@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.
- package/README.md +8 -12
- package/lib/commonjs/components/Radio/index.js +14 -3
- package/lib/commonjs/components/Radio/index.js.map +1 -1
- package/lib/commonjs/components/Radio/styles.js +24 -8
- package/lib/commonjs/components/Radio/styles.js.map +1 -1
- package/lib/commonjs/components/Switch/styles.js +14 -14
- package/lib/commonjs/components/Switch/styles.js.map +1 -1
- package/lib/commonjs/figma/Field.Radio.figma.js +58 -0
- package/lib/commonjs/figma/Field.Radio.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.Group.figma.js +24 -0
- package/lib/commonjs/figma/Radio.Group.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.figma.js +12 -6
- package/lib/commonjs/figma/Radio.figma.js.map +1 -1
- package/lib/module/components/Radio/index.js +14 -3
- package/lib/module/components/Radio/index.js.map +1 -1
- package/lib/module/components/Radio/styles.js +25 -9
- package/lib/module/components/Radio/styles.js.map +1 -1
- package/lib/module/components/Switch/styles.js +14 -14
- package/lib/module/components/Switch/styles.js.map +1 -1
- package/lib/module/figma/Field.Radio.figma.js +52 -0
- package/lib/module/figma/Field.Radio.figma.js.map +1 -0
- package/lib/module/figma/Radio.Group.figma.js +18 -0
- package/lib/module/figma/Radio.Group.figma.js.map +1 -0
- package/lib/module/figma/Radio.figma.js +12 -6
- package/lib/module/figma/Radio.figma.js.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/styles.d.ts.map +1 -1
- package/lib/typescript/components/Switch/styles.d.ts.map +1 -1
- package/lib/typescript/figma/Field.Radio.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Radio.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.Group.figma.d.ts +8 -0
- package/lib/typescript/figma/Radio.Group.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.figma.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Radio/index.tsx +22 -6
- package/src/components/Radio/styles.ts +46 -6
- 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-
|
|
7
|
+
export const switchThumbColorVariants = cva(['accent-surface-primary'], {
|
|
8
8
|
variants: {
|
|
9
9
|
isDisabled: {
|
|
10
|
-
true: 'accent-
|
|
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-
|
|
17
|
+
export const switchTrackOnVariants = cva(['accent-surface-action-strong'], {
|
|
18
18
|
variants: {
|
|
19
19
|
isInvalid: {
|
|
20
|
-
true: 'accent-
|
|
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-
|
|
27
|
+
export const switchTrackOffVariants = cva(['accent-surface-neutral-subtle'], {
|
|
28
28
|
variants: {
|
|
29
29
|
isInvalid: {
|
|
30
|
-
true: 'accent-
|
|
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-
|
|
37
|
+
export const switchIosBgVariants = cva(['accent-surface-neutral-subtle'], {
|
|
38
38
|
variants: {
|
|
39
39
|
isInvalid: {
|
|
40
|
-
true: 'accent-
|
|
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-
|
|
57
|
-
'web:data-[invalid=true]:data-[focus-visible=true]:ring-
|
|
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-
|
|
77
|
-
false: 'bg-
|
|
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
|
-
{
|
|
86
|
-
|
|
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-
|
|
103
|
+
['rounded-full bg-surface-primary shadow-sm', 'transition-transform duration-200'],
|
|
96
104
|
{
|
|
97
105
|
variants: {
|
|
98
106
|
size: {
|