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,55 +0,0 @@
1
- import React, { forwardRef } from 'react'
2
-
3
- import { COLORS } from '@/colors'
4
- import { Loader } from '@/components/react/Loader'
5
-
6
- import { ICON_BUTTON_VARIANTS } from './IconButton.variants'
7
- import { StyledButtonContainer } from './IconButton.styles'
8
-
9
- type IconButtonProps = {
10
- children: React.ReactNode
11
- variant?: keyof typeof ICON_BUTTON_VARIANTS.color
12
- size?: keyof typeof ICON_BUTTON_VARIANTS.size
13
- shape?: keyof typeof ICON_BUTTON_VARIANTS.shape
14
- fullWidth?: boolean
15
- loading?: boolean
16
- } & React.ButtonHTMLAttributes<HTMLButtonElement>
17
-
18
- const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
19
- (
20
- {
21
- children,
22
- variant = 'primary',
23
- size = 'MD',
24
- shape = 'square',
25
- loading = false,
26
- ...props
27
- }: IconButtonProps,
28
- ref: any
29
- ) => {
30
- const colorProps = ICON_BUTTON_VARIANTS.color[variant]
31
- const sizeProps = ICON_BUTTON_VARIANTS.size[size]
32
- const shapeProps = ICON_BUTTON_VARIANTS.shape[shape]
33
-
34
- const loaderColor = colorProps.color as keyof typeof COLORS
35
-
36
- return (
37
- <StyledButtonContainer
38
- type="button"
39
- {...props}
40
- {...colorProps}
41
- {...sizeProps}
42
- {...shapeProps}
43
- loading={loading}
44
- ref={ref}
45
- >
46
- <Loader size={size} color={loaderColor} className="icon-btn-loader" />
47
- <div className="icon-btn-content">{children}</div>
48
- </StyledButtonContainer>
49
- )
50
- }
51
- )
52
-
53
- IconButton.displayName = 'IconButton'
54
-
55
- export default IconButton
@@ -1,40 +0,0 @@
1
- import { COLORS } from '@/colors'
2
- import { FONT, BORDER } from '@/web'
3
-
4
- export const ICON_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_LIGHTER,
18
- activeBackgroundColor: COLORS.NEUTRAL_LIGHTER,
19
- },
20
- },
21
- size: {
22
- SM: {
23
- fontSize: FONT.SIZE.LG,
24
- padding: '4px',
25
- },
26
- MD: {
27
- fontSize: FONT.SIZE.XL,
28
- padding: '6px',
29
- },
30
- },
31
-
32
- shape: {
33
- square: {
34
- borderRadius: BORDER.RADIUS.MD,
35
- },
36
- round: {
37
- borderRadius: '50%',
38
- },
39
- },
40
- }
@@ -1,36 +0,0 @@
1
- import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
3
-
4
- import { Loader as LoaderComponent } from './Loader'
5
- import { COLORS } from '@/colors'
6
-
7
- type Props = React.ComponentProps<typeof LoaderComponent>
8
-
9
- export const Loader = (props: Props) => {
10
- return <LoaderComponent {...props} />
11
- }
12
-
13
- export default {
14
- title: 'Fundation/Loader',
15
- parameters: {
16
- component: Loader,
17
- },
18
- args: {
19
- color: 'GROWTH_MID',
20
- size: 'MD',
21
- },
22
- argTypes: {
23
- color: {
24
- control: {
25
- type: 'select',
26
- options: Object.keys(COLORS),
27
- },
28
- },
29
- size: {
30
- control: {
31
- type: 'select',
32
- options: ['SM', 'MD'],
33
- },
34
- },
35
- },
36
- } as Meta
@@ -1,40 +0,0 @@
1
- import styled from 'styled-components'
2
- import { COLORS } from '@/colors'
3
-
4
- const LOADER_SIZES = {
5
- SM: '14px',
6
- MD: '20px',
7
- }
8
-
9
- const LOADER_BORDER_WIDTH = {
10
- SM: '2px',
11
- MD: '3px',
12
- }
13
-
14
- type LoaderProps = {
15
- size?: keyof typeof LOADER_SIZES
16
- color?: keyof typeof COLORS
17
- }
18
-
19
- export const Loader = styled.span<LoaderProps>`
20
- width: ${({ size }) => LOADER_SIZES[size || 'MD']};
21
- height: ${({ size }) => LOADER_SIZES[size || 'MD']};
22
- border: ${({ size }) => LOADER_BORDER_WIDTH[size || 'MD']} solid
23
- ${({ color }) => COLORS[color || 'NEUTRAL_HIGH']};
24
-
25
- border-bottom-color: transparent;
26
- border-radius: 50%;
27
-
28
- display: inline-block;
29
- box-sizing: border-box;
30
- animation: rotation 1s linear infinite;
31
-
32
- @keyframes rotation {
33
- 0% {
34
- transform: rotate(0deg);
35
- }
36
- 100% {
37
- transform: rotate(360deg);
38
- }
39
- }
40
- `
@@ -1 +0,0 @@
1
- export * from './Loader'
@@ -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 './OutlineButton'
7
- import { OUTLINE_BUTTON_VARIANTS } from './OutlineButton.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 OutlineButton = (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/OutlineButton',
35
- parameters: {
36
- component: OutlineButton,
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(OUTLINE_BUTTON_VARIANTS.color),
63
- },
64
- },
65
- size: {
66
- control: {
67
- type: 'select',
68
- options: Object.keys(OUTLINE_BUTTON_VARIANTS.size),
69
- },
70
- },
71
- shape: {
72
- control: {
73
- type: 'select',
74
- options: Object.keys(OUTLINE_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,97 +0,0 @@
1
- import styled from 'styled-components'
2
- import { COLORS } from '@/colors'
3
-
4
- type StyledButtonProps = {
5
- padding: string
6
- color: string
7
- borderRadius: string
8
- borderColor: string
9
- fontSize: string
10
- gap: string
11
- fullWidth: boolean
12
- loading: boolean
13
- }
14
-
15
- export const StyledButtonContainer = styled.button<StyledButtonProps>`
16
- all: unset;
17
- position: relative;
18
-
19
- display: flex;
20
- flex-direction: row;
21
-
22
- align-items: center;
23
- justify-content: center;
24
-
25
- width: ${(props) => (props.fullWidth ? '100%' : 'auto')};
26
-
27
- transition: 0.05s ease-in-out;
28
-
29
- padding: ${(props) => props.padding};
30
- gap: ${(props) => props.gap};
31
-
32
- color: ${(props) => props.color};
33
- font-size: ${(props) => props.fontSize};
34
- font-weight: 600;
35
-
36
- .default-btn-icon {
37
- display: flex;
38
- align-items: center;
39
- font-size: ${(props) => props.fontSize};
40
- opacity: ${(props) => (props.loading ? 0 : 1)};
41
-
42
- * {
43
- color: ${(props) => props.color};
44
- font-size: ${(props) => props.fontSize};
45
- font-weight: 600;
46
- }
47
- }
48
-
49
- .default-btn-text {
50
- opacity: ${(props) => (props.loading ? 0 : 1)};
51
- }
52
-
53
- .default-btn-loader {
54
- position: absolute;
55
- display: flex;
56
- align-items: center;
57
- justify-content: center;
58
- height: 100%;
59
- width: 100%;
60
- }
61
-
62
- background-color: transparent;
63
- border: 1px solid ${(props) => props.borderColor};
64
- border-radius: ${(props) => props.borderRadius};
65
-
66
- padding: ${(props) => props.padding};
67
-
68
- pointer-events: ${(props) => (props.loading ? 'none' : 'auto')};
69
-
70
- :hover {
71
- cursor: pointer;
72
- transform: scale(1.01);
73
- }
74
-
75
- :active {
76
- transform: scale(0.98);
77
- }
78
-
79
- :disabled {
80
- color: ${COLORS.NEUTRAL_LIGHT};
81
- border-color: ${COLORS.NEUTRAL_LIGHT};
82
- background-color: ${COLORS.NEUTRAL_HIGH};
83
-
84
- * {
85
- color: ${COLORS.NEUTRAL_LIGHT};
86
- }
87
-
88
- :hover {
89
- cursor: default;
90
- transform: scale(1);
91
- }
92
-
93
- :active {
94
- transform: scale(1);
95
- }
96
- }
97
- `
@@ -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 { StyledButtonContainer } from './OutlineButton.styles'
7
- import { OUTLINE_BUTTON_VARIANTS } from './OutlineButton.variants'
8
-
9
- type OutlineButtonProps = {
10
- text: string
11
- variant?: keyof typeof OUTLINE_BUTTON_VARIANTS.color
12
- size?: keyof typeof OUTLINE_BUTTON_VARIANTS.size
13
- shape?: keyof typeof OUTLINE_BUTTON_VARIANTS.shape
14
- leftIcon?: React.ReactNode
15
- rightIcon?: React.ReactNode
16
- fullWidth?: boolean
17
- loading?: boolean
18
- } & React.ButtonHTMLAttributes<HTMLButtonElement>
19
-
20
- const OutlineButton = forwardRef<HTMLButtonElement, OutlineButtonProps>(
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
- }: OutlineButtonProps,
33
- ref: any
34
- ) => {
35
- const colorProps = OUTLINE_BUTTON_VARIANTS.color[variant]
36
- const sizeProps = OUTLINE_BUTTON_VARIANTS.size[size]
37
- const shapeProps = OUTLINE_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
- OutlineButton.displayName = 'OutlineButton'
66
-
67
- export default OutlineButton
@@ -1,40 +0,0 @@
1
- import { COLORS } from '@/colors'
2
- import { FONT, BORDER } from '@/web'
3
-
4
- export const OUTLINE_BUTTON_VARIANTS = {
5
- color: {
6
- primary: {
7
- color: COLORS.GROWTH_MID,
8
- borderColor: COLORS.GROWTH_MID,
9
- },
10
- light: {
11
- color: COLORS.NEUTRAL_LIGHTER,
12
- borderColor: COLORS.NEUTRAL_LIGHTER,
13
- },
14
- dark: {
15
- color: COLORS.NEUTRAL_DARKER,
16
- borderColor: COLORS.NEUTRAL_DARKER,
17
- },
18
- },
19
- size: {
20
- SM: {
21
- fontSize: FONT.SIZE.SM,
22
- padding: '5px 6px',
23
- gap: '6px',
24
- },
25
- MD: {
26
- fontSize: FONT.SIZE.MD,
27
- padding: '6px 10px',
28
- gap: '8px',
29
- },
30
- },
31
-
32
- shape: {
33
- square: {
34
- borderRadius: BORDER.RADIUS.MD,
35
- },
36
- round: {
37
- borderRadius: '55px',
38
- },
39
- },
40
- }
@@ -1,53 +0,0 @@
1
- import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
3
-
4
- import RadioInputComponent from './RadioInput'
5
- import { DEFAULT_RADIO_VARIANTS } from './RadioInput.variants'
6
-
7
- type Props = React.ComponentProps<typeof RadioInputComponent>
8
-
9
- export const RadioInput = (props: Props) => {
10
- return <RadioInputComponent {...props} />
11
- }
12
-
13
- export default {
14
- title: 'Inputs/RadioInput',
15
- parameters: {
16
- component: RadioInput,
17
- },
18
- args: {
19
- variant: 'primary',
20
- size: 'MD',
21
- checked: false,
22
- disabled: false,
23
- },
24
- argTypes: {
25
- variant: {
26
- control: {
27
- type: 'select',
28
- options: Object.keys(DEFAULT_RADIO_VARIANTS.color),
29
- },
30
- },
31
- size: {
32
- control: {
33
- type: 'select',
34
- options: Object.keys(DEFAULT_RADIO_VARIANTS.size),
35
- },
36
- },
37
- checked: {
38
- control: {
39
- type: 'boolean',
40
- },
41
- },
42
- disabled: {
43
- control: {
44
- type: 'boolean',
45
- },
46
- },
47
- onCheckedChange: {
48
- control: {
49
- action: 'changed',
50
- },
51
- },
52
- },
53
- } as Meta
@@ -1,69 +0,0 @@
1
- import styled from 'styled-components'
2
-
3
- import { COLORS } from '@/colors'
4
-
5
- export type StyledRadioInput = {
6
- indicatorColor: string
7
- indicatorHoverColor: string
8
- boxColor: string
9
- boxHoverColor: string
10
- boxActiveColor: string
11
- boxActiveHoverColor: string
12
- borderColor: string
13
- borderHoverColor: string
14
- borderActiveColor: string
15
- borderActiveHoverColor: string
16
- width: string
17
- }
18
-
19
- export const StyledRadioInput = styled.input.attrs({
20
- type: 'radio',
21
- })<StyledRadioInput>`
22
- transition: 0.1s ease-in-out;
23
- width: ${(props) => props.width};
24
- aspect-ratio: 1/1;
25
- appearance: none;
26
- -webkit-appearance: none;
27
-
28
- border-radius: 50%;
29
- border: 1px solid ${(props) => props.borderColor};
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
-
34
- :hover {
35
- cursor: pointer;
36
- background-color: ${(props) => props.boxHoverColor};
37
- border-color: ${(props) => props.borderHoverColor};
38
- }
39
-
40
- :checked {
41
- background-color: ${(props) => props.boxActiveColor};
42
- border-color: ${(props) => props.borderActiveColor};
43
-
44
- :hover {
45
- background-color: ${(props) => props.boxActiveHoverColor};
46
- border-color: ${(props) => props.borderActiveHoverColor};
47
- }
48
-
49
- :after {
50
- content: '';
51
- width: 100%;
52
- aspect-ratio: 1/1;
53
- border-radius: 50%;
54
- border: 3px solid ${(props) => props.boxActiveColor};
55
- background-color: ${(props) => props.indicatorColor};
56
- }
57
-
58
- :hover:after {
59
- background-color: ${(props) => props.indicatorHoverColor};
60
- }
61
- }
62
-
63
- :disabled {
64
- background-color: ${COLORS.NEUTRAL_LIGHT};
65
- border-color: ${COLORS.NEUTRAL_MID};
66
-
67
- pointer-events: none;
68
- }
69
- `
@@ -1,23 +0,0 @@
1
- import React from 'react'
2
-
3
- import { DEFAULT_RADIO_VARIANTS } from './RadioInput.variants'
4
- import { StyledRadioInput } from './RadioInput.styles'
5
-
6
- type RadioInputProps = {
7
- variant?: keyof typeof DEFAULT_RADIO_VARIANTS.color
8
- size?: keyof typeof DEFAULT_RADIO_VARIANTS.size
9
- } & React.InputHTMLAttributes<HTMLInputElement>
10
-
11
- const RadioInput = ({
12
- variant = 'primary',
13
- size = 'MD',
14
- error = false,
15
- ...props
16
- }: RadioInputProps) => {
17
- const colorProps = DEFAULT_RADIO_VARIANTS.color[variant]
18
- const sizeProps = DEFAULT_RADIO_VARIANTS.size[size]
19
-
20
- return <StyledRadioInput {...props} {...colorProps} {...sizeProps} />
21
- }
22
-
23
- export default RadioInput
@@ -1,23 +0,0 @@
1
- import { COLORS } from '@/colors'
2
-
3
- export const DEFAULT_RADIO_VARIANTS = {
4
- color: {
5
- primary: {
6
- indicatorColor: COLORS.GROWTH_MID,
7
- indicatorHoverColor: COLORS.GROWTH_DARK,
8
- boxColor: COLORS.NEUTRAL_HIGH,
9
- boxHoverColor: COLORS.NEUTRAL_LIGHT,
10
- boxActiveColor: COLORS.NEUTRAL_HIGH,
11
- boxActiveHoverColor: COLORS.NEUTRAL_HIGH,
12
- borderColor: COLORS.NEUTRAL_DARK,
13
- borderHoverColor: COLORS.NEUTRAL_DARK,
14
- borderActiveColor: COLORS.NEUTRAL_DARK,
15
- borderActiveHoverColor: COLORS.NEUTRAL_DARK,
16
- },
17
- },
18
- size: {
19
- MD: {
20
- width: '15px',
21
- },
22
- },
23
- }
@@ -1,53 +0,0 @@
1
- import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
3
-
4
- import SwitchComponent from './Switch'
5
- import { DEFAULT_SWITCH_VARIANTS } from './Switch.variants'
6
-
7
- type Props = React.ComponentProps<typeof SwitchComponent>
8
-
9
- export const Switch = (props: Props) => {
10
- return <SwitchComponent {...props} />
11
- }
12
-
13
- export default {
14
- title: 'Inputs/Switch',
15
- parameters: {
16
- component: Switch,
17
- },
18
- args: {
19
- variant: 'primary',
20
- size: 'MD',
21
- checked: false,
22
- disabled: false,
23
- },
24
- argTypes: {
25
- variant: {
26
- control: {
27
- type: 'select',
28
- options: Object.keys(DEFAULT_SWITCH_VARIANTS.color),
29
- },
30
- },
31
- size: {
32
- control: {
33
- type: 'select',
34
- options: Object.keys(DEFAULT_SWITCH_VARIANTS.size),
35
- },
36
- },
37
- checked: {
38
- control: {
39
- type: 'boolean',
40
- },
41
- },
42
- disabled: {
43
- control: {
44
- type: 'boolean',
45
- },
46
- },
47
- onCheckedChange: {
48
- control: {
49
- action: 'changed',
50
- },
51
- },
52
- },
53
- } as Meta