@cdx-ui/components 0.1.1 → 0.1.2

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 (37) hide show
  1. package/README.md +8 -12
  2. package/lib/commonjs/components/Radio/index.js +14 -3
  3. package/lib/commonjs/components/Radio/index.js.map +1 -1
  4. package/lib/commonjs/components/Radio/styles.js +24 -8
  5. package/lib/commonjs/components/Radio/styles.js.map +1 -1
  6. package/lib/commonjs/components/Switch/styles.js +14 -14
  7. package/lib/commonjs/components/Switch/styles.js.map +1 -1
  8. package/lib/commonjs/figma/Field.Radio.figma.js +58 -0
  9. package/lib/commonjs/figma/Field.Radio.figma.js.map +1 -0
  10. package/lib/commonjs/figma/Radio.Group.figma.js +24 -0
  11. package/lib/commonjs/figma/Radio.Group.figma.js.map +1 -0
  12. package/lib/commonjs/figma/Radio.figma.js +12 -6
  13. package/lib/commonjs/figma/Radio.figma.js.map +1 -1
  14. package/lib/module/components/Radio/index.js +14 -3
  15. package/lib/module/components/Radio/index.js.map +1 -1
  16. package/lib/module/components/Radio/styles.js +25 -9
  17. package/lib/module/components/Radio/styles.js.map +1 -1
  18. package/lib/module/components/Switch/styles.js +14 -14
  19. package/lib/module/components/Switch/styles.js.map +1 -1
  20. package/lib/module/figma/Field.Radio.figma.js +52 -0
  21. package/lib/module/figma/Field.Radio.figma.js.map +1 -0
  22. package/lib/module/figma/Radio.Group.figma.js +18 -0
  23. package/lib/module/figma/Radio.Group.figma.js.map +1 -0
  24. package/lib/module/figma/Radio.figma.js +12 -6
  25. package/lib/module/figma/Radio.figma.js.map +1 -1
  26. package/lib/typescript/components/Radio/index.d.ts.map +1 -1
  27. package/lib/typescript/components/Radio/styles.d.ts.map +1 -1
  28. package/lib/typescript/components/Switch/styles.d.ts.map +1 -1
  29. package/lib/typescript/figma/Field.Radio.figma.d.ts +8 -0
  30. package/lib/typescript/figma/Field.Radio.figma.d.ts.map +1 -0
  31. package/lib/typescript/figma/Radio.Group.figma.d.ts +8 -0
  32. package/lib/typescript/figma/Radio.Group.figma.d.ts.map +1 -0
  33. package/lib/typescript/figma/Radio.figma.d.ts.map +1 -1
  34. package/package.json +5 -5
  35. package/src/components/Radio/index.tsx +22 -6
  36. package/src/components/Radio/styles.ts +46 -6
  37. package/src/components/Switch/styles.ts +23 -15
@@ -4,40 +4,40 @@ import { cva, type VariantProps } from '@cdx-ui/utils';
4
4
  // NATIVE — Uniwind className bindings for RN Switch
5
5
  // =============================================================================
6
6
 
7
- export const switchThumbColorVariants = cva(['accent-white'], {
7
+ export const switchThumbColorVariants = cva(['accent-surface-primary'], {
8
8
  variants: {
9
9
  isDisabled: {
10
- true: 'accent-gray-200',
10
+ true: 'accent-surface-neutral-subtle',
11
11
  false: '',
12
12
  },
13
13
  },
14
14
  defaultVariants: { isDisabled: false },
15
15
  });
16
16
 
17
- export const switchTrackOnVariants = cva(['accent-blue-500'], {
17
+ export const switchTrackOnVariants = cva(['accent-surface-action-strong'], {
18
18
  variants: {
19
19
  isInvalid: {
20
- true: 'accent-red-500',
20
+ true: 'accent-surface-danger-strong',
21
21
  false: '',
22
22
  },
23
23
  },
24
24
  defaultVariants: { isInvalid: false },
25
25
  });
26
26
 
27
- export const switchTrackOffVariants = cva(['accent-gray-300'], {
27
+ export const switchTrackOffVariants = cva(['accent-surface-neutral-subtle'], {
28
28
  variants: {
29
29
  isInvalid: {
30
- true: 'accent-red-300',
30
+ true: 'accent-surface-danger-subtle',
31
31
  false: '',
32
32
  },
33
33
  },
34
34
  defaultVariants: { isInvalid: false },
35
35
  });
36
36
 
37
- export const switchIosBgVariants = cva(['accent-gray-300'], {
37
+ export const switchIosBgVariants = cva(['accent-surface-neutral-subtle'], {
38
38
  variants: {
39
39
  isInvalid: {
40
- true: 'accent-red-300',
40
+ true: 'accent-surface-danger-subtle',
41
41
  false: '',
42
42
  },
43
43
  },
@@ -53,8 +53,8 @@ export const switchTrackVariants = cva(
53
53
  'flex-row items-center rounded-full cursor-pointer',
54
54
  'transition-colors duration-200',
55
55
  'data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed',
56
- 'web:data-[focus-visible=true]:ring-3 web:data-[focus-visible=true]:ring-blue-300/50',
57
- 'web:data-[invalid=true]:data-[focus-visible=true]:ring-red-300/50',
56
+ 'web:data-[focus-visible=true]:ring-3 web:data-[focus-visible=true]:ring-stroke-focus/50',
57
+ 'web:data-[invalid=true]:data-[focus-visible=true]:ring-stroke-danger/50',
58
58
  ],
59
59
  {
60
60
  variants: {
@@ -73,8 +73,8 @@ export const switchTrackVariants = cva(
73
73
  export const switchWebTrackColorVariants = cva([], {
74
74
  variants: {
75
75
  isChecked: {
76
- true: 'bg-blue-500 data-[hover=true]:bg-blue-600',
77
- false: 'bg-gray-300 data-[hover=true]:bg-gray-400',
76
+ true: 'bg-surface-action-strong data-[hover=true]:bg-surface-action-strong-hover',
77
+ false: 'bg-surface-neutral-subtle data-[hover=true]:bg-surface-neutral-subtle-hover',
78
78
  },
79
79
  isInvalid: {
80
80
  true: '',
@@ -82,8 +82,16 @@ export const switchWebTrackColorVariants = cva([], {
82
82
  },
83
83
  },
84
84
  compoundVariants: [
85
- { isChecked: true, isInvalid: true, className: 'bg-red-500 data-[hover=true]:bg-red-600' },
86
- { isChecked: false, isInvalid: true, className: 'bg-red-300 data-[hover=true]:bg-red-400' },
85
+ {
86
+ isChecked: true,
87
+ isInvalid: true,
88
+ className: 'bg-surface-danger-strong data-[hover=true]:bg-surface-danger-strong-hover',
89
+ },
90
+ {
91
+ isChecked: false,
92
+ isInvalid: true,
93
+ className: 'bg-surface-danger-subtle data-[hover=true]:bg-surface-danger-subtle-hover',
94
+ },
87
95
  ],
88
96
  defaultVariants: {
89
97
  isChecked: false,
@@ -92,7 +100,7 @@ export const switchWebTrackColorVariants = cva([], {
92
100
  });
93
101
 
94
102
  export const switchThumbVariants = cva(
95
- ['rounded-full bg-white shadow-sm', 'transition-transform duration-200'],
103
+ ['rounded-full bg-surface-primary shadow-sm', 'transition-transform duration-200'],
96
104
  {
97
105
  variants: {
98
106
  size: {