@liguelead/design-system 0.0.10 → 0.0.11

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 (44) hide show
  1. package/components/Button/Button.appearance.ts +20 -16
  2. package/components/Button/Button.sizes.ts +18 -17
  3. package/components/Button/Button.styles.ts +7 -11
  4. package/components/Button/Button.tsx +5 -5
  5. package/components/Button/Button.types.ts +3 -3
  6. package/components/Checkbox/Checkbox.styles.ts +84 -35
  7. package/components/Checkbox/Checkbox.tsx +62 -5
  8. package/components/Checkbox/Checkbox.types.ts +1 -0
  9. package/components/IconButton/IconButton.sizes.ts +6 -13
  10. package/components/IconButton/IconButton.tsx +5 -5
  11. package/components/InputOpt/InputOpt.styles.ts +75 -0
  12. package/components/InputOpt/InputOpt.tsx +153 -0
  13. package/components/InputOpt/InputOpt.types.ts +14 -0
  14. package/components/InputOpt/index.ts +1 -0
  15. package/components/InputOpt/utils/focusManagement.ts +31 -0
  16. package/components/InputOpt/utils/index.ts +2 -0
  17. package/components/InputOpt/utils/inputValidation.ts +14 -0
  18. package/components/LinkButton/LinkButton.size.ts +39 -0
  19. package/components/LinkButton/LinkButton.style.ts +45 -0
  20. package/components/LinkButton/LinkButton.tsx +75 -0
  21. package/components/LinkButton/LinkButton.types.ts +11 -0
  22. package/components/LinkButton/index.ts +1 -0
  23. package/components/RadioButton/RadioButton.inputVariants.ts +133 -0
  24. package/components/RadioButton/RadioButton.styles.ts +78 -0
  25. package/components/RadioButton/RadioButton.tsx +88 -0
  26. package/components/RadioButton/RadioButton.types.ts +33 -0
  27. package/components/RadioButton/RadioButton.variants.ts +67 -0
  28. package/components/RadioButton/index.ts +1 -0
  29. package/components/SegmentedButton/SegmentedButton.tsx +0 -6
  30. package/components/Select/Select.sizes.ts +10 -11
  31. package/components/Select/Select.states.tsx +8 -37
  32. package/components/Select/Select.styles.ts +53 -39
  33. package/components/Select/Select.tsx +30 -23
  34. package/components/Select/Select.types.ts +1 -2
  35. package/components/Text/Text.styles.ts +11 -8
  36. package/components/Text/Text.tsx +2 -2
  37. package/components/Text/Text.types.ts +3 -1
  38. package/components/TextField/TextField.sizes.ts +3 -9
  39. package/components/TextField/TextField.states.tsx +11 -11
  40. package/components/TextField/TextField.styles.ts +4 -0
  41. package/components/TextField/TextField.tsx +5 -2
  42. package/components/index.ts +3 -0
  43. package/package.json +2 -2
  44. package/utils/darkenOrLighen.ts +1 -1
@@ -1,6 +1,6 @@
1
- import {parseColor} from '../../utils'
2
- import {useTheme} from 'styled-components'
3
-
1
+ import { parseColor } from '../../utils'
2
+ import { useTheme } from 'styled-components'
3
+ import { shadow } from '@liguelead/foundation'
4
4
  export interface StateInterface {
5
5
  input: string
6
6
  label?: string
@@ -19,10 +19,10 @@ export const TextFieldStates = (state: keyof TextFieldStates) => {
19
19
  error: {
20
20
  input: `
21
21
  border: 1px solid ${parseColor(theme.colors.danger200)};
22
- color: ${parseColor(theme.colors.neutral1000)};
22
+ color: ${parseColor(theme.colors.textDark)};
23
23
  &:focus {
24
24
  border-color: ${parseColor(theme.colors.danger200)};
25
- box-shadow: 0 0 0 3px #DC262633;
25
+ box-shadow: ${shadow.errorShadow};
26
26
  }
27
27
  `,
28
28
  label: `color: ${parseColor(theme.colors.danger100)};`,
@@ -30,19 +30,19 @@ export const TextFieldStates = (state: keyof TextFieldStates) => {
30
30
  },
31
31
  default: {
32
32
  input: `
33
- border: 1px solid #CFCFD1;
34
- color: ${parseColor(theme.colors.neutral1000)};
33
+ border: 1px solid ${parseColor(theme.colors.neutral400)};
34
+ color: ${parseColor(theme.colors.textDark)};
35
35
  &:focus {
36
36
  border-color: ${parseColor(theme.colors.neutral700)};
37
- box-shadow: 0 0 0 3px #A3A3A380;
37
+ box-shadow: ${shadow.focusShadow};
38
38
  }
39
39
  `,
40
- label: `color: ${parseColor(theme.colors.neutral1100)};`,
41
- helperText: `color: ${parseColor(theme.colors.neutral800)};`,
40
+ label: `color: ${parseColor(theme.colors.textDark)};`,
41
+ helperText: `color: ${parseColor(theme.colors.textMedium)};`,
42
42
  },
43
43
  disabled: {
44
44
  input: `
45
- color: ${parseColor(theme.colors.neutral1100)};
45
+ color: ${parseColor(theme.colors.textDark)};
46
46
  box-shadow: 0 1px 2px 0 #0000000D;
47
47
  opacity: 0.5;
48
48
  `,
@@ -79,3 +79,7 @@ export const Wrapper = styled.div<StyledInputProps>`
79
79
  }
80
80
  `}
81
81
  `
82
+
83
+ export const RequiredAsterisk = styled.span`
84
+ color: ${({ theme }) => parseColor(theme.colors.primary)};
85
+ `
@@ -7,7 +7,8 @@ import {
7
7
  IconWrapper,
8
8
  InputWrapper,
9
9
  StyledInput,
10
- Wrapper
10
+ Wrapper,
11
+ RequiredAsterisk
11
12
  } from './TextField.styles'
12
13
  import { textFieldSizes } from './TextField.sizes'
13
14
  import { Eye, EyeClosed } from '@phosphor-icons/react'
@@ -70,7 +71,9 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
70
71
  size={textFieldSize}
71
72
  $themefication={textFieldState}
72
73
  >
73
- <Label>{label}</Label>
74
+ <Label>
75
+ {label} {props.required && <RequiredAsterisk>*</RequiredAsterisk>}
76
+ </Label>
74
77
  <InputWrapper>
75
78
  {leftIcon && (
76
79
  <IconWrapper onClick={handleLeftIcon}>
@@ -2,6 +2,7 @@ export { default as Button } from './Button'
2
2
  export { default as Checkbox } from './Checkbox'
3
3
  export { default as DatePicker } from './DatePicker'
4
4
  export { default as IconButton } from './IconButton'
5
+ export { default as InputOpt } from './InputOpt'
5
6
  export { default as PageWrapper } from './PageWrapper'
6
7
  export { default as Text } from './Text'
7
8
  export { default as TextField } from './TextField'
@@ -9,3 +10,5 @@ export { default as ThemeProvider } from './ThemeProvider'
9
10
  export { default as Wizard } from './Wizard'
10
11
  export { default as Select } from './Select'
11
12
  export { default as SegmentedButton } from './SegmentedButton'
13
+ export { default as LinkButton } from './LinkButton'
14
+ export { default as RadioButton } from './RadioButton'
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@liguelead/design-system",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "main": "components/index.ts",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
9
  "dependencies": {
10
- "@liguelead/foundation": "^0.0.11",
10
+ "@liguelead/foundation": "^0.0.15",
11
11
  "@phosphor-icons/react": "^2.1.7",
12
12
  "@radix-ui/react-dropdown-menu": "^2.1.6",
13
13
  "@radix-ui/react-select": "^2.1.6",
@@ -9,7 +9,7 @@ const darkenOrLighten = (amount: number, bgColor: string): string => {
9
9
 
10
10
  const luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b
11
11
 
12
- if (luminance < 95) {
12
+ if (luminance < 50) {
13
13
  return lighten(amount, bgColor)
14
14
  }
15
15