@cdx-ui/components 0.0.1-beta.3 → 0.0.1-beta.31
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 +18 -11
- package/lib/commonjs/components/Button/styles.js +2 -2
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Card/index.js +22 -4
- package/lib/commonjs/components/Card/index.js.map +1 -1
- package/lib/commonjs/components/Card/styles.js +27 -5
- package/lib/commonjs/components/Card/styles.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +5 -29
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +39 -47
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +8 -2
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Field/styles.js +4 -4
- package/lib/commonjs/components/Field/styles.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +1 -1
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +1 -2
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +6 -1
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/styles.js +135 -10
- package/lib/commonjs/components/IconButton/styles.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +7 -6
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +283 -0
- package/lib/commonjs/components/ListItem/index.js.map +1 -0
- package/lib/commonjs/components/ListItem/styles.js +130 -0
- package/lib/commonjs/components/ListItem/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/index.js +22 -10
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +167 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Radio/styles.js +31 -0
- package/lib/commonjs/components/Radio/styles.js.map +1 -0
- package/lib/commonjs/components/Text/styles.js +2 -2
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/Tile/index.js +251 -0
- package/lib/commonjs/components/Tile/index.js.map +1 -0
- package/lib/commonjs/components/Tile/styles.js +52 -0
- package/lib/commonjs/components/Tile/styles.js.map +1 -0
- package/lib/commonjs/components/index.js +36 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Button.figma.js +70 -0
- package/lib/commonjs/figma/Button.figma.js.map +1 -0
- package/lib/commonjs/figma/Card.Header.figma.js +28 -0
- package/lib/commonjs/figma/Card.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/Card.figma.js +42 -0
- package/lib/commonjs/figma/Card.figma.js.map +1 -0
- package/lib/commonjs/figma/Checkbox.figma.js +55 -0
- package/lib/commonjs/figma/Checkbox.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Input.figma.js +57 -0
- package/lib/commonjs/figma/Field.Input.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Select.figma.js +57 -0
- package/lib/commonjs/figma/Field.Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Heading.figma.js +30 -0
- package/lib/commonjs/figma/Heading.figma.js.map +1 -0
- package/lib/commonjs/figma/Icon.figma.js +20 -0
- package/lib/commonjs/figma/Icon.figma.js.map +1 -0
- package/lib/commonjs/figma/IconButton.figma.js +47 -0
- package/lib/commonjs/figma/IconButton.figma.js.map +1 -0
- package/lib/commonjs/figma/Input.figma.js +52 -0
- package/lib/commonjs/figma/Input.figma.js.map +1 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js +39 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.figma.js +38 -0
- package/lib/commonjs/figma/Radio.figma.js.map +1 -0
- package/lib/commonjs/figma/Select.figma.js +53 -0
- package/lib/commonjs/figma/Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Text.figma.js +29 -0
- package/lib/commonjs/figma/Text.figma.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.js +27 -0
- package/lib/commonjs/figma/icons.figma.batch.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.json +17705 -0
- package/lib/commonjs/styles/primitives.js +36 -2
- package/lib/commonjs/styles/primitives.js.map +1 -1
- package/lib/module/components/Button/styles.js +2 -2
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Card/index.js +23 -4
- package/lib/module/components/Card/index.js.map +1 -1
- package/lib/module/components/Card/styles.js +27 -5
- package/lib/module/components/Card/styles.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +6 -30
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +40 -48
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Field/index.js +9 -3
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Field/styles.js +4 -4
- package/lib/module/components/Field/styles.js.map +1 -1
- package/lib/module/components/Heading/styles.js +1 -1
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +1 -2
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/IconButton/index.js +6 -1
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/IconButton/styles.js +135 -10
- package/lib/module/components/IconButton/styles.js.map +1 -1
- package/lib/module/components/Input/styles.js +7 -6
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/ListItem/index.js +226 -0
- package/lib/module/components/ListItem/index.js.map +1 -0
- package/lib/module/components/ListItem/styles.js +127 -0
- package/lib/module/components/ListItem/styles.js.map +1 -0
- package/lib/module/components/ProgressSegmented/index.js +23 -11
- package/lib/module/components/ProgressSegmented/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +164 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Radio/styles.js +27 -0
- package/lib/module/components/Radio/styles.js.map +1 -0
- package/lib/module/components/Text/styles.js +2 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/Tile/index.js +243 -0
- package/lib/module/components/Tile/index.js.map +1 -0
- package/lib/module/components/Tile/styles.js +48 -0
- package/lib/module/components/Tile/styles.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Button.figma.js +64 -0
- package/lib/module/figma/Button.figma.js.map +1 -0
- package/lib/module/figma/Card.Header.figma.js +22 -0
- package/lib/module/figma/Card.Header.figma.js.map +1 -0
- package/lib/module/figma/Card.figma.js +36 -0
- package/lib/module/figma/Card.figma.js.map +1 -0
- package/lib/module/figma/Checkbox.figma.js +49 -0
- package/lib/module/figma/Checkbox.figma.js.map +1 -0
- package/lib/module/figma/Field.Input.figma.js +51 -0
- package/lib/module/figma/Field.Input.figma.js.map +1 -0
- package/lib/module/figma/Field.Select.figma.js +51 -0
- package/lib/module/figma/Field.Select.figma.js.map +1 -0
- package/lib/module/figma/Heading.figma.js +24 -0
- package/lib/module/figma/Heading.figma.js.map +1 -0
- package/lib/module/figma/Icon.figma.js +14 -0
- package/lib/module/figma/Icon.figma.js.map +1 -0
- package/lib/module/figma/IconButton.figma.js +41 -0
- package/lib/module/figma/IconButton.figma.js.map +1 -0
- package/lib/module/figma/Input.figma.js +46 -0
- package/lib/module/figma/Input.figma.js.map +1 -0
- package/lib/module/figma/ProgressSegmented.figma.js +33 -0
- package/lib/module/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/module/figma/Radio.figma.js +32 -0
- package/lib/module/figma/Radio.figma.js.map +1 -0
- package/lib/module/figma/Select.figma.js +47 -0
- package/lib/module/figma/Select.figma.js.map +1 -0
- package/lib/module/figma/Text.figma.js +23 -0
- package/lib/module/figma/Text.figma.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.js +22 -0
- package/lib/module/figma/icons.figma.batch.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.json +17705 -0
- package/lib/module/styles/primitives.js +36 -2
- package/lib/module/styles/primitives.js.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +4 -3
- package/lib/typescript/components/Card/index.d.ts.map +1 -1
- package/lib/typescript/components/Card/styles.d.ts +13 -3
- package/lib/typescript/components/Card/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +1 -2
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -14
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +2 -2
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -1
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Field/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/styles.d.ts +6 -2
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +49 -0
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -0
- package/lib/typescript/components/ListItem/styles.d.ts +30 -0
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/index.d.ts +14 -3
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts +40 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/components/Radio/styles.d.ts +8 -0
- package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
- package/lib/typescript/components/Text/styles.d.ts.map +1 -1
- package/lib/typescript/components/Tile/index.d.ts +70 -0
- package/lib/typescript/components/Tile/index.d.ts.map +1 -0
- package/lib/typescript/components/Tile/styles.d.ts +18 -0
- package/lib/typescript/components/Tile/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/Button.figma.d.ts +8 -0
- package/lib/typescript/figma/Button.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Card.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Card.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts +8 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Heading.figma.d.ts +8 -0
- package/lib/typescript/figma/Heading.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Icon.figma.d.ts +8 -0
- package/lib/typescript/figma/Icon.figma.d.ts.map +1 -0
- package/lib/typescript/figma/IconButton.figma.d.ts +8 -0
- package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts +8 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.figma.d.ts +8 -0
- package/lib/typescript/figma/Radio.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Text.figma.d.ts +8 -0
- package/lib/typescript/figma/Text.figma.d.ts.map +1 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts +14 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +35 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/Button/styles.ts +2 -2
- package/src/components/Card/index.tsx +41 -16
- package/src/components/Card/styles.ts +43 -23
- package/src/components/Checkbox/index.tsx +8 -19
- package/src/components/Checkbox/styles.ts +82 -86
- package/src/components/Field/FieldLabel.web.tsx +1 -1
- package/src/components/Field/index.tsx +10 -3
- package/src/components/Field/styles.ts +5 -4
- package/src/components/Heading/{styles.tsx → styles.ts} +1 -1
- package/src/components/Icon/index.tsx +1 -2
- package/src/components/IconButton/index.tsx +3 -2
- package/src/components/IconButton/styles.ts +136 -10
- package/src/components/Input/styles.ts +13 -8
- package/src/components/ListItem/index.tsx +285 -0
- package/src/components/ListItem/styles.ts +153 -0
- package/src/components/ProgressSegmented/index.tsx +49 -14
- package/src/components/Radio/index.tsx +192 -0
- package/src/components/Radio/styles.ts +59 -0
- package/src/components/Text/{styles.tsx → styles.ts} +2 -2
- package/src/components/Tile/index.tsx +296 -0
- package/src/components/Tile/styles.ts +82 -0
- package/src/components/index.ts +3 -0
- package/src/styles/primitives.ts +36 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
|
|
7
|
+
// ── Root (row): density, surface, separator, interactive feedback ──────────
|
|
8
|
+
|
|
9
|
+
export const listItemRootVariants = cva(['flex-row self-stretch w-full px-4', 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none', 'data-[active=true]:opacity-70', TRANSITION_COLORS, Platform.select({
|
|
10
|
+
web: ['outline-none', 'web:data-[hover=true]:bg-slate-50', 'web:focus-visible:data-[disabled=false]:bg-slate-50', 'web:focus-visible:data-[disabled=false]:ring-2 web:focus-visible:data-[disabled=false]:ring-slate-400/40 web:focus-visible:data-[disabled=false]:ring-offset-2'].join(' '),
|
|
11
|
+
default: ''
|
|
12
|
+
})], {
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
default: 'gap-3 py-4',
|
|
16
|
+
compact: 'gap-2 py-3'
|
|
17
|
+
},
|
|
18
|
+
surface: {
|
|
19
|
+
default: 'bg-white',
|
|
20
|
+
negative: 'bg-red-50'
|
|
21
|
+
},
|
|
22
|
+
showSeparator: {
|
|
23
|
+
true: 'border-b border-solid border-stroke-secondary',
|
|
24
|
+
false: 'border-b-0'
|
|
25
|
+
},
|
|
26
|
+
crossAlign: {
|
|
27
|
+
center: 'items-center',
|
|
28
|
+
start: 'items-start'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
compoundVariants: [{
|
|
32
|
+
surface: 'negative',
|
|
33
|
+
className: Platform.select({
|
|
34
|
+
web: 'web:data-[hover=true]:bg-red-100/90',
|
|
35
|
+
default: ''
|
|
36
|
+
})
|
|
37
|
+
}],
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
size: 'default',
|
|
40
|
+
surface: 'default',
|
|
41
|
+
showSeparator: true,
|
|
42
|
+
crossAlign: 'center'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// ── Leading / trailing slots ─────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
export const listItemLeadingSlotVariants = cva(['flex shrink-0 items-center justify-center']);
|
|
49
|
+
export const listItemTrailingSlotVariants = cva(['flex shrink-0 flex-row justify-end gap-2'], {
|
|
50
|
+
variants: {
|
|
51
|
+
crossAlign: {
|
|
52
|
+
center: 'items-center',
|
|
53
|
+
start: 'items-start self-start'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
crossAlign: 'center'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ── Content stack (title / description / meta) ───────────────────────────────
|
|
62
|
+
|
|
63
|
+
export const listItemContentVariants = cva('flex min-w-0 flex-1 flex-col gap-1', {
|
|
64
|
+
variants: {
|
|
65
|
+
crossAlign: {
|
|
66
|
+
center: 'justify-center',
|
|
67
|
+
start: 'justify-start'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
crossAlign: 'center'
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// ── Typography ───────────────────────────────────────────────────────────────
|
|
76
|
+
|
|
77
|
+
export const listItemTitleVariants = cva('text-content-primary font-medium', {
|
|
78
|
+
variants: {
|
|
79
|
+
size: {
|
|
80
|
+
default: 'text-base leading-snug',
|
|
81
|
+
compact: 'text-sm leading-snug'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
defaultVariants: {
|
|
85
|
+
size: 'default'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export const listItemDescriptionVariants = cva('text-content-secondary', {
|
|
89
|
+
variants: {
|
|
90
|
+
size: {
|
|
91
|
+
default: 'text-sm leading-normal',
|
|
92
|
+
compact: 'text-xs leading-normal'
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
size: 'default'
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export const listItemMetaVariants = cva('text-content-tertiary', {
|
|
100
|
+
variants: {
|
|
101
|
+
size: {
|
|
102
|
+
default: 'text-xs leading-normal',
|
|
103
|
+
compact: 'text-[11px] leading-normal'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
defaultVariants: {
|
|
107
|
+
size: 'default'
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// ── Section header (group label row inside lists / cards) ───────────────────
|
|
112
|
+
|
|
113
|
+
export const listItemSectionHeaderVariants = cva(['flex-row items-center justify-between gap-2 border-b border-solid px-4 py-3', 'border-stroke-secondary'], {
|
|
114
|
+
variants: {
|
|
115
|
+
showDivider: {
|
|
116
|
+
true: ['border-t-4 border-solid border-t-surface-brand-strong/40', 'border-x-0'],
|
|
117
|
+
false: 'border-t-0'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
defaultVariants: {
|
|
121
|
+
showDivider: true
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
/** Default section-title typography; applied by `ListItem.SectionHeader` for string/number children. Exported for rare custom composition. */
|
|
126
|
+
export const listItemSectionHeaderLabelVariants = cva('text-xs font-semibold uppercase tracking-wide text-content-secondary');
|
|
127
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","cva","TRANSITION_COLORS","listItemRootVariants","select","web","join","default","variants","size","compact","surface","negative","showSeparator","true","false","crossAlign","center","start","compoundVariants","className","defaultVariants","listItemLeadingSlotVariants","listItemTrailingSlotVariants","listItemContentVariants","listItemTitleVariants","listItemDescriptionVariants","listItemMetaVariants","listItemSectionHeaderVariants","showDivider","listItemSectionHeaderLabelVariants"],"sourceRoot":"../../../../src","sources":["components/ListItem/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AACjE,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;;AAEA,OAAO,MAAMC,oBAAoB,GAAGF,GAAG,CACrC,CACE,mCAAmC,EACnC,0EAA0E,EAC1E,+BAA+B,EAC/BC,iBAAiB,EACjBF,QAAQ,CAACI,MAAM,CAAC;EACdC,GAAG,EAAE,CACH,cAAc,EACd,mCAAmC,EACnC,qDAAqD,EACrD,gKAAgK,CACjK,CAACC,IAAI,CAAC,GAAG,CAAC;EACXC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJF,OAAO,EAAE,YAAY;MACrBG,OAAO,EAAE;IACX,CAAC;IACDC,OAAO,EAAE;MAC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ACDW,eAAe,EAAE;IACfZ,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,OAAO,MAAMiB,2BAA2B,GAAGzB,GAAG,CAAC,wBAAwB,EAAE;EACvEO,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJF,OAAO,EAAE,wBAAwB;MACjCG,OAAO,EAAE;IACX;EACF,CAAC;EACDW,eAAe,EAAE;IACfZ,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,OAAO,MAAMkB,oBAAoB,GAAG1B,GAAG,CAAC,uBAAuB,EAAE;EAC/DO,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJF,OAAO,EAAE,wBAAwB;MACjCG,OAAO,EAAE;IACX;EACF,CAAC;EACDW,eAAe,EAAE;IACfZ,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMmB,6BAA6B,GAAG3B,GAAG,CAC9C,CACE,6EAA6E,EAC7E,yBAAyB,CAC1B,EACD;EACEO,QAAQ,EAAE;IACRqB,WAAW,EAAE;MACXf,IAAI,EAAE,CAAC,0DAA0D,EAAE,YAAY,CAAC;MAChFC,KAAK,EAAE;IACT;EACF,CAAC;EACDM,eAAe,EAAE;IACfQ,WAAW,EAAE;EACf;AACF,CACF,CAAC;;AAED;AACA,OAAO,MAAMC,kCAAkC,GAAG7B,GAAG,CACnD,sEACF,CAAC","ignoreList":[]}
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
import { forwardRef, useEffect, useMemo } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
6
|
import { progressSegmentedVariants, segmentVariants } from './styles';
|
|
7
|
+
|
|
8
|
+
/* `ProgressSegmentedProps.total` remains in the public API until the next major release. */
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
11
|
export const ProgressSegmented = /*#__PURE__*/forwardRef(({
|
|
9
12
|
step,
|
|
10
|
-
|
|
13
|
+
segments,
|
|
14
|
+
total,
|
|
11
15
|
isStepComplete = false,
|
|
12
16
|
getAccessibilityText,
|
|
13
17
|
className,
|
|
14
18
|
accessibilityLabel = 'Progress',
|
|
15
19
|
...props
|
|
16
20
|
}, ref) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
21
|
+
const segmentCount = segments ?? total ?? 5;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production' && total !== undefined && segments === undefined) {
|
|
24
|
+
console.warn('[ProgressSegmented] The `total` prop is deprecated and will be removed in a future major release. Use `segments` instead.');
|
|
25
|
+
}
|
|
26
|
+
}, [total, segments]);
|
|
27
|
+
const clampedStep = Math.max(0, Math.min(step, segmentCount));
|
|
28
|
+
const segmentStates = useMemo(() => {
|
|
19
29
|
return Array.from({
|
|
20
|
-
length:
|
|
30
|
+
length: segmentCount
|
|
21
31
|
}, (_, index) => {
|
|
22
32
|
const segmentIndex = index + 1;
|
|
23
33
|
let state = 'incomplete';
|
|
@@ -28,12 +38,12 @@ export const ProgressSegmented = /*#__PURE__*/forwardRef(({
|
|
|
28
38
|
}
|
|
29
39
|
return state;
|
|
30
40
|
});
|
|
31
|
-
}, [
|
|
32
|
-
let accessibilityText = `Step ${String(clampedStep)} of ${String(
|
|
41
|
+
}, [segmentCount, clampedStep, isStepComplete]);
|
|
42
|
+
let accessibilityText = `Step ${String(clampedStep)} of ${String(segmentCount)}`;
|
|
33
43
|
if (getAccessibilityText) {
|
|
34
|
-
accessibilityText = getAccessibilityText(clampedStep,
|
|
44
|
+
accessibilityText = getAccessibilityText(clampedStep, segmentCount, isStepComplete);
|
|
35
45
|
} else if (isStepComplete) {
|
|
36
|
-
accessibilityText = `Step ${String(clampedStep)} of ${String(
|
|
46
|
+
accessibilityText = `Step ${String(clampedStep)} of ${String(segmentCount)}, completed`;
|
|
37
47
|
}
|
|
38
48
|
return /*#__PURE__*/_jsx(View, {
|
|
39
49
|
ref: ref,
|
|
@@ -41,13 +51,13 @@ export const ProgressSegmented = /*#__PURE__*/forwardRef(({
|
|
|
41
51
|
accessibilityLabel: accessibilityLabel,
|
|
42
52
|
accessibilityValue: {
|
|
43
53
|
min: 0,
|
|
44
|
-
max:
|
|
54
|
+
max: segmentCount,
|
|
45
55
|
now: clampedStep,
|
|
46
56
|
text: accessibilityText
|
|
47
57
|
},
|
|
48
58
|
className: cn(progressSegmentedVariants(), className),
|
|
49
59
|
...props,
|
|
50
|
-
children:
|
|
60
|
+
children: segmentStates.map((state, index) => /*#__PURE__*/_jsx(View, {
|
|
51
61
|
className: cn(segmentVariants({
|
|
52
62
|
state
|
|
53
63
|
}))
|
|
@@ -55,4 +65,6 @@ export const ProgressSegmented = /*#__PURE__*/forwardRef(({
|
|
|
55
65
|
});
|
|
56
66
|
});
|
|
57
67
|
ProgressSegmented.displayName = 'ProgressSegmented';
|
|
68
|
+
|
|
69
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
58
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useMemo","View","cn","progressSegmentedVariants","segmentVariants","jsx","_jsx","ProgressSegmented","step","total","isStepComplete","getAccessibilityText","className","accessibilityLabel","props","ref","clampedStep","Math","max","min","
|
|
1
|
+
{"version":3,"names":["forwardRef","useEffect","useMemo","View","cn","progressSegmentedVariants","segmentVariants","jsx","_jsx","ProgressSegmented","step","segments","total","isStepComplete","getAccessibilityText","className","accessibilityLabel","props","ref","segmentCount","process","env","NODE_ENV","undefined","console","warn","clampedStep","Math","max","min","segmentStates","Array","from","length","_","index","segmentIndex","state","accessibilityText","String","accessibilityRole","accessibilityValue","now","text","children","map","displayName"],"sourceRoot":"../../../../src","sources":["components/ProgressSegmented/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,E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able, Text, View } from 'react-native';
|
|
5
|
+
import { createRadio, dataAttributes } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn } from '@cdx-ui/utils';
|
|
7
|
+
import { radioGroupVariants, radioIndicatorVariants, radioInnerDotVariants, radioLabelVariants, radioRootVariants } from './styles';
|
|
8
|
+
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// STYLED INDICATOR BASE
|
|
11
|
+
// =============================================================================
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const RadioIndicatorBase = /*#__PURE__*/forwardRef(({
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
style,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
// On web, data attributes arrive as `dataSet: { checked: true }`.
|
|
20
|
+
// On native, they arrive as individual `data-checked: "true"` props.
|
|
21
|
+
const ds = props.dataSet;
|
|
22
|
+
const isChecked = ds ? ds.checked === true : props['data-checked'] === 'true';
|
|
23
|
+
const isInvalid = ds ? ds.invalid === true : props['data-invalid'] === 'true';
|
|
24
|
+
const isHovered = ds ? ds.hover === true : props['data-hover'] === 'true';
|
|
25
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: cn(radioIndicatorVariants(), className),
|
|
28
|
+
style: style,
|
|
29
|
+
...props,
|
|
30
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
31
|
+
className: cn(radioInnerDotVariants()),
|
|
32
|
+
...dataAttributes({
|
|
33
|
+
checked: isChecked,
|
|
34
|
+
invalid: isInvalid,
|
|
35
|
+
hover: isHovered
|
|
36
|
+
})
|
|
37
|
+
}), children]
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
RadioIndicatorBase.displayName = 'Radio.IndicatorBase';
|
|
41
|
+
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// PRIMITIVE ASSEMBLY
|
|
44
|
+
// =============================================================================
|
|
45
|
+
|
|
46
|
+
const RadioPrimitive = createRadio({
|
|
47
|
+
Root: Pressable,
|
|
48
|
+
Indicator: RadioIndicatorBase,
|
|
49
|
+
Label: Text,
|
|
50
|
+
Group: View
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// =============================================================================
|
|
54
|
+
// RADIO ROOT
|
|
55
|
+
// =============================================================================
|
|
56
|
+
|
|
57
|
+
const RadioRoot = /*#__PURE__*/forwardRef(({
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
style,
|
|
61
|
+
...props
|
|
62
|
+
}, ref) => {
|
|
63
|
+
const computedClassName = cn(radioRootVariants(), className);
|
|
64
|
+
return /*#__PURE__*/_jsx(RadioPrimitive, {
|
|
65
|
+
ref: ref,
|
|
66
|
+
className: computedClassName,
|
|
67
|
+
style: style,
|
|
68
|
+
...props,
|
|
69
|
+
children: children
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
RadioRoot.displayName = 'Radio';
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// RADIO INDICATOR
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
const RadioIndicator = /*#__PURE__*/forwardRef(({
|
|
79
|
+
className,
|
|
80
|
+
children,
|
|
81
|
+
style,
|
|
82
|
+
...props
|
|
83
|
+
}, ref) => {
|
|
84
|
+
return /*#__PURE__*/_jsx(RadioPrimitive.Indicator, {
|
|
85
|
+
ref: ref,
|
|
86
|
+
className: className,
|
|
87
|
+
style: style,
|
|
88
|
+
...props,
|
|
89
|
+
children: children
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
RadioIndicator.displayName = 'Radio.Indicator';
|
|
93
|
+
|
|
94
|
+
// =============================================================================
|
|
95
|
+
// RADIO LABEL
|
|
96
|
+
// =============================================================================
|
|
97
|
+
|
|
98
|
+
const RadioLabel = /*#__PURE__*/forwardRef(({
|
|
99
|
+
className,
|
|
100
|
+
children,
|
|
101
|
+
style,
|
|
102
|
+
...props
|
|
103
|
+
}, ref) => {
|
|
104
|
+
const computedClassName = cn(radioLabelVariants(), className);
|
|
105
|
+
return /*#__PURE__*/_jsx(RadioPrimitive.Label, {
|
|
106
|
+
ref: ref,
|
|
107
|
+
className: computedClassName,
|
|
108
|
+
style: style,
|
|
109
|
+
...props,
|
|
110
|
+
children: children
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
RadioLabel.displayName = 'Radio.Label';
|
|
114
|
+
|
|
115
|
+
// =============================================================================
|
|
116
|
+
// RADIO GROUP
|
|
117
|
+
// =============================================================================
|
|
118
|
+
|
|
119
|
+
const RadioGroup = /*#__PURE__*/forwardRef(({
|
|
120
|
+
className,
|
|
121
|
+
children,
|
|
122
|
+
style,
|
|
123
|
+
direction = 'column',
|
|
124
|
+
value,
|
|
125
|
+
defaultValue,
|
|
126
|
+
onChange,
|
|
127
|
+
isDisabled,
|
|
128
|
+
isInvalid,
|
|
129
|
+
isRequired,
|
|
130
|
+
isReadOnly,
|
|
131
|
+
name,
|
|
132
|
+
...viewProps
|
|
133
|
+
}, ref) => {
|
|
134
|
+
const computedClassName = cn(radioGroupVariants({
|
|
135
|
+
direction
|
|
136
|
+
}), className);
|
|
137
|
+
return /*#__PURE__*/_jsx(RadioPrimitive.Group, {
|
|
138
|
+
ref: ref,
|
|
139
|
+
className: computedClassName,
|
|
140
|
+
style: style,
|
|
141
|
+
value: value,
|
|
142
|
+
defaultValue: defaultValue,
|
|
143
|
+
onChange: onChange,
|
|
144
|
+
isDisabled: isDisabled,
|
|
145
|
+
isInvalid: isInvalid,
|
|
146
|
+
isRequired: isRequired,
|
|
147
|
+
isReadOnly: isReadOnly,
|
|
148
|
+
name: name,
|
|
149
|
+
...viewProps,
|
|
150
|
+
children: children
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
RadioGroup.displayName = 'Radio.Group';
|
|
154
|
+
|
|
155
|
+
// =============================================================================
|
|
156
|
+
// COMPOUND COMPONENT
|
|
157
|
+
// =============================================================================
|
|
158
|
+
|
|
159
|
+
export const Radio = Object.assign(RadioRoot, {
|
|
160
|
+
Indicator: RadioIndicator,
|
|
161
|
+
Label: RadioLabel,
|
|
162
|
+
Group: RadioGroup
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","Text","View","createRadio","dataAttributes","cn","radioGroupVariants","radioIndicatorVariants","radioInnerDotVariants","radioLabelVariants","radioRootVariants","jsx","_jsx","jsxs","_jsxs","RadioIndicatorBase","className","children","style","props","ref","ds","dataSet","isChecked","checked","isInvalid","invalid","isHovered","hover","displayName","RadioPrimitive","Root","Indicator","Label","Group","RadioRoot","computedClassName","RadioIndicator","RadioLabel","RadioGroup","direction","value","defaultValue","onChange","isDisabled","isRequired","isReadOnly","name","viewProps","Radio","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Radio/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAkBC,IAAI,QAAwB,cAAc;AACpF,SAASC,WAAW,EAAEC,cAAc,QAA0B,oBAAoB;AAClF,SAASC,EAAE,QAAQ,eAAe;AAClC,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,qBAAqB,EACrBC,kBAAkB,EAClBC,iBAAiB,QACZ,UAAU;;AAEjB;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEA,MAAMC,kBAAkB,gBAAGhB,UAAU,CACnC,CAAC;EAAEiB,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjD;EACA;EACA,MAAMC,EAAE,GAAIF,KAAK,CAASG,OAAO;EACjC,MAAMC,SAAS,GAAGF,EAAE,GAAGA,EAAE,CAACG,OAAO,KAAK,IAAI,GAAIL,KAAK,CAAS,cAAc,CAAC,KAAK,MAAM;EACtF,MAA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AI;EACJ,GAAGC;AACL,CAAC,EACD5B,GAAG,KACA;EACH,MAAMgB,iBAAiB,GAAG/B,EAAE,CAACC,kBAAkB,CAAC;IAAEkC;EAAU,CAAC,CAAC,EAAExB,SAAS,CAAC;EAE1E,oBACEJ,IAAA,CAACkB,cAAc,CAACI,KAAK;IACnBd,GAAG,EAAEA,GAAW;IAChBJ,SAAS,EAAEoB,iBAAkB;IAC7BlB,KAAK,EAAEA,KAAM;IACbuB,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BC,QAAQ,EAAEA,QAAS;IACnBC,UAAU,EAAEA,UAAW;IACvBnB,SAAS,EAAEA,SAAU;IACrBoB,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBC,IAAI,EAAEA,IAAK;IAAA,GACPC,SAAS;IAAA/B,QAAA,EAEZA;EAAQ,CACW,CAAC;AAE3B,CACF,CAAC;AAEDsB,UAAU,CAACV,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAQA,OAAO,MAAMoB,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAChB,SAAS,EAAE;EAC5CH,SAAS,EAAEK,cAAc;EACzBJ,KAAK,EAAEK,UAAU;EACjBJ,KAAK,EAAEK;AACT,CAAC,CAA2B","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
export const radioRootVariants = cva(['flex-row items-center gap-2', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', DISABLED_CURSOR]);
|
|
7
|
+
export const radioIndicatorVariants = cva(['items-center justify-center', 'rounded-[var(--border-radius-round)]', 'border-[length:var(--border-width-selected)]', 'h-5 w-5', 'bg-surface-primary', 'data-[checked=false]:border-content-secondary', 'data-[checked=true]:border-stroke-action', 'data-[invalid=true]:border-stroke-danger', 'data-[checked=true]:data-[invalid=true]:border-stroke-danger', Platform.select({
|
|
8
|
+
web: [TRANSITION_COLORS, 'data-[hover=true]:data-[checked=true]:border-surface-action-strong-hover', 'data-[hover=true]:data-[invalid=true]:border-surface-danger-strong-hover', 'web:data-[focus-visible=true]:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[var(--color-stroke-ring)] web:data-[focus-visible=true]:ring-offset-2'].join(' '),
|
|
9
|
+
default: ''
|
|
10
|
+
})]);
|
|
11
|
+
export const radioInnerDotVariants = cva(['rounded-[var(--border-radius-round)]', 'h-2.5 w-2.5', 'scale-0', 'data-[checked=true]:scale-100', 'bg-surface-action-strong', 'data-[invalid=true]:bg-surface-danger-strong', Platform.select({
|
|
12
|
+
web: ['data-[hover=true]:bg-surface-action-strong-hover', 'data-[hover=true]:data-[invalid=true]:bg-surface-danger-strong-hover'].join(' '),
|
|
13
|
+
default: ''
|
|
14
|
+
})]);
|
|
15
|
+
export const radioLabelVariants = cva(['body-md', 'text-content-primary']);
|
|
16
|
+
export const radioGroupVariants = cva([], {
|
|
17
|
+
variants: {
|
|
18
|
+
direction: {
|
|
19
|
+
column: 'gap-2',
|
|
20
|
+
row: 'flex-row gap-4'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
direction: 'column'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","TRANSITION_COLORS","radioRootVariants","radioIndicatorVariants","select","web","join","default","radioInnerDotVariants","radioLabelVariants","radioGroupVariants","variants","direction","column","row","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Radio/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,SA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-variance-authority';
|
|
5
|
-
export const textStyle = cva([
|
|
6
|
-
web: 'font-
|
|
5
|
+
export const textStyle = cva(['text-content-primary', Platform.select({
|
|
6
|
+
web: 'font-body my-0 bg-transparent no-underline',
|
|
7
7
|
default: ''
|
|
8
8
|
})], {
|
|
9
9
|
variants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","textStyle","select","web","default","variants","size","xl","lg","md","sm","xs"],"sourceRoot":"../../../../src","sources":["components/Text/styles.
|
|
1
|
+
{"version":3,"names":["Platform","cva","textStyle","select","web","default","variants","size","xl","lg","md","sm","xs"],"sourceRoot":"../../../../src","sources":["components/Text/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AAEjE,OAAO,MAAMC,SAAS,GAAGD,GAAG,CAC1B,CACE,sBAAsB,EACtBD,QAAQ,CAACG,MAAM,CAAC;EACdC,GAAG,EAAE,4CAA4C;EACjDC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE;IACN;EACF;AACF,CACF,CAAC","ignoreList":[]}
|