@cerberus-design/react 0.13.2-next-d63dca1 → 0.13.2-next-f9ad0e6
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 +159 -0
- package/build/legacy/components/Accordion.cjs +101 -0
- package/build/legacy/components/Accordion.cjs.map +1 -0
- package/build/legacy/components/AccordionItemGroup.cjs +119 -0
- package/build/legacy/components/AccordionItemGroup.cjs.map +1 -0
- package/build/legacy/components/Tooltip.cjs +2 -2
- package/build/legacy/components/Tooltip.cjs.map +1 -1
- package/build/legacy/index.cjs +722 -622
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +159 -0
- package/build/modern/{chunk-FBSESDWJ.js → chunk-4QBPJVEN.js} +4 -4
- package/build/modern/{chunk-WFJWCZ7E.js → chunk-622N7YRT.js} +4 -4
- package/build/modern/{chunk-3XGLNXJJ.js → chunk-C3CDRCHS.js} +7 -7
- package/build/modern/chunk-CSMPRYNC.js +39 -0
- package/build/modern/chunk-CSMPRYNC.js.map +1 -0
- package/build/modern/{chunk-KML4CTMK.js → chunk-LPALHB6R.js} +3 -3
- package/build/modern/chunk-LPALHB6R.js.map +1 -0
- package/build/modern/{chunk-GRUXP3NG.js → chunk-TM5AS6M6.js} +4 -4
- package/build/modern/chunk-ZTYKIWYQ.js +75 -0
- package/build/modern/chunk-ZTYKIWYQ.js.map +1 -0
- package/build/modern/components/Accordion.js +15 -0
- package/build/modern/components/Accordion.js.map +1 -0
- package/build/modern/components/AccordionItemGroup.js +9 -0
- package/build/modern/components/AccordionItemGroup.js.map +1 -0
- package/build/modern/components/Tooltip.js +1 -1
- package/build/modern/context/confirm-modal.js +2 -2
- package/build/modern/context/cta-modal.js +2 -2
- package/build/modern/context/notification-center.js +3 -3
- package/build/modern/context/prompt-modal.js +2 -2
- package/build/modern/index.js +51 -35
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Accordion.tsx +161 -0
- package/src/components/AccordionItemGroup.tsx +79 -0
- package/src/components/Tooltip.tsx +2 -2
- package/src/index.ts +2 -0
- package/build/modern/chunk-KML4CTMK.js.map +0 -1
- /package/build/modern/{chunk-FBSESDWJ.js.map → chunk-4QBPJVEN.js.map} +0 -0
- /package/build/modern/{chunk-WFJWCZ7E.js.map → chunk-622N7YRT.js.map} +0 -0
- /package/build/modern/{chunk-3XGLNXJJ.js.map → chunk-C3CDRCHS.js.map} +0 -0
- /package/build/modern/{chunk-GRUXP3NG.js.map → chunk-TM5AS6M6.js.map} +0 -0
package/build/legacy/index.cjs
CHANGED
|
@@ -22,6 +22,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var src_exports = {};
|
|
23
23
|
__export(src_exports, {
|
|
24
24
|
$cerberusIcons: () => $cerberusIcons,
|
|
25
|
+
Accordion: () => Accordion,
|
|
26
|
+
AccordionItem: () => AccordionItem,
|
|
27
|
+
AccordionItemContent: () => AccordionItemContent,
|
|
28
|
+
AccordionItemGroup: () => AccordionItemGroup,
|
|
29
|
+
AccordionItemIndicator: () => AccordionItemIndicator,
|
|
30
|
+
AccordionItemTrigger: () => AccordionItemTrigger,
|
|
25
31
|
Admonition: () => Admonition,
|
|
26
32
|
AdmonitionDescription: () => AdmonitionDescription,
|
|
27
33
|
AdmonitionHeading: () => AdmonitionHeading,
|
|
@@ -116,18 +122,119 @@ __export(src_exports, {
|
|
|
116
122
|
});
|
|
117
123
|
module.exports = __toCommonJS(src_exports);
|
|
118
124
|
|
|
119
|
-
// src/components/
|
|
120
|
-
var
|
|
125
|
+
// src/components/Accordion.tsx
|
|
126
|
+
var import_react = require("@ark-ui/react");
|
|
127
|
+
var import_icons = require("@cerberus/icons");
|
|
128
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
129
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
130
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
131
|
+
function Accordion(props) {
|
|
132
|
+
const { size, className, ...rootProps } = props;
|
|
133
|
+
const styles = (0, import_recipes.accordion)({ size });
|
|
134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
135
|
+
import_react.Accordion.Root,
|
|
136
|
+
{
|
|
137
|
+
collapsible: true,
|
|
138
|
+
className: (0, import_css.cx)(className, styles.root),
|
|
139
|
+
...rootProps
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function AccordionItem(props) {
|
|
144
|
+
const { size, ...itemProps } = props;
|
|
145
|
+
const styles = (0, import_recipes.accordion)({ size });
|
|
146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
147
|
+
import_react.Accordion.Item,
|
|
148
|
+
{
|
|
149
|
+
...itemProps,
|
|
150
|
+
className: (0, import_css.cx)(itemProps.className, styles.item)
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function AccordionItemTrigger(props) {
|
|
155
|
+
const { size, ...triggerProps } = props;
|
|
156
|
+
const styles = (0, import_recipes.accordion)({ size });
|
|
157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
import_react.Accordion.ItemTrigger,
|
|
159
|
+
{
|
|
160
|
+
...triggerProps,
|
|
161
|
+
className: (0, import_css.cx)(triggerProps.className, styles.itemTrigger)
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function AccordionItemIndicator(props) {
|
|
166
|
+
const { size, ...indicatorProps } = props;
|
|
167
|
+
const styles = (0, import_recipes.accordion)({ size });
|
|
168
|
+
const iconSize = size === "sm" ? 16 : "24";
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
170
|
+
import_react.Accordion.ItemIndicator,
|
|
171
|
+
{
|
|
172
|
+
...indicatorProps,
|
|
173
|
+
className: (0, import_css.cx)(indicatorProps.className, styles.itemIndicator),
|
|
174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ChevronDown, { size: iconSize })
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
function AccordionItemContent(props) {
|
|
179
|
+
const { size, ...contentProps } = props;
|
|
180
|
+
const styles = (0, import_recipes.accordion)({ size });
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
|
+
import_react.Accordion.ItemContent,
|
|
183
|
+
{
|
|
184
|
+
...contentProps,
|
|
185
|
+
className: (0, import_css.cx)(contentProps.className, styles.itemContent)
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// src/components/Show.tsx
|
|
191
|
+
var import_react2 = require("react");
|
|
192
|
+
function Show(props) {
|
|
193
|
+
const { when, children, fallback } = props;
|
|
194
|
+
const condition = (0, import_react2.useMemo)(() => when ?? false, [when]);
|
|
195
|
+
return (0, import_react2.useMemo)(() => {
|
|
196
|
+
if (condition) return children;
|
|
197
|
+
return fallback ?? null;
|
|
198
|
+
}, [condition, children, fallback]);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// src/components/AccordionItemGroup.tsx
|
|
121
202
|
var import_css2 = require("@cerberus/styled-system/css");
|
|
203
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
204
|
+
function AccordionItemGroup(props) {
|
|
205
|
+
const {
|
|
206
|
+
size,
|
|
207
|
+
heading,
|
|
208
|
+
children,
|
|
209
|
+
indicatorPosition = "end",
|
|
210
|
+
...itemProps
|
|
211
|
+
} = props;
|
|
212
|
+
const triggerStyles = indicatorPosition === "start" ? {
|
|
213
|
+
gap: "md",
|
|
214
|
+
justifyContent: "flex-start"
|
|
215
|
+
} : void 0;
|
|
216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AccordionItem, { ...itemProps, children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(AccordionItemTrigger, { className: (0, import_css2.css)(triggerStyles), size, children: [
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Show, { when: indicatorPosition === "start", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AccordionItemIndicator, { size }) }),
|
|
219
|
+
heading,
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Show, { when: indicatorPosition === "end", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AccordionItemIndicator, { size }) })
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AccordionItemContent, { size, children })
|
|
223
|
+
] });
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// src/components/Admonition.tsx
|
|
227
|
+
var import_recipes3 = require("@cerberus/styled-system/recipes");
|
|
228
|
+
var import_css4 = require("@cerberus/styled-system/css");
|
|
122
229
|
var import_patterns2 = require("@cerberus/styled-system/patterns");
|
|
123
230
|
|
|
124
231
|
// src/config/cerbIcons.ts
|
|
125
|
-
var
|
|
232
|
+
var import_icons2 = require("@cerberus/icons");
|
|
126
233
|
|
|
127
234
|
// src/config/icons/checkbox.icons.tsx
|
|
128
|
-
var
|
|
235
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
129
236
|
function CheckmarkIcon(props) {
|
|
130
|
-
return /* @__PURE__ */ (0,
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
131
238
|
"svg",
|
|
132
239
|
{
|
|
133
240
|
"aria-hidden": "true",
|
|
@@ -136,7 +243,7 @@ function CheckmarkIcon(props) {
|
|
|
136
243
|
role: "img",
|
|
137
244
|
viewBox: "0 0 24 24",
|
|
138
245
|
...props,
|
|
139
|
-
children: /* @__PURE__ */ (0,
|
|
246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
140
247
|
"path",
|
|
141
248
|
{
|
|
142
249
|
fill: "currentColor",
|
|
@@ -147,7 +254,7 @@ function CheckmarkIcon(props) {
|
|
|
147
254
|
);
|
|
148
255
|
}
|
|
149
256
|
function IndeterminateIcon(props) {
|
|
150
|
-
return /* @__PURE__ */ (0,
|
|
257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
151
258
|
"svg",
|
|
152
259
|
{
|
|
153
260
|
"aria-hidden": "true",
|
|
@@ -156,15 +263,15 @@ function IndeterminateIcon(props) {
|
|
|
156
263
|
fill: "none",
|
|
157
264
|
viewBox: "0 0 24 24",
|
|
158
265
|
...props,
|
|
159
|
-
children: /* @__PURE__ */ (0,
|
|
266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { fill: "currentColor", d: "M4 11h16v2.667H4z" })
|
|
160
267
|
}
|
|
161
268
|
);
|
|
162
269
|
}
|
|
163
270
|
|
|
164
271
|
// src/components/AnimatingUploadIcon.tsx
|
|
165
|
-
var
|
|
272
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
166
273
|
function AnimatingUploadIcon(props) {
|
|
167
|
-
return /* @__PURE__ */ (0,
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
168
275
|
"svg",
|
|
169
276
|
{
|
|
170
277
|
"aria-hidden": "true",
|
|
@@ -172,7 +279,7 @@ function AnimatingUploadIcon(props) {
|
|
|
172
279
|
width: props.size ?? "1em",
|
|
173
280
|
height: props.size ?? "1em",
|
|
174
281
|
viewBox: "0 0 24 24",
|
|
175
|
-
children: /* @__PURE__ */ (0,
|
|
282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
176
283
|
"g",
|
|
177
284
|
{
|
|
178
285
|
fill: "none",
|
|
@@ -181,14 +288,14 @@ function AnimatingUploadIcon(props) {
|
|
|
181
288
|
strokeLinejoin: "round",
|
|
182
289
|
strokeWidth: 1.5,
|
|
183
290
|
children: [
|
|
184
|
-
/* @__PURE__ */ (0,
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
185
292
|
"path",
|
|
186
293
|
{
|
|
187
294
|
"data-name": "animating-trail",
|
|
188
295
|
strokeDasharray: "2 4",
|
|
189
296
|
strokeDashoffset: 6,
|
|
190
297
|
d: "M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",
|
|
191
|
-
children: /* @__PURE__ */ (0,
|
|
298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
192
299
|
"animate",
|
|
193
300
|
{
|
|
194
301
|
attributeName: "stroke-dashoffset",
|
|
@@ -199,14 +306,14 @@ function AnimatingUploadIcon(props) {
|
|
|
199
306
|
)
|
|
200
307
|
}
|
|
201
308
|
),
|
|
202
|
-
/* @__PURE__ */ (0,
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
203
310
|
"path",
|
|
204
311
|
{
|
|
205
312
|
"data-name": "half-circle",
|
|
206
313
|
strokeDasharray: 32,
|
|
207
314
|
strokeDashoffset: 32,
|
|
208
315
|
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",
|
|
209
|
-
children: /* @__PURE__ */ (0,
|
|
316
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
210
317
|
"animate",
|
|
211
318
|
{
|
|
212
319
|
fill: "freeze",
|
|
@@ -218,7 +325,7 @@ function AnimatingUploadIcon(props) {
|
|
|
218
325
|
)
|
|
219
326
|
}
|
|
220
327
|
),
|
|
221
|
-
/* @__PURE__ */ (0,
|
|
328
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
222
329
|
"svg",
|
|
223
330
|
{
|
|
224
331
|
"aria-hidden": "true",
|
|
@@ -228,7 +335,7 @@ function AnimatingUploadIcon(props) {
|
|
|
228
335
|
x: "27%",
|
|
229
336
|
y: "27%",
|
|
230
337
|
viewBox: "0 0 24 24",
|
|
231
|
-
children: /* @__PURE__ */ (0,
|
|
338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
232
339
|
"polygon",
|
|
233
340
|
{
|
|
234
341
|
fill: "currentColor",
|
|
@@ -236,7 +343,7 @@ function AnimatingUploadIcon(props) {
|
|
|
236
343
|
strokeWidth: 0.8,
|
|
237
344
|
opacity: "1",
|
|
238
345
|
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 ",
|
|
239
|
-
children: /* @__PURE__ */ (0,
|
|
346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
240
347
|
"animate",
|
|
241
348
|
{
|
|
242
349
|
fill: "freeze",
|
|
@@ -259,24 +366,24 @@ function AnimatingUploadIcon(props) {
|
|
|
259
366
|
|
|
260
367
|
// src/config/cerbIcons.ts
|
|
261
368
|
var defaultIcons = {
|
|
262
|
-
avatar:
|
|
369
|
+
avatar: import_icons2.UserFilled,
|
|
263
370
|
checkbox: CheckmarkIcon,
|
|
264
|
-
close:
|
|
265
|
-
confirmModal:
|
|
266
|
-
delete:
|
|
267
|
-
promptModal:
|
|
268
|
-
waitingFileUploader:
|
|
371
|
+
close: import_icons2.Close,
|
|
372
|
+
confirmModal: import_icons2.Information,
|
|
373
|
+
delete: import_icons2.TrashCan,
|
|
374
|
+
promptModal: import_icons2.Information,
|
|
375
|
+
waitingFileUploader: import_icons2.CloudUpload,
|
|
269
376
|
fileUploader: AnimatingUploadIcon,
|
|
270
377
|
indeterminate: IndeterminateIcon,
|
|
271
|
-
infoNotification:
|
|
272
|
-
successNotification:
|
|
273
|
-
warningNotification:
|
|
274
|
-
dangerNotification:
|
|
275
|
-
invalid:
|
|
276
|
-
invalidAlt:
|
|
277
|
-
redo:
|
|
278
|
-
selectArrow:
|
|
279
|
-
toggleChecked:
|
|
378
|
+
infoNotification: import_icons2.Information,
|
|
379
|
+
successNotification: import_icons2.CheckmarkOutline,
|
|
380
|
+
warningNotification: import_icons2.WarningAlt,
|
|
381
|
+
dangerNotification: import_icons2.WarningFilled,
|
|
382
|
+
invalid: import_icons2.WarningFilled,
|
|
383
|
+
invalidAlt: import_icons2.Warning,
|
|
384
|
+
redo: import_icons2.Restart,
|
|
385
|
+
selectArrow: import_icons2.ChevronDown,
|
|
386
|
+
toggleChecked: import_icons2.Checkmark
|
|
280
387
|
};
|
|
281
388
|
|
|
282
389
|
// src/config/defineIcons.ts
|
|
@@ -298,23 +405,10 @@ function defineIcons(icons) {
|
|
|
298
405
|
var $cerberusIcons = defaultIcons;
|
|
299
406
|
|
|
300
407
|
// src/components/Avatar.tsx
|
|
301
|
-
var
|
|
408
|
+
var import_css3 = require("@cerberus/styled-system/css");
|
|
302
409
|
var import_patterns = require("@cerberus/styled-system/patterns");
|
|
303
|
-
var
|
|
304
|
-
|
|
305
|
-
// src/components/Show.tsx
|
|
306
|
-
var import_react = require("react");
|
|
307
|
-
function Show(props) {
|
|
308
|
-
const { when, children, fallback } = props;
|
|
309
|
-
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
310
|
-
return (0, import_react.useMemo)(() => {
|
|
311
|
-
if (condition) return children;
|
|
312
|
-
return fallback ?? null;
|
|
313
|
-
}, [condition, children, fallback]);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// src/components/Avatar.tsx
|
|
317
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
410
|
+
var import_recipes2 = require("@cerberus/styled-system/recipes");
|
|
411
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
318
412
|
function Avatar(props) {
|
|
319
413
|
const {
|
|
320
414
|
ariaLabel,
|
|
@@ -329,28 +423,28 @@ function Avatar(props) {
|
|
|
329
423
|
} = props;
|
|
330
424
|
const { avatar: AvatarIcon } = $cerberusIcons;
|
|
331
425
|
const initials = (ariaLabel || "").split(" ").map((word) => word[0]).join("").slice(0, 2);
|
|
332
|
-
return /* @__PURE__ */ (0,
|
|
426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
333
427
|
"div",
|
|
334
428
|
{
|
|
335
429
|
...nativeProps,
|
|
336
|
-
className: (0,
|
|
430
|
+
className: (0, import_css3.cx)(
|
|
337
431
|
nativeProps.className,
|
|
338
|
-
(0,
|
|
432
|
+
(0, import_recipes2.avatar)({ gradient, size }),
|
|
339
433
|
(0, import_patterns.circle)()
|
|
340
434
|
),
|
|
341
|
-
children: /* @__PURE__ */ (0,
|
|
435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
342
436
|
Show,
|
|
343
437
|
{
|
|
344
438
|
when: Boolean(src) || Boolean(as),
|
|
345
|
-
fallback: /* @__PURE__ */ (0,
|
|
439
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
346
440
|
Show,
|
|
347
441
|
{
|
|
348
442
|
when: Boolean(initials),
|
|
349
|
-
fallback: /* @__PURE__ */ (0,
|
|
443
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
350
444
|
Show,
|
|
351
445
|
{
|
|
352
446
|
when: Boolean(icon),
|
|
353
|
-
fallback: /* @__PURE__ */ (0,
|
|
447
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
354
448
|
AvatarIcon,
|
|
355
449
|
{
|
|
356
450
|
size: iconSizeMap[size]
|
|
@@ -362,15 +456,15 @@ function Avatar(props) {
|
|
|
362
456
|
children: initials
|
|
363
457
|
}
|
|
364
458
|
),
|
|
365
|
-
children: /* @__PURE__ */ (0,
|
|
459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
366
460
|
Show,
|
|
367
461
|
{
|
|
368
462
|
when: Boolean(as),
|
|
369
|
-
fallback: /* @__PURE__ */ (0,
|
|
463
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
370
464
|
"img",
|
|
371
465
|
{
|
|
372
466
|
alt: props.ariaLabel,
|
|
373
|
-
className: (0,
|
|
467
|
+
className: (0, import_css3.css)({
|
|
374
468
|
h: "full",
|
|
375
469
|
objectFit: "cover",
|
|
376
470
|
w: "full"
|
|
@@ -402,50 +496,50 @@ var iconSizeMap = {
|
|
|
402
496
|
};
|
|
403
497
|
|
|
404
498
|
// src/components/Admonition.tsx
|
|
405
|
-
var
|
|
499
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
406
500
|
function Admonition(props) {
|
|
407
501
|
const { children, palette = "page", usage, icon, ...nativeProps } = props;
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
409
503
|
"aside",
|
|
410
504
|
{
|
|
411
505
|
...nativeProps,
|
|
412
|
-
className: (0,
|
|
506
|
+
className: (0, import_css4.cx)(
|
|
413
507
|
nativeProps.className,
|
|
414
508
|
(0, import_patterns2.hstack)({
|
|
415
509
|
gap: "md",
|
|
416
510
|
w: "full"
|
|
417
511
|
}),
|
|
418
|
-
(0,
|
|
512
|
+
(0, import_recipes3.admonition)({ palette, usage }).root
|
|
419
513
|
),
|
|
420
514
|
children: [
|
|
421
|
-
/* @__PURE__ */ (0,
|
|
422
|
-
/* @__PURE__ */ (0,
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: Boolean(icon), fallback: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MatchAvatar, { palette }), children: icon }),
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children })
|
|
423
517
|
]
|
|
424
518
|
}
|
|
425
519
|
);
|
|
426
520
|
}
|
|
427
521
|
function AdmonitionHeading(props) {
|
|
428
522
|
const { palette, usage, ...nativeProps } = props;
|
|
429
|
-
return /* @__PURE__ */ (0,
|
|
523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
430
524
|
"p",
|
|
431
525
|
{
|
|
432
526
|
...nativeProps,
|
|
433
|
-
className: (0,
|
|
527
|
+
className: (0, import_css4.cx)(
|
|
434
528
|
nativeProps.className,
|
|
435
|
-
(0,
|
|
529
|
+
(0, import_recipes3.admonition)({ palette, usage }).heading
|
|
436
530
|
)
|
|
437
531
|
}
|
|
438
532
|
);
|
|
439
533
|
}
|
|
440
534
|
function AdmonitionDescription(props) {
|
|
441
535
|
const { palette, usage, ...nativeProps } = props;
|
|
442
|
-
return /* @__PURE__ */ (0,
|
|
536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
443
537
|
"p",
|
|
444
538
|
{
|
|
445
539
|
...nativeProps,
|
|
446
|
-
className: (0,
|
|
540
|
+
className: (0, import_css4.cx)(
|
|
447
541
|
nativeProps.className,
|
|
448
|
-
(0,
|
|
542
|
+
(0, import_recipes3.admonition)({ palette, usage }).description
|
|
449
543
|
)
|
|
450
544
|
}
|
|
451
545
|
);
|
|
@@ -459,56 +553,56 @@ function MatchAvatar(props) {
|
|
|
459
553
|
} = $cerberusIcons;
|
|
460
554
|
switch (props.palette) {
|
|
461
555
|
case "page":
|
|
462
|
-
return /* @__PURE__ */ (0,
|
|
556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
463
557
|
Avatar,
|
|
464
558
|
{
|
|
465
559
|
gradient: "charon-light",
|
|
466
560
|
ariaLabel: "",
|
|
467
|
-
icon: /* @__PURE__ */ (0,
|
|
561
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(InfoIcon, {}),
|
|
468
562
|
size: "sm",
|
|
469
563
|
src: ""
|
|
470
564
|
}
|
|
471
565
|
);
|
|
472
566
|
case "info":
|
|
473
|
-
return /* @__PURE__ */ (0,
|
|
567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
474
568
|
Avatar,
|
|
475
569
|
{
|
|
476
570
|
gradient: "amphiaraus-dark",
|
|
477
571
|
ariaLabel: "",
|
|
478
|
-
icon: /* @__PURE__ */ (0,
|
|
572
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(InfoIcon, {}),
|
|
479
573
|
size: "sm",
|
|
480
574
|
src: ""
|
|
481
575
|
}
|
|
482
576
|
);
|
|
483
577
|
case "success":
|
|
484
|
-
return /* @__PURE__ */ (0,
|
|
578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
485
579
|
Avatar,
|
|
486
580
|
{
|
|
487
581
|
gradient: "thanatos-dark",
|
|
488
582
|
ariaLabel: "",
|
|
489
|
-
icon: /* @__PURE__ */ (0,
|
|
583
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SuccessIcon, {}),
|
|
490
584
|
size: "sm",
|
|
491
585
|
src: ""
|
|
492
586
|
}
|
|
493
587
|
);
|
|
494
588
|
case "warning":
|
|
495
|
-
return /* @__PURE__ */ (0,
|
|
589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
496
590
|
Avatar,
|
|
497
591
|
{
|
|
498
592
|
gradient: "asphodel-light",
|
|
499
593
|
ariaLabel: "",
|
|
500
|
-
icon: /* @__PURE__ */ (0,
|
|
594
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WarningIcon, {}),
|
|
501
595
|
size: "sm",
|
|
502
596
|
src: ""
|
|
503
597
|
}
|
|
504
598
|
);
|
|
505
599
|
case "danger":
|
|
506
|
-
return /* @__PURE__ */ (0,
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
507
601
|
Avatar,
|
|
508
602
|
{
|
|
509
603
|
gradient: "hades-light",
|
|
510
604
|
ariaLabel: "",
|
|
511
|
-
icon: /* @__PURE__ */ (0,
|
|
605
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DangerIcon, {}),
|
|
512
606
|
size: "sm",
|
|
513
607
|
src: ""
|
|
514
608
|
}
|
|
@@ -519,18 +613,18 @@ function MatchAvatar(props) {
|
|
|
519
613
|
}
|
|
520
614
|
|
|
521
615
|
// src/components/Button.tsx
|
|
522
|
-
var
|
|
523
|
-
var
|
|
524
|
-
var
|
|
616
|
+
var import_css5 = require("@cerberus/styled-system/css");
|
|
617
|
+
var import_recipes4 = require("@cerberus/styled-system/recipes");
|
|
618
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
525
619
|
function Button(props) {
|
|
526
620
|
const { palette, usage, shape, ...nativeProps } = props;
|
|
527
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
528
622
|
"button",
|
|
529
623
|
{
|
|
530
624
|
...nativeProps,
|
|
531
|
-
className: (0,
|
|
625
|
+
className: (0, import_css5.cx)(
|
|
532
626
|
nativeProps.className,
|
|
533
|
-
(0,
|
|
627
|
+
(0, import_recipes4.button)({
|
|
534
628
|
palette,
|
|
535
629
|
usage,
|
|
536
630
|
shape
|
|
@@ -541,16 +635,16 @@ function Button(props) {
|
|
|
541
635
|
}
|
|
542
636
|
|
|
543
637
|
// src/components/Checkbox.tsx
|
|
544
|
-
var
|
|
638
|
+
var import_recipes5 = require("@cerberus/styled-system/recipes");
|
|
545
639
|
var import_patterns3 = require("@cerberus/styled-system/patterns");
|
|
546
|
-
var
|
|
640
|
+
var import_css6 = require("@cerberus/styled-system/css");
|
|
547
641
|
|
|
548
642
|
// src/context/field.tsx
|
|
549
|
-
var
|
|
550
|
-
var
|
|
551
|
-
var FieldContext = (0,
|
|
643
|
+
var import_react3 = require("react");
|
|
644
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
645
|
+
var FieldContext = (0, import_react3.createContext)(null);
|
|
552
646
|
function Field(props) {
|
|
553
|
-
const value = (0,
|
|
647
|
+
const value = (0, import_react3.useMemo)(
|
|
554
648
|
() => ({
|
|
555
649
|
disabled: props.disabled,
|
|
556
650
|
readOnly: props.readOnly,
|
|
@@ -559,10 +653,10 @@ function Field(props) {
|
|
|
559
653
|
}),
|
|
560
654
|
[props.disabled, props.readOnly, props.required, props.invalid]
|
|
561
655
|
);
|
|
562
|
-
return /* @__PURE__ */ (0,
|
|
656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FieldContext.Provider, { value, children: props.children });
|
|
563
657
|
}
|
|
564
658
|
function useFieldContext() {
|
|
565
|
-
const context = (0,
|
|
659
|
+
const context = (0, import_react3.useContext)(FieldContext);
|
|
566
660
|
if (!context) {
|
|
567
661
|
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
568
662
|
}
|
|
@@ -570,16 +664,16 @@ function useFieldContext() {
|
|
|
570
664
|
}
|
|
571
665
|
|
|
572
666
|
// src/components/Checkbox.tsx
|
|
573
|
-
var
|
|
667
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
574
668
|
function Checkbox(props) {
|
|
575
669
|
const { describedBy, size, checked, mixed, ...nativeProps } = props;
|
|
576
670
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
577
|
-
const styles = (0,
|
|
671
|
+
const styles = (0, import_recipes5.checkbox)({ size });
|
|
578
672
|
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon2 } = $cerberusIcons;
|
|
579
|
-
return /* @__PURE__ */ (0,
|
|
673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
580
674
|
"div",
|
|
581
675
|
{
|
|
582
|
-
className: (0,
|
|
676
|
+
className: (0, import_css6.cx)(
|
|
583
677
|
styles.root,
|
|
584
678
|
(0, import_patterns3.vstack)({
|
|
585
679
|
gap: "0",
|
|
@@ -587,7 +681,7 @@ function Checkbox(props) {
|
|
|
587
681
|
})
|
|
588
682
|
),
|
|
589
683
|
children: [
|
|
590
|
-
/* @__PURE__ */ (0,
|
|
684
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
591
685
|
"input",
|
|
592
686
|
{
|
|
593
687
|
...nativeProps,
|
|
@@ -595,12 +689,12 @@ function Checkbox(props) {
|
|
|
595
689
|
...describedBy && { "aria-describedby": describedBy },
|
|
596
690
|
...invalid && { "aria-invalid": true },
|
|
597
691
|
...mixed && { "aria-checked": "mixed" },
|
|
598
|
-
className: (0,
|
|
692
|
+
className: (0, import_css6.cx)("peer", nativeProps.className, styles.input),
|
|
599
693
|
type: "checkbox"
|
|
600
694
|
}
|
|
601
695
|
),
|
|
602
|
-
/* @__PURE__ */ (0,
|
|
603
|
-
/* @__PURE__ */ (0,
|
|
696
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Show, { when: checked && !mixed, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CheckIcon, {}) }) }),
|
|
697
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Show, { when: mixed, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IndeterminateIcon2, {}) }) })
|
|
604
698
|
]
|
|
605
699
|
}
|
|
606
700
|
);
|
|
@@ -608,15 +702,15 @@ function Checkbox(props) {
|
|
|
608
702
|
|
|
609
703
|
// src/components/CircularProgress.tsx
|
|
610
704
|
var import_patterns4 = require("@cerberus/styled-system/patterns");
|
|
611
|
-
var
|
|
612
|
-
var
|
|
705
|
+
var import_css7 = require("@cerberus/styled-system/css");
|
|
706
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
613
707
|
function CircularProgress(props) {
|
|
614
708
|
const strokeW = 14;
|
|
615
709
|
const radius = `calc(50% * (1 - ${strokeW}/100))`;
|
|
616
710
|
const status = props.syntax ?? "Done";
|
|
617
711
|
const now = props.now >= 100 ? 100 : props.now;
|
|
618
712
|
const bgStyle = props.bgStyle ?? "filled";
|
|
619
|
-
return /* @__PURE__ */ (0,
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
620
714
|
"div",
|
|
621
715
|
{
|
|
622
716
|
id: props.id,
|
|
@@ -631,11 +725,11 @@ function CircularProgress(props) {
|
|
|
631
725
|
position: "relative"
|
|
632
726
|
}),
|
|
633
727
|
role: "progressbar",
|
|
634
|
-
children: /* @__PURE__ */ (0,
|
|
728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
635
729
|
"svg",
|
|
636
730
|
{
|
|
637
731
|
"data-complete": now === 100,
|
|
638
|
-
className: (0,
|
|
732
|
+
className: (0, import_css7.css)({
|
|
639
733
|
display: "block",
|
|
640
734
|
rounded: "full",
|
|
641
735
|
transition: "all 0.5s ease"
|
|
@@ -646,17 +740,17 @@ function CircularProgress(props) {
|
|
|
646
740
|
viewBox: "0 0 100 100",
|
|
647
741
|
xmlns: "http://www.w3.org/2000/svg",
|
|
648
742
|
children: [
|
|
649
|
-
/* @__PURE__ */ (0,
|
|
650
|
-
/* @__PURE__ */ (0,
|
|
651
|
-
/* @__PURE__ */ (0,
|
|
652
|
-
/* @__PURE__ */ (0,
|
|
743
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("title", { children: props.title }),
|
|
744
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("desc", { children: `${now}% ${status}` }),
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("linearGradient", { id: "gradient", children: [
|
|
746
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
653
747
|
"stop",
|
|
654
748
|
{
|
|
655
749
|
offset: "0%",
|
|
656
750
|
stopColor: "var(--cerberus-colors-data-viz-progress-start)"
|
|
657
751
|
}
|
|
658
752
|
),
|
|
659
|
-
/* @__PURE__ */ (0,
|
|
753
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
660
754
|
"stop",
|
|
661
755
|
{
|
|
662
756
|
offset: "100%",
|
|
@@ -664,10 +758,10 @@ function CircularProgress(props) {
|
|
|
664
758
|
}
|
|
665
759
|
)
|
|
666
760
|
] }) }),
|
|
667
|
-
/* @__PURE__ */ (0,
|
|
761
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Show, { when: bgStyle === "filled", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
668
762
|
"circle",
|
|
669
763
|
{
|
|
670
|
-
className: (0,
|
|
764
|
+
className: (0, import_css7.css)({
|
|
671
765
|
fill: "page.surface.initial"
|
|
672
766
|
}),
|
|
673
767
|
cx: "50%",
|
|
@@ -676,10 +770,10 @@ function CircularProgress(props) {
|
|
|
676
770
|
pathLength: "100"
|
|
677
771
|
}
|
|
678
772
|
) }),
|
|
679
|
-
/* @__PURE__ */ (0,
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
680
774
|
"circle",
|
|
681
775
|
{
|
|
682
|
-
className: (0,
|
|
776
|
+
className: (0, import_css7.css)({
|
|
683
777
|
stroke: "page.bg.100"
|
|
684
778
|
}),
|
|
685
779
|
cx: "50%",
|
|
@@ -688,11 +782,11 @@ function CircularProgress(props) {
|
|
|
688
782
|
pathLength: "100"
|
|
689
783
|
}
|
|
690
784
|
),
|
|
691
|
-
/* @__PURE__ */ (0,
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
692
786
|
"circle",
|
|
693
787
|
{
|
|
694
788
|
"data-complete": now === 100,
|
|
695
|
-
className: (0,
|
|
789
|
+
className: (0, import_css7.css)({
|
|
696
790
|
stroke: "url(#gradient)",
|
|
697
791
|
transition: "stroke-dashoffset, stroke 0.5s ease",
|
|
698
792
|
_isComplete: {
|
|
@@ -709,11 +803,11 @@ function CircularProgress(props) {
|
|
|
709
803
|
transform: "rotate(-90 50 50)"
|
|
710
804
|
}
|
|
711
805
|
),
|
|
712
|
-
/* @__PURE__ */ (0,
|
|
713
|
-
/* @__PURE__ */ (0,
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("g", { children: [
|
|
807
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
714
808
|
"text",
|
|
715
809
|
{
|
|
716
|
-
className: (0,
|
|
810
|
+
className: (0, import_css7.css)({
|
|
717
811
|
fill: "page.text.initial",
|
|
718
812
|
fontFamily: "mono",
|
|
719
813
|
textStyle: "1.25rem"
|
|
@@ -728,10 +822,10 @@ function CircularProgress(props) {
|
|
|
728
822
|
]
|
|
729
823
|
}
|
|
730
824
|
),
|
|
731
|
-
/* @__PURE__ */ (0,
|
|
825
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
732
826
|
"text",
|
|
733
827
|
{
|
|
734
|
-
className: (0,
|
|
828
|
+
className: (0, import_css7.css)({
|
|
735
829
|
fill: "page.text.100",
|
|
736
830
|
fontSize: "0.5rem",
|
|
737
831
|
fontWeight: 600
|
|
@@ -753,18 +847,18 @@ function CircularProgress(props) {
|
|
|
753
847
|
|
|
754
848
|
// src/components/Droppable.tsx
|
|
755
849
|
var import_core = require("@dnd-kit/core");
|
|
756
|
-
var
|
|
757
|
-
var
|
|
850
|
+
var import_react4 = require("react");
|
|
851
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
758
852
|
function Droppable(props) {
|
|
759
853
|
const { dropped, id, disabled, data, resizeObserverConfig, ...nativeProps } = props;
|
|
760
|
-
const uuid = (0,
|
|
854
|
+
const uuid = (0, import_react4.useId)();
|
|
761
855
|
const { isOver, setNodeRef } = (0, import_core.useDroppable)({
|
|
762
856
|
data,
|
|
763
857
|
disabled,
|
|
764
858
|
id: id || uuid,
|
|
765
859
|
resizeObserverConfig
|
|
766
860
|
});
|
|
767
|
-
return /* @__PURE__ */ (0,
|
|
861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
768
862
|
"div",
|
|
769
863
|
{
|
|
770
864
|
...nativeProps,
|
|
@@ -777,30 +871,30 @@ function Droppable(props) {
|
|
|
777
871
|
}
|
|
778
872
|
|
|
779
873
|
// src/components/FieldMessage.tsx
|
|
780
|
-
var
|
|
781
|
-
var
|
|
782
|
-
var
|
|
874
|
+
var import_css8 = require("@cerberus/styled-system/css");
|
|
875
|
+
var import_recipes6 = require("@cerberus/styled-system/recipes");
|
|
876
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
783
877
|
function FieldMessage(props) {
|
|
784
878
|
const { invalid } = useFieldContext();
|
|
785
|
-
return /* @__PURE__ */ (0,
|
|
879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
786
880
|
"small",
|
|
787
881
|
{
|
|
788
882
|
...props,
|
|
789
883
|
...invalid && { "aria-invalid": true },
|
|
790
|
-
className: (0,
|
|
884
|
+
className: (0, import_css8.cx)(props.className, (0, import_recipes6.fieldMessage)())
|
|
791
885
|
}
|
|
792
886
|
);
|
|
793
887
|
}
|
|
794
888
|
|
|
795
889
|
// src/context/feature-flags.tsx
|
|
796
|
-
var
|
|
797
|
-
var
|
|
798
|
-
var FeatureFlagContext = (0,
|
|
890
|
+
var import_react5 = require("react");
|
|
891
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
892
|
+
var FeatureFlagContext = (0, import_react5.createContext)(null);
|
|
799
893
|
function FeatureFlags(props) {
|
|
800
|
-
return /* @__PURE__ */ (0,
|
|
894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FeatureFlagContext.Provider, { value: props.flags, children: props.children });
|
|
801
895
|
}
|
|
802
896
|
function useFeatureFlags(key) {
|
|
803
|
-
const context = (0,
|
|
897
|
+
const context = (0, import_react5.useContext)(FeatureFlagContext);
|
|
804
898
|
if (context === null) {
|
|
805
899
|
throw new Error(
|
|
806
900
|
"useFeatureFlag must be used within a FeatureFlags Provider"
|
|
@@ -810,26 +904,26 @@ function useFeatureFlags(key) {
|
|
|
810
904
|
}
|
|
811
905
|
|
|
812
906
|
// src/components/FeatureFlag.tsx
|
|
813
|
-
var
|
|
907
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
814
908
|
function FeatureFlag(props) {
|
|
815
909
|
const showContent = useFeatureFlags(props.flag);
|
|
816
|
-
return /* @__PURE__ */ (0,
|
|
910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Show, { when: showContent, children: props.children });
|
|
817
911
|
}
|
|
818
912
|
|
|
819
913
|
// src/components/Fieldset.tsx
|
|
820
|
-
var
|
|
821
|
-
var
|
|
914
|
+
var import_css9 = require("@cerberus/styled-system/css");
|
|
915
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
822
916
|
function Fieldset(props) {
|
|
823
917
|
const { invalid, ...formState } = useFieldContext();
|
|
824
|
-
return /* @__PURE__ */ (0,
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
825
919
|
"fieldset",
|
|
826
920
|
{
|
|
827
921
|
...props,
|
|
828
922
|
...formState,
|
|
829
923
|
...invalid && { "aria-invalid": true },
|
|
830
|
-
className: (0,
|
|
924
|
+
className: (0, import_css9.cx)(
|
|
831
925
|
props.className,
|
|
832
|
-
(0,
|
|
926
|
+
(0, import_css9.css)({
|
|
833
927
|
border: "none",
|
|
834
928
|
pt: 2,
|
|
835
929
|
margin: 0
|
|
@@ -840,18 +934,18 @@ function Fieldset(props) {
|
|
|
840
934
|
}
|
|
841
935
|
|
|
842
936
|
// src/components/FieldsetLabel.tsx
|
|
843
|
-
var
|
|
844
|
-
var
|
|
845
|
-
var
|
|
937
|
+
var import_css10 = require("@cerberus/styled-system/css");
|
|
938
|
+
var import_recipes7 = require("@cerberus/styled-system/recipes");
|
|
939
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
846
940
|
function FieldsetLabel(props) {
|
|
847
941
|
const { size, usage, ...nativeProps } = props;
|
|
848
|
-
return /* @__PURE__ */ (0,
|
|
942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
849
943
|
"label",
|
|
850
944
|
{
|
|
851
945
|
...nativeProps,
|
|
852
|
-
className: (0,
|
|
946
|
+
className: (0, import_css10.cx)(
|
|
853
947
|
nativeProps.className,
|
|
854
|
-
(0,
|
|
948
|
+
(0, import_recipes7.label)({
|
|
855
949
|
size,
|
|
856
950
|
usage
|
|
857
951
|
})
|
|
@@ -861,23 +955,23 @@ function FieldsetLabel(props) {
|
|
|
861
955
|
}
|
|
862
956
|
|
|
863
957
|
// src/components/FileStatus.tsx
|
|
864
|
-
var
|
|
865
|
-
var
|
|
866
|
-
var
|
|
958
|
+
var import_react6 = require("react");
|
|
959
|
+
var import_recipes10 = require("@cerberus/styled-system/recipes");
|
|
960
|
+
var import_css13 = require("@cerberus/styled-system/css");
|
|
867
961
|
var import_patterns5 = require("@cerberus/styled-system/patterns");
|
|
868
962
|
|
|
869
963
|
// src/components/ProgressBar.tsx
|
|
870
|
-
var
|
|
871
|
-
var
|
|
872
|
-
var
|
|
964
|
+
var import_css11 = require("@cerberus/styled-system/css");
|
|
965
|
+
var import_recipes8 = require("@cerberus/styled-system/recipes");
|
|
966
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
873
967
|
function ProgressBar(props) {
|
|
874
968
|
const { indeterminate, size, usage, now, label: label4, ...nativeProps } = props;
|
|
875
|
-
const styles = (0,
|
|
969
|
+
const styles = (0, import_recipes8.progressBar)({ size, usage });
|
|
876
970
|
const nowClamped = Math.min(100, Math.max(0, now || 0));
|
|
877
971
|
const width = {
|
|
878
972
|
width: indeterminate ? "50%" : `${nowClamped}%`
|
|
879
973
|
};
|
|
880
|
-
return /* @__PURE__ */ (0,
|
|
974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
881
975
|
"div",
|
|
882
976
|
{
|
|
883
977
|
...nativeProps,
|
|
@@ -885,9 +979,9 @@ function ProgressBar(props) {
|
|
|
885
979
|
"aria-valuemin": 0,
|
|
886
980
|
"aria-valuemax": 100,
|
|
887
981
|
"aria-valuenow": indeterminate ? 0 : nowClamped,
|
|
888
|
-
className: (0,
|
|
982
|
+
className: (0, import_css11.cx)(nativeProps.className, styles.root),
|
|
889
983
|
role: "progressbar",
|
|
890
|
-
children: /* @__PURE__ */ (0,
|
|
984
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
891
985
|
"div",
|
|
892
986
|
{
|
|
893
987
|
...indeterminate && { "data-indeterminate": true },
|
|
@@ -901,19 +995,19 @@ function ProgressBar(props) {
|
|
|
901
995
|
}
|
|
902
996
|
|
|
903
997
|
// src/components/IconButton.tsx
|
|
904
|
-
var
|
|
905
|
-
var
|
|
906
|
-
var
|
|
998
|
+
var import_css12 = require("@cerberus/styled-system/css");
|
|
999
|
+
var import_recipes9 = require("@cerberus/styled-system/recipes");
|
|
1000
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
907
1001
|
function IconButton(props) {
|
|
908
1002
|
const { ariaLabel, palette, usage, size, ...nativeProps } = props;
|
|
909
|
-
return /* @__PURE__ */ (0,
|
|
1003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
910
1004
|
"button",
|
|
911
1005
|
{
|
|
912
1006
|
...nativeProps,
|
|
913
1007
|
"aria-label": ariaLabel ?? "Icon Button",
|
|
914
|
-
className: (0,
|
|
1008
|
+
className: (0, import_css12.cx)(
|
|
915
1009
|
nativeProps.className,
|
|
916
|
-
(0,
|
|
1010
|
+
(0, import_recipes9.iconButton)({
|
|
917
1011
|
palette,
|
|
918
1012
|
usage,
|
|
919
1013
|
size
|
|
@@ -924,7 +1018,7 @@ function IconButton(props) {
|
|
|
924
1018
|
}
|
|
925
1019
|
|
|
926
1020
|
// src/components/FileStatus.tsx
|
|
927
|
-
var
|
|
1021
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
928
1022
|
var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
929
1023
|
processStatus2["TODO"] = "todo";
|
|
930
1024
|
processStatus2["PROCESSING"] = "processing";
|
|
@@ -934,24 +1028,24 @@ var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
|
934
1028
|
})(processStatus || {});
|
|
935
1029
|
function FileStatus(props) {
|
|
936
1030
|
const { file, now, status, onClick, ...nativeProps } = props;
|
|
937
|
-
const actionLabel = (0,
|
|
938
|
-
const palette = (0,
|
|
939
|
-
const modalIconPalette = (0,
|
|
940
|
-
const styles = (0,
|
|
1031
|
+
const actionLabel = (0, import_react6.useMemo)(() => getStatusActionLabel(status), [status]);
|
|
1032
|
+
const palette = (0, import_react6.useMemo)(() => getPalette(status), [status]);
|
|
1033
|
+
const modalIconPalette = (0, import_react6.useMemo)(() => getModalIconPalette(status), [status]);
|
|
1034
|
+
const styles = (0, import_react6.useMemo)(() => {
|
|
941
1035
|
switch (status) {
|
|
942
1036
|
case "todo" /* TODO */:
|
|
943
|
-
return (0,
|
|
1037
|
+
return (0, import_recipes10.fileStatus)({ status: "todo" });
|
|
944
1038
|
case "processing" /* PROCESSING */:
|
|
945
|
-
return (0,
|
|
1039
|
+
return (0, import_recipes10.fileStatus)({ status: "processing" });
|
|
946
1040
|
case "done" /* DONE */:
|
|
947
|
-
return (0,
|
|
1041
|
+
return (0, import_recipes10.fileStatus)({ status: "done" });
|
|
948
1042
|
case "error" /* ERROR */:
|
|
949
|
-
return (0,
|
|
1043
|
+
return (0, import_recipes10.fileStatus)({ status: "error" });
|
|
950
1044
|
default:
|
|
951
|
-
return (0,
|
|
1045
|
+
return (0, import_recipes10.fileStatus)();
|
|
952
1046
|
}
|
|
953
1047
|
}, [status]);
|
|
954
|
-
const handleClick = (0,
|
|
1048
|
+
const handleClick = (0, import_react6.useCallback)(
|
|
955
1049
|
(e) => {
|
|
956
1050
|
const actionStatus = getStatusActionLabel(
|
|
957
1051
|
status
|
|
@@ -960,22 +1054,22 @@ function FileStatus(props) {
|
|
|
960
1054
|
},
|
|
961
1055
|
[onClick]
|
|
962
1056
|
);
|
|
963
|
-
return /* @__PURE__ */ (0,
|
|
1057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
964
1058
|
"div",
|
|
965
1059
|
{
|
|
966
1060
|
...nativeProps,
|
|
967
|
-
className: (0,
|
|
1061
|
+
className: (0, import_css13.cx)(nativeProps.className, styles.root, (0, import_patterns5.hstack)()),
|
|
968
1062
|
children: [
|
|
969
|
-
/* @__PURE__ */ (0,
|
|
1063
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
970
1064
|
Avatar,
|
|
971
1065
|
{
|
|
972
1066
|
ariaLabel: "",
|
|
973
1067
|
gradient: modalIconPalette,
|
|
974
|
-
icon: /* @__PURE__ */ (0,
|
|
1068
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MatchFileStatusIcon, { size: 24, status }),
|
|
975
1069
|
src: ""
|
|
976
1070
|
}
|
|
977
1071
|
),
|
|
978
|
-
/* @__PURE__ */ (0,
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
979
1073
|
"div",
|
|
980
1074
|
{
|
|
981
1075
|
className: (0, import_patterns5.vstack)({
|
|
@@ -984,17 +1078,17 @@ function FileStatus(props) {
|
|
|
984
1078
|
w: "full"
|
|
985
1079
|
}),
|
|
986
1080
|
children: [
|
|
987
|
-
/* @__PURE__ */ (0,
|
|
1081
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
988
1082
|
"small",
|
|
989
1083
|
{
|
|
990
|
-
className: (0,
|
|
1084
|
+
className: (0, import_css13.css)({
|
|
991
1085
|
color: "page.text.initial",
|
|
992
1086
|
textStyle: "label-sm"
|
|
993
1087
|
}),
|
|
994
1088
|
children: file
|
|
995
1089
|
}
|
|
996
1090
|
),
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
998
1092
|
ProgressBar,
|
|
999
1093
|
{
|
|
1000
1094
|
id: props.id,
|
|
@@ -1003,27 +1097,27 @@ function FileStatus(props) {
|
|
|
1003
1097
|
size: "sm"
|
|
1004
1098
|
}
|
|
1005
1099
|
),
|
|
1006
|
-
/* @__PURE__ */ (0,
|
|
1100
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Field, { invalid: modalIconPalette === "hades-dark", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1007
1101
|
FieldMessage,
|
|
1008
1102
|
{
|
|
1009
|
-
className: (0,
|
|
1103
|
+
className: (0, import_css13.css)({
|
|
1010
1104
|
color: "page.text.100"
|
|
1011
1105
|
}),
|
|
1012
1106
|
id: `help:${file}`,
|
|
1013
|
-
children: /* @__PURE__ */ (0,
|
|
1107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MatchFileStatusText, { status, now })
|
|
1014
1108
|
}
|
|
1015
1109
|
) })
|
|
1016
1110
|
]
|
|
1017
1111
|
}
|
|
1018
1112
|
),
|
|
1019
|
-
/* @__PURE__ */ (0,
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1020
1114
|
IconButton,
|
|
1021
1115
|
{
|
|
1022
1116
|
ariaLabel: actionLabel,
|
|
1023
1117
|
onClick: handleClick,
|
|
1024
1118
|
palette,
|
|
1025
1119
|
size: "sm",
|
|
1026
|
-
children: /* @__PURE__ */ (0,
|
|
1120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MatchStatusAction, { status })
|
|
1027
1121
|
}
|
|
1028
1122
|
)
|
|
1029
1123
|
]
|
|
@@ -1039,13 +1133,13 @@ function MatchFileStatusIcon(props) {
|
|
|
1039
1133
|
} = $cerberusIcons;
|
|
1040
1134
|
switch (props.status) {
|
|
1041
1135
|
case "todo" /* TODO */:
|
|
1042
|
-
return /* @__PURE__ */ (0,
|
|
1136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TodoIcon, { size: props.size });
|
|
1043
1137
|
case "processing" /* PROCESSING */:
|
|
1044
|
-
return /* @__PURE__ */ (0,
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FileUploaderIcon, { size: props.size });
|
|
1045
1139
|
case "done" /* DONE */:
|
|
1046
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DoneIcon, { size: props.size });
|
|
1047
1141
|
case "error" /* ERROR */:
|
|
1048
|
-
return /* @__PURE__ */ (0,
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InvalidIcon, { size: props.size });
|
|
1049
1143
|
default:
|
|
1050
1144
|
throw new Error("Unknown status");
|
|
1051
1145
|
}
|
|
@@ -1069,11 +1163,11 @@ function MatchStatusAction(props) {
|
|
|
1069
1163
|
switch (props.status) {
|
|
1070
1164
|
case "todo" /* TODO */:
|
|
1071
1165
|
case "processing" /* PROCESSING */:
|
|
1072
|
-
return /* @__PURE__ */ (0,
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CloseIcon, {});
|
|
1073
1167
|
case "error" /* ERROR */:
|
|
1074
|
-
return /* @__PURE__ */ (0,
|
|
1168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RedoIcon, {});
|
|
1075
1169
|
case "done" /* DONE */:
|
|
1076
|
-
return /* @__PURE__ */ (0,
|
|
1170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TrashIcon, {});
|
|
1077
1171
|
default:
|
|
1078
1172
|
throw new Error("Invalid status");
|
|
1079
1173
|
}
|
|
@@ -1119,39 +1213,39 @@ function getModalIconPalette(status) {
|
|
|
1119
1213
|
}
|
|
1120
1214
|
|
|
1121
1215
|
// src/components/FileUploader.tsx
|
|
1122
|
-
var
|
|
1216
|
+
var import_css14 = require("@cerberus/styled-system/css");
|
|
1123
1217
|
var import_patterns6 = require("@cerberus/styled-system/patterns");
|
|
1124
|
-
var
|
|
1125
|
-
var
|
|
1218
|
+
var import_recipes11 = require("@cerberus/styled-system/recipes");
|
|
1219
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1126
1220
|
function FileUploader(props) {
|
|
1127
1221
|
var _a;
|
|
1128
|
-
const styles = (0,
|
|
1222
|
+
const styles = (0, import_recipes11.fileUploader)();
|
|
1129
1223
|
const { waitingFileUploader: Icon } = $cerberusIcons;
|
|
1130
|
-
return /* @__PURE__ */ (0,
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1131
1225
|
"div",
|
|
1132
1226
|
{
|
|
1133
1227
|
...props.disabled ? { "aria-disabled": true } : {},
|
|
1134
|
-
className: (0,
|
|
1228
|
+
className: (0, import_css14.cx)(
|
|
1135
1229
|
(0, import_patterns6.vstack)({
|
|
1136
1230
|
justify: "center"
|
|
1137
1231
|
}),
|
|
1138
1232
|
styles.container
|
|
1139
1233
|
),
|
|
1140
1234
|
children: [
|
|
1141
|
-
/* @__PURE__ */ (0,
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1142
1236
|
Avatar,
|
|
1143
1237
|
{
|
|
1144
1238
|
gradient: "charon-light",
|
|
1145
1239
|
ariaLabel: "",
|
|
1146
|
-
icon: /* @__PURE__ */ (0,
|
|
1240
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, {}),
|
|
1147
1241
|
size: "md",
|
|
1148
1242
|
src: ""
|
|
1149
1243
|
}
|
|
1150
1244
|
) }),
|
|
1151
|
-
/* @__PURE__ */ (0,
|
|
1245
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1152
1246
|
"label",
|
|
1153
1247
|
{
|
|
1154
|
-
className: (0,
|
|
1248
|
+
className: (0, import_css14.cx)(
|
|
1155
1249
|
(0, import_patterns6.vstack)({
|
|
1156
1250
|
justify: "center"
|
|
1157
1251
|
}),
|
|
@@ -1159,16 +1253,16 @@ function FileUploader(props) {
|
|
|
1159
1253
|
),
|
|
1160
1254
|
htmlFor: props.name,
|
|
1161
1255
|
children: [
|
|
1162
|
-
/* @__PURE__ */ (0,
|
|
1256
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Show, { when: Boolean(props.heading), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: styles.heading, children: props.heading }) }),
|
|
1163
1257
|
"Import ",
|
|
1164
1258
|
(_a = props.accept) == null ? void 0 : _a.replace(",", ", "),
|
|
1165
1259
|
" files",
|
|
1166
|
-
/* @__PURE__ */ (0,
|
|
1167
|
-
/* @__PURE__ */ (0,
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: styles.description, children: "Click to select files" }),
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1168
1262
|
"input",
|
|
1169
1263
|
{
|
|
1170
1264
|
...props,
|
|
1171
|
-
className: (0,
|
|
1265
|
+
className: (0, import_css14.cx)(props.className, styles.input),
|
|
1172
1266
|
type: "file"
|
|
1173
1267
|
}
|
|
1174
1268
|
)
|
|
@@ -1181,18 +1275,18 @@ function FileUploader(props) {
|
|
|
1181
1275
|
}
|
|
1182
1276
|
|
|
1183
1277
|
// src/components/Input.tsx
|
|
1184
|
-
var
|
|
1185
|
-
var
|
|
1186
|
-
var
|
|
1278
|
+
var import_recipes12 = require("@cerberus/styled-system/recipes");
|
|
1279
|
+
var import_css15 = require("@cerberus/styled-system/css");
|
|
1280
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1187
1281
|
function Input(props) {
|
|
1188
1282
|
const { describedBy, size, startIcon, endIcon, ...nativeProps } = props;
|
|
1189
|
-
const inputStyles = (0,
|
|
1283
|
+
const inputStyles = (0, import_recipes12.input)({ size });
|
|
1190
1284
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
1191
1285
|
const hasEndIcon = Boolean(endIcon);
|
|
1192
1286
|
const { invalid: InvalidIcon } = $cerberusIcons;
|
|
1193
|
-
return /* @__PURE__ */ (0,
|
|
1194
|
-
/* @__PURE__ */ (0,
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: inputStyles.root, children: [
|
|
1288
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1196
1290
|
"input",
|
|
1197
1291
|
{
|
|
1198
1292
|
...nativeProps,
|
|
@@ -1200,31 +1294,31 @@ function Input(props) {
|
|
|
1200
1294
|
...describedBy && { "aria-describedby": describedBy },
|
|
1201
1295
|
...invalid && { "aria-invalid": true },
|
|
1202
1296
|
"data-start-icon": Boolean(startIcon),
|
|
1203
|
-
className: (0,
|
|
1297
|
+
className: (0, import_css15.cx)("peer", nativeProps.className, inputStyles.input)
|
|
1204
1298
|
}
|
|
1205
1299
|
),
|
|
1206
|
-
/* @__PURE__ */ (0,
|
|
1207
|
-
/* @__PURE__ */ (0,
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
|
|
1301
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
|
|
1208
1302
|
] });
|
|
1209
1303
|
}
|
|
1210
1304
|
|
|
1211
1305
|
// src/components/Label.tsx
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1306
|
+
var import_recipes13 = require("@cerberus/styled-system/recipes");
|
|
1307
|
+
var import_css16 = require("@cerberus/styled-system/css");
|
|
1214
1308
|
var import_patterns7 = require("@cerberus/styled-system/patterns");
|
|
1215
|
-
var
|
|
1309
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1216
1310
|
function Label(props) {
|
|
1217
1311
|
const { hidden, size, ...nativeProps } = props;
|
|
1218
1312
|
const { required, disabled } = useFieldContext();
|
|
1219
1313
|
const usage = hidden ? "hidden" : "visible";
|
|
1220
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1221
1315
|
"label",
|
|
1222
1316
|
{
|
|
1223
1317
|
...nativeProps,
|
|
1224
1318
|
...disabled && { "data-disabled": true },
|
|
1225
|
-
className: (0,
|
|
1319
|
+
className: (0, import_css16.cx)(
|
|
1226
1320
|
nativeProps.className,
|
|
1227
|
-
(0,
|
|
1321
|
+
(0, import_recipes13.label)({ size, usage }),
|
|
1228
1322
|
(0, import_patterns7.hstack)({
|
|
1229
1323
|
justify: "space-between",
|
|
1230
1324
|
w: "full"
|
|
@@ -1232,10 +1326,10 @@ function Label(props) {
|
|
|
1232
1326
|
),
|
|
1233
1327
|
children: [
|
|
1234
1328
|
props.children,
|
|
1235
|
-
/* @__PURE__ */ (0,
|
|
1329
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1236
1330
|
"span",
|
|
1237
1331
|
{
|
|
1238
|
-
className: (0,
|
|
1332
|
+
className: (0, import_css16.css)({
|
|
1239
1333
|
color: "page.text.100",
|
|
1240
1334
|
fontSize: "inherit"
|
|
1241
1335
|
}),
|
|
@@ -1248,35 +1342,35 @@ function Label(props) {
|
|
|
1248
1342
|
}
|
|
1249
1343
|
|
|
1250
1344
|
// src/components/Legend.tsx
|
|
1251
|
-
var
|
|
1252
|
-
var
|
|
1345
|
+
var import_css17 = require("@cerberus/styled-system/css");
|
|
1346
|
+
var import_recipes14 = require("@cerberus/styled-system/recipes");
|
|
1253
1347
|
var import_patterns8 = require("@cerberus/styled-system/patterns");
|
|
1254
|
-
var
|
|
1348
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1255
1349
|
function Legend(props) {
|
|
1256
1350
|
const { size, ...nativeProps } = props;
|
|
1257
1351
|
const { invalid, ...formState } = useFieldContext();
|
|
1258
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1259
1353
|
"legend",
|
|
1260
1354
|
{
|
|
1261
1355
|
...nativeProps,
|
|
1262
1356
|
...formState,
|
|
1263
1357
|
...invalid && { "aria-invalid": true },
|
|
1264
|
-
className: (0,
|
|
1358
|
+
className: (0, import_css17.cx)(
|
|
1265
1359
|
nativeProps.className,
|
|
1266
1360
|
(0, import_patterns8.hstack)({
|
|
1267
1361
|
justify: "space-between",
|
|
1268
1362
|
w: "full"
|
|
1269
1363
|
}),
|
|
1270
|
-
(0,
|
|
1364
|
+
(0, import_recipes14.label)({
|
|
1271
1365
|
size
|
|
1272
1366
|
})
|
|
1273
1367
|
),
|
|
1274
1368
|
children: [
|
|
1275
1369
|
nativeProps.children,
|
|
1276
|
-
/* @__PURE__ */ (0,
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Show, { when: formState.required, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1277
1371
|
"span",
|
|
1278
1372
|
{
|
|
1279
|
-
className: (0,
|
|
1373
|
+
className: (0, import_css17.css)({
|
|
1280
1374
|
color: "page.text.100",
|
|
1281
1375
|
fontSize: "inherit"
|
|
1282
1376
|
}),
|
|
@@ -1289,74 +1383,74 @@ function Legend(props) {
|
|
|
1289
1383
|
}
|
|
1290
1384
|
|
|
1291
1385
|
// src/components/Menu.tsx
|
|
1292
|
-
var
|
|
1293
|
-
var
|
|
1294
|
-
var
|
|
1295
|
-
var
|
|
1296
|
-
var menuStyles = (0,
|
|
1297
|
-
var Menu =
|
|
1386
|
+
var import_react7 = require("@ark-ui/react");
|
|
1387
|
+
var import_recipes15 = require("@cerberus/styled-system/recipes");
|
|
1388
|
+
var import_css18 = require("@cerberus/styled-system/css");
|
|
1389
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1390
|
+
var menuStyles = (0, import_recipes15.menu)();
|
|
1391
|
+
var Menu = import_react7.Menu.Root;
|
|
1298
1392
|
function MenuTrigger(props) {
|
|
1299
|
-
return /* @__PURE__ */ (0,
|
|
1393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react7.Menu.Trigger, { ...props, asChild: true });
|
|
1300
1394
|
}
|
|
1301
1395
|
function MenuContent(props) {
|
|
1302
|
-
return /* @__PURE__ */ (0,
|
|
1303
|
-
|
|
1396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react7.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1397
|
+
import_react7.Menu.Content,
|
|
1304
1398
|
{
|
|
1305
1399
|
...props,
|
|
1306
|
-
className: (0,
|
|
1400
|
+
className: (0, import_css18.cx)(props.className, menuStyles.content)
|
|
1307
1401
|
}
|
|
1308
1402
|
) });
|
|
1309
1403
|
}
|
|
1310
1404
|
function MenuItem(props) {
|
|
1311
|
-
return /* @__PURE__ */ (0,
|
|
1405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react7.Menu.Item, { ...props, className: (0, import_css18.cx)(props.className, menuStyles.item) });
|
|
1312
1406
|
}
|
|
1313
|
-
var MenuItemGroup =
|
|
1407
|
+
var MenuItemGroup = import_react7.Menu.ItemGroup;
|
|
1314
1408
|
function MenuGroupLabel(props) {
|
|
1315
|
-
return /* @__PURE__ */ (0,
|
|
1316
|
-
|
|
1409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1410
|
+
import_react7.Menu.ItemGroupLabel,
|
|
1317
1411
|
{
|
|
1318
1412
|
...props,
|
|
1319
|
-
className: (0,
|
|
1413
|
+
className: (0, import_css18.cx)(props.className, menuStyles.itemGroupLabel)
|
|
1320
1414
|
}
|
|
1321
1415
|
);
|
|
1322
1416
|
}
|
|
1323
1417
|
function MenuSeparator(props) {
|
|
1324
|
-
return /* @__PURE__ */ (0,
|
|
1325
|
-
|
|
1418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1419
|
+
import_react7.Menu.Separator,
|
|
1326
1420
|
{
|
|
1327
1421
|
...props,
|
|
1328
|
-
className: (0,
|
|
1422
|
+
className: (0, import_css18.cx)(props.className, menuStyles.separator)
|
|
1329
1423
|
}
|
|
1330
1424
|
);
|
|
1331
1425
|
}
|
|
1332
1426
|
|
|
1333
1427
|
// src/components/Modal.tsx
|
|
1334
|
-
var
|
|
1335
|
-
var
|
|
1336
|
-
var
|
|
1337
|
-
var
|
|
1428
|
+
var import_css19 = require("@cerberus/styled-system/css");
|
|
1429
|
+
var import_recipes16 = require("@cerberus/styled-system/recipes");
|
|
1430
|
+
var import_react8 = require("react");
|
|
1431
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1338
1432
|
function ModalEl(props, ref) {
|
|
1339
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1340
1434
|
"dialog",
|
|
1341
1435
|
{
|
|
1342
1436
|
...props,
|
|
1343
|
-
className: (0,
|
|
1437
|
+
className: (0, import_css19.cx)(props.className, (0, import_recipes16.modal)().dialog),
|
|
1344
1438
|
ref
|
|
1345
1439
|
}
|
|
1346
1440
|
);
|
|
1347
1441
|
}
|
|
1348
|
-
var Modal = (0,
|
|
1442
|
+
var Modal = (0, import_react8.forwardRef)(ModalEl);
|
|
1349
1443
|
|
|
1350
1444
|
// src/components/ModalHeader.tsx
|
|
1351
|
-
var
|
|
1445
|
+
var import_css20 = require("@cerberus/styled-system/css");
|
|
1352
1446
|
var import_patterns9 = require("@cerberus/styled-system/patterns");
|
|
1353
|
-
var
|
|
1447
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1354
1448
|
function ModalHeader(props) {
|
|
1355
|
-
return /* @__PURE__ */ (0,
|
|
1449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1356
1450
|
"div",
|
|
1357
1451
|
{
|
|
1358
1452
|
...props,
|
|
1359
|
-
className: (0,
|
|
1453
|
+
className: (0, import_css20.cx)(
|
|
1360
1454
|
props.className,
|
|
1361
1455
|
(0, import_patterns9.vstack)({
|
|
1362
1456
|
alignItems: "flex-start",
|
|
@@ -1369,25 +1463,25 @@ function ModalHeader(props) {
|
|
|
1369
1463
|
}
|
|
1370
1464
|
|
|
1371
1465
|
// src/components/ModalHeading.tsx
|
|
1372
|
-
var
|
|
1373
|
-
var
|
|
1374
|
-
var
|
|
1466
|
+
var import_css21 = require("@cerberus/styled-system/css");
|
|
1467
|
+
var import_recipes17 = require("@cerberus/styled-system/recipes");
|
|
1468
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1375
1469
|
function ModalHeading(props) {
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { ...props, className: (0, import_css21.cx)(props.className, (0, import_recipes17.modal)().heading) });
|
|
1377
1471
|
}
|
|
1378
1472
|
|
|
1379
1473
|
// src/components/ModalDescription.tsx
|
|
1380
|
-
var
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1474
|
+
var import_css22 = require("@cerberus/styled-system/css");
|
|
1475
|
+
var import_recipes18 = require("@cerberus/styled-system/recipes");
|
|
1476
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1383
1477
|
function ModalDescription(props) {
|
|
1384
|
-
return /* @__PURE__ */ (0,
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { ...props, className: (0, import_css22.cx)(props.className, (0, import_recipes18.modal)().description) });
|
|
1385
1479
|
}
|
|
1386
1480
|
|
|
1387
1481
|
// src/components/NavMenuTrigger.tsx
|
|
1388
|
-
var
|
|
1389
|
-
var
|
|
1390
|
-
var
|
|
1482
|
+
var import_react10 = require("react");
|
|
1483
|
+
var import_css24 = require("@cerberus/styled-system/css");
|
|
1484
|
+
var import_recipes19 = require("@cerberus/styled-system/recipes");
|
|
1391
1485
|
|
|
1392
1486
|
// src/aria-helpers/nav-menu.aria.ts
|
|
1393
1487
|
function createNavTriggerProps(values) {
|
|
@@ -1398,18 +1492,18 @@ function createNavTriggerProps(values) {
|
|
|
1398
1492
|
}
|
|
1399
1493
|
|
|
1400
1494
|
// src/context/navMenu.tsx
|
|
1401
|
-
var
|
|
1402
|
-
var
|
|
1403
|
-
var
|
|
1404
|
-
var NavMenuContext = (0,
|
|
1495
|
+
var import_css23 = require("@cerberus/styled-system/css");
|
|
1496
|
+
var import_react9 = require("react");
|
|
1497
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1498
|
+
var NavMenuContext = (0, import_react9.createContext)(null);
|
|
1405
1499
|
function NavMenu(props) {
|
|
1406
|
-
const triggerRef = (0,
|
|
1407
|
-
const menuRef = (0,
|
|
1408
|
-
const [expanded, setExpanded] = (0,
|
|
1409
|
-
const handleToggle = (0,
|
|
1500
|
+
const triggerRef = (0, import_react9.useRef)(null);
|
|
1501
|
+
const menuRef = (0, import_react9.useRef)(null);
|
|
1502
|
+
const [expanded, setExpanded] = (0, import_react9.useState)(false);
|
|
1503
|
+
const handleToggle = (0, import_react9.useCallback)(() => {
|
|
1410
1504
|
setExpanded((prev) => !prev);
|
|
1411
1505
|
}, []);
|
|
1412
|
-
const value = (0,
|
|
1506
|
+
const value = (0, import_react9.useMemo)(
|
|
1413
1507
|
() => ({
|
|
1414
1508
|
triggerRef,
|
|
1415
1509
|
menuRef,
|
|
@@ -1418,10 +1512,10 @@ function NavMenu(props) {
|
|
|
1418
1512
|
}),
|
|
1419
1513
|
[expanded, handleToggle]
|
|
1420
1514
|
);
|
|
1421
|
-
return /* @__PURE__ */ (0,
|
|
1515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(NavMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1422
1516
|
"nav",
|
|
1423
1517
|
{
|
|
1424
|
-
className: (0,
|
|
1518
|
+
className: (0, import_css23.css)({
|
|
1425
1519
|
position: "relative"
|
|
1426
1520
|
}),
|
|
1427
1521
|
children: props.children
|
|
@@ -1429,7 +1523,7 @@ function NavMenu(props) {
|
|
|
1429
1523
|
) });
|
|
1430
1524
|
}
|
|
1431
1525
|
function useNavMenuContext() {
|
|
1432
|
-
const context = (0,
|
|
1526
|
+
const context = (0, import_react9.useContext)(NavMenuContext);
|
|
1433
1527
|
if (!context) {
|
|
1434
1528
|
throw new Error("useNavMenuContext must be used within a NavMenu.");
|
|
1435
1529
|
}
|
|
@@ -1437,7 +1531,7 @@ function useNavMenuContext() {
|
|
|
1437
1531
|
}
|
|
1438
1532
|
|
|
1439
1533
|
// src/components/NavMenuTrigger.tsx
|
|
1440
|
-
var
|
|
1534
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1441
1535
|
function NavMenuTrigger(props) {
|
|
1442
1536
|
const {
|
|
1443
1537
|
as,
|
|
@@ -1456,25 +1550,25 @@ function NavMenuTrigger(props) {
|
|
|
1456
1550
|
});
|
|
1457
1551
|
const hasAs = Boolean(as);
|
|
1458
1552
|
const AsSub = as;
|
|
1459
|
-
const handleClick = (0,
|
|
1553
|
+
const handleClick = (0, import_react10.useCallback)(
|
|
1460
1554
|
(e) => {
|
|
1461
1555
|
if (onClick) return onClick(e);
|
|
1462
1556
|
onToggle();
|
|
1463
1557
|
},
|
|
1464
1558
|
[onClick, onToggle]
|
|
1465
1559
|
);
|
|
1466
|
-
return /* @__PURE__ */ (0,
|
|
1560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1467
1561
|
Show,
|
|
1468
1562
|
{
|
|
1469
1563
|
when: hasAs,
|
|
1470
|
-
fallback: /* @__PURE__ */ (0,
|
|
1564
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1471
1565
|
"button",
|
|
1472
1566
|
{
|
|
1473
1567
|
...nativeProps,
|
|
1474
1568
|
...ariaProps,
|
|
1475
|
-
className: (0,
|
|
1569
|
+
className: (0, import_css24.cx)(
|
|
1476
1570
|
nativeProps.className,
|
|
1477
|
-
(0,
|
|
1571
|
+
(0, import_recipes19.button)({
|
|
1478
1572
|
palette,
|
|
1479
1573
|
usage,
|
|
1480
1574
|
shape
|
|
@@ -1485,7 +1579,7 @@ function NavMenuTrigger(props) {
|
|
|
1485
1579
|
children: props.children
|
|
1486
1580
|
}
|
|
1487
1581
|
),
|
|
1488
|
-
children: hasAs && /* @__PURE__ */ (0,
|
|
1582
|
+
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1489
1583
|
AsSub,
|
|
1490
1584
|
{
|
|
1491
1585
|
...nativeProps,
|
|
@@ -1499,10 +1593,10 @@ function NavMenuTrigger(props) {
|
|
|
1499
1593
|
}
|
|
1500
1594
|
|
|
1501
1595
|
// src/components/NavMenuList.tsx
|
|
1502
|
-
var
|
|
1503
|
-
var
|
|
1596
|
+
var import_react11 = require("react");
|
|
1597
|
+
var import_css25 = require("@cerberus/styled-system/css");
|
|
1504
1598
|
var import_patterns10 = require("@cerberus/styled-system/patterns");
|
|
1505
|
-
var
|
|
1599
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1506
1600
|
function getPosition(position) {
|
|
1507
1601
|
const defaultPositions = {
|
|
1508
1602
|
left: "auto",
|
|
@@ -1556,16 +1650,16 @@ var navListStyles = (0, import_patterns10.vstack)({
|
|
|
1556
1650
|
function NavMenuList(props) {
|
|
1557
1651
|
const { position, ...nativeProps } = props;
|
|
1558
1652
|
const { menuRef, expanded } = useNavMenuContext();
|
|
1559
|
-
const locationStyles = (0,
|
|
1653
|
+
const locationStyles = (0, import_react11.useMemo)(
|
|
1560
1654
|
() => getPosition(position ?? "bottom"),
|
|
1561
1655
|
[position]
|
|
1562
1656
|
);
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Show, { when: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1564
1658
|
"ul",
|
|
1565
1659
|
{
|
|
1566
1660
|
...nativeProps,
|
|
1567
1661
|
"data-position": position ?? "bottom",
|
|
1568
|
-
className: (0,
|
|
1662
|
+
className: (0, import_css25.cx)(nativeProps.className, navListStyles),
|
|
1569
1663
|
ref: menuRef,
|
|
1570
1664
|
style: locationStyles
|
|
1571
1665
|
}
|
|
@@ -1573,29 +1667,29 @@ function NavMenuList(props) {
|
|
|
1573
1667
|
}
|
|
1574
1668
|
|
|
1575
1669
|
// src/components/NavMenuLink.tsx
|
|
1576
|
-
var
|
|
1577
|
-
var
|
|
1670
|
+
var import_css26 = require("@cerberus/styled-system/css");
|
|
1671
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1578
1672
|
function NavMenuLink(props) {
|
|
1579
1673
|
const { as, ...nativeProps } = props;
|
|
1580
1674
|
const hasAs = Boolean(as);
|
|
1581
1675
|
const AsSub = as;
|
|
1582
|
-
return /* @__PURE__ */ (0,
|
|
1676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1583
1677
|
"li",
|
|
1584
1678
|
{
|
|
1585
|
-
className: (0,
|
|
1679
|
+
className: (0, import_css26.css)({
|
|
1586
1680
|
w: "full"
|
|
1587
1681
|
}),
|
|
1588
|
-
children: /* @__PURE__ */ (0,
|
|
1682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1589
1683
|
Show,
|
|
1590
1684
|
{
|
|
1591
1685
|
when: hasAs,
|
|
1592
|
-
fallback: /* @__PURE__ */ (0,
|
|
1686
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1593
1687
|
"a",
|
|
1594
1688
|
{
|
|
1595
1689
|
...nativeProps,
|
|
1596
|
-
className: (0,
|
|
1690
|
+
className: (0, import_css26.cx)(
|
|
1597
1691
|
nativeProps.className,
|
|
1598
|
-
(0,
|
|
1692
|
+
(0, import_css26.css)({
|
|
1599
1693
|
color: "action.navigation.initial",
|
|
1600
1694
|
textStyle: "link",
|
|
1601
1695
|
_hover: {
|
|
@@ -1605,7 +1699,7 @@ function NavMenuLink(props) {
|
|
|
1605
1699
|
)
|
|
1606
1700
|
}
|
|
1607
1701
|
),
|
|
1608
|
-
children: hasAs && /* @__PURE__ */ (0,
|
|
1702
|
+
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AsSub, { ...nativeProps })
|
|
1609
1703
|
}
|
|
1610
1704
|
)
|
|
1611
1705
|
}
|
|
@@ -1613,10 +1707,10 @@ function NavMenuLink(props) {
|
|
|
1613
1707
|
}
|
|
1614
1708
|
|
|
1615
1709
|
// src/components/Notification.tsx
|
|
1616
|
-
var
|
|
1710
|
+
var import_css27 = require("@cerberus/styled-system/css");
|
|
1617
1711
|
var import_patterns11 = require("@cerberus/styled-system/patterns");
|
|
1618
|
-
var
|
|
1619
|
-
var
|
|
1712
|
+
var import_recipes20 = require("@cerberus/styled-system/recipes");
|
|
1713
|
+
var import_react12 = require("react");
|
|
1620
1714
|
|
|
1621
1715
|
// src/aria-helpers/trap-focus.aria.ts
|
|
1622
1716
|
function trapFocus(modalRef) {
|
|
@@ -1645,24 +1739,24 @@ function trapFocus(modalRef) {
|
|
|
1645
1739
|
}
|
|
1646
1740
|
|
|
1647
1741
|
// src/components/Notification.tsx
|
|
1648
|
-
var
|
|
1742
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1649
1743
|
function MatchNotificationIcon(props) {
|
|
1650
1744
|
const palette = props.palette || "info";
|
|
1651
1745
|
const key = `${palette}Notification`;
|
|
1652
1746
|
const Icon = $cerberusIcons[key];
|
|
1653
|
-
return /* @__PURE__ */ (0,
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, {});
|
|
1654
1748
|
}
|
|
1655
1749
|
function Notification(props) {
|
|
1656
1750
|
const { children, palette, onClose, ...nativeProps } = props;
|
|
1657
|
-
const ref = (0,
|
|
1751
|
+
const ref = (0, import_react12.useRef)(null);
|
|
1658
1752
|
const onKeyDown = trapFocus(ref);
|
|
1659
|
-
const styles = (0,
|
|
1753
|
+
const styles = (0, import_recipes20.notification)({ palette });
|
|
1660
1754
|
const { close: CloseIcon } = $cerberusIcons;
|
|
1661
|
-
return /* @__PURE__ */ (0,
|
|
1755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1662
1756
|
"dialog",
|
|
1663
1757
|
{
|
|
1664
1758
|
...nativeProps,
|
|
1665
|
-
className: (0,
|
|
1759
|
+
className: (0, import_css27.cx)(
|
|
1666
1760
|
nativeProps.className,
|
|
1667
1761
|
(0, import_patterns11.hstack)({
|
|
1668
1762
|
position: "relative",
|
|
@@ -1673,8 +1767,8 @@ function Notification(props) {
|
|
|
1673
1767
|
onKeyDown,
|
|
1674
1768
|
ref,
|
|
1675
1769
|
children: [
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1770
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MatchNotificationIcon, { palette }) }),
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1678
1772
|
"div",
|
|
1679
1773
|
{
|
|
1680
1774
|
className: (0, import_patterns11.vstack)({
|
|
@@ -1685,14 +1779,14 @@ function Notification(props) {
|
|
|
1685
1779
|
children
|
|
1686
1780
|
}
|
|
1687
1781
|
),
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1782
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1689
1783
|
"button",
|
|
1690
1784
|
{
|
|
1691
1785
|
"aria-label": "Close",
|
|
1692
1786
|
className: styles.close,
|
|
1693
1787
|
onClick: onClose,
|
|
1694
1788
|
value: props.id,
|
|
1695
|
-
children: /* @__PURE__ */ (0,
|
|
1789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CloseIcon, {})
|
|
1696
1790
|
}
|
|
1697
1791
|
)
|
|
1698
1792
|
]
|
|
@@ -1701,48 +1795,48 @@ function Notification(props) {
|
|
|
1701
1795
|
}
|
|
1702
1796
|
|
|
1703
1797
|
// src/components/NotificationHeading.tsx
|
|
1704
|
-
var
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
1798
|
+
var import_css28 = require("@cerberus/styled-system/css");
|
|
1799
|
+
var import_recipes21 = require("@cerberus/styled-system/recipes");
|
|
1800
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1707
1801
|
function NotificationHeading(props) {
|
|
1708
1802
|
const { palette, ...nativeProps } = props;
|
|
1709
|
-
const styles = (0,
|
|
1710
|
-
return /* @__PURE__ */ (0,
|
|
1803
|
+
const styles = (0, import_recipes21.notification)({ palette });
|
|
1804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: (0, import_css28.cx)(nativeProps.className, styles.heading), ...nativeProps });
|
|
1711
1805
|
}
|
|
1712
1806
|
|
|
1713
1807
|
// src/components/NotificationDescription.tsx
|
|
1714
|
-
var
|
|
1715
|
-
var
|
|
1716
|
-
var
|
|
1808
|
+
var import_css29 = require("@cerberus/styled-system/css");
|
|
1809
|
+
var import_recipes22 = require("@cerberus/styled-system/recipes");
|
|
1810
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1717
1811
|
function NotificationDescription(props) {
|
|
1718
1812
|
const { palette, ...nativeProps } = props;
|
|
1719
|
-
const styles = (0,
|
|
1720
|
-
return /* @__PURE__ */ (0,
|
|
1813
|
+
const styles = (0, import_recipes22.notification)({ palette });
|
|
1814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1721
1815
|
"p",
|
|
1722
1816
|
{
|
|
1723
|
-
className: (0,
|
|
1817
|
+
className: (0, import_css29.cx)(nativeProps.className, styles.description),
|
|
1724
1818
|
...nativeProps
|
|
1725
1819
|
}
|
|
1726
1820
|
);
|
|
1727
1821
|
}
|
|
1728
1822
|
|
|
1729
1823
|
// src/components/Portal.tsx
|
|
1730
|
-
var
|
|
1731
|
-
var Portal =
|
|
1824
|
+
var import_react13 = require("@ark-ui/react");
|
|
1825
|
+
var Portal = import_react13.Portal;
|
|
1732
1826
|
|
|
1733
1827
|
// src/components/Radio.tsx
|
|
1734
|
-
var
|
|
1828
|
+
var import_css30 = require("@cerberus/styled-system/css");
|
|
1735
1829
|
var import_patterns12 = require("@cerberus/styled-system/patterns");
|
|
1736
|
-
var
|
|
1737
|
-
var
|
|
1830
|
+
var import_recipes23 = require("@cerberus/styled-system/recipes");
|
|
1831
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1738
1832
|
function Radio(props) {
|
|
1739
1833
|
const { children, size, ...nativeProps } = props;
|
|
1740
1834
|
const { invalid, ...state } = useFieldContext();
|
|
1741
|
-
const styles = (0,
|
|
1742
|
-
return /* @__PURE__ */ (0,
|
|
1835
|
+
const styles = (0, import_recipes23.radio)({ size });
|
|
1836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
1743
1837
|
"div",
|
|
1744
1838
|
{
|
|
1745
|
-
className: (0,
|
|
1839
|
+
className: (0, import_css30.cx)(
|
|
1746
1840
|
"group",
|
|
1747
1841
|
(0, import_patterns12.hstack)({
|
|
1748
1842
|
gap: "sm"
|
|
@@ -1751,13 +1845,13 @@ function Radio(props) {
|
|
|
1751
1845
|
),
|
|
1752
1846
|
tabIndex: 0,
|
|
1753
1847
|
children: [
|
|
1754
|
-
/* @__PURE__ */ (0,
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1755
1849
|
"input",
|
|
1756
1850
|
{
|
|
1757
1851
|
...nativeProps,
|
|
1758
1852
|
...state,
|
|
1759
1853
|
...invalid && { "aria-invalid": true },
|
|
1760
|
-
className: (0,
|
|
1854
|
+
className: (0, import_css30.cx)(nativeProps.className, styles.input),
|
|
1761
1855
|
tabIndex: -1,
|
|
1762
1856
|
type: "radio"
|
|
1763
1857
|
}
|
|
@@ -1769,19 +1863,19 @@ function Radio(props) {
|
|
|
1769
1863
|
}
|
|
1770
1864
|
|
|
1771
1865
|
// src/components/Select.tsx
|
|
1772
|
-
var
|
|
1866
|
+
var import_css31 = require("@cerberus/styled-system/css");
|
|
1773
1867
|
var import_patterns13 = require("@cerberus/styled-system/patterns");
|
|
1774
|
-
var
|
|
1775
|
-
var
|
|
1868
|
+
var import_recipes24 = require("@cerberus/styled-system/recipes");
|
|
1869
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1776
1870
|
function Select(props) {
|
|
1777
1871
|
const { describedBy, size, ...nativeProps } = props;
|
|
1778
1872
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
1779
1873
|
const { invalid: InvalidIcon, selectArrow: SelectArrow } = $cerberusIcons;
|
|
1780
|
-
const styles = (0,
|
|
1874
|
+
const styles = (0, import_recipes24.select)({
|
|
1781
1875
|
size
|
|
1782
1876
|
});
|
|
1783
|
-
return /* @__PURE__ */ (0,
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: styles.root, children: [
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1785
1879
|
"select",
|
|
1786
1880
|
{
|
|
1787
1881
|
...nativeProps,
|
|
@@ -1791,38 +1885,38 @@ function Select(props) {
|
|
|
1791
1885
|
className: styles.input
|
|
1792
1886
|
}
|
|
1793
1887
|
),
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1795
1889
|
"span",
|
|
1796
1890
|
{
|
|
1797
|
-
className: (0,
|
|
1891
|
+
className: (0, import_css31.cx)(
|
|
1798
1892
|
styles.iconStack,
|
|
1799
1893
|
(0, import_patterns13.hstack)({
|
|
1800
1894
|
gap: "2"
|
|
1801
1895
|
})
|
|
1802
1896
|
),
|
|
1803
1897
|
children: [
|
|
1804
|
-
/* @__PURE__ */ (0,
|
|
1898
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1805
1899
|
"span",
|
|
1806
1900
|
{
|
|
1807
1901
|
...invalid && { "data-invalid": true },
|
|
1808
1902
|
className: styles.stateIcon,
|
|
1809
|
-
children: /* @__PURE__ */ (0,
|
|
1903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(InvalidIcon, {})
|
|
1810
1904
|
}
|
|
1811
1905
|
) }),
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1906
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: styles.arrowIcon, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectArrow, {}) })
|
|
1813
1907
|
]
|
|
1814
1908
|
}
|
|
1815
1909
|
)
|
|
1816
1910
|
] });
|
|
1817
1911
|
}
|
|
1818
1912
|
function Option(props) {
|
|
1819
|
-
return /* @__PURE__ */ (0,
|
|
1913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("option", { ...props });
|
|
1820
1914
|
}
|
|
1821
1915
|
|
|
1822
1916
|
// src/components/Spinner.tsx
|
|
1823
|
-
var
|
|
1917
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1824
1918
|
function Spinner(props) {
|
|
1825
|
-
return /* @__PURE__ */ (0,
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1826
1920
|
"svg",
|
|
1827
1921
|
{
|
|
1828
1922
|
"aria-busy": "true",
|
|
@@ -1832,7 +1926,7 @@ function Spinner(props) {
|
|
|
1832
1926
|
width: props.size,
|
|
1833
1927
|
viewBox: "0 0 24 24",
|
|
1834
1928
|
...props,
|
|
1835
|
-
children: /* @__PURE__ */ (0,
|
|
1929
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
1836
1930
|
"g",
|
|
1837
1931
|
{
|
|
1838
1932
|
fill: "none",
|
|
@@ -1841,14 +1935,14 @@ function Spinner(props) {
|
|
|
1841
1935
|
strokeLinejoin: "round",
|
|
1842
1936
|
strokeWidth: 2,
|
|
1843
1937
|
children: [
|
|
1844
|
-
/* @__PURE__ */ (0,
|
|
1938
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
1845
1939
|
"path",
|
|
1846
1940
|
{
|
|
1847
1941
|
strokeDasharray: 16,
|
|
1848
1942
|
strokeDashoffset: 16,
|
|
1849
1943
|
d: "M12 3c4.97 0 9 4.03 9 9",
|
|
1850
1944
|
children: [
|
|
1851
|
-
/* @__PURE__ */ (0,
|
|
1945
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1852
1946
|
"animate",
|
|
1853
1947
|
{
|
|
1854
1948
|
fill: "freeze",
|
|
@@ -1857,7 +1951,7 @@ function Spinner(props) {
|
|
|
1857
1951
|
values: "16;0"
|
|
1858
1952
|
}
|
|
1859
1953
|
),
|
|
1860
|
-
/* @__PURE__ */ (0,
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1861
1955
|
"animateTransform",
|
|
1862
1956
|
{
|
|
1863
1957
|
attributeName: "transform",
|
|
@@ -1870,14 +1964,14 @@ function Spinner(props) {
|
|
|
1870
1964
|
]
|
|
1871
1965
|
}
|
|
1872
1966
|
),
|
|
1873
|
-
/* @__PURE__ */ (0,
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1874
1968
|
"path",
|
|
1875
1969
|
{
|
|
1876
1970
|
strokeDasharray: 64,
|
|
1877
1971
|
strokeDashoffset: 64,
|
|
1878
1972
|
strokeOpacity: 0.3,
|
|
1879
1973
|
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",
|
|
1880
|
-
children: /* @__PURE__ */ (0,
|
|
1974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1881
1975
|
"animate",
|
|
1882
1976
|
{
|
|
1883
1977
|
fill: "freeze",
|
|
@@ -1896,31 +1990,31 @@ function Spinner(props) {
|
|
|
1896
1990
|
}
|
|
1897
1991
|
|
|
1898
1992
|
// src/components/Tab.tsx
|
|
1899
|
-
var
|
|
1993
|
+
var import_react16 = require("react");
|
|
1900
1994
|
|
|
1901
1995
|
// src/context/tabs.tsx
|
|
1902
|
-
var
|
|
1903
|
-
var
|
|
1904
|
-
var
|
|
1905
|
-
var TabsContext = (0,
|
|
1996
|
+
var import_recipes25 = require("@cerberus/styled-system/recipes");
|
|
1997
|
+
var import_react14 = require("react");
|
|
1998
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1999
|
+
var TabsContext = (0, import_react14.createContext)(null);
|
|
1906
2000
|
function Tabs(props) {
|
|
1907
2001
|
const { cache, active, id, palette } = props;
|
|
1908
|
-
const [activeTab, setActiveTab] = (0,
|
|
1909
|
-
const tabsList = (0,
|
|
1910
|
-
const uuid = (0,
|
|
2002
|
+
const [activeTab, setActiveTab] = (0, import_react14.useState)(() => cache ? "" : active ?? "");
|
|
2003
|
+
const tabsList = (0, import_react14.useRef)([]);
|
|
2004
|
+
const uuid = (0, import_react14.useMemo)(() => {
|
|
1911
2005
|
return id ? `cerberus-tabs-${id}` : "cerberus-tabs";
|
|
1912
2006
|
}, [id]);
|
|
1913
|
-
const value = (0,
|
|
2007
|
+
const value = (0, import_react14.useMemo)(
|
|
1914
2008
|
() => ({
|
|
1915
2009
|
tabs: tabsList,
|
|
1916
2010
|
id: uuid,
|
|
1917
2011
|
active: activeTab,
|
|
1918
|
-
styles: (0,
|
|
2012
|
+
styles: (0, import_recipes25.tabs)({ palette }),
|
|
1919
2013
|
onTabUpdate: setActiveTab
|
|
1920
2014
|
}),
|
|
1921
2015
|
[activeTab, setActiveTab, palette, uuid, tabsList]
|
|
1922
2016
|
);
|
|
1923
|
-
(0,
|
|
2017
|
+
(0, import_react14.useEffect)(() => {
|
|
1924
2018
|
if (cache) {
|
|
1925
2019
|
const cachedTab = window.localStorage.getItem(uuid);
|
|
1926
2020
|
setActiveTab(
|
|
@@ -1928,15 +2022,15 @@ function Tabs(props) {
|
|
|
1928
2022
|
);
|
|
1929
2023
|
}
|
|
1930
2024
|
}, [cache, active, uuid]);
|
|
1931
|
-
(0,
|
|
2025
|
+
(0, import_react14.useEffect)(() => {
|
|
1932
2026
|
if (cache && activeTab) {
|
|
1933
2027
|
window.localStorage.setItem(uuid, activeTab);
|
|
1934
2028
|
}
|
|
1935
2029
|
}, [activeTab, cache]);
|
|
1936
|
-
return /* @__PURE__ */ (0,
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabsContext.Provider, { value, children: props.children });
|
|
1937
2031
|
}
|
|
1938
2032
|
function useTabsContext() {
|
|
1939
|
-
const context = (0,
|
|
2033
|
+
const context = (0, import_react14.useContext)(TabsContext);
|
|
1940
2034
|
if (!context) {
|
|
1941
2035
|
throw new Error("useTabsContext must be used within a Tabs Provider.");
|
|
1942
2036
|
}
|
|
@@ -1944,10 +2038,10 @@ function useTabsContext() {
|
|
|
1944
2038
|
}
|
|
1945
2039
|
|
|
1946
2040
|
// src/components/Tab.tsx
|
|
1947
|
-
var
|
|
2041
|
+
var import_css32 = require("@cerberus/styled-system/css");
|
|
1948
2042
|
|
|
1949
2043
|
// src/aria-helpers/tabs.aria.ts
|
|
1950
|
-
var
|
|
2044
|
+
var import_react15 = require("react");
|
|
1951
2045
|
function getNextIndex(index, length) {
|
|
1952
2046
|
return index === length - 1 ? 0 : index + 1;
|
|
1953
2047
|
}
|
|
@@ -1956,8 +2050,8 @@ function getPrevIndex(index, length) {
|
|
|
1956
2050
|
}
|
|
1957
2051
|
function useTabsKeyboardNavigation() {
|
|
1958
2052
|
const { tabs: tabs2 } = useTabsContext();
|
|
1959
|
-
const [activeTab, setActiveTab] = (0,
|
|
1960
|
-
(0,
|
|
2053
|
+
const [activeTab, setActiveTab] = (0, import_react15.useState)(-1);
|
|
2054
|
+
(0, import_react15.useEffect)(() => {
|
|
1961
2055
|
const handleKeyDown = (event) => {
|
|
1962
2056
|
const index = activeTab === -1 ? tabs2.current.findIndex((tab) => tab.ariaSelected === "true") : activeTab;
|
|
1963
2057
|
const nextIndex = getNextIndex(index, tabs2.current.length);
|
|
@@ -2003,19 +2097,19 @@ function useTabsKeyboardNavigation() {
|
|
|
2003
2097
|
}
|
|
2004
2098
|
|
|
2005
2099
|
// src/components/Tab.tsx
|
|
2006
|
-
var
|
|
2100
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2007
2101
|
function Tab(props) {
|
|
2008
2102
|
const { value, ...nativeProps } = props;
|
|
2009
2103
|
const { active, onTabUpdate, styles } = useTabsContext();
|
|
2010
|
-
const [isPending, startTransition] = (0,
|
|
2104
|
+
const [isPending, startTransition] = (0, import_react16.useTransition)();
|
|
2011
2105
|
const { ref } = useTabsKeyboardNavigation();
|
|
2012
|
-
const isActive = (0,
|
|
2106
|
+
const isActive = (0, import_react16.useMemo)(() => active === value, [active, value]);
|
|
2013
2107
|
function handleClick(e) {
|
|
2014
2108
|
var _a;
|
|
2015
2109
|
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
2016
2110
|
startTransition(() => onTabUpdate(e.currentTarget.value));
|
|
2017
2111
|
}
|
|
2018
|
-
return /* @__PURE__ */ (0,
|
|
2112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2019
2113
|
"button",
|
|
2020
2114
|
{
|
|
2021
2115
|
...nativeProps,
|
|
@@ -2024,7 +2118,7 @@ function Tab(props) {
|
|
|
2024
2118
|
"aria-busy": isPending,
|
|
2025
2119
|
"aria-selected": isActive,
|
|
2026
2120
|
id: `tab:${value}`,
|
|
2027
|
-
className: (0,
|
|
2121
|
+
className: (0, import_css32.cx)(nativeProps.className, styles.tab),
|
|
2028
2122
|
onClick: handleClick,
|
|
2029
2123
|
role: "tab",
|
|
2030
2124
|
ref,
|
|
@@ -2034,18 +2128,18 @@ function Tab(props) {
|
|
|
2034
2128
|
}
|
|
2035
2129
|
|
|
2036
2130
|
// src/components/TabList.tsx
|
|
2037
|
-
var
|
|
2131
|
+
var import_css33 = require("@cerberus/styled-system/css");
|
|
2038
2132
|
var import_patterns14 = require("@cerberus/styled-system/patterns");
|
|
2039
|
-
var
|
|
2133
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2040
2134
|
function TabList(props) {
|
|
2041
2135
|
const { description, ...nativeProps } = props;
|
|
2042
2136
|
const { id, styles } = useTabsContext();
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
2137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2044
2138
|
"div",
|
|
2045
2139
|
{
|
|
2046
2140
|
...nativeProps,
|
|
2047
2141
|
"aria-label": description,
|
|
2048
|
-
className: (0,
|
|
2142
|
+
className: (0, import_css33.cx)(
|
|
2049
2143
|
nativeProps.className,
|
|
2050
2144
|
(0, import_patterns14.hstack)({
|
|
2051
2145
|
gap: "0"
|
|
@@ -2059,20 +2153,20 @@ function TabList(props) {
|
|
|
2059
2153
|
}
|
|
2060
2154
|
|
|
2061
2155
|
// src/components/TabPanel.tsx
|
|
2062
|
-
var
|
|
2063
|
-
var
|
|
2064
|
-
var
|
|
2156
|
+
var import_css34 = require("@cerberus/styled-system/css");
|
|
2157
|
+
var import_react17 = require("react");
|
|
2158
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2065
2159
|
function TabPanel(props) {
|
|
2066
2160
|
const { tab, ...nativeProps } = props;
|
|
2067
2161
|
const { active, styles } = useTabsContext();
|
|
2068
|
-
const isActive = (0,
|
|
2069
|
-
return /* @__PURE__ */ (0,
|
|
2162
|
+
const isActive = (0, import_react17.useMemo)(() => active === tab, [active, tab]);
|
|
2163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Show, { when: isActive, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2070
2164
|
"div",
|
|
2071
2165
|
{
|
|
2072
2166
|
...nativeProps,
|
|
2073
2167
|
...isActive && { tabIndex: 0 },
|
|
2074
2168
|
"aria-labelledby": `tab:${tab}`,
|
|
2075
|
-
className: (0,
|
|
2169
|
+
className: (0, import_css34.cx)(nativeProps.className, styles.tabPanel),
|
|
2076
2170
|
id: `panel:${tab}`,
|
|
2077
2171
|
role: "tabpanel"
|
|
2078
2172
|
}
|
|
@@ -2080,60 +2174,60 @@ function TabPanel(props) {
|
|
|
2080
2174
|
}
|
|
2081
2175
|
|
|
2082
2176
|
// src/components/Table.tsx
|
|
2083
|
-
var
|
|
2084
|
-
var
|
|
2085
|
-
var
|
|
2177
|
+
var import_css35 = require("@cerberus/styled-system/css");
|
|
2178
|
+
var import_recipes26 = require("@cerberus/styled-system/recipes");
|
|
2179
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2086
2180
|
function Table(props) {
|
|
2087
2181
|
const { caption, children, ...nativeProps } = props;
|
|
2088
|
-
const styles = (0,
|
|
2089
|
-
return /* @__PURE__ */ (0,
|
|
2182
|
+
const styles = (0, import_recipes26.table)();
|
|
2183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2090
2184
|
"table",
|
|
2091
2185
|
{
|
|
2092
2186
|
...nativeProps,
|
|
2093
|
-
className: (0,
|
|
2187
|
+
className: (0, import_css35.cx)(nativeProps.className, styles.table),
|
|
2094
2188
|
children: [
|
|
2095
|
-
/* @__PURE__ */ (0,
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("caption", { className: styles.caption, children: caption }),
|
|
2096
2190
|
children
|
|
2097
2191
|
]
|
|
2098
2192
|
}
|
|
2099
2193
|
) });
|
|
2100
2194
|
}
|
|
2101
2195
|
function Tr(props) {
|
|
2102
|
-
return /* @__PURE__ */ (0,
|
|
2196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { ...props });
|
|
2103
2197
|
}
|
|
2104
2198
|
|
|
2105
2199
|
// src/components/Thead.tsx
|
|
2106
|
-
var
|
|
2107
|
-
var
|
|
2108
|
-
var
|
|
2200
|
+
var import_css36 = require("@cerberus/styled-system/css");
|
|
2201
|
+
var import_recipes27 = require("@cerberus/styled-system/recipes");
|
|
2202
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2109
2203
|
function Thead(props) {
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("thead", { ...props, className: (0, import_css36.cx)(props.className, (0, import_recipes27.thead)()) });
|
|
2111
2205
|
}
|
|
2112
2206
|
|
|
2113
2207
|
// src/components/Th.tsx
|
|
2114
|
-
var
|
|
2115
|
-
var
|
|
2116
|
-
var
|
|
2208
|
+
var import_css37 = require("@cerberus/styled-system/css");
|
|
2209
|
+
var import_recipes28 = require("@cerberus/styled-system/recipes");
|
|
2210
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2117
2211
|
function Th(props) {
|
|
2118
2212
|
const { size, onClick, ...nativeProps } = props;
|
|
2119
|
-
return /* @__PURE__ */ (0,
|
|
2213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2120
2214
|
Show,
|
|
2121
2215
|
{
|
|
2122
2216
|
when: Boolean(onClick),
|
|
2123
|
-
fallback: /* @__PURE__ */ (0,
|
|
2217
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2124
2218
|
"th",
|
|
2125
2219
|
{
|
|
2126
2220
|
...nativeProps,
|
|
2127
|
-
className: (0,
|
|
2221
|
+
className: (0, import_css37.cx)(nativeProps.className, (0, import_recipes28.th)({ size }))
|
|
2128
2222
|
}
|
|
2129
2223
|
),
|
|
2130
|
-
children: /* @__PURE__ */ (0,
|
|
2224
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { ...nativeProps, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2131
2225
|
"button",
|
|
2132
2226
|
{
|
|
2133
|
-
className: (0,
|
|
2227
|
+
className: (0, import_css37.cx)(
|
|
2134
2228
|
nativeProps.className,
|
|
2135
|
-
(0,
|
|
2136
|
-
(0,
|
|
2229
|
+
(0, import_recipes28.th)({ size }),
|
|
2230
|
+
(0, import_css37.css)({
|
|
2137
2231
|
alignItems: "center",
|
|
2138
2232
|
display: "inline-flex",
|
|
2139
2233
|
justifyContent: "space-between",
|
|
@@ -2153,18 +2247,18 @@ function Th(props) {
|
|
|
2153
2247
|
}
|
|
2154
2248
|
|
|
2155
2249
|
// src/components/Td.tsx
|
|
2156
|
-
var
|
|
2157
|
-
var
|
|
2158
|
-
var
|
|
2250
|
+
var import_css38 = require("@cerberus/styled-system/css");
|
|
2251
|
+
var import_recipes29 = require("@cerberus/styled-system/recipes");
|
|
2252
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2159
2253
|
function Td(props) {
|
|
2160
2254
|
const { size, ...nativeProps } = props;
|
|
2161
|
-
return /* @__PURE__ */ (0,
|
|
2255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2162
2256
|
"td",
|
|
2163
2257
|
{
|
|
2164
2258
|
...nativeProps,
|
|
2165
|
-
className: (0,
|
|
2259
|
+
className: (0, import_css38.cx)(
|
|
2166
2260
|
nativeProps.className,
|
|
2167
|
-
(0,
|
|
2261
|
+
(0, import_recipes29.td)({
|
|
2168
2262
|
size
|
|
2169
2263
|
})
|
|
2170
2264
|
)
|
|
@@ -2173,18 +2267,18 @@ function Td(props) {
|
|
|
2173
2267
|
}
|
|
2174
2268
|
|
|
2175
2269
|
// src/components/Tbody.tsx
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2178
|
-
var
|
|
2270
|
+
var import_recipes30 = require("@cerberus/styled-system/recipes");
|
|
2271
|
+
var import_css39 = require("@cerberus/styled-system/css");
|
|
2272
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2179
2273
|
function Tbody(props) {
|
|
2180
2274
|
const { decoration, ...nativeProps } = props;
|
|
2181
|
-
return /* @__PURE__ */ (0,
|
|
2275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2182
2276
|
"tbody",
|
|
2183
2277
|
{
|
|
2184
2278
|
...nativeProps,
|
|
2185
|
-
className: (0,
|
|
2279
|
+
className: (0, import_css39.cx)(
|
|
2186
2280
|
nativeProps.className,
|
|
2187
|
-
(0,
|
|
2281
|
+
(0, import_recipes30.tbody)({
|
|
2188
2282
|
decoration
|
|
2189
2283
|
})
|
|
2190
2284
|
)
|
|
@@ -2193,9 +2287,9 @@ function Tbody(props) {
|
|
|
2193
2287
|
}
|
|
2194
2288
|
|
|
2195
2289
|
// src/components/Tag.tsx
|
|
2196
|
-
var
|
|
2197
|
-
var
|
|
2198
|
-
var
|
|
2290
|
+
var import_css40 = require("@cerberus/styled-system/css");
|
|
2291
|
+
var import_recipes31 = require("@cerberus/styled-system/recipes");
|
|
2292
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2199
2293
|
function Tag(props) {
|
|
2200
2294
|
const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props;
|
|
2201
2295
|
const palette = (props == null ? void 0 : props.palette) ?? "page";
|
|
@@ -2203,13 +2297,13 @@ function Tag(props) {
|
|
|
2203
2297
|
const shape = isClosable ? "pill" : initShape;
|
|
2204
2298
|
const closableStyles = isClosable ? closableCss : "";
|
|
2205
2299
|
const { close: Close2 } = $cerberusIcons;
|
|
2206
|
-
return /* @__PURE__ */ (0,
|
|
2300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2207
2301
|
"span",
|
|
2208
2302
|
{
|
|
2209
2303
|
...nativeProps,
|
|
2210
|
-
className: (0,
|
|
2304
|
+
className: (0, import_css40.cx)(
|
|
2211
2305
|
nativeProps.className,
|
|
2212
|
-
(0,
|
|
2306
|
+
(0, import_recipes31.tag)({
|
|
2213
2307
|
gradient,
|
|
2214
2308
|
palette,
|
|
2215
2309
|
shape,
|
|
@@ -2219,47 +2313,47 @@ function Tag(props) {
|
|
|
2219
2313
|
),
|
|
2220
2314
|
children: [
|
|
2221
2315
|
props.children,
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Show, { when: isClosable, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2223
2317
|
"button",
|
|
2224
2318
|
{
|
|
2225
2319
|
"aria-label": "Close",
|
|
2226
|
-
className: (0,
|
|
2320
|
+
className: (0, import_recipes31.iconButton)({
|
|
2227
2321
|
palette: "action",
|
|
2228
2322
|
usage: "filled",
|
|
2229
2323
|
size: "sm"
|
|
2230
2324
|
}),
|
|
2231
2325
|
onClick,
|
|
2232
|
-
children: /* @__PURE__ */ (0,
|
|
2326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Close2, {})
|
|
2233
2327
|
}
|
|
2234
2328
|
) })
|
|
2235
2329
|
]
|
|
2236
2330
|
}
|
|
2237
2331
|
);
|
|
2238
2332
|
}
|
|
2239
|
-
var closableCss = (0,
|
|
2333
|
+
var closableCss = (0, import_css40.css)({
|
|
2240
2334
|
bgColor: "action.bg.active",
|
|
2241
2335
|
color: "action.text.initial",
|
|
2242
2336
|
paddingInlineEnd: "0"
|
|
2243
2337
|
});
|
|
2244
2338
|
|
|
2245
2339
|
// src/components/Textarea.tsx
|
|
2246
|
-
var
|
|
2247
|
-
var
|
|
2248
|
-
var
|
|
2340
|
+
var import_css41 = require("@cerberus/styled-system/css");
|
|
2341
|
+
var import_recipes32 = require("@cerberus/styled-system/recipes");
|
|
2342
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2249
2343
|
function Textarea(props) {
|
|
2250
2344
|
const { describedBy, ...nativeProps } = props;
|
|
2251
2345
|
const { invalid, ...fieldState } = useFieldContext();
|
|
2252
|
-
return /* @__PURE__ */ (0,
|
|
2346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2253
2347
|
"textarea",
|
|
2254
2348
|
{
|
|
2255
2349
|
...nativeProps,
|
|
2256
2350
|
...fieldState,
|
|
2257
2351
|
...describedBy && { "aria-describedby": describedBy },
|
|
2258
2352
|
...invalid && { "aria-invalid": true },
|
|
2259
|
-
className: (0,
|
|
2353
|
+
className: (0, import_css41.cx)(
|
|
2260
2354
|
props.className,
|
|
2261
|
-
(0,
|
|
2262
|
-
(0,
|
|
2355
|
+
(0, import_recipes32.input)().input,
|
|
2356
|
+
(0, import_css41.css)({
|
|
2263
2357
|
pxi: "2",
|
|
2264
2358
|
py: "2",
|
|
2265
2359
|
resize: "vertical"
|
|
@@ -2271,43 +2365,43 @@ function Textarea(props) {
|
|
|
2271
2365
|
}
|
|
2272
2366
|
|
|
2273
2367
|
// src/components/Toggle.tsx
|
|
2274
|
-
var
|
|
2368
|
+
var import_css42 = require("@cerberus/styled-system/css");
|
|
2275
2369
|
var import_patterns15 = require("@cerberus/styled-system/patterns");
|
|
2276
|
-
var
|
|
2277
|
-
var
|
|
2370
|
+
var import_recipes33 = require("@cerberus/styled-system/recipes");
|
|
2371
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2278
2372
|
function Toggle(props) {
|
|
2279
2373
|
const { size, describedBy, ...nativeProps } = props;
|
|
2280
|
-
const styles = (0,
|
|
2374
|
+
const styles = (0, import_recipes33.toggle)({ size });
|
|
2281
2375
|
const { invalid, ...state } = useFieldContext();
|
|
2282
2376
|
const Icon = $cerberusIcons.toggleChecked;
|
|
2283
|
-
return /* @__PURE__ */ (0,
|
|
2377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
2284
2378
|
"span",
|
|
2285
2379
|
{
|
|
2286
|
-
className: (0,
|
|
2380
|
+
className: (0, import_css42.cx)("group", styles.track, (0, import_patterns15.hstack)()),
|
|
2287
2381
|
"data-checked": props.checked || props.defaultChecked,
|
|
2288
2382
|
children: [
|
|
2289
|
-
/* @__PURE__ */ (0,
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2290
2384
|
"input",
|
|
2291
2385
|
{
|
|
2292
2386
|
...nativeProps,
|
|
2293
2387
|
...state,
|
|
2294
2388
|
...describedBy && { "aria-describedby": describedBy },
|
|
2295
2389
|
...invalid && { "aria-invalid": true },
|
|
2296
|
-
className: (0,
|
|
2390
|
+
className: (0, import_css42.cx)("peer", styles.input),
|
|
2297
2391
|
role: "switch",
|
|
2298
2392
|
type: "checkbox"
|
|
2299
2393
|
}
|
|
2300
2394
|
),
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2302
2396
|
"span",
|
|
2303
2397
|
{
|
|
2304
|
-
className: (0,
|
|
2398
|
+
className: (0, import_css42.cx)(
|
|
2305
2399
|
styles.thumb,
|
|
2306
2400
|
(0, import_patterns15.vstack)({
|
|
2307
2401
|
justify: "center"
|
|
2308
2402
|
})
|
|
2309
2403
|
),
|
|
2310
|
-
children: /* @__PURE__ */ (0,
|
|
2404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, {})
|
|
2311
2405
|
}
|
|
2312
2406
|
)
|
|
2313
2407
|
]
|
|
@@ -2317,24 +2411,24 @@ function Toggle(props) {
|
|
|
2317
2411
|
|
|
2318
2412
|
// src/components/Tooltip.tsx
|
|
2319
2413
|
var import_tooltip = require("@ark-ui/react/tooltip");
|
|
2320
|
-
var
|
|
2321
|
-
var
|
|
2322
|
-
var
|
|
2414
|
+
var import_css43 = require("@cerberus/styled-system/css");
|
|
2415
|
+
var import_recipes34 = require("@cerberus/styled-system/recipes");
|
|
2416
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2323
2417
|
function Tooltip(props) {
|
|
2324
|
-
const { content, children, ...nativeProps } = props;
|
|
2325
|
-
const styles = (0,
|
|
2418
|
+
const { content, children, asChild, ...nativeProps } = props;
|
|
2419
|
+
const styles = (0, import_recipes34.tooltip)();
|
|
2326
2420
|
const position = {
|
|
2327
2421
|
placement: props.position || "top"
|
|
2328
2422
|
};
|
|
2329
|
-
return /* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2331
|
-
/* @__PURE__ */ (0,
|
|
2423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_tooltip.Tooltip.Root, { openDelay: 400, positioning: position, children: [
|
|
2424
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_tooltip.Tooltip.Trigger, { className: styles.trigger, asChild, children }),
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_tooltip.Tooltip.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2332
2426
|
import_tooltip.Tooltip.Content,
|
|
2333
2427
|
{
|
|
2334
2428
|
...nativeProps,
|
|
2335
|
-
className: (0,
|
|
2429
|
+
className: (0, import_css43.cx)(nativeProps.className, styles.content),
|
|
2336
2430
|
children: [
|
|
2337
|
-
/* @__PURE__ */ (0,
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_tooltip.Tooltip.Arrow, { className: styles.arrow, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_tooltip.Tooltip.ArrowTip, { className: styles.arrowTip }) }),
|
|
2338
2432
|
content
|
|
2339
2433
|
]
|
|
2340
2434
|
}
|
|
@@ -2343,26 +2437,26 @@ function Tooltip(props) {
|
|
|
2343
2437
|
}
|
|
2344
2438
|
|
|
2345
2439
|
// src/context/confirm-modal.tsx
|
|
2346
|
-
var
|
|
2347
|
-
var
|
|
2440
|
+
var import_react19 = require("react");
|
|
2441
|
+
var import_css44 = require("@cerberus/styled-system/css");
|
|
2348
2442
|
var import_patterns16 = require("@cerberus/styled-system/patterns");
|
|
2349
2443
|
|
|
2350
2444
|
// src/hooks/useModal.ts
|
|
2351
|
-
var
|
|
2445
|
+
var import_react18 = require("react");
|
|
2352
2446
|
function useModal() {
|
|
2353
|
-
const modalRef = (0,
|
|
2354
|
-
const [isOpen, setIsOpen] = (0,
|
|
2355
|
-
const show = (0,
|
|
2447
|
+
const modalRef = (0, import_react18.useRef)(null);
|
|
2448
|
+
const [isOpen, setIsOpen] = (0, import_react18.useState)(false);
|
|
2449
|
+
const show = (0, import_react18.useCallback)(() => {
|
|
2356
2450
|
var _a;
|
|
2357
2451
|
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
2358
2452
|
setIsOpen(true);
|
|
2359
2453
|
}, []);
|
|
2360
|
-
const close = (0,
|
|
2454
|
+
const close = (0, import_react18.useCallback)(() => {
|
|
2361
2455
|
var _a;
|
|
2362
2456
|
(_a = modalRef.current) == null ? void 0 : _a.close();
|
|
2363
2457
|
setIsOpen(false);
|
|
2364
2458
|
}, []);
|
|
2365
|
-
return (0,
|
|
2459
|
+
return (0, import_react18.useMemo)(() => {
|
|
2366
2460
|
return {
|
|
2367
2461
|
modalRef,
|
|
2368
2462
|
show,
|
|
@@ -2374,20 +2468,20 @@ function useModal() {
|
|
|
2374
2468
|
|
|
2375
2469
|
// src/context/confirm-modal.tsx
|
|
2376
2470
|
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
2377
|
-
var
|
|
2378
|
-
var ConfirmModalContext = (0,
|
|
2471
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2472
|
+
var ConfirmModalContext = (0, import_react19.createContext)(null);
|
|
2379
2473
|
function ConfirmModal(props) {
|
|
2380
2474
|
const { modalRef, show, close } = useModal();
|
|
2381
|
-
const resolveRef = (0,
|
|
2382
|
-
const [content, setContent] = (0,
|
|
2475
|
+
const resolveRef = (0, import_react19.useRef)(null);
|
|
2476
|
+
const [content, setContent] = (0, import_react19.useState)(null);
|
|
2383
2477
|
const focusTrap = trapFocus(modalRef);
|
|
2384
2478
|
const ConfirmIcon = $cerberusIcons.confirmModal;
|
|
2385
2479
|
const kind = (content == null ? void 0 : content.kind) ?? "non-destructive";
|
|
2386
|
-
const palette = (0,
|
|
2480
|
+
const palette = (0, import_react19.useMemo)(
|
|
2387
2481
|
() => kind === "destructive" ? "danger" : "action",
|
|
2388
2482
|
[kind]
|
|
2389
2483
|
);
|
|
2390
|
-
const handleChoice = (0,
|
|
2484
|
+
const handleChoice = (0, import_react19.useCallback)(
|
|
2391
2485
|
(e) => {
|
|
2392
2486
|
var _a, _b;
|
|
2393
2487
|
const target = e.currentTarget;
|
|
@@ -2399,7 +2493,7 @@ function ConfirmModal(props) {
|
|
|
2399
2493
|
},
|
|
2400
2494
|
[close]
|
|
2401
2495
|
);
|
|
2402
|
-
const handleShow = (0,
|
|
2496
|
+
const handleShow = (0, import_react19.useCallback)(
|
|
2403
2497
|
(options) => {
|
|
2404
2498
|
return new Promise((resolve) => {
|
|
2405
2499
|
setContent({ ...options });
|
|
@@ -2409,42 +2503,42 @@ function ConfirmModal(props) {
|
|
|
2409
2503
|
},
|
|
2410
2504
|
[show]
|
|
2411
2505
|
);
|
|
2412
|
-
const value = (0,
|
|
2506
|
+
const value = (0, import_react19.useMemo)(
|
|
2413
2507
|
() => ({
|
|
2414
2508
|
show: handleShow
|
|
2415
2509
|
}),
|
|
2416
2510
|
[handleShow]
|
|
2417
2511
|
);
|
|
2418
|
-
return /* @__PURE__ */ (0,
|
|
2512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(ConfirmModalContext.Provider, { value, children: [
|
|
2419
2513
|
props.children,
|
|
2420
|
-
/* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx.VStack, { gap: "xl", w: "full", children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(ModalHeader, { children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2423
2517
|
"div",
|
|
2424
2518
|
{
|
|
2425
2519
|
className: (0, import_patterns16.hstack)({
|
|
2426
2520
|
justify: "center",
|
|
2427
2521
|
w: "full"
|
|
2428
2522
|
}),
|
|
2429
|
-
children: /* @__PURE__ */ (0,
|
|
2523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2430
2524
|
Show,
|
|
2431
2525
|
{
|
|
2432
2526
|
when: palette === "danger",
|
|
2433
|
-
fallback: /* @__PURE__ */ (0,
|
|
2527
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2434
2528
|
Avatar,
|
|
2435
2529
|
{
|
|
2436
2530
|
ariaLabel: "",
|
|
2437
2531
|
gradient: "charon-light",
|
|
2438
|
-
icon: /* @__PURE__ */ (0,
|
|
2532
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ConfirmIcon, { size: 24 }),
|
|
2439
2533
|
src: ""
|
|
2440
2534
|
}
|
|
2441
2535
|
),
|
|
2442
|
-
children: /* @__PURE__ */ (0,
|
|
2536
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2443
2537
|
Avatar,
|
|
2444
2538
|
{
|
|
2445
2539
|
ariaLabel: "",
|
|
2446
2540
|
gradient: "hades-dark",
|
|
2447
|
-
icon: /* @__PURE__ */ (0,
|
|
2541
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ConfirmIcon, { size: 24 }),
|
|
2448
2542
|
src: ""
|
|
2449
2543
|
}
|
|
2450
2544
|
)
|
|
@@ -2452,15 +2546,15 @@ function ConfirmModal(props) {
|
|
|
2452
2546
|
)
|
|
2453
2547
|
}
|
|
2454
2548
|
),
|
|
2455
|
-
/* @__PURE__ */ (0,
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
2457
2551
|
] }),
|
|
2458
|
-
/* @__PURE__ */ (0,
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx.HStack, { gap: "4", w: "full", children: [
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2460
2554
|
Button,
|
|
2461
2555
|
{
|
|
2462
2556
|
autoFocus: true,
|
|
2463
|
-
className: (0,
|
|
2557
|
+
className: (0, import_css44.css)({
|
|
2464
2558
|
w: "1/2"
|
|
2465
2559
|
}),
|
|
2466
2560
|
name: "confirm",
|
|
@@ -2470,10 +2564,10 @@ function ConfirmModal(props) {
|
|
|
2470
2564
|
children: content == null ? void 0 : content.actionText
|
|
2471
2565
|
}
|
|
2472
2566
|
),
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2474
2568
|
Button,
|
|
2475
2569
|
{
|
|
2476
|
-
className: (0,
|
|
2570
|
+
className: (0, import_css44.css)({
|
|
2477
2571
|
w: "1/2"
|
|
2478
2572
|
}),
|
|
2479
2573
|
name: "cancel",
|
|
@@ -2488,7 +2582,7 @@ function ConfirmModal(props) {
|
|
|
2488
2582
|
] });
|
|
2489
2583
|
}
|
|
2490
2584
|
function useConfirmModal() {
|
|
2491
|
-
const context = (0,
|
|
2585
|
+
const context = (0, import_react19.useContext)(ConfirmModalContext);
|
|
2492
2586
|
if (context === null) {
|
|
2493
2587
|
throw new Error(
|
|
2494
2588
|
"useConfirmModal must be used within a ConfirmModal Provider"
|
|
@@ -2498,21 +2592,21 @@ function useConfirmModal() {
|
|
|
2498
2592
|
}
|
|
2499
2593
|
|
|
2500
2594
|
// src/context/cta-modal.tsx
|
|
2501
|
-
var
|
|
2595
|
+
var import_react20 = require("react");
|
|
2502
2596
|
var import_jsx2 = require("@cerberus/styled-system/jsx");
|
|
2503
|
-
var
|
|
2597
|
+
var import_css45 = require("@cerberus/styled-system/css");
|
|
2504
2598
|
var import_jsx3 = require("@cerberus/styled-system/jsx");
|
|
2505
|
-
var
|
|
2506
|
-
var CTAModalContext = (0,
|
|
2599
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2600
|
+
var CTAModalContext = (0, import_react20.createContext)(null);
|
|
2507
2601
|
function CTAModal(props) {
|
|
2508
2602
|
var _a, _b;
|
|
2509
2603
|
const { modalRef, show, close } = useModal();
|
|
2510
|
-
const [content, setContent] = (0,
|
|
2604
|
+
const [content, setContent] = (0, import_react20.useState)(null);
|
|
2511
2605
|
const focusTrap = trapFocus(modalRef);
|
|
2512
2606
|
const FallbackIcon = $cerberusIcons.confirmModal;
|
|
2513
2607
|
const confirmIcon = content == null ? void 0 : content.icon;
|
|
2514
2608
|
const { close: CloseIcon } = $cerberusIcons;
|
|
2515
|
-
const handleShow = (0,
|
|
2609
|
+
const handleShow = (0, import_react20.useCallback)(
|
|
2516
2610
|
(options) => {
|
|
2517
2611
|
const maxActions = 2;
|
|
2518
2612
|
if (options.actions.length > maxActions) {
|
|
@@ -2525,7 +2619,7 @@ function CTAModal(props) {
|
|
|
2525
2619
|
},
|
|
2526
2620
|
[show]
|
|
2527
2621
|
);
|
|
2528
|
-
const handleActionClick = (0,
|
|
2622
|
+
const handleActionClick = (0, import_react20.useCallback)(
|
|
2529
2623
|
(event) => {
|
|
2530
2624
|
const index = event.currentTarget.getAttribute("data-index");
|
|
2531
2625
|
const action = content == null ? void 0 : content.actions[Number(index)];
|
|
@@ -2536,54 +2630,54 @@ function CTAModal(props) {
|
|
|
2536
2630
|
},
|
|
2537
2631
|
[content, close]
|
|
2538
2632
|
);
|
|
2539
|
-
const value = (0,
|
|
2633
|
+
const value = (0, import_react20.useMemo)(
|
|
2540
2634
|
() => ({
|
|
2541
2635
|
show: handleShow
|
|
2542
2636
|
}),
|
|
2543
2637
|
[handleShow]
|
|
2544
2638
|
);
|
|
2545
|
-
return /* @__PURE__ */ (0,
|
|
2639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(CTAModalContext.Provider, { value, children: [
|
|
2546
2640
|
props.children,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2548
|
-
/* @__PURE__ */ (0,
|
|
2641
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2549
2643
|
"span",
|
|
2550
2644
|
{
|
|
2551
|
-
className: (0,
|
|
2645
|
+
className: (0, import_css45.css)({
|
|
2552
2646
|
padding: "md",
|
|
2553
2647
|
position: "absolute",
|
|
2554
2648
|
right: 0,
|
|
2555
2649
|
top: 0,
|
|
2556
2650
|
zIndex: "decorator"
|
|
2557
2651
|
}),
|
|
2558
|
-
children: /* @__PURE__ */ (0,
|
|
2652
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(IconButton, { ariaLabel: "Close modal", onClick: close, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(CloseIcon, {}) })
|
|
2559
2653
|
}
|
|
2560
2654
|
),
|
|
2561
|
-
/* @__PURE__ */ (0,
|
|
2562
|
-
/* @__PURE__ */ (0,
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx3.VStack, { gap: "xl", w: "full", children: [
|
|
2656
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ModalHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx3.VStack, { gap: "lg", w: "full", children: [
|
|
2657
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2564
2658
|
Avatar,
|
|
2565
2659
|
{
|
|
2566
2660
|
ariaLabel: "",
|
|
2567
2661
|
gradient: "charon-light",
|
|
2568
|
-
icon: /* @__PURE__ */ (0,
|
|
2662
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2569
2663
|
Show,
|
|
2570
2664
|
{
|
|
2571
2665
|
when: Boolean(confirmIcon),
|
|
2572
|
-
fallback: /* @__PURE__ */ (0,
|
|
2666
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FallbackIcon, { size: 24 }),
|
|
2573
2667
|
children: confirmIcon
|
|
2574
2668
|
}
|
|
2575
2669
|
),
|
|
2576
2670
|
src: ""
|
|
2577
2671
|
}
|
|
2578
2672
|
),
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
2674
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
2581
2675
|
] }) }),
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2676
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx2.HStack, { gap: "md", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime53.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_runtime53.jsx)(
|
|
2583
2677
|
Button,
|
|
2584
2678
|
{
|
|
2585
2679
|
"data-index": index,
|
|
2586
|
-
className: (0,
|
|
2680
|
+
className: (0, import_css45.css)({
|
|
2587
2681
|
w: "1/2"
|
|
2588
2682
|
}),
|
|
2589
2683
|
onClick: handleActionClick,
|
|
@@ -2598,7 +2692,7 @@ function CTAModal(props) {
|
|
|
2598
2692
|
] });
|
|
2599
2693
|
}
|
|
2600
2694
|
function useCTAModal() {
|
|
2601
|
-
const context = (0,
|
|
2695
|
+
const context = (0, import_react20.useContext)(CTAModalContext);
|
|
2602
2696
|
if (context === null) {
|
|
2603
2697
|
throw new Error("useCTAModal must be used within a CTAModal Provider");
|
|
2604
2698
|
}
|
|
@@ -2606,22 +2700,22 @@ function useCTAModal() {
|
|
|
2606
2700
|
}
|
|
2607
2701
|
|
|
2608
2702
|
// src/context/notification-center.tsx
|
|
2609
|
-
var
|
|
2703
|
+
var import_react21 = require("react");
|
|
2610
2704
|
var import_patterns17 = require("@cerberus/styled-system/patterns");
|
|
2611
|
-
var
|
|
2612
|
-
var
|
|
2613
|
-
var
|
|
2614
|
-
var NotificationsContext = (0,
|
|
2705
|
+
var import_recipes35 = require("@cerberus/styled-system/recipes");
|
|
2706
|
+
var import_css46 = require("@cerberus/styled-system/css");
|
|
2707
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2708
|
+
var NotificationsContext = (0, import_react21.createContext)(null);
|
|
2615
2709
|
function NotificationCenter(props) {
|
|
2616
|
-
const [activeNotifications, setActiveNotifications] = (0,
|
|
2617
|
-
const styles = (0,
|
|
2618
|
-
const handleNotify = (0,
|
|
2710
|
+
const [activeNotifications, setActiveNotifications] = (0, import_react21.useState)([]);
|
|
2711
|
+
const styles = (0, import_recipes35.notification)();
|
|
2712
|
+
const handleNotify = (0, import_react21.useCallback)((options) => {
|
|
2619
2713
|
setActiveNotifications((prev) => {
|
|
2620
2714
|
const id = `${options.palette}:${prev.length + 1}`;
|
|
2621
2715
|
return [...prev, { ...options, id }];
|
|
2622
2716
|
});
|
|
2623
2717
|
}, []);
|
|
2624
|
-
const handleClose = (0,
|
|
2718
|
+
const handleClose = (0, import_react21.useCallback)((e) => {
|
|
2625
2719
|
const target = e.currentTarget;
|
|
2626
2720
|
setActiveNotifications((prev) => {
|
|
2627
2721
|
const item = prev.find((option) => option.id === target.value);
|
|
@@ -2629,7 +2723,7 @@ function NotificationCenter(props) {
|
|
|
2629
2723
|
return prev.filter((option) => option.id !== target.value);
|
|
2630
2724
|
});
|
|
2631
2725
|
}, []);
|
|
2632
|
-
const handleCloseAll = (0,
|
|
2726
|
+
const handleCloseAll = (0, import_react21.useCallback)(() => {
|
|
2633
2727
|
setActiveNotifications((prev) => {
|
|
2634
2728
|
prev.forEach((item) => {
|
|
2635
2729
|
if (item.onClose) item.onClose();
|
|
@@ -2637,19 +2731,19 @@ function NotificationCenter(props) {
|
|
|
2637
2731
|
return [];
|
|
2638
2732
|
});
|
|
2639
2733
|
}, []);
|
|
2640
|
-
const value = (0,
|
|
2734
|
+
const value = (0, import_react21.useMemo)(
|
|
2641
2735
|
() => ({
|
|
2642
2736
|
notify: handleNotify
|
|
2643
2737
|
}),
|
|
2644
2738
|
[handleNotify]
|
|
2645
2739
|
);
|
|
2646
|
-
return /* @__PURE__ */ (0,
|
|
2740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(NotificationsContext.Provider, { value, children: [
|
|
2647
2741
|
props.children,
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Show, { when: activeNotifications.length > 0, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Portal, { container: props.container, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: styles.center, children: [
|
|
2743
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Show, { when: activeNotifications.length >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2650
2744
|
Button,
|
|
2651
2745
|
{
|
|
2652
|
-
className: (0,
|
|
2746
|
+
className: (0, import_css46.cx)(styles.closeAll, (0, import_patterns17.animateIn)()),
|
|
2653
2747
|
onClick: handleCloseAll,
|
|
2654
2748
|
palette: "action",
|
|
2655
2749
|
shape: "rounded",
|
|
@@ -2658,7 +2752,7 @@ function NotificationCenter(props) {
|
|
|
2658
2752
|
children: "Close all"
|
|
2659
2753
|
}
|
|
2660
2754
|
) }),
|
|
2661
|
-
/* @__PURE__ */ (0,
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2662
2756
|
"div",
|
|
2663
2757
|
{
|
|
2664
2758
|
className: (0, import_patterns17.vstack)({
|
|
@@ -2668,7 +2762,7 @@ function NotificationCenter(props) {
|
|
|
2668
2762
|
style: {
|
|
2669
2763
|
alignItems: "flex-end"
|
|
2670
2764
|
},
|
|
2671
|
-
children: activeNotifications.map((option) => /* @__PURE__ */ (0,
|
|
2765
|
+
children: activeNotifications.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2672
2766
|
MatchNotification,
|
|
2673
2767
|
{
|
|
2674
2768
|
...option,
|
|
@@ -2685,7 +2779,7 @@ function MatchNotification(props) {
|
|
|
2685
2779
|
const { palette, id, onClose, heading, description } = props;
|
|
2686
2780
|
switch (palette) {
|
|
2687
2781
|
case "success":
|
|
2688
|
-
return /* @__PURE__ */ (0,
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
2689
2783
|
Notification,
|
|
2690
2784
|
{
|
|
2691
2785
|
id,
|
|
@@ -2693,14 +2787,14 @@ function MatchNotification(props) {
|
|
|
2693
2787
|
open: true,
|
|
2694
2788
|
palette: "success",
|
|
2695
2789
|
children: [
|
|
2696
|
-
/* @__PURE__ */ (0,
|
|
2697
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationHeading, { palette: "success", children: heading }),
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationDescription, { palette: "success", children: description })
|
|
2698
2792
|
]
|
|
2699
2793
|
},
|
|
2700
2794
|
id
|
|
2701
2795
|
);
|
|
2702
2796
|
case "warning":
|
|
2703
|
-
return /* @__PURE__ */ (0,
|
|
2797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
2704
2798
|
Notification,
|
|
2705
2799
|
{
|
|
2706
2800
|
id,
|
|
@@ -2708,27 +2802,27 @@ function MatchNotification(props) {
|
|
|
2708
2802
|
open: true,
|
|
2709
2803
|
palette: "warning",
|
|
2710
2804
|
children: [
|
|
2711
|
-
/* @__PURE__ */ (0,
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationHeading, { palette: "warning", children: heading }),
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationDescription, { palette: "warning", children: description })
|
|
2713
2807
|
]
|
|
2714
2808
|
},
|
|
2715
2809
|
id
|
|
2716
2810
|
);
|
|
2717
2811
|
case "danger":
|
|
2718
|
-
return /* @__PURE__ */ (0,
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Notification, { id, onClose, open: true, palette: "danger", children: [
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationHeading, { palette: "danger", children: heading }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationDescription, { palette: "danger", children: description })
|
|
2721
2815
|
] }, id);
|
|
2722
2816
|
case "info":
|
|
2723
2817
|
default:
|
|
2724
|
-
return /* @__PURE__ */ (0,
|
|
2725
|
-
/* @__PURE__ */ (0,
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Notification, { id, onClose, open: true, palette: "info", children: [
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationHeading, { palette: "info", children: heading }),
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(NotificationDescription, { palette: "info", children: description })
|
|
2727
2821
|
] }, id);
|
|
2728
2822
|
}
|
|
2729
2823
|
}
|
|
2730
2824
|
function useNotificationCenter() {
|
|
2731
|
-
const context = (0,
|
|
2825
|
+
const context = (0, import_react21.useContext)(NotificationsContext);
|
|
2732
2826
|
if (!context) {
|
|
2733
2827
|
throw new Error(
|
|
2734
2828
|
"useNotificationCenter must be used within a NotificationsProvider"
|
|
@@ -2738,33 +2832,33 @@ function useNotificationCenter() {
|
|
|
2738
2832
|
}
|
|
2739
2833
|
|
|
2740
2834
|
// src/context/prompt-modal.tsx
|
|
2741
|
-
var
|
|
2742
|
-
var
|
|
2835
|
+
var import_react22 = require("react");
|
|
2836
|
+
var import_css47 = require("@cerberus/styled-system/css");
|
|
2743
2837
|
var import_patterns18 = require("@cerberus/styled-system/patterns");
|
|
2744
|
-
var
|
|
2745
|
-
var PromptModalContext = (0,
|
|
2838
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2839
|
+
var PromptModalContext = (0, import_react22.createContext)(null);
|
|
2746
2840
|
function PromptModal(props) {
|
|
2747
2841
|
const { modalRef, show, close } = useModal();
|
|
2748
|
-
const resolveRef = (0,
|
|
2749
|
-
const [content, setContent] = (0,
|
|
2750
|
-
const [inputValue, setInputValue] = (0,
|
|
2842
|
+
const resolveRef = (0, import_react22.useRef)(null);
|
|
2843
|
+
const [content, setContent] = (0, import_react22.useState)(null);
|
|
2844
|
+
const [inputValue, setInputValue] = (0, import_react22.useState)("");
|
|
2751
2845
|
const focusTrap = trapFocus(modalRef);
|
|
2752
2846
|
const PromptIcon = $cerberusIcons.promptModal;
|
|
2753
|
-
const isValid = (0,
|
|
2847
|
+
const isValid = (0, import_react22.useMemo)(
|
|
2754
2848
|
() => inputValue === (content == null ? void 0 : content.key),
|
|
2755
2849
|
[inputValue, content]
|
|
2756
2850
|
);
|
|
2757
|
-
const palette = (0,
|
|
2851
|
+
const palette = (0, import_react22.useMemo)(
|
|
2758
2852
|
() => (content == null ? void 0 : content.kind) === "destructive" ? "danger" : "action",
|
|
2759
2853
|
[content]
|
|
2760
2854
|
);
|
|
2761
|
-
const handleChange = (0,
|
|
2855
|
+
const handleChange = (0, import_react22.useCallback)(
|
|
2762
2856
|
(e) => {
|
|
2763
2857
|
setInputValue(e.currentTarget.value);
|
|
2764
2858
|
},
|
|
2765
2859
|
[content]
|
|
2766
2860
|
);
|
|
2767
|
-
const handleChoice = (0,
|
|
2861
|
+
const handleChoice = (0, import_react22.useCallback)(
|
|
2768
2862
|
(e) => {
|
|
2769
2863
|
var _a;
|
|
2770
2864
|
const target = e.currentTarget;
|
|
@@ -2775,7 +2869,7 @@ function PromptModal(props) {
|
|
|
2775
2869
|
},
|
|
2776
2870
|
[inputValue, close]
|
|
2777
2871
|
);
|
|
2778
|
-
const handleShow = (0,
|
|
2872
|
+
const handleShow = (0, import_react22.useCallback)(
|
|
2779
2873
|
(options) => {
|
|
2780
2874
|
return new Promise((resolve) => {
|
|
2781
2875
|
setContent({ ...options, kind: options.kind || "non-destructive" });
|
|
@@ -2785,42 +2879,42 @@ function PromptModal(props) {
|
|
|
2785
2879
|
},
|
|
2786
2880
|
[show]
|
|
2787
2881
|
);
|
|
2788
|
-
const value = (0,
|
|
2882
|
+
const value = (0, import_react22.useMemo)(
|
|
2789
2883
|
() => ({
|
|
2790
2884
|
show: handleShow
|
|
2791
2885
|
}),
|
|
2792
2886
|
[handleShow]
|
|
2793
2887
|
);
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(PromptModalContext.Provider, { value, children: [
|
|
2795
2889
|
props.children,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2890
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(ModalHeader, { children: [
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2799
2893
|
"div",
|
|
2800
2894
|
{
|
|
2801
2895
|
className: (0, import_patterns18.hstack)({
|
|
2802
2896
|
justify: "center",
|
|
2803
2897
|
w: "full"
|
|
2804
2898
|
}),
|
|
2805
|
-
children: /* @__PURE__ */ (0,
|
|
2899
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2806
2900
|
Show,
|
|
2807
2901
|
{
|
|
2808
2902
|
when: palette === "danger",
|
|
2809
|
-
fallback: /* @__PURE__ */ (0,
|
|
2903
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2810
2904
|
Avatar,
|
|
2811
2905
|
{
|
|
2812
2906
|
ariaLabel: "",
|
|
2813
2907
|
gradient: "charon-light",
|
|
2814
|
-
icon: /* @__PURE__ */ (0,
|
|
2908
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PromptIcon, { size: 24 }),
|
|
2815
2909
|
src: ""
|
|
2816
2910
|
}
|
|
2817
2911
|
),
|
|
2818
|
-
children: /* @__PURE__ */ (0,
|
|
2912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2819
2913
|
Avatar,
|
|
2820
2914
|
{
|
|
2821
2915
|
ariaLabel: "",
|
|
2822
2916
|
gradient: "hades-dark",
|
|
2823
|
-
icon: /* @__PURE__ */ (0,
|
|
2917
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PromptIcon, { size: 24 }),
|
|
2824
2918
|
src: ""
|
|
2825
2919
|
}
|
|
2826
2920
|
)
|
|
@@ -2828,10 +2922,10 @@ function PromptModal(props) {
|
|
|
2828
2922
|
)
|
|
2829
2923
|
}
|
|
2830
2924
|
),
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
2926
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
2833
2927
|
] }),
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2835
2929
|
"div",
|
|
2836
2930
|
{
|
|
2837
2931
|
className: (0, import_patterns18.vstack)({
|
|
@@ -2839,11 +2933,11 @@ function PromptModal(props) {
|
|
|
2839
2933
|
mt: "4",
|
|
2840
2934
|
mb: "8"
|
|
2841
2935
|
}),
|
|
2842
|
-
children: /* @__PURE__ */ (0,
|
|
2843
|
-
/* @__PURE__ */ (0,
|
|
2936
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Field, { invalid: !isValid, children: [
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
2844
2938
|
Label,
|
|
2845
2939
|
{
|
|
2846
|
-
className: (0,
|
|
2940
|
+
className: (0, import_css47.css)({
|
|
2847
2941
|
gap: 1,
|
|
2848
2942
|
justifyContent: "flex-start"
|
|
2849
2943
|
}),
|
|
@@ -2851,10 +2945,10 @@ function PromptModal(props) {
|
|
|
2851
2945
|
size: "md",
|
|
2852
2946
|
children: [
|
|
2853
2947
|
"Type",
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2948
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2855
2949
|
"strong",
|
|
2856
2950
|
{
|
|
2857
|
-
className: (0,
|
|
2951
|
+
className: (0, import_css47.css)({
|
|
2858
2952
|
textTransform: "uppercase"
|
|
2859
2953
|
}),
|
|
2860
2954
|
children: content == null ? void 0 : content.key
|
|
@@ -2864,7 +2958,7 @@ function PromptModal(props) {
|
|
|
2864
2958
|
]
|
|
2865
2959
|
}
|
|
2866
2960
|
),
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2868
2962
|
Input,
|
|
2869
2963
|
{
|
|
2870
2964
|
id: "confirm",
|
|
@@ -2876,7 +2970,7 @@ function PromptModal(props) {
|
|
|
2876
2970
|
] })
|
|
2877
2971
|
}
|
|
2878
2972
|
),
|
|
2879
|
-
/* @__PURE__ */ (0,
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
2880
2974
|
"div",
|
|
2881
2975
|
{
|
|
2882
2976
|
className: (0, import_patterns18.hstack)({
|
|
@@ -2884,11 +2978,11 @@ function PromptModal(props) {
|
|
|
2884
2978
|
gap: "4"
|
|
2885
2979
|
}),
|
|
2886
2980
|
children: [
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2888
2982
|
Button,
|
|
2889
2983
|
{
|
|
2890
2984
|
autoFocus: true,
|
|
2891
|
-
className: (0,
|
|
2985
|
+
className: (0, import_css47.css)({
|
|
2892
2986
|
w: "1/2"
|
|
2893
2987
|
}),
|
|
2894
2988
|
disabled: !isValid,
|
|
@@ -2899,10 +2993,10 @@ function PromptModal(props) {
|
|
|
2899
2993
|
children: content == null ? void 0 : content.actionText
|
|
2900
2994
|
}
|
|
2901
2995
|
),
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2903
2997
|
Button,
|
|
2904
2998
|
{
|
|
2905
|
-
className: (0,
|
|
2999
|
+
className: (0, import_css47.css)({
|
|
2906
3000
|
w: "1/2"
|
|
2907
3001
|
}),
|
|
2908
3002
|
name: "cancel",
|
|
@@ -2919,7 +3013,7 @@ function PromptModal(props) {
|
|
|
2919
3013
|
] });
|
|
2920
3014
|
}
|
|
2921
3015
|
function usePromptModal() {
|
|
2922
|
-
const context = (0,
|
|
3016
|
+
const context = (0, import_react22.useContext)(PromptModalContext);
|
|
2923
3017
|
if (context === null) {
|
|
2924
3018
|
throw new Error("usePromptModal must be used within a PromptModal Provider");
|
|
2925
3019
|
}
|
|
@@ -2927,50 +3021,50 @@ function usePromptModal() {
|
|
|
2927
3021
|
}
|
|
2928
3022
|
|
|
2929
3023
|
// src/context/theme.tsx
|
|
2930
|
-
var
|
|
3024
|
+
var import_react24 = require("react");
|
|
2931
3025
|
|
|
2932
3026
|
// src/hooks/useTheme.ts
|
|
2933
|
-
var
|
|
3027
|
+
var import_react23 = require("react");
|
|
2934
3028
|
var THEME_KEY = "cerberus-theme";
|
|
2935
3029
|
var MODE_KEY = "cerberus-mode";
|
|
2936
3030
|
function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options = {}) {
|
|
2937
3031
|
const { updateMode, updateTheme, cache } = options;
|
|
2938
|
-
const [theme, setTheme] = (0,
|
|
2939
|
-
const [colorMode, setColorMode] = (0,
|
|
2940
|
-
const handleThemeChange = (0,
|
|
3032
|
+
const [theme, setTheme] = (0, import_react23.useState)(defaultTheme);
|
|
3033
|
+
const [colorMode, setColorMode] = (0, import_react23.useState)(defaultColorMode);
|
|
3034
|
+
const handleThemeChange = (0, import_react23.useCallback)(
|
|
2941
3035
|
(newTheme) => {
|
|
2942
3036
|
setTheme(newTheme);
|
|
2943
3037
|
updateTheme == null ? void 0 : updateTheme(newTheme);
|
|
2944
3038
|
},
|
|
2945
3039
|
[updateTheme]
|
|
2946
3040
|
);
|
|
2947
|
-
const handleColorModeChange = (0,
|
|
3041
|
+
const handleColorModeChange = (0, import_react23.useCallback)(
|
|
2948
3042
|
(newMode) => {
|
|
2949
3043
|
setColorMode(newMode);
|
|
2950
3044
|
updateMode == null ? void 0 : updateMode(newMode);
|
|
2951
3045
|
},
|
|
2952
3046
|
[updateMode]
|
|
2953
3047
|
);
|
|
2954
|
-
(0,
|
|
3048
|
+
(0, import_react23.useLayoutEffect)(() => {
|
|
2955
3049
|
const theme2 = localStorage.getItem(THEME_KEY);
|
|
2956
3050
|
if (theme2) {
|
|
2957
3051
|
setTheme(theme2);
|
|
2958
3052
|
}
|
|
2959
3053
|
}, []);
|
|
2960
|
-
(0,
|
|
3054
|
+
(0, import_react23.useLayoutEffect)(() => {
|
|
2961
3055
|
const mode = localStorage.getItem(MODE_KEY);
|
|
2962
3056
|
if (mode) {
|
|
2963
3057
|
setColorMode(mode);
|
|
2964
3058
|
}
|
|
2965
3059
|
}, []);
|
|
2966
|
-
(0,
|
|
3060
|
+
(0, import_react23.useEffect)(() => {
|
|
2967
3061
|
const root = document.documentElement;
|
|
2968
3062
|
root.dataset.pandaTheme = theme;
|
|
2969
3063
|
if (cache) {
|
|
2970
3064
|
localStorage.setItem(THEME_KEY, theme);
|
|
2971
3065
|
}
|
|
2972
3066
|
}, [theme, cache]);
|
|
2973
|
-
(0,
|
|
3067
|
+
(0, import_react23.useEffect)(() => {
|
|
2974
3068
|
const root = document.documentElement;
|
|
2975
3069
|
if (colorMode === "system") {
|
|
2976
3070
|
root.dataset.colorMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -2981,7 +3075,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
2981
3075
|
localStorage.setItem(MODE_KEY, colorMode);
|
|
2982
3076
|
}
|
|
2983
3077
|
}, [colorMode, cache]);
|
|
2984
|
-
return (0,
|
|
3078
|
+
return (0, import_react23.useMemo)(
|
|
2985
3079
|
() => ({
|
|
2986
3080
|
theme,
|
|
2987
3081
|
mode: colorMode,
|
|
@@ -2993,8 +3087,8 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
2993
3087
|
}
|
|
2994
3088
|
|
|
2995
3089
|
// src/context/theme.tsx
|
|
2996
|
-
var
|
|
2997
|
-
var ThemeContext = (0,
|
|
3090
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3091
|
+
var ThemeContext = (0, import_react24.createContext)(
|
|
2998
3092
|
null
|
|
2999
3093
|
);
|
|
3000
3094
|
function ThemeProvider(props) {
|
|
@@ -3003,10 +3097,10 @@ function ThemeProvider(props) {
|
|
|
3003
3097
|
updateMode: props.updateMode,
|
|
3004
3098
|
updateTheme: props.updateTheme
|
|
3005
3099
|
});
|
|
3006
|
-
return /* @__PURE__ */ (0,
|
|
3100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ThemeContext.Provider, { value: state, children: props.children });
|
|
3007
3101
|
}
|
|
3008
3102
|
function useThemeContext() {
|
|
3009
|
-
const context = (0,
|
|
3103
|
+
const context = (0, import_react24.useContext)(ThemeContext);
|
|
3010
3104
|
if (!context) {
|
|
3011
3105
|
throw new Error("useThemeContext must be used within a ThemeProvider");
|
|
3012
3106
|
}
|
|
@@ -3014,13 +3108,13 @@ function useThemeContext() {
|
|
|
3014
3108
|
}
|
|
3015
3109
|
|
|
3016
3110
|
// src/hooks/useDate.ts
|
|
3017
|
-
var
|
|
3111
|
+
var import_react25 = require("react");
|
|
3018
3112
|
function useDate(options) {
|
|
3019
3113
|
const initialValue = (options == null ? void 0 : options.initialValue) ?? "";
|
|
3020
3114
|
const format = (options == null ? void 0 : options.format) ?? DateFormats.USMilitary;
|
|
3021
3115
|
const onChange = options == null ? void 0 : options.onChange;
|
|
3022
|
-
const [value, setValue] = (0,
|
|
3023
|
-
const handleChange = (0,
|
|
3116
|
+
const [value, setValue] = (0, import_react25.useState)(initialValue);
|
|
3117
|
+
const handleChange = (0, import_react25.useCallback)(
|
|
3024
3118
|
(e) => {
|
|
3025
3119
|
const newValue = formatMilitaryDate(e.currentTarget.value);
|
|
3026
3120
|
if (onChange) onChange(e);
|
|
@@ -3028,7 +3122,7 @@ function useDate(options) {
|
|
|
3028
3122
|
},
|
|
3029
3123
|
[onChange]
|
|
3030
3124
|
);
|
|
3031
|
-
return (0,
|
|
3125
|
+
return (0, import_react25.useMemo)(
|
|
3032
3126
|
() => ({
|
|
3033
3127
|
format,
|
|
3034
3128
|
value,
|
|
@@ -3101,11 +3195,11 @@ var MONTHS = [
|
|
|
3101
3195
|
];
|
|
3102
3196
|
|
|
3103
3197
|
// src/hooks/useToggle.ts
|
|
3104
|
-
var
|
|
3198
|
+
var import_react26 = require("react");
|
|
3105
3199
|
function useToggle(options) {
|
|
3106
|
-
const [checked, setChecked] = (0,
|
|
3200
|
+
const [checked, setChecked] = (0, import_react26.useState)((options == null ? void 0 : options.checked) ?? "");
|
|
3107
3201
|
const onChange = options == null ? void 0 : options.onChange;
|
|
3108
|
-
const handleChange = (0,
|
|
3202
|
+
const handleChange = (0, import_react26.useCallback)(
|
|
3109
3203
|
(e) => {
|
|
3110
3204
|
const target = e.currentTarget;
|
|
3111
3205
|
setChecked((prev) => {
|
|
@@ -3115,25 +3209,25 @@ function useToggle(options) {
|
|
|
3115
3209
|
},
|
|
3116
3210
|
[onChange]
|
|
3117
3211
|
);
|
|
3118
|
-
return (0,
|
|
3212
|
+
return (0, import_react26.useMemo)(() => ({ checked, handleChange }), [checked, handleChange]);
|
|
3119
3213
|
}
|
|
3120
3214
|
|
|
3121
3215
|
// src/hooks/useRootColors.ts
|
|
3122
|
-
var
|
|
3216
|
+
var import_react27 = require("react");
|
|
3123
3217
|
function useRootColors(colors = []) {
|
|
3124
|
-
const [state, dispatch] = (0,
|
|
3125
|
-
const handleRefetch = (0,
|
|
3218
|
+
const [state, dispatch] = (0, import_react27.useReducer)(rootColorsReducer, {});
|
|
3219
|
+
const handleRefetch = (0, import_react27.useCallback)(() => {
|
|
3126
3220
|
return new Promise((resolve) => {
|
|
3127
3221
|
dispatch(formatColors(colors));
|
|
3128
3222
|
resolve();
|
|
3129
3223
|
});
|
|
3130
3224
|
}, []);
|
|
3131
|
-
(0,
|
|
3225
|
+
(0, import_react27.useEffect)(() => {
|
|
3132
3226
|
if (Object.keys(state).length === colors.length) return;
|
|
3133
3227
|
dispatch(formatColors(colors));
|
|
3134
3228
|
console.log("updating colors in root hook");
|
|
3135
3229
|
}, [colors]);
|
|
3136
|
-
return (0,
|
|
3230
|
+
return (0, import_react27.useMemo)(
|
|
3137
3231
|
() => ({ colors: state, refetch: handleRefetch }),
|
|
3138
3232
|
[state, handleRefetch]
|
|
3139
3233
|
);
|
|
@@ -3164,6 +3258,12 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
3164
3258
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3165
3259
|
0 && (module.exports = {
|
|
3166
3260
|
$cerberusIcons,
|
|
3261
|
+
Accordion,
|
|
3262
|
+
AccordionItem,
|
|
3263
|
+
AccordionItemContent,
|
|
3264
|
+
AccordionItemGroup,
|
|
3265
|
+
AccordionItemIndicator,
|
|
3266
|
+
AccordionItemTrigger,
|
|
3167
3267
|
Admonition,
|
|
3168
3268
|
AdmonitionDescription,
|
|
3169
3269
|
AdmonitionHeading,
|