@cerberus-design/react 0.8.1-next-a0decf7 → 0.8.1-next-97f2c1c
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 +44 -0
- package/build/legacy/components/Avatar.cjs +115 -0
- package/build/legacy/components/Avatar.cjs.map +1 -0
- package/build/legacy/index.cjs +460 -382
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +44 -0
- package/build/modern/{chunk-GZY6CH7D.js → chunk-3JF6LWXF.js} +7 -7
- package/build/modern/{chunk-S6CMAXQF.js → chunk-HMYC7CR3.js} +7 -7
- package/build/modern/{chunk-VPWBSZAR.js → chunk-OGAH7HBD.js} +4 -4
- package/build/modern/chunk-ZYXEVTIX.js +84 -0
- package/build/modern/chunk-ZYXEVTIX.js.map +1 -0
- package/build/modern/components/Avatar.js +8 -0
- package/build/modern/components/Avatar.js.map +1 -0
- package/build/modern/context/confirm-modal.js +3 -3
- package/build/modern/context/notification-center.js +2 -2
- package/build/modern/context/prompt-modal.js +3 -3
- package/build/modern/index.js +27 -23
- package/build/modern/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Avatar.tsx +113 -0
- package/src/index.ts +1 -0
- /package/build/modern/{chunk-GZY6CH7D.js.map → chunk-3JF6LWXF.js.map} +0 -0
- /package/build/modern/{chunk-S6CMAXQF.js.map → chunk-HMYC7CR3.js.map} +0 -0
- /package/build/modern/{chunk-VPWBSZAR.js.map → chunk-OGAH7HBD.js.map} +0 -0
package/build/legacy/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var src_exports = {};
|
|
23
23
|
__export(src_exports, {
|
|
24
24
|
$cerberusIcons: () => $cerberusIcons,
|
|
25
|
+
Avatar: () => Avatar,
|
|
25
26
|
Button: () => Button,
|
|
26
27
|
Checkbox: () => Checkbox,
|
|
27
28
|
ConfirmModal: () => ConfirmModal,
|
|
@@ -92,19 +93,106 @@ __export(src_exports, {
|
|
|
92
93
|
});
|
|
93
94
|
module.exports = __toCommonJS(src_exports);
|
|
94
95
|
|
|
95
|
-
// src/components/
|
|
96
|
+
// src/components/Avatar.tsx
|
|
96
97
|
var import_css = require("@cerberus/styled-system/css");
|
|
98
|
+
var import_patterns = require("@cerberus/styled-system/patterns");
|
|
97
99
|
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
100
|
+
var import_icons = require("@cerberus/icons");
|
|
101
|
+
|
|
102
|
+
// src/components/Show.tsx
|
|
103
|
+
var import_react = require("react");
|
|
104
|
+
function Show(props) {
|
|
105
|
+
const { when, children, fallback } = props;
|
|
106
|
+
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
107
|
+
return (0, import_react.useMemo)(() => {
|
|
108
|
+
if (condition) return children;
|
|
109
|
+
return fallback ?? null;
|
|
110
|
+
}, [condition, children, fallback]);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// src/components/Avatar.tsx
|
|
98
114
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
115
|
+
function Avatar(props) {
|
|
116
|
+
const { ariaLabel, as, gradient, size, src, width, height, ...nativeProps } = props;
|
|
117
|
+
const initials = (ariaLabel || "").split(" ").map((word) => word[0]).join("").slice(0, 2);
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
...nativeProps,
|
|
122
|
+
className: (0, import_css.cx)(
|
|
123
|
+
nativeProps.className,
|
|
124
|
+
(0, import_recipes.avatar)({ gradient, size }),
|
|
125
|
+
(0, import_patterns.circle)()
|
|
126
|
+
),
|
|
127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
Show,
|
|
129
|
+
{
|
|
130
|
+
when: Boolean(src) || Boolean(as),
|
|
131
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
Show,
|
|
133
|
+
{
|
|
134
|
+
when: Boolean(initials),
|
|
135
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
+
import_icons.UserFilled,
|
|
137
|
+
{
|
|
138
|
+
size: iconSizeMap[size]
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: initials })
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
Show,
|
|
146
|
+
{
|
|
147
|
+
when: Boolean(as),
|
|
148
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
"img",
|
|
150
|
+
{
|
|
151
|
+
alt: props.ariaLabel,
|
|
152
|
+
className: (0, import_css.css)({
|
|
153
|
+
h: "full",
|
|
154
|
+
objectFit: "cover",
|
|
155
|
+
w: "full"
|
|
156
|
+
}),
|
|
157
|
+
decoding: "async",
|
|
158
|
+
loading: "lazy",
|
|
159
|
+
src,
|
|
160
|
+
height,
|
|
161
|
+
width
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
children: as
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
var iconSizeMap = {
|
|
173
|
+
xs: 16,
|
|
174
|
+
sm: 16,
|
|
175
|
+
md: 20,
|
|
176
|
+
lg: 34,
|
|
177
|
+
xl: 32,
|
|
178
|
+
"2xl": 32,
|
|
179
|
+
"3xl": 32,
|
|
180
|
+
"4xl": 32
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// src/components/Button.tsx
|
|
184
|
+
var import_css2 = require("@cerberus/styled-system/css");
|
|
185
|
+
var import_recipes2 = require("@cerberus/styled-system/recipes");
|
|
186
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
99
187
|
function Button(props) {
|
|
100
188
|
const { palette, usage, shape, ...nativeProps } = props;
|
|
101
|
-
return /* @__PURE__ */ (0,
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
102
190
|
"button",
|
|
103
191
|
{
|
|
104
192
|
...nativeProps,
|
|
105
|
-
className: (0,
|
|
193
|
+
className: (0, import_css2.cx)(
|
|
106
194
|
nativeProps.className,
|
|
107
|
-
(0,
|
|
195
|
+
(0, import_recipes2.button)({
|
|
108
196
|
palette,
|
|
109
197
|
usage,
|
|
110
198
|
shape
|
|
@@ -115,24 +203,13 @@ function Button(props) {
|
|
|
115
203
|
}
|
|
116
204
|
|
|
117
205
|
// src/components/Checkbox.tsx
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
// src/components/Show.tsx
|
|
123
|
-
var import_react = require("react");
|
|
124
|
-
function Show(props) {
|
|
125
|
-
const { when, children, fallback } = props;
|
|
126
|
-
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
127
|
-
return (0, import_react.useMemo)(() => {
|
|
128
|
-
if (condition) return children;
|
|
129
|
-
return fallback ?? null;
|
|
130
|
-
}, [condition, children, fallback]);
|
|
131
|
-
}
|
|
206
|
+
var import_recipes3 = require("@cerberus/styled-system/recipes");
|
|
207
|
+
var import_patterns2 = require("@cerberus/styled-system/patterns");
|
|
208
|
+
var import_css3 = require("@cerberus/styled-system/css");
|
|
132
209
|
|
|
133
210
|
// src/context/field.tsx
|
|
134
211
|
var import_react2 = require("react");
|
|
135
|
-
var
|
|
212
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
136
213
|
var FieldContext = (0, import_react2.createContext)(null);
|
|
137
214
|
function Field(props) {
|
|
138
215
|
const value = (0, import_react2.useMemo)(
|
|
@@ -144,7 +221,7 @@ function Field(props) {
|
|
|
144
221
|
}),
|
|
145
222
|
[props.disabled, props.readOnly, props.required, props.invalid]
|
|
146
223
|
);
|
|
147
|
-
return /* @__PURE__ */ (0,
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FieldContext.Provider, { value, children: props.children });
|
|
148
225
|
}
|
|
149
226
|
function useFieldContext() {
|
|
150
227
|
const context = (0, import_react2.useContext)(FieldContext);
|
|
@@ -155,12 +232,12 @@ function useFieldContext() {
|
|
|
155
232
|
}
|
|
156
233
|
|
|
157
234
|
// src/config/cerbIcons.ts
|
|
158
|
-
var
|
|
235
|
+
var import_icons2 = require("@cerberus/icons");
|
|
159
236
|
|
|
160
237
|
// src/config/icons/checkbox.icons.tsx
|
|
161
|
-
var
|
|
238
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
162
239
|
function CheckmarkIcon(props) {
|
|
163
|
-
return /* @__PURE__ */ (0,
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
164
241
|
"svg",
|
|
165
242
|
{
|
|
166
243
|
"aria-hidden": "true",
|
|
@@ -169,7 +246,7 @@ function CheckmarkIcon(props) {
|
|
|
169
246
|
role: "img",
|
|
170
247
|
viewBox: "0 0 24 24",
|
|
171
248
|
...props,
|
|
172
|
-
children: /* @__PURE__ */ (0,
|
|
249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
173
250
|
"path",
|
|
174
251
|
{
|
|
175
252
|
fill: "currentColor",
|
|
@@ -180,7 +257,7 @@ function CheckmarkIcon(props) {
|
|
|
180
257
|
);
|
|
181
258
|
}
|
|
182
259
|
function IndeterminateIcon(props) {
|
|
183
|
-
return /* @__PURE__ */ (0,
|
|
260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
184
261
|
"svg",
|
|
185
262
|
{
|
|
186
263
|
"aria-hidden": "true",
|
|
@@ -189,7 +266,7 @@ function IndeterminateIcon(props) {
|
|
|
189
266
|
fill: "none",
|
|
190
267
|
viewBox: "0 0 24 24",
|
|
191
268
|
...props,
|
|
192
|
-
children: /* @__PURE__ */ (0,
|
|
269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { fill: "currentColor", d: "M4 11h16v2.667H4z" })
|
|
193
270
|
}
|
|
194
271
|
);
|
|
195
272
|
}
|
|
@@ -197,21 +274,21 @@ function IndeterminateIcon(props) {
|
|
|
197
274
|
// src/config/cerbIcons.ts
|
|
198
275
|
var defaultIcons = {
|
|
199
276
|
checkbox: CheckmarkIcon,
|
|
200
|
-
close:
|
|
201
|
-
confirmModal:
|
|
202
|
-
delete:
|
|
203
|
-
promptModal:
|
|
204
|
-
fileUploader:
|
|
277
|
+
close: import_icons2.CloseFilled,
|
|
278
|
+
confirmModal: import_icons2.Information,
|
|
279
|
+
delete: import_icons2.TrashCan,
|
|
280
|
+
promptModal: import_icons2.Information,
|
|
281
|
+
fileUploader: import_icons2.CloudUpload,
|
|
205
282
|
indeterminate: IndeterminateIcon,
|
|
206
|
-
infoNotification:
|
|
207
|
-
successNotification:
|
|
208
|
-
warningNotification:
|
|
209
|
-
dangerNotification:
|
|
210
|
-
invalid:
|
|
211
|
-
invalidAlt:
|
|
212
|
-
redo:
|
|
213
|
-
selectArrow:
|
|
214
|
-
toggleChecked:
|
|
283
|
+
infoNotification: import_icons2.InformationFilled,
|
|
284
|
+
successNotification: import_icons2.CheckmarkFilled,
|
|
285
|
+
warningNotification: import_icons2.WarningFilled,
|
|
286
|
+
dangerNotification: import_icons2.ErrorFilled,
|
|
287
|
+
invalid: import_icons2.WarningFilled,
|
|
288
|
+
invalidAlt: import_icons2.Warning,
|
|
289
|
+
redo: import_icons2.Restart,
|
|
290
|
+
selectArrow: import_icons2.ChevronDown,
|
|
291
|
+
toggleChecked: import_icons2.Checkmark
|
|
215
292
|
};
|
|
216
293
|
|
|
217
294
|
// src/config/defineIcons.ts
|
|
@@ -233,24 +310,24 @@ function defineIcons(icons) {
|
|
|
233
310
|
var $cerberusIcons = defaultIcons;
|
|
234
311
|
|
|
235
312
|
// src/components/Checkbox.tsx
|
|
236
|
-
var
|
|
313
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
237
314
|
function Checkbox(props) {
|
|
238
315
|
const { describedBy, size, checked, mixed, ...nativeProps } = props;
|
|
239
316
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
240
|
-
const styles = (0,
|
|
317
|
+
const styles = (0, import_recipes3.checkbox)({ size });
|
|
241
318
|
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon2 } = $cerberusIcons;
|
|
242
|
-
return /* @__PURE__ */ (0,
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
243
320
|
"div",
|
|
244
321
|
{
|
|
245
|
-
className: (0,
|
|
322
|
+
className: (0, import_css3.cx)(
|
|
246
323
|
styles.root,
|
|
247
|
-
(0,
|
|
324
|
+
(0, import_patterns2.vstack)({
|
|
248
325
|
gap: "0",
|
|
249
326
|
justify: "center"
|
|
250
327
|
})
|
|
251
328
|
),
|
|
252
329
|
children: [
|
|
253
|
-
/* @__PURE__ */ (0,
|
|
330
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
254
331
|
"input",
|
|
255
332
|
{
|
|
256
333
|
...nativeProps,
|
|
@@ -258,12 +335,12 @@ function Checkbox(props) {
|
|
|
258
335
|
...describedBy && { "aria-describedby": describedBy },
|
|
259
336
|
...invalid && { "aria-invalid": true },
|
|
260
337
|
...mixed && { "aria-checked": "mixed" },
|
|
261
|
-
className: (0,
|
|
338
|
+
className: (0, import_css3.cx)("peer", nativeProps.className, styles.input),
|
|
262
339
|
type: "checkbox"
|
|
263
340
|
}
|
|
264
341
|
),
|
|
265
|
-
/* @__PURE__ */ (0,
|
|
266
|
-
/* @__PURE__ */ (0,
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: checked && !mixed, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckIcon, {}) }) }),
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: mixed, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IndeterminateIcon2, {}) }) })
|
|
267
344
|
]
|
|
268
345
|
}
|
|
269
346
|
);
|
|
@@ -272,7 +349,7 @@ function Checkbox(props) {
|
|
|
272
349
|
// src/components/Droppable.tsx
|
|
273
350
|
var import_core = require("@dnd-kit/core");
|
|
274
351
|
var import_react3 = require("react");
|
|
275
|
-
var
|
|
352
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
276
353
|
function Droppable(props) {
|
|
277
354
|
const { dropped, id, disabled, data, resizeObserverConfig, ...nativeProps } = props;
|
|
278
355
|
const uuid = (0, import_react3.useId)();
|
|
@@ -282,7 +359,7 @@ function Droppable(props) {
|
|
|
282
359
|
id: id || uuid,
|
|
283
360
|
resizeObserverConfig
|
|
284
361
|
});
|
|
285
|
-
return /* @__PURE__ */ (0,
|
|
362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
286
363
|
"div",
|
|
287
364
|
{
|
|
288
365
|
...nativeProps,
|
|
@@ -295,27 +372,27 @@ function Droppable(props) {
|
|
|
295
372
|
}
|
|
296
373
|
|
|
297
374
|
// src/components/FieldMessage.tsx
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
var
|
|
375
|
+
var import_css4 = require("@cerberus/styled-system/css");
|
|
376
|
+
var import_recipes4 = require("@cerberus/styled-system/recipes");
|
|
377
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
301
378
|
function FieldMessage(props) {
|
|
302
379
|
const { invalid } = useFieldContext();
|
|
303
|
-
return /* @__PURE__ */ (0,
|
|
380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
304
381
|
"small",
|
|
305
382
|
{
|
|
306
383
|
...props,
|
|
307
384
|
...invalid && { "aria-invalid": true },
|
|
308
|
-
className: (0,
|
|
385
|
+
className: (0, import_css4.cx)(props.className, (0, import_recipes4.fieldMessage)())
|
|
309
386
|
}
|
|
310
387
|
);
|
|
311
388
|
}
|
|
312
389
|
|
|
313
390
|
// src/context/feature-flags.tsx
|
|
314
391
|
var import_react4 = require("react");
|
|
315
|
-
var
|
|
392
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
316
393
|
var FeatureFlagContext = (0, import_react4.createContext)(null);
|
|
317
394
|
function FeatureFlags(props) {
|
|
318
|
-
return /* @__PURE__ */ (0,
|
|
395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FeatureFlagContext.Provider, { value: props.flags, children: props.children });
|
|
319
396
|
}
|
|
320
397
|
function useFeatureFlags(key) {
|
|
321
398
|
const context = (0, import_react4.useContext)(FeatureFlagContext);
|
|
@@ -328,36 +405,36 @@ function useFeatureFlags(key) {
|
|
|
328
405
|
}
|
|
329
406
|
|
|
330
407
|
// src/components/FeatureFlag.tsx
|
|
331
|
-
var
|
|
408
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
332
409
|
function FeatureFlag(props) {
|
|
333
410
|
const showContent = useFeatureFlags(props.flag);
|
|
334
|
-
return /* @__PURE__ */ (0,
|
|
411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Show, { when: showContent, children: props.children });
|
|
335
412
|
}
|
|
336
413
|
|
|
337
414
|
// src/components/FileStatus.tsx
|
|
338
415
|
var import_react5 = require("react");
|
|
339
416
|
|
|
340
417
|
// src/components/ProgressBar.tsx
|
|
341
|
-
var
|
|
342
|
-
var
|
|
343
|
-
var
|
|
418
|
+
var import_css5 = require("@cerberus/styled-system/css");
|
|
419
|
+
var import_recipes5 = require("@cerberus/styled-system/recipes");
|
|
420
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
344
421
|
function ProgressBar(props) {
|
|
345
422
|
const { indeterminate, size, usage, now, ...nativeProps } = props;
|
|
346
|
-
const styles = (0,
|
|
423
|
+
const styles = (0, import_recipes5.progressBar)({ size, usage });
|
|
347
424
|
const nowClamped = Math.min(100, Math.max(0, now || 0));
|
|
348
425
|
const width = {
|
|
349
426
|
width: indeterminate ? "50%" : `${nowClamped}%`
|
|
350
427
|
};
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
352
429
|
"div",
|
|
353
430
|
{
|
|
354
431
|
...nativeProps,
|
|
355
432
|
"aria-valuemin": 0,
|
|
356
433
|
"aria-valuemax": 100,
|
|
357
434
|
"aria-valuenow": indeterminate ? 0 : nowClamped,
|
|
358
|
-
className: (0,
|
|
435
|
+
className: (0, import_css5.cx)(nativeProps.className, styles.root),
|
|
359
436
|
role: "meter",
|
|
360
|
-
children: /* @__PURE__ */ (0,
|
|
437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
361
438
|
"div",
|
|
362
439
|
{
|
|
363
440
|
...indeterminate && { "data-indeterminate": true },
|
|
@@ -371,21 +448,21 @@ function ProgressBar(props) {
|
|
|
371
448
|
}
|
|
372
449
|
|
|
373
450
|
// src/components/IconButton.tsx
|
|
374
|
-
var
|
|
375
|
-
var
|
|
376
|
-
var
|
|
451
|
+
var import_css6 = require("@cerberus/styled-system/css");
|
|
452
|
+
var import_recipes6 = require("@cerberus/styled-system/recipes");
|
|
453
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
377
454
|
function IconButton(props) {
|
|
378
455
|
const { ariaLabel, palette, usage, size, ...nativeProps } = props;
|
|
379
|
-
return /* @__PURE__ */ (0,
|
|
456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
380
457
|
"button",
|
|
381
458
|
{
|
|
382
459
|
...nativeProps,
|
|
383
460
|
"data-tooltip": true,
|
|
384
461
|
"data-position": props.tooltipPosition ?? "top",
|
|
385
462
|
"aria-label": ariaLabel ?? "Icon Button",
|
|
386
|
-
className: (0,
|
|
463
|
+
className: (0, import_css6.cx)(
|
|
387
464
|
nativeProps.className,
|
|
388
|
-
(0,
|
|
465
|
+
(0, import_recipes6.iconButton)({
|
|
389
466
|
palette,
|
|
390
467
|
usage,
|
|
391
468
|
size
|
|
@@ -396,10 +473,10 @@ function IconButton(props) {
|
|
|
396
473
|
}
|
|
397
474
|
|
|
398
475
|
// src/components/FileStatus.tsx
|
|
399
|
-
var
|
|
400
|
-
var
|
|
401
|
-
var
|
|
402
|
-
var
|
|
476
|
+
var import_recipes7 = require("@cerberus/styled-system/recipes");
|
|
477
|
+
var import_css7 = require("@cerberus/styled-system/css");
|
|
478
|
+
var import_patterns3 = require("@cerberus/styled-system/patterns");
|
|
479
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
403
480
|
var processStatus = /* @__PURE__ */ ((processStatus2) => {
|
|
404
481
|
processStatus2["TODO"] = "todo";
|
|
405
482
|
processStatus2["PROCESSING"] = "processing";
|
|
@@ -415,15 +492,15 @@ function FileStatus(props) {
|
|
|
415
492
|
const styles = (0, import_react5.useMemo)(() => {
|
|
416
493
|
switch (status) {
|
|
417
494
|
case "todo" /* TODO */:
|
|
418
|
-
return (0,
|
|
495
|
+
return (0, import_recipes7.fileStatus)({ status: "todo" });
|
|
419
496
|
case "processing" /* PROCESSING */:
|
|
420
|
-
return (0,
|
|
497
|
+
return (0, import_recipes7.fileStatus)({ status: "processing" });
|
|
421
498
|
case "done" /* DONE */:
|
|
422
|
-
return (0,
|
|
499
|
+
return (0, import_recipes7.fileStatus)({ status: "done" });
|
|
423
500
|
case "error" /* ERROR */:
|
|
424
|
-
return (0,
|
|
501
|
+
return (0, import_recipes7.fileStatus)({ status: "error" });
|
|
425
502
|
default:
|
|
426
|
-
return (0,
|
|
503
|
+
return (0, import_recipes7.fileStatus)();
|
|
427
504
|
}
|
|
428
505
|
}, [status]);
|
|
429
506
|
const handleClick = (0, import_react5.useCallback)(
|
|
@@ -435,65 +512,65 @@ function FileStatus(props) {
|
|
|
435
512
|
},
|
|
436
513
|
[onClick]
|
|
437
514
|
);
|
|
438
|
-
return /* @__PURE__ */ (0,
|
|
515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
439
516
|
"div",
|
|
440
517
|
{
|
|
441
518
|
...nativeProps,
|
|
442
|
-
className: (0,
|
|
519
|
+
className: (0, import_css7.cx)(nativeProps.className, styles.root, (0, import_patterns3.hstack)()),
|
|
443
520
|
children: [
|
|
444
|
-
/* @__PURE__ */ (0,
|
|
521
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
445
522
|
"div",
|
|
446
523
|
{
|
|
447
|
-
className: (0,
|
|
524
|
+
className: (0, import_css7.cx)(
|
|
448
525
|
styles.icon,
|
|
449
|
-
(0,
|
|
526
|
+
(0, import_patterns3.circle)({
|
|
450
527
|
size: "2rem"
|
|
451
528
|
})
|
|
452
529
|
),
|
|
453
|
-
children: /* @__PURE__ */ (0,
|
|
530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MatchFileStatusIcon, { status })
|
|
454
531
|
}
|
|
455
532
|
),
|
|
456
|
-
/* @__PURE__ */ (0,
|
|
533
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
457
534
|
"div",
|
|
458
535
|
{
|
|
459
|
-
className: (0,
|
|
536
|
+
className: (0, import_patterns3.vstack)({
|
|
460
537
|
alignItems: "flex-start",
|
|
461
538
|
gap: "0.12rem",
|
|
462
539
|
w: "full"
|
|
463
540
|
}),
|
|
464
541
|
children: [
|
|
465
|
-
/* @__PURE__ */ (0,
|
|
542
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
466
543
|
"small",
|
|
467
544
|
{
|
|
468
|
-
className: (0,
|
|
545
|
+
className: (0, import_css7.css)({
|
|
469
546
|
color: "page.text.initial",
|
|
470
547
|
textStyle: "label-sm"
|
|
471
548
|
}),
|
|
472
549
|
children: file
|
|
473
550
|
}
|
|
474
551
|
),
|
|
475
|
-
/* @__PURE__ */ (0,
|
|
476
|
-
/* @__PURE__ */ (0,
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProgressBar, { now, size: "sm" }),
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field, { invalid: modalIconPalette === "danger", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
477
554
|
FieldMessage,
|
|
478
555
|
{
|
|
479
|
-
className: (0,
|
|
556
|
+
className: (0, import_css7.css)({
|
|
480
557
|
color: "page.text.100"
|
|
481
558
|
}),
|
|
482
559
|
id: `help:${file}`,
|
|
483
|
-
children: /* @__PURE__ */ (0,
|
|
560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MatchFileStatusText, { status, now })
|
|
484
561
|
}
|
|
485
562
|
) })
|
|
486
563
|
]
|
|
487
564
|
}
|
|
488
565
|
),
|
|
489
|
-
/* @__PURE__ */ (0,
|
|
566
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
490
567
|
IconButton,
|
|
491
568
|
{
|
|
492
569
|
ariaLabel: actionLabel,
|
|
493
570
|
onClick: handleClick,
|
|
494
571
|
palette,
|
|
495
572
|
size: "sm",
|
|
496
|
-
children: /* @__PURE__ */ (0,
|
|
573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MatchStatusAction, { status })
|
|
497
574
|
}
|
|
498
575
|
)
|
|
499
576
|
]
|
|
@@ -509,11 +586,11 @@ function MatchFileStatusIcon(props) {
|
|
|
509
586
|
switch (props.status) {
|
|
510
587
|
case "todo" /* TODO */:
|
|
511
588
|
case "processing" /* PROCESSING */:
|
|
512
|
-
return /* @__PURE__ */ (0,
|
|
589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FileUploaderIcon, {});
|
|
513
590
|
case "done" /* DONE */:
|
|
514
|
-
return /* @__PURE__ */ (0,
|
|
591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DoneIcon, {});
|
|
515
592
|
case "error" /* ERROR */:
|
|
516
|
-
return /* @__PURE__ */ (0,
|
|
593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(InvalidIcon, {});
|
|
517
594
|
default:
|
|
518
595
|
throw new Error("Unknown status");
|
|
519
596
|
}
|
|
@@ -537,11 +614,11 @@ function MatchStatusAction(props) {
|
|
|
537
614
|
switch (props.status) {
|
|
538
615
|
case "todo" /* TODO */:
|
|
539
616
|
case "processing" /* PROCESSING */:
|
|
540
|
-
return /* @__PURE__ */ (0,
|
|
617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon, {});
|
|
541
618
|
case "error" /* ERROR */:
|
|
542
|
-
return /* @__PURE__ */ (0,
|
|
619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RedoIcon, {});
|
|
543
620
|
case "done" /* DONE */:
|
|
544
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TrashIcon, {});
|
|
545
622
|
default:
|
|
546
623
|
throw new Error("Invalid status");
|
|
547
624
|
}
|
|
@@ -587,46 +664,46 @@ function getModalIconPalette(status) {
|
|
|
587
664
|
}
|
|
588
665
|
|
|
589
666
|
// src/components/FileUploader.tsx
|
|
590
|
-
var
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
var
|
|
667
|
+
var import_css8 = require("@cerberus/styled-system/css");
|
|
668
|
+
var import_patterns4 = require("@cerberus/styled-system/patterns");
|
|
669
|
+
var import_recipes8 = require("@cerberus/styled-system/recipes");
|
|
670
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
594
671
|
function FileUploader(props) {
|
|
595
672
|
var _a;
|
|
596
|
-
const styles = (0,
|
|
673
|
+
const styles = (0, import_recipes8.fileUploader)();
|
|
597
674
|
const Icon = $cerberusIcons.fileUploader;
|
|
598
|
-
return /* @__PURE__ */ (0,
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
599
676
|
"div",
|
|
600
677
|
{
|
|
601
|
-
className: (0,
|
|
602
|
-
(0,
|
|
678
|
+
className: (0, import_css8.cx)(
|
|
679
|
+
(0, import_patterns4.vstack)({
|
|
603
680
|
justify: "center"
|
|
604
681
|
}),
|
|
605
682
|
styles.container
|
|
606
683
|
),
|
|
607
684
|
children: [
|
|
608
|
-
/* @__PURE__ */ (0,
|
|
609
|
-
/* @__PURE__ */ (0,
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: (0, import_css8.cx)(styles.icon, (0, import_recipes8.modalIcon)(), (0, import_patterns4.circle)()), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, {}) }),
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
610
687
|
"label",
|
|
611
688
|
{
|
|
612
|
-
className: (0,
|
|
613
|
-
(0,
|
|
689
|
+
className: (0, import_css8.cx)(
|
|
690
|
+
(0, import_patterns4.vstack)({
|
|
614
691
|
justify: "center"
|
|
615
692
|
}),
|
|
616
693
|
styles.label
|
|
617
694
|
),
|
|
618
695
|
htmlFor: props.name,
|
|
619
696
|
children: [
|
|
620
|
-
/* @__PURE__ */ (0,
|
|
697
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Show, { when: Boolean(props.heading), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: styles.heading, children: props.heading }) }),
|
|
621
698
|
"Import ",
|
|
622
699
|
(_a = props.accept) == null ? void 0 : _a.replace(",", ", "),
|
|
623
700
|
" files",
|
|
624
|
-
/* @__PURE__ */ (0,
|
|
625
|
-
/* @__PURE__ */ (0,
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: styles.description, children: "Click to select files" }),
|
|
702
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
626
703
|
"input",
|
|
627
704
|
{
|
|
628
705
|
...props,
|
|
629
|
-
className: (0,
|
|
706
|
+
className: (0, import_css8.cx)(props.className, styles.input),
|
|
630
707
|
type: "file"
|
|
631
708
|
}
|
|
632
709
|
)
|
|
@@ -639,18 +716,18 @@ function FileUploader(props) {
|
|
|
639
716
|
}
|
|
640
717
|
|
|
641
718
|
// src/components/Input.tsx
|
|
642
|
-
var
|
|
643
|
-
var
|
|
644
|
-
var
|
|
719
|
+
var import_recipes9 = require("@cerberus/styled-system/recipes");
|
|
720
|
+
var import_css9 = require("@cerberus/styled-system/css");
|
|
721
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
645
722
|
function Input(props) {
|
|
646
723
|
const { describedBy, size, startIcon, endIcon, ...nativeProps } = props;
|
|
647
|
-
const inputStyles = (0,
|
|
724
|
+
const inputStyles = (0, import_recipes9.input)({ size });
|
|
648
725
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
649
726
|
const hasEndIcon = Boolean(endIcon);
|
|
650
727
|
const { invalid: InvalidIcon } = $cerberusIcons;
|
|
651
|
-
return /* @__PURE__ */ (0,
|
|
652
|
-
/* @__PURE__ */ (0,
|
|
653
|
-
/* @__PURE__ */ (0,
|
|
728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: inputStyles.root, children: [
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
|
|
730
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
654
731
|
"input",
|
|
655
732
|
{
|
|
656
733
|
...nativeProps,
|
|
@@ -658,42 +735,42 @@ function Input(props) {
|
|
|
658
735
|
...describedBy && { "aria-describedby": describedBy },
|
|
659
736
|
...invalid && { "aria-invalid": true },
|
|
660
737
|
"data-start-icon": Boolean(startIcon),
|
|
661
|
-
className: (0,
|
|
738
|
+
className: (0, import_css9.cx)("peer", nativeProps.className, inputStyles.input)
|
|
662
739
|
}
|
|
663
740
|
),
|
|
664
|
-
/* @__PURE__ */ (0,
|
|
665
|
-
/* @__PURE__ */ (0,
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
|
|
666
743
|
] });
|
|
667
744
|
}
|
|
668
745
|
|
|
669
746
|
// src/components/Label.tsx
|
|
670
|
-
var
|
|
671
|
-
var
|
|
672
|
-
var
|
|
673
|
-
var
|
|
747
|
+
var import_recipes10 = require("@cerberus/styled-system/recipes");
|
|
748
|
+
var import_css10 = require("@cerberus/styled-system/css");
|
|
749
|
+
var import_patterns5 = require("@cerberus/styled-system/patterns");
|
|
750
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
674
751
|
function Label(props) {
|
|
675
752
|
const { hidden, size, ...nativeProps } = props;
|
|
676
753
|
const { required, disabled } = useFieldContext();
|
|
677
754
|
const usage = hidden ? "hidden" : "visible";
|
|
678
|
-
return /* @__PURE__ */ (0,
|
|
755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
679
756
|
"label",
|
|
680
757
|
{
|
|
681
758
|
...nativeProps,
|
|
682
759
|
...disabled && { "data-disabled": true },
|
|
683
|
-
className: (0,
|
|
760
|
+
className: (0, import_css10.cx)(
|
|
684
761
|
nativeProps.className,
|
|
685
|
-
(0,
|
|
686
|
-
(0,
|
|
762
|
+
(0, import_recipes10.label)({ size, usage }),
|
|
763
|
+
(0, import_patterns5.hstack)({
|
|
687
764
|
justify: "space-between",
|
|
688
765
|
w: "full"
|
|
689
766
|
})
|
|
690
767
|
),
|
|
691
768
|
children: [
|
|
692
769
|
props.children,
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
694
771
|
"span",
|
|
695
772
|
{
|
|
696
|
-
className: (0,
|
|
773
|
+
className: (0, import_css10.css)({
|
|
697
774
|
color: "inherit",
|
|
698
775
|
fontSize: "inherit"
|
|
699
776
|
}),
|
|
@@ -706,16 +783,16 @@ function Label(props) {
|
|
|
706
783
|
}
|
|
707
784
|
|
|
708
785
|
// src/components/Modal.tsx
|
|
709
|
-
var
|
|
710
|
-
var
|
|
786
|
+
var import_css11 = require("@cerberus/styled-system/css");
|
|
787
|
+
var import_recipes11 = require("@cerberus/styled-system/recipes");
|
|
711
788
|
var import_react6 = require("react");
|
|
712
|
-
var
|
|
789
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
713
790
|
function ModalEl(props, ref) {
|
|
714
|
-
return /* @__PURE__ */ (0,
|
|
791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
715
792
|
"dialog",
|
|
716
793
|
{
|
|
717
794
|
...props,
|
|
718
|
-
className: (0,
|
|
795
|
+
className: (0, import_css11.cx)(props.className, (0, import_recipes11.modal)().dialog),
|
|
719
796
|
ref
|
|
720
797
|
}
|
|
721
798
|
);
|
|
@@ -723,17 +800,17 @@ function ModalEl(props, ref) {
|
|
|
723
800
|
var Modal = (0, import_react6.forwardRef)(ModalEl);
|
|
724
801
|
|
|
725
802
|
// src/components/ModalHeader.tsx
|
|
726
|
-
var
|
|
727
|
-
var
|
|
728
|
-
var
|
|
803
|
+
var import_css12 = require("@cerberus/styled-system/css");
|
|
804
|
+
var import_patterns6 = require("@cerberus/styled-system/patterns");
|
|
805
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
729
806
|
function ModalHeader(props) {
|
|
730
|
-
return /* @__PURE__ */ (0,
|
|
807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
731
808
|
"div",
|
|
732
809
|
{
|
|
733
810
|
...props,
|
|
734
|
-
className: (0,
|
|
811
|
+
className: (0, import_css12.cx)(
|
|
735
812
|
props.className,
|
|
736
|
-
(0,
|
|
813
|
+
(0, import_patterns6.vstack)({
|
|
737
814
|
alignItems: "flex-start",
|
|
738
815
|
gap: "4",
|
|
739
816
|
mb: "8"
|
|
@@ -744,38 +821,38 @@ function ModalHeader(props) {
|
|
|
744
821
|
}
|
|
745
822
|
|
|
746
823
|
// src/components/ModalHeading.tsx
|
|
747
|
-
var import_css12 = require("@cerberus/styled-system/css");
|
|
748
|
-
var import_recipes11 = require("@cerberus/styled-system/recipes");
|
|
749
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
750
|
-
function ModalHeading(props) {
|
|
751
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { ...props, className: (0, import_css12.cx)(props.className, (0, import_recipes11.modal)().heading) });
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
// src/components/ModalDescription.tsx
|
|
755
824
|
var import_css13 = require("@cerberus/styled-system/css");
|
|
756
825
|
var import_recipes12 = require("@cerberus/styled-system/recipes");
|
|
757
826
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
758
|
-
function
|
|
759
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { ...props, className: (0, import_css13.cx)(props.className, (0, import_recipes12.modal)().
|
|
827
|
+
function ModalHeading(props) {
|
|
828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { ...props, className: (0, import_css13.cx)(props.className, (0, import_recipes12.modal)().heading) });
|
|
760
829
|
}
|
|
761
830
|
|
|
762
|
-
// src/components/
|
|
831
|
+
// src/components/ModalDescription.tsx
|
|
763
832
|
var import_css14 = require("@cerberus/styled-system/css");
|
|
764
|
-
var import_patterns6 = require("@cerberus/styled-system/patterns");
|
|
765
833
|
var import_recipes13 = require("@cerberus/styled-system/recipes");
|
|
766
834
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
835
|
+
function ModalDescription(props) {
|
|
836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { ...props, className: (0, import_css14.cx)(props.className, (0, import_recipes13.modal)().description) });
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// src/components/ModalIcon.tsx
|
|
840
|
+
var import_css15 = require("@cerberus/styled-system/css");
|
|
841
|
+
var import_patterns7 = require("@cerberus/styled-system/patterns");
|
|
842
|
+
var import_recipes14 = require("@cerberus/styled-system/recipes");
|
|
843
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
767
844
|
function ModalIcon(props) {
|
|
768
845
|
const { palette, ...nativeProps } = props;
|
|
769
|
-
return /* @__PURE__ */ (0,
|
|
846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
770
847
|
"div",
|
|
771
848
|
{
|
|
772
849
|
...nativeProps,
|
|
773
|
-
className: (0,
|
|
850
|
+
className: (0, import_css15.cx)(
|
|
774
851
|
nativeProps.className,
|
|
775
|
-
(0,
|
|
852
|
+
(0, import_recipes14.modalIcon)({
|
|
776
853
|
palette
|
|
777
854
|
}),
|
|
778
|
-
(0,
|
|
855
|
+
(0, import_patterns7.circle)()
|
|
779
856
|
),
|
|
780
857
|
children: props.children
|
|
781
858
|
}
|
|
@@ -784,8 +861,8 @@ function ModalIcon(props) {
|
|
|
784
861
|
|
|
785
862
|
// src/components/NavMenuTrigger.tsx
|
|
786
863
|
var import_react8 = require("react");
|
|
787
|
-
var
|
|
788
|
-
var
|
|
864
|
+
var import_css17 = require("@cerberus/styled-system/css");
|
|
865
|
+
var import_recipes15 = require("@cerberus/styled-system/recipes");
|
|
789
866
|
|
|
790
867
|
// src/aria-helpers/nav-menu.aria.ts
|
|
791
868
|
function createNavTriggerProps(values) {
|
|
@@ -796,9 +873,9 @@ function createNavTriggerProps(values) {
|
|
|
796
873
|
}
|
|
797
874
|
|
|
798
875
|
// src/context/navMenu.tsx
|
|
799
|
-
var
|
|
876
|
+
var import_css16 = require("@cerberus/styled-system/css");
|
|
800
877
|
var import_react7 = require("react");
|
|
801
|
-
var
|
|
878
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
802
879
|
var NavMenuContext = (0, import_react7.createContext)(null);
|
|
803
880
|
function NavMenu(props) {
|
|
804
881
|
const triggerRef = (0, import_react7.useRef)(null);
|
|
@@ -816,10 +893,10 @@ function NavMenu(props) {
|
|
|
816
893
|
}),
|
|
817
894
|
[expanded, handleToggle]
|
|
818
895
|
);
|
|
819
|
-
return /* @__PURE__ */ (0,
|
|
896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(NavMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
820
897
|
"nav",
|
|
821
898
|
{
|
|
822
|
-
className: (0,
|
|
899
|
+
className: (0, import_css16.css)({
|
|
823
900
|
position: "relative"
|
|
824
901
|
}),
|
|
825
902
|
children: props.children
|
|
@@ -835,7 +912,7 @@ function useNavMenuContext() {
|
|
|
835
912
|
}
|
|
836
913
|
|
|
837
914
|
// src/components/NavMenuTrigger.tsx
|
|
838
|
-
var
|
|
915
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
839
916
|
function NavMenuTrigger(props) {
|
|
840
917
|
const {
|
|
841
918
|
as,
|
|
@@ -861,18 +938,18 @@ function NavMenuTrigger(props) {
|
|
|
861
938
|
},
|
|
862
939
|
[onClick, onToggle]
|
|
863
940
|
);
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
865
942
|
Show,
|
|
866
943
|
{
|
|
867
944
|
when: hasAs,
|
|
868
|
-
fallback: /* @__PURE__ */ (0,
|
|
945
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
869
946
|
"button",
|
|
870
947
|
{
|
|
871
948
|
...nativeProps,
|
|
872
949
|
...ariaProps,
|
|
873
|
-
className: (0,
|
|
950
|
+
className: (0, import_css17.cx)(
|
|
874
951
|
nativeProps.className,
|
|
875
|
-
(0,
|
|
952
|
+
(0, import_recipes15.button)({
|
|
876
953
|
palette,
|
|
877
954
|
usage,
|
|
878
955
|
shape
|
|
@@ -883,7 +960,7 @@ function NavMenuTrigger(props) {
|
|
|
883
960
|
children: props.children
|
|
884
961
|
}
|
|
885
962
|
),
|
|
886
|
-
children: hasAs && /* @__PURE__ */ (0,
|
|
963
|
+
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
887
964
|
AsSub,
|
|
888
965
|
{
|
|
889
966
|
...nativeProps,
|
|
@@ -898,9 +975,9 @@ function NavMenuTrigger(props) {
|
|
|
898
975
|
|
|
899
976
|
// src/components/NavMenuList.tsx
|
|
900
977
|
var import_react9 = require("react");
|
|
901
|
-
var
|
|
902
|
-
var
|
|
903
|
-
var
|
|
978
|
+
var import_css18 = require("@cerberus/styled-system/css");
|
|
979
|
+
var import_patterns8 = require("@cerberus/styled-system/patterns");
|
|
980
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
904
981
|
function getPosition(position) {
|
|
905
982
|
const defaultPositions = {
|
|
906
983
|
left: "auto",
|
|
@@ -921,7 +998,7 @@ function getPosition(position) {
|
|
|
921
998
|
return defaultPositions;
|
|
922
999
|
}
|
|
923
1000
|
}
|
|
924
|
-
var navListStyles = (0,
|
|
1001
|
+
var navListStyles = (0, import_patterns8.vstack)({
|
|
925
1002
|
alignItems: "flex-start",
|
|
926
1003
|
bgColor: "page.surface.100",
|
|
927
1004
|
boxShadow: "lg",
|
|
@@ -958,12 +1035,12 @@ function NavMenuList(props) {
|
|
|
958
1035
|
() => getPosition(position ?? "bottom"),
|
|
959
1036
|
[position]
|
|
960
1037
|
);
|
|
961
|
-
return /* @__PURE__ */ (0,
|
|
1038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Show, { when: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
962
1039
|
"ul",
|
|
963
1040
|
{
|
|
964
1041
|
...nativeProps,
|
|
965
1042
|
"data-position": position ?? "bottom",
|
|
966
|
-
className: (0,
|
|
1043
|
+
className: (0, import_css18.cx)(nativeProps.className, navListStyles),
|
|
967
1044
|
ref: menuRef,
|
|
968
1045
|
style: locationStyles
|
|
969
1046
|
}
|
|
@@ -971,29 +1048,29 @@ function NavMenuList(props) {
|
|
|
971
1048
|
}
|
|
972
1049
|
|
|
973
1050
|
// src/components/NavMenuLink.tsx
|
|
974
|
-
var
|
|
975
|
-
var
|
|
1051
|
+
var import_css19 = require("@cerberus/styled-system/css");
|
|
1052
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
976
1053
|
function NavMenuLink(props) {
|
|
977
1054
|
const { as, ...nativeProps } = props;
|
|
978
1055
|
const hasAs = Boolean(as);
|
|
979
1056
|
const AsSub = as;
|
|
980
|
-
return /* @__PURE__ */ (0,
|
|
1057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
981
1058
|
"li",
|
|
982
1059
|
{
|
|
983
|
-
className: (0,
|
|
1060
|
+
className: (0, import_css19.css)({
|
|
984
1061
|
w: "full"
|
|
985
1062
|
}),
|
|
986
|
-
children: /* @__PURE__ */ (0,
|
|
1063
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
987
1064
|
Show,
|
|
988
1065
|
{
|
|
989
1066
|
when: hasAs,
|
|
990
|
-
fallback: /* @__PURE__ */ (0,
|
|
1067
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
991
1068
|
"a",
|
|
992
1069
|
{
|
|
993
1070
|
...nativeProps,
|
|
994
|
-
className: (0,
|
|
1071
|
+
className: (0, import_css19.cx)(
|
|
995
1072
|
nativeProps.className,
|
|
996
|
-
(0,
|
|
1073
|
+
(0, import_css19.css)({
|
|
997
1074
|
color: "action.navigation.initial",
|
|
998
1075
|
textStyle: "link",
|
|
999
1076
|
_hover: {
|
|
@@ -1003,7 +1080,7 @@ function NavMenuLink(props) {
|
|
|
1003
1080
|
)
|
|
1004
1081
|
}
|
|
1005
1082
|
),
|
|
1006
|
-
children: hasAs && /* @__PURE__ */ (0,
|
|
1083
|
+
children: hasAs && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AsSub, { ...nativeProps })
|
|
1007
1084
|
}
|
|
1008
1085
|
)
|
|
1009
1086
|
}
|
|
@@ -1011,11 +1088,11 @@ function NavMenuLink(props) {
|
|
|
1011
1088
|
}
|
|
1012
1089
|
|
|
1013
1090
|
// src/components/Notification.tsx
|
|
1014
|
-
var
|
|
1015
|
-
var
|
|
1016
|
-
var
|
|
1091
|
+
var import_css20 = require("@cerberus/styled-system/css");
|
|
1092
|
+
var import_patterns9 = require("@cerberus/styled-system/patterns");
|
|
1093
|
+
var import_recipes16 = require("@cerberus/styled-system/recipes");
|
|
1017
1094
|
var import_react10 = require("react");
|
|
1018
|
-
var
|
|
1095
|
+
var import_icons3 = require("@cerberus/icons");
|
|
1019
1096
|
|
|
1020
1097
|
// src/aria-helpers/trap-focus.aria.ts
|
|
1021
1098
|
function trapFocus(modalRef) {
|
|
@@ -1044,25 +1121,25 @@ function trapFocus(modalRef) {
|
|
|
1044
1121
|
}
|
|
1045
1122
|
|
|
1046
1123
|
// src/components/Notification.tsx
|
|
1047
|
-
var
|
|
1124
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1048
1125
|
function MatchNotificationIcon(props) {
|
|
1049
1126
|
const palette = props.palette || "info";
|
|
1050
1127
|
const key = `${palette}Notification`;
|
|
1051
1128
|
const Icon = $cerberusIcons[key];
|
|
1052
|
-
return /* @__PURE__ */ (0,
|
|
1129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, {});
|
|
1053
1130
|
}
|
|
1054
1131
|
function Notification(props) {
|
|
1055
1132
|
const { children, palette, onClose, ...nativeProps } = props;
|
|
1056
1133
|
const ref = (0, import_react10.useRef)(null);
|
|
1057
1134
|
const onKeyDown = trapFocus(ref);
|
|
1058
|
-
const styles = (0,
|
|
1059
|
-
return /* @__PURE__ */ (0,
|
|
1135
|
+
const styles = (0, import_recipes16.notification)({ palette });
|
|
1136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1060
1137
|
"dialog",
|
|
1061
1138
|
{
|
|
1062
1139
|
...nativeProps,
|
|
1063
|
-
className: (0,
|
|
1140
|
+
className: (0, import_css20.cx)(
|
|
1064
1141
|
nativeProps.className,
|
|
1065
|
-
(0,
|
|
1142
|
+
(0, import_patterns9.hstack)({
|
|
1066
1143
|
position: "relative",
|
|
1067
1144
|
gap: "4"
|
|
1068
1145
|
}),
|
|
@@ -1072,11 +1149,11 @@ function Notification(props) {
|
|
|
1072
1149
|
ref,
|
|
1073
1150
|
role: "alert",
|
|
1074
1151
|
children: [
|
|
1075
|
-
/* @__PURE__ */ (0,
|
|
1076
|
-
/* @__PURE__ */ (0,
|
|
1152
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MatchNotificationIcon, { palette }) }),
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1077
1154
|
"div",
|
|
1078
1155
|
{
|
|
1079
|
-
className: (0,
|
|
1156
|
+
className: (0, import_patterns9.vstack)({
|
|
1080
1157
|
alignItems: "flex-start",
|
|
1081
1158
|
gap: "0",
|
|
1082
1159
|
py: "2"
|
|
@@ -1084,14 +1161,14 @@ function Notification(props) {
|
|
|
1084
1161
|
children
|
|
1085
1162
|
}
|
|
1086
1163
|
),
|
|
1087
|
-
/* @__PURE__ */ (0,
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1088
1165
|
"button",
|
|
1089
1166
|
{
|
|
1090
1167
|
"aria-label": "Close",
|
|
1091
1168
|
className: styles.close,
|
|
1092
1169
|
onClick: onClose,
|
|
1093
1170
|
value: props.id,
|
|
1094
|
-
children: /* @__PURE__ */ (0,
|
|
1171
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_icons3.Close, {})
|
|
1095
1172
|
}
|
|
1096
1173
|
)
|
|
1097
1174
|
]
|
|
@@ -1100,26 +1177,26 @@ function Notification(props) {
|
|
|
1100
1177
|
}
|
|
1101
1178
|
|
|
1102
1179
|
// src/components/NotificationHeading.tsx
|
|
1103
|
-
var
|
|
1104
|
-
var
|
|
1105
|
-
var
|
|
1180
|
+
var import_css21 = require("@cerberus/styled-system/css");
|
|
1181
|
+
var import_recipes17 = require("@cerberus/styled-system/recipes");
|
|
1182
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1106
1183
|
function NotificationHeading(props) {
|
|
1107
1184
|
const { palette, ...nativeProps } = props;
|
|
1108
|
-
const styles = (0,
|
|
1109
|
-
return /* @__PURE__ */ (0,
|
|
1185
|
+
const styles = (0, import_recipes17.notification)({ palette });
|
|
1186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: (0, import_css21.cx)(nativeProps.className, styles.heading), ...nativeProps });
|
|
1110
1187
|
}
|
|
1111
1188
|
|
|
1112
1189
|
// src/components/NotificationDescription.tsx
|
|
1113
|
-
var
|
|
1114
|
-
var
|
|
1115
|
-
var
|
|
1190
|
+
var import_css22 = require("@cerberus/styled-system/css");
|
|
1191
|
+
var import_recipes18 = require("@cerberus/styled-system/recipes");
|
|
1192
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1116
1193
|
function NotificationDescription(props) {
|
|
1117
1194
|
const { palette, ...nativeProps } = props;
|
|
1118
|
-
const styles = (0,
|
|
1119
|
-
return /* @__PURE__ */ (0,
|
|
1195
|
+
const styles = (0, import_recipes18.notification)({ palette });
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1120
1197
|
"p",
|
|
1121
1198
|
{
|
|
1122
|
-
className: (0,
|
|
1199
|
+
className: (0, import_css22.cx)(nativeProps.className, styles.description),
|
|
1123
1200
|
...nativeProps
|
|
1124
1201
|
}
|
|
1125
1202
|
);
|
|
@@ -1133,22 +1210,22 @@ function Portal(props) {
|
|
|
1133
1210
|
}
|
|
1134
1211
|
|
|
1135
1212
|
// src/components/Radio.tsx
|
|
1136
|
-
var
|
|
1137
|
-
var
|
|
1138
|
-
var
|
|
1139
|
-
var
|
|
1213
|
+
var import_css23 = require("@cerberus/styled-system/css");
|
|
1214
|
+
var import_patterns10 = require("@cerberus/styled-system/patterns");
|
|
1215
|
+
var import_recipes19 = require("@cerberus/styled-system/recipes");
|
|
1216
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1140
1217
|
function Radio(props) {
|
|
1141
1218
|
const { children, size, ...nativeProps } = props;
|
|
1142
1219
|
const { invalid, ...state } = useFieldContext();
|
|
1143
|
-
const styles = (0,
|
|
1144
|
-
return /* @__PURE__ */ (0,
|
|
1145
|
-
/* @__PURE__ */ (0,
|
|
1220
|
+
const styles = (0, import_recipes19.radio)({ size });
|
|
1221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: (0, import_css23.cx)("group", (0, import_patterns10.hstack)(), styles.root), tabIndex: 0, children: [
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1146
1223
|
"input",
|
|
1147
1224
|
{
|
|
1148
1225
|
...nativeProps,
|
|
1149
1226
|
...state,
|
|
1150
1227
|
...invalid && { "aria-invalid": true },
|
|
1151
|
-
className: (0,
|
|
1228
|
+
className: (0, import_css23.cx)(nativeProps.className, styles.input),
|
|
1152
1229
|
tabIndex: -1,
|
|
1153
1230
|
type: "radio"
|
|
1154
1231
|
}
|
|
@@ -1158,19 +1235,19 @@ function Radio(props) {
|
|
|
1158
1235
|
}
|
|
1159
1236
|
|
|
1160
1237
|
// src/components/Select.tsx
|
|
1161
|
-
var
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1164
|
-
var
|
|
1238
|
+
var import_css24 = require("@cerberus/styled-system/css");
|
|
1239
|
+
var import_patterns11 = require("@cerberus/styled-system/patterns");
|
|
1240
|
+
var import_recipes20 = require("@cerberus/styled-system/recipes");
|
|
1241
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1165
1242
|
function Select(props) {
|
|
1166
1243
|
const { describedBy, size, ...nativeProps } = props;
|
|
1167
1244
|
const { invalid, ...fieldStates } = useFieldContext();
|
|
1168
1245
|
const { invalid: InvalidIcon, selectArrow: SelectArrow } = $cerberusIcons;
|
|
1169
|
-
const styles = (0,
|
|
1246
|
+
const styles = (0, import_recipes20.select)({
|
|
1170
1247
|
size
|
|
1171
1248
|
});
|
|
1172
|
-
return /* @__PURE__ */ (0,
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: styles.root, children: [
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1174
1251
|
"select",
|
|
1175
1252
|
{
|
|
1176
1253
|
...nativeProps,
|
|
@@ -1180,41 +1257,41 @@ function Select(props) {
|
|
|
1180
1257
|
className: styles.input
|
|
1181
1258
|
}
|
|
1182
1259
|
),
|
|
1183
|
-
/* @__PURE__ */ (0,
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1184
1261
|
"span",
|
|
1185
1262
|
{
|
|
1186
|
-
className: (0,
|
|
1263
|
+
className: (0, import_css24.cx)(
|
|
1187
1264
|
styles.iconStack,
|
|
1188
|
-
(0,
|
|
1265
|
+
(0, import_patterns11.hstack)({
|
|
1189
1266
|
gap: "2"
|
|
1190
1267
|
})
|
|
1191
1268
|
),
|
|
1192
1269
|
children: [
|
|
1193
|
-
/* @__PURE__ */ (0,
|
|
1270
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1194
1271
|
"span",
|
|
1195
1272
|
{
|
|
1196
1273
|
...invalid && { "data-invalid": true },
|
|
1197
1274
|
className: styles.stateIcon,
|
|
1198
|
-
children: /* @__PURE__ */ (0,
|
|
1275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(InvalidIcon, {})
|
|
1199
1276
|
}
|
|
1200
1277
|
) }),
|
|
1201
|
-
/* @__PURE__ */ (0,
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: styles.arrowIcon, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectArrow, {}) })
|
|
1202
1279
|
]
|
|
1203
1280
|
}
|
|
1204
1281
|
)
|
|
1205
1282
|
] });
|
|
1206
1283
|
}
|
|
1207
1284
|
function Option(props) {
|
|
1208
|
-
return /* @__PURE__ */ (0,
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { ...props });
|
|
1209
1286
|
}
|
|
1210
1287
|
|
|
1211
1288
|
// src/components/Tab.tsx
|
|
1212
1289
|
var import_react13 = require("react");
|
|
1213
1290
|
|
|
1214
1291
|
// src/context/tabs.tsx
|
|
1215
|
-
var
|
|
1292
|
+
var import_recipes21 = require("@cerberus/styled-system/recipes");
|
|
1216
1293
|
var import_react11 = require("react");
|
|
1217
|
-
var
|
|
1294
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1218
1295
|
var TabsContext = (0, import_react11.createContext)(null);
|
|
1219
1296
|
function Tabs(props) {
|
|
1220
1297
|
const { cache, active, id, palette } = props;
|
|
@@ -1228,7 +1305,7 @@ function Tabs(props) {
|
|
|
1228
1305
|
tabs: tabsList,
|
|
1229
1306
|
id: uuid,
|
|
1230
1307
|
active: activeTab,
|
|
1231
|
-
styles: (0,
|
|
1308
|
+
styles: (0, import_recipes21.tabs)({ palette }),
|
|
1232
1309
|
onTabUpdate: setActiveTab
|
|
1233
1310
|
}),
|
|
1234
1311
|
[activeTab, setActiveTab, palette, uuid, tabsList]
|
|
@@ -1246,7 +1323,7 @@ function Tabs(props) {
|
|
|
1246
1323
|
window.localStorage.setItem(uuid, activeTab);
|
|
1247
1324
|
}
|
|
1248
1325
|
}, [activeTab, cache]);
|
|
1249
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsContext.Provider, { value, children: props.children });
|
|
1250
1327
|
}
|
|
1251
1328
|
function useTabsContext() {
|
|
1252
1329
|
const context = (0, import_react11.useContext)(TabsContext);
|
|
@@ -1257,7 +1334,7 @@ function useTabsContext() {
|
|
|
1257
1334
|
}
|
|
1258
1335
|
|
|
1259
1336
|
// src/components/Tab.tsx
|
|
1260
|
-
var
|
|
1337
|
+
var import_css25 = require("@cerberus/styled-system/css");
|
|
1261
1338
|
|
|
1262
1339
|
// src/aria-helpers/tabs.aria.ts
|
|
1263
1340
|
var import_react12 = require("react");
|
|
@@ -1316,7 +1393,7 @@ function useTabsKeyboardNavigation() {
|
|
|
1316
1393
|
}
|
|
1317
1394
|
|
|
1318
1395
|
// src/components/Tab.tsx
|
|
1319
|
-
var
|
|
1396
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1320
1397
|
function Tab(props) {
|
|
1321
1398
|
const { value, ...nativeProps } = props;
|
|
1322
1399
|
const { active, onTabUpdate, styles } = useTabsContext();
|
|
@@ -1328,7 +1405,7 @@ function Tab(props) {
|
|
|
1328
1405
|
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
1329
1406
|
startTransition(() => onTabUpdate(e.currentTarget.value));
|
|
1330
1407
|
}
|
|
1331
|
-
return /* @__PURE__ */ (0,
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1332
1409
|
"button",
|
|
1333
1410
|
{
|
|
1334
1411
|
...nativeProps,
|
|
@@ -1337,7 +1414,7 @@ function Tab(props) {
|
|
|
1337
1414
|
"aria-busy": isPending,
|
|
1338
1415
|
"aria-selected": isActive,
|
|
1339
1416
|
id: value,
|
|
1340
|
-
className: (0,
|
|
1417
|
+
className: (0, import_css25.cx)(nativeProps.className, styles.tab),
|
|
1341
1418
|
onClick: handleClick,
|
|
1342
1419
|
role: "tab",
|
|
1343
1420
|
ref,
|
|
@@ -1347,20 +1424,20 @@ function Tab(props) {
|
|
|
1347
1424
|
}
|
|
1348
1425
|
|
|
1349
1426
|
// src/components/TabList.tsx
|
|
1350
|
-
var
|
|
1351
|
-
var
|
|
1352
|
-
var
|
|
1427
|
+
var import_css26 = require("@cerberus/styled-system/css");
|
|
1428
|
+
var import_patterns12 = require("@cerberus/styled-system/patterns");
|
|
1429
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1353
1430
|
function TabList(props) {
|
|
1354
1431
|
const { description, ...nativeProps } = props;
|
|
1355
1432
|
const { id, styles } = useTabsContext();
|
|
1356
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1357
1434
|
"div",
|
|
1358
1435
|
{
|
|
1359
1436
|
...nativeProps,
|
|
1360
1437
|
"aria-describedby": description,
|
|
1361
|
-
className: (0,
|
|
1438
|
+
className: (0, import_css26.cx)(
|
|
1362
1439
|
nativeProps.className,
|
|
1363
|
-
(0,
|
|
1440
|
+
(0, import_patterns12.hstack)({
|
|
1364
1441
|
gap: "0"
|
|
1365
1442
|
}),
|
|
1366
1443
|
styles.tabList
|
|
@@ -1371,20 +1448,20 @@ function TabList(props) {
|
|
|
1371
1448
|
}
|
|
1372
1449
|
|
|
1373
1450
|
// src/components/TabPanel.tsx
|
|
1374
|
-
var
|
|
1451
|
+
var import_css27 = require("@cerberus/styled-system/css");
|
|
1375
1452
|
var import_react14 = require("react");
|
|
1376
|
-
var
|
|
1453
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1377
1454
|
function TabPanel(props) {
|
|
1378
1455
|
const { tab, ...nativeProps } = props;
|
|
1379
1456
|
const { active, styles } = useTabsContext();
|
|
1380
1457
|
const isActive = (0, import_react14.useMemo)(() => active === tab, [active, tab]);
|
|
1381
|
-
return /* @__PURE__ */ (0,
|
|
1458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Show, { when: isActive, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1382
1459
|
"div",
|
|
1383
1460
|
{
|
|
1384
1461
|
...nativeProps,
|
|
1385
1462
|
...isActive && { tabIndex: 0 },
|
|
1386
1463
|
"aria-labelledby": tab,
|
|
1387
|
-
className: (0,
|
|
1464
|
+
className: (0, import_css27.cx)(nativeProps.className, styles.tabPanel),
|
|
1388
1465
|
id: `panel:${tab}`,
|
|
1389
1466
|
role: "tabpanel"
|
|
1390
1467
|
}
|
|
@@ -1392,60 +1469,60 @@ function TabPanel(props) {
|
|
|
1392
1469
|
}
|
|
1393
1470
|
|
|
1394
1471
|
// src/components/Table.tsx
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1397
|
-
var
|
|
1472
|
+
var import_css28 = require("@cerberus/styled-system/css");
|
|
1473
|
+
var import_recipes22 = require("@cerberus/styled-system/recipes");
|
|
1474
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1398
1475
|
function Table(props) {
|
|
1399
1476
|
const { caption, children, ...nativeProps } = props;
|
|
1400
|
-
const styles = (0,
|
|
1401
|
-
return /* @__PURE__ */ (0,
|
|
1477
|
+
const styles = (0, import_recipes22.table)();
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1402
1479
|
"table",
|
|
1403
1480
|
{
|
|
1404
1481
|
...nativeProps,
|
|
1405
|
-
className: (0,
|
|
1482
|
+
className: (0, import_css28.cx)(nativeProps.className, styles.table),
|
|
1406
1483
|
children: [
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("caption", { className: styles.caption, children: caption }),
|
|
1408
1485
|
children
|
|
1409
1486
|
]
|
|
1410
1487
|
}
|
|
1411
1488
|
) });
|
|
1412
1489
|
}
|
|
1413
1490
|
function Tr(props) {
|
|
1414
|
-
return /* @__PURE__ */ (0,
|
|
1491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tr", { ...props });
|
|
1415
1492
|
}
|
|
1416
1493
|
|
|
1417
1494
|
// src/components/Thead.tsx
|
|
1418
|
-
var
|
|
1419
|
-
var
|
|
1420
|
-
var
|
|
1495
|
+
var import_css29 = require("@cerberus/styled-system/css");
|
|
1496
|
+
var import_recipes23 = require("@cerberus/styled-system/recipes");
|
|
1497
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1421
1498
|
function Thead(props) {
|
|
1422
|
-
return /* @__PURE__ */ (0,
|
|
1499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("thead", { ...props, className: (0, import_css29.cx)(props.className, (0, import_recipes23.thead)()) });
|
|
1423
1500
|
}
|
|
1424
1501
|
|
|
1425
1502
|
// src/components/Th.tsx
|
|
1426
|
-
var
|
|
1427
|
-
var
|
|
1428
|
-
var
|
|
1503
|
+
var import_css30 = require("@cerberus/styled-system/css");
|
|
1504
|
+
var import_recipes24 = require("@cerberus/styled-system/recipes");
|
|
1505
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1429
1506
|
function Th(props) {
|
|
1430
1507
|
const { size, onClick, ...nativeProps } = props;
|
|
1431
|
-
return /* @__PURE__ */ (0,
|
|
1508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1432
1509
|
Show,
|
|
1433
1510
|
{
|
|
1434
1511
|
when: Boolean(onClick),
|
|
1435
|
-
fallback: /* @__PURE__ */ (0,
|
|
1512
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1436
1513
|
"th",
|
|
1437
1514
|
{
|
|
1438
1515
|
...nativeProps,
|
|
1439
|
-
className: (0,
|
|
1516
|
+
className: (0, import_css30.cx)(nativeProps.className, (0, import_recipes24.th)({ size }))
|
|
1440
1517
|
}
|
|
1441
1518
|
),
|
|
1442
|
-
children: /* @__PURE__ */ (0,
|
|
1519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("th", { ...nativeProps, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1443
1520
|
"button",
|
|
1444
1521
|
{
|
|
1445
|
-
className: (0,
|
|
1522
|
+
className: (0, import_css30.cx)(
|
|
1446
1523
|
nativeProps.className,
|
|
1447
|
-
(0,
|
|
1448
|
-
(0,
|
|
1524
|
+
(0, import_recipes24.th)({ size }),
|
|
1525
|
+
(0, import_css30.css)({
|
|
1449
1526
|
alignItems: "center",
|
|
1450
1527
|
display: "inline-flex",
|
|
1451
1528
|
justifyContent: "space-between",
|
|
@@ -1462,18 +1539,18 @@ function Th(props) {
|
|
|
1462
1539
|
}
|
|
1463
1540
|
|
|
1464
1541
|
// src/components/Td.tsx
|
|
1465
|
-
var
|
|
1466
|
-
var
|
|
1467
|
-
var
|
|
1542
|
+
var import_css31 = require("@cerberus/styled-system/css");
|
|
1543
|
+
var import_recipes25 = require("@cerberus/styled-system/recipes");
|
|
1544
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1468
1545
|
function Td(props) {
|
|
1469
1546
|
const { size, ...nativeProps } = props;
|
|
1470
|
-
return /* @__PURE__ */ (0,
|
|
1547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1471
1548
|
"td",
|
|
1472
1549
|
{
|
|
1473
1550
|
...nativeProps,
|
|
1474
|
-
className: (0,
|
|
1551
|
+
className: (0, import_css31.cx)(
|
|
1475
1552
|
nativeProps.className,
|
|
1476
|
-
(0,
|
|
1553
|
+
(0, import_recipes25.td)({
|
|
1477
1554
|
size
|
|
1478
1555
|
})
|
|
1479
1556
|
)
|
|
@@ -1482,18 +1559,18 @@ function Td(props) {
|
|
|
1482
1559
|
}
|
|
1483
1560
|
|
|
1484
1561
|
// src/components/Tbody.tsx
|
|
1485
|
-
var
|
|
1486
|
-
var
|
|
1487
|
-
var
|
|
1562
|
+
var import_recipes26 = require("@cerberus/styled-system/recipes");
|
|
1563
|
+
var import_css32 = require("@cerberus/styled-system/css");
|
|
1564
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1488
1565
|
function Tbody(props) {
|
|
1489
1566
|
const { decoration, ...nativeProps } = props;
|
|
1490
|
-
return /* @__PURE__ */ (0,
|
|
1567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1491
1568
|
"tbody",
|
|
1492
1569
|
{
|
|
1493
1570
|
...nativeProps,
|
|
1494
|
-
className: (0,
|
|
1571
|
+
className: (0, import_css32.cx)(
|
|
1495
1572
|
nativeProps.className,
|
|
1496
|
-
(0,
|
|
1573
|
+
(0, import_recipes26.tbody)({
|
|
1497
1574
|
decoration
|
|
1498
1575
|
})
|
|
1499
1576
|
)
|
|
@@ -1502,23 +1579,23 @@ function Tbody(props) {
|
|
|
1502
1579
|
}
|
|
1503
1580
|
|
|
1504
1581
|
// src/components/Tag.tsx
|
|
1505
|
-
var
|
|
1506
|
-
var
|
|
1507
|
-
var
|
|
1508
|
-
var
|
|
1582
|
+
var import_icons4 = require("@cerberus/icons");
|
|
1583
|
+
var import_css33 = require("@cerberus/styled-system/css");
|
|
1584
|
+
var import_recipes27 = require("@cerberus/styled-system/recipes");
|
|
1585
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1509
1586
|
function Tag(props) {
|
|
1510
1587
|
const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props;
|
|
1511
1588
|
const palette = (props == null ? void 0 : props.palette) ?? "page";
|
|
1512
1589
|
const isClosable = Boolean(onClick);
|
|
1513
1590
|
const shape = isClosable ? "pill" : initShape;
|
|
1514
1591
|
const closableStyles = isClosable ? closableCss : "";
|
|
1515
|
-
return /* @__PURE__ */ (0,
|
|
1592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1516
1593
|
"span",
|
|
1517
1594
|
{
|
|
1518
1595
|
...nativeProps,
|
|
1519
|
-
className: (0,
|
|
1596
|
+
className: (0, import_css33.cx)(
|
|
1520
1597
|
nativeProps.className,
|
|
1521
|
-
(0,
|
|
1598
|
+
(0, import_recipes27.tag)({
|
|
1522
1599
|
gradient,
|
|
1523
1600
|
palette,
|
|
1524
1601
|
shape,
|
|
@@ -1528,47 +1605,47 @@ function Tag(props) {
|
|
|
1528
1605
|
),
|
|
1529
1606
|
children: [
|
|
1530
1607
|
props.children,
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Show, { when: isClosable, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1532
1609
|
"button",
|
|
1533
1610
|
{
|
|
1534
1611
|
"aria-label": "Close",
|
|
1535
|
-
className: (0,
|
|
1612
|
+
className: (0, import_recipes27.iconButton)({
|
|
1536
1613
|
palette: "action",
|
|
1537
1614
|
usage: "filled",
|
|
1538
1615
|
size: "sm"
|
|
1539
1616
|
}),
|
|
1540
1617
|
onClick,
|
|
1541
|
-
children: /* @__PURE__ */ (0,
|
|
1618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons4.Close, {})
|
|
1542
1619
|
}
|
|
1543
1620
|
) })
|
|
1544
1621
|
]
|
|
1545
1622
|
}
|
|
1546
1623
|
);
|
|
1547
1624
|
}
|
|
1548
|
-
var closableCss = (0,
|
|
1625
|
+
var closableCss = (0, import_css33.css)({
|
|
1549
1626
|
bgColor: "action.bg.active",
|
|
1550
1627
|
color: "action.text.initial",
|
|
1551
1628
|
paddingInlineEnd: "0"
|
|
1552
1629
|
});
|
|
1553
1630
|
|
|
1554
1631
|
// src/components/Textarea.tsx
|
|
1555
|
-
var
|
|
1556
|
-
var
|
|
1557
|
-
var
|
|
1632
|
+
var import_css34 = require("@cerberus/styled-system/css");
|
|
1633
|
+
var import_recipes28 = require("@cerberus/styled-system/recipes");
|
|
1634
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1558
1635
|
function Textarea(props) {
|
|
1559
1636
|
const { describedBy, ...nativeProps } = props;
|
|
1560
1637
|
const { invalid, ...fieldState } = useFieldContext();
|
|
1561
|
-
return /* @__PURE__ */ (0,
|
|
1638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1562
1639
|
"textarea",
|
|
1563
1640
|
{
|
|
1564
1641
|
...nativeProps,
|
|
1565
1642
|
...fieldState,
|
|
1566
1643
|
...describedBy && { "aria-describedby": describedBy },
|
|
1567
1644
|
...invalid && { "aria-invalid": true },
|
|
1568
|
-
className: (0,
|
|
1645
|
+
className: (0, import_css34.cx)(
|
|
1569
1646
|
props.className,
|
|
1570
|
-
(0,
|
|
1571
|
-
(0,
|
|
1647
|
+
(0, import_recipes28.input)().input,
|
|
1648
|
+
(0, import_css34.css)({
|
|
1572
1649
|
pxi: "2",
|
|
1573
1650
|
py: "2",
|
|
1574
1651
|
resize: "vertical"
|
|
@@ -1580,43 +1657,43 @@ function Textarea(props) {
|
|
|
1580
1657
|
}
|
|
1581
1658
|
|
|
1582
1659
|
// src/components/Toggle.tsx
|
|
1583
|
-
var
|
|
1584
|
-
var
|
|
1585
|
-
var
|
|
1586
|
-
var
|
|
1660
|
+
var import_css35 = require("@cerberus/styled-system/css");
|
|
1661
|
+
var import_patterns13 = require("@cerberus/styled-system/patterns");
|
|
1662
|
+
var import_recipes29 = require("@cerberus/styled-system/recipes");
|
|
1663
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1587
1664
|
function Toggle(props) {
|
|
1588
1665
|
const { size, describedBy, ...nativeProps } = props;
|
|
1589
|
-
const styles = (0,
|
|
1666
|
+
const styles = (0, import_recipes29.toggle)({ size });
|
|
1590
1667
|
const { invalid, ...state } = useFieldContext();
|
|
1591
1668
|
const Icon = $cerberusIcons.toggleChecked;
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1593
1670
|
"span",
|
|
1594
1671
|
{
|
|
1595
|
-
className: (0,
|
|
1672
|
+
className: (0, import_css35.cx)("group", styles.track, (0, import_patterns13.hstack)()),
|
|
1596
1673
|
"data-checked": props.checked || props.defaultChecked,
|
|
1597
1674
|
children: [
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1675
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1599
1676
|
"input",
|
|
1600
1677
|
{
|
|
1601
1678
|
...nativeProps,
|
|
1602
1679
|
...state,
|
|
1603
1680
|
...describedBy && { "aria-describedby": describedBy },
|
|
1604
1681
|
...invalid && { "aria-invalid": true },
|
|
1605
|
-
className: (0,
|
|
1682
|
+
className: (0, import_css35.cx)("peer", styles.input),
|
|
1606
1683
|
role: "switch",
|
|
1607
1684
|
type: "checkbox"
|
|
1608
1685
|
}
|
|
1609
1686
|
),
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1611
1688
|
"span",
|
|
1612
1689
|
{
|
|
1613
|
-
className: (0,
|
|
1690
|
+
className: (0, import_css35.cx)(
|
|
1614
1691
|
styles.thumb,
|
|
1615
|
-
(0,
|
|
1692
|
+
(0, import_patterns13.vstack)({
|
|
1616
1693
|
justify: "center"
|
|
1617
1694
|
})
|
|
1618
1695
|
),
|
|
1619
|
-
children: /* @__PURE__ */ (0,
|
|
1696
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, {})
|
|
1620
1697
|
}
|
|
1621
1698
|
)
|
|
1622
1699
|
]
|
|
@@ -1626,8 +1703,8 @@ function Toggle(props) {
|
|
|
1626
1703
|
|
|
1627
1704
|
// src/context/confirm-modal.tsx
|
|
1628
1705
|
var import_react16 = require("react");
|
|
1629
|
-
var
|
|
1630
|
-
var
|
|
1706
|
+
var import_css36 = require("@cerberus/styled-system/css");
|
|
1707
|
+
var import_patterns14 = require("@cerberus/styled-system/patterns");
|
|
1631
1708
|
|
|
1632
1709
|
// src/hooks/useModal.ts
|
|
1633
1710
|
var import_react15 = require("react");
|
|
@@ -1651,7 +1728,7 @@ function useModal() {
|
|
|
1651
1728
|
}
|
|
1652
1729
|
|
|
1653
1730
|
// src/context/confirm-modal.tsx
|
|
1654
|
-
var
|
|
1731
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1655
1732
|
var ConfirmModalContext = (0, import_react16.createContext)(null);
|
|
1656
1733
|
function ConfirmModal(props) {
|
|
1657
1734
|
const { modalRef, show, close } = useModal();
|
|
@@ -1691,33 +1768,33 @@ function ConfirmModal(props) {
|
|
|
1691
1768
|
}),
|
|
1692
1769
|
[handleShow]
|
|
1693
1770
|
);
|
|
1694
|
-
return /* @__PURE__ */ (0,
|
|
1771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(ConfirmModalContext.Provider, { value, children: [
|
|
1695
1772
|
props.children,
|
|
1696
|
-
/* @__PURE__ */ (0,
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(ModalHeader, { children: [
|
|
1775
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1699
1776
|
Show,
|
|
1700
1777
|
{
|
|
1701
1778
|
when: palette === "danger",
|
|
1702
|
-
fallback: /* @__PURE__ */ (0,
|
|
1703
|
-
children: /* @__PURE__ */ (0,
|
|
1779
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ModalIcon, { palette: "action", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ConfirmIcon, { size: 24 }) }),
|
|
1780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ModalIcon, { palette: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ConfirmIcon, { size: 24 }) })
|
|
1704
1781
|
}
|
|
1705
1782
|
),
|
|
1706
|
-
/* @__PURE__ */ (0,
|
|
1707
|
-
/* @__PURE__ */ (0,
|
|
1783
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
1708
1785
|
] }),
|
|
1709
|
-
/* @__PURE__ */ (0,
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
1710
1787
|
"div",
|
|
1711
1788
|
{
|
|
1712
|
-
className: (0,
|
|
1789
|
+
className: (0, import_patterns14.hstack)({
|
|
1713
1790
|
gap: "4"
|
|
1714
1791
|
}),
|
|
1715
1792
|
children: [
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1793
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1717
1794
|
Button,
|
|
1718
1795
|
{
|
|
1719
1796
|
autoFocus: true,
|
|
1720
|
-
className: (0,
|
|
1797
|
+
className: (0, import_css36.css)({
|
|
1721
1798
|
w: "1/2"
|
|
1722
1799
|
}),
|
|
1723
1800
|
name: "confirm",
|
|
@@ -1727,10 +1804,10 @@ function ConfirmModal(props) {
|
|
|
1727
1804
|
children: content == null ? void 0 : content.actionText
|
|
1728
1805
|
}
|
|
1729
1806
|
),
|
|
1730
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1731
1808
|
Button,
|
|
1732
1809
|
{
|
|
1733
|
-
className: (0,
|
|
1810
|
+
className: (0, import_css36.css)({
|
|
1734
1811
|
w: "1/2"
|
|
1735
1812
|
}),
|
|
1736
1813
|
name: "cancel",
|
|
@@ -1758,14 +1835,14 @@ function useConfirmModal() {
|
|
|
1758
1835
|
|
|
1759
1836
|
// src/context/notification-center.tsx
|
|
1760
1837
|
var import_react17 = require("react");
|
|
1761
|
-
var
|
|
1762
|
-
var
|
|
1763
|
-
var
|
|
1764
|
-
var
|
|
1838
|
+
var import_patterns15 = require("@cerberus/styled-system/patterns");
|
|
1839
|
+
var import_recipes30 = require("@cerberus/styled-system/recipes");
|
|
1840
|
+
var import_css37 = require("@cerberus/styled-system/css");
|
|
1841
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1765
1842
|
var NotificationsContext = (0, import_react17.createContext)(null);
|
|
1766
1843
|
function NotificationCenter(props) {
|
|
1767
1844
|
const [activeNotifications, setActiveNotifications] = (0, import_react17.useState)([]);
|
|
1768
|
-
const styles = (0,
|
|
1845
|
+
const styles = (0, import_recipes30.notification)();
|
|
1769
1846
|
const handleNotify = (0, import_react17.useCallback)((options) => {
|
|
1770
1847
|
setActiveNotifications((prev) => {
|
|
1771
1848
|
const id = `${options.palette}:${prev.length + 1}`;
|
|
@@ -1794,13 +1871,13 @@ function NotificationCenter(props) {
|
|
|
1794
1871
|
}),
|
|
1795
1872
|
[handleNotify]
|
|
1796
1873
|
);
|
|
1797
|
-
return /* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(NotificationsContext.Provider, { value, children: [
|
|
1798
1875
|
props.children,
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1800
|
-
/* @__PURE__ */ (0,
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Show, { when: activeNotifications.length > 0, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Portal, { container: props.container, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: styles.center, children: [
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Show, { when: activeNotifications.length >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1801
1878
|
Button,
|
|
1802
1879
|
{
|
|
1803
|
-
className: (0,
|
|
1880
|
+
className: (0, import_css37.cx)(styles.closeAll, (0, import_patterns15.animateIn)()),
|
|
1804
1881
|
onClick: handleCloseAll,
|
|
1805
1882
|
palette: "action",
|
|
1806
1883
|
shape: "rounded",
|
|
@@ -1809,17 +1886,17 @@ function NotificationCenter(props) {
|
|
|
1809
1886
|
children: "Close all"
|
|
1810
1887
|
}
|
|
1811
1888
|
) }),
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1813
1890
|
"div",
|
|
1814
1891
|
{
|
|
1815
|
-
className: (0,
|
|
1892
|
+
className: (0, import_patterns15.vstack)({
|
|
1816
1893
|
alignItems: "flex-end",
|
|
1817
1894
|
gap: "4"
|
|
1818
1895
|
}),
|
|
1819
1896
|
style: {
|
|
1820
1897
|
alignItems: "flex-end"
|
|
1821
1898
|
},
|
|
1822
|
-
children: activeNotifications.map((option) => /* @__PURE__ */ (0,
|
|
1899
|
+
children: activeNotifications.map((option) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
1823
1900
|
Notification,
|
|
1824
1901
|
{
|
|
1825
1902
|
id: option.id,
|
|
@@ -1827,8 +1904,8 @@ function NotificationCenter(props) {
|
|
|
1827
1904
|
open: true,
|
|
1828
1905
|
palette: option.palette,
|
|
1829
1906
|
children: [
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1907
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationHeading, { palette: option.palette, children: option.heading }),
|
|
1908
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationDescription, { palette: option.palette, children: option.description })
|
|
1832
1909
|
]
|
|
1833
1910
|
},
|
|
1834
1911
|
option.id
|
|
@@ -1850,9 +1927,9 @@ function useNotificationCenter() {
|
|
|
1850
1927
|
|
|
1851
1928
|
// src/context/prompt-modal.tsx
|
|
1852
1929
|
var import_react18 = require("react");
|
|
1853
|
-
var
|
|
1854
|
-
var
|
|
1855
|
-
var
|
|
1930
|
+
var import_css38 = require("@cerberus/styled-system/css");
|
|
1931
|
+
var import_patterns16 = require("@cerberus/styled-system/patterns");
|
|
1932
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1856
1933
|
var PromptModalContext = (0, import_react18.createContext)(null);
|
|
1857
1934
|
function PromptModal(props) {
|
|
1858
1935
|
const { modalRef, show, close } = useModal();
|
|
@@ -1902,36 +1979,36 @@ function PromptModal(props) {
|
|
|
1902
1979
|
}),
|
|
1903
1980
|
[handleShow]
|
|
1904
1981
|
);
|
|
1905
|
-
return /* @__PURE__ */ (0,
|
|
1982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(PromptModalContext.Provider, { value, children: [
|
|
1906
1983
|
props.children,
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
1909
|
-
/* @__PURE__ */ (0,
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(ModalHeader, { children: [
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1910
1987
|
Show,
|
|
1911
1988
|
{
|
|
1912
1989
|
when: palette === "danger",
|
|
1913
|
-
fallback: /* @__PURE__ */ (0,
|
|
1914
|
-
children: /* @__PURE__ */ (0,
|
|
1990
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalIcon, { palette: "action", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PromptIcon, { size: 24 }) }),
|
|
1991
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalIcon, { palette: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PromptIcon, { size: 24 }) })
|
|
1915
1992
|
}
|
|
1916
1993
|
),
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1918
|
-
/* @__PURE__ */ (0,
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
1919
1996
|
] }),
|
|
1920
|
-
/* @__PURE__ */ (0,
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1921
1998
|
"div",
|
|
1922
1999
|
{
|
|
1923
|
-
className: (0,
|
|
2000
|
+
className: (0, import_patterns16.vstack)({
|
|
1924
2001
|
alignItems: "flex-start",
|
|
1925
2002
|
mt: "4",
|
|
1926
2003
|
mb: "8"
|
|
1927
2004
|
}),
|
|
1928
|
-
children: /* @__PURE__ */ (0,
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
2005
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Field, { invalid: !isValid, children: [
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Label, { htmlFor: "confirm", size: "md", children: [
|
|
1930
2007
|
"Type",
|
|
1931
|
-
/* @__PURE__ */ (0,
|
|
2008
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1932
2009
|
"strong",
|
|
1933
2010
|
{
|
|
1934
|
-
className: (0,
|
|
2011
|
+
className: (0, import_css38.css)({
|
|
1935
2012
|
textTransform: "uppercase"
|
|
1936
2013
|
}),
|
|
1937
2014
|
children: content == null ? void 0 : content.key
|
|
@@ -1939,7 +2016,7 @@ function PromptModal(props) {
|
|
|
1939
2016
|
),
|
|
1940
2017
|
"to confirm"
|
|
1941
2018
|
] }),
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
2019
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1943
2020
|
Input,
|
|
1944
2021
|
{
|
|
1945
2022
|
id: "confirm",
|
|
@@ -1951,19 +2028,19 @@ function PromptModal(props) {
|
|
|
1951
2028
|
] })
|
|
1952
2029
|
}
|
|
1953
2030
|
),
|
|
1954
|
-
/* @__PURE__ */ (0,
|
|
2031
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
1955
2032
|
"div",
|
|
1956
2033
|
{
|
|
1957
|
-
className: (0,
|
|
2034
|
+
className: (0, import_patterns16.hstack)({
|
|
1958
2035
|
justifyContent: "stretch",
|
|
1959
2036
|
gap: "4"
|
|
1960
2037
|
}),
|
|
1961
2038
|
children: [
|
|
1962
|
-
/* @__PURE__ */ (0,
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1963
2040
|
Button,
|
|
1964
2041
|
{
|
|
1965
2042
|
autoFocus: true,
|
|
1966
|
-
className: (0,
|
|
2043
|
+
className: (0, import_css38.css)({
|
|
1967
2044
|
w: "1/2"
|
|
1968
2045
|
}),
|
|
1969
2046
|
disabled: !isValid,
|
|
@@ -1974,10 +2051,10 @@ function PromptModal(props) {
|
|
|
1974
2051
|
children: content == null ? void 0 : content.actionText
|
|
1975
2052
|
}
|
|
1976
2053
|
),
|
|
1977
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1978
2055
|
Button,
|
|
1979
2056
|
{
|
|
1980
|
-
className: (0,
|
|
2057
|
+
className: (0, import_css38.css)({
|
|
1981
2058
|
w: "1/2"
|
|
1982
2059
|
}),
|
|
1983
2060
|
name: "cancel",
|
|
@@ -2052,7 +2129,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light") {
|
|
|
2052
2129
|
}
|
|
2053
2130
|
|
|
2054
2131
|
// src/context/theme.tsx
|
|
2055
|
-
var
|
|
2132
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2056
2133
|
var THEME_KEY = "cerberus-theme";
|
|
2057
2134
|
var MODE_KEY = "cerberus-mode";
|
|
2058
2135
|
var ThemeContext = (0, import_react20.createContext)(
|
|
@@ -2060,7 +2137,7 @@ var ThemeContext = (0, import_react20.createContext)(
|
|
|
2060
2137
|
);
|
|
2061
2138
|
function ThemeProvider(props) {
|
|
2062
2139
|
const state = useTheme();
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ThemeContext.Provider, { value: state, children: props.children });
|
|
2064
2141
|
}
|
|
2065
2142
|
function useThemeContext() {
|
|
2066
2143
|
const context = (0, import_react20.useContext)(ThemeContext);
|
|
@@ -2093,6 +2170,7 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
2093
2170
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2094
2171
|
0 && (module.exports = {
|
|
2095
2172
|
$cerberusIcons,
|
|
2173
|
+
Avatar,
|
|
2096
2174
|
Button,
|
|
2097
2175
|
Checkbox,
|
|
2098
2176
|
ConfirmModal,
|