@cerberus-design/react 0.15.0-next-e0ce56e → 0.15.0-next-5d7dc1e
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/build/legacy/_tsup-dts-rollup.d.cts +491 -119
- package/build/legacy/components/DatePicker.client.cjs +67 -89
- package/build/legacy/components/DatePicker.client.cjs.map +1 -1
- package/build/legacy/components/Fieldset.cjs +4 -17
- package/build/legacy/components/Fieldset.cjs.map +1 -1
- package/build/legacy/components/FieldsetLabel.cjs.map +1 -1
- package/build/legacy/components/FileStatus.cjs +126 -79
- package/build/legacy/components/FileStatus.cjs.map +1 -1
- package/build/legacy/components/Legend.cjs +10 -22
- package/build/legacy/components/Legend.cjs.map +1 -1
- package/build/legacy/components/Radio.cjs +4 -21
- package/build/legacy/components/Radio.cjs.map +1 -1
- package/build/legacy/components/Select.cjs +19 -54
- package/build/legacy/components/Select.cjs.map +1 -1
- package/build/legacy/components/Toggle.cjs +17 -24
- package/build/legacy/components/Toggle.cjs.map +1 -1
- package/build/legacy/components/button/button.cjs +1 -1
- package/build/legacy/components/button/button.cjs.map +1 -1
- package/build/legacy/components/button/index.cjs +1 -1
- package/build/legacy/components/button/index.cjs.map +1 -1
- package/build/legacy/components/button/parts.cjs +1 -1
- package/build/legacy/components/button/parts.cjs.map +1 -1
- package/build/legacy/components/checkbox/checkbox-icon.cjs +121 -0
- package/build/legacy/components/checkbox/checkbox-icon.cjs.map +1 -0
- package/build/legacy/components/checkbox/checkbox.cjs +165 -0
- package/build/legacy/components/checkbox/checkbox.cjs.map +1 -0
- package/build/legacy/components/checkbox/index.cjs +179 -0
- package/build/legacy/components/checkbox/index.cjs.map +1 -0
- package/build/legacy/components/checkbox/parts.cjs +89 -0
- package/build/legacy/components/checkbox/parts.cjs.map +1 -0
- package/build/legacy/components/checkbox/primitives.cjs +87 -0
- package/build/legacy/components/checkbox/primitives.cjs.map +1 -0
- package/build/legacy/components/{FieldMessage.cjs → deprecated/FieldMessage.cjs} +4 -17
- package/build/legacy/components/deprecated/FieldMessage.cjs.map +1 -0
- package/build/legacy/components/{Textarea.cjs → deprecated/Label.cjs} +24 -36
- package/build/legacy/components/deprecated/Label.cjs.map +1 -0
- package/build/legacy/components/field/field.cjs +130 -0
- package/build/legacy/components/field/field.cjs.map +1 -0
- package/build/legacy/components/field/index.cjs +267 -0
- package/build/legacy/components/field/index.cjs.map +1 -0
- package/build/legacy/components/field/parts.cjs +188 -0
- package/build/legacy/components/field/parts.cjs.map +1 -0
- package/build/legacy/components/field/primitives.cjs +191 -0
- package/build/legacy/components/field/primitives.cjs.map +1 -0
- package/build/legacy/components/field/start-indicator.cjs +45 -0
- package/build/legacy/components/field/start-indicator.cjs.map +1 -0
- package/build/legacy/components/field/status-indicator.cjs +78 -0
- package/build/legacy/components/field/status-indicator.cjs.map +1 -0
- package/build/legacy/components/for.cjs +38 -0
- package/build/legacy/components/for.cjs.map +1 -0
- package/build/legacy/context/confirm-modal.cjs +1 -1
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/cta-modal.cjs +1 -1
- package/build/legacy/context/cta-modal.cjs.map +1 -1
- package/build/legacy/context/field.cjs +23 -4
- package/build/legacy/context/field.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +168 -166
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/hooks/useDate.cjs.map +1 -1
- package/build/legacy/index.cjs +1274 -1123
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/utils/index.cjs +22 -2
- package/build/legacy/utils/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +491 -119
- package/build/modern/{chunk-2JX27W6Y.js → chunk-2BIHLH4V.js} +2 -2
- package/build/modern/chunk-2BIHLH4V.js.map +1 -0
- package/build/modern/{chunk-3ZDFQO25.js → chunk-6EUC3SUI.js} +4 -7
- package/build/modern/chunk-6EUC3SUI.js.map +1 -0
- package/build/modern/chunk-6I2FW4WI.js +33 -0
- package/build/modern/chunk-6I2FW4WI.js.map +1 -0
- package/build/modern/{chunk-MER66QUY.js → chunk-6KZVE4HC.js} +1 -1
- package/build/modern/{chunk-MER66QUY.js.map → chunk-6KZVE4HC.js.map} +1 -1
- package/build/modern/{chunk-FTPZHG6J.js → chunk-6WOJAMZV.js} +3 -9
- package/build/modern/chunk-6WOJAMZV.js.map +1 -0
- package/build/modern/chunk-77FJSNGD.js +13 -0
- package/build/modern/chunk-77FJSNGD.js.map +1 -0
- package/build/modern/chunk-BL7G3577.js +29 -0
- package/build/modern/chunk-BL7G3577.js.map +1 -0
- package/build/modern/chunk-BPRF34DU.js +62 -0
- package/build/modern/chunk-BPRF34DU.js.map +1 -0
- package/build/modern/{chunk-7P7OWBGV.js → chunk-CF3EHG42.js} +10 -10
- package/build/modern/chunk-CF3EHG42.js.map +1 -0
- package/build/modern/{chunk-Q4IV5NUT.js → chunk-CMYD5KWA.js} +40 -43
- package/build/modern/chunk-CMYD5KWA.js.map +1 -0
- package/build/modern/chunk-CNA2VKAH.js +43 -0
- package/build/modern/chunk-CNA2VKAH.js.map +1 -0
- package/build/modern/chunk-EL4MX2PG.js +22 -0
- package/build/modern/chunk-EL4MX2PG.js.map +1 -0
- package/build/modern/chunk-FBS7AX76.js +37 -0
- package/build/modern/chunk-FBS7AX76.js.map +1 -0
- package/build/modern/{chunk-KU2AWAK3.js → chunk-FK52US7K.js} +7 -20
- package/build/modern/chunk-FK52US7K.js.map +1 -0
- package/build/modern/{chunk-Z7FGXAND.js → chunk-FMRWRVUS.js} +2 -2
- package/build/modern/{chunk-XQICKZH4.js → chunk-GENS32QO.js} +10 -8
- package/build/modern/chunk-GENS32QO.js.map +1 -0
- package/build/modern/{chunk-7S47NSGR.js → chunk-H54FR7IP.js} +2 -2
- package/build/modern/chunk-KWZ3CEG6.js +23 -0
- package/build/modern/chunk-KWZ3CEG6.js.map +1 -0
- package/build/modern/{chunk-JWIJHSI6.js → chunk-L7N24B6B.js} +3 -6
- package/build/modern/chunk-L7N24B6B.js.map +1 -0
- package/build/modern/chunk-LT62577B.js +23 -0
- package/build/modern/chunk-LT62577B.js.map +1 -0
- package/build/modern/{chunk-3BM6MZ4A.js → chunk-MWRO5QYD.js} +1 -1
- package/build/modern/chunk-MWRO5QYD.js.map +1 -0
- package/build/modern/{chunk-PZAZKQMO.js → chunk-OYT7RGC7.js} +1 -1
- package/build/modern/chunk-OYT7RGC7.js.map +1 -0
- package/build/modern/{chunk-ILQW5VZT.js → chunk-RBNOEAWJ.js} +4 -7
- package/build/modern/chunk-RBNOEAWJ.js.map +1 -0
- package/build/modern/{chunk-5QONP7GT.js → chunk-S2X5OEPK.js} +2 -10
- package/build/modern/chunk-S2X5OEPK.js.map +1 -0
- package/build/modern/chunk-TIJAFPHQ.js +1 -0
- package/build/modern/chunk-TYPULJMJ.js +1 -0
- package/build/modern/chunk-UNN4LHRS.js +31 -0
- package/build/modern/chunk-UNN4LHRS.js.map +1 -0
- package/build/modern/chunk-VSTOSLFS.js +100 -0
- package/build/modern/chunk-VSTOSLFS.js.map +1 -0
- package/build/modern/chunk-Z52R6ABJ.js +21 -0
- package/build/modern/chunk-Z52R6ABJ.js.map +1 -0
- package/build/modern/{chunk-3RGRHMJQ.js → chunk-ZDANBCM3.js} +2 -2
- package/build/modern/components/AccordionItemGroup.js +1 -1
- package/build/modern/components/DatePicker.client.js +4 -5
- package/build/modern/components/Fieldset.js +1 -2
- package/build/modern/components/FieldsetLabel.js +1 -1
- package/build/modern/components/FileStatus.js +10 -4
- package/build/modern/components/Legend.js +1 -2
- package/build/modern/components/Radio.js +1 -3
- package/build/modern/components/Select.js +1 -2
- package/build/modern/components/Toggle.js +1 -2
- package/build/modern/components/button/button.js +1 -1
- package/build/modern/components/button/index.js +2 -2
- package/build/modern/components/button/parts.js +2 -2
- package/build/modern/components/checkbox/checkbox-icon.js +12 -0
- package/build/modern/components/checkbox/checkbox.js +13 -0
- package/build/modern/components/checkbox/index.js +30 -0
- package/build/modern/components/checkbox/parts.js +8 -0
- package/build/modern/components/checkbox/parts.js.map +1 -0
- package/build/modern/components/checkbox/primitives.js +17 -0
- package/build/modern/components/checkbox/primitives.js.map +1 -0
- package/build/modern/components/deprecated/FieldMessage.js +8 -0
- package/build/modern/components/deprecated/FieldMessage.js.map +1 -0
- package/build/modern/components/deprecated/Label.js +17 -0
- package/build/modern/components/deprecated/Label.js.map +1 -0
- package/build/modern/components/field/field.js +14 -0
- package/build/modern/components/field/field.js.map +1 -0
- package/build/modern/components/field/index.js +44 -0
- package/build/modern/components/field/index.js.map +1 -0
- package/build/modern/components/field/parts.js +11 -0
- package/build/modern/components/field/parts.js.map +1 -0
- package/build/modern/components/field/primitives.js +26 -0
- package/build/modern/components/field/primitives.js.map +1 -0
- package/build/modern/components/field/start-indicator.js +7 -0
- package/build/modern/components/field/start-indicator.js.map +1 -0
- package/build/modern/components/field/status-indicator.js +9 -0
- package/build/modern/components/field/status-indicator.js.map +1 -0
- package/build/modern/components/for.js +7 -0
- package/build/modern/components/for.js.map +1 -0
- package/build/modern/context/confirm-modal.js +3 -3
- package/build/modern/context/cta-modal.js +4 -4
- package/build/modern/context/field.js +34 -4
- package/build/modern/context/field.js.map +1 -1
- package/build/modern/context/notification-center.js +2 -2
- package/build/modern/context/prompt-modal.js +12 -7
- package/build/modern/hooks/useDate.js +1 -1
- package/build/modern/index.js +131 -82
- package/build/modern/index.js.map +1 -1
- package/build/modern/utils/index.js +5 -3
- package/package.json +2 -2
- package/src/components/DatePicker.client.tsx +2 -14
- package/src/components/Fieldset.tsx +3 -3
- package/src/components/FieldsetLabel.tsx +5 -2
- package/src/components/FileStatus.tsx +4 -5
- package/src/components/Legend.tsx +5 -6
- package/src/components/Radio.tsx +2 -7
- package/src/components/Select.tsx +1 -16
- package/src/components/Toggle.tsx +14 -7
- package/src/components/button/button.tsx +1 -1
- package/src/components/button/parts.ts +6 -0
- package/src/components/checkbox/checkbox-icon.tsx +39 -0
- package/src/components/checkbox/checkbox.tsx +48 -0
- package/src/components/checkbox/index.ts +3 -0
- package/src/components/checkbox/parts.ts +59 -0
- package/src/components/checkbox/primitives.tsx +104 -0
- package/src/components/{FieldMessage.tsx → deprecated/FieldMessage.tsx} +2 -13
- package/src/components/deprecated/Label.tsx +24 -0
- package/src/components/field/field.tsx +77 -0
- package/src/components/field/index.ts +5 -0
- package/src/components/field/parts.ts +77 -0
- package/src/components/field/primitives.tsx +204 -0
- package/src/components/field/start-indicator.tsx +23 -0
- package/src/components/field/status-indicator.tsx +58 -0
- package/src/components/for.tsx +43 -0
- package/src/context/field.tsx +6 -5
- package/src/context/prompt-modal.tsx +16 -18
- package/src/hooks/useDate.ts +1 -7
- package/src/index.ts +6 -7
- package/src/utils/index.ts +30 -0
- package/build/legacy/components/Checkbox.cjs +0 -113
- package/build/legacy/components/Checkbox.cjs.map +0 -1
- package/build/legacy/components/FieldMessage.cjs.map +0 -1
- package/build/legacy/components/Input.cjs +0 -95
- package/build/legacy/components/Input.cjs.map +0 -1
- package/build/legacy/components/Label.cjs +0 -93
- package/build/legacy/components/Label.cjs.map +0 -1
- package/build/legacy/components/Textarea.cjs.map +0 -1
- package/build/modern/chunk-2JX27W6Y.js.map +0 -1
- package/build/modern/chunk-3BM6MZ4A.js.map +0 -1
- package/build/modern/chunk-3ZDFQO25.js.map +0 -1
- package/build/modern/chunk-5QONP7GT.js.map +0 -1
- package/build/modern/chunk-7P7OWBGV.js.map +0 -1
- package/build/modern/chunk-C5EHJUS5.js +0 -10
- package/build/modern/chunk-C5EHJUS5.js.map +0 -1
- package/build/modern/chunk-FTPZHG6J.js.map +0 -1
- package/build/modern/chunk-ILQW5VZT.js.map +0 -1
- package/build/modern/chunk-JIJM6JFJ.js +0 -36
- package/build/modern/chunk-JIJM6JFJ.js.map +0 -1
- package/build/modern/chunk-JWIJHSI6.js.map +0 -1
- package/build/modern/chunk-KU2AWAK3.js.map +0 -1
- package/build/modern/chunk-NGOLRISW.js +0 -63
- package/build/modern/chunk-NGOLRISW.js.map +0 -1
- package/build/modern/chunk-NMF2HYWO.js +0 -50
- package/build/modern/chunk-NMF2HYWO.js.map +0 -1
- package/build/modern/chunk-PZAZKQMO.js.map +0 -1
- package/build/modern/chunk-Q4IV5NUT.js.map +0 -1
- package/build/modern/chunk-UZDVOIW5.js +0 -33
- package/build/modern/chunk-UZDVOIW5.js.map +0 -1
- package/build/modern/chunk-VYCU7I4J.js +0 -43
- package/build/modern/chunk-VYCU7I4J.js.map +0 -1
- package/build/modern/chunk-XQICKZH4.js.map +0 -1
- package/build/modern/components/Checkbox.js +0 -11
- package/build/modern/components/FieldMessage.js +0 -9
- package/build/modern/components/Input.js +0 -11
- package/build/modern/components/Label.js +0 -10
- package/build/modern/components/Textarea.js +0 -9
- package/src/components/Checkbox.tsx +0 -93
- package/src/components/Input.tsx +0 -69
- package/src/components/Label.tsx +0 -69
- package/src/components/Textarea.tsx +0 -52
- /package/build/modern/{chunk-Z7FGXAND.js.map → chunk-FMRWRVUS.js.map} +0 -0
- /package/build/modern/{chunk-7S47NSGR.js.map → chunk-H54FR7IP.js.map} +0 -0
- /package/build/modern/{components/Checkbox.js.map → chunk-TIJAFPHQ.js.map} +0 -0
- /package/build/modern/{components/FieldMessage.js.map → chunk-TYPULJMJ.js.map} +0 -0
- /package/build/modern/{chunk-3RGRHMJQ.js.map → chunk-ZDANBCM3.js.map} +0 -0
- /package/build/modern/components/{Input.js.map → checkbox/checkbox-icon.js.map} +0 -0
- /package/build/modern/components/{Label.js.map → checkbox/checkbox.js.map} +0 -0
- /package/build/modern/components/{Textarea.js.map → checkbox/index.js.map} +0 -0
package/build/legacy/index.cjs
CHANGED
|
@@ -36,7 +36,14 @@ __export(src_exports, {
|
|
|
36
36
|
ButtonParts: () => ButtonParts,
|
|
37
37
|
CTAModal: () => CTAModal,
|
|
38
38
|
CerberusProvider: () => CerberusProvider,
|
|
39
|
-
Checkbox: () =>
|
|
39
|
+
Checkbox: () => Checkbox2,
|
|
40
|
+
CheckboxControl: () => CheckboxControl,
|
|
41
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
42
|
+
CheckboxHiddenInput: () => CheckboxHiddenInput,
|
|
43
|
+
CheckboxIndicator: () => CheckboxIndicator,
|
|
44
|
+
CheckboxLabel: () => CheckboxLabel,
|
|
45
|
+
CheckboxParts: () => CheckboxParts,
|
|
46
|
+
CheckboxRoot: () => CheckboxRoot,
|
|
40
47
|
CircularProgress: () => CircularProgress,
|
|
41
48
|
ConfirmModal: () => ConfirmModal,
|
|
42
49
|
DateFormats: () => DateFormats,
|
|
@@ -70,12 +77,23 @@ __export(src_exports, {
|
|
|
70
77
|
Droppable: () => Droppable,
|
|
71
78
|
FeatureFlag: () => FeatureFlag,
|
|
72
79
|
FeatureFlags: () => FeatureFlags,
|
|
73
|
-
Field: () =>
|
|
80
|
+
Field: () => Field2,
|
|
81
|
+
FieldErrorText: () => FieldErrorText,
|
|
82
|
+
FieldHelperText: () => FieldHelperText,
|
|
83
|
+
FieldInput: () => FieldInput,
|
|
84
|
+
FieldLabel: () => FieldLabel,
|
|
74
85
|
FieldMessage: () => FieldMessage,
|
|
86
|
+
FieldParts: () => FieldParts,
|
|
87
|
+
FieldRequiredIndicator: () => FieldRequiredIndicator,
|
|
88
|
+
FieldRoot: () => FieldRoot,
|
|
89
|
+
FieldStartIndicator: () => FieldStartIndicator,
|
|
90
|
+
FieldStatusIndicator: () => FieldStatusIndicator,
|
|
91
|
+
FieldTextarea: () => FieldTextarea,
|
|
75
92
|
Fieldset: () => Fieldset,
|
|
76
93
|
FieldsetLabel: () => FieldsetLabel,
|
|
77
94
|
FileStatus: () => FileStatus,
|
|
78
95
|
FileUploader: () => FileUploader,
|
|
96
|
+
For: () => For,
|
|
79
97
|
IconButton: () => IconButton,
|
|
80
98
|
Input: () => Input,
|
|
81
99
|
Label: () => Label,
|
|
@@ -157,13 +175,13 @@ __export(src_exports, {
|
|
|
157
175
|
makeSystemConfig: () => makeSystemConfig,
|
|
158
176
|
processStatus: () => processStatus,
|
|
159
177
|
setLocalStorage: () => setLocalStorage,
|
|
178
|
+
splitProps: () => splitProps,
|
|
160
179
|
trapFocus: () => trapFocus,
|
|
161
180
|
useCTAModal: () => useCTAModal,
|
|
162
181
|
useCerberusContext: () => useCerberusContext,
|
|
163
182
|
useConfirmModal: () => useConfirmModal,
|
|
164
183
|
useDate: () => useDate,
|
|
165
184
|
useFeatureFlags: () => useFeatureFlags,
|
|
166
|
-
useFieldContext: () => useFieldContext,
|
|
167
185
|
useModal: () => useModal,
|
|
168
186
|
useNavMenuContext: () => useNavMenuContext,
|
|
169
187
|
useNotificationCenter: () => useNotificationCenter,
|
|
@@ -176,33 +194,300 @@ __export(src_exports, {
|
|
|
176
194
|
});
|
|
177
195
|
module.exports = __toCommonJS(src_exports);
|
|
178
196
|
|
|
179
|
-
// src/components/deprecated/
|
|
197
|
+
// src/components/deprecated/FieldMessage.tsx
|
|
180
198
|
var import_css = require("@cerberus/styled-system/css");
|
|
181
199
|
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
182
|
-
var
|
|
200
|
+
var import_field = require("@ark-ui/react/field");
|
|
183
201
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
184
|
-
function
|
|
202
|
+
function FieldMessage(props) {
|
|
203
|
+
const { invalid } = (0, import_field.useFieldContext)();
|
|
185
204
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
205
|
+
"small",
|
|
206
|
+
{
|
|
207
|
+
...props,
|
|
208
|
+
...invalid && { "aria-invalid": true },
|
|
209
|
+
className: (0, import_css.cx)(props.className, (0, import_recipes.fieldMessage)())
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// src/components/deprecated/Label.tsx
|
|
215
|
+
var import_recipes5 = require("@cerberus/styled-system/recipes");
|
|
216
|
+
var import_css5 = require("@cerberus/styled-system/css");
|
|
217
|
+
|
|
218
|
+
// src/utils/localStorage.ts
|
|
219
|
+
function getLocalStorage(key, defaultValue) {
|
|
220
|
+
const value = window.localStorage.getItem(key);
|
|
221
|
+
if (value) {
|
|
222
|
+
return value;
|
|
223
|
+
}
|
|
224
|
+
return defaultValue;
|
|
225
|
+
}
|
|
226
|
+
function setLocalStorage(key, value) {
|
|
227
|
+
const stringValue = typeof value === "string" ? value : JSON.stringify(value);
|
|
228
|
+
window.localStorage.setItem(key, stringValue);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/utils/index.ts
|
|
232
|
+
function formatNotifyCount(count) {
|
|
233
|
+
if (count > 99) return "99+";
|
|
234
|
+
return count.toString();
|
|
235
|
+
}
|
|
236
|
+
function splitProps(props, ...keyGroups) {
|
|
237
|
+
const result = keyGroups.map(() => ({}));
|
|
238
|
+
const rest = {};
|
|
239
|
+
for (const key in props) {
|
|
240
|
+
let assigned = false;
|
|
241
|
+
for (let i = 0; i < keyGroups.length; i++) {
|
|
242
|
+
if (keyGroups[i].includes(key)) {
|
|
243
|
+
result[i][key] = props[key];
|
|
244
|
+
assigned = true;
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (!assigned) {
|
|
249
|
+
rest[key] = props[key];
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return [...result, rest];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/components/field/primitives.tsx
|
|
256
|
+
var import_field2 = require("@ark-ui/react/field");
|
|
257
|
+
var import_css4 = require("@cerberus/styled-system/css");
|
|
258
|
+
var import_recipes4 = require("@cerberus/styled-system/recipes");
|
|
259
|
+
|
|
260
|
+
// src/components/field/status-indicator.tsx
|
|
261
|
+
var import_react2 = require("@ark-ui/react");
|
|
262
|
+
var import_css2 = require("@cerberus/styled-system/css");
|
|
263
|
+
var import_recipes2 = require("@cerberus/styled-system/recipes");
|
|
264
|
+
|
|
265
|
+
// src/context/cerberus.tsx
|
|
266
|
+
var import_react = require("react");
|
|
267
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
268
|
+
var CerberusContext = (0, import_react.createContext)(null);
|
|
269
|
+
function CerberusProvider(props) {
|
|
270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CerberusContext.Provider, { value: props.config, children: props.children });
|
|
271
|
+
}
|
|
272
|
+
function useCerberusContext() {
|
|
273
|
+
const context = (0, import_react.useContext)(CerberusContext);
|
|
274
|
+
if (!context) {
|
|
275
|
+
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
276
|
+
}
|
|
277
|
+
return context;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// src/components/field/status-indicator.tsx
|
|
281
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
282
|
+
function FieldStatusIndicator(props) {
|
|
283
|
+
const { fallback, ...nativeProps } = props;
|
|
284
|
+
const styles = (0, import_recipes2.field)();
|
|
285
|
+
const fieldContext = (0, import_react2.useFieldContext)();
|
|
286
|
+
const { icons } = useCerberusContext();
|
|
287
|
+
const { invalid: InvalidIcon } = icons;
|
|
288
|
+
if (fieldContext.invalid) {
|
|
289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
290
|
+
"span",
|
|
291
|
+
{
|
|
292
|
+
...nativeProps,
|
|
293
|
+
"aria-hidden": "true",
|
|
294
|
+
"data-invalid": true,
|
|
295
|
+
className: (0, import_css2.cx)(nativeProps.className, styles.statusIndicator),
|
|
296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InvalidIcon, {})
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
301
|
+
"span",
|
|
302
|
+
{
|
|
303
|
+
...nativeProps,
|
|
304
|
+
"aria-hidden": "true",
|
|
305
|
+
"data-part": "end-indicator",
|
|
306
|
+
className: (0, import_css2.cx)(nativeProps.className, styles.endIndicator),
|
|
307
|
+
children: fallback
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// src/components/field/start-indicator.tsx
|
|
313
|
+
var import_css3 = require("@cerberus/styled-system/css");
|
|
314
|
+
var import_recipes3 = require("@cerberus/styled-system/recipes");
|
|
315
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
316
|
+
function FieldStartIndicator(props) {
|
|
317
|
+
const styles = (0, import_recipes3.field)();
|
|
318
|
+
if (!props.children) return null;
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
320
|
+
"span",
|
|
321
|
+
{
|
|
322
|
+
...props,
|
|
323
|
+
"data-part": "start-indicator",
|
|
324
|
+
className: (0, import_css3.cx)(props.className, styles.startIndicator)
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// src/components/field/primitives.tsx
|
|
330
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
331
|
+
function FieldRoot(props) {
|
|
332
|
+
const { size, ...fieldProps } = props;
|
|
333
|
+
const styles = (0, import_recipes4.field)({ size });
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
335
|
+
import_field2.Field.Root,
|
|
336
|
+
{
|
|
337
|
+
...fieldProps,
|
|
338
|
+
className: (0, import_css4.cx)(styles.root, fieldProps.className)
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
function FieldLabel(props) {
|
|
343
|
+
const { children, ...nativeProps } = props;
|
|
344
|
+
const styles = (0, import_recipes4.field)();
|
|
345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_field2.Field.Label, { ...nativeProps, className: (0, import_css4.cx)(styles.label, props.className), children: [
|
|
346
|
+
children,
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_field2.Field.RequiredIndicator, { children: "(required)" })
|
|
348
|
+
] });
|
|
349
|
+
}
|
|
350
|
+
function FieldRequiredIndicator() {
|
|
351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_field2.Field.RequiredIndicator, { children: "(required)" });
|
|
352
|
+
}
|
|
353
|
+
function FieldInput(props) {
|
|
354
|
+
const { size, startIcon, endIcon, ...fieldProps } = props;
|
|
355
|
+
const styles = (0, import_recipes4.field)({ size });
|
|
356
|
+
const hasStartIcon = Boolean(startIcon);
|
|
357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.inputRoot, children: [
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldStartIndicator, { children: startIcon }),
|
|
359
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
360
|
+
import_field2.Field.Input,
|
|
361
|
+
{
|
|
362
|
+
...fieldProps,
|
|
363
|
+
...hasStartIcon && { "data-has": "start-indicator" },
|
|
364
|
+
className: (0, import_css4.cx)(styles.input, fieldProps.className)
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldStatusIndicator, { fallback: endIcon })
|
|
368
|
+
] });
|
|
369
|
+
}
|
|
370
|
+
function FieldHelperText(props) {
|
|
371
|
+
const styles = (0, import_recipes4.field)();
|
|
372
|
+
if (!props.children) return null;
|
|
373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
374
|
+
import_field2.Field.HelperText,
|
|
375
|
+
{
|
|
376
|
+
...props,
|
|
377
|
+
className: (0, import_css4.cx)(styles.helperText, props.className)
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
function FieldErrorText(props) {
|
|
382
|
+
const styles = (0, import_recipes4.field)();
|
|
383
|
+
if (!props.children) return null;
|
|
384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
385
|
+
import_field2.Field.ErrorText,
|
|
386
|
+
{
|
|
387
|
+
...props,
|
|
388
|
+
className: (0, import_css4.cx)(styles.errorText, props.className)
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
function FieldTextarea(props) {
|
|
393
|
+
const styles = (0, import_recipes4.field)();
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
395
|
+
import_field2.Field.Textarea,
|
|
396
|
+
{
|
|
397
|
+
...props,
|
|
398
|
+
className: (0, import_css4.cx)(styles.textarea, props.className)
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
var Input = FieldInput;
|
|
403
|
+
var Textarea = FieldTextarea;
|
|
404
|
+
|
|
405
|
+
// src/components/field/field.tsx
|
|
406
|
+
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
407
|
+
|
|
408
|
+
// src/components/Show.tsx
|
|
409
|
+
var import_react3 = require("react");
|
|
410
|
+
function Show(props) {
|
|
411
|
+
const { when, children, fallback } = props;
|
|
412
|
+
const condition = (0, import_react3.useMemo)(() => when ?? false, [when]);
|
|
413
|
+
return (0, import_react3.useMemo)(() => {
|
|
414
|
+
if (condition) return children;
|
|
415
|
+
return fallback ?? null;
|
|
416
|
+
}, [condition, children, fallback]);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// src/components/field/field.tsx
|
|
420
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
421
|
+
function Field2(props) {
|
|
422
|
+
const [statusProps, fieldProps, rootProps] = splitProps(
|
|
423
|
+
props,
|
|
424
|
+
["disabled", "required", "readOnly", "invalid"],
|
|
425
|
+
["label", "helperText", "secondaryHelperText", "errorText", "children"]
|
|
426
|
+
);
|
|
427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(FieldRoot, { ...statusProps, ...rootProps, children: [
|
|
428
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: Boolean(fieldProps.label), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldLabel, { children: fieldProps.label }) }),
|
|
429
|
+
fieldProps.children,
|
|
430
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: Boolean(fieldProps.helperText && !statusProps.invalid), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx.HStack, { justifyContent: "space-between", w: "full", children: [
|
|
431
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldHelperText, { children: fieldProps.helperText }),
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: Boolean(fieldProps.secondaryHelperText), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldHelperText, { children: fieldProps.secondaryHelperText }) })
|
|
433
|
+
] }) }),
|
|
434
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldErrorText, { children: fieldProps.errorText })
|
|
435
|
+
] });
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// src/components/field/parts.ts
|
|
439
|
+
var FieldParts = {
|
|
440
|
+
Root: FieldRoot,
|
|
441
|
+
Label: FieldLabel,
|
|
442
|
+
Input: FieldInput,
|
|
443
|
+
Textarea: FieldTextarea,
|
|
444
|
+
HelperText: FieldHelperText,
|
|
445
|
+
ErrorText: FieldErrorText,
|
|
446
|
+
StartIndicator: FieldStartIndicator,
|
|
447
|
+
StatusIndicator: FieldStatusIndicator,
|
|
448
|
+
RequiredIndicator: FieldRequiredIndicator
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// src/components/deprecated/Label.tsx
|
|
452
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
453
|
+
function Label(props) {
|
|
454
|
+
const { size, ...nativeProps } = props;
|
|
455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
456
|
+
FieldLabel,
|
|
457
|
+
{
|
|
458
|
+
...nativeProps,
|
|
459
|
+
className: (0, import_css5.cx)((0, import_recipes5.label)({ size }), props.className)
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// src/components/deprecated/Modal.tsx
|
|
465
|
+
var import_css6 = require("@cerberus/styled-system/css");
|
|
466
|
+
var import_recipes6 = require("@cerberus/styled-system/recipes");
|
|
467
|
+
var import_react4 = require("react");
|
|
468
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
469
|
+
function ModalEl(props, ref) {
|
|
470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
186
471
|
"dialog",
|
|
187
472
|
{
|
|
188
473
|
...props,
|
|
189
|
-
className: (0,
|
|
474
|
+
className: (0, import_css6.cx)(props.className, (0, import_recipes6.modal)().dialog),
|
|
190
475
|
ref
|
|
191
476
|
}
|
|
192
477
|
);
|
|
193
478
|
}
|
|
194
|
-
var Modal = (0,
|
|
479
|
+
var Modal = (0, import_react4.forwardRef)(ModalEl);
|
|
195
480
|
|
|
196
481
|
// src/components/deprecated/ModalHeader.tsx
|
|
197
|
-
var
|
|
482
|
+
var import_css7 = require("@cerberus/styled-system/css");
|
|
198
483
|
var import_patterns = require("@cerberus/styled-system/patterns");
|
|
199
|
-
var
|
|
484
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
200
485
|
function ModalHeader(props) {
|
|
201
|
-
return /* @__PURE__ */ (0,
|
|
486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
202
487
|
"div",
|
|
203
488
|
{
|
|
204
489
|
...props,
|
|
205
|
-
className: (0,
|
|
490
|
+
className: (0, import_css7.cx)(
|
|
206
491
|
props.className,
|
|
207
492
|
(0, import_patterns.vstack)({
|
|
208
493
|
alignItems: "flex-start",
|
|
@@ -215,25 +500,25 @@ function ModalHeader(props) {
|
|
|
215
500
|
}
|
|
216
501
|
|
|
217
502
|
// src/components/deprecated/ModalHeading.tsx
|
|
218
|
-
var
|
|
219
|
-
var
|
|
220
|
-
var
|
|
503
|
+
var import_css8 = require("@cerberus/styled-system/css");
|
|
504
|
+
var import_recipes7 = require("@cerberus/styled-system/recipes");
|
|
505
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
221
506
|
function ModalHeading(props) {
|
|
222
|
-
return /* @__PURE__ */ (0,
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { ...props, className: (0, import_css8.cx)(props.className, (0, import_recipes7.modal)().heading) });
|
|
223
508
|
}
|
|
224
509
|
|
|
225
510
|
// src/components/deprecated/ModalDescription.tsx
|
|
226
|
-
var
|
|
227
|
-
var
|
|
228
|
-
var
|
|
511
|
+
var import_css9 = require("@cerberus/styled-system/css");
|
|
512
|
+
var import_recipes8 = require("@cerberus/styled-system/recipes");
|
|
513
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
229
514
|
function ModalDescription(props) {
|
|
230
|
-
return /* @__PURE__ */ (0,
|
|
515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { ...props, className: (0, import_css9.cx)(props.className, (0, import_recipes8.modal)().description) });
|
|
231
516
|
}
|
|
232
517
|
|
|
233
518
|
// src/components/deprecated/NavMenuTrigger.tsx
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
var
|
|
519
|
+
var import_react6 = require("react");
|
|
520
|
+
var import_css11 = require("@cerberus/styled-system/css");
|
|
521
|
+
var import_recipes9 = require("@cerberus/styled-system/recipes");
|
|
237
522
|
|
|
238
523
|
// src/aria-helpers/nav-menu.aria.ts
|
|
239
524
|
function createNavTriggerProps(values) {
|
|
@@ -244,18 +529,18 @@ function createNavTriggerProps(values) {
|
|
|
244
529
|
}
|
|
245
530
|
|
|
246
531
|
// src/context/navMenu.tsx
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var NavMenuContext = (0,
|
|
532
|
+
var import_css10 = require("@cerberus/styled-system/css");
|
|
533
|
+
var import_react5 = require("react");
|
|
534
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
535
|
+
var NavMenuContext = (0, import_react5.createContext)(null);
|
|
251
536
|
function NavMenu(props) {
|
|
252
|
-
const triggerRef = (0,
|
|
253
|
-
const menuRef = (0,
|
|
254
|
-
const [expanded, setExpanded] = (0,
|
|
255
|
-
const handleToggle = (0,
|
|
537
|
+
const triggerRef = (0, import_react5.useRef)(null);
|
|
538
|
+
const menuRef = (0, import_react5.useRef)(null);
|
|
539
|
+
const [expanded, setExpanded] = (0, import_react5.useState)(false);
|
|
540
|
+
const handleToggle = (0, import_react5.useCallback)(() => {
|
|
256
541
|
setExpanded((prev) => !prev);
|
|
257
542
|
}, []);
|
|
258
|
-
const value = (0,
|
|
543
|
+
const value = (0, import_react5.useMemo)(
|
|
259
544
|
() => ({
|
|
260
545
|
triggerRef,
|
|
261
546
|
menuRef,
|
|
@@ -264,10 +549,10 @@ function NavMenu(props) {
|
|
|
264
549
|
}),
|
|
265
550
|
[expanded, handleToggle]
|
|
266
551
|
);
|
|
267
|
-
return /* @__PURE__ */ (0,
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(NavMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
268
553
|
"nav",
|
|
269
554
|
{
|
|
270
|
-
className: (0,
|
|
555
|
+
className: (0, import_css10.css)({
|
|
271
556
|
position: "relative"
|
|
272
557
|
}),
|
|
273
558
|
children: props.children
|
|
@@ -275,26 +560,15 @@ function NavMenu(props) {
|
|
|
275
560
|
) });
|
|
276
561
|
}
|
|
277
562
|
function useNavMenuContext() {
|
|
278
|
-
const context = (0,
|
|
563
|
+
const context = (0, import_react5.useContext)(NavMenuContext);
|
|
279
564
|
if (!context) {
|
|
280
565
|
throw new Error("useNavMenuContext must be used within a NavMenu.");
|
|
281
566
|
}
|
|
282
567
|
return context;
|
|
283
568
|
}
|
|
284
569
|
|
|
285
|
-
// src/components/Show.tsx
|
|
286
|
-
var import_react3 = require("react");
|
|
287
|
-
function Show(props) {
|
|
288
|
-
const { when, children, fallback } = props;
|
|
289
|
-
const condition = (0, import_react3.useMemo)(() => when ?? false, [when]);
|
|
290
|
-
return (0, import_react3.useMemo)(() => {
|
|
291
|
-
if (condition) return children;
|
|
292
|
-
return fallback ?? null;
|
|
293
|
-
}, [condition, children, fallback]);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
570
|
// src/components/deprecated/NavMenuTrigger.tsx
|
|
297
|
-
var
|
|
571
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
298
572
|
function NavMenuTrigger(props) {
|
|
299
573
|
const {
|
|
300
574
|
as,
|
|
@@ -313,25 +587,25 @@ function NavMenuTrigger(props) {
|
|
|
313
587
|
});
|
|
314
588
|
const hasAs = Boolean(as);
|
|
315
589
|
const AsSub = as;
|
|
316
|
-
const handleClick = (0,
|
|
590
|
+
const handleClick = (0, import_react6.useCallback)(
|
|
317
591
|
(e) => {
|
|
318
592
|
if (onClick) return onClick(e);
|
|
319
593
|
onToggle();
|
|
320
594
|
},
|
|
321
595
|
[onClick, onToggle]
|
|
322
596
|
);
|
|
323
|
-
return /* @__PURE__ */ (0,
|
|
597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
324
598
|
Show,
|
|
325
599
|
{
|
|
326
600
|
when: hasAs,
|
|
327
|
-
fallback: /* @__PURE__ */ (0,
|
|
601
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
328
602
|
"button",
|
|
329
603
|
{
|
|
330
604
|
...nativeProps,
|
|
331
605
|
...ariaProps,
|
|
332
|
-
className: (0,
|
|
606
|
+
className: (0, import_css11.cx)(
|
|
333
607
|
nativeProps.className,
|
|
334
|
-
(0,
|
|
608
|
+
(0, import_recipes9.button)({
|
|
335
609
|
palette,
|
|
336
610
|
usage,
|
|
337
611
|
shape
|
|
@@ -342,7 +616,7 @@ function NavMenuTrigger(props) {
|
|
|
342
616
|
children: props.children
|
|
343
617
|
}
|
|
344
618
|
),
|
|
345
|
-
children: hasAs && /* @__PURE__ */ (0,
|
|
619
|
+
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
346
620
|
AsSub,
|
|
347
621
|
{
|
|
348
622
|
...nativeProps,
|
|
@@ -356,10 +630,10 @@ function NavMenuTrigger(props) {
|
|
|
356
630
|
}
|
|
357
631
|
|
|
358
632
|
// src/components/deprecated/NavMenuList.tsx
|
|
359
|
-
var
|
|
360
|
-
var
|
|
633
|
+
var import_react7 = require("react");
|
|
634
|
+
var import_css12 = require("@cerberus/styled-system/css");
|
|
361
635
|
var import_patterns2 = require("@cerberus/styled-system/patterns");
|
|
362
|
-
var
|
|
636
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
363
637
|
function getPosition(position) {
|
|
364
638
|
const defaultPositions = {
|
|
365
639
|
left: "auto",
|
|
@@ -413,16 +687,16 @@ var navListStyles = (0, import_patterns2.vstack)({
|
|
|
413
687
|
function NavMenuList(props) {
|
|
414
688
|
const { position, ...nativeProps } = props;
|
|
415
689
|
const { menuRef, expanded } = useNavMenuContext();
|
|
416
|
-
const locationStyles = (0,
|
|
690
|
+
const locationStyles = (0, import_react7.useMemo)(
|
|
417
691
|
() => getPosition(position ?? "bottom"),
|
|
418
692
|
[position]
|
|
419
693
|
);
|
|
420
|
-
return /* @__PURE__ */ (0,
|
|
694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Show, { when: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
421
695
|
"ul",
|
|
422
696
|
{
|
|
423
697
|
...nativeProps,
|
|
424
698
|
"data-position": position ?? "bottom",
|
|
425
|
-
className: (0,
|
|
699
|
+
className: (0, import_css12.cx)(nativeProps.className, navListStyles),
|
|
426
700
|
ref: menuRef,
|
|
427
701
|
style: locationStyles
|
|
428
702
|
}
|
|
@@ -430,29 +704,29 @@ function NavMenuList(props) {
|
|
|
430
704
|
}
|
|
431
705
|
|
|
432
706
|
// src/components/deprecated/NavMenuLink.tsx
|
|
433
|
-
var
|
|
434
|
-
var
|
|
707
|
+
var import_css13 = require("@cerberus/styled-system/css");
|
|
708
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
435
709
|
function NavMenuLink(props) {
|
|
436
710
|
const { as, ...nativeProps } = props;
|
|
437
711
|
const hasAs = Boolean(as);
|
|
438
712
|
const AsSub = as;
|
|
439
|
-
return /* @__PURE__ */ (0,
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
440
714
|
"li",
|
|
441
715
|
{
|
|
442
|
-
className: (0,
|
|
716
|
+
className: (0, import_css13.css)({
|
|
443
717
|
w: "full"
|
|
444
718
|
}),
|
|
445
|
-
children: /* @__PURE__ */ (0,
|
|
719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
446
720
|
Show,
|
|
447
721
|
{
|
|
448
722
|
when: hasAs,
|
|
449
|
-
fallback: /* @__PURE__ */ (0,
|
|
723
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
450
724
|
"a",
|
|
451
725
|
{
|
|
452
726
|
...nativeProps,
|
|
453
|
-
className: (0,
|
|
727
|
+
className: (0, import_css13.cx)(
|
|
454
728
|
nativeProps.className,
|
|
455
|
-
(0,
|
|
729
|
+
(0, import_css13.css)({
|
|
456
730
|
color: "action.navigation.initial",
|
|
457
731
|
textStyle: "link",
|
|
458
732
|
_hover: {
|
|
@@ -462,105 +736,181 @@ function NavMenuLink(props) {
|
|
|
462
736
|
)
|
|
463
737
|
}
|
|
464
738
|
),
|
|
465
|
-
children: hasAs && /* @__PURE__ */ (0,
|
|
739
|
+
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AsSub, { ...nativeProps })
|
|
466
740
|
}
|
|
467
741
|
)
|
|
468
742
|
}
|
|
469
743
|
);
|
|
470
744
|
}
|
|
471
745
|
|
|
746
|
+
// src/hooks/useDate.ts
|
|
747
|
+
var import_react8 = require("react");
|
|
748
|
+
function useDate(options) {
|
|
749
|
+
const initialValue = (options == null ? void 0 : options.initialValue) ?? "";
|
|
750
|
+
const format = (options == null ? void 0 : options.format) ?? DateFormats.USMilitary;
|
|
751
|
+
const onChange = options == null ? void 0 : options.onChange;
|
|
752
|
+
const [value, setValue] = (0, import_react8.useState)(initialValue);
|
|
753
|
+
const handleChange = (0, import_react8.useCallback)(
|
|
754
|
+
(e) => {
|
|
755
|
+
const newValue = formatMilitaryDate(e.currentTarget.value);
|
|
756
|
+
if (onChange) onChange(e);
|
|
757
|
+
setValue(newValue);
|
|
758
|
+
},
|
|
759
|
+
[onChange]
|
|
760
|
+
);
|
|
761
|
+
return (0, import_react8.useMemo)(
|
|
762
|
+
() => ({
|
|
763
|
+
format,
|
|
764
|
+
value,
|
|
765
|
+
ISO: formatMilitaryToISO(value),
|
|
766
|
+
onChange: handleChange
|
|
767
|
+
}),
|
|
768
|
+
[format, value, handleChange]
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
function formatMilitaryToISO(input) {
|
|
772
|
+
const [day, month, year] = input.split(" ");
|
|
773
|
+
const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
|
|
774
|
+
const monthNum = monthIndex + 1;
|
|
775
|
+
return `${year ?? "0000"}-${monthNum.toString().padStart(2, "0")}-${day.padStart(
|
|
776
|
+
2,
|
|
777
|
+
"0"
|
|
778
|
+
)}`;
|
|
779
|
+
}
|
|
780
|
+
function formatMilitaryDate(input) {
|
|
781
|
+
let formatted = input.toUpperCase().replace(/[^0-9A-Z]/g, "");
|
|
782
|
+
let day = "";
|
|
783
|
+
let month = "";
|
|
784
|
+
let year = "";
|
|
785
|
+
if (formatted.length >= 2) {
|
|
786
|
+
day = formatted.replace(/[^0-9]/g, "").slice(0, 2);
|
|
787
|
+
const dayNum = parseInt(day, 10);
|
|
788
|
+
if (dayNum > 31) day = "31";
|
|
789
|
+
else if (dayNum === 0) day = "01";
|
|
790
|
+
formatted = formatted.slice(2);
|
|
791
|
+
}
|
|
792
|
+
if (formatted.length >= 3) {
|
|
793
|
+
month = formatted.slice(0, 3);
|
|
794
|
+
const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
|
|
795
|
+
if (monthIndex !== -1) {
|
|
796
|
+
month = MONTHS[monthIndex];
|
|
797
|
+
} else {
|
|
798
|
+
month = month.replace(/[^A-Z]/g, "");
|
|
799
|
+
}
|
|
800
|
+
formatted = formatted.slice(3);
|
|
801
|
+
}
|
|
802
|
+
if (formatted.length > 0) {
|
|
803
|
+
year = formatted.slice(0, 4);
|
|
804
|
+
}
|
|
805
|
+
return [day, month, year].filter(Boolean).join(" ");
|
|
806
|
+
}
|
|
807
|
+
function formatISOToMilitary(date) {
|
|
808
|
+
const [year, month, day] = date.split("-");
|
|
809
|
+
const monthIndex = parseInt(month, 10) - 1;
|
|
810
|
+
const monthStr = MONTHS[monthIndex];
|
|
811
|
+
return `${day} ${monthStr} ${year}`;
|
|
812
|
+
}
|
|
813
|
+
var DateFormats = {
|
|
814
|
+
get ISO() {
|
|
815
|
+
return "YYYY-MM-DD";
|
|
816
|
+
},
|
|
817
|
+
get USMilitary() {
|
|
818
|
+
return "DD MMM YYYY";
|
|
819
|
+
},
|
|
820
|
+
get Months() {
|
|
821
|
+
return MONTHS;
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
var MONTHS = [
|
|
825
|
+
"JAN",
|
|
826
|
+
"FEB",
|
|
827
|
+
"MAR",
|
|
828
|
+
"APR",
|
|
829
|
+
"MAY",
|
|
830
|
+
"JUN",
|
|
831
|
+
"JUL",
|
|
832
|
+
"AUG",
|
|
833
|
+
"SEP",
|
|
834
|
+
"OCT",
|
|
835
|
+
"NOV",
|
|
836
|
+
"DEC"
|
|
837
|
+
];
|
|
838
|
+
|
|
472
839
|
// src/components/Accordion.tsx
|
|
473
|
-
var
|
|
474
|
-
var
|
|
475
|
-
var
|
|
476
|
-
var
|
|
840
|
+
var import_react9 = require("@ark-ui/react");
|
|
841
|
+
var import_css14 = require("@cerberus/styled-system/css");
|
|
842
|
+
var import_recipes10 = require("@cerberus/styled-system/recipes");
|
|
843
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
477
844
|
function Accordion(props) {
|
|
478
845
|
const { size, className, ...rootProps } = props;
|
|
479
|
-
const styles = (0,
|
|
480
|
-
return /* @__PURE__ */ (0,
|
|
481
|
-
|
|
846
|
+
const styles = (0, import_recipes10.accordion)({ size });
|
|
847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
848
|
+
import_react9.Accordion.Root,
|
|
482
849
|
{
|
|
483
850
|
collapsible: true,
|
|
484
|
-
className: (0,
|
|
851
|
+
className: (0, import_css14.cx)(className, styles.root),
|
|
485
852
|
...rootProps
|
|
486
853
|
}
|
|
487
854
|
);
|
|
488
855
|
}
|
|
489
856
|
function AccordionItem(props) {
|
|
490
857
|
const { size, ...itemProps } = props;
|
|
491
|
-
const styles = (0,
|
|
492
|
-
return /* @__PURE__ */ (0,
|
|
493
|
-
|
|
858
|
+
const styles = (0, import_recipes10.accordion)({ size });
|
|
859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
860
|
+
import_react9.Accordion.Item,
|
|
494
861
|
{
|
|
495
862
|
...itemProps,
|
|
496
|
-
className: (0,
|
|
863
|
+
className: (0, import_css14.cx)(itemProps.className, styles.item)
|
|
497
864
|
}
|
|
498
865
|
);
|
|
499
866
|
}
|
|
500
867
|
function AccordionItemTrigger(props) {
|
|
501
868
|
const { size, ...triggerProps } = props;
|
|
502
|
-
const styles = (0,
|
|
503
|
-
return /* @__PURE__ */ (0,
|
|
504
|
-
|
|
869
|
+
const styles = (0, import_recipes10.accordion)({ size });
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
871
|
+
import_react9.Accordion.ItemTrigger,
|
|
505
872
|
{
|
|
506
873
|
...triggerProps,
|
|
507
|
-
className: (0,
|
|
874
|
+
className: (0, import_css14.cx)(triggerProps.className, styles.itemTrigger)
|
|
508
875
|
}
|
|
509
876
|
);
|
|
510
877
|
}
|
|
511
878
|
function AccordionItemContent(props) {
|
|
512
879
|
const { size, ...contentProps } = props;
|
|
513
|
-
const styles = (0,
|
|
514
|
-
return /* @__PURE__ */ (0,
|
|
515
|
-
|
|
880
|
+
const styles = (0, import_recipes10.accordion)({ size });
|
|
881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
882
|
+
import_react9.Accordion.ItemContent,
|
|
516
883
|
{
|
|
517
884
|
...contentProps,
|
|
518
|
-
className: (0,
|
|
885
|
+
className: (0, import_css14.cx)(contentProps.className, styles.itemContent)
|
|
519
886
|
}
|
|
520
887
|
);
|
|
521
888
|
}
|
|
522
889
|
|
|
523
890
|
// src/components/Accordion.client.tsx
|
|
524
|
-
var
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
|
|
528
|
-
// src/context/cerberus.tsx
|
|
529
|
-
var import_react7 = require("react");
|
|
530
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
531
|
-
var CerberusContext = (0, import_react7.createContext)(null);
|
|
532
|
-
function CerberusProvider(props) {
|
|
533
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CerberusContext.Provider, { value: props.config, children: props.children });
|
|
534
|
-
}
|
|
535
|
-
function useCerberusContext() {
|
|
536
|
-
const context = (0, import_react7.useContext)(CerberusContext);
|
|
537
|
-
if (!context) {
|
|
538
|
-
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
539
|
-
}
|
|
540
|
-
return context;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
// src/components/Accordion.client.tsx
|
|
544
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
891
|
+
var import_react10 = require("@ark-ui/react");
|
|
892
|
+
var import_css15 = require("@cerberus/styled-system/css");
|
|
893
|
+
var import_recipes11 = require("@cerberus/styled-system/recipes");
|
|
894
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
545
895
|
function AccordionItemIndicator(props) {
|
|
546
896
|
const { size, ...indicatorProps } = props;
|
|
547
|
-
const styles = (0,
|
|
897
|
+
const styles = (0, import_recipes11.accordion)({ size });
|
|
548
898
|
const iconSize = size === "sm" ? 16 : "24";
|
|
549
899
|
const { icons } = useCerberusContext();
|
|
550
900
|
const ChevronDown = icons.accordionIndicator;
|
|
551
|
-
return /* @__PURE__ */ (0,
|
|
552
|
-
|
|
901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
902
|
+
import_react10.Accordion.ItemIndicator,
|
|
553
903
|
{
|
|
554
904
|
...indicatorProps,
|
|
555
|
-
className: (0,
|
|
556
|
-
children: /* @__PURE__ */ (0,
|
|
905
|
+
className: (0, import_css15.cx)(indicatorProps.className, styles.itemIndicator),
|
|
906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDown, { size: iconSize })
|
|
557
907
|
}
|
|
558
908
|
);
|
|
559
909
|
}
|
|
560
910
|
|
|
561
911
|
// src/components/AccordionItemGroup.tsx
|
|
562
|
-
var
|
|
563
|
-
var
|
|
912
|
+
var import_css16 = require("@cerberus/styled-system/css");
|
|
913
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
564
914
|
function AccordionItemGroup(props) {
|
|
565
915
|
const {
|
|
566
916
|
size,
|
|
@@ -573,26 +923,26 @@ function AccordionItemGroup(props) {
|
|
|
573
923
|
gap: "md",
|
|
574
924
|
justifyContent: "flex-start"
|
|
575
925
|
} : void 0;
|
|
576
|
-
return /* @__PURE__ */ (0,
|
|
577
|
-
/* @__PURE__ */ (0,
|
|
578
|
-
/* @__PURE__ */ (0,
|
|
926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(AccordionItem, { ...itemProps, children: [
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(AccordionItemTrigger, { className: (0, import_css16.css)(triggerStyles), size, children: [
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Show, { when: indicatorPosition === "start", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AccordionItemIndicator, { size }) }),
|
|
579
929
|
heading,
|
|
580
|
-
/* @__PURE__ */ (0,
|
|
930
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Show, { when: indicatorPosition === "end", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AccordionItemIndicator, { size }) })
|
|
581
931
|
] }),
|
|
582
|
-
/* @__PURE__ */ (0,
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AccordionItemContent, { size, children })
|
|
583
933
|
] });
|
|
584
934
|
}
|
|
585
935
|
|
|
586
936
|
// src/components/Admonition.tsx
|
|
587
|
-
var
|
|
588
|
-
var
|
|
937
|
+
var import_recipes13 = require("@cerberus/styled-system/recipes");
|
|
938
|
+
var import_css18 = require("@cerberus/styled-system/css");
|
|
589
939
|
var import_patterns4 = require("@cerberus/styled-system/patterns");
|
|
590
940
|
|
|
591
941
|
// src/components/Avatar.tsx
|
|
592
|
-
var
|
|
942
|
+
var import_css17 = require("@cerberus/styled-system/css");
|
|
593
943
|
var import_patterns3 = require("@cerberus/styled-system/patterns");
|
|
594
|
-
var
|
|
595
|
-
var
|
|
944
|
+
var import_recipes12 = require("@cerberus/styled-system/recipes");
|
|
945
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
596
946
|
function Avatar(props) {
|
|
597
947
|
const {
|
|
598
948
|
ariaLabel,
|
|
@@ -608,28 +958,28 @@ function Avatar(props) {
|
|
|
608
958
|
const { icons } = useCerberusContext();
|
|
609
959
|
const { avatar: AvatarIcon } = icons;
|
|
610
960
|
const initials = (ariaLabel || "").split(" ").map((word) => word[0]).join("").slice(0, 2);
|
|
611
|
-
return /* @__PURE__ */ (0,
|
|
961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
612
962
|
"div",
|
|
613
963
|
{
|
|
614
964
|
...nativeProps,
|
|
615
|
-
className: (0,
|
|
965
|
+
className: (0, import_css17.cx)(
|
|
616
966
|
nativeProps.className,
|
|
617
|
-
(0,
|
|
967
|
+
(0, import_recipes12.avatar)({ gradient, size }),
|
|
618
968
|
(0, import_patterns3.circle)()
|
|
619
969
|
),
|
|
620
|
-
children: /* @__PURE__ */ (0,
|
|
970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
621
971
|
Show,
|
|
622
972
|
{
|
|
623
973
|
when: Boolean(src) || Boolean(as),
|
|
624
|
-
fallback: /* @__PURE__ */ (0,
|
|
974
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
625
975
|
Show,
|
|
626
976
|
{
|
|
627
977
|
when: Boolean(initials),
|
|
628
|
-
fallback: /* @__PURE__ */ (0,
|
|
978
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
629
979
|
Show,
|
|
630
980
|
{
|
|
631
981
|
when: Boolean(icon),
|
|
632
|
-
fallback: /* @__PURE__ */ (0,
|
|
982
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
633
983
|
AvatarIcon,
|
|
634
984
|
{
|
|
635
985
|
size: iconSizeMap[size]
|
|
@@ -641,15 +991,15 @@ function Avatar(props) {
|
|
|
641
991
|
children: initials
|
|
642
992
|
}
|
|
643
993
|
),
|
|
644
|
-
children: /* @__PURE__ */ (0,
|
|
994
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
645
995
|
Show,
|
|
646
996
|
{
|
|
647
997
|
when: Boolean(as),
|
|
648
|
-
fallback: /* @__PURE__ */ (0,
|
|
998
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
649
999
|
"img",
|
|
650
1000
|
{
|
|
651
1001
|
alt: props.ariaLabel,
|
|
652
|
-
className: (0,
|
|
1002
|
+
className: (0, import_css17.css)({
|
|
653
1003
|
h: "full",
|
|
654
1004
|
objectFit: "cover",
|
|
655
1005
|
w: "full"
|
|
@@ -681,7 +1031,7 @@ var iconSizeMap = {
|
|
|
681
1031
|
};
|
|
682
1032
|
|
|
683
1033
|
// src/components/Admonition.client.tsx
|
|
684
|
-
var
|
|
1034
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
685
1035
|
function MatchAvatar(props) {
|
|
686
1036
|
const { icons } = useCerberusContext();
|
|
687
1037
|
const {
|
|
@@ -692,56 +1042,56 @@ function MatchAvatar(props) {
|
|
|
692
1042
|
} = icons;
|
|
693
1043
|
switch (props.palette) {
|
|
694
1044
|
case "page":
|
|
695
|
-
return /* @__PURE__ */ (0,
|
|
1045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
696
1046
|
Avatar,
|
|
697
1047
|
{
|
|
698
1048
|
gradient: "charon-light",
|
|
699
1049
|
ariaLabel: "",
|
|
700
|
-
icon: /* @__PURE__ */ (0,
|
|
1050
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(InfoIcon, {}),
|
|
701
1051
|
size: "sm",
|
|
702
1052
|
src: ""
|
|
703
1053
|
}
|
|
704
1054
|
);
|
|
705
1055
|
case "info":
|
|
706
|
-
return /* @__PURE__ */ (0,
|
|
1056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
707
1057
|
Avatar,
|
|
708
1058
|
{
|
|
709
1059
|
gradient: "amphiaraus-dark",
|
|
710
1060
|
ariaLabel: "",
|
|
711
|
-
icon: /* @__PURE__ */ (0,
|
|
1061
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(InfoIcon, {}),
|
|
712
1062
|
size: "sm",
|
|
713
1063
|
src: ""
|
|
714
1064
|
}
|
|
715
1065
|
);
|
|
716
1066
|
case "success":
|
|
717
|
-
return /* @__PURE__ */ (0,
|
|
1067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
718
1068
|
Avatar,
|
|
719
1069
|
{
|
|
720
1070
|
gradient: "thanatos-dark",
|
|
721
1071
|
ariaLabel: "",
|
|
722
|
-
icon: /* @__PURE__ */ (0,
|
|
1072
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SuccessIcon, {}),
|
|
723
1073
|
size: "sm",
|
|
724
1074
|
src: ""
|
|
725
1075
|
}
|
|
726
1076
|
);
|
|
727
1077
|
case "warning":
|
|
728
|
-
return /* @__PURE__ */ (0,
|
|
1078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
729
1079
|
Avatar,
|
|
730
1080
|
{
|
|
731
1081
|
gradient: "asphodel-light",
|
|
732
1082
|
ariaLabel: "",
|
|
733
|
-
icon: /* @__PURE__ */ (0,
|
|
1083
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WarningIcon, {}),
|
|
734
1084
|
size: "sm",
|
|
735
1085
|
src: ""
|
|
736
1086
|
}
|
|
737
1087
|
);
|
|
738
1088
|
case "danger":
|
|
739
|
-
return /* @__PURE__ */ (0,
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
740
1090
|
Avatar,
|
|
741
1091
|
{
|
|
742
1092
|
gradient: "hades-light",
|
|
743
1093
|
ariaLabel: "",
|
|
744
|
-
icon: /* @__PURE__ */ (0,
|
|
1094
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DangerIcon, {}),
|
|
745
1095
|
size: "sm",
|
|
746
1096
|
src: ""
|
|
747
1097
|
}
|
|
@@ -752,64 +1102,65 @@ function MatchAvatar(props) {
|
|
|
752
1102
|
}
|
|
753
1103
|
|
|
754
1104
|
// src/components/Admonition.tsx
|
|
755
|
-
var
|
|
1105
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
756
1106
|
function Admonition(props) {
|
|
757
1107
|
const { children, palette = "page", usage, icon, ...nativeProps } = props;
|
|
758
|
-
return /* @__PURE__ */ (0,
|
|
1108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
759
1109
|
"aside",
|
|
760
1110
|
{
|
|
761
1111
|
...nativeProps,
|
|
762
|
-
className: (0,
|
|
1112
|
+
className: (0, import_css18.cx)(
|
|
763
1113
|
nativeProps.className,
|
|
764
1114
|
(0, import_patterns4.hstack)({
|
|
765
1115
|
gap: "md",
|
|
766
1116
|
w: "full"
|
|
767
1117
|
}),
|
|
768
|
-
(0,
|
|
1118
|
+
(0, import_recipes13.admonition)({ palette, usage }).root
|
|
769
1119
|
),
|
|
770
1120
|
children: [
|
|
771
|
-
/* @__PURE__ */ (0,
|
|
772
|
-
/* @__PURE__ */ (0,
|
|
1121
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Show, { when: Boolean(icon), fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MatchAvatar, { palette }), children: icon }),
|
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children })
|
|
773
1123
|
]
|
|
774
1124
|
}
|
|
775
1125
|
);
|
|
776
1126
|
}
|
|
777
1127
|
function AdmonitionHeading(props) {
|
|
778
1128
|
const { palette, usage, ...nativeProps } = props;
|
|
779
|
-
return /* @__PURE__ */ (0,
|
|
1129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
780
1130
|
"p",
|
|
781
1131
|
{
|
|
782
1132
|
...nativeProps,
|
|
783
|
-
className: (0,
|
|
1133
|
+
className: (0, import_css18.cx)(
|
|
784
1134
|
nativeProps.className,
|
|
785
|
-
(0,
|
|
1135
|
+
(0, import_recipes13.admonition)({ palette, usage }).heading
|
|
786
1136
|
)
|
|
787
1137
|
}
|
|
788
1138
|
);
|
|
789
1139
|
}
|
|
790
1140
|
function AdmonitionDescription(props) {
|
|
791
1141
|
const { palette, usage, ...nativeProps } = props;
|
|
792
|
-
return /* @__PURE__ */ (0,
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
793
1143
|
"p",
|
|
794
1144
|
{
|
|
795
1145
|
...nativeProps,
|
|
796
|
-
className: (0,
|
|
1146
|
+
className: (0, import_css18.cx)(
|
|
797
1147
|
nativeProps.className,
|
|
798
|
-
(0,
|
|
1148
|
+
(0, import_recipes13.admonition)({ palette, usage }).description
|
|
799
1149
|
)
|
|
800
1150
|
}
|
|
801
1151
|
);
|
|
802
1152
|
}
|
|
803
1153
|
|
|
804
1154
|
// src/components/button/button.tsx
|
|
805
|
-
var
|
|
806
|
-
var
|
|
807
|
-
var
|
|
1155
|
+
var import_react11 = require("react");
|
|
1156
|
+
var import_css19 = require("@cerberus/styled-system/css");
|
|
1157
|
+
var import_recipes14 = require("@cerberus/styled-system/recipes");
|
|
1158
|
+
var import_jsx2 = require("@cerberus/styled-system/jsx");
|
|
808
1159
|
|
|
809
1160
|
// src/components/Spinner.tsx
|
|
810
|
-
var
|
|
1161
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
811
1162
|
function Spinner(props) {
|
|
812
|
-
return /* @__PURE__ */ (0,
|
|
1163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
813
1164
|
"svg",
|
|
814
1165
|
{
|
|
815
1166
|
"aria-busy": "true",
|
|
@@ -819,7 +1170,7 @@ function Spinner(props) {
|
|
|
819
1170
|
width: props.size,
|
|
820
1171
|
viewBox: "0 0 24 24",
|
|
821
1172
|
...props,
|
|
822
|
-
children: /* @__PURE__ */ (0,
|
|
1173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
823
1174
|
"g",
|
|
824
1175
|
{
|
|
825
1176
|
fill: "none",
|
|
@@ -828,14 +1179,14 @@ function Spinner(props) {
|
|
|
828
1179
|
strokeLinejoin: "round",
|
|
829
1180
|
strokeWidth: 2,
|
|
830
1181
|
children: [
|
|
831
|
-
/* @__PURE__ */ (0,
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
832
1183
|
"path",
|
|
833
1184
|
{
|
|
834
1185
|
strokeDasharray: 16,
|
|
835
1186
|
strokeDashoffset: 16,
|
|
836
1187
|
d: "M12 3c4.97 0 9 4.03 9 9",
|
|
837
1188
|
children: [
|
|
838
|
-
/* @__PURE__ */ (0,
|
|
1189
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
839
1190
|
"animate",
|
|
840
1191
|
{
|
|
841
1192
|
fill: "freeze",
|
|
@@ -844,7 +1195,7 @@ function Spinner(props) {
|
|
|
844
1195
|
values: "16;0"
|
|
845
1196
|
}
|
|
846
1197
|
),
|
|
847
|
-
/* @__PURE__ */ (0,
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
848
1199
|
"animateTransform",
|
|
849
1200
|
{
|
|
850
1201
|
attributeName: "transform",
|
|
@@ -857,14 +1208,14 @@ function Spinner(props) {
|
|
|
857
1208
|
]
|
|
858
1209
|
}
|
|
859
1210
|
),
|
|
860
|
-
/* @__PURE__ */ (0,
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
861
1212
|
"path",
|
|
862
1213
|
{
|
|
863
1214
|
strokeDasharray: 64,
|
|
864
1215
|
strokeDashoffset: 64,
|
|
865
1216
|
strokeOpacity: 0.3,
|
|
866
1217
|
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z",
|
|
867
|
-
children: /* @__PURE__ */ (0,
|
|
1218
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
868
1219
|
"animate",
|
|
869
1220
|
{
|
|
870
1221
|
fill: "freeze",
|
|
@@ -883,22 +1234,21 @@ function Spinner(props) {
|
|
|
883
1234
|
}
|
|
884
1235
|
|
|
885
1236
|
// src/components/button/button.tsx
|
|
886
|
-
var
|
|
887
|
-
var
|
|
888
|
-
var ButtonContext = (0, import_react9.createContext)({
|
|
1237
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1238
|
+
var ButtonContext = (0, import_react11.createContext)({
|
|
889
1239
|
pending: false
|
|
890
1240
|
});
|
|
891
1241
|
function Button(props) {
|
|
892
1242
|
const { palette, usage, shape, size, pending = false, ...nativeProps } = props;
|
|
893
|
-
const value = (0,
|
|
894
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
const value = (0, import_react11.useMemo)(() => ({ pending }), [pending]);
|
|
1244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ButtonContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
895
1245
|
"button",
|
|
896
1246
|
{
|
|
897
1247
|
...nativeProps,
|
|
898
1248
|
disabled: pending || nativeProps.disabled,
|
|
899
|
-
className: (0,
|
|
1249
|
+
className: (0, import_css19.cx)(
|
|
900
1250
|
nativeProps.className,
|
|
901
|
-
(0,
|
|
1251
|
+
(0, import_recipes14.button)({
|
|
902
1252
|
palette,
|
|
903
1253
|
usage,
|
|
904
1254
|
shape,
|
|
@@ -909,8 +1259,8 @@ function Button(props) {
|
|
|
909
1259
|
) });
|
|
910
1260
|
}
|
|
911
1261
|
function ButtonIcon(props) {
|
|
912
|
-
const { pending } = (0,
|
|
913
|
-
return /* @__PURE__ */ (0,
|
|
1262
|
+
const { pending } = (0, import_react11.useContext)(ButtonContext);
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Show, { when: pending, fallback: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: props.children }), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx2.Box, { w: "4", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Spinner, {}) }) });
|
|
914
1264
|
}
|
|
915
1265
|
|
|
916
1266
|
// src/components/button/parts.ts
|
|
@@ -919,90 +1269,129 @@ var ButtonParts = {
|
|
|
919
1269
|
Icon: ButtonIcon
|
|
920
1270
|
};
|
|
921
1271
|
|
|
922
|
-
// src/components/
|
|
923
|
-
var
|
|
924
|
-
var
|
|
925
|
-
|
|
1272
|
+
// src/components/Text.tsx
|
|
1273
|
+
var import_jsx3 = require("@cerberus/styled-system/jsx");
|
|
1274
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1275
|
+
function Text(props) {
|
|
1276
|
+
const { as = "p", ...pandaJSXProps } = props;
|
|
1277
|
+
switch (as) {
|
|
1278
|
+
case "h1":
|
|
1279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.H1, { ...pandaJSXProps });
|
|
1280
|
+
case "h2":
|
|
1281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.H2, { ...pandaJSXProps });
|
|
1282
|
+
case "h3":
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.H3, { ...pandaJSXProps });
|
|
1284
|
+
case "h4":
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.H4, { ...pandaJSXProps });
|
|
1286
|
+
case "h5":
|
|
1287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.H5, { ...pandaJSXProps });
|
|
1288
|
+
case "h6":
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.H6, { ...pandaJSXProps });
|
|
1290
|
+
case "strong":
|
|
1291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.Strong, { ...pandaJSXProps });
|
|
1292
|
+
case "em":
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.Em, { ...pandaJSXProps });
|
|
1294
|
+
case "small":
|
|
1295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.Small, { ...pandaJSXProps });
|
|
1296
|
+
case "span":
|
|
1297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.Span, { ...pandaJSXProps });
|
|
1298
|
+
default:
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx3.P, { ...pandaJSXProps });
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
926
1302
|
|
|
927
|
-
// src/
|
|
928
|
-
var
|
|
929
|
-
var
|
|
930
|
-
var
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1303
|
+
// src/components/checkbox/primitives.tsx
|
|
1304
|
+
var import_react12 = require("@ark-ui/react");
|
|
1305
|
+
var import_css20 = require("@cerberus/styled-system/css");
|
|
1306
|
+
var import_recipes15 = require("@cerberus/styled-system/recipes");
|
|
1307
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1308
|
+
function CheckboxRoot(props) {
|
|
1309
|
+
const styles = (0, import_recipes15.checkbox)();
|
|
1310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react12.Checkbox.Root, { ...props, className: (0, import_css20.cx)(styles.root, props.className) });
|
|
1311
|
+
}
|
|
1312
|
+
function CheckboxLabel(props) {
|
|
1313
|
+
const { size, ...labelProps } = props;
|
|
1314
|
+
const styles = (0, import_recipes15.checkbox)({ size });
|
|
1315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1316
|
+
import_react12.Checkbox.Label,
|
|
1317
|
+
{
|
|
1318
|
+
...labelProps,
|
|
1319
|
+
className: (0, import_css20.cx)(styles.label, labelProps.className)
|
|
1320
|
+
}
|
|
940
1321
|
);
|
|
941
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FieldContext.Provider, { value, children: props.children });
|
|
942
1322
|
}
|
|
943
|
-
function
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1323
|
+
function CheckboxControl(props) {
|
|
1324
|
+
const { size, ...controlProps } = props;
|
|
1325
|
+
const styles = (0, import_recipes15.checkbox)({ size });
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1327
|
+
import_react12.Checkbox.Control,
|
|
1328
|
+
{
|
|
1329
|
+
...controlProps,
|
|
1330
|
+
className: (0, import_css20.cx)(styles.control, controlProps.className)
|
|
1331
|
+
}
|
|
1332
|
+
);
|
|
949
1333
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
const { describedBy, size, checked, mixed, ...nativeProps } = props;
|
|
955
|
-
const { invalid, ...fieldStates } = useFieldContext();
|
|
956
|
-
const styles = (0, import_recipes10.checkbox)({ size });
|
|
957
|
-
const { icons } = useCerberusContext();
|
|
958
|
-
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon2 } = icons;
|
|
959
|
-
if (!CheckIcon) {
|
|
960
|
-
throw new Error("The CerberusProvider is missing the checkbox icon.");
|
|
961
|
-
}
|
|
962
|
-
if (!IndeterminateIcon2) {
|
|
963
|
-
throw new Error("The CerberusProvider is missing the indeterminate icon.");
|
|
964
|
-
}
|
|
965
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
966
|
-
"div",
|
|
1334
|
+
function CheckboxIndicator(props) {
|
|
1335
|
+
const styles = (0, import_recipes15.checkbox)();
|
|
1336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1337
|
+
import_react12.Checkbox.Indicator,
|
|
967
1338
|
{
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
(0, import_patterns5.vstack)({
|
|
971
|
-
gap: "0",
|
|
972
|
-
justify: "center"
|
|
973
|
-
})
|
|
974
|
-
),
|
|
975
|
-
children: [
|
|
976
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
977
|
-
"input",
|
|
978
|
-
{
|
|
979
|
-
...nativeProps,
|
|
980
|
-
...fieldStates,
|
|
981
|
-
...describedBy && { "aria-describedby": describedBy },
|
|
982
|
-
...invalid && { "aria-invalid": true },
|
|
983
|
-
...mixed && { "aria-checked": "mixed" },
|
|
984
|
-
className: (0, import_css15.cx)("peer", nativeProps.className, styles.input),
|
|
985
|
-
type: "checkbox"
|
|
986
|
-
}
|
|
987
|
-
),
|
|
988
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Show, { when: checked && !mixed, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CheckIcon, {}) }) }),
|
|
989
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Show, { when: mixed, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IndeterminateIcon2, {}) }) })
|
|
990
|
-
]
|
|
1339
|
+
...props,
|
|
1340
|
+
className: (0, import_css20.cx)(styles.indicator, props.className)
|
|
991
1341
|
}
|
|
992
1342
|
);
|
|
993
1343
|
}
|
|
1344
|
+
function CheckboxHiddenInput(props) {
|
|
1345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react12.Checkbox.HiddenInput, { ...props });
|
|
1346
|
+
}
|
|
1347
|
+
function CheckboxGroup(props) {
|
|
1348
|
+
const styles = (0, import_recipes15.checkbox)();
|
|
1349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react12.Checkbox.Group, { ...props, className: (0, import_css20.cx)(styles.group, props.className) });
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
// src/components/checkbox/parts.ts
|
|
1353
|
+
var CheckboxParts = {
|
|
1354
|
+
Root: CheckboxRoot,
|
|
1355
|
+
Label: CheckboxLabel,
|
|
1356
|
+
Control: CheckboxControl,
|
|
1357
|
+
Indicator: CheckboxIndicator,
|
|
1358
|
+
HiddenInput: CheckboxHiddenInput,
|
|
1359
|
+
Group: CheckboxGroup
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
// src/components/checkbox/checkbox-icon.tsx
|
|
1363
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1364
|
+
function CheckboxIcon(props) {
|
|
1365
|
+
const { icons } = useCerberusContext();
|
|
1366
|
+
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon2 } = icons;
|
|
1367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CheckboxParts.Indicator, { indeterminate: props.indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Show, { when: props.indeterminate, fallback: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CheckIcon, {}), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IndeterminateIcon2, {}) }) });
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
// src/components/checkbox/checkbox.tsx
|
|
1371
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1372
|
+
function Checkbox2(props) {
|
|
1373
|
+
const { size, children, ...rootProps } = props;
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CheckboxParts.Root, { ...rootProps, children: [
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxParts.Control, { size, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxIcon, { indeterminate: rootProps.checked === "indeterminate" }) }),
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CheckboxParts.Label, { size, children: [
|
|
1377
|
+
children,
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Show, { when: props.required, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { as: "span", "data-part": "required-indicator", children: "(required)" }) })
|
|
1379
|
+
] }),
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxParts.HiddenInput, {})
|
|
1381
|
+
] });
|
|
1382
|
+
}
|
|
994
1383
|
|
|
995
1384
|
// src/components/CircularProgress.tsx
|
|
996
|
-
var
|
|
997
|
-
var
|
|
998
|
-
var
|
|
1385
|
+
var import_patterns5 = require("@cerberus/styled-system/patterns");
|
|
1386
|
+
var import_css21 = require("@cerberus/styled-system/css");
|
|
1387
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
999
1388
|
function CircularProgress(props) {
|
|
1000
1389
|
const strokeW = 14;
|
|
1001
1390
|
const radius = `calc(50% * (1 - ${strokeW}/100))`;
|
|
1002
1391
|
const status = props.syntax ?? "Done";
|
|
1003
1392
|
const now = props.now >= 100 ? 100 : props.now;
|
|
1004
1393
|
const bgStyle = props.bgStyle ?? "filled";
|
|
1005
|
-
return /* @__PURE__ */ (0,
|
|
1394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1006
1395
|
"div",
|
|
1007
1396
|
{
|
|
1008
1397
|
id: props.id,
|
|
@@ -1010,18 +1399,18 @@ function CircularProgress(props) {
|
|
|
1010
1399
|
"aria-valuemin": 0,
|
|
1011
1400
|
"aria-valuemax": 100,
|
|
1012
1401
|
"aria-valuenow": now,
|
|
1013
|
-
className: (0,
|
|
1402
|
+
className: (0, import_patterns5.cq)({
|
|
1014
1403
|
alignSelf: "stretch",
|
|
1015
1404
|
flex: 1,
|
|
1016
1405
|
m: "4px",
|
|
1017
1406
|
position: "relative"
|
|
1018
1407
|
}),
|
|
1019
1408
|
role: "progressbar",
|
|
1020
|
-
children: /* @__PURE__ */ (0,
|
|
1409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1021
1410
|
"svg",
|
|
1022
1411
|
{
|
|
1023
1412
|
"data-complete": now === 100,
|
|
1024
|
-
className: (0,
|
|
1413
|
+
className: (0, import_css21.css)({
|
|
1025
1414
|
display: "block",
|
|
1026
1415
|
rounded: "full",
|
|
1027
1416
|
transition: "all 0.5s ease"
|
|
@@ -1032,17 +1421,17 @@ function CircularProgress(props) {
|
|
|
1032
1421
|
viewBox: "0 0 100 100",
|
|
1033
1422
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1034
1423
|
children: [
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1036
|
-
/* @__PURE__ */ (0,
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1424
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("title", { children: props.title }),
|
|
1425
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("desc", { children: `${now}% ${status}` }),
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("linearGradient", { id: "gradient", children: [
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1039
1428
|
"stop",
|
|
1040
1429
|
{
|
|
1041
1430
|
offset: "0%",
|
|
1042
1431
|
stopColor: "var(--cerberus-colors-data-viz-progress-start)"
|
|
1043
1432
|
}
|
|
1044
1433
|
),
|
|
1045
|
-
/* @__PURE__ */ (0,
|
|
1434
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1046
1435
|
"stop",
|
|
1047
1436
|
{
|
|
1048
1437
|
offset: "100%",
|
|
@@ -1050,10 +1439,10 @@ function CircularProgress(props) {
|
|
|
1050
1439
|
}
|
|
1051
1440
|
)
|
|
1052
1441
|
] }) }),
|
|
1053
|
-
/* @__PURE__ */ (0,
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Show, { when: bgStyle === "filled", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1054
1443
|
"circle",
|
|
1055
1444
|
{
|
|
1056
|
-
className: (0,
|
|
1445
|
+
className: (0, import_css21.css)({
|
|
1057
1446
|
fill: "page.surface.initial"
|
|
1058
1447
|
}),
|
|
1059
1448
|
cx: "50%",
|
|
@@ -1062,10 +1451,10 @@ function CircularProgress(props) {
|
|
|
1062
1451
|
pathLength: "100"
|
|
1063
1452
|
}
|
|
1064
1453
|
) }),
|
|
1065
|
-
/* @__PURE__ */ (0,
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1066
1455
|
"circle",
|
|
1067
1456
|
{
|
|
1068
|
-
className: (0,
|
|
1457
|
+
className: (0, import_css21.css)({
|
|
1069
1458
|
stroke: "page.bg.100"
|
|
1070
1459
|
}),
|
|
1071
1460
|
cx: "50%",
|
|
@@ -1074,11 +1463,11 @@ function CircularProgress(props) {
|
|
|
1074
1463
|
pathLength: "100"
|
|
1075
1464
|
}
|
|
1076
1465
|
),
|
|
1077
|
-
/* @__PURE__ */ (0,
|
|
1466
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1078
1467
|
"circle",
|
|
1079
1468
|
{
|
|
1080
1469
|
"data-complete": now === 100,
|
|
1081
|
-
className: (0,
|
|
1470
|
+
className: (0, import_css21.css)({
|
|
1082
1471
|
stroke: "url(#gradient)",
|
|
1083
1472
|
transition: "stroke-dashoffset, stroke 0.5s ease",
|
|
1084
1473
|
_isComplete: {
|
|
@@ -1095,11 +1484,11 @@ function CircularProgress(props) {
|
|
|
1095
1484
|
transform: "rotate(-90 50 50)"
|
|
1096
1485
|
}
|
|
1097
1486
|
),
|
|
1098
|
-
/* @__PURE__ */ (0,
|
|
1099
|
-
/* @__PURE__ */ (0,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("g", { children: [
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1100
1489
|
"text",
|
|
1101
1490
|
{
|
|
1102
|
-
className: (0,
|
|
1491
|
+
className: (0, import_css21.css)({
|
|
1103
1492
|
fill: "page.text.initial",
|
|
1104
1493
|
fontFamily: "mono",
|
|
1105
1494
|
textStyle: "1.25rem"
|
|
@@ -1114,10 +1503,10 @@ function CircularProgress(props) {
|
|
|
1114
1503
|
]
|
|
1115
1504
|
}
|
|
1116
1505
|
),
|
|
1117
|
-
/* @__PURE__ */ (0,
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1118
1507
|
"text",
|
|
1119
1508
|
{
|
|
1120
|
-
className: (0,
|
|
1509
|
+
className: (0, import_css21.css)({
|
|
1121
1510
|
fill: "page.text.100",
|
|
1122
1511
|
fontSize: "0.5rem",
|
|
1123
1512
|
fontWeight: 600
|
|
@@ -1138,31 +1527,31 @@ function CircularProgress(props) {
|
|
|
1138
1527
|
}
|
|
1139
1528
|
|
|
1140
1529
|
// src/components/DatePicker.client.tsx
|
|
1141
|
-
var
|
|
1530
|
+
var import_react15 = require("@ark-ui/react");
|
|
1142
1531
|
|
|
1143
1532
|
// src/components/Portal.tsx
|
|
1144
|
-
var
|
|
1145
|
-
var Portal =
|
|
1533
|
+
var import_react13 = require("@ark-ui/react");
|
|
1534
|
+
var Portal = import_react13.Portal;
|
|
1146
1535
|
|
|
1147
1536
|
// src/components/DatePicker.client.tsx
|
|
1148
|
-
var
|
|
1149
|
-
var
|
|
1537
|
+
var import_recipes18 = require("@cerberus/styled-system/recipes");
|
|
1538
|
+
var import_css24 = require("@cerberus/styled-system/css");
|
|
1150
1539
|
|
|
1151
1540
|
// src/components/DatePicker.server.tsx
|
|
1152
|
-
var
|
|
1153
|
-
var
|
|
1154
|
-
var
|
|
1155
|
-
var
|
|
1156
|
-
var datePickerStyles = (0,
|
|
1541
|
+
var import_react14 = require("@ark-ui/react");
|
|
1542
|
+
var import_css22 = require("@cerberus/styled-system/css");
|
|
1543
|
+
var import_recipes16 = require("@cerberus/styled-system/recipes");
|
|
1544
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1545
|
+
var datePickerStyles = (0, import_recipes16.datePicker)();
|
|
1157
1546
|
function DatePickerLabel(props) {
|
|
1158
1547
|
const { className, ...arkProps } = props;
|
|
1159
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
-
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1549
|
+
import_react14.DatePicker.Label,
|
|
1161
1550
|
{
|
|
1162
1551
|
...arkProps,
|
|
1163
|
-
className: (0,
|
|
1552
|
+
className: (0, import_css22.cx)(
|
|
1164
1553
|
className,
|
|
1165
|
-
(0,
|
|
1554
|
+
(0, import_recipes16.label)({
|
|
1166
1555
|
size: "sm"
|
|
1167
1556
|
})
|
|
1168
1557
|
)
|
|
@@ -1170,67 +1559,67 @@ function DatePickerLabel(props) {
|
|
|
1170
1559
|
);
|
|
1171
1560
|
}
|
|
1172
1561
|
function DatePickerViewControl(props) {
|
|
1173
|
-
return /* @__PURE__ */ (0,
|
|
1174
|
-
|
|
1562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1563
|
+
import_react14.DatePicker.Control,
|
|
1175
1564
|
{
|
|
1176
1565
|
...props,
|
|
1177
|
-
className: (0,
|
|
1566
|
+
className: (0, import_css22.cx)(props.className, datePickerStyles.viewControl)
|
|
1178
1567
|
}
|
|
1179
1568
|
);
|
|
1180
1569
|
}
|
|
1181
1570
|
function DatePickerTable(props) {
|
|
1182
|
-
return /* @__PURE__ */ (0,
|
|
1183
|
-
|
|
1571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1572
|
+
import_react14.DatePicker.Table,
|
|
1184
1573
|
{
|
|
1185
1574
|
...props,
|
|
1186
|
-
className: (0,
|
|
1575
|
+
className: (0, import_css22.cx)(props.className, datePickerStyles.table)
|
|
1187
1576
|
}
|
|
1188
1577
|
);
|
|
1189
1578
|
}
|
|
1190
1579
|
function DatePickerTableHeader(props) {
|
|
1191
|
-
return /* @__PURE__ */ (0,
|
|
1192
|
-
|
|
1580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1581
|
+
import_react14.DatePicker.TableHeader,
|
|
1193
1582
|
{
|
|
1194
1583
|
...props,
|
|
1195
|
-
className: (0,
|
|
1584
|
+
className: (0, import_css22.cx)(props.className, datePickerStyles.tableHeader)
|
|
1196
1585
|
}
|
|
1197
1586
|
);
|
|
1198
1587
|
}
|
|
1199
1588
|
function DatePickerTableCell(props) {
|
|
1200
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
-
|
|
1589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1590
|
+
import_react14.DatePicker.TableCell,
|
|
1202
1591
|
{
|
|
1203
1592
|
...props,
|
|
1204
|
-
className: (0,
|
|
1593
|
+
className: (0, import_css22.cx)(props.className, datePickerStyles.tableCell)
|
|
1205
1594
|
}
|
|
1206
1595
|
);
|
|
1207
1596
|
}
|
|
1208
1597
|
function DatePickerTableCellTrigger(props) {
|
|
1209
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
-
|
|
1598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1599
|
+
import_react14.DatePicker.TableCellTrigger,
|
|
1211
1600
|
{
|
|
1212
1601
|
...props,
|
|
1213
|
-
className: (0,
|
|
1602
|
+
className: (0, import_css22.cx)(props.className, datePickerStyles.tableCellTrigger)
|
|
1214
1603
|
}
|
|
1215
1604
|
);
|
|
1216
1605
|
}
|
|
1217
|
-
var DatePickerView =
|
|
1218
|
-
var DatePickerContext =
|
|
1606
|
+
var DatePickerView = import_react14.DatePicker.View;
|
|
1607
|
+
var DatePickerContext = import_react14.DatePicker.Context;
|
|
1219
1608
|
|
|
1220
1609
|
// src/components/IconButton.tsx
|
|
1221
|
-
var
|
|
1222
|
-
var
|
|
1223
|
-
var
|
|
1610
|
+
var import_css23 = require("@cerberus/styled-system/css");
|
|
1611
|
+
var import_recipes17 = require("@cerberus/styled-system/recipes");
|
|
1612
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1224
1613
|
function IconButton(props) {
|
|
1225
1614
|
const { ariaLabel, palette, usage, size, ...nativeProps } = props;
|
|
1226
|
-
return /* @__PURE__ */ (0,
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1227
1616
|
"button",
|
|
1228
1617
|
{
|
|
1229
1618
|
...nativeProps,
|
|
1230
1619
|
"aria-label": ariaLabel ?? "Icon Button",
|
|
1231
|
-
className: (0,
|
|
1620
|
+
className: (0, import_css23.cx)(
|
|
1232
1621
|
nativeProps.className,
|
|
1233
|
-
(0,
|
|
1622
|
+
(0, import_recipes17.iconButton)({
|
|
1234
1623
|
palette,
|
|
1235
1624
|
usage,
|
|
1236
1625
|
size
|
|
@@ -1241,16 +1630,14 @@ function IconButton(props) {
|
|
|
1241
1630
|
}
|
|
1242
1631
|
|
|
1243
1632
|
// src/components/DatePicker.client.tsx
|
|
1244
|
-
var
|
|
1245
|
-
var
|
|
1246
|
-
var datePickerStyles2 = (0,
|
|
1633
|
+
var import_react16 = require("react");
|
|
1634
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1635
|
+
var datePickerStyles2 = (0, import_recipes18.datePicker)();
|
|
1247
1636
|
function DatePicker(props) {
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
import_react13.DatePicker.Root,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1638
|
+
import_react15.DatePicker.Root,
|
|
1251
1639
|
{
|
|
1252
1640
|
...props,
|
|
1253
|
-
...states,
|
|
1254
1641
|
positioning: {
|
|
1255
1642
|
placement: "bottom-start"
|
|
1256
1643
|
}
|
|
@@ -1260,54 +1647,51 @@ function DatePicker(props) {
|
|
|
1260
1647
|
function DatePickerViewControlGroup(props) {
|
|
1261
1648
|
const { icons } = useCerberusContext();
|
|
1262
1649
|
const { calendarPrev: PrevIcon, calendarNext: NextIcon } = icons;
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1264
|
-
/* @__PURE__ */ (0,
|
|
1265
|
-
/* @__PURE__ */ (0,
|
|
1650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DatePickerViewControl, { ...props, children: [
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.PrevTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconButton, { ariaLabel: "Previous", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PrevIcon, {}) }) }),
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.ViewTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1266
1653
|
Button,
|
|
1267
1654
|
{
|
|
1268
|
-
className: (0,
|
|
1655
|
+
className: (0, import_css24.css)({
|
|
1269
1656
|
h: "2rem",
|
|
1270
1657
|
paddingInline: "md"
|
|
1271
1658
|
}),
|
|
1272
1659
|
shape: "rounded",
|
|
1273
1660
|
size: "sm",
|
|
1274
1661
|
usage: "ghost",
|
|
1275
|
-
children: /* @__PURE__ */ (0,
|
|
1662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.RangeText, {})
|
|
1276
1663
|
}
|
|
1277
1664
|
) }),
|
|
1278
|
-
/* @__PURE__ */ (0,
|
|
1665
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.NextTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconButton, { ariaLabel: "Next", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(NextIcon, {}) }) })
|
|
1279
1666
|
] });
|
|
1280
1667
|
}
|
|
1281
1668
|
function DatePickerTrigger(props) {
|
|
1282
1669
|
const { icons } = useCerberusContext();
|
|
1283
1670
|
const { calendar: CalendarIcon } = icons;
|
|
1284
|
-
return /* @__PURE__ */ (0,
|
|
1285
|
-
|
|
1671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1672
|
+
import_react15.DatePicker.Trigger,
|
|
1286
1673
|
{
|
|
1287
1674
|
...props,
|
|
1288
|
-
className: (0,
|
|
1675
|
+
className: (0, import_css24.cx)(
|
|
1289
1676
|
props.className,
|
|
1290
|
-
(0,
|
|
1677
|
+
(0, import_recipes18.iconButton)({
|
|
1291
1678
|
size: "sm",
|
|
1292
1679
|
usage: "ghost"
|
|
1293
1680
|
}),
|
|
1294
1681
|
datePickerStyles2.trigger
|
|
1295
1682
|
),
|
|
1296
|
-
children: /* @__PURE__ */ (0,
|
|
1683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CalendarIcon, {})
|
|
1297
1684
|
}
|
|
1298
1685
|
);
|
|
1299
1686
|
}
|
|
1300
1687
|
function DatePickerInput(props) {
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
/* @__PURE__ */ (0,
|
|
1304
|
-
|
|
1305
|
-
import_react13.DatePicker.Input,
|
|
1688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react15.DatePicker.Control, { className: datePickerStyles2.control, children: [
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTrigger, {}),
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1691
|
+
import_react15.DatePicker.Input,
|
|
1306
1692
|
{
|
|
1307
1693
|
...props,
|
|
1308
|
-
|
|
1309
|
-
...invalid && { "aria-invalid": true },
|
|
1310
|
-
className: (0, import_css19.cx)(props.className, datePickerStyles2.input),
|
|
1694
|
+
className: (0, import_css24.cx)(props.className, datePickerStyles2.input),
|
|
1311
1695
|
placeholder: props.placeholder ?? "DD MMM YYYY",
|
|
1312
1696
|
maxLength: 11
|
|
1313
1697
|
}
|
|
@@ -1315,36 +1699,31 @@ function DatePickerInput(props) {
|
|
|
1315
1699
|
] });
|
|
1316
1700
|
}
|
|
1317
1701
|
function RangePickerInput(props) {
|
|
1318
|
-
const { invalid, ...fieldStates } = useFieldContext();
|
|
1319
1702
|
const { defaultValue, ...nativeProps } = props;
|
|
1320
|
-
const startDate = (0,
|
|
1321
|
-
const endDate = (0,
|
|
1322
|
-
return /* @__PURE__ */ (0,
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
|
|
1703
|
+
const startDate = (0, import_react16.useMemo)(() => defaultValue == null ? void 0 : defaultValue[0], [defaultValue]);
|
|
1704
|
+
const endDate = (0, import_react16.useMemo)(() => defaultValue == null ? void 0 : defaultValue[1], [defaultValue]);
|
|
1705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react15.DatePicker.Control, { "data-range": true, className: datePickerStyles2.control, children: [
|
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTrigger, {}),
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1708
|
+
import_react15.DatePicker.Input,
|
|
1326
1709
|
{
|
|
1327
1710
|
...nativeProps,
|
|
1328
|
-
...fieldStates,
|
|
1329
|
-
...invalid && { "aria-invalid": true },
|
|
1330
1711
|
"data-range-input": true,
|
|
1331
1712
|
defaultValue: startDate,
|
|
1332
|
-
className: (0,
|
|
1713
|
+
className: (0, import_css24.cx)(props.className, datePickerStyles2.input),
|
|
1333
1714
|
placeholder: props.placeholder ?? "DD MMM YYYY",
|
|
1334
1715
|
maxLength: 11,
|
|
1335
1716
|
index: 0
|
|
1336
1717
|
}
|
|
1337
1718
|
),
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1339
|
-
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1720
|
+
import_react15.DatePicker.Input,
|
|
1340
1721
|
{
|
|
1341
1722
|
...nativeProps,
|
|
1342
|
-
...fieldStates,
|
|
1343
|
-
...invalid && { "aria-invalid": true },
|
|
1344
1723
|
"data-range-input": true,
|
|
1345
1724
|
defaultValue: endDate,
|
|
1346
1725
|
"data-range-end-input": true,
|
|
1347
|
-
className: (0,
|
|
1726
|
+
className: (0, import_css24.cx)(props.className, datePickerStyles2.input),
|
|
1348
1727
|
placeholder: props.placeholder ?? "DD MMM YYYY",
|
|
1349
1728
|
maxLength: 11,
|
|
1350
1729
|
index: 1
|
|
@@ -1354,11 +1733,11 @@ function RangePickerInput(props) {
|
|
|
1354
1733
|
}
|
|
1355
1734
|
function DatePickerContent(props) {
|
|
1356
1735
|
const { children, withModal, ...contentProps } = props;
|
|
1357
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
-
|
|
1736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Portal, { disabled: withModal ?? false, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.Positioner, { className: datePickerStyles2.positioner, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1737
|
+
import_react15.DatePicker.Content,
|
|
1359
1738
|
{
|
|
1360
1739
|
...contentProps,
|
|
1361
|
-
className: (0,
|
|
1740
|
+
className: (0, import_css24.cx)(contentProps.className, datePickerStyles2.content),
|
|
1362
1741
|
children
|
|
1363
1742
|
}
|
|
1364
1743
|
) }) });
|
|
@@ -1380,11 +1759,11 @@ function DatePickerDayView(props) {
|
|
|
1380
1759
|
if (isPastDay(date)) return "past";
|
|
1381
1760
|
return "future";
|
|
1382
1761
|
}
|
|
1383
|
-
return /* @__PURE__ */ (0,
|
|
1384
|
-
/* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerView, { ...props, view: "day", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerContext, { children: (datePicker3) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerViewControlGroup, {}),
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DatePickerTable, { children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableRow, { children: datePicker3.weekDays.map((weekDay, id) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTableHeader, { children: weekDay.narrow }, id)) }) }),
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableBody, { children: datePicker3.weeks.map((week, id) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableRow, { children: week.map((day, id2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTableCell, { value: day, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1388
1767
|
DatePickerTableCellTrigger,
|
|
1389
1768
|
{
|
|
1390
1769
|
"data-date": getDayValue(day),
|
|
@@ -1395,84 +1774,84 @@ function DatePickerDayView(props) {
|
|
|
1395
1774
|
] }) }) });
|
|
1396
1775
|
}
|
|
1397
1776
|
function DatePickerMonthView(props) {
|
|
1398
|
-
return /* @__PURE__ */ (0,
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.View, { ...props, view: "month", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.Context, { children: (datePicker3) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerViewControlGroup, {}),
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTable, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableBody, { children: datePicker3.getMonthsGrid({ columns: 4, format: "short" }).map((months, id) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableRow, { children: months.map((month, id2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTableCell, { value: month.value, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTableCellTrigger, { children: month.label }) }, id2)) }, id)) }) })
|
|
1401
1780
|
] }) }) });
|
|
1402
1781
|
}
|
|
1403
1782
|
function DatePickerYearView(props) {
|
|
1404
|
-
return /* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.View, { ...props, view: "year", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.Context, { children: (datePicker3) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerViewControlGroup, {}),
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTable, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableBody, { children: datePicker3.getYearsGrid({ columns: 4 }).map((years, id) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react15.DatePicker.TableRow, { children: years.map((year, id2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTableCell, { value: year.value, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerTableCellTrigger, { children: year.label }) }, id2)) }, id)) }) })
|
|
1407
1786
|
] }) }) });
|
|
1408
1787
|
}
|
|
1409
1788
|
function DatePickerCalendar(props) {
|
|
1410
|
-
return /* @__PURE__ */ (0,
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(DatePickerContent, { withModal: props.withModal, children: [
|
|
1790
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerDayView, {}),
|
|
1791
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerMonthView, {}),
|
|
1792
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DatePickerYearView, {})
|
|
1414
1793
|
] });
|
|
1415
1794
|
}
|
|
1416
1795
|
|
|
1417
1796
|
// src/components/Dialog.tsx
|
|
1418
|
-
var
|
|
1419
|
-
var
|
|
1420
|
-
var
|
|
1421
|
-
var
|
|
1797
|
+
var import_react17 = require("@ark-ui/react");
|
|
1798
|
+
var import_recipes19 = require("@cerberus/styled-system/recipes");
|
|
1799
|
+
var import_css25 = require("@cerberus/styled-system/css");
|
|
1800
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1422
1801
|
function DialogProvider(props) {
|
|
1423
|
-
return /* @__PURE__ */ (0,
|
|
1802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react17.Dialog.Root, { ...props });
|
|
1424
1803
|
}
|
|
1425
1804
|
function Dialog(props) {
|
|
1426
1805
|
const { size, ...contentProps } = props;
|
|
1427
|
-
const styles = (0,
|
|
1428
|
-
return /* @__PURE__ */ (0,
|
|
1429
|
-
/* @__PURE__ */ (0,
|
|
1430
|
-
/* @__PURE__ */ (0,
|
|
1806
|
+
const styles = (0, import_recipes19.dialog)({ size });
|
|
1807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Portal, { children: [
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DialogBackdrop, { className: styles.backdrop }),
|
|
1809
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DialogPositioner, { className: styles.positioner, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DialogContent, { className: styles.content, ...contentProps }) })
|
|
1431
1810
|
] });
|
|
1432
1811
|
}
|
|
1433
1812
|
function DialogHeading(props) {
|
|
1434
|
-
const styles = (0,
|
|
1435
|
-
return /* @__PURE__ */ (0,
|
|
1813
|
+
const styles = (0, import_recipes19.dialog)();
|
|
1814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react17.Dialog.Title, { ...props, className: (0, import_css25.cx)(props.className, styles.title) });
|
|
1436
1815
|
}
|
|
1437
1816
|
function DialogDescription(props) {
|
|
1438
|
-
const styles = (0,
|
|
1439
|
-
return /* @__PURE__ */ (0,
|
|
1440
|
-
|
|
1817
|
+
const styles = (0, import_recipes19.dialog)();
|
|
1818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1819
|
+
import_react17.Dialog.Description,
|
|
1441
1820
|
{
|
|
1442
1821
|
...props,
|
|
1443
|
-
className: (0,
|
|
1822
|
+
className: (0, import_css25.cx)(props.className, styles.description)
|
|
1444
1823
|
}
|
|
1445
1824
|
);
|
|
1446
1825
|
}
|
|
1447
|
-
var DialogTrigger =
|
|
1448
|
-
var DialogCloseTrigger =
|
|
1449
|
-
var DialogBackdrop =
|
|
1450
|
-
var DialogPositioner =
|
|
1451
|
-
var DialogContent =
|
|
1826
|
+
var DialogTrigger = import_react17.Dialog.Trigger;
|
|
1827
|
+
var DialogCloseTrigger = import_react17.Dialog.CloseTrigger;
|
|
1828
|
+
var DialogBackdrop = import_react17.Dialog.Backdrop;
|
|
1829
|
+
var DialogPositioner = import_react17.Dialog.Positioner;
|
|
1830
|
+
var DialogContent = import_react17.Dialog.Content;
|
|
1452
1831
|
|
|
1453
1832
|
// src/components/Dialog.client.tsx
|
|
1454
|
-
var
|
|
1455
|
-
var
|
|
1456
|
-
var
|
|
1457
|
-
var
|
|
1833
|
+
var import_react18 = require("@ark-ui/react");
|
|
1834
|
+
var import_recipes20 = require("@cerberus/styled-system/recipes");
|
|
1835
|
+
var import_css26 = require("@cerberus/styled-system/css");
|
|
1836
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1458
1837
|
function DialogCloseIconTrigger(props) {
|
|
1459
1838
|
const { icons } = useCerberusContext();
|
|
1460
1839
|
const { close: CloseIcon } = icons;
|
|
1461
|
-
const styles = (0,
|
|
1462
|
-
return /* @__PURE__ */ (0,
|
|
1463
|
-
|
|
1840
|
+
const styles = (0, import_recipes20.dialog)();
|
|
1841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1842
|
+
import_react18.Dialog.CloseTrigger,
|
|
1464
1843
|
{
|
|
1465
1844
|
...props,
|
|
1466
|
-
className: (0,
|
|
1845
|
+
className: (0, import_css26.cx)(props.className, styles.closeTrigger),
|
|
1467
1846
|
asChild: true,
|
|
1468
|
-
children: /* @__PURE__ */ (0,
|
|
1847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1469
1848
|
IconButton,
|
|
1470
1849
|
{
|
|
1471
1850
|
ariaLabel: "Close dialog",
|
|
1472
1851
|
palette: "action",
|
|
1473
1852
|
size: "lg",
|
|
1474
1853
|
usage: "ghost",
|
|
1475
|
-
children: /* @__PURE__ */ (0,
|
|
1854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CloseIcon, {})
|
|
1476
1855
|
}
|
|
1477
1856
|
)
|
|
1478
1857
|
}
|
|
@@ -1481,18 +1860,18 @@ function DialogCloseIconTrigger(props) {
|
|
|
1481
1860
|
|
|
1482
1861
|
// src/components/Droppable.tsx
|
|
1483
1862
|
var import_core = require("@dnd-kit/core");
|
|
1484
|
-
var
|
|
1485
|
-
var
|
|
1863
|
+
var import_react19 = require("react");
|
|
1864
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1486
1865
|
function Droppable(props) {
|
|
1487
1866
|
const { dropped, id, disabled, data, resizeObserverConfig, ...nativeProps } = props;
|
|
1488
|
-
const uuid = (0,
|
|
1867
|
+
const uuid = (0, import_react19.useId)();
|
|
1489
1868
|
const { isOver, setNodeRef } = (0, import_core.useDroppable)({
|
|
1490
1869
|
data,
|
|
1491
1870
|
disabled,
|
|
1492
1871
|
id: id || uuid,
|
|
1493
1872
|
resizeObserverConfig
|
|
1494
1873
|
});
|
|
1495
|
-
return /* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1496
1875
|
"div",
|
|
1497
1876
|
{
|
|
1498
1877
|
...nativeProps,
|
|
@@ -1504,31 +1883,15 @@ function Droppable(props) {
|
|
|
1504
1883
|
);
|
|
1505
1884
|
}
|
|
1506
1885
|
|
|
1507
|
-
// src/components/FieldMessage.tsx
|
|
1508
|
-
var import_css22 = require("@cerberus/styled-system/css");
|
|
1509
|
-
var import_recipes16 = require("@cerberus/styled-system/recipes");
|
|
1510
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1511
|
-
function FieldMessage(props) {
|
|
1512
|
-
const { invalid } = useFieldContext();
|
|
1513
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1514
|
-
"small",
|
|
1515
|
-
{
|
|
1516
|
-
...props,
|
|
1517
|
-
...invalid && { "aria-invalid": true },
|
|
1518
|
-
className: (0, import_css22.cx)(props.className, (0, import_recipes16.fieldMessage)())
|
|
1519
|
-
}
|
|
1520
|
-
);
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
1886
|
// src/context/feature-flags.tsx
|
|
1524
|
-
var
|
|
1525
|
-
var
|
|
1526
|
-
var FeatureFlagContext = (0,
|
|
1887
|
+
var import_react20 = require("react");
|
|
1888
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1889
|
+
var FeatureFlagContext = (0, import_react20.createContext)(null);
|
|
1527
1890
|
function FeatureFlags(props) {
|
|
1528
|
-
return /* @__PURE__ */ (0,
|
|
1891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FeatureFlagContext.Provider, { value: props.flags, children: props.children });
|
|
1529
1892
|
}
|
|
1530
1893
|
function useFeatureFlags(key) {
|
|
1531
|
-
const context = (0,
|
|
1894
|
+
const context = (0, import_react20.useContext)(FeatureFlagContext);
|
|
1532
1895
|
if (context === null) {
|
|
1533
1896
|
throw new Error(
|
|
1534
1897
|
"useFeatureFlag must be used within a FeatureFlags Provider"
|
|
@@ -1538,26 +1901,27 @@ function useFeatureFlags(key) {
|
|
|
1538
1901
|
}
|
|
1539
1902
|
|
|
1540
1903
|
// src/components/FeatureFlag.tsx
|
|
1541
|
-
var
|
|
1904
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1542
1905
|
function FeatureFlag(props) {
|
|
1543
1906
|
const showContent = useFeatureFlags(props.flag);
|
|
1544
|
-
return /* @__PURE__ */ (0,
|
|
1907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Show, { when: showContent, children: props.children });
|
|
1545
1908
|
}
|
|
1546
1909
|
|
|
1547
1910
|
// src/components/Fieldset.tsx
|
|
1548
|
-
var
|
|
1549
|
-
var
|
|
1911
|
+
var import_field4 = require("@ark-ui/react/field");
|
|
1912
|
+
var import_css27 = require("@cerberus/styled-system/css");
|
|
1913
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1550
1914
|
function Fieldset(props) {
|
|
1551
|
-
const { invalid,
|
|
1552
|
-
return /* @__PURE__ */ (0,
|
|
1915
|
+
const { invalid, disabled } = (0, import_field4.useFieldContext)();
|
|
1916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1553
1917
|
"fieldset",
|
|
1554
1918
|
{
|
|
1555
1919
|
...props,
|
|
1556
|
-
|
|
1920
|
+
disabled,
|
|
1557
1921
|
...invalid && { "aria-invalid": true },
|
|
1558
|
-
className: (0,
|
|
1922
|
+
className: (0, import_css27.cx)(
|
|
1559
1923
|
props.className,
|
|
1560
|
-
(0,
|
|
1924
|
+
(0, import_css27.css)({
|
|
1561
1925
|
border: "none",
|
|
1562
1926
|
pt: 2,
|
|
1563
1927
|
margin: 0
|
|
@@ -1568,18 +1932,18 @@ function Fieldset(props) {
|
|
|
1568
1932
|
}
|
|
1569
1933
|
|
|
1570
1934
|
// src/components/FieldsetLabel.tsx
|
|
1571
|
-
var
|
|
1572
|
-
var
|
|
1573
|
-
var
|
|
1935
|
+
var import_css28 = require("@cerberus/styled-system/css");
|
|
1936
|
+
var import_recipes21 = require("@cerberus/styled-system/recipes");
|
|
1937
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1574
1938
|
function FieldsetLabel(props) {
|
|
1575
1939
|
const { size, usage, ...nativeProps } = props;
|
|
1576
|
-
return /* @__PURE__ */ (0,
|
|
1940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1577
1941
|
"label",
|
|
1578
1942
|
{
|
|
1579
1943
|
...nativeProps,
|
|
1580
|
-
className: (0,
|
|
1944
|
+
className: (0, import_css28.cx)(
|
|
1581
1945
|
nativeProps.className,
|
|
1582
|
-
(0,
|
|
1946
|
+
(0, import_recipes21.label)({
|
|
1583
1947
|
size,
|
|
1584
1948
|
usage
|
|
1585
1949
|
})
|
|
@@ -1589,23 +1953,23 @@ function FieldsetLabel(props) {
|
|
|
1589
1953
|
}
|
|
1590
1954
|
|
|
1591
1955
|
// src/components/FileStatus.tsx
|
|
1592
|
-
var
|
|
1593
|
-
var
|
|
1594
|
-
var
|
|
1595
|
-
var
|
|
1956
|
+
var import_react21 = require("react");
|
|
1957
|
+
var import_recipes23 = require("@cerberus/styled-system/recipes");
|
|
1958
|
+
var import_css30 = require("@cerberus/styled-system/css");
|
|
1959
|
+
var import_patterns6 = require("@cerberus/styled-system/patterns");
|
|
1596
1960
|
|
|
1597
1961
|
// src/components/ProgressBar.tsx
|
|
1598
|
-
var
|
|
1599
|
-
var
|
|
1600
|
-
var
|
|
1962
|
+
var import_css29 = require("@cerberus/styled-system/css");
|
|
1963
|
+
var import_recipes22 = require("@cerberus/styled-system/recipes");
|
|
1964
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1601
1965
|
function ProgressBar(props) {
|
|
1602
1966
|
const { indeterminate, size, usage, now, label: label5, ...nativeProps } = props;
|
|
1603
|
-
const styles = (0,
|
|
1967
|
+
const styles = (0, import_recipes22.progressBar)({ size, usage });
|
|
1604
1968
|
const nowClamped = Math.min(100, Math.max(0, now || 0));
|
|
1605
1969
|
const width = {
|
|
1606
1970
|
width: indeterminate ? "50%" : `${nowClamped}%`
|
|
1607
1971
|
};
|
|
1608
|
-
return /* @__PURE__ */ (0,
|
|
1972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1609
1973
|
"div",
|
|
1610
1974
|
{
|
|
1611
1975
|
...nativeProps,
|
|
@@ -1613,9 +1977,9 @@ function ProgressBar(props) {
|
|
|
1613
1977
|
"aria-valuemin": 0,
|
|
1614
1978
|
"aria-valuemax": 100,
|
|
1615
1979
|
"aria-valuenow": indeterminate ? 0 : nowClamped,
|
|
1616
|
-
className: (0,
|
|
1980
|
+
className: (0, import_css29.cx)(nativeProps.className, styles.root),
|
|
1617
1981
|
role: "progressbar",
|
|
1618
|
-
children: /* @__PURE__ */ (0,
|
|
1982
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1619
1983
|
"div",
|
|
1620
1984
|
{
|
|
1621
1985
|
...indeterminate && { "data-indeterminate": true },
|
|
@@ -1629,7 +1993,7 @@ function ProgressBar(props) {
|
|
|
1629
1993
|
}
|
|
1630
1994
|
|
|
1631
1995
|
// src/components/FileStatus.tsx
|
|
1632
|
-
var
|
|
1996
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1633
1997
|
var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
1634
1998
|
processStatus2["TODO"] = "todo";
|
|
1635
1999
|
processStatus2["PROCESSING"] = "processing";
|
|
@@ -1639,24 +2003,24 @@ var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
|
1639
2003
|
})(processStatus || {});
|
|
1640
2004
|
function FileStatus(props) {
|
|
1641
2005
|
const { file, now, status, onClick, ...nativeProps } = props;
|
|
1642
|
-
const actionLabel = (0,
|
|
1643
|
-
const palette = (0,
|
|
1644
|
-
const modalIconPalette = (0,
|
|
1645
|
-
const styles = (0,
|
|
2006
|
+
const actionLabel = (0, import_react21.useMemo)(() => getStatusActionLabel(status), [status]);
|
|
2007
|
+
const palette = (0, import_react21.useMemo)(() => getPalette(status), [status]);
|
|
2008
|
+
const modalIconPalette = (0, import_react21.useMemo)(() => getModalIconPalette(status), [status]);
|
|
2009
|
+
const styles = (0, import_react21.useMemo)(() => {
|
|
1646
2010
|
switch (status) {
|
|
1647
2011
|
case "todo" /* TODO */:
|
|
1648
|
-
return (0,
|
|
2012
|
+
return (0, import_recipes23.fileStatus)({ status: "todo" });
|
|
1649
2013
|
case "processing" /* PROCESSING */:
|
|
1650
|
-
return (0,
|
|
2014
|
+
return (0, import_recipes23.fileStatus)({ status: "processing" });
|
|
1651
2015
|
case "done" /* DONE */:
|
|
1652
|
-
return (0,
|
|
2016
|
+
return (0, import_recipes23.fileStatus)({ status: "done" });
|
|
1653
2017
|
case "error" /* ERROR */:
|
|
1654
|
-
return (0,
|
|
2018
|
+
return (0, import_recipes23.fileStatus)({ status: "error" });
|
|
1655
2019
|
default:
|
|
1656
|
-
return (0,
|
|
2020
|
+
return (0, import_recipes23.fileStatus)();
|
|
1657
2021
|
}
|
|
1658
2022
|
}, [status]);
|
|
1659
|
-
const handleClick = (0,
|
|
2023
|
+
const handleClick = (0, import_react21.useCallback)(
|
|
1660
2024
|
(e) => {
|
|
1661
2025
|
const actionStatus = getStatusActionLabel(
|
|
1662
2026
|
status
|
|
@@ -1665,41 +2029,41 @@ function FileStatus(props) {
|
|
|
1665
2029
|
},
|
|
1666
2030
|
[onClick]
|
|
1667
2031
|
);
|
|
1668
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
1669
2033
|
"div",
|
|
1670
2034
|
{
|
|
1671
2035
|
...nativeProps,
|
|
1672
|
-
className: (0,
|
|
2036
|
+
className: (0, import_css30.cx)(nativeProps.className, styles.root, (0, import_patterns6.hstack)()),
|
|
1673
2037
|
children: [
|
|
1674
|
-
/* @__PURE__ */ (0,
|
|
2038
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1675
2039
|
Avatar,
|
|
1676
2040
|
{
|
|
1677
2041
|
ariaLabel: "",
|
|
1678
2042
|
gradient: modalIconPalette,
|
|
1679
|
-
icon: /* @__PURE__ */ (0,
|
|
2043
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MatchFileStatusIcon, { size: 24, status }),
|
|
1680
2044
|
src: ""
|
|
1681
2045
|
}
|
|
1682
2046
|
),
|
|
1683
|
-
/* @__PURE__ */ (0,
|
|
2047
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
1684
2048
|
"div",
|
|
1685
2049
|
{
|
|
1686
|
-
className: (0,
|
|
2050
|
+
className: (0, import_patterns6.vstack)({
|
|
1687
2051
|
alignItems: "flex-start",
|
|
1688
2052
|
gap: "0.12rem",
|
|
1689
2053
|
w: "full"
|
|
1690
2054
|
}),
|
|
1691
2055
|
children: [
|
|
1692
|
-
/* @__PURE__ */ (0,
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1693
2057
|
"small",
|
|
1694
2058
|
{
|
|
1695
|
-
className: (0,
|
|
2059
|
+
className: (0, import_css30.css)({
|
|
1696
2060
|
color: "page.text.initial",
|
|
1697
2061
|
textStyle: "label-sm"
|
|
1698
2062
|
}),
|
|
1699
2063
|
children: file
|
|
1700
2064
|
}
|
|
1701
2065
|
),
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
2066
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1703
2067
|
ProgressBar,
|
|
1704
2068
|
{
|
|
1705
2069
|
id: props.id,
|
|
@@ -1708,27 +2072,27 @@ function FileStatus(props) {
|
|
|
1708
2072
|
size: "sm"
|
|
1709
2073
|
}
|
|
1710
2074
|
),
|
|
1711
|
-
/* @__PURE__ */ (0,
|
|
1712
|
-
|
|
2075
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Field2, { label: "", invalid: modalIconPalette === "hades-dark", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2076
|
+
FieldHelperText,
|
|
1713
2077
|
{
|
|
1714
|
-
className: (0,
|
|
2078
|
+
className: (0, import_css30.css)({
|
|
1715
2079
|
color: "page.text.100"
|
|
1716
2080
|
}),
|
|
1717
2081
|
id: `help:${file}`,
|
|
1718
|
-
children: /* @__PURE__ */ (0,
|
|
2082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MatchFileStatusText, { status, now })
|
|
1719
2083
|
}
|
|
1720
2084
|
) })
|
|
1721
2085
|
]
|
|
1722
2086
|
}
|
|
1723
2087
|
),
|
|
1724
|
-
/* @__PURE__ */ (0,
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1725
2089
|
IconButton,
|
|
1726
2090
|
{
|
|
1727
2091
|
ariaLabel: actionLabel,
|
|
1728
2092
|
onClick: handleClick,
|
|
1729
2093
|
palette,
|
|
1730
2094
|
size: "sm",
|
|
1731
|
-
children: /* @__PURE__ */ (0,
|
|
2095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MatchStatusAction, { status })
|
|
1732
2096
|
}
|
|
1733
2097
|
)
|
|
1734
2098
|
]
|
|
@@ -1745,13 +2109,13 @@ function MatchFileStatusIcon(props) {
|
|
|
1745
2109
|
} = icons;
|
|
1746
2110
|
switch (props.status) {
|
|
1747
2111
|
case "todo" /* TODO */:
|
|
1748
|
-
return /* @__PURE__ */ (0,
|
|
2112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TodoIcon, { size: props.size });
|
|
1749
2113
|
case "processing" /* PROCESSING */:
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
2114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FileUploaderIcon, { size: props.size });
|
|
1751
2115
|
case "done" /* DONE */:
|
|
1752
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(DoneIcon, { size: props.size });
|
|
1753
2117
|
case "error" /* ERROR */:
|
|
1754
|
-
return /* @__PURE__ */ (0,
|
|
2118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(InvalidIcon, { size: props.size });
|
|
1755
2119
|
default:
|
|
1756
2120
|
throw new Error("Unknown status");
|
|
1757
2121
|
}
|
|
@@ -1776,11 +2140,11 @@ function MatchStatusAction(props) {
|
|
|
1776
2140
|
switch (props.status) {
|
|
1777
2141
|
case "todo" /* TODO */:
|
|
1778
2142
|
case "processing" /* PROCESSING */:
|
|
1779
|
-
return /* @__PURE__ */ (0,
|
|
2143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CloseIcon, {});
|
|
1780
2144
|
case "error" /* ERROR */:
|
|
1781
|
-
return /* @__PURE__ */ (0,
|
|
2145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(RedoIcon, {});
|
|
1782
2146
|
case "done" /* DONE */:
|
|
1783
|
-
return /* @__PURE__ */ (0,
|
|
2147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TrashIcon, {});
|
|
1784
2148
|
default:
|
|
1785
2149
|
throw new Error("Invalid status");
|
|
1786
2150
|
}
|
|
@@ -1826,57 +2190,57 @@ function getModalIconPalette(status) {
|
|
|
1826
2190
|
}
|
|
1827
2191
|
|
|
1828
2192
|
// src/components/FileUploader.tsx
|
|
1829
|
-
var
|
|
1830
|
-
var
|
|
1831
|
-
var
|
|
1832
|
-
var
|
|
2193
|
+
var import_css31 = require("@cerberus/styled-system/css");
|
|
2194
|
+
var import_patterns7 = require("@cerberus/styled-system/patterns");
|
|
2195
|
+
var import_recipes24 = require("@cerberus/styled-system/recipes");
|
|
2196
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1833
2197
|
function FileUploader(props) {
|
|
1834
2198
|
var _a;
|
|
1835
2199
|
const { icons } = useCerberusContext();
|
|
1836
|
-
const styles = (0,
|
|
2200
|
+
const styles = (0, import_recipes24.fileUploader)();
|
|
1837
2201
|
const { waitingFileUploader: Icon } = icons;
|
|
1838
|
-
return /* @__PURE__ */ (0,
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1839
2203
|
"div",
|
|
1840
2204
|
{
|
|
1841
2205
|
...props.disabled ? { "aria-disabled": true } : {},
|
|
1842
|
-
className: (0,
|
|
1843
|
-
(0,
|
|
2206
|
+
className: (0, import_css31.cx)(
|
|
2207
|
+
(0, import_patterns7.vstack)({
|
|
1844
2208
|
justify: "center"
|
|
1845
2209
|
}),
|
|
1846
2210
|
styles.container
|
|
1847
2211
|
),
|
|
1848
2212
|
children: [
|
|
1849
|
-
/* @__PURE__ */ (0,
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1850
2214
|
Avatar,
|
|
1851
2215
|
{
|
|
1852
2216
|
gradient: "charon-light",
|
|
1853
2217
|
ariaLabel: "",
|
|
1854
|
-
icon: /* @__PURE__ */ (0,
|
|
2218
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, {}),
|
|
1855
2219
|
size: "md",
|
|
1856
2220
|
src: ""
|
|
1857
2221
|
}
|
|
1858
2222
|
) }),
|
|
1859
|
-
/* @__PURE__ */ (0,
|
|
2223
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1860
2224
|
"label",
|
|
1861
2225
|
{
|
|
1862
|
-
className: (0,
|
|
1863
|
-
(0,
|
|
2226
|
+
className: (0, import_css31.cx)(
|
|
2227
|
+
(0, import_patterns7.vstack)({
|
|
1864
2228
|
justify: "center"
|
|
1865
2229
|
}),
|
|
1866
2230
|
styles.label
|
|
1867
2231
|
),
|
|
1868
2232
|
htmlFor: props.name,
|
|
1869
2233
|
children: [
|
|
1870
|
-
/* @__PURE__ */ (0,
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Show, { when: Boolean(props.heading), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: styles.heading, children: props.heading }) }),
|
|
1871
2235
|
"Import ",
|
|
1872
2236
|
(_a = props.accept) == null ? void 0 : _a.replace(",", ", "),
|
|
1873
2237
|
" files",
|
|
1874
|
-
/* @__PURE__ */ (0,
|
|
1875
|
-
/* @__PURE__ */ (0,
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: styles.description, children: "Click to select files" }),
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1876
2240
|
"input",
|
|
1877
2241
|
{
|
|
1878
2242
|
...props,
|
|
1879
|
-
className: (0,
|
|
2243
|
+
className: (0, import_css31.cx)(props.className, styles.input),
|
|
1880
2244
|
type: "file"
|
|
1881
2245
|
}
|
|
1882
2246
|
)
|
|
@@ -1888,104 +2252,46 @@ function FileUploader(props) {
|
|
|
1888
2252
|
);
|
|
1889
2253
|
}
|
|
1890
2254
|
|
|
1891
|
-
// src/components/
|
|
1892
|
-
|
|
1893
|
-
var
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
const hasEndIcon = Boolean(endIcon);
|
|
1900
|
-
const { icons } = useCerberusContext();
|
|
1901
|
-
const { invalid: InvalidIcon } = icons;
|
|
1902
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: inputStyles.root, children: [
|
|
1903
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
|
|
1904
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1905
|
-
"input",
|
|
1906
|
-
{
|
|
1907
|
-
...nativeProps,
|
|
1908
|
-
...fieldStates,
|
|
1909
|
-
...describedBy && { "aria-describedby": describedBy },
|
|
1910
|
-
...invalid && { "aria-invalid": true },
|
|
1911
|
-
"data-start-icon": Boolean(startIcon),
|
|
1912
|
-
className: (0, import_css28.cx)("peer", nativeProps.className, inputStyles.input)
|
|
1913
|
-
}
|
|
1914
|
-
),
|
|
1915
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
|
|
1916
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
|
|
1917
|
-
] });
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
// src/components/Label.tsx
|
|
1921
|
-
var import_recipes22 = require("@cerberus/styled-system/recipes");
|
|
1922
|
-
var import_css29 = require("@cerberus/styled-system/css");
|
|
1923
|
-
var import_patterns9 = require("@cerberus/styled-system/patterns");
|
|
1924
|
-
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1925
|
-
function Label(props) {
|
|
1926
|
-
const { hidden, size, ...nativeProps } = props;
|
|
1927
|
-
const { required, disabled } = useFieldContext();
|
|
1928
|
-
const usage = hidden ? "hidden" : "visible";
|
|
1929
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
1930
|
-
"label",
|
|
1931
|
-
{
|
|
1932
|
-
...nativeProps,
|
|
1933
|
-
...disabled && { "data-disabled": true },
|
|
1934
|
-
className: (0, import_css29.cx)(
|
|
1935
|
-
nativeProps.className,
|
|
1936
|
-
(0, import_recipes22.label)({ size, usage }),
|
|
1937
|
-
(0, import_patterns9.hstack)({
|
|
1938
|
-
justify: "space-between",
|
|
1939
|
-
w: "full"
|
|
1940
|
-
})
|
|
1941
|
-
),
|
|
1942
|
-
children: [
|
|
1943
|
-
props.children,
|
|
1944
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1945
|
-
"span",
|
|
1946
|
-
{
|
|
1947
|
-
className: (0, import_css29.css)({
|
|
1948
|
-
color: "page.text.100",
|
|
1949
|
-
fontSize: "inherit"
|
|
1950
|
-
}),
|
|
1951
|
-
children: "(required)"
|
|
1952
|
-
}
|
|
1953
|
-
) })
|
|
1954
|
-
]
|
|
1955
|
-
}
|
|
1956
|
-
);
|
|
2255
|
+
// src/components/for.tsx
|
|
2256
|
+
function For(props) {
|
|
2257
|
+
var _a, _b;
|
|
2258
|
+
const mappableChildren = props.children;
|
|
2259
|
+
if (((_a = props.each) == null ? void 0 : _a.length) === 0) {
|
|
2260
|
+
return props.fallback || null;
|
|
2261
|
+
}
|
|
2262
|
+
return (_b = props.each) == null ? void 0 : _b.map(mappableChildren);
|
|
1957
2263
|
}
|
|
1958
2264
|
|
|
1959
2265
|
// src/components/Legend.tsx
|
|
1960
|
-
var
|
|
1961
|
-
var
|
|
1962
|
-
var
|
|
1963
|
-
var
|
|
2266
|
+
var import_css32 = require("@cerberus/styled-system/css");
|
|
2267
|
+
var import_recipes25 = require("@cerberus/styled-system/recipes");
|
|
2268
|
+
var import_patterns8 = require("@cerberus/styled-system/patterns");
|
|
2269
|
+
var import_field6 = require("@ark-ui/react/field");
|
|
2270
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1964
2271
|
function Legend(props) {
|
|
1965
2272
|
const { size, ...nativeProps } = props;
|
|
1966
|
-
const { invalid,
|
|
1967
|
-
return /* @__PURE__ */ (0,
|
|
2273
|
+
const { invalid, required } = (0, import_field6.useFieldContext)();
|
|
2274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
1968
2275
|
"legend",
|
|
1969
2276
|
{
|
|
1970
2277
|
...nativeProps,
|
|
1971
|
-
...formState,
|
|
1972
2278
|
...invalid && { "aria-invalid": true },
|
|
1973
|
-
className: (0,
|
|
2279
|
+
className: (0, import_css32.cx)(
|
|
1974
2280
|
nativeProps.className,
|
|
1975
|
-
(0,
|
|
2281
|
+
(0, import_patterns8.hstack)({
|
|
1976
2282
|
justify: "space-between",
|
|
1977
2283
|
w: "full"
|
|
1978
2284
|
}),
|
|
1979
|
-
(0,
|
|
2285
|
+
(0, import_recipes25.label)({
|
|
1980
2286
|
size
|
|
1981
2287
|
})
|
|
1982
2288
|
),
|
|
1983
2289
|
children: [
|
|
1984
2290
|
nativeProps.children,
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1986
2292
|
"span",
|
|
1987
2293
|
{
|
|
1988
|
-
className: (0,
|
|
2294
|
+
className: (0, import_css32.css)({
|
|
1989
2295
|
color: "page.text.100",
|
|
1990
2296
|
fontSize: "inherit"
|
|
1991
2297
|
}),
|
|
@@ -1998,52 +2304,52 @@ function Legend(props) {
|
|
|
1998
2304
|
}
|
|
1999
2305
|
|
|
2000
2306
|
// src/components/Menu.tsx
|
|
2001
|
-
var
|
|
2002
|
-
var
|
|
2003
|
-
var
|
|
2004
|
-
var
|
|
2005
|
-
var menuStyles = (0,
|
|
2006
|
-
var Menu =
|
|
2307
|
+
var import_react22 = require("@ark-ui/react");
|
|
2308
|
+
var import_recipes26 = require("@cerberus/styled-system/recipes");
|
|
2309
|
+
var import_css33 = require("@cerberus/styled-system/css");
|
|
2310
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2311
|
+
var menuStyles = (0, import_recipes26.menu)();
|
|
2312
|
+
var Menu = import_react22.Menu.Root;
|
|
2007
2313
|
function MenuTrigger(props) {
|
|
2008
|
-
return /* @__PURE__ */ (0,
|
|
2314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react22.Menu.Trigger, { ...props, asChild: true });
|
|
2009
2315
|
}
|
|
2010
2316
|
function MenuContent(props) {
|
|
2011
|
-
return /* @__PURE__ */ (0,
|
|
2012
|
-
|
|
2317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react22.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2318
|
+
import_react22.Menu.Content,
|
|
2013
2319
|
{
|
|
2014
2320
|
...props,
|
|
2015
|
-
className: (0,
|
|
2321
|
+
className: (0, import_css33.cx)(props.className, menuStyles.content)
|
|
2016
2322
|
}
|
|
2017
2323
|
) });
|
|
2018
2324
|
}
|
|
2019
2325
|
function MenuItem(props) {
|
|
2020
|
-
return /* @__PURE__ */ (0,
|
|
2326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react22.Menu.Item, { ...props, className: (0, import_css33.cx)(props.className, menuStyles.item) });
|
|
2021
2327
|
}
|
|
2022
|
-
var MenuItemGroup =
|
|
2328
|
+
var MenuItemGroup = import_react22.Menu.ItemGroup;
|
|
2023
2329
|
function MenuGroupLabel(props) {
|
|
2024
|
-
return /* @__PURE__ */ (0,
|
|
2025
|
-
|
|
2330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2331
|
+
import_react22.Menu.ItemGroupLabel,
|
|
2026
2332
|
{
|
|
2027
2333
|
...props,
|
|
2028
|
-
className: (0,
|
|
2334
|
+
className: (0, import_css33.cx)(props.className, menuStyles.itemGroupLabel)
|
|
2029
2335
|
}
|
|
2030
2336
|
);
|
|
2031
2337
|
}
|
|
2032
2338
|
function MenuSeparator(props) {
|
|
2033
|
-
return /* @__PURE__ */ (0,
|
|
2034
|
-
|
|
2339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2340
|
+
import_react22.Menu.Separator,
|
|
2035
2341
|
{
|
|
2036
2342
|
...props,
|
|
2037
|
-
className: (0,
|
|
2343
|
+
className: (0, import_css33.cx)(props.className, menuStyles.separator)
|
|
2038
2344
|
}
|
|
2039
2345
|
);
|
|
2040
2346
|
}
|
|
2041
2347
|
|
|
2042
2348
|
// src/components/Notification.tsx
|
|
2043
|
-
var
|
|
2044
|
-
var
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2349
|
+
var import_css34 = require("@cerberus/styled-system/css");
|
|
2350
|
+
var import_patterns9 = require("@cerberus/styled-system/patterns");
|
|
2351
|
+
var import_recipes27 = require("@cerberus/styled-system/recipes");
|
|
2352
|
+
var import_react23 = require("react");
|
|
2047
2353
|
|
|
2048
2354
|
// src/aria-helpers/trap-focus.aria.ts
|
|
2049
2355
|
function trapFocus(modalRef) {
|
|
@@ -2072,29 +2378,29 @@ function trapFocus(modalRef) {
|
|
|
2072
2378
|
}
|
|
2073
2379
|
|
|
2074
2380
|
// src/components/Notification.tsx
|
|
2075
|
-
var
|
|
2381
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2076
2382
|
function MatchNotificationIcon(props) {
|
|
2077
2383
|
const { icons } = useCerberusContext();
|
|
2078
2384
|
const palette = props.palette || "info";
|
|
2079
2385
|
const key = `${palette}Notification`;
|
|
2080
2386
|
const Icon = icons[key];
|
|
2081
|
-
return /* @__PURE__ */ (0,
|
|
2387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, {});
|
|
2082
2388
|
}
|
|
2083
2389
|
function Notification(props) {
|
|
2084
2390
|
const { children, palette, onClose, ...nativeProps } = props;
|
|
2085
|
-
const ref = (0,
|
|
2391
|
+
const ref = (0, import_react23.useRef)(null);
|
|
2086
2392
|
const onKeyDown = trapFocus(ref);
|
|
2087
|
-
const styles = (0,
|
|
2393
|
+
const styles = (0, import_recipes27.notification)({ palette });
|
|
2088
2394
|
const { icons } = useCerberusContext();
|
|
2089
2395
|
const { close: CloseIcon } = icons;
|
|
2090
|
-
return /* @__PURE__ */ (0,
|
|
2396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2091
2397
|
"dialog",
|
|
2092
2398
|
{
|
|
2093
2399
|
...nativeProps,
|
|
2094
2400
|
"data-placement": "left",
|
|
2095
|
-
className: (0,
|
|
2401
|
+
className: (0, import_css34.cx)(
|
|
2096
2402
|
nativeProps.className,
|
|
2097
|
-
(0,
|
|
2403
|
+
(0, import_patterns9.hstack)({
|
|
2098
2404
|
position: "relative",
|
|
2099
2405
|
gap: "4"
|
|
2100
2406
|
}),
|
|
@@ -2103,11 +2409,11 @@ function Notification(props) {
|
|
|
2103
2409
|
onKeyDown,
|
|
2104
2410
|
ref,
|
|
2105
2411
|
children: [
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MatchNotificationIcon, { palette }) }),
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2108
2414
|
"div",
|
|
2109
2415
|
{
|
|
2110
|
-
className: (0,
|
|
2416
|
+
className: (0, import_patterns9.vstack)({
|
|
2111
2417
|
alignItems: "flex-start",
|
|
2112
2418
|
gap: "0",
|
|
2113
2419
|
py: "2"
|
|
@@ -2115,14 +2421,14 @@ function Notification(props) {
|
|
|
2115
2421
|
children
|
|
2116
2422
|
}
|
|
2117
2423
|
),
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2119
2425
|
"button",
|
|
2120
2426
|
{
|
|
2121
2427
|
"aria-label": "Close",
|
|
2122
2428
|
className: styles.close,
|
|
2123
2429
|
onClick: onClose,
|
|
2124
2430
|
value: props.id,
|
|
2125
|
-
children: /* @__PURE__ */ (0,
|
|
2431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CloseIcon, {})
|
|
2126
2432
|
}
|
|
2127
2433
|
)
|
|
2128
2434
|
]
|
|
@@ -2131,59 +2437,57 @@ function Notification(props) {
|
|
|
2131
2437
|
}
|
|
2132
2438
|
|
|
2133
2439
|
// src/components/NotificationHeading.tsx
|
|
2134
|
-
var
|
|
2135
|
-
var
|
|
2136
|
-
var
|
|
2440
|
+
var import_css35 = require("@cerberus/styled-system/css");
|
|
2441
|
+
var import_recipes28 = require("@cerberus/styled-system/recipes");
|
|
2442
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2137
2443
|
function NotificationHeading(props) {
|
|
2138
2444
|
const { palette, ...nativeProps } = props;
|
|
2139
|
-
const styles = (0,
|
|
2140
|
-
return /* @__PURE__ */ (0,
|
|
2445
|
+
const styles = (0, import_recipes28.notification)({ palette });
|
|
2446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: (0, import_css35.cx)(nativeProps.className, styles.heading), ...nativeProps });
|
|
2141
2447
|
}
|
|
2142
2448
|
|
|
2143
2449
|
// src/components/NotificationDescription.tsx
|
|
2144
|
-
var
|
|
2145
|
-
var
|
|
2146
|
-
var
|
|
2450
|
+
var import_css36 = require("@cerberus/styled-system/css");
|
|
2451
|
+
var import_recipes29 = require("@cerberus/styled-system/recipes");
|
|
2452
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2147
2453
|
function NotificationDescription(props) {
|
|
2148
2454
|
const { palette, ...nativeProps } = props;
|
|
2149
|
-
const styles = (0,
|
|
2150
|
-
return /* @__PURE__ */ (0,
|
|
2455
|
+
const styles = (0, import_recipes29.notification)({ palette });
|
|
2456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2151
2457
|
"p",
|
|
2152
2458
|
{
|
|
2153
|
-
className: (0,
|
|
2459
|
+
className: (0, import_css36.cx)(nativeProps.className, styles.description),
|
|
2154
2460
|
...nativeProps
|
|
2155
2461
|
}
|
|
2156
2462
|
);
|
|
2157
2463
|
}
|
|
2158
2464
|
|
|
2159
2465
|
// src/components/Radio.tsx
|
|
2160
|
-
var
|
|
2161
|
-
var
|
|
2162
|
-
var
|
|
2163
|
-
var
|
|
2466
|
+
var import_field7 = require("@ark-ui/react/field");
|
|
2467
|
+
var import_css37 = require("@cerberus/styled-system/css");
|
|
2468
|
+
var import_patterns10 = require("@cerberus/styled-system/patterns");
|
|
2469
|
+
var import_recipes30 = require("@cerberus/styled-system/recipes");
|
|
2470
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2164
2471
|
function Radio(props) {
|
|
2165
2472
|
const { children, size, ...nativeProps } = props;
|
|
2166
|
-
const
|
|
2167
|
-
|
|
2168
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2473
|
+
const styles = (0, import_recipes30.radio)({ size });
|
|
2474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
2169
2475
|
"div",
|
|
2170
2476
|
{
|
|
2171
|
-
className: (0,
|
|
2477
|
+
className: (0, import_css37.cx)(
|
|
2172
2478
|
"group",
|
|
2173
|
-
(0,
|
|
2479
|
+
(0, import_patterns10.hstack)({
|
|
2174
2480
|
gap: "sm"
|
|
2175
2481
|
}),
|
|
2176
2482
|
styles.root
|
|
2177
2483
|
),
|
|
2178
2484
|
tabIndex: 0,
|
|
2179
2485
|
children: [
|
|
2180
|
-
/* @__PURE__ */ (0,
|
|
2181
|
-
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2487
|
+
import_field7.Field.Input,
|
|
2182
2488
|
{
|
|
2183
2489
|
...nativeProps,
|
|
2184
|
-
|
|
2185
|
-
...invalid && { "aria-invalid": true },
|
|
2186
|
-
className: (0, import_css35.cx)(nativeProps.className, styles.input),
|
|
2490
|
+
className: (0, import_css37.cx)(nativeProps.className, styles.input),
|
|
2187
2491
|
tabIndex: -1,
|
|
2188
2492
|
type: "radio"
|
|
2189
2493
|
}
|
|
@@ -2196,40 +2500,25 @@ function Radio(props) {
|
|
|
2196
2500
|
|
|
2197
2501
|
// src/components/Tabs.client.tsx
|
|
2198
2502
|
var import_tabs2 = require("@ark-ui/react/tabs");
|
|
2199
|
-
var
|
|
2503
|
+
var import_css38 = require("@cerberus/styled-system/css");
|
|
2200
2504
|
|
|
2201
2505
|
// src/context/tabs.tsx
|
|
2202
2506
|
var import_tabs = require("@ark-ui/react/tabs");
|
|
2203
|
-
var
|
|
2204
|
-
var
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
function getLocalStorage(key, defaultValue) {
|
|
2208
|
-
const value = window.localStorage.getItem(key);
|
|
2209
|
-
if (value) {
|
|
2210
|
-
return value;
|
|
2211
|
-
}
|
|
2212
|
-
return defaultValue;
|
|
2213
|
-
}
|
|
2214
|
-
function setLocalStorage(key, value) {
|
|
2215
|
-
const stringValue = typeof value === "string" ? value : JSON.stringify(value);
|
|
2216
|
-
window.localStorage.setItem(key, stringValue);
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
// src/context/tabs.tsx
|
|
2220
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2221
|
-
var TabsContext = (0, import_react22.createContext)(null);
|
|
2507
|
+
var import_recipes31 = require("@cerberus/styled-system/recipes");
|
|
2508
|
+
var import_react24 = require("react");
|
|
2509
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2510
|
+
var TabsContext = (0, import_react24.createContext)(null);
|
|
2222
2511
|
function Tabs(props) {
|
|
2223
2512
|
const { cache, defaultValue, palette, uuid, ...arkProps } = props;
|
|
2224
|
-
const [activeTab, setActiveTab] = (0,
|
|
2513
|
+
const [activeTab, setActiveTab] = (0, import_react24.useState)(
|
|
2225
2514
|
() => cache ? "" : defaultValue
|
|
2226
2515
|
);
|
|
2227
|
-
const styles = (0,
|
|
2228
|
-
const cacheKey = (0,
|
|
2516
|
+
const styles = (0, import_recipes31.tabs)({ palette });
|
|
2517
|
+
const cacheKey = (0, import_react24.useMemo)(
|
|
2229
2518
|
() => uuid ? `cerberus-tabs-${uuid}` : "cerberus-tabs",
|
|
2230
2519
|
[uuid]
|
|
2231
2520
|
);
|
|
2232
|
-
const handleValueChange = (0,
|
|
2521
|
+
const handleValueChange = (0, import_react24.useCallback)(
|
|
2233
2522
|
(details) => {
|
|
2234
2523
|
if (cache) {
|
|
2235
2524
|
setLocalStorage(cacheKey, details.value);
|
|
@@ -2238,20 +2527,20 @@ function Tabs(props) {
|
|
|
2238
2527
|
},
|
|
2239
2528
|
[cache]
|
|
2240
2529
|
);
|
|
2241
|
-
(0,
|
|
2530
|
+
(0, import_react24.useEffect)(() => {
|
|
2242
2531
|
if (cache && !activeTab) {
|
|
2243
2532
|
const cachedTab = getLocalStorage(cacheKey, defaultValue ?? "");
|
|
2244
2533
|
setActiveTab(cachedTab);
|
|
2245
2534
|
}
|
|
2246
2535
|
}, [cache, defaultValue, activeTab]);
|
|
2247
|
-
const value = (0,
|
|
2536
|
+
const value = (0, import_react24.useMemo)(
|
|
2248
2537
|
() => ({
|
|
2249
2538
|
active: activeTab,
|
|
2250
2539
|
styles
|
|
2251
2540
|
}),
|
|
2252
2541
|
[activeTab, palette, styles]
|
|
2253
2542
|
);
|
|
2254
|
-
return /* @__PURE__ */ (0,
|
|
2543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabsContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2255
2544
|
import_tabs.Tabs.Root,
|
|
2256
2545
|
{
|
|
2257
2546
|
...arkProps,
|
|
@@ -2265,7 +2554,7 @@ function Tabs(props) {
|
|
|
2265
2554
|
) });
|
|
2266
2555
|
}
|
|
2267
2556
|
function useTabsContext() {
|
|
2268
|
-
const context = (0,
|
|
2557
|
+
const context = (0, import_react24.useContext)(TabsContext);
|
|
2269
2558
|
if (!context) {
|
|
2270
2559
|
throw new Error("useTabsContext must be used within a Tabs Provider.");
|
|
2271
2560
|
}
|
|
@@ -2273,18 +2562,18 @@ function useTabsContext() {
|
|
|
2273
2562
|
}
|
|
2274
2563
|
|
|
2275
2564
|
// src/components/Tabs.client.tsx
|
|
2276
|
-
var
|
|
2565
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2277
2566
|
function TabsList(props) {
|
|
2278
2567
|
const { children, ...tabsProps } = props;
|
|
2279
2568
|
const { styles } = useTabsContext();
|
|
2280
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2281
2570
|
import_tabs2.Tabs.List,
|
|
2282
2571
|
{
|
|
2283
2572
|
...tabsProps,
|
|
2284
|
-
className: (0,
|
|
2573
|
+
className: (0, import_css38.cx)(tabsProps.className, styles.list),
|
|
2285
2574
|
children: [
|
|
2286
2575
|
children,
|
|
2287
|
-
/* @__PURE__ */ (0,
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabIndicator, {})
|
|
2288
2577
|
]
|
|
2289
2578
|
}
|
|
2290
2579
|
);
|
|
@@ -2292,90 +2581,90 @@ function TabsList(props) {
|
|
|
2292
2581
|
var TabList = TabsList;
|
|
2293
2582
|
function Tab(props) {
|
|
2294
2583
|
const { styles } = useTabsContext();
|
|
2295
|
-
return /* @__PURE__ */ (0,
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2296
2585
|
import_tabs2.Tabs.Trigger,
|
|
2297
2586
|
{
|
|
2298
2587
|
...props,
|
|
2299
|
-
className: (0,
|
|
2588
|
+
className: (0, import_css38.cx)(props.className, styles.trigger)
|
|
2300
2589
|
}
|
|
2301
2590
|
);
|
|
2302
2591
|
}
|
|
2303
2592
|
function TabIndicator(props) {
|
|
2304
2593
|
const { styles } = useTabsContext();
|
|
2305
|
-
return /* @__PURE__ */ (0,
|
|
2594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2306
2595
|
import_tabs2.Tabs.Indicator,
|
|
2307
2596
|
{
|
|
2308
2597
|
...props,
|
|
2309
|
-
className: (0,
|
|
2598
|
+
className: (0, import_css38.cx)(props.className, styles.indicator)
|
|
2310
2599
|
}
|
|
2311
2600
|
);
|
|
2312
2601
|
}
|
|
2313
2602
|
function TabPanel(props) {
|
|
2314
2603
|
const { styles } = useTabsContext();
|
|
2315
|
-
return /* @__PURE__ */ (0,
|
|
2604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2316
2605
|
import_tabs2.Tabs.Content,
|
|
2317
2606
|
{
|
|
2318
2607
|
...props,
|
|
2319
|
-
className: (0,
|
|
2608
|
+
className: (0, import_css38.cx)(props.className, styles.content)
|
|
2320
2609
|
}
|
|
2321
2610
|
);
|
|
2322
2611
|
}
|
|
2323
2612
|
|
|
2324
2613
|
// src/components/Table.tsx
|
|
2325
|
-
var
|
|
2326
|
-
var
|
|
2327
|
-
var
|
|
2614
|
+
var import_css39 = require("@cerberus/styled-system/css");
|
|
2615
|
+
var import_recipes32 = require("@cerberus/styled-system/recipes");
|
|
2616
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2328
2617
|
function Table(props) {
|
|
2329
2618
|
const { caption, children, ...nativeProps } = props;
|
|
2330
|
-
const styles = (0,
|
|
2331
|
-
return /* @__PURE__ */ (0,
|
|
2619
|
+
const styles = (0, import_recipes32.table)();
|
|
2620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
2332
2621
|
"table",
|
|
2333
2622
|
{
|
|
2334
2623
|
...nativeProps,
|
|
2335
|
-
className: (0,
|
|
2624
|
+
className: (0, import_css39.cx)(nativeProps.className, styles.table),
|
|
2336
2625
|
children: [
|
|
2337
|
-
/* @__PURE__ */ (0,
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("caption", { className: styles.caption, children: caption }),
|
|
2338
2627
|
children
|
|
2339
2628
|
]
|
|
2340
2629
|
}
|
|
2341
2630
|
) });
|
|
2342
2631
|
}
|
|
2343
2632
|
function Tr(props) {
|
|
2344
|
-
return /* @__PURE__ */ (0,
|
|
2633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("tr", { ...props });
|
|
2345
2634
|
}
|
|
2346
2635
|
|
|
2347
2636
|
// src/components/Thead.tsx
|
|
2348
|
-
var
|
|
2349
|
-
var
|
|
2350
|
-
var
|
|
2637
|
+
var import_css40 = require("@cerberus/styled-system/css");
|
|
2638
|
+
var import_recipes33 = require("@cerberus/styled-system/recipes");
|
|
2639
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2351
2640
|
function Thead(props) {
|
|
2352
|
-
return /* @__PURE__ */ (0,
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { ...props, className: (0, import_css40.cx)(props.className, (0, import_recipes33.thead)()) });
|
|
2353
2642
|
}
|
|
2354
2643
|
|
|
2355
2644
|
// src/components/Th.tsx
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2358
|
-
var
|
|
2645
|
+
var import_css41 = require("@cerberus/styled-system/css");
|
|
2646
|
+
var import_recipes34 = require("@cerberus/styled-system/recipes");
|
|
2647
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2359
2648
|
function Th(props) {
|
|
2360
2649
|
const { size, onClick, ...nativeProps } = props;
|
|
2361
|
-
return /* @__PURE__ */ (0,
|
|
2650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2362
2651
|
Show,
|
|
2363
2652
|
{
|
|
2364
2653
|
when: Boolean(onClick),
|
|
2365
|
-
fallback: /* @__PURE__ */ (0,
|
|
2654
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2366
2655
|
"th",
|
|
2367
2656
|
{
|
|
2368
2657
|
...nativeProps,
|
|
2369
|
-
className: (0,
|
|
2658
|
+
className: (0, import_css41.cx)(nativeProps.className, (0, import_recipes34.th)({ size }))
|
|
2370
2659
|
}
|
|
2371
2660
|
),
|
|
2372
|
-
children: /* @__PURE__ */ (0,
|
|
2661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { ...nativeProps, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2373
2662
|
"button",
|
|
2374
2663
|
{
|
|
2375
|
-
className: (0,
|
|
2664
|
+
className: (0, import_css41.cx)(
|
|
2376
2665
|
nativeProps.className,
|
|
2377
|
-
(0,
|
|
2378
|
-
(0,
|
|
2666
|
+
(0, import_recipes34.th)({ size }),
|
|
2667
|
+
(0, import_css41.css)({
|
|
2379
2668
|
alignItems: "center",
|
|
2380
2669
|
display: "inline-flex",
|
|
2381
2670
|
justifyContent: "space-between",
|
|
@@ -2395,18 +2684,18 @@ function Th(props) {
|
|
|
2395
2684
|
}
|
|
2396
2685
|
|
|
2397
2686
|
// src/components/Td.tsx
|
|
2398
|
-
var
|
|
2399
|
-
var
|
|
2400
|
-
var
|
|
2687
|
+
var import_css42 = require("@cerberus/styled-system/css");
|
|
2688
|
+
var import_recipes35 = require("@cerberus/styled-system/recipes");
|
|
2689
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2401
2690
|
function Td(props) {
|
|
2402
2691
|
const { size, ...nativeProps } = props;
|
|
2403
|
-
return /* @__PURE__ */ (0,
|
|
2692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2404
2693
|
"td",
|
|
2405
2694
|
{
|
|
2406
2695
|
...nativeProps,
|
|
2407
|
-
className: (0,
|
|
2696
|
+
className: (0, import_css42.cx)(
|
|
2408
2697
|
nativeProps.className,
|
|
2409
|
-
(0,
|
|
2698
|
+
(0, import_recipes35.td)({
|
|
2410
2699
|
size
|
|
2411
2700
|
})
|
|
2412
2701
|
)
|
|
@@ -2415,18 +2704,18 @@ function Td(props) {
|
|
|
2415
2704
|
}
|
|
2416
2705
|
|
|
2417
2706
|
// src/components/Tbody.tsx
|
|
2418
|
-
var
|
|
2419
|
-
var
|
|
2420
|
-
var
|
|
2707
|
+
var import_recipes36 = require("@cerberus/styled-system/recipes");
|
|
2708
|
+
var import_css43 = require("@cerberus/styled-system/css");
|
|
2709
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2421
2710
|
function Tbody(props) {
|
|
2422
2711
|
const { decoration, ...nativeProps } = props;
|
|
2423
|
-
return /* @__PURE__ */ (0,
|
|
2712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2424
2713
|
"tbody",
|
|
2425
2714
|
{
|
|
2426
2715
|
...nativeProps,
|
|
2427
|
-
className: (0,
|
|
2716
|
+
className: (0, import_css43.cx)(
|
|
2428
2717
|
nativeProps.className,
|
|
2429
|
-
(0,
|
|
2718
|
+
(0, import_recipes36.tbody)({
|
|
2430
2719
|
decoration
|
|
2431
2720
|
})
|
|
2432
2721
|
)
|
|
@@ -2435,9 +2724,9 @@ function Tbody(props) {
|
|
|
2435
2724
|
}
|
|
2436
2725
|
|
|
2437
2726
|
// src/components/Tag.tsx
|
|
2438
|
-
var
|
|
2439
|
-
var
|
|
2440
|
-
var
|
|
2727
|
+
var import_css44 = require("@cerberus/styled-system/css");
|
|
2728
|
+
var import_recipes37 = require("@cerberus/styled-system/recipes");
|
|
2729
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2441
2730
|
function Tag(props) {
|
|
2442
2731
|
const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props;
|
|
2443
2732
|
const palette = (props == null ? void 0 : props.palette) ?? "page";
|
|
@@ -2446,13 +2735,13 @@ function Tag(props) {
|
|
|
2446
2735
|
const closableStyles = isClosable ? closableCss : "";
|
|
2447
2736
|
const { icons } = useCerberusContext();
|
|
2448
2737
|
const { close: Close } = icons;
|
|
2449
|
-
return /* @__PURE__ */ (0,
|
|
2738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
2450
2739
|
"span",
|
|
2451
2740
|
{
|
|
2452
2741
|
...nativeProps,
|
|
2453
|
-
className: (0,
|
|
2742
|
+
className: (0, import_css44.cx)(
|
|
2454
2743
|
nativeProps.className,
|
|
2455
|
-
(0,
|
|
2744
|
+
(0, import_recipes37.tag)({
|
|
2456
2745
|
gradient,
|
|
2457
2746
|
palette,
|
|
2458
2747
|
shape,
|
|
@@ -2462,127 +2751,73 @@ function Tag(props) {
|
|
|
2462
2751
|
),
|
|
2463
2752
|
children: [
|
|
2464
2753
|
props.children,
|
|
2465
|
-
/* @__PURE__ */ (0,
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Show, { when: isClosable, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2466
2755
|
"button",
|
|
2467
2756
|
{
|
|
2468
2757
|
"aria-label": "Close",
|
|
2469
|
-
className: (0,
|
|
2758
|
+
className: (0, import_recipes37.iconButton)({
|
|
2470
2759
|
palette: "action",
|
|
2471
2760
|
usage: "filled",
|
|
2472
2761
|
size: "sm"
|
|
2473
2762
|
}),
|
|
2474
2763
|
onClick,
|
|
2475
|
-
children: /* @__PURE__ */ (0,
|
|
2764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Close, {})
|
|
2476
2765
|
}
|
|
2477
2766
|
) })
|
|
2478
2767
|
]
|
|
2479
2768
|
}
|
|
2480
2769
|
);
|
|
2481
2770
|
}
|
|
2482
|
-
var closableCss = (0,
|
|
2771
|
+
var closableCss = (0, import_css44.css)({
|
|
2483
2772
|
bgColor: "action.bg.active",
|
|
2484
2773
|
color: "action.text.initial",
|
|
2485
2774
|
paddingInlineEnd: "0"
|
|
2486
2775
|
});
|
|
2487
2776
|
|
|
2488
|
-
// src/components/Text.tsx
|
|
2489
|
-
var import_jsx2 = require("@cerberus/styled-system/jsx");
|
|
2490
|
-
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2491
|
-
function Text(props) {
|
|
2492
|
-
const { as = "p", ...pandaJSXProps } = props;
|
|
2493
|
-
switch (as) {
|
|
2494
|
-
case "h1":
|
|
2495
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H1, { ...pandaJSXProps });
|
|
2496
|
-
case "h2":
|
|
2497
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H2, { ...pandaJSXProps });
|
|
2498
|
-
case "h3":
|
|
2499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H3, { ...pandaJSXProps });
|
|
2500
|
-
case "h4":
|
|
2501
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H4, { ...pandaJSXProps });
|
|
2502
|
-
case "h5":
|
|
2503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H5, { ...pandaJSXProps });
|
|
2504
|
-
case "h6":
|
|
2505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.H6, { ...pandaJSXProps });
|
|
2506
|
-
case "strong":
|
|
2507
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Strong, { ...pandaJSXProps });
|
|
2508
|
-
case "em":
|
|
2509
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Em, { ...pandaJSXProps });
|
|
2510
|
-
case "small":
|
|
2511
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Small, { ...pandaJSXProps });
|
|
2512
|
-
case "span":
|
|
2513
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.Span, { ...pandaJSXProps });
|
|
2514
|
-
default:
|
|
2515
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx2.P, { ...pandaJSXProps });
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
|
|
2519
|
-
// src/components/Textarea.tsx
|
|
2520
|
-
var import_css43 = require("@cerberus/styled-system/css");
|
|
2521
|
-
var import_recipes36 = require("@cerberus/styled-system/recipes");
|
|
2522
|
-
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2523
|
-
function Textarea(props) {
|
|
2524
|
-
const { describedBy, ...nativeProps } = props;
|
|
2525
|
-
const { invalid, ...fieldState } = useFieldContext();
|
|
2526
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2527
|
-
"textarea",
|
|
2528
|
-
{
|
|
2529
|
-
...nativeProps,
|
|
2530
|
-
...fieldState,
|
|
2531
|
-
...describedBy && { "aria-describedby": describedBy },
|
|
2532
|
-
...invalid && { "aria-invalid": true },
|
|
2533
|
-
className: (0, import_css43.cx)(
|
|
2534
|
-
props.className,
|
|
2535
|
-
(0, import_recipes36.input)().input,
|
|
2536
|
-
(0, import_css43.css)({
|
|
2537
|
-
pxi: "2",
|
|
2538
|
-
py: "2",
|
|
2539
|
-
resize: "vertical"
|
|
2540
|
-
})
|
|
2541
|
-
),
|
|
2542
|
-
rows: 4
|
|
2543
|
-
}
|
|
2544
|
-
);
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
2777
|
// src/components/Toggle.tsx
|
|
2548
|
-
var
|
|
2549
|
-
var
|
|
2550
|
-
var
|
|
2551
|
-
var
|
|
2778
|
+
var import_field8 = require("@ark-ui/react/field");
|
|
2779
|
+
var import_css45 = require("@cerberus/styled-system/css");
|
|
2780
|
+
var import_patterns11 = require("@cerberus/styled-system/patterns");
|
|
2781
|
+
var import_recipes38 = require("@cerberus/styled-system/recipes");
|
|
2782
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2552
2783
|
function Toggle(props) {
|
|
2553
|
-
const { size,
|
|
2554
|
-
const styles = (0,
|
|
2555
|
-
const { invalid,
|
|
2784
|
+
const { size, ...nativeProps } = props;
|
|
2785
|
+
const styles = (0, import_recipes38.toggle)({ size });
|
|
2786
|
+
const { invalid, disabled, readOnly, required, ariaDescribedby } = (0, import_field8.useFieldContext)();
|
|
2556
2787
|
const { icons } = useCerberusContext();
|
|
2557
2788
|
const CheckedIcon = icons.toggleChecked;
|
|
2558
|
-
return /* @__PURE__ */ (0,
|
|
2789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
2559
2790
|
"span",
|
|
2560
2791
|
{
|
|
2561
|
-
className: (0,
|
|
2792
|
+
className: (0, import_css45.cx)("group", styles.track, (0, import_patterns11.hstack)()),
|
|
2562
2793
|
"data-checked": props.checked || props.defaultChecked,
|
|
2563
2794
|
children: [
|
|
2564
|
-
/* @__PURE__ */ (0,
|
|
2795
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2565
2796
|
"input",
|
|
2566
2797
|
{
|
|
2567
2798
|
...nativeProps,
|
|
2568
|
-
...
|
|
2569
|
-
...
|
|
2799
|
+
...disabled && { disabled: true },
|
|
2800
|
+
...readOnly && { readOnly: true },
|
|
2801
|
+
...required && { required: true },
|
|
2802
|
+
...ariaDescribedby && {
|
|
2803
|
+
"aria-describedby": ariaDescribedby
|
|
2804
|
+
},
|
|
2570
2805
|
...invalid && { "aria-invalid": true },
|
|
2571
|
-
className: (0,
|
|
2806
|
+
className: (0, import_css45.cx)("peer", styles.input),
|
|
2572
2807
|
role: "switch",
|
|
2573
2808
|
type: "checkbox"
|
|
2574
2809
|
}
|
|
2575
2810
|
),
|
|
2576
|
-
/* @__PURE__ */ (0,
|
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2577
2812
|
"span",
|
|
2578
2813
|
{
|
|
2579
|
-
className: (0,
|
|
2814
|
+
className: (0, import_css45.cx)(
|
|
2580
2815
|
styles.thumb,
|
|
2581
|
-
(0,
|
|
2816
|
+
(0, import_patterns11.vstack)({
|
|
2582
2817
|
justify: "center"
|
|
2583
2818
|
})
|
|
2584
2819
|
),
|
|
2585
|
-
children: /* @__PURE__ */ (0,
|
|
2820
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CheckedIcon, {})
|
|
2586
2821
|
}
|
|
2587
2822
|
)
|
|
2588
2823
|
]
|
|
@@ -2592,24 +2827,24 @@ function Toggle(props) {
|
|
|
2592
2827
|
|
|
2593
2828
|
// src/components/Tooltip.tsx
|
|
2594
2829
|
var import_tooltip = require("@ark-ui/react/tooltip");
|
|
2595
|
-
var
|
|
2596
|
-
var
|
|
2597
|
-
var
|
|
2830
|
+
var import_css46 = require("@cerberus/styled-system/css");
|
|
2831
|
+
var import_recipes39 = require("@cerberus/styled-system/recipes");
|
|
2832
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2598
2833
|
function Tooltip(props) {
|
|
2599
2834
|
const { content, children, asChild, ...nativeProps } = props;
|
|
2600
|
-
const styles = (0,
|
|
2835
|
+
const styles = (0, import_recipes39.tooltip)();
|
|
2601
2836
|
const position = {
|
|
2602
2837
|
placement: props.position || "top"
|
|
2603
2838
|
};
|
|
2604
|
-
return /* @__PURE__ */ (0,
|
|
2605
|
-
/* @__PURE__ */ (0,
|
|
2606
|
-
/* @__PURE__ */ (0,
|
|
2839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_tooltip.Tooltip.Root, { openDelay: 400, positioning: position, children: [
|
|
2840
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tooltip.Tooltip.Trigger, { className: styles.trigger, asChild, children }),
|
|
2841
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tooltip.Tooltip.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2607
2842
|
import_tooltip.Tooltip.Content,
|
|
2608
2843
|
{
|
|
2609
2844
|
...nativeProps,
|
|
2610
|
-
className: (0,
|
|
2845
|
+
className: (0, import_css46.cx)(nativeProps.className, styles.content),
|
|
2611
2846
|
children: [
|
|
2612
|
-
/* @__PURE__ */ (0,
|
|
2847
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tooltip.Tooltip.Arrow, { className: styles.arrow, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_tooltip.Tooltip.ArrowTip, { className: styles.arrowTip }) }),
|
|
2613
2848
|
content
|
|
2614
2849
|
]
|
|
2615
2850
|
}
|
|
@@ -2619,18 +2854,18 @@ function Tooltip(props) {
|
|
|
2619
2854
|
|
|
2620
2855
|
// src/components/Select.tsx
|
|
2621
2856
|
var import_select2 = require("@ark-ui/react/select");
|
|
2622
|
-
var
|
|
2623
|
-
var
|
|
2624
|
-
var
|
|
2857
|
+
var import_recipes40 = require("@cerberus/styled-system/recipes");
|
|
2858
|
+
var import_css47 = require("@cerberus/styled-system/css");
|
|
2859
|
+
var import_jsx4 = require("@cerberus/styled-system/jsx");
|
|
2625
2860
|
|
|
2626
2861
|
// src/components/Select.server.tsx
|
|
2627
2862
|
var import_select = require("@ark-ui/react/select");
|
|
2628
|
-
var
|
|
2863
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2629
2864
|
function SelectRoot(props) {
|
|
2630
2865
|
const { children, ...rootProps } = props;
|
|
2631
|
-
return /* @__PURE__ */ (0,
|
|
2866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_select.Select.Root, { ...rootProps, children: [
|
|
2632
2867
|
children,
|
|
2633
|
-
/* @__PURE__ */ (0,
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_select.Select.HiddenSelect, {})
|
|
2634
2869
|
] });
|
|
2635
2870
|
}
|
|
2636
2871
|
var SelectLabel = import_select.Select.Label;
|
|
@@ -2648,48 +2883,44 @@ var SelectItemText = import_select.Select.ItemText;
|
|
|
2648
2883
|
var SelectItemIndicator = import_select.Select.ItemIndicator;
|
|
2649
2884
|
|
|
2650
2885
|
// src/components/Select.tsx
|
|
2651
|
-
var
|
|
2886
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2652
2887
|
function Select(props) {
|
|
2653
|
-
const { collection,
|
|
2888
|
+
const { collection, placeholder, size, ...rootProps } = props;
|
|
2654
2889
|
const { icons } = useCerberusContext();
|
|
2655
2890
|
const { selectArrow: SelectArrow, invalid: InvalidIcon } = icons;
|
|
2656
|
-
const styles = (0,
|
|
2657
|
-
return /* @__PURE__ */ (0,
|
|
2658
|
-
/* @__PURE__ */ (0,
|
|
2659
|
-
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValueText, { placeholder }),
|
|
2664
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx3.HStack, { children: [
|
|
2665
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Show, { when: props.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(InvalidIcon, { "data-part": "invalid-icon" }) }),
|
|
2666
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectIndicator, { className: styles.indicator, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectArrow, {}) })
|
|
2891
|
+
const styles = (0, import_recipes40.select)({ size });
|
|
2892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(SelectRoot, { className: styles.root, collection, ...rootProps, children: [
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectControl, { className: styles.control, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(SelectTrigger, { className: styles.trigger, children: [
|
|
2894
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectValueText, { placeholder }),
|
|
2895
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx4.HStack, { children: [
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Show, { when: props.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(InvalidIcon, { "data-part": "invalid-icon" }) }),
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectIndicator, { className: styles.indicator, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectArrow, {}) })
|
|
2667
2898
|
] })
|
|
2668
2899
|
] }) }),
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectPositioner, { className: styles.positioner, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectContent, { className: styles.content, children: props.children }) }) }),
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_select2.Select.HiddenSelect, {})
|
|
2671
2902
|
] });
|
|
2672
2903
|
}
|
|
2673
2904
|
function Option(props) {
|
|
2674
2905
|
const { item, ...itemProps } = props;
|
|
2675
2906
|
const { icons } = useCerberusContext();
|
|
2676
2907
|
const { selectChecked: CheckedIcon } = icons;
|
|
2677
|
-
const styles = (0,
|
|
2678
|
-
return /* @__PURE__ */ (0,
|
|
2679
|
-
/* @__PURE__ */ (0,
|
|
2680
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
const styles = (0, import_recipes40.select)();
|
|
2909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(SelectItem, { ...itemProps, item, className: styles.item, children: [
|
|
2910
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectItemText, { className: styles.itemText, children: item == null ? void 0 : item.label }),
|
|
2911
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectItemIndicator, { className: styles.itemIndicator, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CheckedIcon, {}) })
|
|
2681
2912
|
] });
|
|
2682
2913
|
}
|
|
2683
2914
|
function OptionGroup(props) {
|
|
2684
|
-
return /* @__PURE__ */ (0,
|
|
2915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SelectItemGroup, { ...props });
|
|
2685
2916
|
}
|
|
2686
2917
|
function OptionGroupLabel(props) {
|
|
2687
|
-
const styles = (0,
|
|
2688
|
-
return /* @__PURE__ */ (0,
|
|
2918
|
+
const styles = (0, import_recipes40.select)();
|
|
2919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2689
2920
|
SelectItemGroupLabel,
|
|
2690
2921
|
{
|
|
2691
2922
|
...props,
|
|
2692
|
-
className: (0,
|
|
2923
|
+
className: (0, import_css47.cx)(props.className, styles.itemGroupLabel)
|
|
2693
2924
|
}
|
|
2694
2925
|
);
|
|
2695
2926
|
}
|
|
@@ -2700,23 +2931,23 @@ function createSelectCollection(collection) {
|
|
|
2700
2931
|
}
|
|
2701
2932
|
|
|
2702
2933
|
// src/context/confirm-modal.tsx
|
|
2703
|
-
var
|
|
2704
|
-
var
|
|
2705
|
-
var
|
|
2706
|
-
var
|
|
2707
|
-
var ConfirmModalContext = (0,
|
|
2934
|
+
var import_react25 = require("react");
|
|
2935
|
+
var import_css48 = require("@cerberus/styled-system/css");
|
|
2936
|
+
var import_jsx5 = require("@cerberus/styled-system/jsx");
|
|
2937
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2938
|
+
var ConfirmModalContext = (0, import_react25.createContext)(null);
|
|
2708
2939
|
function ConfirmModal(props) {
|
|
2709
|
-
const [open, setOpen] = (0,
|
|
2710
|
-
const [content, setContent] = (0,
|
|
2711
|
-
const resolveRef = (0,
|
|
2940
|
+
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
2941
|
+
const [content, setContent] = (0, import_react25.useState)(null);
|
|
2942
|
+
const resolveRef = (0, import_react25.useRef)(null);
|
|
2712
2943
|
const kind = (content == null ? void 0 : content.kind) ?? "non-destructive";
|
|
2713
2944
|
const { icons } = useCerberusContext();
|
|
2714
2945
|
const { confirmModal: ConfirmIcon } = icons;
|
|
2715
|
-
const palette = (0,
|
|
2946
|
+
const palette = (0, import_react25.useMemo)(
|
|
2716
2947
|
() => kind === "destructive" ? "danger" : "action",
|
|
2717
2948
|
[kind]
|
|
2718
2949
|
);
|
|
2719
|
-
const handleChoice = (0,
|
|
2950
|
+
const handleChoice = (0, import_react25.useCallback)(
|
|
2720
2951
|
(e) => {
|
|
2721
2952
|
var _a, _b;
|
|
2722
2953
|
const target = e.currentTarget;
|
|
@@ -2728,7 +2959,7 @@ function ConfirmModal(props) {
|
|
|
2728
2959
|
},
|
|
2729
2960
|
[setOpen]
|
|
2730
2961
|
);
|
|
2731
|
-
const handleShow = (0,
|
|
2962
|
+
const handleShow = (0, import_react25.useCallback)(
|
|
2732
2963
|
(options) => {
|
|
2733
2964
|
return new Promise((resolve) => {
|
|
2734
2965
|
setContent({ ...options });
|
|
@@ -2738,42 +2969,42 @@ function ConfirmModal(props) {
|
|
|
2738
2969
|
},
|
|
2739
2970
|
[setOpen, setContent]
|
|
2740
2971
|
);
|
|
2741
|
-
const value = (0,
|
|
2972
|
+
const value = (0, import_react25.useMemo)(
|
|
2742
2973
|
() => ({
|
|
2743
2974
|
show: handleShow
|
|
2744
2975
|
}),
|
|
2745
2976
|
[handleShow]
|
|
2746
2977
|
);
|
|
2747
|
-
return /* @__PURE__ */ (0,
|
|
2978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(ConfirmModalContext.Provider, { value, children: [
|
|
2748
2979
|
props.children,
|
|
2749
|
-
/* @__PURE__ */ (0,
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2751
|
-
/* @__PURE__ */ (0,
|
|
2752
|
-
|
|
2980
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Dialog, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx5.VStack, { gap: "xl", w: "full", children: [
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx5.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
|
|
2982
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2983
|
+
import_jsx5.HStack,
|
|
2753
2984
|
{
|
|
2754
2985
|
alignSelf: "center",
|
|
2755
2986
|
justify: "center",
|
|
2756
2987
|
paddingBlockEnd: "md",
|
|
2757
2988
|
w: "full",
|
|
2758
|
-
children: /* @__PURE__ */ (0,
|
|
2989
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2759
2990
|
Show,
|
|
2760
2991
|
{
|
|
2761
2992
|
when: palette === "danger",
|
|
2762
|
-
fallback: /* @__PURE__ */ (0,
|
|
2993
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2763
2994
|
Avatar,
|
|
2764
2995
|
{
|
|
2765
2996
|
ariaLabel: "",
|
|
2766
2997
|
gradient: "charon-light",
|
|
2767
|
-
icon: /* @__PURE__ */ (0,
|
|
2998
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ConfirmIcon, { size: 24 }),
|
|
2768
2999
|
src: ""
|
|
2769
3000
|
}
|
|
2770
3001
|
),
|
|
2771
|
-
children: /* @__PURE__ */ (0,
|
|
3002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2772
3003
|
Avatar,
|
|
2773
3004
|
{
|
|
2774
3005
|
ariaLabel: "",
|
|
2775
3006
|
gradient: "hades-dark",
|
|
2776
|
-
icon: /* @__PURE__ */ (0,
|
|
3007
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ConfirmIcon, { size: 24 }),
|
|
2777
3008
|
src: ""
|
|
2778
3009
|
}
|
|
2779
3010
|
)
|
|
@@ -2781,15 +3012,15 @@ function ConfirmModal(props) {
|
|
|
2781
3012
|
)
|
|
2782
3013
|
}
|
|
2783
3014
|
),
|
|
2784
|
-
/* @__PURE__ */ (0,
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
3015
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
2786
3017
|
] }),
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx5.HStack, { gap: "4", w: "full", children: [
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2789
3020
|
Button,
|
|
2790
3021
|
{
|
|
2791
3022
|
autoFocus: true,
|
|
2792
|
-
className: (0,
|
|
3023
|
+
className: (0, import_css48.css)({
|
|
2793
3024
|
w: "1/2"
|
|
2794
3025
|
}),
|
|
2795
3026
|
name: "confirm",
|
|
@@ -2799,10 +3030,10 @@ function ConfirmModal(props) {
|
|
|
2799
3030
|
children: content == null ? void 0 : content.actionText
|
|
2800
3031
|
}
|
|
2801
3032
|
),
|
|
2802
|
-
/* @__PURE__ */ (0,
|
|
3033
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2803
3034
|
Button,
|
|
2804
3035
|
{
|
|
2805
|
-
className: (0,
|
|
3036
|
+
className: (0, import_css48.css)({
|
|
2806
3037
|
w: "1/2"
|
|
2807
3038
|
}),
|
|
2808
3039
|
name: "cancel",
|
|
@@ -2817,7 +3048,7 @@ function ConfirmModal(props) {
|
|
|
2817
3048
|
] });
|
|
2818
3049
|
}
|
|
2819
3050
|
function useConfirmModal() {
|
|
2820
|
-
const context = (0,
|
|
3051
|
+
const context = (0, import_react25.useContext)(ConfirmModalContext);
|
|
2821
3052
|
if (context === null) {
|
|
2822
3053
|
throw new Error(
|
|
2823
3054
|
"useConfirmModal must be used within a ConfirmModal Provider"
|
|
@@ -2827,20 +3058,20 @@ function useConfirmModal() {
|
|
|
2827
3058
|
}
|
|
2828
3059
|
|
|
2829
3060
|
// src/context/cta-modal.tsx
|
|
2830
|
-
var
|
|
2831
|
-
var import_jsx5 = require("@cerberus/styled-system/jsx");
|
|
2832
|
-
var import_css48 = require("@cerberus/styled-system/css");
|
|
3061
|
+
var import_react26 = require("react");
|
|
2833
3062
|
var import_jsx6 = require("@cerberus/styled-system/jsx");
|
|
2834
|
-
var
|
|
2835
|
-
var
|
|
3063
|
+
var import_css49 = require("@cerberus/styled-system/css");
|
|
3064
|
+
var import_jsx7 = require("@cerberus/styled-system/jsx");
|
|
3065
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3066
|
+
var CTAModalContext = (0, import_react26.createContext)(null);
|
|
2836
3067
|
function CTAModal(props) {
|
|
2837
3068
|
var _a, _b;
|
|
2838
|
-
const [open, setOpen] = (0,
|
|
2839
|
-
const [content, setContent] = (0,
|
|
3069
|
+
const [open, setOpen] = (0, import_react26.useState)(false);
|
|
3070
|
+
const [content, setContent] = (0, import_react26.useState)(null);
|
|
2840
3071
|
const confirmIcon = content == null ? void 0 : content.icon;
|
|
2841
3072
|
const { icons } = useCerberusContext();
|
|
2842
3073
|
const { confirmModal: FallbackIcon } = icons;
|
|
2843
|
-
const handleShow = (0,
|
|
3074
|
+
const handleShow = (0, import_react26.useCallback)(
|
|
2844
3075
|
(options) => {
|
|
2845
3076
|
const maxActions = 2;
|
|
2846
3077
|
if (options.actions.length > maxActions) {
|
|
@@ -2853,7 +3084,7 @@ function CTAModal(props) {
|
|
|
2853
3084
|
},
|
|
2854
3085
|
[setOpen]
|
|
2855
3086
|
);
|
|
2856
|
-
const handleActionClick = (0,
|
|
3087
|
+
const handleActionClick = (0, import_react26.useCallback)(
|
|
2857
3088
|
(event) => {
|
|
2858
3089
|
const index = event.currentTarget.getAttribute("data-index");
|
|
2859
3090
|
const action = content == null ? void 0 : content.actions[Number(index)];
|
|
@@ -2863,42 +3094,42 @@ function CTAModal(props) {
|
|
|
2863
3094
|
},
|
|
2864
3095
|
[content, setOpen]
|
|
2865
3096
|
);
|
|
2866
|
-
const value = (0,
|
|
3097
|
+
const value = (0, import_react26.useMemo)(
|
|
2867
3098
|
() => ({
|
|
2868
3099
|
show: handleShow
|
|
2869
3100
|
}),
|
|
2870
3101
|
[handleShow]
|
|
2871
3102
|
);
|
|
2872
|
-
return /* @__PURE__ */ (0,
|
|
3103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(CTAModalContext.Provider, { value, children: [
|
|
2873
3104
|
props.children,
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
2875
|
-
/* @__PURE__ */ (0,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
/* @__PURE__ */ (0,
|
|
3105
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Dialog, { size: "sm", children: [
|
|
3106
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DialogCloseIconTrigger, {}),
|
|
3107
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx7.VStack, { gap: "xl", w: "full", children: [
|
|
3108
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx7.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx7.VStack, { gap: "lg", w: "full", children: [
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2879
3110
|
Avatar,
|
|
2880
3111
|
{
|
|
2881
3112
|
ariaLabel: "",
|
|
2882
3113
|
gradient: "charon-light",
|
|
2883
|
-
icon: /* @__PURE__ */ (0,
|
|
3114
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2884
3115
|
Show,
|
|
2885
3116
|
{
|
|
2886
3117
|
when: Boolean(confirmIcon),
|
|
2887
|
-
fallback: /* @__PURE__ */ (0,
|
|
3118
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FallbackIcon, { size: 24 }),
|
|
2888
3119
|
children: confirmIcon
|
|
2889
3120
|
}
|
|
2890
3121
|
),
|
|
2891
3122
|
src: ""
|
|
2892
3123
|
}
|
|
2893
3124
|
),
|
|
2894
|
-
/* @__PURE__ */ (0,
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
3125
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
2896
3127
|
] }) }),
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
3128
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx6.HStack, { gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Show, { when: Boolean((_a = content == null ? void 0 : content.actions) == null ? void 0 : _a.length), children: (_b = content == null ? void 0 : content.actions) == null ? void 0 : _b.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2898
3129
|
Button,
|
|
2899
3130
|
{
|
|
2900
3131
|
"data-index": index,
|
|
2901
|
-
className: (0,
|
|
3132
|
+
className: (0, import_css49.css)({
|
|
2902
3133
|
w: "1/2"
|
|
2903
3134
|
}),
|
|
2904
3135
|
onClick: handleActionClick,
|
|
@@ -2913,7 +3144,7 @@ function CTAModal(props) {
|
|
|
2913
3144
|
] });
|
|
2914
3145
|
}
|
|
2915
3146
|
function useCTAModal() {
|
|
2916
|
-
const context = (0,
|
|
3147
|
+
const context = (0, import_react26.useContext)(CTAModalContext);
|
|
2917
3148
|
if (context === null) {
|
|
2918
3149
|
throw new Error("useCTAModal must be used within a CTAModal Provider");
|
|
2919
3150
|
}
|
|
@@ -2921,10 +3152,10 @@ function useCTAModal() {
|
|
|
2921
3152
|
}
|
|
2922
3153
|
|
|
2923
3154
|
// src/context/notification-center.tsx
|
|
2924
|
-
var
|
|
2925
|
-
var
|
|
2926
|
-
var
|
|
2927
|
-
var
|
|
3155
|
+
var import_react27 = require("react");
|
|
3156
|
+
var import_patterns12 = require("@cerberus/styled-system/patterns");
|
|
3157
|
+
var import_recipes41 = require("@cerberus/styled-system/recipes");
|
|
3158
|
+
var import_css50 = require("@cerberus/styled-system/css");
|
|
2928
3159
|
|
|
2929
3160
|
// src/context/notification-center/store.ts
|
|
2930
3161
|
function notificationCenterReducer(state, action) {
|
|
@@ -2957,16 +3188,16 @@ function clearNotificationState(dispatch) {
|
|
|
2957
3188
|
}
|
|
2958
3189
|
|
|
2959
3190
|
// src/context/notification-center.tsx
|
|
2960
|
-
var
|
|
2961
|
-
var NotificationsContext = (0,
|
|
3191
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3192
|
+
var NotificationsContext = (0, import_react27.createContext)(null);
|
|
2962
3193
|
function NotificationCenter(props) {
|
|
2963
|
-
const [state, dispatch] = (0,
|
|
2964
|
-
const styles = (0,
|
|
2965
|
-
const timeout = (0,
|
|
3194
|
+
const [state, dispatch] = (0, import_react27.useReducer)(notificationCenterReducer, []);
|
|
3195
|
+
const styles = (0, import_recipes41.notification)();
|
|
3196
|
+
const timeout = (0, import_react27.useMemo)(
|
|
2966
3197
|
() => props.duration || 6e3,
|
|
2967
3198
|
[props.duration]
|
|
2968
3199
|
);
|
|
2969
|
-
const closeNotification = (0,
|
|
3200
|
+
const closeNotification = (0, import_react27.useCallback)(
|
|
2970
3201
|
(id) => {
|
|
2971
3202
|
updateNotificationState(dispatch, {
|
|
2972
3203
|
id,
|
|
@@ -2978,7 +3209,7 @@ function NotificationCenter(props) {
|
|
|
2978
3209
|
},
|
|
2979
3210
|
[dispatch]
|
|
2980
3211
|
);
|
|
2981
|
-
const handleNotify = (0,
|
|
3212
|
+
const handleNotify = (0, import_react27.useCallback)(
|
|
2982
3213
|
(options) => {
|
|
2983
3214
|
const id = `${options.palette}:${state.length + 1}`;
|
|
2984
3215
|
addNotification(dispatch, {
|
|
@@ -2992,32 +3223,32 @@ function NotificationCenter(props) {
|
|
|
2992
3223
|
},
|
|
2993
3224
|
[dispatch, state, timeout, closeNotification]
|
|
2994
3225
|
);
|
|
2995
|
-
const handleClose = (0,
|
|
3226
|
+
const handleClose = (0, import_react27.useCallback)(
|
|
2996
3227
|
(e) => {
|
|
2997
3228
|
const target = e.currentTarget;
|
|
2998
3229
|
closeNotification(target.value);
|
|
2999
3230
|
},
|
|
3000
3231
|
[closeNotification]
|
|
3001
3232
|
);
|
|
3002
|
-
const handleCloseAll = (0,
|
|
3233
|
+
const handleCloseAll = (0, import_react27.useCallback)(() => {
|
|
3003
3234
|
state.forEach((item) => {
|
|
3004
3235
|
if (item.onClose) item.onClose();
|
|
3005
3236
|
});
|
|
3006
3237
|
clearNotificationState(dispatch);
|
|
3007
3238
|
}, [state, dispatch]);
|
|
3008
|
-
const value = (0,
|
|
3239
|
+
const value = (0, import_react27.useMemo)(
|
|
3009
3240
|
() => ({
|
|
3010
3241
|
notify: handleNotify
|
|
3011
3242
|
}),
|
|
3012
3243
|
[handleNotify]
|
|
3013
3244
|
);
|
|
3014
|
-
return /* @__PURE__ */ (0,
|
|
3245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(NotificationsContext.Provider, { value, children: [
|
|
3015
3246
|
props.children,
|
|
3016
|
-
/* @__PURE__ */ (0,
|
|
3017
|
-
/* @__PURE__ */ (0,
|
|
3247
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Show, { when: state.length > 0, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Portal, { container: props.container, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: styles.center, children: [
|
|
3248
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Show, { when: state.length >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3018
3249
|
Button,
|
|
3019
3250
|
{
|
|
3020
|
-
className: (0,
|
|
3251
|
+
className: (0, import_css50.cx)(styles.closeAll, (0, import_patterns12.animateIn)()),
|
|
3021
3252
|
onClick: handleCloseAll,
|
|
3022
3253
|
palette: "action",
|
|
3023
3254
|
shape: "rounded",
|
|
@@ -3026,17 +3257,17 @@ function NotificationCenter(props) {
|
|
|
3026
3257
|
children: "Close all"
|
|
3027
3258
|
}
|
|
3028
3259
|
) }),
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3260
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3030
3261
|
"div",
|
|
3031
3262
|
{
|
|
3032
|
-
className: (0,
|
|
3263
|
+
className: (0, import_patterns12.vstack)({
|
|
3033
3264
|
alignItems: "flex-end",
|
|
3034
3265
|
gap: "4"
|
|
3035
3266
|
}),
|
|
3036
3267
|
style: {
|
|
3037
3268
|
alignItems: "flex-end"
|
|
3038
3269
|
},
|
|
3039
|
-
children: state.map((option) => /* @__PURE__ */ (0,
|
|
3270
|
+
children: state.map((option) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3040
3271
|
MatchNotification,
|
|
3041
3272
|
{
|
|
3042
3273
|
...option,
|
|
@@ -3052,7 +3283,7 @@ function NotificationCenter(props) {
|
|
|
3052
3283
|
}
|
|
3053
3284
|
function MatchNotification(props) {
|
|
3054
3285
|
const { palette, id, onClose, heading, description, open } = props;
|
|
3055
|
-
const sharedProps = (0,
|
|
3286
|
+
const sharedProps = (0, import_react27.useMemo)(
|
|
3056
3287
|
() => ({
|
|
3057
3288
|
id,
|
|
3058
3289
|
open: true,
|
|
@@ -3063,30 +3294,30 @@ function MatchNotification(props) {
|
|
|
3063
3294
|
);
|
|
3064
3295
|
switch (palette) {
|
|
3065
3296
|
case "success":
|
|
3066
|
-
return /* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3068
|
-
/* @__PURE__ */ (0,
|
|
3297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Notification, { ...sharedProps, palette: "success", children: [
|
|
3298
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationHeading, { palette: "success", children: heading }),
|
|
3299
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationDescription, { palette: "success", children: description })
|
|
3069
3300
|
] });
|
|
3070
3301
|
case "warning":
|
|
3071
|
-
return /* @__PURE__ */ (0,
|
|
3072
|
-
/* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Notification, { ...sharedProps, palette: "warning", children: [
|
|
3303
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationHeading, { palette: "warning", children: heading }),
|
|
3304
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationDescription, { palette: "warning", children: description })
|
|
3074
3305
|
] });
|
|
3075
3306
|
case "danger":
|
|
3076
|
-
return /* @__PURE__ */ (0,
|
|
3077
|
-
/* @__PURE__ */ (0,
|
|
3078
|
-
/* @__PURE__ */ (0,
|
|
3307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Notification, { ...sharedProps, palette: "danger", children: [
|
|
3308
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationHeading, { palette: "danger", children: heading }),
|
|
3309
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationDescription, { palette: "danger", children: description })
|
|
3079
3310
|
] });
|
|
3080
3311
|
case "info":
|
|
3081
3312
|
default:
|
|
3082
|
-
return /* @__PURE__ */ (0,
|
|
3083
|
-
/* @__PURE__ */ (0,
|
|
3084
|
-
/* @__PURE__ */ (0,
|
|
3313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Notification, { ...sharedProps, palette: "info", children: [
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationHeading, { palette: "info", children: heading }),
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NotificationDescription, { palette: "info", children: description })
|
|
3085
3316
|
] });
|
|
3086
3317
|
}
|
|
3087
3318
|
}
|
|
3088
3319
|
function useNotificationCenter() {
|
|
3089
|
-
const context = (0,
|
|
3320
|
+
const context = (0, import_react27.useContext)(NotificationsContext);
|
|
3090
3321
|
if (!context) {
|
|
3091
3322
|
throw new Error(
|
|
3092
3323
|
"useNotificationCenter must be used within a NotificationsProvider"
|
|
@@ -3096,35 +3327,35 @@ function useNotificationCenter() {
|
|
|
3096
3327
|
}
|
|
3097
3328
|
|
|
3098
3329
|
// src/context/prompt-modal.tsx
|
|
3099
|
-
var
|
|
3100
|
-
var
|
|
3101
|
-
var
|
|
3102
|
-
var
|
|
3103
|
-
var
|
|
3104
|
-
var
|
|
3105
|
-
var PromptModalContext = (0,
|
|
3330
|
+
var import_react28 = require("react");
|
|
3331
|
+
var import_react29 = require("@ark-ui/react");
|
|
3332
|
+
var import_jsx8 = require("@cerberus/styled-system/jsx");
|
|
3333
|
+
var import_css51 = require("@cerberus/styled-system/css");
|
|
3334
|
+
var import_patterns13 = require("@cerberus/styled-system/patterns");
|
|
3335
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3336
|
+
var PromptModalContext = (0, import_react28.createContext)(null);
|
|
3106
3337
|
function PromptModal(props) {
|
|
3107
|
-
const resolveRef = (0,
|
|
3108
|
-
const [open, setOpen] = (0,
|
|
3109
|
-
const [content, setContent] = (0,
|
|
3110
|
-
const [inputValue, setInputValue] = (0,
|
|
3338
|
+
const resolveRef = (0, import_react28.useRef)(null);
|
|
3339
|
+
const [open, setOpen] = (0, import_react28.useState)(false);
|
|
3340
|
+
const [content, setContent] = (0, import_react28.useState)(null);
|
|
3341
|
+
const [inputValue, setInputValue] = (0, import_react28.useState)("");
|
|
3111
3342
|
const { icons } = useCerberusContext();
|
|
3112
3343
|
const { promptModal: PromptIcon } = icons;
|
|
3113
|
-
const isValid = (0,
|
|
3344
|
+
const isValid = (0, import_react28.useMemo)(
|
|
3114
3345
|
() => inputValue === (content == null ? void 0 : content.key),
|
|
3115
3346
|
[inputValue, content]
|
|
3116
3347
|
);
|
|
3117
|
-
const palette = (0,
|
|
3348
|
+
const palette = (0, import_react28.useMemo)(
|
|
3118
3349
|
() => (content == null ? void 0 : content.kind) === "destructive" ? "danger" : "action",
|
|
3119
3350
|
[content]
|
|
3120
3351
|
);
|
|
3121
|
-
const handleChange = (0,
|
|
3352
|
+
const handleChange = (0, import_react28.useCallback)(
|
|
3122
3353
|
(e) => {
|
|
3123
3354
|
setInputValue(e.currentTarget.value);
|
|
3124
3355
|
},
|
|
3125
3356
|
[content]
|
|
3126
3357
|
);
|
|
3127
|
-
const handleChoice = (0,
|
|
3358
|
+
const handleChoice = (0, import_react28.useCallback)(
|
|
3128
3359
|
(e) => {
|
|
3129
3360
|
var _a;
|
|
3130
3361
|
const target = e.currentTarget;
|
|
@@ -3135,7 +3366,7 @@ function PromptModal(props) {
|
|
|
3135
3366
|
},
|
|
3136
3367
|
[inputValue, setOpen]
|
|
3137
3368
|
);
|
|
3138
|
-
const handleShow = (0,
|
|
3369
|
+
const handleShow = (0, import_react28.useCallback)(
|
|
3139
3370
|
(options) => {
|
|
3140
3371
|
return new Promise((resolve) => {
|
|
3141
3372
|
setContent({ ...options, kind: options.kind || "non-destructive" });
|
|
@@ -3145,42 +3376,42 @@ function PromptModal(props) {
|
|
|
3145
3376
|
},
|
|
3146
3377
|
[setOpen]
|
|
3147
3378
|
);
|
|
3148
|
-
const value = (0,
|
|
3379
|
+
const value = (0, import_react28.useMemo)(
|
|
3149
3380
|
() => ({
|
|
3150
3381
|
show: handleShow
|
|
3151
3382
|
}),
|
|
3152
3383
|
[handleShow]
|
|
3153
3384
|
);
|
|
3154
|
-
return /* @__PURE__ */ (0,
|
|
3385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(PromptModalContext.Provider, { value, children: [
|
|
3155
3386
|
props.children,
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3158
|
-
/* @__PURE__ */ (0,
|
|
3159
|
-
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Dialog, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx8.VStack, { gap: "xl", w: "full", children: [
|
|
3388
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx8.VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
|
|
3389
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3390
|
+
import_jsx8.HStack,
|
|
3160
3391
|
{
|
|
3161
3392
|
alignSelf: "center",
|
|
3162
3393
|
justify: "center",
|
|
3163
3394
|
paddingBlockEnd: "md",
|
|
3164
3395
|
w: "full",
|
|
3165
|
-
children: /* @__PURE__ */ (0,
|
|
3396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3166
3397
|
Show,
|
|
3167
3398
|
{
|
|
3168
3399
|
when: palette === "danger",
|
|
3169
|
-
fallback: /* @__PURE__ */ (0,
|
|
3400
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3170
3401
|
Avatar,
|
|
3171
3402
|
{
|
|
3172
3403
|
ariaLabel: "",
|
|
3173
3404
|
gradient: "charon-light",
|
|
3174
|
-
icon: /* @__PURE__ */ (0,
|
|
3405
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PromptIcon, { size: 24 }),
|
|
3175
3406
|
src: ""
|
|
3176
3407
|
}
|
|
3177
3408
|
),
|
|
3178
|
-
children: /* @__PURE__ */ (0,
|
|
3409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3179
3410
|
Avatar,
|
|
3180
3411
|
{
|
|
3181
3412
|
ariaLabel: "",
|
|
3182
3413
|
gradient: "hades-dark",
|
|
3183
|
-
icon: /* @__PURE__ */ (0,
|
|
3414
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PromptIcon, { size: 24 }),
|
|
3184
3415
|
src: ""
|
|
3185
3416
|
}
|
|
3186
3417
|
)
|
|
@@ -3188,51 +3419,52 @@ function PromptModal(props) {
|
|
|
3188
3419
|
)
|
|
3189
3420
|
}
|
|
3190
3421
|
),
|
|
3191
|
-
/* @__PURE__ */ (0,
|
|
3192
|
-
/* @__PURE__ */ (0,
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogHeading, { children: content == null ? void 0 : content.heading }),
|
|
3423
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogDescription, { children: content == null ? void 0 : content.description })
|
|
3193
3424
|
] }),
|
|
3194
|
-
/* @__PURE__ */ (0,
|
|
3195
|
-
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3426
|
+
import_jsx8.VStack,
|
|
3196
3427
|
{
|
|
3197
3428
|
alignItems: "flex-start",
|
|
3198
3429
|
marginBlockStart: "md",
|
|
3199
3430
|
marginBlockEnd: "lg",
|
|
3200
3431
|
w: "full",
|
|
3201
|
-
children: /* @__PURE__ */ (0,
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
{
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
3433
|
+
FieldRoot,
|
|
3434
|
+
{
|
|
3435
|
+
ids: {
|
|
3436
|
+
control: "confirm"
|
|
3437
|
+
},
|
|
3438
|
+
invalid: !isValid,
|
|
3439
|
+
children: [
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
3441
|
+
FieldLabel,
|
|
3442
|
+
{
|
|
3443
|
+
className: (0, import_patterns13.hstack)({
|
|
3444
|
+
gap: "xs",
|
|
3445
|
+
justify: "flex-start !important",
|
|
3446
|
+
marginBlockEnd: "xs",
|
|
3447
|
+
textStyle: "label-md"
|
|
3448
|
+
}),
|
|
3449
|
+
children: [
|
|
3450
|
+
"Type",
|
|
3451
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Text, { as: "strong", textTransform: "uppercase", children: content == null ? void 0 : content.key }),
|
|
3452
|
+
"to confirm"
|
|
3453
|
+
]
|
|
3454
|
+
}
|
|
3455
|
+
),
|
|
3456
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Input, { name: "confirm", onChange: handleChange, type: "text" })
|
|
3457
|
+
]
|
|
3458
|
+
}
|
|
3459
|
+
)
|
|
3228
3460
|
}
|
|
3229
3461
|
),
|
|
3230
|
-
/* @__PURE__ */ (0,
|
|
3231
|
-
/* @__PURE__ */ (0,
|
|
3462
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx8.HStack, { gap: "md", justify: "stretch", w: "full", children: [
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3232
3464
|
Button,
|
|
3233
3465
|
{
|
|
3234
3466
|
autoFocus: true,
|
|
3235
|
-
className: (0,
|
|
3467
|
+
className: (0, import_css51.css)({
|
|
3236
3468
|
w: "1/2"
|
|
3237
3469
|
}),
|
|
3238
3470
|
disabled: !isValid,
|
|
@@ -3243,10 +3475,10 @@ function PromptModal(props) {
|
|
|
3243
3475
|
children: content == null ? void 0 : content.actionText
|
|
3244
3476
|
}
|
|
3245
3477
|
),
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react29.DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
3247
3479
|
Button,
|
|
3248
3480
|
{
|
|
3249
|
-
className: (0,
|
|
3481
|
+
className: (0, import_css51.css)({
|
|
3250
3482
|
w: "1/2"
|
|
3251
3483
|
}),
|
|
3252
3484
|
name: "cancel",
|
|
@@ -3261,7 +3493,7 @@ function PromptModal(props) {
|
|
|
3261
3493
|
] });
|
|
3262
3494
|
}
|
|
3263
3495
|
function usePromptModal() {
|
|
3264
|
-
const context = (0,
|
|
3496
|
+
const context = (0, import_react28.useContext)(PromptModalContext);
|
|
3265
3497
|
if (context === null) {
|
|
3266
3498
|
throw new Error("usePromptModal must be used within a PromptModal Provider");
|
|
3267
3499
|
}
|
|
@@ -3269,50 +3501,50 @@ function usePromptModal() {
|
|
|
3269
3501
|
}
|
|
3270
3502
|
|
|
3271
3503
|
// src/context/theme.tsx
|
|
3272
|
-
var
|
|
3504
|
+
var import_react31 = require("react");
|
|
3273
3505
|
|
|
3274
3506
|
// src/hooks/useTheme.ts
|
|
3275
|
-
var
|
|
3507
|
+
var import_react30 = require("react");
|
|
3276
3508
|
var THEME_KEY = "cerberus-theme";
|
|
3277
3509
|
var MODE_KEY = "cerberus-mode";
|
|
3278
3510
|
function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options = {}) {
|
|
3279
3511
|
const { updateMode, updateTheme, cache } = options;
|
|
3280
|
-
const [theme, setTheme] = (0,
|
|
3281
|
-
const [colorMode, setColorMode] = (0,
|
|
3282
|
-
const handleThemeChange = (0,
|
|
3512
|
+
const [theme, setTheme] = (0, import_react30.useState)(defaultTheme);
|
|
3513
|
+
const [colorMode, setColorMode] = (0, import_react30.useState)(defaultColorMode);
|
|
3514
|
+
const handleThemeChange = (0, import_react30.useCallback)(
|
|
3283
3515
|
(newTheme) => {
|
|
3284
3516
|
setTheme(newTheme);
|
|
3285
3517
|
updateTheme == null ? void 0 : updateTheme(newTheme);
|
|
3286
3518
|
},
|
|
3287
3519
|
[updateTheme]
|
|
3288
3520
|
);
|
|
3289
|
-
const handleColorModeChange = (0,
|
|
3521
|
+
const handleColorModeChange = (0, import_react30.useCallback)(
|
|
3290
3522
|
(newMode) => {
|
|
3291
3523
|
setColorMode(newMode);
|
|
3292
3524
|
updateMode == null ? void 0 : updateMode(newMode);
|
|
3293
3525
|
},
|
|
3294
3526
|
[updateMode]
|
|
3295
3527
|
);
|
|
3296
|
-
(0,
|
|
3528
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
3297
3529
|
const theme2 = localStorage.getItem(THEME_KEY);
|
|
3298
3530
|
if (theme2) {
|
|
3299
3531
|
setTheme(theme2);
|
|
3300
3532
|
}
|
|
3301
3533
|
}, []);
|
|
3302
|
-
(0,
|
|
3534
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
3303
3535
|
const mode = localStorage.getItem(MODE_KEY);
|
|
3304
3536
|
if (mode) {
|
|
3305
3537
|
setColorMode(mode);
|
|
3306
3538
|
}
|
|
3307
3539
|
}, []);
|
|
3308
|
-
(0,
|
|
3540
|
+
(0, import_react30.useEffect)(() => {
|
|
3309
3541
|
const root = document.documentElement;
|
|
3310
3542
|
root.dataset.pandaTheme = theme;
|
|
3311
3543
|
if (cache) {
|
|
3312
3544
|
localStorage.setItem(THEME_KEY, theme);
|
|
3313
3545
|
}
|
|
3314
3546
|
}, [theme, cache]);
|
|
3315
|
-
(0,
|
|
3547
|
+
(0, import_react30.useEffect)(() => {
|
|
3316
3548
|
const root = document.documentElement;
|
|
3317
3549
|
if (colorMode === "system") {
|
|
3318
3550
|
root.dataset.colorMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -3323,7 +3555,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
3323
3555
|
localStorage.setItem(MODE_KEY, colorMode);
|
|
3324
3556
|
}
|
|
3325
3557
|
}, [colorMode, cache]);
|
|
3326
|
-
return (0,
|
|
3558
|
+
return (0, import_react30.useMemo)(
|
|
3327
3559
|
() => ({
|
|
3328
3560
|
theme,
|
|
3329
3561
|
mode: colorMode,
|
|
@@ -3335,8 +3567,8 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
3335
3567
|
}
|
|
3336
3568
|
|
|
3337
3569
|
// src/context/theme.tsx
|
|
3338
|
-
var
|
|
3339
|
-
var ThemeContext = (0,
|
|
3570
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3571
|
+
var ThemeContext = (0, import_react31.createContext)(
|
|
3340
3572
|
null
|
|
3341
3573
|
);
|
|
3342
3574
|
function ThemeProvider(props) {
|
|
@@ -3345,125 +3577,32 @@ function ThemeProvider(props) {
|
|
|
3345
3577
|
updateMode: props.updateMode,
|
|
3346
3578
|
updateTheme: props.updateTheme
|
|
3347
3579
|
});
|
|
3348
|
-
return /* @__PURE__ */ (0,
|
|
3580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ThemeContext.Provider, { value: state, children: props.children });
|
|
3349
3581
|
}
|
|
3350
3582
|
function useThemeContext() {
|
|
3351
|
-
const context = (0,
|
|
3583
|
+
const context = (0, import_react31.useContext)(ThemeContext);
|
|
3352
3584
|
if (!context) {
|
|
3353
3585
|
throw new Error("useThemeContext must be used within a ThemeProvider");
|
|
3354
3586
|
}
|
|
3355
3587
|
return context;
|
|
3356
3588
|
}
|
|
3357
3589
|
|
|
3358
|
-
// src/hooks/useDate.ts
|
|
3359
|
-
var import_react30 = require("react");
|
|
3360
|
-
function useDate(options) {
|
|
3361
|
-
const initialValue = (options == null ? void 0 : options.initialValue) ?? "";
|
|
3362
|
-
const format = (options == null ? void 0 : options.format) ?? DateFormats.USMilitary;
|
|
3363
|
-
const onChange = options == null ? void 0 : options.onChange;
|
|
3364
|
-
const [value, setValue] = (0, import_react30.useState)(initialValue);
|
|
3365
|
-
const handleChange = (0, import_react30.useCallback)(
|
|
3366
|
-
(e) => {
|
|
3367
|
-
const newValue = formatMilitaryDate(e.currentTarget.value);
|
|
3368
|
-
if (onChange) onChange(e);
|
|
3369
|
-
setValue(newValue);
|
|
3370
|
-
},
|
|
3371
|
-
[onChange]
|
|
3372
|
-
);
|
|
3373
|
-
return (0, import_react30.useMemo)(
|
|
3374
|
-
() => ({
|
|
3375
|
-
format,
|
|
3376
|
-
value,
|
|
3377
|
-
ISO: formatMilitaryToISO(value),
|
|
3378
|
-
onChange: handleChange
|
|
3379
|
-
}),
|
|
3380
|
-
[format, value, handleChange]
|
|
3381
|
-
);
|
|
3382
|
-
}
|
|
3383
|
-
function formatMilitaryToISO(input3) {
|
|
3384
|
-
const [day, month, year] = input3.split(" ");
|
|
3385
|
-
const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
|
|
3386
|
-
const monthNum = monthIndex + 1;
|
|
3387
|
-
return `${year ?? "0000"}-${monthNum.toString().padStart(2, "0")}-${day.padStart(
|
|
3388
|
-
2,
|
|
3389
|
-
"0"
|
|
3390
|
-
)}`;
|
|
3391
|
-
}
|
|
3392
|
-
function formatMilitaryDate(input3) {
|
|
3393
|
-
let formatted = input3.toUpperCase().replace(/[^0-9A-Z]/g, "");
|
|
3394
|
-
let day = "";
|
|
3395
|
-
let month = "";
|
|
3396
|
-
let year = "";
|
|
3397
|
-
if (formatted.length >= 2) {
|
|
3398
|
-
day = formatted.replace(/[^0-9]/g, "").slice(0, 2);
|
|
3399
|
-
const dayNum = parseInt(day, 10);
|
|
3400
|
-
if (dayNum > 31) day = "31";
|
|
3401
|
-
else if (dayNum === 0) day = "01";
|
|
3402
|
-
formatted = formatted.slice(2);
|
|
3403
|
-
}
|
|
3404
|
-
if (formatted.length >= 3) {
|
|
3405
|
-
month = formatted.slice(0, 3);
|
|
3406
|
-
const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
|
|
3407
|
-
if (monthIndex !== -1) {
|
|
3408
|
-
month = MONTHS[monthIndex];
|
|
3409
|
-
} else {
|
|
3410
|
-
month = month.replace(/[^A-Z]/g, "");
|
|
3411
|
-
}
|
|
3412
|
-
formatted = formatted.slice(3);
|
|
3413
|
-
}
|
|
3414
|
-
if (formatted.length > 0) {
|
|
3415
|
-
year = formatted.slice(0, 4);
|
|
3416
|
-
}
|
|
3417
|
-
return [day, month, year].filter(Boolean).join(" ");
|
|
3418
|
-
}
|
|
3419
|
-
function formatISOToMilitary(date) {
|
|
3420
|
-
const [year, month, day] = date.split("-");
|
|
3421
|
-
const monthIndex = parseInt(month, 10) - 1;
|
|
3422
|
-
const monthStr = MONTHS[monthIndex];
|
|
3423
|
-
return `${day} ${monthStr} ${year}`;
|
|
3424
|
-
}
|
|
3425
|
-
var DateFormats = {
|
|
3426
|
-
get ISO() {
|
|
3427
|
-
return "YYYY-MM-DD";
|
|
3428
|
-
},
|
|
3429
|
-
get USMilitary() {
|
|
3430
|
-
return "DD MMM YYYY";
|
|
3431
|
-
},
|
|
3432
|
-
get Months() {
|
|
3433
|
-
return MONTHS;
|
|
3434
|
-
}
|
|
3435
|
-
};
|
|
3436
|
-
var MONTHS = [
|
|
3437
|
-
"JAN",
|
|
3438
|
-
"FEB",
|
|
3439
|
-
"MAR",
|
|
3440
|
-
"APR",
|
|
3441
|
-
"MAY",
|
|
3442
|
-
"JUN",
|
|
3443
|
-
"JUL",
|
|
3444
|
-
"AUG",
|
|
3445
|
-
"SEP",
|
|
3446
|
-
"OCT",
|
|
3447
|
-
"NOV",
|
|
3448
|
-
"DEC"
|
|
3449
|
-
];
|
|
3450
|
-
|
|
3451
3590
|
// src/hooks/useModal.ts
|
|
3452
|
-
var
|
|
3591
|
+
var import_react32 = require("react");
|
|
3453
3592
|
function useModal() {
|
|
3454
|
-
const modalRef = (0,
|
|
3455
|
-
const [isOpen, setIsOpen] = (0,
|
|
3456
|
-
const show = (0,
|
|
3593
|
+
const modalRef = (0, import_react32.useRef)(null);
|
|
3594
|
+
const [isOpen, setIsOpen] = (0, import_react32.useState)(false);
|
|
3595
|
+
const show = (0, import_react32.useCallback)(() => {
|
|
3457
3596
|
var _a;
|
|
3458
3597
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
3459
3598
|
setIsOpen(true);
|
|
3460
3599
|
}, []);
|
|
3461
|
-
const close = (0,
|
|
3600
|
+
const close = (0, import_react32.useCallback)(() => {
|
|
3462
3601
|
var _a;
|
|
3463
3602
|
(_a = modalRef.current) == null ? void 0 : _a.close();
|
|
3464
3603
|
setIsOpen(false);
|
|
3465
3604
|
}, []);
|
|
3466
|
-
return (0,
|
|
3605
|
+
return (0, import_react32.useMemo)(() => {
|
|
3467
3606
|
return {
|
|
3468
3607
|
modalRef,
|
|
3469
3608
|
show,
|
|
@@ -3474,11 +3613,11 @@ function useModal() {
|
|
|
3474
3613
|
}
|
|
3475
3614
|
|
|
3476
3615
|
// src/hooks/useToggle.ts
|
|
3477
|
-
var
|
|
3616
|
+
var import_react33 = require("react");
|
|
3478
3617
|
function useToggle(options) {
|
|
3479
|
-
const [checked, setChecked] = (0,
|
|
3618
|
+
const [checked, setChecked] = (0, import_react33.useState)((options == null ? void 0 : options.checked) ?? "");
|
|
3480
3619
|
const onChange = options == null ? void 0 : options.onChange;
|
|
3481
|
-
const handleChange = (0,
|
|
3620
|
+
const handleChange = (0, import_react33.useCallback)(
|
|
3482
3621
|
(e) => {
|
|
3483
3622
|
const target = e.currentTarget;
|
|
3484
3623
|
setChecked((prev) => {
|
|
@@ -3488,24 +3627,24 @@ function useToggle(options) {
|
|
|
3488
3627
|
},
|
|
3489
3628
|
[onChange]
|
|
3490
3629
|
);
|
|
3491
|
-
return (0,
|
|
3630
|
+
return (0, import_react33.useMemo)(() => ({ checked, handleChange }), [checked, handleChange]);
|
|
3492
3631
|
}
|
|
3493
3632
|
|
|
3494
3633
|
// src/hooks/useRootColors.ts
|
|
3495
|
-
var
|
|
3634
|
+
var import_react34 = require("react");
|
|
3496
3635
|
function useRootColors(colors = []) {
|
|
3497
|
-
const [state, dispatch] = (0,
|
|
3498
|
-
const handleRefetch = (0,
|
|
3636
|
+
const [state, dispatch] = (0, import_react34.useReducer)(rootColorsReducer, {});
|
|
3637
|
+
const handleRefetch = (0, import_react34.useCallback)(() => {
|
|
3499
3638
|
return new Promise((resolve) => {
|
|
3500
3639
|
dispatch(formatColors(colors));
|
|
3501
3640
|
resolve();
|
|
3502
3641
|
});
|
|
3503
3642
|
}, []);
|
|
3504
|
-
(0,
|
|
3643
|
+
(0, import_react34.useEffect)(() => {
|
|
3505
3644
|
if (Object.keys(state).length === colors.length) return;
|
|
3506
3645
|
dispatch(formatColors(colors));
|
|
3507
3646
|
}, [colors]);
|
|
3508
|
-
return (0,
|
|
3647
|
+
return (0, import_react34.useMemo)(
|
|
3509
3648
|
() => ({ colors: state, refetch: handleRefetch }),
|
|
3510
3649
|
[state, handleRefetch]
|
|
3511
3650
|
);
|
|
@@ -3526,9 +3665,9 @@ function rootColorsReducer(state, action) {
|
|
|
3526
3665
|
}
|
|
3527
3666
|
|
|
3528
3667
|
// src/config/icons/checkbox.icons.tsx
|
|
3529
|
-
var
|
|
3668
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3530
3669
|
function CheckmarkIcon(props) {
|
|
3531
|
-
return /* @__PURE__ */ (0,
|
|
3670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3532
3671
|
"svg",
|
|
3533
3672
|
{
|
|
3534
3673
|
"aria-hidden": "true",
|
|
@@ -3537,7 +3676,7 @@ function CheckmarkIcon(props) {
|
|
|
3537
3676
|
role: "img",
|
|
3538
3677
|
viewBox: "0 0 24 24",
|
|
3539
3678
|
...props,
|
|
3540
|
-
children: /* @__PURE__ */ (0,
|
|
3679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3541
3680
|
"path",
|
|
3542
3681
|
{
|
|
3543
3682
|
fill: "currentColor",
|
|
@@ -3548,7 +3687,7 @@ function CheckmarkIcon(props) {
|
|
|
3548
3687
|
);
|
|
3549
3688
|
}
|
|
3550
3689
|
function IndeterminateIcon(props) {
|
|
3551
|
-
return /* @__PURE__ */ (0,
|
|
3690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3552
3691
|
"svg",
|
|
3553
3692
|
{
|
|
3554
3693
|
"aria-hidden": "true",
|
|
@@ -3557,15 +3696,15 @@ function IndeterminateIcon(props) {
|
|
|
3557
3696
|
fill: "none",
|
|
3558
3697
|
viewBox: "0 0 24 24",
|
|
3559
3698
|
...props,
|
|
3560
|
-
children: /* @__PURE__ */ (0,
|
|
3699
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { fill: "currentColor", d: "M4 11h16v2.667H4z" })
|
|
3561
3700
|
}
|
|
3562
3701
|
);
|
|
3563
3702
|
}
|
|
3564
3703
|
|
|
3565
3704
|
// src/components/AnimatingUploadIcon.tsx
|
|
3566
|
-
var
|
|
3705
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3567
3706
|
function AnimatingUploadIcon(props) {
|
|
3568
|
-
return /* @__PURE__ */ (0,
|
|
3707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3569
3708
|
"svg",
|
|
3570
3709
|
{
|
|
3571
3710
|
"aria-hidden": "true",
|
|
@@ -3573,7 +3712,7 @@ function AnimatingUploadIcon(props) {
|
|
|
3573
3712
|
width: props.size ?? "1em",
|
|
3574
3713
|
height: props.size ?? "1em",
|
|
3575
3714
|
viewBox: "0 0 24 24",
|
|
3576
|
-
children: /* @__PURE__ */ (0,
|
|
3715
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
3577
3716
|
"g",
|
|
3578
3717
|
{
|
|
3579
3718
|
fill: "none",
|
|
@@ -3582,14 +3721,14 @@ function AnimatingUploadIcon(props) {
|
|
|
3582
3721
|
strokeLinejoin: "round",
|
|
3583
3722
|
strokeWidth: 1.5,
|
|
3584
3723
|
children: [
|
|
3585
|
-
/* @__PURE__ */ (0,
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3586
3725
|
"path",
|
|
3587
3726
|
{
|
|
3588
3727
|
"data-name": "animating-trail",
|
|
3589
3728
|
strokeDasharray: "2 4",
|
|
3590
3729
|
strokeDashoffset: 6,
|
|
3591
3730
|
d: "M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",
|
|
3592
|
-
children: /* @__PURE__ */ (0,
|
|
3731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3593
3732
|
"animate",
|
|
3594
3733
|
{
|
|
3595
3734
|
attributeName: "stroke-dashoffset",
|
|
@@ -3600,14 +3739,14 @@ function AnimatingUploadIcon(props) {
|
|
|
3600
3739
|
)
|
|
3601
3740
|
}
|
|
3602
3741
|
),
|
|
3603
|
-
/* @__PURE__ */ (0,
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3604
3743
|
"path",
|
|
3605
3744
|
{
|
|
3606
3745
|
"data-name": "half-circle",
|
|
3607
3746
|
strokeDasharray: 32,
|
|
3608
3747
|
strokeDashoffset: 32,
|
|
3609
3748
|
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",
|
|
3610
|
-
children: /* @__PURE__ */ (0,
|
|
3749
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3611
3750
|
"animate",
|
|
3612
3751
|
{
|
|
3613
3752
|
fill: "freeze",
|
|
@@ -3619,7 +3758,7 @@ function AnimatingUploadIcon(props) {
|
|
|
3619
3758
|
)
|
|
3620
3759
|
}
|
|
3621
3760
|
),
|
|
3622
|
-
/* @__PURE__ */ (0,
|
|
3761
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3623
3762
|
"svg",
|
|
3624
3763
|
{
|
|
3625
3764
|
"aria-hidden": "true",
|
|
@@ -3629,7 +3768,7 @@ function AnimatingUploadIcon(props) {
|
|
|
3629
3768
|
x: "27%",
|
|
3630
3769
|
y: "27%",
|
|
3631
3770
|
viewBox: "0 0 24 24",
|
|
3632
|
-
children: /* @__PURE__ */ (0,
|
|
3771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3633
3772
|
"polygon",
|
|
3634
3773
|
{
|
|
3635
3774
|
fill: "currentColor",
|
|
@@ -3637,7 +3776,7 @@ function AnimatingUploadIcon(props) {
|
|
|
3637
3776
|
strokeWidth: 0.8,
|
|
3638
3777
|
opacity: "1",
|
|
3639
3778
|
points: "3.7,6.7 7.5,2.9 7.5,15 8.5,15 8.5,2.9 12.3,6.7 13,6 8,1 3,6 ",
|
|
3640
|
-
children: /* @__PURE__ */ (0,
|
|
3779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3641
3780
|
"animate",
|
|
3642
3781
|
{
|
|
3643
3782
|
fill: "freeze",
|
|
@@ -3676,12 +3815,6 @@ function makeSystemConfig(options) {
|
|
|
3676
3815
|
return options;
|
|
3677
3816
|
}
|
|
3678
3817
|
|
|
3679
|
-
// src/utils/index.ts
|
|
3680
|
-
function formatNotifyCount(count) {
|
|
3681
|
-
if (count > 99) return "99+";
|
|
3682
|
-
return count.toString();
|
|
3683
|
-
}
|
|
3684
|
-
|
|
3685
3818
|
// src/index.ts
|
|
3686
3819
|
__reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
3687
3820
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -3702,6 +3835,13 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
3702
3835
|
CTAModal,
|
|
3703
3836
|
CerberusProvider,
|
|
3704
3837
|
Checkbox,
|
|
3838
|
+
CheckboxControl,
|
|
3839
|
+
CheckboxGroup,
|
|
3840
|
+
CheckboxHiddenInput,
|
|
3841
|
+
CheckboxIndicator,
|
|
3842
|
+
CheckboxLabel,
|
|
3843
|
+
CheckboxParts,
|
|
3844
|
+
CheckboxRoot,
|
|
3705
3845
|
CircularProgress,
|
|
3706
3846
|
ConfirmModal,
|
|
3707
3847
|
DateFormats,
|
|
@@ -3736,11 +3876,22 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
3736
3876
|
FeatureFlag,
|
|
3737
3877
|
FeatureFlags,
|
|
3738
3878
|
Field,
|
|
3879
|
+
FieldErrorText,
|
|
3880
|
+
FieldHelperText,
|
|
3881
|
+
FieldInput,
|
|
3882
|
+
FieldLabel,
|
|
3739
3883
|
FieldMessage,
|
|
3884
|
+
FieldParts,
|
|
3885
|
+
FieldRequiredIndicator,
|
|
3886
|
+
FieldRoot,
|
|
3887
|
+
FieldStartIndicator,
|
|
3888
|
+
FieldStatusIndicator,
|
|
3889
|
+
FieldTextarea,
|
|
3740
3890
|
Fieldset,
|
|
3741
3891
|
FieldsetLabel,
|
|
3742
3892
|
FileStatus,
|
|
3743
3893
|
FileUploader,
|
|
3894
|
+
For,
|
|
3744
3895
|
IconButton,
|
|
3745
3896
|
Input,
|
|
3746
3897
|
Label,
|
|
@@ -3822,13 +3973,13 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
3822
3973
|
makeSystemConfig,
|
|
3823
3974
|
processStatus,
|
|
3824
3975
|
setLocalStorage,
|
|
3976
|
+
splitProps,
|
|
3825
3977
|
trapFocus,
|
|
3826
3978
|
useCTAModal,
|
|
3827
3979
|
useCerberusContext,
|
|
3828
3980
|
useConfirmModal,
|
|
3829
3981
|
useDate,
|
|
3830
3982
|
useFeatureFlags,
|
|
3831
|
-
useFieldContext,
|
|
3832
3983
|
useModal,
|
|
3833
3984
|
useNavMenuContext,
|
|
3834
3985
|
useNotificationCenter,
|