@szum-tech/design-system 2.7.0 → 3.0.0
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/dist/chunk-2Y2ZCPNV.cjs +61 -0
- package/dist/chunk-3376ZTRC.cjs +2 -0
- package/dist/{chunk-S5BN23O7.cjs → chunk-3KMXFN6M.cjs} +14 -20
- package/dist/chunk-5AA4IE2T.cjs +27 -0
- package/dist/chunk-5F2Y65JH.js +32 -0
- package/dist/chunk-6BSR3O2J.js +53 -0
- package/dist/chunk-BYXBJQAS.js +1 -0
- package/dist/{chunk-XIPREW2R.js → chunk-DP7UEOTA.js} +173 -176
- package/dist/chunk-HCHVDUI6.cjs +34 -0
- package/dist/chunk-HD7ZDQWW.js +173 -0
- package/dist/chunk-I3RSTJP6.js +20 -0
- package/dist/chunk-I7AV5IQO.cjs +33 -0
- package/dist/chunk-N4O2GO6V.cjs +204 -0
- package/dist/chunk-NGVFYKAT.js +29 -0
- package/dist/chunk-NU5UQPBX.cjs +25 -0
- package/dist/chunk-OQCNPNPS.js +23 -0
- package/dist/chunk-S3ANEJJ7.cjs +22 -0
- package/dist/chunk-U4AWAABZ.js +4901 -0
- package/dist/chunk-UGSNASZM.js +25 -0
- package/dist/{chunk-EIXSMEDP.cjs → chunk-UIOBJSKZ.cjs} +1 -3
- package/dist/{chunk-I5P2HH5Z.js → chunk-WJSS32MY.js} +13 -19
- package/dist/{chunk-GEACYHTU.js → chunk-XJIUGEPN.js} +1 -3
- package/dist/chunk-Y6EVJSAH.cjs +4928 -0
- package/dist/{chunk-D3MOZUNH.cjs → chunk-ZV4467OW.cjs} +176 -185
- package/dist/components/alert-dialog/index.cjs +1 -0
- package/dist/components/alert-dialog/index.js +1 -0
- package/dist/components/avatar/index.cjs +5 -4
- package/dist/components/avatar/index.d.cts +5 -19
- package/dist/components/avatar/index.d.ts +5 -19
- package/dist/components/avatar/index.js +2 -1
- package/dist/components/badge/index.cjs +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/button/index.cjs +23 -3
- package/dist/components/button/index.d.cts +8 -15
- package/dist/components/button/index.d.ts +8 -15
- package/dist/components/button/index.js +22 -2
- package/dist/components/card/index.cjs +12 -7
- package/dist/components/card/index.d.cts +8 -5
- package/dist/components/card/index.d.ts +8 -5
- package/dist/components/card/index.js +2 -1
- package/dist/components/checkbox/index.cjs +12 -0
- package/dist/components/checkbox/index.d.cts +8 -0
- package/dist/components/checkbox/index.d.ts +8 -0
- package/dist/components/checkbox/index.js +3 -0
- package/dist/components/dialog/index.cjs +1 -0
- package/dist/components/dialog/index.d.cts +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/field/index.cjs +50 -0
- package/dist/components/field/index.d.cts +50 -0
- package/dist/components/field/index.d.ts +50 -0
- package/dist/components/field/index.js +5 -0
- package/dist/components/header/index.cjs +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/index.cjs +158 -126
- package/dist/components/index.d.cts +7 -8
- package/dist/components/index.d.ts +7 -8
- package/dist/components/index.js +14 -14
- package/dist/components/input/index.cjs +3 -2
- package/dist/components/input/index.d.cts +2 -4
- package/dist/components/input/index.d.ts +2 -4
- package/dist/components/input/index.js +2 -1
- package/dist/components/item/index.cjs +13 -12
- package/dist/components/item/index.d.cts +7 -7
- package/dist/components/item/index.d.ts +7 -7
- package/dist/components/item/index.js +3 -2
- package/dist/components/label/index.cjs +3 -2
- package/dist/components/label/index.js +2 -1
- package/dist/components/select/index.cjs +20 -3
- package/dist/components/select/index.d.cts +20 -6
- package/dist/components/select/index.d.ts +20 -6
- package/dist/components/select/index.js +2 -1
- package/dist/components/separator/index.cjs +3 -2
- package/dist/components/separator/index.js +2 -1
- package/dist/components/sheet/index.cjs +1 -0
- package/dist/components/sheet/index.d.cts +1 -1
- package/dist/components/sheet/index.d.ts +1 -1
- package/dist/components/sheet/index.js +1 -0
- package/dist/components/spinner/index.cjs +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/stepper/index.cjs +33 -33
- package/dist/components/stepper/index.js +14 -14
- package/dist/components/textarea/index.cjs +4 -2
- package/dist/components/textarea/index.d.cts +2 -2
- package/dist/components/textarea/index.d.ts +2 -2
- package/dist/components/textarea/index.js +3 -1
- package/dist/components/tooltip/index.cjs +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/contexts/index.cjs +1 -0
- package/dist/contexts/index.js +1 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/icons/index.cjs +89 -18
- package/dist/icons/index.js +88 -1
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +8 -9
- package/tailwind/global.css +5 -9
- package/tailwind/palette.css +149 -204
- package/tailwind/typography.css +33 -57
- package/dist/chunk-36YD6ICC.js +0 -70
- package/dist/chunk-4NO6IM75.cjs +0 -40
- package/dist/chunk-5BTQ6BQA.js +0 -24
- package/dist/chunk-5PBHBOXI.js +0 -30
- package/dist/chunk-EU7G37IS.js +0 -36
- package/dist/chunk-FPFRA5Q6.cjs +0 -31
- package/dist/chunk-FVSO3RHT.cjs +0 -17
- package/dist/chunk-G6VXQ7DJ.cjs +0 -63
- package/dist/chunk-IAI7BIAG.js +0 -31
- package/dist/chunk-K4TRAPRN.cjs +0 -341
- package/dist/chunk-MI3CQBHC.js +0 -60
- package/dist/chunk-OIWEXHFE.cjs +0 -33
- package/dist/chunk-P4J2TTH7.cjs +0 -32
- package/dist/chunk-UKWZ5BHD.cjs +0 -93
- package/dist/chunk-VZKTT6CG.js +0 -15
- package/dist/chunk-XTO7CMIM.js +0 -88
- package/dist/chunk-YJFJLF7Y.js +0 -319
- package/dist/chunk-ZZ3EBGSD.cjs +0 -72
- package/dist/components/form/index.cjs +0 -55
- package/dist/components/form/index.d.cts +0 -32
- package/dist/components/form/index.d.ts +0 -32
- package/dist/components/form/index.js +0 -22
- package/dist/components/helper-text/index.cjs +0 -10
- package/dist/components/helper-text/index.d.cts +0 -18
- package/dist/components/helper-text/index.d.ts +0 -18
- package/dist/components/helper-text/index.js +0 -1
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkY6EVJSAH_cjs = require('./chunk-Y6EVJSAH.cjs');
|
|
4
|
+
var chunk3WSQRFUY_cjs = require('./chunk-3WSQRFUY.cjs');
|
|
5
5
|
var chunkEW6TE3N5_cjs = require('./chunk-EW6TE3N5.cjs');
|
|
6
6
|
var chunk7EYMOUWG_cjs = require('./chunk-7EYMOUWG.cjs');
|
|
7
7
|
var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
|
|
8
|
-
var
|
|
9
|
-
var React12 = require('react');
|
|
10
|
-
var tailwindMerge = require('tailwind-merge');
|
|
11
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var React5 = require('react');
|
|
12
9
|
var reactSlot = require('@radix-ui/react-slot');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
13
12
|
|
|
14
13
|
function _interopNamespace(e) {
|
|
15
14
|
if (e && e.__esModule) return e;
|
|
@@ -29,72 +28,7 @@ function _interopNamespace(e) {
|
|
|
29
28
|
return Object.freeze(n);
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
var Form = reactHookForm.FormProvider;
|
|
35
|
-
var FormItemContext = React12__namespace.createContext({});
|
|
36
|
-
var FormItem = React12__namespace.forwardRef(function({ className, ...props }, ref) {
|
|
37
|
-
const id = React12__namespace.useId();
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: tailwindMerge.twMerge("space-y-2", className), ...props }) });
|
|
39
|
-
});
|
|
40
|
-
FormItem.displayName = "FormItem";
|
|
41
|
-
var FormFieldContext = React12__namespace.createContext({});
|
|
42
|
-
var FormField = ({
|
|
43
|
-
...props
|
|
44
|
-
}) => {
|
|
45
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
|
|
46
|
-
};
|
|
47
|
-
var useFormField = () => {
|
|
48
|
-
const fieldContext = React12__namespace.useContext(FormFieldContext);
|
|
49
|
-
const itemContext = React12__namespace.useContext(FormItemContext);
|
|
50
|
-
const { getFieldState, formState } = reactHookForm.useFormContext();
|
|
51
|
-
const fieldState = getFieldState(fieldContext.name, formState);
|
|
52
|
-
if (!fieldContext) {
|
|
53
|
-
throw new Error("useFormField should be used within <FormField>");
|
|
54
|
-
}
|
|
55
|
-
const { id } = itemContext;
|
|
56
|
-
return {
|
|
57
|
-
id,
|
|
58
|
-
name: fieldContext.name,
|
|
59
|
-
formItemId: `${id}-form-item`,
|
|
60
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
61
|
-
formMessageId: `${id}-form-item-message`,
|
|
62
|
-
...fieldState
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
var FormLabel = React12__namespace.forwardRef(
|
|
66
|
-
({ className, caption, ...props }, ref) => {
|
|
67
|
-
const { error, formItemId } = useFormField();
|
|
68
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-end justify-between", children: [
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
-
chunkFVSO3RHT_cjs.Label,
|
|
71
|
-
{
|
|
72
|
-
ref,
|
|
73
|
-
className: tailwindMerge.twMerge(error ? "text-error-500" : null, className),
|
|
74
|
-
htmlFor: formItemId,
|
|
75
|
-
...props
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
caption ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typography-caption text-gray-200", children: caption }) : null
|
|
79
|
-
] });
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
FormLabel.displayName = "FormLabel";
|
|
83
|
-
var FormControl = React12__namespace.forwardRef(function(props, ref) {
|
|
84
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
85
|
-
const newProps = { ...props, invalid: !!error };
|
|
86
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
-
reactSlot.Slot,
|
|
88
|
-
{
|
|
89
|
-
ref,
|
|
90
|
-
id: formItemId,
|
|
91
|
-
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
92
|
-
"aria-invalid": !!error,
|
|
93
|
-
...newProps
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
FormControl.displayName = "FormControl";
|
|
31
|
+
var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
|
|
98
32
|
|
|
99
33
|
// src/components/stepper/stepper.constants.ts
|
|
100
34
|
var STEPPER_ROOT_NAME = "Stepper";
|
|
@@ -122,9 +56,9 @@ var STEPPER_MAP_KEY_TO_FOCUS_INTENT = {
|
|
|
122
56
|
};
|
|
123
57
|
|
|
124
58
|
// src/components/stepper/stepper.context.tsx
|
|
125
|
-
var StepperContext =
|
|
59
|
+
var StepperContext = React5__namespace.createContext(null);
|
|
126
60
|
function useStepperContext(consumerName) {
|
|
127
|
-
const context =
|
|
61
|
+
const context = React5__namespace.useContext(StepperContext);
|
|
128
62
|
if (!context) {
|
|
129
63
|
throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ROOT_NAME}\``);
|
|
130
64
|
}
|
|
@@ -214,9 +148,9 @@ function createStepperStore(listenersRef, stateRef, onValueChange, onValueComple
|
|
|
214
148
|
};
|
|
215
149
|
return store;
|
|
216
150
|
}
|
|
217
|
-
var StepperStoreContext =
|
|
151
|
+
var StepperStoreContext = React5__namespace.createContext(null);
|
|
218
152
|
function useStepperStoreContext(consumerName) {
|
|
219
|
-
const context =
|
|
153
|
+
const context = React5__namespace.useContext(StepperStoreContext);
|
|
220
154
|
if (!context) {
|
|
221
155
|
throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ROOT_NAME}\``);
|
|
222
156
|
}
|
|
@@ -224,8 +158,8 @@ function useStepperStoreContext(consumerName) {
|
|
|
224
158
|
}
|
|
225
159
|
function useStepperStore(selector) {
|
|
226
160
|
const store = useStepperStoreContext("useStore");
|
|
227
|
-
const getSnapshot =
|
|
228
|
-
return
|
|
161
|
+
const getSnapshot = React5__namespace.useCallback(() => selector(store.getState()), [selector, store]);
|
|
162
|
+
return React5__namespace.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
229
163
|
}
|
|
230
164
|
function Stepper({
|
|
231
165
|
value,
|
|
@@ -247,14 +181,14 @@ function Stepper({
|
|
|
247
181
|
indicators = {},
|
|
248
182
|
...rootProps
|
|
249
183
|
}) {
|
|
250
|
-
const id =
|
|
184
|
+
const id = React5__namespace.useId();
|
|
251
185
|
const rootId = idProp ?? id;
|
|
252
186
|
const listenersRef = chunk7EYMOUWG_cjs.useLazyRef(() => /* @__PURE__ */ new Set());
|
|
253
187
|
const stateRef = chunk7EYMOUWG_cjs.useLazyRef(() => ({
|
|
254
188
|
steps: /* @__PURE__ */ new Map(),
|
|
255
189
|
value: value ?? defaultValue
|
|
256
190
|
}));
|
|
257
|
-
const store =
|
|
191
|
+
const store = React5__namespace.useMemo(
|
|
258
192
|
() => createStepperStore(listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate),
|
|
259
193
|
[listenersRef, stateRef, onValueChange, onValueComplete, onValueAdd, onValueRemove, onValidate]
|
|
260
194
|
);
|
|
@@ -264,7 +198,7 @@ function Stepper({
|
|
|
264
198
|
}
|
|
265
199
|
}, [value]);
|
|
266
200
|
const dir = chunkEW6TE3N5_cjs.useDirection(dirProp);
|
|
267
|
-
const contextValue =
|
|
201
|
+
const contextValue = React5__namespace.useMemo(
|
|
268
202
|
() => ({
|
|
269
203
|
id: rootId,
|
|
270
204
|
dir,
|
|
@@ -316,48 +250,14 @@ var StepperDataState = {
|
|
|
316
250
|
ACTIVE: "active",
|
|
317
251
|
COMPLETED: "completed"
|
|
318
252
|
};
|
|
319
|
-
var StepperFocusContext =
|
|
253
|
+
var StepperFocusContext = React5__namespace.createContext(null);
|
|
320
254
|
function useStepperFocusContext(consumerName) {
|
|
321
|
-
const context =
|
|
255
|
+
const context = React5__namespace.useContext(StepperFocusContext);
|
|
322
256
|
if (!context) {
|
|
323
257
|
throw new Error(`\`${consumerName}\` must be used within \`FocusProvider\``);
|
|
324
258
|
}
|
|
325
259
|
return context;
|
|
326
260
|
}
|
|
327
|
-
function setRef(ref, value) {
|
|
328
|
-
if (typeof ref === "function") {
|
|
329
|
-
return ref(value);
|
|
330
|
-
} else if (ref !== null && ref !== void 0) {
|
|
331
|
-
ref.current = value;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
function composeRefs(...refs) {
|
|
335
|
-
return (node) => {
|
|
336
|
-
let hasCleanup = false;
|
|
337
|
-
const cleanups = refs.map((ref) => {
|
|
338
|
-
const cleanup = setRef(ref, node);
|
|
339
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
340
|
-
hasCleanup = true;
|
|
341
|
-
}
|
|
342
|
-
return cleanup;
|
|
343
|
-
});
|
|
344
|
-
if (hasCleanup) {
|
|
345
|
-
return () => {
|
|
346
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
347
|
-
const cleanup = cleanups[i];
|
|
348
|
-
if (typeof cleanup == "function") {
|
|
349
|
-
cleanup();
|
|
350
|
-
} else {
|
|
351
|
-
setRef(refs[i], null);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
function useComposedRefs(...refs) {
|
|
359
|
-
return React12__namespace.useCallback(composeRefs(...refs), refs);
|
|
360
|
-
}
|
|
361
261
|
|
|
362
262
|
// src/components/stepper/stepper.utils.tsx
|
|
363
263
|
function focusFirst(candidates, preventScroll = false) {
|
|
@@ -407,32 +307,32 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
407
307
|
const context = useStepperContext(STEPPER_NAV_NAME);
|
|
408
308
|
const orientation = context.orientation;
|
|
409
309
|
const currentValue = useStepperStore((state) => state.value);
|
|
410
|
-
const [tabStopId, setTabStopId] =
|
|
411
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
412
|
-
const [focusableItemCount, setFocusableItemCount] =
|
|
413
|
-
const isClickFocusRef =
|
|
414
|
-
const itemsRef =
|
|
415
|
-
const listRef =
|
|
416
|
-
const composedRef = useComposedRefs(ref, listRef);
|
|
417
|
-
const onItemFocus =
|
|
310
|
+
const [tabStopId, setTabStopId] = React5__namespace.useState(null);
|
|
311
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React5__namespace.useState(false);
|
|
312
|
+
const [focusableItemCount, setFocusableItemCount] = React5__namespace.useState(0);
|
|
313
|
+
const isClickFocusRef = React5__namespace.useRef(false);
|
|
314
|
+
const itemsRef = React5__namespace.useRef(/* @__PURE__ */ new Map());
|
|
315
|
+
const listRef = React5__namespace.useRef(null);
|
|
316
|
+
const composedRef = chunkY6EVJSAH_cjs.useComposedRefs(ref, listRef);
|
|
317
|
+
const onItemFocus = React5__namespace.useCallback((tabStopId2) => {
|
|
418
318
|
setTabStopId(tabStopId2);
|
|
419
319
|
}, []);
|
|
420
|
-
const onItemShiftTab =
|
|
320
|
+
const onItemShiftTab = React5__namespace.useCallback(() => {
|
|
421
321
|
setIsTabbingBackOut(true);
|
|
422
322
|
}, []);
|
|
423
|
-
const onFocusableItemAdd =
|
|
323
|
+
const onFocusableItemAdd = React5__namespace.useCallback(() => {
|
|
424
324
|
setFocusableItemCount((prevCount) => prevCount + 1);
|
|
425
325
|
}, []);
|
|
426
|
-
const onFocusableItemRemove =
|
|
326
|
+
const onFocusableItemRemove = React5__namespace.useCallback(() => {
|
|
427
327
|
setFocusableItemCount((prevCount) => prevCount - 1);
|
|
428
328
|
}, []);
|
|
429
|
-
const onItemRegister =
|
|
329
|
+
const onItemRegister = React5__namespace.useCallback((item) => {
|
|
430
330
|
itemsRef.current.set(item.id, item);
|
|
431
331
|
}, []);
|
|
432
|
-
const onItemUnregister =
|
|
332
|
+
const onItemUnregister = React5__namespace.useCallback((id) => {
|
|
433
333
|
itemsRef.current.delete(id);
|
|
434
334
|
}, []);
|
|
435
|
-
const getItems =
|
|
335
|
+
const getItems = React5__namespace.useCallback(() => {
|
|
436
336
|
return Array.from(itemsRef.current.values()).filter((item) => item.ref.current).sort((a, b) => {
|
|
437
337
|
const elementA = a.ref.current;
|
|
438
338
|
const elementB = b.ref.current;
|
|
@@ -447,7 +347,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
447
347
|
return 0;
|
|
448
348
|
});
|
|
449
349
|
}, []);
|
|
450
|
-
const onBlur =
|
|
350
|
+
const onBlur = React5__namespace.useCallback(
|
|
451
351
|
(event) => {
|
|
452
352
|
listProps.onBlur?.(event);
|
|
453
353
|
if (event.defaultPrevented) return;
|
|
@@ -455,7 +355,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
455
355
|
},
|
|
456
356
|
[listProps.onBlur]
|
|
457
357
|
);
|
|
458
|
-
const onFocus =
|
|
358
|
+
const onFocus = React5__namespace.useCallback(
|
|
459
359
|
(event) => {
|
|
460
360
|
listProps.onFocus?.(event);
|
|
461
361
|
if (event.defaultPrevented) return;
|
|
@@ -480,7 +380,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
480
380
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
481
381
|
[listProps.onFocus, isTabbingBackOut, currentValue, tabStopId]
|
|
482
382
|
);
|
|
483
|
-
const onMouseDown =
|
|
383
|
+
const onMouseDown = React5__namespace.useCallback(
|
|
484
384
|
(event) => {
|
|
485
385
|
listProps.onMouseDown?.(event);
|
|
486
386
|
if (event.defaultPrevented) return;
|
|
@@ -489,7 +389,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
489
389
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
490
390
|
[listProps.onMouseDown]
|
|
491
391
|
);
|
|
492
|
-
const focusContextValue =
|
|
392
|
+
const focusContextValue = React5__namespace.useMemo(
|
|
493
393
|
() => ({
|
|
494
394
|
tabStopId,
|
|
495
395
|
onItemFocus,
|
|
@@ -535,9 +435,9 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
|
|
|
535
435
|
}
|
|
536
436
|
) });
|
|
537
437
|
}
|
|
538
|
-
var StepperItemContext =
|
|
438
|
+
var StepperItemContext = React5__namespace.createContext(null);
|
|
539
439
|
function useStepperItemContext(consumerName) {
|
|
540
|
-
const context =
|
|
440
|
+
const context = React5__namespace.useContext(StepperItemContext);
|
|
541
441
|
if (!context) {
|
|
542
442
|
throw new Error(`\`${consumerName}\` must be used within \`${STEPPER_ITEM_NAME}\``);
|
|
543
443
|
}
|
|
@@ -568,7 +468,7 @@ function StepperItem({
|
|
|
568
468
|
const stepState = useStepperStore((state) => state.steps.get(itemValue));
|
|
569
469
|
const steps = useStepperStore((state) => state.steps);
|
|
570
470
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
571
|
-
const itemContextValue =
|
|
471
|
+
const itemContextValue = React5__namespace.useMemo(
|
|
572
472
|
() => ({
|
|
573
473
|
value: itemValue,
|
|
574
474
|
stepState
|
|
@@ -585,7 +485,7 @@ function StepperItem({
|
|
|
585
485
|
"data-slot": "stepper-item",
|
|
586
486
|
dir,
|
|
587
487
|
className: chunkH2BWO3SI_cjs.cn(
|
|
588
|
-
"group/step flex flex-1 flex-col justify-end",
|
|
488
|
+
"group/step flex flex-1 flex-col justify-end data-[disabled]:opacity-50",
|
|
589
489
|
"",
|
|
590
490
|
// "group-data-[orientation=horizontal]/stepper-nav:flex-row group-data-[orientation=vertical]/stepper-nav:flex-col",
|
|
591
491
|
className
|
|
@@ -598,8 +498,8 @@ function StepperItem({
|
|
|
598
498
|
{
|
|
599
499
|
"data-state": dataState,
|
|
600
500
|
className: chunkH2BWO3SI_cjs.cn(
|
|
601
|
-
"h-1 w-full
|
|
602
|
-
"data-[state=active]:bg-primary
|
|
501
|
+
"bg-border h-1 w-full transition-colors duration-500",
|
|
502
|
+
"data-[state=active]:bg-primary data-[state=completed]:bg-success"
|
|
603
503
|
)
|
|
604
504
|
}
|
|
605
505
|
)
|
|
@@ -630,11 +530,11 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
630
530
|
const isActive = value === itemValue;
|
|
631
531
|
const isTabStop = focusContext.tabStopId === triggerId;
|
|
632
532
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
633
|
-
const triggerRef =
|
|
634
|
-
const composedRef = useComposedRefs(ref, triggerRef);
|
|
635
|
-
const isArrowKeyPressedRef =
|
|
636
|
-
const isMouseClickRef =
|
|
637
|
-
|
|
533
|
+
const triggerRef = React5__namespace.useRef(null);
|
|
534
|
+
const composedRef = chunkY6EVJSAH_cjs.useComposedRefs(ref, triggerRef);
|
|
535
|
+
const isArrowKeyPressedRef = React5__namespace.useRef(false);
|
|
536
|
+
const isMouseClickRef = React5__namespace.useRef(false);
|
|
537
|
+
React5__namespace.useEffect(() => {
|
|
638
538
|
function onKeyDown2(event) {
|
|
639
539
|
if (STEPPER_ARROW_KEYS.includes(event.key)) {
|
|
640
540
|
isArrowKeyPressedRef.current = true;
|
|
@@ -668,7 +568,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
668
568
|
}
|
|
669
569
|
};
|
|
670
570
|
}, [focusContext, triggerId, itemValue, isTabStop, isDisabled]);
|
|
671
|
-
const onClick =
|
|
571
|
+
const onClick = React5__namespace.useCallback(
|
|
672
572
|
async (event) => {
|
|
673
573
|
triggerProps.onClick?.(event);
|
|
674
574
|
if (event.defaultPrevented) return;
|
|
@@ -682,7 +582,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
682
582
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
683
583
|
[isDisabled, context.nonInteractive, store, itemValue, value, steps, triggerProps.onClick]
|
|
684
584
|
);
|
|
685
|
-
const onFocus =
|
|
585
|
+
const onFocus = React5__namespace.useCallback(
|
|
686
586
|
async (event) => {
|
|
687
587
|
triggerProps.onFocus?.(event);
|
|
688
588
|
if (event.defaultPrevented) return;
|
|
@@ -697,20 +597,20 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
697
597
|
isMouseClickRef.current = false;
|
|
698
598
|
},
|
|
699
599
|
[
|
|
600
|
+
triggerProps,
|
|
700
601
|
focusContext,
|
|
701
602
|
triggerId,
|
|
702
|
-
activationMode,
|
|
703
603
|
isActive,
|
|
704
604
|
isDisabled,
|
|
605
|
+
activationMode,
|
|
705
606
|
context.nonInteractive,
|
|
706
|
-
store,
|
|
707
|
-
itemValue,
|
|
708
|
-
value,
|
|
709
607
|
steps,
|
|
710
|
-
|
|
608
|
+
value,
|
|
609
|
+
itemValue,
|
|
610
|
+
store
|
|
711
611
|
]
|
|
712
612
|
);
|
|
713
|
-
const onKeyDown =
|
|
613
|
+
const onKeyDown = React5__namespace.useCallback(
|
|
714
614
|
async (event) => {
|
|
715
615
|
triggerProps.onKeyDown?.(event);
|
|
716
616
|
if (event.defaultPrevented) return;
|
|
@@ -779,7 +679,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
779
679
|
steps
|
|
780
680
|
]
|
|
781
681
|
);
|
|
782
|
-
const onMouseDown =
|
|
682
|
+
const onMouseDown = React5__namespace.useCallback(
|
|
783
683
|
(event) => {
|
|
784
684
|
triggerProps.onMouseDown?.(event);
|
|
785
685
|
if (event.defaultPrevented) {
|
|
@@ -815,10 +715,9 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
|
|
|
815
715
|
"aria-selected": isActive,
|
|
816
716
|
"aria-setsize": stepCount,
|
|
817
717
|
className: chunkH2BWO3SI_cjs.cn(
|
|
818
|
-
"inline-flex w-full cursor-pointer items-center gap-3 rounded text-left transition-colors duration-
|
|
819
|
-
"
|
|
820
|
-
"
|
|
821
|
-
"focus-visible:ring-primary-500/50 focus-visible:z-10 focus-visible:ring-[3px]",
|
|
718
|
+
"inline-flex w-full cursor-pointer items-center gap-3 rounded text-left transition-colors duration-500 outline-none",
|
|
719
|
+
"disabled:pointer-events-none",
|
|
720
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
822
721
|
className
|
|
823
722
|
),
|
|
824
723
|
onClick,
|
|
@@ -847,9 +746,9 @@ function StepperIndicator({ className, children, asChild, ref, ...props }) {
|
|
|
847
746
|
dir,
|
|
848
747
|
ref,
|
|
849
748
|
className: chunkH2BWO3SI_cjs.cn(
|
|
850
|
-
"bg-
|
|
851
|
-
"data-[state=completed]:bg-success
|
|
852
|
-
"data-[state=active]:bg-primary
|
|
749
|
+
"bg-muted border-border text-muted-foreground relative flex size-6 shrink-0 items-center justify-center self-end overflow-hidden rounded-t border-x border-t text-xs transition-colors duration-500",
|
|
750
|
+
"data-[state=completed]:bg-success/50 data-[state=completed]:border-success data-[state=completed]:text-success-foreground",
|
|
751
|
+
"data-[state=active]:bg-primary/50 data-[state=active]:border-primary data-[state=active]:text-primary-foreground",
|
|
853
752
|
className
|
|
854
753
|
),
|
|
855
754
|
...props,
|
|
@@ -884,7 +783,7 @@ function StepperDescription({ className, asChild, ...props }) {
|
|
|
884
783
|
id: descriptionId,
|
|
885
784
|
"data-slot": "stepper-description",
|
|
886
785
|
dir: context.dir,
|
|
887
|
-
className: chunkH2BWO3SI_cjs.cn("text-
|
|
786
|
+
className: chunkH2BWO3SI_cjs.cn("text-muted-foreground text-sm", className),
|
|
888
787
|
...props
|
|
889
788
|
}
|
|
890
789
|
);
|
|
@@ -941,7 +840,7 @@ function StepperNextTrigger({ asChild = false, onClick, disabled, ...props }) {
|
|
|
941
840
|
const stepKeys = Array.from(steps.keys());
|
|
942
841
|
const currentIndex = value ? stepKeys.indexOf(value) : -1;
|
|
943
842
|
const isDisabled = disabled || currentIndex >= stepKeys.length - 1;
|
|
944
|
-
const handleClick =
|
|
843
|
+
const handleClick = React5__namespace.useCallback(
|
|
945
844
|
async (event) => {
|
|
946
845
|
onClick?.(event);
|
|
947
846
|
if (event.defaultPrevented || isDisabled) {
|
|
@@ -974,7 +873,7 @@ function StepperPrevTrigger({ asChild = false, disabled, onClick, ...props }) {
|
|
|
974
873
|
const stepKeys = Array.from(steps.keys());
|
|
975
874
|
const currentIndex = value ? stepKeys.indexOf(value) : -1;
|
|
976
875
|
const isDisabled = disabled || currentIndex <= 0;
|
|
977
|
-
const handleClick =
|
|
876
|
+
const handleClick = React5__namespace.useCallback(
|
|
978
877
|
async (event) => {
|
|
979
878
|
onClick?.(event);
|
|
980
879
|
if (event.defaultPrevented || isDisabled) {
|
|
@@ -1000,28 +899,120 @@ function StepperPrevTrigger({ asChild = false, disabled, onClick, ...props }) {
|
|
|
1000
899
|
}
|
|
1001
900
|
);
|
|
1002
901
|
}
|
|
1003
|
-
var
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
902
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
903
|
+
[
|
|
904
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded text-sm font-medium transition-all shrink-0 outline-none",
|
|
905
|
+
"disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
906
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
907
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
908
|
+
"aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error"
|
|
909
|
+
],
|
|
910
|
+
{
|
|
911
|
+
variants: {
|
|
912
|
+
variant: {
|
|
913
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
914
|
+
error: "bg-error text-white hover:bg-error/90 focus-visible:ring-error/20 dark:focus-visible:ring-error/40 dark:bg-error/60",
|
|
915
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
916
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
917
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
918
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
919
|
+
},
|
|
920
|
+
size: {
|
|
921
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
922
|
+
sm: "h-8 rounded gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
923
|
+
lg: "h-10 rounded px-6 has-[>svg]:px-4",
|
|
924
|
+
icon: "size-9",
|
|
925
|
+
"icon-sm": "size-8",
|
|
926
|
+
"icon-lg": "size-10"
|
|
927
|
+
},
|
|
928
|
+
fullWidth: {
|
|
929
|
+
true: "w-full"
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
defaultVariants: {
|
|
933
|
+
variant: "default",
|
|
934
|
+
size: "default",
|
|
935
|
+
fullWidth: false
|
|
936
|
+
}
|
|
1008
937
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
938
|
+
);
|
|
939
|
+
function Button({
|
|
940
|
+
asChild = false,
|
|
941
|
+
variant = "default",
|
|
942
|
+
disabled = false,
|
|
943
|
+
fullWidth = false,
|
|
944
|
+
loadingPosition: loadingPositionProp = "start",
|
|
945
|
+
children,
|
|
946
|
+
type = "button",
|
|
947
|
+
loading = false,
|
|
948
|
+
size = "default",
|
|
949
|
+
endIcon,
|
|
950
|
+
startIcon,
|
|
951
|
+
className,
|
|
952
|
+
...props
|
|
953
|
+
}) {
|
|
954
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
955
|
+
const isDisabled = disabled || loading;
|
|
956
|
+
const loadingPosition = size?.startsWith("icon") ? "center" : loadingPositionProp;
|
|
957
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
958
|
+
Comp,
|
|
959
|
+
{
|
|
960
|
+
"data-slot": "button",
|
|
961
|
+
"aria-disabled": isDisabled || void 0,
|
|
962
|
+
className: chunkH2BWO3SI_cjs.cn(buttonVariants({ fullWidth, size, variant }), className),
|
|
963
|
+
"data-state": loading ? "loading" : void 0,
|
|
964
|
+
disabled: isDisabled,
|
|
965
|
+
role: Comp !== "button" ? "button" : void 0,
|
|
966
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
967
|
+
type: Comp === "button" ? type : void 0,
|
|
968
|
+
"data-size": size,
|
|
969
|
+
"data-variant": variant,
|
|
970
|
+
...props,
|
|
971
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
972
|
+
ButtonContent,
|
|
973
|
+
{
|
|
974
|
+
loading,
|
|
975
|
+
size,
|
|
976
|
+
loadingPosition,
|
|
977
|
+
startIcon,
|
|
978
|
+
endIcon,
|
|
979
|
+
asChild,
|
|
980
|
+
children
|
|
981
|
+
}
|
|
982
|
+
)
|
|
983
|
+
}
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
function ButtonContent({
|
|
987
|
+
children,
|
|
988
|
+
loading = false,
|
|
989
|
+
loadingPosition = "start",
|
|
990
|
+
startIcon,
|
|
991
|
+
asChild,
|
|
992
|
+
endIcon,
|
|
993
|
+
...props
|
|
994
|
+
}) {
|
|
995
|
+
const isStartLoading = loading && loadingPosition === "start";
|
|
996
|
+
const StartIcon = isStartLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : startIcon || null;
|
|
997
|
+
const isEndLoading = loading && loadingPosition === "end";
|
|
998
|
+
const EndIcon = isEndLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : endIcon || null;
|
|
999
|
+
const isCenterLoading = loading && loadingPosition === "center";
|
|
1000
|
+
return asChild && React5__namespace.isValidElement(children) ? React5__namespace.cloneElement(
|
|
1001
|
+
children,
|
|
1002
|
+
props,
|
|
1003
|
+
/* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.Fragment, { children: [
|
|
1004
|
+
StartIcon,
|
|
1005
|
+
isCenterLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : React5__namespace.isValidElement(children) ? children.props?.children : null,
|
|
1006
|
+
EndIcon
|
|
1007
|
+
] })
|
|
1008
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(React5__namespace.Fragment, { children: [
|
|
1009
|
+
StartIcon,
|
|
1010
|
+
isCenterLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunk3WSQRFUY_cjs.Spinner, { "aria-label": "Loading" }) : children,
|
|
1011
|
+
EndIcon
|
|
1012
|
+
] });
|
|
1013
|
+
}
|
|
1017
1014
|
|
|
1018
|
-
exports.
|
|
1019
|
-
exports.FormControl = FormControl;
|
|
1020
|
-
exports.FormDescription = FormDescription;
|
|
1021
|
-
exports.FormField = FormField;
|
|
1022
|
-
exports.FormItem = FormItem;
|
|
1023
|
-
exports.FormLabel = FormLabel;
|
|
1024
|
-
exports.FormMessage = FormMessage;
|
|
1015
|
+
exports.Button = Button;
|
|
1025
1016
|
exports.Stepper = Stepper;
|
|
1026
1017
|
exports.StepperActivationMode = StepperActivationMode;
|
|
1027
1018
|
exports.StepperContent = StepperContent;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '../../chunk-5MJPZUTO.js';
|
|
2
2
|
import '../../chunk-ZD2QRAOX.js';
|
|
3
|
+
import '../../chunk-BYXBJQAS.js';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkI7AV5IQO_cjs = require('../../chunk-I7AV5IQO.cjs');
|
|
4
4
|
require('../../chunk-H2BWO3SI.cjs');
|
|
5
|
+
require('../../chunk-3376ZTRC.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
Object.defineProperty(exports, "Avatar", {
|
|
9
10
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkI7AV5IQO_cjs.Avatar; }
|
|
11
12
|
});
|
|
12
13
|
Object.defineProperty(exports, "AvatarFallback", {
|
|
13
14
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkI7AV5IQO_cjs.AvatarFallback; }
|
|
15
16
|
});
|
|
16
17
|
Object.defineProperty(exports, "AvatarImage", {
|
|
17
18
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkI7AV5IQO_cjs.AvatarImage; }
|
|
19
20
|
});
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Avatar as Avatar$1 } from 'radix-ui';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
4
|
|
|
7
|
-
type AvatarProps = Avatar$1.
|
|
8
|
-
|
|
9
|
-
* Defines avatar size
|
|
10
|
-
*/
|
|
11
|
-
size?: AvatarSizeType;
|
|
12
|
-
};
|
|
13
|
-
declare function Avatar({ className, size, ref, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
14
|
-
|
|
15
|
-
declare const avatarCva: (props?: ({
|
|
16
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
17
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
18
|
-
|
|
19
|
-
type AvatarCvaProps = VariantProps<typeof avatarCva>;
|
|
20
|
-
type AvatarSizeType = NonNullable<AvatarCvaProps["size"]>;
|
|
5
|
+
type AvatarProps = React.ComponentProps<typeof Avatar$1.Root>;
|
|
6
|
+
declare function Avatar({ className, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
21
7
|
|
|
22
8
|
type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
|
|
23
|
-
declare function AvatarImage({ className,
|
|
9
|
+
declare function AvatarImage({ className, ...props }: AvatarImageProps): react_jsx_runtime.JSX.Element;
|
|
24
10
|
|
|
25
11
|
type AvatarFallbackProps = React.ComponentProps<typeof Avatar$1.Fallback>;
|
|
26
|
-
declare function AvatarFallback({ className,
|
|
12
|
+
declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): react_jsx_runtime.JSX.Element;
|
|
27
13
|
|
|
28
|
-
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps
|
|
14
|
+
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps };
|