@cdx-ui/components 0.3.0 → 0.3.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/docs/components/bottom-sheet/content.md +2 -2
- package/docs/components/carousel/content.md +1 -1
- package/docs/components/currency-input/content.md +94 -5
- package/docs/components/data-grid/content.md +50 -8
- package/docs/components/icon-button/content.md +23 -1
- package/docs/components/toast/content.md +23 -7
- package/docs/llms.txt +2 -0
- package/docs/resources/release-notes/0.3.0/content.md +19 -0
- package/docs/resources/release-notes/0.3.1/content.md +13 -0
- package/docs/resources/release-notes/content.md +2 -0
- package/lib/commonjs/components/BottomSheet/index.js +63 -16
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/components/CurrencyInput/index.js +35 -10
- package/lib/commonjs/components/CurrencyInput/index.js.map +1 -1
- package/lib/commonjs/components/CurrencyInput/styles.js +40 -3
- package/lib/commonjs/components/CurrencyInput/styles.js.map +1 -1
- package/lib/commonjs/components/IconButton/styles.js +107 -2
- package/lib/commonjs/components/IconButton/styles.js.map +1 -1
- package/lib/commonjs/components/Toast/index.js +5 -2
- package/lib/commonjs/components/Toast/index.js.map +1 -1
- package/lib/commonjs/figma/CurrencyInput.figma.js +8 -8
- package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/module/components/BottomSheet/index.js +64 -17
- package/lib/module/components/BottomSheet/index.js.map +1 -1
- package/lib/module/components/CurrencyInput/index.js +37 -12
- package/lib/module/components/CurrencyInput/index.js.map +1 -1
- package/lib/module/components/CurrencyInput/styles.js +38 -3
- package/lib/module/components/CurrencyInput/styles.js.map +1 -1
- package/lib/module/components/IconButton/styles.js +107 -2
- package/lib/module/components/IconButton/styles.js.map +1 -1
- package/lib/module/components/Toast/index.js +5 -2
- package/lib/module/components/Toast/index.js.map +1 -1
- package/lib/module/figma/CurrencyInput.figma.js +8 -8
- package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -1
- package/lib/typescript/components/CurrencyInput/index.d.ts +4 -1
- package/lib/typescript/components/CurrencyInput/index.d.ts.map +1 -1
- package/lib/typescript/components/CurrencyInput/styles.d.ts +17 -6
- package/lib/typescript/components/CurrencyInput/styles.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/styles.d.ts +2 -2
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
- package/lib/typescript/components/Toast/index.d.ts.map +1 -1
- package/lib/typescript/figma/CurrencyInput.figma.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/BottomSheet/index.tsx +88 -13
- package/src/components/CurrencyInput/index.tsx +36 -12
- package/src/components/CurrencyInput/styles.ts +51 -4
- package/src/components/IconButton/styles.ts +111 -0
- package/src/components/Toast/index.tsx +13 -3
|
@@ -29,6 +29,9 @@ export const iconButtonRootVariants = cva(
|
|
|
29
29
|
neutral: [],
|
|
30
30
|
action: [],
|
|
31
31
|
danger: [],
|
|
32
|
+
warning: [],
|
|
33
|
+
success: [],
|
|
34
|
+
info: [],
|
|
32
35
|
},
|
|
33
36
|
size: iconButtonSizeClassNames,
|
|
34
37
|
},
|
|
@@ -67,6 +70,39 @@ export const iconButtonRootVariants = cva(
|
|
|
67
70
|
}),
|
|
68
71
|
],
|
|
69
72
|
},
|
|
73
|
+
{
|
|
74
|
+
variant: 'solid',
|
|
75
|
+
color: 'warning',
|
|
76
|
+
className: [
|
|
77
|
+
'bg-surface-warning-strong',
|
|
78
|
+
Platform.select({
|
|
79
|
+
default: 'data-[active=true]:bg-surface-warning-strong-active',
|
|
80
|
+
web: 'data-[hover=true]:bg-surface-warning-strong-hover data-[active=true]:data-[hover=true]:bg-surface-warning-strong-active',
|
|
81
|
+
}),
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
variant: 'solid',
|
|
86
|
+
color: 'success',
|
|
87
|
+
className: [
|
|
88
|
+
'bg-surface-success-strong',
|
|
89
|
+
Platform.select({
|
|
90
|
+
default: 'data-[active=true]:bg-surface-success-strong-active',
|
|
91
|
+
web: 'data-[hover=true]:bg-surface-success-strong-hover data-[active=true]:data-[hover=true]:bg-surface-success-strong-active',
|
|
92
|
+
}),
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
variant: 'solid',
|
|
97
|
+
color: 'info',
|
|
98
|
+
className: [
|
|
99
|
+
'bg-surface-info-strong',
|
|
100
|
+
Platform.select({
|
|
101
|
+
default: 'data-[active=true]:bg-surface-info-strong-active',
|
|
102
|
+
web: 'data-[hover=true]:bg-surface-info-strong-hover data-[active=true]:data-[hover=true]:bg-surface-info-strong-active',
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
105
|
+
},
|
|
70
106
|
|
|
71
107
|
// ── subtle × color ─────────────────────────────────────────────────
|
|
72
108
|
{
|
|
@@ -102,6 +138,39 @@ export const iconButtonRootVariants = cva(
|
|
|
102
138
|
}),
|
|
103
139
|
],
|
|
104
140
|
},
|
|
141
|
+
{
|
|
142
|
+
variant: 'subtle',
|
|
143
|
+
color: 'warning',
|
|
144
|
+
className: [
|
|
145
|
+
'bg-surface-warning-subtle',
|
|
146
|
+
Platform.select({
|
|
147
|
+
default: 'data-[active=true]:bg-surface-warning-subtle-active',
|
|
148
|
+
web: 'data-[hover=true]:bg-surface-warning-subtle-hover data-[active=true]:data-[hover=true]:bg-surface-warning-subtle-active',
|
|
149
|
+
}),
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
variant: 'subtle',
|
|
154
|
+
color: 'success',
|
|
155
|
+
className: [
|
|
156
|
+
'bg-surface-success-subtle',
|
|
157
|
+
Platform.select({
|
|
158
|
+
default: 'data-[active=true]:bg-surface-success-subtle-active',
|
|
159
|
+
web: 'data-[hover=true]:bg-surface-success-subtle-hover data-[active=true]:data-[hover=true]:bg-surface-success-subtle-active',
|
|
160
|
+
}),
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
variant: 'subtle',
|
|
165
|
+
color: 'info',
|
|
166
|
+
className: [
|
|
167
|
+
'bg-surface-info-subtle',
|
|
168
|
+
Platform.select({
|
|
169
|
+
default: 'data-[active=true]:bg-surface-info-subtle-active',
|
|
170
|
+
web: 'data-[hover=true]:bg-surface-info-subtle-hover data-[active=true]:data-[hover=true]:bg-surface-info-subtle-active',
|
|
171
|
+
}),
|
|
172
|
+
],
|
|
173
|
+
},
|
|
105
174
|
|
|
106
175
|
// ── ghost × color ──────────────────────────────────────────────────
|
|
107
176
|
{
|
|
@@ -134,6 +203,36 @@ export const iconButtonRootVariants = cva(
|
|
|
134
203
|
}),
|
|
135
204
|
],
|
|
136
205
|
},
|
|
206
|
+
{
|
|
207
|
+
variant: 'ghost',
|
|
208
|
+
color: 'warning',
|
|
209
|
+
className: [
|
|
210
|
+
Platform.select({
|
|
211
|
+
default: 'data-[active=true]:bg-surface-warning-subtle-active',
|
|
212
|
+
web: 'data-[hover=true]:bg-surface-warning-subtle-hover data-[active=true]:data-[hover=true]:bg-surface-warning-subtle-active',
|
|
213
|
+
}),
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
variant: 'ghost',
|
|
218
|
+
color: 'success',
|
|
219
|
+
className: [
|
|
220
|
+
Platform.select({
|
|
221
|
+
default: 'data-[active=true]:bg-surface-success-subtle-active',
|
|
222
|
+
web: 'data-[hover=true]:bg-surface-success-subtle-hover data-[active=true]:data-[hover=true]:bg-surface-success-subtle-active',
|
|
223
|
+
}),
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
variant: 'ghost',
|
|
228
|
+
color: 'info',
|
|
229
|
+
className: [
|
|
230
|
+
Platform.select({
|
|
231
|
+
default: 'data-[active=true]:bg-surface-info-subtle-active',
|
|
232
|
+
web: 'data-[hover=true]:bg-surface-info-subtle-hover data-[active=true]:data-[hover=true]:bg-surface-info-subtle-active',
|
|
233
|
+
}),
|
|
234
|
+
],
|
|
235
|
+
},
|
|
137
236
|
],
|
|
138
237
|
defaultVariants: {
|
|
139
238
|
variant: 'solid',
|
|
@@ -166,18 +265,30 @@ export const iconButtonIconColorVariants = cva([], {
|
|
|
166
265
|
neutral: [],
|
|
167
266
|
action: [],
|
|
168
267
|
danger: [],
|
|
268
|
+
warning: [],
|
|
269
|
+
success: [],
|
|
270
|
+
info: [],
|
|
169
271
|
},
|
|
170
272
|
},
|
|
171
273
|
compoundVariants: [
|
|
172
274
|
{ variant: 'solid', color: 'neutral', className: 'text-content-primary' },
|
|
173
275
|
{ variant: 'solid', color: 'action', className: 'text-content-action-on-strong' },
|
|
174
276
|
{ variant: 'solid', color: 'danger', className: 'text-content-danger-on-strong' },
|
|
277
|
+
{ variant: 'solid', color: 'warning', className: 'text-content-warning-on-strong' },
|
|
278
|
+
{ variant: 'solid', color: 'success', className: 'text-content-success-on-strong' },
|
|
279
|
+
{ variant: 'solid', color: 'info', className: 'text-content-info-on-strong' },
|
|
175
280
|
{ variant: 'subtle', color: 'neutral', className: 'text-content-primary' },
|
|
176
281
|
{ variant: 'subtle', color: 'action', className: 'text-content-action-on-subtle' },
|
|
177
282
|
{ variant: 'subtle', color: 'danger', className: 'text-content-danger-on-subtle' },
|
|
283
|
+
{ variant: 'subtle', color: 'warning', className: 'text-content-warning-on-subtle' },
|
|
284
|
+
{ variant: 'subtle', color: 'success', className: 'text-content-success-on-subtle' },
|
|
285
|
+
{ variant: 'subtle', color: 'info', className: 'text-content-info-on-subtle' },
|
|
178
286
|
{ variant: 'ghost', color: 'neutral', className: 'text-content-primary' },
|
|
179
287
|
{ variant: 'ghost', color: 'action', className: 'text-content-action' },
|
|
180
288
|
{ variant: 'ghost', color: 'danger', className: 'text-content-danger' },
|
|
289
|
+
{ variant: 'ghost', color: 'warning', className: 'text-content-warning' },
|
|
290
|
+
{ variant: 'ghost', color: 'success', className: 'text-content-success' },
|
|
291
|
+
{ variant: 'ghost', color: 'info', className: 'text-content-info' },
|
|
181
292
|
],
|
|
182
293
|
defaultVariants: {
|
|
183
294
|
variant: 'solid',
|
|
@@ -441,9 +441,18 @@ const ToastAction = forwardRef<View, ToastActionProps>((props, ref) => {
|
|
|
441
441
|
// --------------------------------------------------
|
|
442
442
|
|
|
443
443
|
const ToastClose = forwardRef<View, ToastCloseProps>((props, ref) => {
|
|
444
|
-
const {
|
|
444
|
+
const {
|
|
445
|
+
children,
|
|
446
|
+
size = 'small',
|
|
447
|
+
className,
|
|
448
|
+
onPress,
|
|
449
|
+
iconClassName,
|
|
450
|
+
color: colorProp,
|
|
451
|
+
as = CloseIcon,
|
|
452
|
+
...restProps
|
|
453
|
+
} = props;
|
|
445
454
|
const { hide, id, color: toastColor } = useToastStyleContext();
|
|
446
|
-
const usesNeutralStandIn = toastColor === 'neutral';
|
|
455
|
+
const usesNeutralStandIn = toastColor === 'neutral' && colorProp == null;
|
|
447
456
|
|
|
448
457
|
/**
|
|
449
458
|
* Handle close button press
|
|
@@ -463,12 +472,13 @@ const ToastClose = forwardRef<View, ToastCloseProps>((props, ref) => {
|
|
|
463
472
|
<IconButton
|
|
464
473
|
ref={ref}
|
|
465
474
|
variant="ghost"
|
|
475
|
+
color={colorProp ?? toastColor}
|
|
466
476
|
size={size}
|
|
467
477
|
aria-label="Close"
|
|
468
478
|
className={cn(usesNeutralStandIn ? toastCloseRootVariants() : undefined, className)}
|
|
469
479
|
iconClassName={cn(usesNeutralStandIn ? toastCloseIconVariants() : undefined, iconClassName)}
|
|
470
480
|
onPress={handlePress}
|
|
471
|
-
as={
|
|
481
|
+
as={as}
|
|
472
482
|
{...restProps}
|
|
473
483
|
/>
|
|
474
484
|
);
|