@liguelead/design-system 0.0.8 → 0.0.10

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 (58) hide show
  1. package/components/Button/Button.appearance.ts +62 -62
  2. package/components/Button/Button.sizes.ts +41 -41
  3. package/components/Button/Button.styles.ts +50 -50
  4. package/components/Button/Button.tsx +76 -76
  5. package/components/Button/Button.types.ts +23 -23
  6. package/components/Button/index.ts +1 -1
  7. package/components/Checkbox/Checkbox.styles.ts +66 -66
  8. package/components/Checkbox/Checkbox.tsx +40 -40
  9. package/components/Checkbox/Checkbox.types.ts +11 -11
  10. package/components/Checkbox/index.tsx +2 -2
  11. package/components/DatePicker/DatePicker.styles.ts +66 -66
  12. package/components/DatePicker/DatePicker.tsx +135 -135
  13. package/components/DatePicker/DatePicker.types.ts +29 -29
  14. package/components/DatePicker/index.ts +1 -1
  15. package/components/IconButton/IconButton.sizes.ts +41 -41
  16. package/components/IconButton/IconButton.tsx +70 -70
  17. package/components/IconButton/index.ts +1 -1
  18. package/components/PageWrapper/PageWrapper.tsx +31 -31
  19. package/components/PageWrapper/index.ts +1 -1
  20. package/components/SegmentedButton/SegmentedButton.styles.ts +29 -29
  21. package/components/SegmentedButton/SegmentedButton.tsx +49 -49
  22. package/components/SegmentedButton/SegmentedButton.types.ts +20 -20
  23. package/components/SegmentedButton/index.ts +1 -1
  24. package/components/Select/Select.sizes.ts +56 -56
  25. package/components/Select/Select.states.tsx +69 -69
  26. package/components/Select/Select.styles.ts +148 -148
  27. package/components/Select/Select.tsx +145 -144
  28. package/components/Select/Select.types.ts +36 -36
  29. package/components/Select/index.ts +1 -1
  30. package/components/Text/Text.styles.ts +43 -43
  31. package/components/Text/Text.tsx +27 -27
  32. package/components/Text/Text.types.ts +42 -42
  33. package/components/Text/index.ts +1 -1
  34. package/components/TextField/TextField.sizes.ts +58 -58
  35. package/components/TextField/TextField.states.tsx +53 -76
  36. package/components/TextField/TextField.styles.ts +81 -98
  37. package/components/TextField/TextField.tsx +105 -108
  38. package/components/TextField/TextField.types.ts +22 -21
  39. package/components/TextField/index.ts +2 -2
  40. package/components/TextField/utils/getState.ts +7 -0
  41. package/components/ThemeProvider/ThemeProvider.tsx +21 -21
  42. package/components/ThemeProvider/index.ts +1 -1
  43. package/components/ThemeProvider/style.ts +969 -969
  44. package/components/Wizard/StepContent.tsx +28 -28
  45. package/components/Wizard/StepMenuItem.tsx +33 -33
  46. package/components/Wizard/Wizard.context.tsx +76 -76
  47. package/components/Wizard/Wizard.styles.ts +126 -126
  48. package/components/Wizard/Wizard.tsx +55 -55
  49. package/components/Wizard/index.ts +1 -1
  50. package/components/index.ts +11 -11
  51. package/package.json +41 -39
  52. package/scripts/createTypes.js +70 -70
  53. package/utils/colorDarken.ts +10 -10
  54. package/utils/colorLighten.ts +10 -10
  55. package/utils/darkenOrLighen.ts +19 -19
  56. package/utils/getTextColor.ts +12 -12
  57. package/utils/index.ts +5 -5
  58. package/utils/parseColor.ts +7 -7
@@ -1,62 +1,62 @@
1
- import {ButtonAppearanceTypes} from './Button.types'
2
- import {colorType} from 'types'
3
- import {useTheme} from 'styled-components'
4
- import {darkenOrLighten, getTextColor, parseColor} from '../../utils'
5
-
6
- export const ButtonAppearance = (
7
- color: colorType,
8
- appearance: ButtonAppearanceTypes
9
- ) => {
10
- const theme = useTheme()
11
- const parsedColor = parseColor(theme.colors[color])
12
-
13
- const solidtextColor = parseColor(theme.colors[getTextColor(parsedColor)])
14
-
15
- const colorHover = darkenOrLighten(0.2, parsedColor)
16
-
17
- const appearances = {
18
- solid: `
19
- background-color: ${parsedColor};
20
- color: ${solidtextColor};
21
- border: 1px solid ${parsedColor};
22
- &:hover {
23
- background-color: ${colorHover};
24
- border-color: ${colorHover};
25
- }
26
- &:disabled {
27
- background-color: ${parseColor(theme.colors.neutral200)};
28
- color: ${parseColor(theme.colors.neutral500)};
29
- border-color: ${parseColor(theme.colors.neutral200)};
30
- }
31
- `,
32
- outline: `
33
- background-color: transparent;
34
- color: ${parsedColor};
35
- border: 1px solid ${parsedColor};
36
- &:hover {
37
- background-color: ${parsedColor};
38
- border-color: ${parsedColor};
39
- color: white;
40
- }
41
- &:disabled {
42
- background-color: transparent;
43
- color: ${parseColor(theme.colors.neutral500)};
44
- border-color: ${parseColor(theme.colors.neutral500)};
45
- }
46
- `,
47
- ghost: `
48
- background-color: transparent;
49
- color: ${parsedColor};
50
- border: 1px solid transparent;
51
- &:hover {
52
- background-color: rgba(0,0,0,0.05)
53
- }
54
- &:disabled {
55
- background-color: transparent;
56
- color: ${parseColor(theme.colors.neutral500)};
57
- }
58
- `
59
- }
60
-
61
- return appearances[appearance]
62
- }
1
+ import {ButtonAppearanceTypes} from './Button.types'
2
+ import {colorType} from 'types'
3
+ import {useTheme} from 'styled-components'
4
+ import {darkenOrLighten, getTextColor, parseColor} from '../../utils'
5
+
6
+ export const ButtonAppearance = (
7
+ color: colorType,
8
+ appearance: ButtonAppearanceTypes
9
+ ) => {
10
+ const theme = useTheme()
11
+ const parsedColor = parseColor(theme.colors[color])
12
+
13
+ const solidtextColor = parseColor(theme.colors[getTextColor(parsedColor)])
14
+
15
+ const colorHover = darkenOrLighten(0.2, parsedColor)
16
+
17
+ const appearances = {
18
+ solid: `
19
+ background-color: ${parsedColor};
20
+ color: ${solidtextColor};
21
+ border: 1px solid ${parsedColor};
22
+ &:hover {
23
+ background-color: ${colorHover};
24
+ border-color: ${colorHover};
25
+ }
26
+ &:disabled {
27
+ background-color: ${parseColor(theme.colors.neutral200)};
28
+ color: ${parseColor(theme.colors.neutral500)};
29
+ border-color: ${parseColor(theme.colors.neutral200)};
30
+ }
31
+ `,
32
+ outline: `
33
+ background-color: transparent;
34
+ color: ${parsedColor};
35
+ border: 1px solid ${parsedColor};
36
+ &:hover {
37
+ background-color: ${parsedColor};
38
+ border-color: ${parsedColor};
39
+ color: white;
40
+ }
41
+ &:disabled {
42
+ background-color: transparent;
43
+ color: ${parseColor(theme.colors.neutral500)};
44
+ border-color: ${parseColor(theme.colors.neutral500)};
45
+ }
46
+ `,
47
+ ghost: `
48
+ background-color: transparent;
49
+ color: ${parsedColor};
50
+ border: 1px solid transparent;
51
+ &:hover {
52
+ background-color: rgba(0,0,0,0.05)
53
+ }
54
+ &:disabled {
55
+ background-color: transparent;
56
+ color: ${parseColor(theme.colors.neutral500)};
57
+ }
58
+ `
59
+ }
60
+
61
+ return appearances[appearance]
62
+ }
@@ -1,41 +1,41 @@
1
- import { fontSize, fontWeight, lineHeight, spacing } from '@liguelead/foundation'
2
- import { ButtonSizeTypes } from './Button.types'
3
-
4
- export const ButtonSizes = (size: ButtonSizeTypes) => {
5
- const sizes = {
6
- xs: `
7
- padding: ${spacing.spacing4}px ${spacing.spacing8}px;
8
- font-size: ${fontSize.fontSize10}px;
9
- font-weight: ${fontWeight.fontWeight600};
10
- line-height: ${lineHeight.lineHeight14}px;
11
- gap: ${spacing.spacing8}px;
12
- border-radius: ${spacing.spacing4}px;
13
- `,
14
- sm: `
15
- padding: ${spacing.spacing8}px ${spacing.spacing12}px;
16
- font-size: ${fontSize.fontSize14}px;
17
- font-weight: ${fontWeight.fontWeight600};
18
- line-height: ${lineHeight.lineHeight22}px;
19
- gap: ${spacing.spacing8}px;
20
- border-radius: ${spacing.spacing4}px;
21
- `,
22
- md: `
23
- padding: ${spacing.spacing12}px ${spacing.spacing20}px;
24
- font-size: ${fontSize.fontSize14}px;
25
- font-weight: ${fontWeight.fontWeight600};
26
- line-height: ${lineHeight.lineHeight22}px;
27
- gap: ${spacing.spacing8}px;
28
- border-radius: ${spacing.spacing4}px;
29
- `,
30
- lg: `
31
- padding: ${spacing.spacing16}px ${spacing.spacing24}px;
32
- font-size: ${fontSize.fontSize16}px;
33
- font-weight: ${fontWeight.fontWeight600};
34
- line-height: ${lineHeight.lineHeight24}px;
35
- gap: ${spacing.spacing8}px;
36
- border-radius: ${spacing.spacing4}px;
37
- `
38
- }
39
-
40
- return sizes[size]
41
- }
1
+ import { fontSize, fontWeight, lineHeight, spacing } from '@liguelead/foundation'
2
+ import { ButtonSizeTypes } from './Button.types'
3
+
4
+ export const ButtonSizes = (size: ButtonSizeTypes) => {
5
+ const sizes = {
6
+ xs: `
7
+ padding: ${spacing.spacing4}px ${spacing.spacing8}px;
8
+ font-size: ${fontSize.fontSize10}px;
9
+ font-weight: ${fontWeight.fontWeight600};
10
+ line-height: ${lineHeight.lineHeight14}px;
11
+ gap: ${spacing.spacing8}px;
12
+ border-radius: ${spacing.spacing4}px;
13
+ `,
14
+ sm: `
15
+ padding: ${spacing.spacing8}px ${spacing.spacing12}px;
16
+ font-size: ${fontSize.fontSize14}px;
17
+ font-weight: ${fontWeight.fontWeight600};
18
+ line-height: ${lineHeight.lineHeight22}px;
19
+ gap: ${spacing.spacing8}px;
20
+ border-radius: ${spacing.spacing4}px;
21
+ `,
22
+ md: `
23
+ padding: ${spacing.spacing12}px ${spacing.spacing20}px;
24
+ font-size: ${fontSize.fontSize14}px;
25
+ font-weight: ${fontWeight.fontWeight600};
26
+ line-height: ${lineHeight.lineHeight22}px;
27
+ gap: ${spacing.spacing8}px;
28
+ border-radius: ${spacing.spacing4}px;
29
+ `,
30
+ lg: `
31
+ padding: ${spacing.spacing16}px ${spacing.spacing24}px;
32
+ font-size: ${fontSize.fontSize16}px;
33
+ font-weight: ${fontWeight.fontWeight600};
34
+ line-height: ${lineHeight.lineHeight24}px;
35
+ gap: ${spacing.spacing8}px;
36
+ border-radius: ${spacing.spacing4}px;
37
+ `
38
+ }
39
+
40
+ return sizes[size]
41
+ }
@@ -1,50 +1,50 @@
1
- import styled from 'styled-components'
2
- import { ButtonProps } from './Button.types'
3
-
4
- interface StyledButtonProps extends ButtonProps {
5
- $appearance: string
6
- $buttonSize: string
7
- $fluid: boolean
8
- }
9
-
10
- export const StyledButton = styled.button<StyledButtonProps>`
11
- position: relative;
12
- display: flex;
13
- outline: none !important;
14
- justify-content: center;
15
- align-items: center;
16
- width: ${({ $fluid }) => ($fluid ? '100%' : 'auto')};
17
- ${({ $buttonSize }) => $buttonSize}
18
- overflow: hidden;
19
- cursor: pointer;
20
- outline: none;
21
- transition: background-color 0.3s, box-shadow 0.3s;
22
- ${({ $appearance }) => $appearance}
23
-
24
- &:focus {
25
- outline: none;
26
- box-shadow: 0px 0px 0px var(--2, 2px) rgba(255, 255, 255, 0.1),
27
- 0px 0px 0px var(--4, 4px) rgba(255, 255, 255, 0.1);
28
- }
29
- `
30
-
31
- export const RippleContainer = styled.span<{
32
- $appearance: string
33
- }>`
34
- position: absolute;
35
- border-radius: 50%;
36
- transform: scale(0);
37
- animation: ripple 0.4s linear;
38
- background-color: ${({ $appearance }) =>
39
- $appearance === 'solid'
40
- ? 'rgba(255, 255, 255, 0.5)'
41
- : 'rgba(0, 0, 0, 0.2)'};
42
- pointer-events: none;
43
-
44
- @keyframes ripple {
45
- to {
46
- transform: scale(9);
47
- opacity: 0;
48
- }
49
- }
50
- `
1
+ import styled from 'styled-components'
2
+ import { ButtonProps } from './Button.types'
3
+
4
+ interface StyledButtonProps extends ButtonProps {
5
+ $appearance: string
6
+ $buttonSize: string
7
+ $fluid: boolean
8
+ }
9
+
10
+ export const StyledButton = styled.button<StyledButtonProps>`
11
+ position: relative;
12
+ display: flex;
13
+ outline: none !important;
14
+ justify-content: center;
15
+ align-items: center;
16
+ width: ${({ $fluid }) => ($fluid ? '100%' : 'auto')};
17
+ ${({ $buttonSize }) => $buttonSize}
18
+ overflow: hidden;
19
+ cursor: pointer;
20
+ outline: none;
21
+ transition: background-color 0.3s, box-shadow 0.3s;
22
+ ${({ $appearance }) => $appearance}
23
+
24
+ &:focus {
25
+ outline: none;
26
+ box-shadow: 0px 0px 0px var(--2, 2px) rgba(255, 255, 255, 0.1),
27
+ 0px 0px 0px var(--4, 4px) rgba(255, 255, 255, 0.1);
28
+ }
29
+ `
30
+
31
+ export const RippleContainer = styled.span<{
32
+ $appearance: string
33
+ }>`
34
+ position: absolute;
35
+ border-radius: 50%;
36
+ transform: scale(0);
37
+ animation: ripple 0.4s linear;
38
+ background-color: ${({ $appearance }) =>
39
+ $appearance === 'solid'
40
+ ? 'rgba(255, 255, 255, 0.5)'
41
+ : 'rgba(0, 0, 0, 0.2)'};
42
+ pointer-events: none;
43
+
44
+ @keyframes ripple {
45
+ to {
46
+ transform: scale(9);
47
+ opacity: 0;
48
+ }
49
+ }
50
+ `
@@ -1,76 +1,76 @@
1
- import { useState } from 'react'
2
- import { StyledButton, RippleContainer } from './Button.styles'
3
- import { RippleInterface, ButtonProps } from './Button.types'
4
- import { ButtonSizes } from './Button.sizes'
5
- import { ButtonAppearance } from './Button.appearance'
6
-
7
- const Button: React.FC<ButtonProps> = ({
8
- appearance = 'solid',
9
- children,
10
- className,
11
- color = 'primary',
12
- disabled,
13
- fluid = false,
14
- size = 'md',
15
- onClick,
16
- type = 'button',
17
- ...rest
18
- }) => {
19
- const [ripples, setRipples] = useState<RippleInterface[]>([])
20
-
21
- const buttonSize = ButtonSizes(size)
22
- const buttonAppearance = ButtonAppearance(color, appearance)
23
-
24
- const removeRipple = (ripples: RippleInterface[], rippleId: string) => {
25
- return ripples.filter(r => r.id !== rippleId)
26
- }
27
-
28
- const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
29
- const rect = e.currentTarget.getBoundingClientRect()
30
- const x = e.clientX - rect.left
31
- const y = e.clientY - rect.top
32
-
33
- const newRipple: RippleInterface = {
34
- id: `${Date.now()}-${Math.random()}`,
35
- x,
36
- y
37
- }
38
- setRipples(prev => [...prev, newRipple])
39
-
40
- // Chama o onClick fornecido
41
- if (onClick) {
42
- onClick(e)
43
- }
44
- }
45
-
46
- return (
47
- <StyledButton
48
- disabled={disabled}
49
- className={className}
50
- $fluid={fluid}
51
- $appearance={buttonAppearance}
52
- onClick={handleClick}
53
- $buttonSize={buttonSize}
54
- type={type}
55
- {...rest}>
56
- {children}
57
- {ripples.map(ripple => (
58
- <RippleContainer
59
- $appearance={appearance}
60
- key={ripple.id}
61
- style={{
62
- top: ripple.y - 10,
63
- left: ripple.x - 10,
64
- width: 20,
65
- height: 20
66
- }}
67
- onAnimationEnd={() =>
68
- setRipples(prev => removeRipple(prev, ripple.id))
69
- }
70
- />
71
- ))}
72
- </StyledButton>
73
- )
74
- }
75
-
76
- export default Button
1
+ import { useState } from 'react'
2
+ import { StyledButton, RippleContainer } from './Button.styles'
3
+ import { RippleInterface, ButtonProps } from './Button.types'
4
+ import { ButtonSizes } from './Button.sizes'
5
+ import { ButtonAppearance } from './Button.appearance'
6
+
7
+ const Button: React.FC<ButtonProps> = ({
8
+ appearance = 'solid',
9
+ children,
10
+ className,
11
+ color = 'primary',
12
+ disabled,
13
+ fluid = false,
14
+ size = 'md',
15
+ onClick,
16
+ type = 'button',
17
+ ...rest
18
+ }) => {
19
+ const [ripples, setRipples] = useState<RippleInterface[]>([])
20
+
21
+ const buttonSize = ButtonSizes(size)
22
+ const buttonAppearance = ButtonAppearance(color, appearance)
23
+
24
+ const removeRipple = (ripples: RippleInterface[], rippleId: string) => {
25
+ return ripples.filter(r => r.id !== rippleId)
26
+ }
27
+
28
+ const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
29
+ const rect = e.currentTarget.getBoundingClientRect()
30
+ const x = e.clientX - rect.left
31
+ const y = e.clientY - rect.top
32
+
33
+ const newRipple: RippleInterface = {
34
+ id: `${Date.now()}-${Math.random()}`,
35
+ x,
36
+ y
37
+ }
38
+ setRipples(prev => [...prev, newRipple])
39
+
40
+ // Chama o onClick fornecido
41
+ if (onClick) {
42
+ onClick(e)
43
+ }
44
+ }
45
+
46
+ return (
47
+ <StyledButton
48
+ disabled={disabled}
49
+ className={className}
50
+ $fluid={fluid}
51
+ $appearance={buttonAppearance}
52
+ onClick={handleClick}
53
+ $buttonSize={buttonSize}
54
+ type={type}
55
+ {...rest}>
56
+ {children}
57
+ {ripples.map(ripple => (
58
+ <RippleContainer
59
+ $appearance={appearance}
60
+ key={ripple.id}
61
+ style={{
62
+ top: ripple.y - 10,
63
+ left: ripple.x - 10,
64
+ width: 20,
65
+ height: 20
66
+ }}
67
+ onAnimationEnd={() =>
68
+ setRipples(prev => removeRipple(prev, ripple.id))
69
+ }
70
+ />
71
+ ))}
72
+ </StyledButton>
73
+ )
74
+ }
75
+
76
+ export default Button
@@ -1,23 +1,23 @@
1
- import { colorType } from 'types'
2
-
3
- export type ButtonSizeTypes = 'xs' | 'sm' | 'md' | 'lg'
4
- export type ButtonAppearanceTypes = 'solid' | 'outline' | 'ghost'
5
-
6
- export interface ButtonProps {
7
- appearance?: ButtonAppearanceTypes
8
- children: React.ReactNode
9
- className?: string
10
- disabled?: boolean
11
- fluid?: boolean
12
- size?: ButtonSizeTypes
13
- color?: colorType
14
- onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
15
- type?: 'button' | 'submit' | 'reset'
16
- style?: React.CSSProperties
17
- }
18
-
19
- export interface RippleInterface {
20
- id: string
21
- x: number
22
- y: number
23
- }
1
+ import { colorType } from 'types'
2
+
3
+ export type ButtonSizeTypes = 'xs' | 'sm' | 'md' | 'lg'
4
+ export type ButtonAppearanceTypes = 'solid' | 'outline' | 'ghost'
5
+
6
+ export interface ButtonProps {
7
+ appearance?: ButtonAppearanceTypes
8
+ children: React.ReactNode
9
+ className?: string
10
+ disabled?: boolean
11
+ fluid?: boolean
12
+ size?: ButtonSizeTypes
13
+ color?: colorType
14
+ onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
15
+ type?: 'button' | 'submit' | 'reset'
16
+ style?: React.CSSProperties
17
+ }
18
+
19
+ export interface RippleInterface {
20
+ id: string
21
+ x: number
22
+ y: number
23
+ }
@@ -1 +1 @@
1
- export { default } from './Button'
1
+ export { default } from './Button'
@@ -1,66 +1,66 @@
1
- import { spacing } from '@liguelead/foundation'
2
- import { parseColor } from '../../utils'
3
- import styled from 'styled-components'
4
-
5
- export const CheckboxWrapper = styled.label`
6
- display: flex;
7
- align-items: center;
8
- cursor: pointer;
9
- position: relative;
10
- user-select: none;
11
- gap: 8px;
12
- font-size: 14px;
13
-
14
- input {
15
- position: absolute;
16
- opacity: 0;
17
- width: 0;
18
- height: 0;
19
- }
20
- `
21
-
22
- export const CustomCheckbox = styled.span<{
23
- checked: boolean
24
- disabled?: boolean
25
- }>`
26
- width: ${spacing.spacing20}px;
27
- height: ${spacing.spacing20}px;
28
- border: 2px solid ${({ theme }) => parseColor(theme.colors.primary)};
29
- border-radius: 2px;
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
- transition: all 0.2s ease-in-out;
34
- background-color: ${({ checked, theme }) =>
35
- checked ? parseColor(theme.colors.primary) : 'transparent'};
36
-
37
- ${({ disabled, theme }) =>
38
- disabled &&
39
- `
40
- border-color: ${parseColor(theme.colors.neutral300)};
41
- background-color: ${parseColor(theme.colors.neutral100)};
42
- cursor: not-allowed;
43
- `}
44
-
45
- &::after {
46
- content: '';
47
- width: 16px;
48
- height: 16px;
49
- display: ${({ checked }) => (checked ? 'block' : 'none')};
50
- background-color: white;
51
-
52
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2l-4.2-4.2-1.4 1.4 5.6 5.6L21 7.8l-1.4-1.4z'/%3E%3C/svg%3E")
53
- no-repeat center / contain;
54
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2l-4.2-4.2-1.4 1.4 5.6 5.6L21 7.8l-1.4-1.4z'/%3E%3C/svg%3E")
55
- no-repeat center / contain;
56
- }
57
- `
58
-
59
- export const Label = styled.span<{ disabled?: boolean }>`
60
- font-size: 14px;
61
- font-weight: 500;
62
- color: ${({ theme, disabled }) =>
63
- disabled
64
- ? parseColor(theme.colors.neutral500)
65
- : parseColor(theme.colors.neutral900)};
66
- `
1
+ import { spacing } from '@liguelead/foundation'
2
+ import { parseColor } from '../../utils'
3
+ import styled from 'styled-components'
4
+
5
+ export const CheckboxWrapper = styled.label`
6
+ display: flex;
7
+ align-items: center;
8
+ cursor: pointer;
9
+ position: relative;
10
+ user-select: none;
11
+ gap: 8px;
12
+ font-size: 14px;
13
+
14
+ input {
15
+ position: absolute;
16
+ opacity: 0;
17
+ width: 0;
18
+ height: 0;
19
+ }
20
+ `
21
+
22
+ export const CustomCheckbox = styled.span<{
23
+ checked: boolean
24
+ disabled?: boolean
25
+ }>`
26
+ width: ${spacing.spacing20}px;
27
+ height: ${spacing.spacing20}px;
28
+ border: 2px solid ${({ theme }) => parseColor(theme.colors.primary)};
29
+ border-radius: 2px;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ transition: all 0.2s ease-in-out;
34
+ background-color: ${({ checked, theme }) =>
35
+ checked ? parseColor(theme.colors.primary) : 'transparent'};
36
+
37
+ ${({ disabled, theme }) =>
38
+ disabled &&
39
+ `
40
+ border-color: ${parseColor(theme.colors.neutral300)};
41
+ background-color: ${parseColor(theme.colors.neutral100)};
42
+ cursor: not-allowed;
43
+ `}
44
+
45
+ &::after {
46
+ content: '';
47
+ width: 16px;
48
+ height: 16px;
49
+ display: ${({ checked }) => (checked ? 'block' : 'none')};
50
+ background-color: white;
51
+
52
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2l-4.2-4.2-1.4 1.4 5.6 5.6L21 7.8l-1.4-1.4z'/%3E%3C/svg%3E")
53
+ no-repeat center / contain;
54
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2l-4.2-4.2-1.4 1.4 5.6 5.6L21 7.8l-1.4-1.4z'/%3E%3C/svg%3E")
55
+ no-repeat center / contain;
56
+ }
57
+ `
58
+
59
+ export const Label = styled.span<{ disabled?: boolean }>`
60
+ font-size: 14px;
61
+ font-weight: 500;
62
+ color: ${({ theme, disabled }) =>
63
+ disabled
64
+ ? parseColor(theme.colors.neutral500)
65
+ : parseColor(theme.colors.neutral900)};
66
+ `