@cerberus-design/react 0.12.0 → 0.13.1-next-e3e9e48

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 (61) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +128 -1
  2. package/build/legacy/components/Portal.cjs +3 -5
  3. package/build/legacy/components/Portal.cjs.map +1 -1
  4. package/build/legacy/components/Tooltip.cjs +55 -0
  5. package/build/legacy/components/Tooltip.cjs.map +1 -0
  6. package/build/legacy/context/confirm-modal.cjs +2 -5
  7. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  8. package/build/legacy/context/cta-modal.cjs +2 -5
  9. package/build/legacy/context/cta-modal.cjs.map +1 -1
  10. package/build/legacy/context/notification-center.cjs +3 -6
  11. package/build/legacy/context/notification-center.cjs.map +1 -1
  12. package/build/legacy/context/prompt-modal.cjs +2 -5
  13. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  14. package/build/legacy/hooks/useDate.cjs +122 -0
  15. package/build/legacy/hooks/useDate.cjs.map +1 -0
  16. package/build/legacy/hooks/useModal.cjs.map +1 -1
  17. package/build/legacy/index.cjs +214 -93
  18. package/build/legacy/index.cjs.map +1 -1
  19. package/build/modern/_tsup-dts-rollup.d.ts +128 -1
  20. package/build/modern/{chunk-ZBMA5G54.js → chunk-7MM5KYEX.js} +4 -4
  21. package/build/modern/chunk-CZND26FC.js +98 -0
  22. package/build/modern/chunk-CZND26FC.js.map +1 -0
  23. package/build/modern/{chunk-T6LS5P5W.js → chunk-J4LOSTEP.js} +13 -13
  24. package/build/modern/chunk-K2PSHGS7.js +11 -0
  25. package/build/modern/chunk-K2PSHGS7.js.map +1 -0
  26. package/build/modern/{chunk-CSEHDNMJ.js → chunk-KFGI37CO.js} +12 -12
  27. package/build/modern/{chunk-7T3JIGM7.js → chunk-KGQG5JGW.js} +1 -1
  28. package/build/modern/chunk-KGQG5JGW.js.map +1 -0
  29. package/build/modern/chunk-KML4CTMK.js +33 -0
  30. package/build/modern/chunk-KML4CTMK.js.map +1 -0
  31. package/build/modern/{chunk-5OSUZUR4.js → chunk-KUT2YEEQ.js} +7 -7
  32. package/build/modern/chunk-KUT2YEEQ.js.map +1 -0
  33. package/build/modern/{chunk-VP5ERLAY.js → chunk-NCUHRVW2.js} +15 -15
  34. package/build/modern/components/FileStatus.js +2 -2
  35. package/build/modern/components/Portal.js +2 -1
  36. package/build/modern/components/Tooltip.js +7 -0
  37. package/build/modern/components/Tooltip.js.map +1 -0
  38. package/build/modern/context/confirm-modal.js +5 -5
  39. package/build/modern/context/cta-modal.js +5 -5
  40. package/build/modern/context/notification-center.js +3 -3
  41. package/build/modern/context/prompt-modal.js +6 -6
  42. package/build/modern/hooks/useDate.js +14 -0
  43. package/build/modern/hooks/useDate.js.map +1 -0
  44. package/build/modern/hooks/useModal.js +1 -1
  45. package/build/modern/index.js +43 -29
  46. package/build/modern/index.js.map +1 -1
  47. package/package.json +2 -2
  48. package/src/components/Portal.tsx +17 -6
  49. package/src/components/Tooltip.tsx +61 -0
  50. package/src/context/notification-center.tsx +1 -1
  51. package/src/hooks/useDate.ts +164 -0
  52. package/src/hooks/useModal.ts +1 -1
  53. package/src/index.ts +2 -0
  54. package/build/modern/chunk-5OSUZUR4.js.map +0 -1
  55. package/build/modern/chunk-7T3JIGM7.js.map +0 -1
  56. package/build/modern/chunk-GLY7GU5S.js +0 -14
  57. package/build/modern/chunk-GLY7GU5S.js.map +0 -1
  58. /package/build/modern/{chunk-ZBMA5G54.js.map → chunk-7MM5KYEX.js.map} +0 -0
  59. /package/build/modern/{chunk-T6LS5P5W.js.map → chunk-J4LOSTEP.js.map} +0 -0
  60. /package/build/modern/{chunk-CSEHDNMJ.js.map → chunk-KFGI37CO.js.map} +0 -0
  61. /package/build/modern/{chunk-VP5ERLAY.js.map → chunk-NCUHRVW2.js.map} +0 -0
@@ -31,6 +31,7 @@ __export(src_exports, {
31
31
  Checkbox: () => Checkbox,
32
32
  CircularProgress: () => CircularProgress,
33
33
  ConfirmModal: () => ConfirmModal,
34
+ DateFormats: () => DateFormats,
34
35
  Droppable: () => Droppable,
35
36
  FeatureFlag: () => FeatureFlag,
36
37
  FeatureFlags: () => FeatureFlags,
@@ -87,15 +88,19 @@ __export(src_exports, {
87
88
  Thead: () => Thead,
88
89
  ThemeProvider: () => ThemeProvider,
89
90
  Toggle: () => Toggle,
91
+ Tooltip: () => Tooltip,
90
92
  Tr: () => Tr,
91
93
  createNavTriggerProps: () => createNavTriggerProps,
92
94
  defineIcons: () => defineIcons,
95
+ formatMilitaryDate: () => formatMilitaryDate,
96
+ formatMilitaryToISO: () => formatMilitaryToISO,
93
97
  formatNotifyCount: () => formatNotifyCount,
94
98
  getPosition: () => getPosition,
95
99
  processStatus: () => processStatus,
96
100
  trapFocus: () => trapFocus,
97
101
  useCTAModal: () => useCTAModal,
98
102
  useConfirmModal: () => useConfirmModal,
103
+ useDate: () => useDate,
99
104
  useFeatureFlags: () => useFeatureFlags,
100
105
  useFieldContext: () => useFieldContext,
101
106
  useModal: () => useModal,
@@ -1724,11 +1729,8 @@ function NotificationDescription(props) {
1724
1729
  // src/components/Portal.tsx
1725
1730
  var import_react_dom = require("react-dom");
1726
1731
  function Portal(props) {
1727
- if (typeof window !== "undefined") {
1728
- const container = props.container || document.body;
1729
- return (0, import_react_dom.createPortal)(props.children, container, props.key);
1730
- }
1731
- return null;
1732
+ const container = props.container || document.body;
1733
+ return (0, import_react_dom.createPortal)(props.children, container, props.key);
1732
1734
  }
1733
1735
 
1734
1736
  // src/components/Radio.tsx
@@ -2316,9 +2318,36 @@ function Toggle(props) {
2316
2318
  );
2317
2319
  }
2318
2320
 
2321
+ // src/components/Tooltip.tsx
2322
+ var import_tooltip = require("@ark-ui/react/tooltip");
2323
+ var import_css41 = require("@cerberus/styled-system/css");
2324
+ var import_recipes33 = require("@cerberus/styled-system/recipes");
2325
+ var import_jsx_runtime49 = require("react/jsx-runtime");
2326
+ function Tooltip(props) {
2327
+ const { content, children, ...nativeProps } = props;
2328
+ const styles = (0, import_recipes33.tooltip)();
2329
+ const position = {
2330
+ placement: props.position || "top"
2331
+ };
2332
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_tooltip.Tooltip.Root, { openDelay: 400, positioning: position, children: [
2333
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_tooltip.Tooltip.Trigger, { className: styles.trigger, children }),
2334
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_tooltip.Tooltip.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
2335
+ import_tooltip.Tooltip.Content,
2336
+ {
2337
+ ...nativeProps,
2338
+ className: (0, import_css41.cx)(nativeProps.className, styles.content),
2339
+ children: [
2340
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_tooltip.Tooltip.Arrow, { className: styles.arrow, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_tooltip.Tooltip.ArrowTip, { className: styles.arrowTip }) }),
2341
+ content
2342
+ ]
2343
+ }
2344
+ ) })
2345
+ ] });
2346
+ }
2347
+
2319
2348
  // src/context/confirm-modal.tsx
2320
2349
  var import_react17 = require("react");
2321
- var import_css41 = require("@cerberus/styled-system/css");
2350
+ var import_css42 = require("@cerberus/styled-system/css");
2322
2351
  var import_patterns16 = require("@cerberus/styled-system/patterns");
2323
2352
 
2324
2353
  // src/hooks/useModal.ts
@@ -2347,7 +2376,7 @@ function useModal() {
2347
2376
  }
2348
2377
 
2349
2378
  // src/context/confirm-modal.tsx
2350
- var import_jsx_runtime49 = require("react/jsx-runtime");
2379
+ var import_jsx_runtime50 = require("react/jsx-runtime");
2351
2380
  var ConfirmModalContext = (0, import_react17.createContext)(null);
2352
2381
  function ConfirmModal(props) {
2353
2382
  const { modalRef, show, close } = useModal();
@@ -2387,36 +2416,36 @@ function ConfirmModal(props) {
2387
2416
  }),
2388
2417
  [handleShow]
2389
2418
  );
2390
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(ConfirmModalContext.Provider, { value, children: [
2419
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(ConfirmModalContext.Provider, { value, children: [
2391
2420
  props.children,
2392
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
2393
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(ModalHeader, { children: [
2394
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2421
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
2422
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(ModalHeader, { children: [
2423
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2395
2424
  "div",
2396
2425
  {
2397
2426
  className: (0, import_patterns16.hstack)({
2398
2427
  justify: "center",
2399
2428
  w: "full"
2400
2429
  }),
2401
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2430
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2402
2431
  Show,
2403
2432
  {
2404
2433
  when: palette === "danger",
2405
- fallback: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2434
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2406
2435
  Avatar,
2407
2436
  {
2408
2437
  ariaLabel: "",
2409
2438
  gradient: "charon-light",
2410
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ConfirmIcon, { size: 24 }),
2439
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ConfirmIcon, { size: 24 }),
2411
2440
  src: ""
2412
2441
  }
2413
2442
  ),
2414
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2443
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2415
2444
  Avatar,
2416
2445
  {
2417
2446
  ariaLabel: "",
2418
2447
  gradient: "hades-dark",
2419
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ConfirmIcon, { size: 24 }),
2448
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ConfirmIcon, { size: 24 }),
2420
2449
  src: ""
2421
2450
  }
2422
2451
  )
@@ -2424,21 +2453,21 @@ function ConfirmModal(props) {
2424
2453
  )
2425
2454
  }
2426
2455
  ),
2427
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
2428
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
2456
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
2457
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
2429
2458
  ] }),
2430
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
2459
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
2431
2460
  "div",
2432
2461
  {
2433
2462
  className: (0, import_patterns16.hstack)({
2434
2463
  gap: "4"
2435
2464
  }),
2436
2465
  children: [
2437
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2466
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2438
2467
  Button,
2439
2468
  {
2440
2469
  autoFocus: true,
2441
- className: (0, import_css41.css)({
2470
+ className: (0, import_css42.css)({
2442
2471
  w: "1/2"
2443
2472
  }),
2444
2473
  name: "confirm",
@@ -2448,10 +2477,10 @@ function ConfirmModal(props) {
2448
2477
  children: content == null ? void 0 : content.actionText
2449
2478
  }
2450
2479
  ),
2451
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2480
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2452
2481
  Button,
2453
2482
  {
2454
- className: (0, import_css41.css)({
2483
+ className: (0, import_css42.css)({
2455
2484
  w: "1/2"
2456
2485
  }),
2457
2486
  name: "cancel",
@@ -2480,9 +2509,9 @@ function useConfirmModal() {
2480
2509
  // src/context/cta-modal.tsx
2481
2510
  var import_react18 = require("react");
2482
2511
  var import_jsx = require("@cerberus/styled-system/jsx");
2483
- var import_css42 = require("@cerberus/styled-system/css");
2512
+ var import_css43 = require("@cerberus/styled-system/css");
2484
2513
  var import_jsx2 = require("@cerberus/styled-system/jsx");
2485
- var import_jsx_runtime50 = require("react/jsx-runtime");
2514
+ var import_jsx_runtime51 = require("react/jsx-runtime");
2486
2515
  var CTAModalContext = (0, import_react18.createContext)(null);
2487
2516
  function CTAModal(props) {
2488
2517
  var _a, _b;
@@ -2522,49 +2551,49 @@ function CTAModal(props) {
2522
2551
  }),
2523
2552
  [handleShow]
2524
2553
  );
2525
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(CTAModalContext.Provider, { value, children: [
2554
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(CTAModalContext.Provider, { value, children: [
2526
2555
  props.children,
2527
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
2528
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2556
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
2557
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2529
2558
  "span",
2530
2559
  {
2531
- className: (0, import_css42.css)({
2560
+ className: (0, import_css43.css)({
2532
2561
  padding: "md",
2533
2562
  position: "absolute",
2534
2563
  right: 0,
2535
2564
  top: 0,
2536
2565
  zIndex: "decorator"
2537
2566
  }),
2538
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconButton, { ariaLabel: "Close modal", onClick: close, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CloseIcon, {}) })
2567
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(IconButton, { ariaLabel: "Close modal", onClick: close, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CloseIcon, {}) })
2539
2568
  }
2540
2569
  ),
2541
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(ModalHeader, { children: [
2542
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx.HStack, { justify: "center", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2570
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(ModalHeader, { children: [
2571
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx.HStack, { justify: "center", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2543
2572
  Avatar,
2544
2573
  {
2545
2574
  ariaLabel: "",
2546
2575
  gradient: "charon-light",
2547
- icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2576
+ icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2548
2577
  Show,
2549
2578
  {
2550
2579
  when: Boolean(confirmIcon),
2551
- fallback: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FallbackIcon, { size: 24 }),
2580
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FallbackIcon, { size: 24 }),
2552
2581
  children: confirmIcon
2553
2582
  }
2554
2583
  ),
2555
2584
  src: ""
2556
2585
  }
2557
2586
  ) }),
2558
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx2.VStack, { gap: "lg", w: "full", children: [
2559
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
2560
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
2587
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx2.VStack, { gap: "lg", w: "full", children: [
2588
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
2589
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
2561
2590
  ] })
2562
2591
  ] }),
2563
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx.HStack, { gap: "md", pt: "sm", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Show, { when: Boolean((_a = content == null ? void 0 : content.actions) == null ? void 0 : _a.length), children: (_b = content == null ? void 0 : content.actions) == null ? void 0 : _b.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2592
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx.HStack, { gap: "md", pt: "sm", w: "full", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Show, { when: Boolean((_a = content == null ? void 0 : content.actions) == null ? void 0 : _a.length), children: (_b = content == null ? void 0 : content.actions) == null ? void 0 : _b.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2564
2593
  Button,
2565
2594
  {
2566
2595
  "data-index": index,
2567
- className: (0, import_css42.css)({
2596
+ className: (0, import_css43.css)({
2568
2597
  w: "1/2"
2569
2598
  }),
2570
2599
  onClick: handleActionClick,
@@ -2588,13 +2617,13 @@ function useCTAModal() {
2588
2617
  // src/context/notification-center.tsx
2589
2618
  var import_react19 = require("react");
2590
2619
  var import_patterns17 = require("@cerberus/styled-system/patterns");
2591
- var import_recipes33 = require("@cerberus/styled-system/recipes");
2592
- var import_css43 = require("@cerberus/styled-system/css");
2593
- var import_jsx_runtime51 = require("react/jsx-runtime");
2620
+ var import_recipes34 = require("@cerberus/styled-system/recipes");
2621
+ var import_css44 = require("@cerberus/styled-system/css");
2622
+ var import_jsx_runtime52 = require("react/jsx-runtime");
2594
2623
  var NotificationsContext = (0, import_react19.createContext)(null);
2595
2624
  function NotificationCenter(props) {
2596
2625
  const [activeNotifications, setActiveNotifications] = (0, import_react19.useState)([]);
2597
- const styles = (0, import_recipes33.notification)();
2626
+ const styles = (0, import_recipes34.notification)();
2598
2627
  const handleNotify = (0, import_react19.useCallback)((options) => {
2599
2628
  setActiveNotifications((prev) => {
2600
2629
  const id = `${options.palette}:${prev.length + 1}`;
@@ -2623,22 +2652,22 @@ function NotificationCenter(props) {
2623
2652
  }),
2624
2653
  [handleNotify]
2625
2654
  );
2626
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(NotificationsContext.Provider, { value, children: [
2655
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(NotificationsContext.Provider, { value, children: [
2627
2656
  props.children,
2628
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Show, { when: activeNotifications.length > 0, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Portal, { container: props.container, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: styles.center, children: [
2629
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Show, { when: activeNotifications.length >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2657
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Show, { when: activeNotifications.length > 0, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Portal, { container: props.container, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: styles.center, children: [
2658
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Show, { when: activeNotifications.length >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2630
2659
  Button,
2631
2660
  {
2632
- className: (0, import_css43.cx)(styles.closeAll, (0, import_patterns17.animateIn)()),
2661
+ className: (0, import_css44.cx)(styles.closeAll, (0, import_patterns17.animateIn)()),
2633
2662
  onClick: handleCloseAll,
2634
2663
  palette: "action",
2635
2664
  shape: "rounded",
2636
2665
  size: "sm",
2637
- usage: "text",
2666
+ usage: "ghost",
2638
2667
  children: "Close all"
2639
2668
  }
2640
2669
  ) }),
2641
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2670
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2642
2671
  "div",
2643
2672
  {
2644
2673
  className: (0, import_patterns17.vstack)({
@@ -2648,7 +2677,7 @@ function NotificationCenter(props) {
2648
2677
  style: {
2649
2678
  alignItems: "flex-end"
2650
2679
  },
2651
- children: activeNotifications.map((option) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2680
+ children: activeNotifications.map((option) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2652
2681
  MatchNotification,
2653
2682
  {
2654
2683
  ...option,
@@ -2665,7 +2694,7 @@ function MatchNotification(props) {
2665
2694
  const { palette, id, onClose, heading, description } = props;
2666
2695
  switch (palette) {
2667
2696
  case "success":
2668
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
2697
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2669
2698
  Notification,
2670
2699
  {
2671
2700
  id,
@@ -2673,14 +2702,14 @@ function MatchNotification(props) {
2673
2702
  open: true,
2674
2703
  palette: "success",
2675
2704
  children: [
2676
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationHeading, { palette: "success", children: heading }),
2677
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationDescription, { palette: "success", children: description })
2705
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationHeading, { palette: "success", children: heading }),
2706
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationDescription, { palette: "success", children: description })
2678
2707
  ]
2679
2708
  },
2680
2709
  id
2681
2710
  );
2682
2711
  case "warning":
2683
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
2712
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2684
2713
  Notification,
2685
2714
  {
2686
2715
  id,
@@ -2688,22 +2717,22 @@ function MatchNotification(props) {
2688
2717
  open: true,
2689
2718
  palette: "warning",
2690
2719
  children: [
2691
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationHeading, { palette: "warning", children: heading }),
2692
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationDescription, { palette: "warning", children: description })
2720
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationHeading, { palette: "warning", children: heading }),
2721
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationDescription, { palette: "warning", children: description })
2693
2722
  ]
2694
2723
  },
2695
2724
  id
2696
2725
  );
2697
2726
  case "danger":
2698
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Notification, { id, onClose, open: true, palette: "danger", children: [
2699
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationHeading, { palette: "danger", children: heading }),
2700
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationDescription, { palette: "danger", children: description })
2727
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Notification, { id, onClose, open: true, palette: "danger", children: [
2728
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationHeading, { palette: "danger", children: heading }),
2729
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationDescription, { palette: "danger", children: description })
2701
2730
  ] }, id);
2702
2731
  case "info":
2703
2732
  default:
2704
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Notification, { id, onClose, open: true, palette: "info", children: [
2705
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationHeading, { palette: "info", children: heading }),
2706
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(NotificationDescription, { palette: "info", children: description })
2733
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Notification, { id, onClose, open: true, palette: "info", children: [
2734
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationHeading, { palette: "info", children: heading }),
2735
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NotificationDescription, { palette: "info", children: description })
2707
2736
  ] }, id);
2708
2737
  }
2709
2738
  }
@@ -2719,9 +2748,9 @@ function useNotificationCenter() {
2719
2748
 
2720
2749
  // src/context/prompt-modal.tsx
2721
2750
  var import_react20 = require("react");
2722
- var import_css44 = require("@cerberus/styled-system/css");
2751
+ var import_css45 = require("@cerberus/styled-system/css");
2723
2752
  var import_patterns18 = require("@cerberus/styled-system/patterns");
2724
- var import_jsx_runtime52 = require("react/jsx-runtime");
2753
+ var import_jsx_runtime53 = require("react/jsx-runtime");
2725
2754
  var PromptModalContext = (0, import_react20.createContext)(null);
2726
2755
  function PromptModal(props) {
2727
2756
  const { modalRef, show, close } = useModal();
@@ -2771,36 +2800,36 @@ function PromptModal(props) {
2771
2800
  }),
2772
2801
  [handleShow]
2773
2802
  );
2774
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(PromptModalContext.Provider, { value, children: [
2803
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(PromptModalContext.Provider, { value, children: [
2775
2804
  props.children,
2776
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
2777
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(ModalHeader, { children: [
2778
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2805
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
2806
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(ModalHeader, { children: [
2807
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2779
2808
  "div",
2780
2809
  {
2781
2810
  className: (0, import_patterns18.hstack)({
2782
2811
  justify: "center",
2783
2812
  w: "full"
2784
2813
  }),
2785
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2814
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2786
2815
  Show,
2787
2816
  {
2788
2817
  when: palette === "danger",
2789
- fallback: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2818
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2790
2819
  Avatar,
2791
2820
  {
2792
2821
  ariaLabel: "",
2793
2822
  gradient: "charon-light",
2794
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PromptIcon, { size: 24 }),
2823
+ icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PromptIcon, { size: 24 }),
2795
2824
  src: ""
2796
2825
  }
2797
2826
  ),
2798
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2827
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2799
2828
  Avatar,
2800
2829
  {
2801
2830
  ariaLabel: "",
2802
2831
  gradient: "hades-dark",
2803
- icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PromptIcon, { size: 24 }),
2832
+ icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PromptIcon, { size: 24 }),
2804
2833
  src: ""
2805
2834
  }
2806
2835
  )
@@ -2808,10 +2837,10 @@ function PromptModal(props) {
2808
2837
  )
2809
2838
  }
2810
2839
  ),
2811
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
2812
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
2840
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
2841
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
2813
2842
  ] }),
2814
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2843
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2815
2844
  "div",
2816
2845
  {
2817
2846
  className: (0, import_patterns18.vstack)({
@@ -2819,11 +2848,11 @@ function PromptModal(props) {
2819
2848
  mt: "4",
2820
2849
  mb: "8"
2821
2850
  }),
2822
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Field, { invalid: !isValid, children: [
2823
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2851
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Field, { invalid: !isValid, children: [
2852
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2824
2853
  Label,
2825
2854
  {
2826
- className: (0, import_css44.css)({
2855
+ className: (0, import_css45.css)({
2827
2856
  gap: 1,
2828
2857
  justifyContent: "flex-start"
2829
2858
  }),
@@ -2831,10 +2860,10 @@ function PromptModal(props) {
2831
2860
  size: "md",
2832
2861
  children: [
2833
2862
  "Type",
2834
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2863
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2835
2864
  "strong",
2836
2865
  {
2837
- className: (0, import_css44.css)({
2866
+ className: (0, import_css45.css)({
2838
2867
  textTransform: "uppercase"
2839
2868
  }),
2840
2869
  children: content == null ? void 0 : content.key
@@ -2844,7 +2873,7 @@ function PromptModal(props) {
2844
2873
  ]
2845
2874
  }
2846
2875
  ),
2847
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2876
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2848
2877
  Input,
2849
2878
  {
2850
2879
  id: "confirm",
@@ -2856,7 +2885,7 @@ function PromptModal(props) {
2856
2885
  ] })
2857
2886
  }
2858
2887
  ),
2859
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2888
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2860
2889
  "div",
2861
2890
  {
2862
2891
  className: (0, import_patterns18.hstack)({
@@ -2864,11 +2893,11 @@ function PromptModal(props) {
2864
2893
  gap: "4"
2865
2894
  }),
2866
2895
  children: [
2867
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2896
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2868
2897
  Button,
2869
2898
  {
2870
2899
  autoFocus: true,
2871
- className: (0, import_css44.css)({
2900
+ className: (0, import_css45.css)({
2872
2901
  w: "1/2"
2873
2902
  }),
2874
2903
  disabled: !isValid,
@@ -2879,10 +2908,10 @@ function PromptModal(props) {
2879
2908
  children: content == null ? void 0 : content.actionText
2880
2909
  }
2881
2910
  ),
2882
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2911
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2883
2912
  Button,
2884
2913
  {
2885
- className: (0, import_css44.css)({
2914
+ className: (0, import_css45.css)({
2886
2915
  w: "1/2"
2887
2916
  }),
2888
2917
  name: "cancel",
@@ -2973,7 +3002,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
2973
3002
  }
2974
3003
 
2975
3004
  // src/context/theme.tsx
2976
- var import_jsx_runtime53 = require("react/jsx-runtime");
3005
+ var import_jsx_runtime54 = require("react/jsx-runtime");
2977
3006
  var ThemeContext = (0, import_react22.createContext)(
2978
3007
  null
2979
3008
  );
@@ -2983,7 +3012,7 @@ function ThemeProvider(props) {
2983
3012
  updateMode: props.updateMode,
2984
3013
  updateTheme: props.updateTheme
2985
3014
  });
2986
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemeContext.Provider, { value: state, children: props.children });
3015
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ThemeContext.Provider, { value: state, children: props.children });
2987
3016
  }
2988
3017
  function useThemeContext() {
2989
3018
  const context = (0, import_react22.useContext)(ThemeContext);
@@ -2993,12 +3022,99 @@ function useThemeContext() {
2993
3022
  return context;
2994
3023
  }
2995
3024
 
2996
- // src/hooks/useToggle.ts
3025
+ // src/hooks/useDate.ts
2997
3026
  var import_react23 = require("react");
2998
- function useToggle(options) {
2999
- const [checked, setChecked] = (0, import_react23.useState)((options == null ? void 0 : options.checked) ?? "");
3027
+ function useDate(options) {
3028
+ const initialValue = (options == null ? void 0 : options.initialValue) ?? "";
3029
+ const format = (options == null ? void 0 : options.format) ?? DateFormats.USMilitary;
3000
3030
  const onChange = options == null ? void 0 : options.onChange;
3031
+ const [value, setValue] = (0, import_react23.useState)(initialValue);
3001
3032
  const handleChange = (0, import_react23.useCallback)(
3033
+ (e) => {
3034
+ const newValue = formatMilitaryDate(e.currentTarget.value);
3035
+ if (onChange) onChange(e);
3036
+ setValue(newValue);
3037
+ },
3038
+ [onChange]
3039
+ );
3040
+ return (0, import_react23.useMemo)(
3041
+ () => ({
3042
+ format,
3043
+ value,
3044
+ ISO: formatMilitaryToISO(value),
3045
+ onChange: handleChange
3046
+ }),
3047
+ [format, value, handleChange]
3048
+ );
3049
+ }
3050
+ function formatMilitaryToISO(input3) {
3051
+ const [day, month, year] = input3.split(" ");
3052
+ const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
3053
+ const monthNum = monthIndex + 1;
3054
+ return `${year ?? "0000"}-${monthNum.toString().padStart(2, "0")}-${day.padStart(
3055
+ 2,
3056
+ "0"
3057
+ )}`;
3058
+ }
3059
+ function formatMilitaryDate(input3) {
3060
+ let formatted = input3.toUpperCase().replace(/[^0-9A-Z]/g, "");
3061
+ let day = "";
3062
+ let month = "";
3063
+ let year = "";
3064
+ if (formatted.length >= 2) {
3065
+ day = formatted.replace(/[^0-9]/g, "").slice(0, 2);
3066
+ const dayNum = parseInt(day, 10);
3067
+ if (dayNum > 31) day = "31";
3068
+ else if (dayNum === 0) day = "01";
3069
+ formatted = formatted.slice(2);
3070
+ }
3071
+ if (formatted.length >= 3) {
3072
+ month = formatted.slice(0, 3);
3073
+ const monthIndex = MONTHS.findIndex((m) => m.startsWith(month));
3074
+ if (monthIndex !== -1) {
3075
+ month = MONTHS[monthIndex];
3076
+ } else {
3077
+ month = month.replace(/[^A-Z]/g, "");
3078
+ }
3079
+ formatted = formatted.slice(3);
3080
+ }
3081
+ if (formatted.length > 0) {
3082
+ year = formatted.slice(0, 4);
3083
+ }
3084
+ return [day, month, year].filter(Boolean).join(" ");
3085
+ }
3086
+ var DateFormats = {
3087
+ get ISO() {
3088
+ return "YYYY-MM-DD";
3089
+ },
3090
+ get USMilitary() {
3091
+ return "DD MMM YYYY";
3092
+ },
3093
+ get Months() {
3094
+ return MONTHS;
3095
+ }
3096
+ };
3097
+ var MONTHS = [
3098
+ "JAN",
3099
+ "FEB",
3100
+ "MAR",
3101
+ "APR",
3102
+ "MAY",
3103
+ "JUN",
3104
+ "JUL",
3105
+ "AUG",
3106
+ "SEP",
3107
+ "OCT",
3108
+ "NOV",
3109
+ "DEC"
3110
+ ];
3111
+
3112
+ // src/hooks/useToggle.ts
3113
+ var import_react24 = require("react");
3114
+ function useToggle(options) {
3115
+ const [checked, setChecked] = (0, import_react24.useState)((options == null ? void 0 : options.checked) ?? "");
3116
+ const onChange = options == null ? void 0 : options.onChange;
3117
+ const handleChange = (0, import_react24.useCallback)(
3002
3118
  (e) => {
3003
3119
  const target = e.currentTarget;
3004
3120
  setChecked((prev) => {
@@ -3008,7 +3124,7 @@ function useToggle(options) {
3008
3124
  },
3009
3125
  [onChange]
3010
3126
  );
3011
- return (0, import_react23.useMemo)(() => ({ checked, handleChange }), [checked, handleChange]);
3127
+ return (0, import_react24.useMemo)(() => ({ checked, handleChange }), [checked, handleChange]);
3012
3128
  }
3013
3129
 
3014
3130
  // src/utils/index.ts
@@ -3031,6 +3147,7 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
3031
3147
  Checkbox,
3032
3148
  CircularProgress,
3033
3149
  ConfirmModal,
3150
+ DateFormats,
3034
3151
  Droppable,
3035
3152
  FeatureFlag,
3036
3153
  FeatureFlags,
@@ -3087,15 +3204,19 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
3087
3204
  Thead,
3088
3205
  ThemeProvider,
3089
3206
  Toggle,
3207
+ Tooltip,
3090
3208
  Tr,
3091
3209
  createNavTriggerProps,
3092
3210
  defineIcons,
3211
+ formatMilitaryDate,
3212
+ formatMilitaryToISO,
3093
3213
  formatNotifyCount,
3094
3214
  getPosition,
3095
3215
  processStatus,
3096
3216
  trapFocus,
3097
3217
  useCTAModal,
3098
3218
  useConfirmModal,
3219
+ useDate,
3099
3220
  useFeatureFlags,
3100
3221
  useFieldContext,
3101
3222
  useModal,