@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,69 +1,69 @@
1
- import { parseColor } from '../../utils'
2
- import { useTheme } from 'styled-components'
3
- import { fontWeight, fontSize } from '@liguelead/foundation'
4
- import { TextFieldStates } from './Select.types'
5
-
6
- export const SelectStates = (state: keyof TextFieldStates) => {
7
- const theme = useTheme()
8
- const states: TextFieldStates = {
9
- error: {
10
- input: `
11
- border: 1px solid ${parseColor(theme.colors.danger100)};
12
- color: ${parseColor(theme.colors.neutral1000)};
13
- &:focus {
14
- border-color: ${parseColor(theme.colors.danger100)};
15
- }
16
- &:focus + label {
17
- color: ${parseColor(theme.colors.danger100)};
18
- }
19
- `,
20
- label: `color: ${parseColor(theme.colors.danger100)};`,
21
- helperText: `color: ${parseColor(theme.colors.danger100)};`,
22
- animation: `
23
- &:focus div + label,
24
- &:not(:placeholder-shown) + label {
25
- top: 0px;
26
- left: 12px;
27
- font-size: ${fontSize.fontSize12}px;
28
- }`
29
- },
30
- default: {
31
- input: `
32
- border: 1px solid ${parseColor(theme.colors.neutral700)};
33
- color: ${parseColor(theme.colors.neutral1000)};
34
-
35
- &:focus {
36
- border-color: ${parseColor(theme.colors.primary)};
37
- }
38
- &:focus label,
39
- &:focus-within label {
40
- color: ${parseColor(theme.colors.primary)} !important;
41
- font-weight: ${fontWeight.fontWeight600};
42
- .select-label {
43
- color: ${parseColor(theme.colors.primary)};
44
- }
45
- }
46
- `,
47
- label: `color: ${parseColor(theme.colors.neutral800)};`,
48
- helperText: `color: ${parseColor(theme.colors.neutral700)};`,
49
- animation: `
50
- &:focus + label,
51
- &:not(:placeholder-shown) + label {
52
- top: 0px;
53
- left: 12px;
54
- font-size: ${fontSize.fontSize12}px;
55
- }`
56
- },
57
- disabled: {
58
- input: `
59
- border: 2px solid ${parseColor(theme.colors.neutral500)};
60
- color: ${parseColor(theme.colors.neutral600)};
61
- `,
62
- label: `color: ${parseColor(theme.colors.neutral500)};
63
- background: transparent;`,
64
- helperText: `color: ${parseColor(theme.colors.neutral500)};`,
65
- animation: ``
66
- }
67
- }
68
- return states[state]
69
- }
1
+ import { parseColor } from '../../utils'
2
+ import { useTheme } from 'styled-components'
3
+ import { fontWeight, fontSize } from '@liguelead/foundation'
4
+ import { TextFieldStates } from './Select.types'
5
+
6
+ export const SelectStates = (state: keyof TextFieldStates) => {
7
+ const theme = useTheme()
8
+ const states: TextFieldStates = {
9
+ error: {
10
+ input: `
11
+ border: 1px solid ${parseColor(theme.colors.danger100)};
12
+ color: ${parseColor(theme.colors.neutral1000)};
13
+ &:focus {
14
+ border-color: ${parseColor(theme.colors.danger100)};
15
+ }
16
+ &:focus + label {
17
+ color: ${parseColor(theme.colors.danger100)};
18
+ }
19
+ `,
20
+ label: `color: ${parseColor(theme.colors.danger100)};`,
21
+ helperText: `color: ${parseColor(theme.colors.danger100)};`,
22
+ animation: `
23
+ &:focus div + label,
24
+ &:not(:placeholder-shown) + label {
25
+ top: 0px;
26
+ left: 12px;
27
+ font-size: ${fontSize.fontSize12}px;
28
+ }`
29
+ },
30
+ default: {
31
+ input: `
32
+ border: 1px solid ${parseColor(theme.colors.neutral700)};
33
+ color: ${parseColor(theme.colors.neutral1000)};
34
+
35
+ &:focus {
36
+ border-color: ${parseColor(theme.colors.primary)};
37
+ }
38
+ &:focus label,
39
+ &:focus-within label {
40
+ color: ${parseColor(theme.colors.primary)} !important;
41
+ font-weight: ${fontWeight.fontWeight600};
42
+ .select-label {
43
+ color: ${parseColor(theme.colors.primary)};
44
+ }
45
+ }
46
+ `,
47
+ label: `color: ${parseColor(theme.colors.neutral800)};`,
48
+ helperText: `color: ${parseColor(theme.colors.neutral700)};`,
49
+ animation: `
50
+ &:focus + label,
51
+ &:not(:placeholder-shown) + label {
52
+ top: 0px;
53
+ left: 12px;
54
+ font-size: ${fontSize.fontSize12}px;
55
+ }`
56
+ },
57
+ disabled: {
58
+ input: `
59
+ border: 2px solid ${parseColor(theme.colors.neutral500)};
60
+ color: ${parseColor(theme.colors.neutral600)};
61
+ `,
62
+ label: `color: ${parseColor(theme.colors.neutral500)};
63
+ background: transparent;`,
64
+ helperText: `color: ${parseColor(theme.colors.neutral500)};`,
65
+ animation: ``
66
+ }
67
+ }
68
+ return states[state]
69
+ }
@@ -1,148 +1,148 @@
1
- import styled from 'styled-components'
2
- import { TextFieldSizeType, StateInterface } from './Select.types'
3
- import {
4
- fontSize,
5
- fontWeight,
6
- lineHeight,
7
- spacing
8
- } from '@liguelead/foundation'
9
- import { parseColor } from '../../utils'
10
- import { Content, Item } from '@radix-ui/react-select'
11
-
12
- interface StyledInputProps {
13
- size: TextFieldSizeType
14
- $themefication: StateInterface
15
- }
16
-
17
- export const InputWrapper = styled.div`
18
- position: relative;
19
- width: 100%;
20
- `
21
-
22
- export const FloatingLabel = styled.label`
23
- position: absolute;
24
- top: 50%;
25
- left: 12px;
26
- transform: translateY(-50%);
27
- font-weight: ${fontWeight.fontWeight600};
28
- transition: all 0.2s ease;
29
- pointer-events: none;
30
- background-color: white;
31
- padding: 0 4px;
32
- &.is-open {
33
- color: ${({ theme }) => parseColor(theme.colors.primary)} !important;
34
- }
35
- `
36
-
37
- export const HelperText = styled.span<{ error?: boolean }>`
38
- font-size: ${fontSize.fontSize12}px;
39
- line-height: ${lineHeight.lineHeight12}px;
40
- padding-left: ${spacing.spacing16}px;
41
- `
42
-
43
- export const IconWrapper = styled.div<{ $right?: boolean; $error?: boolean }>`
44
- display: flex;
45
- align-items: center;
46
- justify-content: space-between;
47
- position: absolute;
48
- top: 0px;
49
- height: 100%;
50
- cursor: pointer;
51
- ${({ $right }) => ($right ? 'right: 0px;' : 'left: 0px;')}
52
- padding: 0px ${spacing.spacing16}px;
53
-
54
- & svg {
55
- width: 20px;
56
- height: 20px;
57
- fill: ${({ theme, $error }) =>
58
- $error
59
- ? parseColor(theme.colors.danger100)
60
- : parseColor(theme.colors.neutral700)};
61
- transition: fill 0.2s ease;
62
- }
63
- `
64
-
65
- export const StyledContent = styled(Content)`
66
- padding: 0px;
67
- background-color: #fff;
68
- min-width: var(--radix-select-trigger-width, auto);
69
- width: 100%;
70
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
71
- border: 1px solid ${({ theme }) => parseColor(theme.colors.neutral500)};
72
- border-top: 0px;
73
- max-height: var(--radix-select-content-height, 314px);
74
- overflow-y: scroll !important;
75
- z-index: 10;
76
- & .RadixSelectViewport {
77
- max-height: 200px; /* Limite de altura do dropdown */
78
- overflow-y: auto; /* Adiciona o scroll quando necessário */
79
- scrollbar-width: thin; /* Personaliza a largura do scroll (opcional) */
80
- }
81
- `
82
-
83
- export const StyledItem = styled(Item)`
84
- padding: ${spacing.spacing12}px ${spacing.spacing20}px;
85
- display: flex;
86
- align-items: center;
87
- gap: 8px;
88
- transition: all 0.2s ease;
89
- cursor: pointer;
90
- &:hover {
91
- background-color: ${({ theme }) => parseColor(theme.colors.neutral200)};
92
- }
93
- &[data-state='checked'] {
94
- background-color: ${({ theme }) =>
95
- parseColor(theme.colors.primaryLight)};
96
- }
97
- `
98
-
99
- export const StyledInput = styled.input.withConfig({
100
- shouldForwardProp: prop => !['control', 'errors', 'rules'].includes(prop)
101
- })`
102
- width: 100%;
103
- border-radius: 4px;
104
- outline: none;
105
- transition: border-color 0.2s ease;
106
- background: transparent;
107
- &.is-open {
108
- border-color: ${({ theme }) =>
109
- parseColor(theme.colors.primary)} !important;
110
- }
111
- `
112
-
113
- export const BorderWrapper = styled.div`
114
- position: absolute;
115
- top: 0;
116
- left: 0;
117
- right: 0;
118
- bottom: 0;
119
- pointer-events: none;
120
- border: 2px solid #ccc;
121
- border-radius: 4px;
122
- background-color: transparent;
123
- z-index: -1;
124
-
125
- ${StyledInput}:focus ~ & {
126
- border-color: ${({ theme }) => theme.colors.primary};
127
- }
128
- `
129
-
130
- export const Wrapper = styled.div<StyledInputProps>`
131
- position: relative;
132
- width: 100%;
133
- cursor: pointer;
134
- ${({ $themefication, size }) => `
135
- ${StyledInput} {
136
- ${$themefication.animation}
137
- ${$themefication.input}
138
- ${size.input}
139
- }
140
- ${FloatingLabel} {
141
- ${$themefication.label}
142
- ${size.label}
143
- }
144
- ${HelperText} {
145
- ${$themefication.label}
146
- }
147
- `}
148
- `
1
+ import styled from 'styled-components'
2
+ import { TextFieldSizeType, StateInterface } from './Select.types'
3
+ import {
4
+ fontSize,
5
+ fontWeight,
6
+ lineHeight,
7
+ spacing
8
+ } from '@liguelead/foundation'
9
+ import { parseColor } from '../../utils'
10
+ import { Content, Item } from '@radix-ui/react-select'
11
+
12
+ interface StyledInputProps {
13
+ size: TextFieldSizeType
14
+ $themefication: StateInterface
15
+ }
16
+
17
+ export const InputWrapper = styled.div`
18
+ position: relative;
19
+ width: 100%;
20
+ `
21
+
22
+ export const FloatingLabel = styled.label`
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 12px;
26
+ transform: translateY(-50%);
27
+ font-weight: ${fontWeight.fontWeight600};
28
+ transition: all 0.2s ease;
29
+ pointer-events: none;
30
+ background-color: white;
31
+ padding: 0 4px;
32
+ &.is-open {
33
+ color: ${({ theme }) => parseColor(theme.colors.primary)} !important;
34
+ }
35
+ `
36
+
37
+ export const HelperText = styled.span<{ error?: boolean }>`
38
+ font-size: ${fontSize.fontSize12}px;
39
+ line-height: ${lineHeight.lineHeight12}px;
40
+ padding-left: ${spacing.spacing16}px;
41
+ `
42
+
43
+ export const IconWrapper = styled.div<{ $right?: boolean; $error?: boolean }>`
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: space-between;
47
+ position: absolute;
48
+ top: 0px;
49
+ height: 100%;
50
+ cursor: pointer;
51
+ ${({ $right }) => ($right ? 'right: 0px;' : 'left: 0px;')}
52
+ padding: 0px ${spacing.spacing16}px;
53
+
54
+ & svg {
55
+ width: 20px;
56
+ height: 20px;
57
+ fill: ${({ theme, $error }) =>
58
+ $error
59
+ ? parseColor(theme.colors.danger100)
60
+ : parseColor(theme.colors.neutral700)};
61
+ transition: fill 0.2s ease;
62
+ }
63
+ `
64
+
65
+ export const StyledContent = styled(Content)`
66
+ padding: 0px;
67
+ background-color: #fff;
68
+ min-width: var(--radix-select-trigger-width, auto);
69
+ width: 100%;
70
+ box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
71
+ border: 1px solid ${({ theme }) => parseColor(theme.colors.neutral500)};
72
+ border-top: 0px;
73
+ max-height: var(--radix-select-content-height, 314px);
74
+ overflow-y: scroll !important;
75
+ z-index: 10;
76
+ & .RadixSelectViewport {
77
+ max-height: 200px; /* Limite de altura do dropdown */
78
+ overflow-y: auto; /* Adiciona o scroll quando necessário */
79
+ scrollbar-width: thin; /* Personaliza a largura do scroll (opcional) */
80
+ }
81
+ `
82
+
83
+ export const StyledItem = styled(Item)`
84
+ padding: ${spacing.spacing12}px ${spacing.spacing20}px;
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 8px;
88
+ transition: all 0.2s ease;
89
+ cursor: pointer;
90
+ &:hover {
91
+ background-color: ${({ theme }) => parseColor(theme.colors.neutral200)};
92
+ }
93
+ &[data-state='checked'] {
94
+ background-color: ${({ theme }) =>
95
+ parseColor(theme.colors.primaryLight)};
96
+ }
97
+ `
98
+
99
+ export const StyledInput = styled.input.withConfig({
100
+ shouldForwardProp: prop => !['control', 'errors', 'rules'].includes(prop)
101
+ })`
102
+ width: 100%;
103
+ border-radius: 4px;
104
+ outline: none;
105
+ transition: border-color 0.2s ease;
106
+ background: transparent;
107
+ &.is-open {
108
+ border-color: ${({ theme }) =>
109
+ parseColor(theme.colors.primary)} !important;
110
+ }
111
+ `
112
+
113
+ export const BorderWrapper = styled.div`
114
+ position: absolute;
115
+ top: 0;
116
+ left: 0;
117
+ right: 0;
118
+ bottom: 0;
119
+ pointer-events: none;
120
+ border: 2px solid #ccc;
121
+ border-radius: 4px;
122
+ background-color: transparent;
123
+ z-index: -1;
124
+
125
+ ${StyledInput}:focus ~ & {
126
+ border-color: ${({ theme }) => theme.colors.primary};
127
+ }
128
+ `
129
+
130
+ export const Wrapper = styled.div<StyledInputProps>`
131
+ position: relative;
132
+ width: 100%;
133
+ cursor: pointer;
134
+ ${({ $themefication, size }) => `
135
+ ${StyledInput} {
136
+ ${$themefication.animation}
137
+ ${$themefication.input}
138
+ ${size.input}
139
+ }
140
+ ${FloatingLabel} {
141
+ ${$themefication.label}
142
+ ${size.label}
143
+ }
144
+ ${HelperText} {
145
+ ${$themefication.label}
146
+ }
147
+ `}
148
+ `