beyond-system 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/components/react/Checkbox/index.d.ts +1 -0
  2. package/dist/components/react/Checkbox/index.js +2 -0
  3. package/dist/components/react/Checkbox/index.js.map +1 -0
  4. package/dist/components/react/DefaultButton/DefaultButton.d.ts +12 -0
  5. package/dist/components/react/DefaultButton/DefaultButton.stories.d.ts +7 -0
  6. package/dist/components/react/DefaultButton/index.d.ts +1 -0
  7. package/dist/components/react/DefaultButton/index.js +2 -0
  8. package/dist/components/react/DefaultButton/index.js.map +1 -0
  9. package/dist/components/react/IconButton/IconButton.d.ts +10 -0
  10. package/dist/components/react/IconButton/IconButton.stories.d.ts +7 -0
  11. package/dist/components/react/IconButton/index.d.ts +1 -0
  12. package/dist/components/react/IconButton/index.js +2 -0
  13. package/dist/components/react/IconButton/index.js.map +1 -0
  14. package/dist/components/react/Loader/index.d.ts +3 -0
  15. package/dist/components/react/Loader/index.js +4 -0
  16. package/dist/components/react/Loader/index.js.map +1 -0
  17. package/dist/components/react/OutlineButton/OutlineButton.d.ts +12 -0
  18. package/dist/components/react/OutlineButton/OutlineButton.stories.d.ts +7 -0
  19. package/dist/components/react/OutlineButton/index.d.ts +1 -0
  20. package/dist/components/react/OutlineButton/index.js +2 -0
  21. package/dist/components/react/OutlineButton/index.js.map +1 -0
  22. package/dist/components/react/RadioInput/index.d.ts +1 -0
  23. package/dist/components/react/RadioInput/index.js +2 -0
  24. package/dist/components/react/RadioInput/index.js.map +1 -0
  25. package/dist/components/react/Switch/index.d.ts +1 -0
  26. package/dist/components/react/Switch/index.js +2 -0
  27. package/dist/components/react/Switch/index.js.map +1 -0
  28. package/dist/components/react/TransparentButton/index.d.ts +1 -0
  29. package/dist/components/react/TransparentButton/index.js +2 -0
  30. package/dist/components/react/TransparentButton/index.js.map +1 -0
  31. package/dist/components/react/index.d.ts +8 -0
  32. package/dist/components/react/index.js +9 -0
  33. package/dist/components/react/index.js.map +1 -0
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.js +4 -0
  36. package/dist/index.js.map +1 -0
  37. package/package.json +16 -1
  38. package/.auto-changelog +0 -10
  39. package/.editorconfig +0 -9
  40. package/.eslintrc.js +0 -74
  41. package/.storybook/growth-theme.js +0 -23
  42. package/.storybook/main.js +0 -21
  43. package/.storybook/manager.js +0 -7
  44. package/.storybook/preview-head.html +0 -13
  45. package/.storybook/preview.js +0 -29
  46. package/changelog-template.hbs +0 -19
  47. package/next.config.js +0 -6
  48. package/prettier.config.js +0 -5
  49. package/public/favicon.ico +0 -0
  50. package/public/next.svg +0 -1
  51. package/public/thirteen.svg +0 -1
  52. package/public/vercel.svg +0 -1
  53. package/setup.js +0 -15
  54. package/src/colors/base-colors.ts +0 -75
  55. package/src/colors/gradients.ts +0 -9
  56. package/src/colors/index.ts +0 -3
  57. package/src/colors/shadows.ts +0 -9
  58. package/src/components/react/Checkbox/Checkbox.stories.tsx +0 -59
  59. package/src/components/react/Checkbox/Checkbox.styles.ts +0 -84
  60. package/src/components/react/Checkbox/Checkbox.tsx +0 -33
  61. package/src/components/react/Checkbox/Checkbox.variants.ts +0 -27
  62. package/src/components/react/DefaultButton/DefaultButton.stories.tsx +0 -98
  63. package/src/components/react/DefaultButton/DefaultButton.styles.ts +0 -106
  64. package/src/components/react/DefaultButton/DefaultButton.tsx +0 -67
  65. package/src/components/react/DefaultButton/DefaultButton.variants.ts +0 -49
  66. package/src/components/react/IconButton/IconButton.stories.tsx +0 -71
  67. package/src/components/react/IconButton/IconButton.styles.ts +0 -98
  68. package/src/components/react/IconButton/IconButton.tsx +0 -55
  69. package/src/components/react/IconButton/IconButton.variants.ts +0 -40
  70. package/src/components/react/Loader/Loader.stories.tsx +0 -36
  71. package/src/components/react/Loader/Loader.tsx +0 -40
  72. package/src/components/react/Loader/index.tsx +0 -1
  73. package/src/components/react/OutlineButton/OutlineButton.stories.tsx +0 -98
  74. package/src/components/react/OutlineButton/OutlineButton.styles.ts +0 -97
  75. package/src/components/react/OutlineButton/OutlineButton.tsx +0 -67
  76. package/src/components/react/OutlineButton/OutlineButton.variants.ts +0 -40
  77. package/src/components/react/RadioInput/RadioInput.stories.tsx +0 -53
  78. package/src/components/react/RadioInput/RadioInput.styles.ts +0 -69
  79. package/src/components/react/RadioInput/RadioInput.tsx +0 -23
  80. package/src/components/react/RadioInput/RadioInput.variants.ts +0 -23
  81. package/src/components/react/Switch/Switch.stories.tsx +0 -53
  82. package/src/components/react/Switch/Switch.styles.ts +0 -60
  83. package/src/components/react/Switch/Switch.tsx +0 -28
  84. package/src/components/react/Switch/Switch.variants.ts +0 -19
  85. package/src/components/react/TransparentButton/TransparentButton.stories.tsx +0 -53
  86. package/src/components/react/TransparentButton/TransparentButton.styles.ts +0 -74
  87. package/src/components/react/TransparentButton/TransparentButton.tsx +0 -41
  88. package/src/components/react/TransparentButton/TransparentButton.variants.ts +0 -35
  89. package/src/stories/base-colors/base-colors.stories.styles.ts +0 -65
  90. package/src/stories/base-colors/base-colors.stories.tsx +0 -89
  91. package/src/stories/gradients/gradients.stories.styles.ts +0 -60
  92. package/src/stories/gradients/gradients.stories.tsx +0 -39
  93. package/src/stories/shadows/shadows.stories.styles.ts +0 -59
  94. package/src/stories/shadows/shadows.stories.tsx +0 -37
  95. package/src/web/border.ts +0 -13
  96. package/src/web/font.ts +0 -38
  97. package/src/web/index.ts +0 -2
  98. package/tsconfig.json +0 -24
  99. package/vercel.json +0 -8
@@ -1,59 +0,0 @@
1
- import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
3
-
4
- import CheckboxComponent from './Checkbox'
5
- import { DEFAULT_CHECKBOX_VARIANTS } from './Checkbox.variants'
6
-
7
- type Props = React.ComponentProps<typeof CheckboxComponent>
8
-
9
- export const Checkbox = (props: Props) => {
10
- return <CheckboxComponent {...props} />
11
- }
12
-
13
- export default {
14
- title: 'Inputs/Checkbox',
15
- parameters: {
16
- component: Checkbox,
17
- },
18
- args: {
19
- variant: 'primary',
20
- size: 'MD',
21
- checked: false,
22
- disabled: false,
23
- error: false,
24
- },
25
- argTypes: {
26
- variant: {
27
- control: {
28
- type: 'select',
29
- options: Object.keys(DEFAULT_CHECKBOX_VARIANTS.color),
30
- },
31
- },
32
- size: {
33
- control: {
34
- type: 'select',
35
- options: Object.keys(DEFAULT_CHECKBOX_VARIANTS.size),
36
- },
37
- },
38
- checked: {
39
- control: {
40
- type: 'boolean',
41
- },
42
- },
43
- disabled: {
44
- control: {
45
- type: 'boolean',
46
- },
47
- },
48
- error: {
49
- control: {
50
- type: 'boolean',
51
- },
52
- },
53
- onCheckedChange: {
54
- control: {
55
- action: 'changed',
56
- },
57
- },
58
- },
59
- } as Meta
@@ -1,84 +0,0 @@
1
- import styled from 'styled-components'
2
-
3
- import * as RadixCheckbox from '@radix-ui/react-checkbox'
4
-
5
- import { COLORS } from '@/colors'
6
-
7
- export type StyledCheckboxProps = {
8
- indicatorColor: string
9
- indicatorHoverColor: string
10
- indicatorActiveColor: string
11
- boxColor: string
12
- boxHoverColor: string
13
- boxActiveColor: string
14
- boxActiveHoverColor: string
15
- borderColor: string
16
- borderHoverColor: string
17
- borderActiveColor: string
18
- borderActiveHoverColor: string
19
- error?: boolean
20
- width: string
21
- }
22
-
23
- export const CheckboxContainer = styled(
24
- RadixCheckbox.Root
25
- )<StyledCheckboxProps>`
26
- all: unset;
27
- display: flex;
28
- align-items: center;
29
- justify-content: center;
30
-
31
- transition: 0.1s ease-in-out;
32
- width: ${(props) => props.width};
33
- aspect-ratio: 1/1;
34
-
35
- background-color: ${(props) => props.boxColor};
36
- border: 1px solid ${(props) => props.borderColor};
37
- border-radius: 3px;
38
-
39
- outline: ${(props) =>
40
- props.error ? `2px solid ${COLORS.ALERT_MID}` : 'none'};
41
-
42
- :hover {
43
- cursor: pointer;
44
- background-color: ${(props) => props.boxHoverColor};
45
- border-color: ${(props) => props.borderHoverColor};
46
- }
47
-
48
- &[data-state='checked'] {
49
- background-color: ${(props) => props.boxActiveColor};
50
- border-color: ${(props) => props.borderActiveColor};
51
-
52
- :hover {
53
- background-color: ${(props) => props.boxActiveHoverColor};
54
- border-color: ${(props) => props.borderActiveHoverColor};
55
- }
56
- }
57
-
58
- :disabled {
59
- background-color: ${COLORS.NEUTRAL_MID};
60
- border-color: ${COLORS.NEUTRAL_MID};
61
-
62
- pointer-events: none;
63
- }
64
- `
65
-
66
- export const CheckboxIndicator = styled(
67
- RadixCheckbox.Indicator
68
- )<StyledCheckboxProps>`
69
- display: flex;
70
- align-items: center;
71
- justify-content: center;
72
-
73
- aspect-ratio: 1/1;
74
-
75
- * {
76
- font-size: calc(${(props) => props.width} * 0.75);
77
-
78
- color: ${(props) => props.indicatorColor};
79
-
80
- &[data-state='checked'] {
81
- color: ${(props) => props.indicatorActiveColor};
82
- }
83
- }
84
- `
@@ -1,33 +0,0 @@
1
- import React from 'react'
2
- import { MdOutlineCheck } from 'react-icons/md'
3
- import * as RadixCheckbox from '@radix-ui/react-checkbox'
4
-
5
- import { DEFAULT_CHECKBOX_VARIANTS } from './Checkbox.variants'
6
- import { CheckboxContainer, CheckboxIndicator } from './Checkbox.styles'
7
-
8
- type RootCheckboxProps = React.ComponentProps<typeof RadixCheckbox.Root>
9
- type CheckboxProps = {
10
- variant?: keyof typeof DEFAULT_CHECKBOX_VARIANTS.color
11
- size?: keyof typeof DEFAULT_CHECKBOX_VARIANTS.size
12
- error?: boolean
13
- } & RootCheckboxProps
14
-
15
- const Checkbox = ({
16
- variant = 'primary',
17
- size = 'MD',
18
- error = false,
19
- ...props
20
- }: CheckboxProps) => {
21
- const colorProps = DEFAULT_CHECKBOX_VARIANTS.color[variant]
22
- const sizeProps = DEFAULT_CHECKBOX_VARIANTS.size[size]
23
-
24
- return (
25
- <CheckboxContainer {...props} {...colorProps} {...sizeProps} error={error}>
26
- <CheckboxIndicator {...colorProps} {...sizeProps}>
27
- <MdOutlineCheck />
28
- </CheckboxIndicator>
29
- </CheckboxContainer>
30
- )
31
- }
32
-
33
- export default Checkbox
@@ -1,27 +0,0 @@
1
- import { COLORS } from '@/colors'
2
-
3
- export const DEFAULT_CHECKBOX_VARIANTS = {
4
- color: {
5
- primary: {
6
- indicatorColor: COLORS.NEUTRAL_HIGH,
7
- indicatorHoverColor: COLORS.GROWTH_MID,
8
- indicatorActiveColor: COLORS.GROWTH_MID,
9
- boxColor: COLORS.NEUTRAL_HIGH,
10
- boxHoverColor: COLORS.NEUTRAL_LIGHT,
11
- boxActiveColor: COLORS.INFO_MID,
12
- boxActiveHoverColor: COLORS.INFO_DARK,
13
- borderColor: COLORS.NEUTRAL_DARK,
14
- borderHoverColor: COLORS.NEUTRAL_DARK,
15
- borderActiveColor: COLORS.INFO_MID,
16
- borderActiveHoverColor: COLORS.INFO_DARK,
17
- },
18
- },
19
- size: {
20
- SM: {
21
- width: '12px',
22
- },
23
- MD: {
24
- width: '15px',
25
- },
26
- },
27
- }
@@ -1,98 +0,0 @@
1
- import React from 'react'
2
- import styled from 'styled-components'
3
- import { Meta } from '@storybook/react/types-6-0'
4
- import { MdCheck } from 'react-icons/md'
5
-
6
- import ButtonComponent from './DefaultButton'
7
- import { DEFAULT_BUTTON_VARIANTS } from './DefaultButton.variants'
8
-
9
- type Props = React.ComponentProps<typeof ButtonComponent>
10
-
11
- const Container = styled.div`
12
- display: flex;
13
- flex-direction: column;
14
- align-items: flex-start;
15
- gap: 1rem;
16
- `
17
-
18
- export const DefaultButton = (props: Props) => {
19
- return (
20
- <Container>
21
- <ButtonComponent {...props} />
22
- <ButtonComponent {...props} leftIcon={<MdCheck />} />
23
- <ButtonComponent {...props} rightIcon={<MdCheck />} />
24
- <ButtonComponent
25
- {...props}
26
- leftIcon={<MdCheck />}
27
- rightIcon={<MdCheck />}
28
- />
29
- </Container>
30
- )
31
- }
32
-
33
- export default {
34
- title: 'Buttons/DefaultButton',
35
- parameters: {
36
- component: DefaultButton,
37
- },
38
- args: {
39
- text: 'Button',
40
- variant: 'primary',
41
- size: 'MD',
42
- shape: 'square',
43
- fullWidth: false,
44
- disabled: false,
45
- loading: false,
46
- },
47
- argTypes: {
48
- text: {
49
- control: {
50
- type: 'text',
51
- },
52
- },
53
- leftIcon: {
54
- control: {},
55
- },
56
- rightIcon: {
57
- control: {},
58
- },
59
- variant: {
60
- control: {
61
- type: 'select',
62
- options: Object.keys(DEFAULT_BUTTON_VARIANTS.color),
63
- },
64
- },
65
- size: {
66
- control: {
67
- type: 'select',
68
- options: Object.keys(DEFAULT_BUTTON_VARIANTS.size),
69
- },
70
- },
71
- shape: {
72
- control: {
73
- type: 'select',
74
- options: Object.keys(DEFAULT_BUTTON_VARIANTS.shape),
75
- },
76
- },
77
- loading: {
78
- control: {
79
- type: 'boolean',
80
- },
81
- },
82
- fullWidth: {
83
- control: {
84
- type: 'boolean',
85
- },
86
- },
87
- disabled: {
88
- control: {
89
- type: 'boolean',
90
- },
91
- },
92
- onClick: {
93
- control: {
94
- action: 'clicked',
95
- },
96
- },
97
- },
98
- } as Meta
@@ -1,106 +0,0 @@
1
- import styled from 'styled-components'
2
- import { COLORS, SHADOWS } from '@/colors'
3
-
4
- type StyledButtonProps = {
5
- padding: string
6
- color: string
7
- backgroundColor: string
8
- borderRadius: string
9
- borderColor: string
10
- fontSize: string
11
- gap: string
12
- hoverBackgroundColor: string
13
- activeBackgroundColor: string
14
- fullWidth: boolean
15
- loading: boolean
16
- }
17
-
18
- export const StyledButtonContainer = styled.button<StyledButtonProps>`
19
- all: unset;
20
- position: relative;
21
-
22
- display: flex;
23
- flex-direction: row;
24
-
25
- align-items: center;
26
- justify-content: center;
27
-
28
- width: ${(props) => (props.fullWidth ? '100%' : 'auto')};
29
-
30
- transition: 0.05s ease-in-out;
31
-
32
- padding: ${(props) => props.padding};
33
- gap: ${(props) => props.gap};
34
-
35
- color: ${(props) => props.color};
36
- font-size: ${(props) => props.fontSize};
37
- font-weight: 600;
38
-
39
- .default-btn-icon {
40
- display: flex;
41
- align-items: center;
42
- font-size: ${(props) => props.fontSize};
43
- opacity: ${(props) => (props.loading ? 0 : 1)};
44
-
45
- * {
46
- color: ${(props) => props.color};
47
- font-size: ${(props) => props.fontSize};
48
- font-weight: 600;
49
- }
50
- }
51
-
52
- .default-btn-text {
53
- opacity: ${(props) => (props.loading ? 0 : 1)};
54
- }
55
-
56
- .default-btn-loader {
57
- position: absolute;
58
- display: flex;
59
- align-items: center;
60
- justify-content: center;
61
- height: 100%;
62
- width: 100%;
63
- }
64
-
65
- background-color: ${(props) => props.backgroundColor};
66
- border: 1px solid ${(props) => props.borderColor};
67
- border-radius: ${(props) => props.borderRadius};
68
-
69
- padding: ${(props) => props.padding};
70
-
71
- pointer-events: ${(props) => (props.loading ? 'none' : 'auto')};
72
-
73
- :hover {
74
- cursor: pointer;
75
- background-color: ${(props) => props.hoverBackgroundColor};
76
- transform: scale(1.01);
77
- box-shadow: ${SHADOWS.HOVER};
78
- }
79
-
80
- :active {
81
- transform: scale(0.98);
82
- background-color: ${(props) => props.activeBackgroundColor};
83
- box-shadow: none;
84
- }
85
-
86
- :disabled {
87
- color: ${COLORS.NEUTRAL_LIGHT};
88
- border-color: ${COLORS.NEUTRAL_LIGHT};
89
- background-color: ${COLORS.NEUTRAL_LIGHTER};
90
-
91
- * {
92
- color: ${COLORS.NEUTRAL_LIGHT};
93
- }
94
-
95
- :hover {
96
- cursor: default;
97
- transform: scale(1);
98
- box-shadow: none;
99
- }
100
-
101
- :active {
102
- transform: scale(1);
103
- box-shadow: none;
104
- }
105
- }
106
- `
@@ -1,67 +0,0 @@
1
- import React, { forwardRef } from 'react'
2
-
3
- import { COLORS } from '@/colors'
4
- import { Loader } from '@/components/react/Loader'
5
-
6
- import { DEFAULT_BUTTON_VARIANTS } from './DefaultButton.variants'
7
- import { StyledButtonContainer } from './DefaultButton.styles'
8
-
9
- type DefaultButtonProps = {
10
- text: string
11
- variant?: keyof typeof DEFAULT_BUTTON_VARIANTS.color
12
- size?: keyof typeof DEFAULT_BUTTON_VARIANTS.size
13
- shape?: keyof typeof DEFAULT_BUTTON_VARIANTS.shape
14
- leftIcon?: React.ReactNode
15
- rightIcon?: React.ReactNode
16
- fullWidth?: boolean
17
- loading?: boolean
18
- } & React.ButtonHTMLAttributes<HTMLButtonElement>
19
-
20
- const DefaultButton = forwardRef<HTMLButtonElement, DefaultButtonProps>(
21
- (
22
- {
23
- text,
24
- variant = 'primary',
25
- size = 'MD',
26
- shape = 'square',
27
- fullWidth = false,
28
- leftIcon: LeftIcon,
29
- rightIcon: RightIcon,
30
- loading = false,
31
- ...props
32
- }: DefaultButtonProps,
33
- ref: any
34
- ) => {
35
- const colorProps = DEFAULT_BUTTON_VARIANTS.color[variant]
36
- const sizeProps = DEFAULT_BUTTON_VARIANTS.size[size]
37
- const shapeProps = DEFAULT_BUTTON_VARIANTS.shape[shape]
38
-
39
- const loaderColor = colorProps.color as keyof typeof COLORS
40
-
41
- return (
42
- <StyledButtonContainer
43
- type="button"
44
- {...props}
45
- {...colorProps}
46
- {...sizeProps}
47
- {...shapeProps}
48
- fullWidth={fullWidth}
49
- loading={loading}
50
- ref={ref}
51
- >
52
- {loading && (
53
- <span className="default-btn-loader">
54
- <Loader size={size} color={loaderColor} />
55
- </span>
56
- )}
57
- {LeftIcon && <span className="default-btn-icon">{LeftIcon}</span>}
58
- <span className="default-btn-text">{text}</span>
59
- {RightIcon && <span className="default-btn-icon">{RightIcon}</span>}
60
- </StyledButtonContainer>
61
- )
62
- }
63
- )
64
-
65
- DefaultButton.displayName = 'DefaultButton'
66
-
67
- export default DefaultButton
@@ -1,49 +0,0 @@
1
- import { COLORS } from '@/colors'
2
- import { FONT, BORDER } from '@/web'
3
-
4
- export const DEFAULT_BUTTON_VARIANTS = {
5
- color: {
6
- primary: {
7
- color: COLORS.NEUTRAL_LIGHTER,
8
- borderColor: COLORS.GROWTH_MID,
9
- backgroundColor: COLORS.GROWTH_MID,
10
- hoverBackgroundColor: COLORS.GROWTH_DARK,
11
- activeBackgroundColor: COLORS.GROWTH_LIGHT,
12
- },
13
- light: {
14
- color: COLORS.GROWTH_MID,
15
- borderColor: COLORS.GROWTH_MID,
16
- backgroundColor: COLORS.NEUTRAL_HIGH,
17
- hoverBackgroundColor: COLORS.NEUTRAL_HIGH,
18
- activeBackgroundColor: COLORS.NEUTRAL_LIGHTER,
19
- },
20
- dark: {
21
- color: COLORS.NEUTRAL_LIGHTER,
22
- borderColor: COLORS.NEUTRAL_DARKER,
23
- backgroundColor: COLORS.NEUTRAL_DARKER,
24
- hoverBackgroundColor: COLORS.NEUTRAL_DARKER,
25
- activeBackgroundColor: COLORS.NEUTRAL_LOW,
26
- },
27
- },
28
- size: {
29
- SM: {
30
- fontSize: FONT.SIZE.SM,
31
- padding: '5px 6px',
32
- gap: '6px',
33
- },
34
- MD: {
35
- fontSize: FONT.SIZE.MD,
36
- padding: '6px 10px',
37
- gap: '8px',
38
- },
39
- },
40
-
41
- shape: {
42
- square: {
43
- borderRadius: BORDER.RADIUS.MD,
44
- },
45
- round: {
46
- borderRadius: '55px',
47
- },
48
- },
49
- }
@@ -1,71 +0,0 @@
1
- import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
3
- import { MdCheck } from 'react-icons/md'
4
-
5
- import ButtonComponent from './IconButton'
6
- import { ICON_BUTTON_VARIANTS } from './IconButton.variants'
7
-
8
- type Props = React.ComponentProps<typeof ButtonComponent>
9
-
10
- export const IconButton = (props: Props) => {
11
- return (
12
- <ButtonComponent {...props}>
13
- <MdCheck />
14
- </ButtonComponent>
15
- )
16
- }
17
-
18
- export default {
19
- title: 'Buttons/IconButton',
20
- parameters: {
21
- component: IconButton,
22
- },
23
- args: {
24
- children: 'Button',
25
- variant: 'primary',
26
- size: 'MD',
27
- shape: 'square',
28
- disabled: false,
29
- loading: false,
30
- },
31
- argTypes: {
32
- children: {
33
- control: {
34
- type: 'text',
35
- },
36
- },
37
- variant: {
38
- control: {
39
- type: 'select',
40
- options: Object.keys(ICON_BUTTON_VARIANTS.color),
41
- },
42
- },
43
- size: {
44
- control: {
45
- type: 'select',
46
- options: Object.keys(ICON_BUTTON_VARIANTS.size),
47
- },
48
- },
49
- shape: {
50
- control: {
51
- type: 'select',
52
- options: Object.keys(ICON_BUTTON_VARIANTS.shape),
53
- },
54
- },
55
- loading: {
56
- control: {
57
- type: 'boolean',
58
- },
59
- },
60
- disabled: {
61
- control: {
62
- type: 'boolean',
63
- },
64
- },
65
- onClick: {
66
- control: {
67
- action: 'clicked',
68
- },
69
- },
70
- },
71
- } as Meta
@@ -1,98 +0,0 @@
1
- import styled from 'styled-components'
2
- import { COLORS, SHADOWS } from '@/colors'
3
-
4
- type StyledButtonProps = {
5
- padding: string
6
- color: string
7
- backgroundColor: string
8
- borderRadius: string
9
- borderColor: string
10
- fontSize: string
11
- hoverBackgroundColor: string
12
- activeBackgroundColor: string
13
- loading: boolean
14
- }
15
-
16
- export const StyledButtonContainer = styled.button<StyledButtonProps>`
17
- all: unset;
18
- position: relative;
19
-
20
- display: flex;
21
- flex-direction: row;
22
-
23
- align-items: center;
24
- justify-content: center;
25
-
26
- aspect-ratio: 1/1;
27
-
28
- transition: 0.05s ease-in-out;
29
-
30
- padding: ${(props) => props.padding};
31
-
32
- color: ${(props) => props.color};
33
- font-size: ${(props) => props.fontSize};
34
-
35
- * {
36
- color: ${(props) => props.color};
37
- font-size: ${(props) => props.fontSize};
38
- font-weight: 600;
39
- }
40
-
41
- background-color: ${(props) => props.backgroundColor};
42
- border: 1px solid ${(props) => props.borderColor};
43
- border-radius: ${(props) => props.borderRadius};
44
-
45
- padding: ${(props) => props.padding};
46
-
47
- pointer-events: ${(props) => (props.loading ? 'none' : 'auto')};
48
-
49
- .icon-btn-loader {
50
- opacity: ${(props) => (props.loading ? 1 : 0)};
51
- }
52
-
53
- .icon-btn-content {
54
- position: absolute;
55
-
56
- display: flex;
57
- align-items: center;
58
- justify-content: center;
59
- height: 100%;
60
- width: 100%;
61
-
62
- opacity: ${(props) => (props.loading ? 0 : 1)};
63
- }
64
-
65
- :hover {
66
- cursor: pointer;
67
- background-color: ${(props) => props.hoverBackgroundColor};
68
- transform: scale(1.01);
69
- box-shadow: ${SHADOWS.HOVER};
70
- }
71
-
72
- :active {
73
- transform: scale(0.98);
74
- background-color: ${(props) => props.activeBackgroundColor};
75
- box-shadow: none;
76
- }
77
-
78
- :disabled {
79
- color: ${COLORS.NEUTRAL_LIGHT};
80
- border-color: ${COLORS.NEUTRAL_LIGHT};
81
- background-color: ${COLORS.NEUTRAL_LIGHTER};
82
-
83
- * {
84
- color: ${COLORS.NEUTRAL_LIGHT};
85
- }
86
-
87
- :hover {
88
- cursor: default;
89
- transform: scale(1);
90
- box-shadow: none;
91
- }
92
-
93
- :active {
94
- transform: scale(1);
95
- box-shadow: none;
96
- }
97
- }
98
- `