@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,21 +1,22 @@
1
- import { FieldValues, UseFormRegisterReturn } from 'react-hook-form'
2
- import { TextFieldSize } from './TextField.sizes'
3
- import React from 'react'
4
-
5
- export interface TextFieldProps<TFieldValues extends FieldValues = FieldValues>
6
- extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
7
- label: string
8
- value?: string
9
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
10
- handleLeftIcon?: () => void
11
- handleRightIcon?: () => void
12
- helperText?: string
13
- size?: TextFieldSize
14
- className?: string
15
- disabled?: boolean
16
- leftIcon?: React.ReactNode
17
- rightIcon?: React.ReactNode
18
- error?: TFieldValues
19
- type?: 'text' | 'password' | 'email' | 'number'
20
- register?: UseFormRegisterReturn<string>
21
- }
1
+ import { FieldValues, UseFormRegisterReturn } from 'react-hook-form'
2
+ import { TextFieldSize } from './TextField.sizes'
3
+ import React from 'react'
4
+
5
+ export interface TextFieldProps<TFieldValues extends FieldValues = FieldValues>
6
+ extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
7
+ label: string
8
+ value?: string
9
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
10
+ handleLeftIcon?: () => void
11
+ handleRightIcon?: () => void
12
+ helperText?: string
13
+ size?: TextFieldSize
14
+ className?: string
15
+ placeholder?: string
16
+ disabled?: boolean
17
+ leftIcon?: React.ReactNode
18
+ rightIcon?: React.ReactNode
19
+ error?: TFieldValues
20
+ type?: 'text' | 'password' | 'email' | 'number'
21
+ register?: UseFormRegisterReturn<string>
22
+ }
@@ -1,2 +1,2 @@
1
- export { default } from './TextField'
2
- export type { TextFieldProps } from './TextField.types'
1
+ export { default } from './TextField'
2
+ export type { TextFieldProps } from './TextField.types'
@@ -0,0 +1,7 @@
1
+ const getState = (disabled: boolean, error: boolean) => {
2
+ if (disabled) return 'disabled'
3
+ if (error) return 'error'
4
+ return 'default'
5
+ }
6
+
7
+ export default getState
@@ -1,21 +1,21 @@
1
- import { ThemeProvider as StyledTheme } from 'styled-components'
2
- import { themes } from '@liguelead/foundation'
3
- import { globalStyle as Reset } from './style'
4
-
5
- interface ThemeProviderProps {
6
- children: React.ReactNode
7
- theme?: 'spa'
8
- }
9
-
10
- const ThemeProvider = ({ children, theme }: ThemeProviderProps) => {
11
- const appliedTheme = theme ? themes[theme] : themes['spa']
12
-
13
- return (
14
- <StyledTheme theme={appliedTheme}>
15
- <Reset />
16
- {children}
17
- </StyledTheme>
18
- )
19
- }
20
-
21
- export default ThemeProvider
1
+ import { ThemeProvider as StyledTheme } from 'styled-components'
2
+ import { themes } from '@liguelead/foundation'
3
+ import { globalStyle as Reset } from './style'
4
+
5
+ interface ThemeProviderProps {
6
+ children: React.ReactNode
7
+ theme?: 'spa'
8
+ }
9
+
10
+ const ThemeProvider = ({ children, theme }: ThemeProviderProps) => {
11
+ const appliedTheme = theme ? themes[theme] : themes['spa']
12
+
13
+ return (
14
+ <StyledTheme theme={appliedTheme}>
15
+ <Reset />
16
+ {children}
17
+ </StyledTheme>
18
+ )
19
+ }
20
+
21
+ export default ThemeProvider
@@ -1 +1 @@
1
- export { default } from './ThemeProvider'
1
+ export { default } from './ThemeProvider'