Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button to Tailwind #4015

Merged
merged 5 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions docs/src/components/BrandedTile.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { Heading, Stack, Button, mediaQueries as mq } from "@kiwicom/orbit-components";
import { StyledButtonPrimitive } from "@kiwicom/orbit-components/lib/primitives/ButtonPrimitive";
import useTheme from "@kiwicom/orbit-components/lib/hooks/useTheme";
import styled, { css } from "styled-components";

Expand Down Expand Up @@ -40,18 +39,18 @@ const StyledWrapper = styled.a<{ primary: string; type?: "primary" | "secondary"
${boxShadowActive};
}

${StyledButtonPrimitive} {
.orbit-button-primitive {
pointer-events: none;
background: ${getBgColor({ theme, type, color })};
}

&:hover ${StyledButtonPrimitive} {
&:hover .orbit-button-primitive {
background: ${getBgColorHover({ theme, type, color })}
}
&:focus ${StyledButtonPrimitive} {
&:focus .orbit-button-primitive {
background: ${getBgColor({ theme, type, color })}
}
&:active ${StyledButtonPrimitive} {
&:active .orbit-button-primitive {
background: ${getBgColorActive({ theme, type, color })}
}
`};
Expand Down
4 changes: 2 additions & 2 deletions packages/orbit-components/src/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import SPACINGS_AFTER from "../common/getSpacingToken/consts";
import Button from ".";

const getIcons = (name: string, defaultIcon: string) =>
select(name, Object.keys(Icons), defaultIcon);
select(name, ["none", ...Object.keys(Icons)], defaultIcon);

const getIcon = (source: string | null) => (source ? Icons[source] : null);
const getIcon = (source: string) => (source in Icons ? Icons[source] : null);

export default {
title: "Button",
Expand Down
21 changes: 0 additions & 21 deletions packages/orbit-components/src/Button/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,3 @@ export enum SIZE_OPTIONS {
NORMAL = "normal",
LARGE = "large",
}

export enum TOKENS {
// Size tokens
heightButton = "heightButton",
loadingWidth = "loadingWidth",
loadingHeight = "loadingHeight",
fontSizeButton = "fontSizeButton",
paddingButton = "paddingButton",
paddingButtonWithIcons = "paddingButtonWithIcons",
paddingButtonWithLeftIcon = "paddingButtonWithLeftIcon",
paddingButtonWithRightIcon = "paddingButtonWithRightIcon",
// Type tokens
backgroundButton = "backgroundButton",
backgroundButtonHover = "backgroundButtonHover",
backgroundButtonActive = "backgroundButtonActive",
backgroundButtonFocus = "backgroundButtonFocus",
colorTextButton = "colorTextButton",
colorTextButtonHover = "colorTextButtonHover",
colorTextButtonActive = "colorTextButtonActive",
borderColorButtonFocus = "borderColorButtonFocus",
}
49 changes: 0 additions & 49 deletions packages/orbit-components/src/Button/helpers/getButtonBoxShadow.ts

This file was deleted.

This file was deleted.

45 changes: 0 additions & 45 deletions packages/orbit-components/src/Button/helpers/getButtonStyles.ts

This file was deleted.

112 changes: 0 additions & 112 deletions packages/orbit-components/src/Button/helpers/getButtonTypeToken.ts

This file was deleted.

Loading
Loading