@cerberus-design/react 0.10.4 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +244 -2
  2. package/build/legacy/components/Admonition.cjs +419 -0
  3. package/build/legacy/components/Admonition.cjs.map +1 -0
  4. package/build/legacy/components/AnimatingUploadIcon.cjs +124 -0
  5. package/build/legacy/components/AnimatingUploadIcon.cjs.map +1 -0
  6. package/build/legacy/components/Avatar.cjs +110 -13
  7. package/build/legacy/components/Avatar.cjs.map +1 -1
  8. package/build/legacy/components/Checkbox.cjs +107 -10
  9. package/build/legacy/components/Checkbox.cjs.map +1 -1
  10. package/build/legacy/components/CircularProgress.cjs +19 -5
  11. package/build/legacy/components/CircularProgress.cjs.map +1 -1
  12. package/build/legacy/components/Fieldset.cjs +66 -0
  13. package/build/legacy/components/Fieldset.cjs.map +1 -0
  14. package/build/legacy/components/FieldsetLabel.cjs +49 -0
  15. package/build/legacy/components/FieldsetLabel.cjs.map +1 -0
  16. package/build/legacy/components/FileStatus.cjs +138 -39
  17. package/build/legacy/components/FileStatus.cjs.map +1 -1
  18. package/build/legacy/components/FileUploader.cjs +120 -22
  19. package/build/legacy/components/FileUploader.cjs.map +1 -1
  20. package/build/legacy/components/Input.cjs +108 -11
  21. package/build/legacy/components/Input.cjs.map +1 -1
  22. package/build/legacy/components/Label.cjs +1 -1
  23. package/build/legacy/components/Label.cjs.map +1 -1
  24. package/build/legacy/components/Legend.cjs +95 -0
  25. package/build/legacy/components/Legend.cjs.map +1 -0
  26. package/build/legacy/components/ModalHeader.cjs +2 -2
  27. package/build/legacy/components/ModalHeader.cjs.map +1 -1
  28. package/build/legacy/components/Notification.cjs +109 -12
  29. package/build/legacy/components/Notification.cjs.map +1 -1
  30. package/build/legacy/components/Radio.cjs +27 -14
  31. package/build/legacy/components/Radio.cjs.map +1 -1
  32. package/build/legacy/components/Select.cjs +111 -14
  33. package/build/legacy/components/Select.cjs.map +1 -1
  34. package/build/legacy/components/Tag.cjs +106 -9
  35. package/build/legacy/components/Tag.cjs.map +1 -1
  36. package/build/legacy/components/Th.cjs +4 -1
  37. package/build/legacy/components/Th.cjs.map +1 -1
  38. package/build/legacy/components/Toggle.cjs +108 -11
  39. package/build/legacy/components/Toggle.cjs.map +1 -1
  40. package/build/legacy/config/cerbIcons.cjs +102 -5
  41. package/build/legacy/config/cerbIcons.cjs.map +1 -1
  42. package/build/legacy/config/defineIcons.cjs +102 -5
  43. package/build/legacy/config/defineIcons.cjs.map +1 -1
  44. package/build/legacy/context/confirm-modal.cjs +141 -40
  45. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  46. package/build/legacy/context/notification-center.cjs +129 -32
  47. package/build/legacy/context/notification-center.cjs.map +1 -1
  48. package/build/legacy/context/prompt-modal.cjs +178 -66
  49. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  50. package/build/legacy/hooks/useModal.cjs +6 -2
  51. package/build/legacy/hooks/useModal.cjs.map +1 -1
  52. package/build/legacy/index.cjs +793 -442
  53. package/build/legacy/index.cjs.map +1 -1
  54. package/build/modern/_tsup-dts-rollup.d.ts +244 -2
  55. package/build/modern/{chunk-S7XGIQY6.js → chunk-243VUIA6.js} +2 -2
  56. package/build/modern/{chunk-LKFXUM3Z.js → chunk-3NE6C66J.js} +36 -25
  57. package/build/modern/{chunk-LKFXUM3Z.js.map → chunk-3NE6C66J.js.map} +1 -1
  58. package/build/modern/chunk-3ZDFQO25.js +31 -0
  59. package/build/modern/chunk-3ZDFQO25.js.map +1 -0
  60. package/build/modern/{chunk-YLPSE5Z2.js → chunk-6QHOKCV3.js} +11 -6
  61. package/build/modern/chunk-6QHOKCV3.js.map +1 -0
  62. package/build/modern/chunk-6TTN2JMY.js +54 -0
  63. package/build/modern/chunk-6TTN2JMY.js.map +1 -0
  64. package/build/modern/{chunk-OW62FLJ6.js → chunk-7T3JIGM7.js} +8 -4
  65. package/build/modern/chunk-7T3JIGM7.js.map +1 -0
  66. package/build/modern/{chunk-7K6PZBHN.js → chunk-CO4BKT7K.js} +5 -2
  67. package/build/modern/{chunk-7K6PZBHN.js.map → chunk-CO4BKT7K.js.map} +1 -1
  68. package/build/modern/{chunk-NBG2OSYI.js → chunk-FT7DFRHQ.js} +2 -2
  69. package/build/modern/chunk-FTPZHG6J.js +46 -0
  70. package/build/modern/{chunk-LJYCFFX7.js.map → chunk-FTPZHG6J.js.map} +1 -1
  71. package/build/modern/{chunk-JCGWTIR4.js → chunk-HCB5NQ5J.js} +5 -4
  72. package/build/modern/chunk-HCB5NQ5J.js.map +1 -0
  73. package/build/modern/chunk-HVKM54BA.js +100 -0
  74. package/build/modern/chunk-HVKM54BA.js.map +1 -0
  75. package/build/modern/{chunk-CMUFJU4S.js → chunk-KLUBAM4U.js} +2 -2
  76. package/build/modern/{chunk-AUAPBPGW.js → chunk-MDIUFBDX.js} +2 -2
  77. package/build/modern/{chunk-I35HMGJQ.js → chunk-NMF2HYWO.js} +2 -2
  78. package/build/modern/{chunk-I35HMGJQ.js.map → chunk-NMF2HYWO.js.map} +1 -1
  79. package/build/modern/{chunk-O6JYYVO7.js → chunk-PA5EB7EO.js} +2 -2
  80. package/build/modern/chunk-PZAZKQMO.js +25 -0
  81. package/build/modern/chunk-PZAZKQMO.js.map +1 -0
  82. package/build/modern/{chunk-EZNGCXVJ.js → chunk-RDQHHCFR.js} +5 -5
  83. package/build/modern/{chunk-BDCFYW34.js → chunk-TMR7JGMP.js} +12 -9
  84. package/build/modern/chunk-TMR7JGMP.js.map +1 -0
  85. package/build/modern/{chunk-WZOYPFUU.js → chunk-UJKS4DDN.js} +2 -2
  86. package/build/modern/{chunk-WLEX22KS.js → chunk-ULYQLKWA.js} +3 -3
  87. package/build/modern/{chunk-WLEX22KS.js.map → chunk-ULYQLKWA.js.map} +1 -1
  88. package/build/modern/{chunk-6YUB3ITX.js → chunk-X4Y4WTRU.js} +10 -10
  89. package/build/modern/{chunk-UXHAFEBA.js → chunk-YMJMB6OP.js} +5 -3
  90. package/build/modern/chunk-YMJMB6OP.js.map +1 -0
  91. package/build/modern/{chunk-GMG3B34U.js → chunk-YWCTMLLO.js} +2 -2
  92. package/build/modern/chunk-ZW3FFE37.js +138 -0
  93. package/build/modern/chunk-ZW3FFE37.js.map +1 -0
  94. package/build/modern/{chunk-477G5ZEL.js → chunk-ZX6DBC2Z.js} +2 -2
  95. package/build/modern/components/Admonition.js +17 -0
  96. package/build/modern/components/Admonition.js.map +1 -0
  97. package/build/modern/components/AnimatingUploadIcon.js +7 -0
  98. package/build/modern/components/AnimatingUploadIcon.js.map +1 -0
  99. package/build/modern/components/Avatar.js +4 -3
  100. package/build/modern/components/Checkbox.js +4 -3
  101. package/build/modern/components/CircularProgress.js +2 -1
  102. package/build/modern/components/Fieldset.js +9 -0
  103. package/build/modern/components/Fieldset.js.map +1 -0
  104. package/build/modern/components/FieldsetLabel.js +7 -0
  105. package/build/modern/components/FieldsetLabel.js.map +1 -0
  106. package/build/modern/components/FileStatus.js +5 -4
  107. package/build/modern/components/FileUploader.js +5 -4
  108. package/build/modern/components/Input.js +4 -3
  109. package/build/modern/components/Label.js +1 -1
  110. package/build/modern/components/Legend.js +10 -0
  111. package/build/modern/components/Legend.js.map +1 -0
  112. package/build/modern/components/ModalHeader.js +1 -1
  113. package/build/modern/components/Notification.js +4 -3
  114. package/build/modern/components/Radio.js +1 -1
  115. package/build/modern/components/Select.js +4 -3
  116. package/build/modern/components/Tag.js +4 -3
  117. package/build/modern/components/Th.js +1 -1
  118. package/build/modern/components/Toggle.js +4 -3
  119. package/build/modern/config/cerbIcons.js +2 -1
  120. package/build/modern/config/defineIcons.js +3 -2
  121. package/build/modern/context/confirm-modal.js +8 -7
  122. package/build/modern/context/notification-center.js +6 -5
  123. package/build/modern/context/prompt-modal.js +10 -9
  124. package/build/modern/hooks/useModal.js +1 -1
  125. package/build/modern/index.js +86 -65
  126. package/build/modern/index.js.map +1 -1
  127. package/package.json +3 -3
  128. package/src/components/Admonition.tsx +186 -0
  129. package/src/components/AnimatingUploadIcon.tsx +83 -0
  130. package/src/components/CircularProgress.tsx +20 -12
  131. package/src/components/Fieldset.tsx +65 -0
  132. package/src/components/FieldsetLabel.tsx +59 -0
  133. package/src/components/FileStatus.tsx +2 -0
  134. package/src/components/FileUploader.tsx +6 -1
  135. package/src/components/Label.tsx +1 -1
  136. package/src/components/Legend.tsx +87 -0
  137. package/src/components/ModalHeader.tsx +2 -2
  138. package/src/components/Radio.tsx +10 -1
  139. package/src/components/Th.tsx +3 -0
  140. package/src/config/cerbIcons.ts +10 -8
  141. package/src/context/prompt-modal.tsx +8 -1
  142. package/src/hooks/useModal.ts +19 -4
  143. package/src/index.ts +4 -0
  144. package/build/modern/chunk-BDCFYW34.js.map +0 -1
  145. package/build/modern/chunk-JCGWTIR4.js.map +0 -1
  146. package/build/modern/chunk-LJYCFFX7.js +0 -33
  147. package/build/modern/chunk-OW62FLJ6.js.map +0 -1
  148. package/build/modern/chunk-UXHAFEBA.js.map +0 -1
  149. package/build/modern/chunk-YLPSE5Z2.js.map +0 -1
  150. /package/build/modern/{chunk-S7XGIQY6.js.map → chunk-243VUIA6.js.map} +0 -0
  151. /package/build/modern/{chunk-NBG2OSYI.js.map → chunk-FT7DFRHQ.js.map} +0 -0
  152. /package/build/modern/{chunk-CMUFJU4S.js.map → chunk-KLUBAM4U.js.map} +0 -0
  153. /package/build/modern/{chunk-AUAPBPGW.js.map → chunk-MDIUFBDX.js.map} +0 -0
  154. /package/build/modern/{chunk-O6JYYVO7.js.map → chunk-PA5EB7EO.js.map} +0 -0
  155. /package/build/modern/{chunk-EZNGCXVJ.js.map → chunk-RDQHHCFR.js.map} +0 -0
  156. /package/build/modern/{chunk-WZOYPFUU.js.map → chunk-UJKS4DDN.js.map} +0 -0
  157. /package/build/modern/{chunk-6YUB3ITX.js.map → chunk-X4Y4WTRU.js.map} +0 -0
  158. /package/build/modern/{chunk-GMG3B34U.js.map → chunk-YWCTMLLO.js.map} +0 -0
  159. /package/build/modern/{chunk-477G5ZEL.js.map → chunk-ZX6DBC2Z.js.map} +0 -0
@@ -157,6 +157,102 @@ function IndeterminateIcon(props) {
157
157
  );
158
158
  }
159
159
 
160
+ // src/components/AnimatingUploadIcon.tsx
161
+ var import_jsx_runtime4 = require("react/jsx-runtime");
162
+ function AnimatingUploadIcon(props) {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
164
+ "svg",
165
+ {
166
+ "aria-hidden": "true",
167
+ xmlns: "http://www.w3.org/2000/svg",
168
+ width: props.size ?? "1em",
169
+ height: props.size ?? "1em",
170
+ viewBox: "0 0 24 24",
171
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
172
+ "g",
173
+ {
174
+ fill: "none",
175
+ stroke: "currentColor",
176
+ strokeLinecap: "square",
177
+ strokeLinejoin: "round",
178
+ strokeWidth: 1.5,
179
+ children: [
180
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
181
+ "path",
182
+ {
183
+ "data-name": "animating-trail",
184
+ strokeDasharray: "2 4",
185
+ strokeDashoffset: 6,
186
+ d: "M12 21c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9",
187
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
188
+ "animate",
189
+ {
190
+ attributeName: "stroke-dashoffset",
191
+ dur: "0.45s",
192
+ repeatCount: "indefinite",
193
+ values: "6;0"
194
+ }
195
+ )
196
+ }
197
+ ),
198
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
199
+ "path",
200
+ {
201
+ "data-name": "half-circle",
202
+ strokeDasharray: 32,
203
+ strokeDashoffset: 32,
204
+ d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9",
205
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
206
+ "animate",
207
+ {
208
+ fill: "freeze",
209
+ attributeName: "stroke-dashoffset",
210
+ begin: "0.075s",
211
+ dur: "0.3s",
212
+ values: "32;0"
213
+ }
214
+ )
215
+ }
216
+ ),
217
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
218
+ "svg",
219
+ {
220
+ "aria-hidden": "true",
221
+ xmlns: "http://www.w3.org/2000/svg",
222
+ width: "0.8em",
223
+ height: "0.8em",
224
+ x: "27%",
225
+ y: "27%",
226
+ viewBox: "0 0 24 24",
227
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
228
+ "polygon",
229
+ {
230
+ fill: "currentColor",
231
+ stroke: "currentColor",
232
+ strokeWidth: 0.8,
233
+ opacity: "1",
234
+ 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 ",
235
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
236
+ "animate",
237
+ {
238
+ fill: "freeze",
239
+ attributeName: "opacity",
240
+ values: "1;0;1",
241
+ dur: "2s",
242
+ repeatCount: "indefinite"
243
+ }
244
+ )
245
+ }
246
+ )
247
+ }
248
+ )
249
+ ]
250
+ }
251
+ )
252
+ }
253
+ );
254
+ }
255
+
160
256
  // src/config/cerbIcons.ts
161
257
  var defaultIcons = {
162
258
  avatar: import_icons.UserFilled,
@@ -165,12 +261,13 @@ var defaultIcons = {
165
261
  confirmModal: import_icons.Information,
166
262
  delete: import_icons.TrashCan,
167
263
  promptModal: import_icons.Information,
168
- fileUploader: import_icons.CloudUpload,
264
+ waitingFileUploader: import_icons.CloudUpload,
265
+ fileUploader: AnimatingUploadIcon,
169
266
  indeterminate: IndeterminateIcon,
170
- infoNotification: import_icons.InformationFilled,
171
- successNotification: import_icons.CheckmarkFilled,
172
- warningNotification: import_icons.WarningFilled,
173
- dangerNotification: import_icons.ErrorFilled,
267
+ infoNotification: import_icons.Information,
268
+ successNotification: import_icons.CheckmarkOutline,
269
+ warningNotification: import_icons.WarningAlt,
270
+ dangerNotification: import_icons.WarningFilled,
174
271
  invalid: import_icons.WarningFilled,
175
272
  invalidAlt: import_icons.Warning,
176
273
  redo: import_icons.Restart,
@@ -193,16 +290,16 @@ function Show(props) {
193
290
  }
194
291
 
195
292
  // src/components/Input.tsx
196
- var import_jsx_runtime4 = require("react/jsx-runtime");
293
+ var import_jsx_runtime5 = require("react/jsx-runtime");
197
294
  function Input(props) {
198
295
  const { describedBy, size, startIcon, endIcon, ...nativeProps } = props;
199
296
  const inputStyles = (0, import_recipes2.input)({ size });
200
297
  const { invalid, ...fieldStates } = useFieldContext();
201
298
  const hasEndIcon = Boolean(endIcon);
202
299
  const { invalid: InvalidIcon } = $cerberusIcons;
203
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: inputStyles.root, children: [
204
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
205
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
300
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: inputStyles.root, children: [
301
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
302
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
206
303
  "input",
207
304
  {
208
305
  ...nativeProps,
@@ -213,8 +310,8 @@ function Input(props) {
213
310
  className: (0, import_css2.cx)("peer", nativeProps.className, inputStyles.input)
214
311
  }
215
312
  ),
216
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
217
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
313
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
314
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
218
315
  ] });
219
316
  }
220
317
 
@@ -222,12 +319,12 @@ function Input(props) {
222
319
  var import_recipes3 = require("@cerberus/styled-system/recipes");
223
320
  var import_css3 = require("@cerberus/styled-system/css");
224
321
  var import_patterns = require("@cerberus/styled-system/patterns");
225
- var import_jsx_runtime5 = require("react/jsx-runtime");
322
+ var import_jsx_runtime6 = require("react/jsx-runtime");
226
323
  function Label(props) {
227
324
  const { hidden, size, ...nativeProps } = props;
228
325
  const { required, disabled } = useFieldContext();
229
326
  const usage = hidden ? "hidden" : "visible";
230
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
327
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
231
328
  "label",
232
329
  {
233
330
  ...nativeProps,
@@ -242,11 +339,11 @@ function Label(props) {
242
339
  ),
243
340
  children: [
244
341
  props.children,
245
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
342
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Show, { when: required, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
246
343
  "span",
247
344
  {
248
345
  className: (0, import_css3.css)({
249
- color: "inherit",
346
+ color: "page.text.100",
250
347
  fontSize: "inherit"
251
348
  }),
252
349
  children: "(required)"
@@ -261,30 +358,34 @@ function Label(props) {
261
358
  var import_react3 = require("react");
262
359
  function useModal() {
263
360
  const modalRef = (0, import_react3.useRef)(null);
361
+ const [isOpen, setIsOpen] = (0, import_react3.useState)(false);
264
362
  const show = (0, import_react3.useCallback)(() => {
265
363
  var _a;
266
364
  (_a = modalRef.current) == null ? void 0 : _a.showModal();
365
+ setIsOpen(true);
267
366
  }, []);
268
367
  const close = (0, import_react3.useCallback)(() => {
269
368
  var _a;
270
369
  (_a = modalRef.current) == null ? void 0 : _a.close();
370
+ setIsOpen(false);
271
371
  }, []);
272
372
  return (0, import_react3.useMemo)(() => {
273
373
  return {
274
374
  modalRef,
275
375
  show,
276
- close
376
+ close,
377
+ isOpen
277
378
  };
278
- }, [modalRef, show, close]);
379
+ }, [modalRef, show, close, isOpen]);
279
380
  }
280
381
 
281
382
  // src/components/Modal.tsx
282
383
  var import_css4 = require("@cerberus/styled-system/css");
283
384
  var import_recipes4 = require("@cerberus/styled-system/recipes");
284
385
  var import_react4 = require("react");
285
- var import_jsx_runtime6 = require("react/jsx-runtime");
386
+ var import_jsx_runtime7 = require("react/jsx-runtime");
286
387
  function ModalEl(props, ref) {
287
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
388
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
288
389
  "dialog",
289
390
  {
290
391
  ...props,
@@ -298,9 +399,9 @@ var Modal = (0, import_react4.forwardRef)(ModalEl);
298
399
  // src/components/ModalHeader.tsx
299
400
  var import_css5 = require("@cerberus/styled-system/css");
300
401
  var import_patterns2 = require("@cerberus/styled-system/patterns");
301
- var import_jsx_runtime7 = require("react/jsx-runtime");
402
+ var import_jsx_runtime8 = require("react/jsx-runtime");
302
403
  function ModalHeader(props) {
303
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
404
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
304
405
  "div",
305
406
  {
306
407
  ...props,
@@ -308,8 +409,8 @@ function ModalHeader(props) {
308
409
  props.className,
309
410
  (0, import_patterns2.vstack)({
310
411
  alignItems: "flex-start",
311
- gap: "4",
312
- mb: "8"
412
+ gap: "md",
413
+ mb: "md"
313
414
  })
314
415
  )
315
416
  }
@@ -319,24 +420,24 @@ function ModalHeader(props) {
319
420
  // src/components/ModalHeading.tsx
320
421
  var import_css6 = require("@cerberus/styled-system/css");
321
422
  var import_recipes5 = require("@cerberus/styled-system/recipes");
322
- var import_jsx_runtime8 = require("react/jsx-runtime");
423
+ var import_jsx_runtime9 = require("react/jsx-runtime");
323
424
  function ModalHeading(props) {
324
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { ...props, className: (0, import_css6.cx)(props.className, (0, import_recipes5.modal)().heading) });
425
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { ...props, className: (0, import_css6.cx)(props.className, (0, import_recipes5.modal)().heading) });
325
426
  }
326
427
 
327
428
  // src/components/ModalDescription.tsx
328
429
  var import_css7 = require("@cerberus/styled-system/css");
329
430
  var import_recipes6 = require("@cerberus/styled-system/recipes");
330
- var import_jsx_runtime9 = require("react/jsx-runtime");
431
+ var import_jsx_runtime10 = require("react/jsx-runtime");
331
432
  function ModalDescription(props) {
332
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { ...props, className: (0, import_css7.cx)(props.className, (0, import_recipes6.modal)().description) });
433
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { ...props, className: (0, import_css7.cx)(props.className, (0, import_recipes6.modal)().description) });
333
434
  }
334
435
 
335
436
  // src/components/Avatar.tsx
336
437
  var import_css8 = require("@cerberus/styled-system/css");
337
438
  var import_patterns3 = require("@cerberus/styled-system/patterns");
338
439
  var import_recipes7 = require("@cerberus/styled-system/recipes");
339
- var import_jsx_runtime10 = require("react/jsx-runtime");
440
+ var import_jsx_runtime11 = require("react/jsx-runtime");
340
441
  function Avatar(props) {
341
442
  const {
342
443
  ariaLabel,
@@ -351,7 +452,7 @@ function Avatar(props) {
351
452
  } = props;
352
453
  const { avatar: AvatarIcon } = $cerberusIcons;
353
454
  const initials = (ariaLabel || "").split(" ").map((word) => word[0]).join("").slice(0, 2);
354
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
455
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
355
456
  "div",
356
457
  {
357
458
  ...nativeProps,
@@ -360,19 +461,19 @@ function Avatar(props) {
360
461
  (0, import_recipes7.avatar)({ gradient, size }),
361
462
  (0, import_patterns3.circle)()
362
463
  ),
363
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
464
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
364
465
  Show,
365
466
  {
366
467
  when: Boolean(src) || Boolean(as),
367
- fallback: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
468
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
368
469
  Show,
369
470
  {
370
471
  when: Boolean(initials),
371
- fallback: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
472
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
372
473
  Show,
373
474
  {
374
475
  when: Boolean(icon),
375
- fallback: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
476
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
376
477
  AvatarIcon,
377
478
  {
378
479
  size: iconSizeMap[size]
@@ -384,11 +485,11 @@ function Avatar(props) {
384
485
  children: initials
385
486
  }
386
487
  ),
387
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
488
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
388
489
  Show,
389
490
  {
390
491
  when: Boolean(as),
391
- fallback: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
492
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
392
493
  "img",
393
494
  {
394
495
  alt: props.ariaLabel,
@@ -424,7 +525,7 @@ var iconSizeMap = {
424
525
  };
425
526
 
426
527
  // src/context/prompt-modal.tsx
427
- var import_jsx_runtime11 = require("react/jsx-runtime");
528
+ var import_jsx_runtime12 = require("react/jsx-runtime");
428
529
  var PromptModalContext = (0, import_react5.createContext)(null);
429
530
  function PromptModal(props) {
430
531
  const { modalRef, show, close } = useModal();
@@ -474,36 +575,36 @@ function PromptModal(props) {
474
575
  }),
475
576
  [handleShow]
476
577
  );
477
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(PromptModalContext.Provider, { value, children: [
578
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(PromptModalContext.Provider, { value, children: [
478
579
  props.children,
479
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
480
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ModalHeader, { children: [
481
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
580
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
581
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ModalHeader, { children: [
582
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
482
583
  "div",
483
584
  {
484
585
  className: (0, import_patterns4.hstack)({
485
586
  justify: "center",
486
587
  w: "full"
487
588
  }),
488
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
589
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
489
590
  Show,
490
591
  {
491
592
  when: palette === "danger",
492
- fallback: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
593
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
493
594
  Avatar,
494
595
  {
495
596
  ariaLabel: "",
496
597
  gradient: "charon-light",
497
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PromptIcon, { size: 24 }),
598
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PromptIcon, { size: 24 }),
498
599
  src: ""
499
600
  }
500
601
  ),
501
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
602
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
502
603
  Avatar,
503
604
  {
504
605
  ariaLabel: "",
505
606
  gradient: "hades-dark",
506
- icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PromptIcon, { size: 24 }),
607
+ icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PromptIcon, { size: 24 }),
507
608
  src: ""
508
609
  }
509
610
  )
@@ -511,10 +612,10 @@ function PromptModal(props) {
511
612
  )
512
613
  }
513
614
  ),
514
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
515
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
615
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
616
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
516
617
  ] }),
517
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
618
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
518
619
  "div",
519
620
  {
520
621
  className: (0, import_patterns4.vstack)({
@@ -522,21 +623,32 @@ function PromptModal(props) {
522
623
  mt: "4",
523
624
  mb: "8"
524
625
  }),
525
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { invalid: !isValid, children: [
526
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Label, { htmlFor: "confirm", size: "md", children: [
527
- "Type",
528
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
529
- "strong",
530
- {
531
- className: (0, import_css9.css)({
532
- textTransform: "uppercase"
533
- }),
534
- children: content == null ? void 0 : content.key
535
- }
536
- ),
537
- "to confirm"
538
- ] }),
539
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
626
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Field, { invalid: !isValid, children: [
627
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
628
+ Label,
629
+ {
630
+ className: (0, import_css9.css)({
631
+ gap: 1,
632
+ justifyContent: "flex-start"
633
+ }),
634
+ htmlFor: "confirm",
635
+ size: "md",
636
+ children: [
637
+ "Type",
638
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
639
+ "strong",
640
+ {
641
+ className: (0, import_css9.css)({
642
+ textTransform: "uppercase"
643
+ }),
644
+ children: content == null ? void 0 : content.key
645
+ }
646
+ ),
647
+ "to confirm"
648
+ ]
649
+ }
650
+ ),
651
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
540
652
  Input,
541
653
  {
542
654
  id: "confirm",
@@ -548,7 +660,7 @@ function PromptModal(props) {
548
660
  ] })
549
661
  }
550
662
  ),
551
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
663
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
552
664
  "div",
553
665
  {
554
666
  className: (0, import_patterns4.hstack)({
@@ -556,7 +668,7 @@ function PromptModal(props) {
556
668
  gap: "4"
557
669
  }),
558
670
  children: [
559
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
671
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
560
672
  Button,
561
673
  {
562
674
  autoFocus: true,
@@ -571,7 +683,7 @@ function PromptModal(props) {
571
683
  children: content == null ? void 0 : content.actionText
572
684
  }
573
685
  ),
574
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
686
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
575
687
  Button,
576
688
  {
577
689
  className: (0, import_css9.css)({