@xenide-io/the-old-ui-theme 0.2.5 → 0.2.9

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 (112) hide show
  1. package/dist/chunk-FWCSY2DS.mjs +37 -0
  2. package/dist/chunk-SHF57J7U.mjs +2910 -0
  3. package/dist/index-CmS6hcUk.d.mts +753 -0
  4. package/dist/index-CmS6hcUk.d.ts +753 -0
  5. package/dist/index.d.mts +5 -755
  6. package/dist/index.d.ts +5 -755
  7. package/dist/index.js +655 -378
  8. package/dist/index.mjs +348 -2695
  9. package/dist/tailwind-preset.mjs +2 -0
  10. package/dist/ui.d.mts +3 -0
  11. package/dist/ui.d.ts +3 -0
  12. package/dist/ui.js +2946 -0
  13. package/dist/ui.mjs +139 -0
  14. package/package.json +13 -5
  15. package/src/components/charts/index.ts +8 -0
  16. package/src/components/charts/ph-insight-charts.tsx +162 -0
  17. package/src/components/dashboard/DashboardFiltersBar.tsx +19 -0
  18. package/src/components/dashboard/DashboardGrid.tsx +23 -0
  19. package/src/components/dashboard/DashboardInsightPlaceholder.tsx +37 -0
  20. package/src/components/dashboard/DashboardKpiCard.tsx +25 -0
  21. package/src/components/dashboard/DashboardToolbar.tsx +23 -0
  22. package/src/components/dashboard/DashboardWell.tsx +10 -0
  23. package/src/components/dashboard/InsightMiniCard.tsx +26 -0
  24. package/src/components/dashboard/InsightShell.tsx +37 -0
  25. package/src/components/dashboard/InsightShellHeader.tsx +22 -0
  26. package/src/components/dashboard/MiniTrendBars.tsx +51 -0
  27. package/src/components/dashboard/index.ts +31 -0
  28. package/src/components/dashboard/types.ts +9 -0
  29. package/src/components/icons/IconBase.tsx +39 -0
  30. package/src/components/icons/createIconBase.tsx +27 -0
  31. package/src/components/icons/icons.tsx +367 -0
  32. package/src/components/icons/index.ts +3 -0
  33. package/src/components/sections/AccordionShowcase.tsx +45 -0
  34. package/src/components/sections/AlertShowcase.tsx +39 -0
  35. package/src/components/sections/AvatarShowcase.tsx +80 -0
  36. package/src/components/sections/BadgeShowcase.tsx +65 -0
  37. package/src/components/sections/ButtonShowcase.tsx +312 -0
  38. package/src/components/sections/CalendarShowcase.tsx +35 -0
  39. package/src/components/sections/CardShowcase.tsx +143 -0
  40. package/src/components/sections/ChartShowcase.tsx +190 -0
  41. package/src/components/sections/CodeMockupShowcase.tsx +56 -0
  42. package/src/components/sections/ColorPalette.tsx +117 -0
  43. package/src/components/sections/CommandPaletteShowcase.tsx +48 -0
  44. package/src/components/sections/CountdownShowcase.tsx +43 -0
  45. package/src/components/sections/DashboardShowcase.tsx +191 -0
  46. package/src/components/sections/DiffShowcase.tsx +70 -0
  47. package/src/components/sections/DrawerShowcase.tsx +97 -0
  48. package/src/components/sections/DropdownShowcase.tsx +100 -0
  49. package/src/components/sections/EmptyStateShowcase.tsx +50 -0
  50. package/src/components/sections/FilterChipsShowcase.tsx +50 -0
  51. package/src/components/sections/FormShowcase.tsx +126 -0
  52. package/src/components/sections/HoverCardShowcase.tsx +50 -0
  53. package/src/components/sections/IconShowcase.tsx +247 -0
  54. package/src/components/sections/IndicatorShowcase.tsx +52 -0
  55. package/src/components/sections/KbdShowcase.tsx +31 -0
  56. package/src/components/sections/ModalShowcase.tsx +210 -0
  57. package/src/components/sections/NavigationShowcase.tsx +199 -0
  58. package/src/components/sections/ProgressShowcase.tsx +85 -0
  59. package/src/components/sections/SegmentedControlShowcase.tsx +49 -0
  60. package/src/components/sections/SetupThemeShowcase.tsx +262 -0
  61. package/src/components/sections/StackShowcase.tsx +33 -0
  62. package/src/components/sections/StatShowcase.tsx +129 -0
  63. package/src/components/sections/StepperShowcase.tsx +37 -0
  64. package/src/components/sections/SwapShowcase.tsx +91 -0
  65. package/src/components/sections/TabShowcase.tsx +84 -0
  66. package/src/components/sections/TableShowcase.tsx +140 -0
  67. package/src/components/sections/TimelineShowcase.tsx +83 -0
  68. package/src/components/sections/ToastShowcase.tsx +108 -0
  69. package/src/components/sections/TooltipShowcase.tsx +44 -0
  70. package/src/components/sections/UtilityShowcase.tsx +81 -0
  71. package/src/components/ui/Accordion.tsx +77 -0
  72. package/src/components/ui/Alert.tsx +68 -0
  73. package/src/components/ui/Avatar.tsx +97 -0
  74. package/src/components/ui/Badge.tsx +55 -0
  75. package/src/components/ui/Button.tsx +110 -0
  76. package/src/components/ui/ButtonChrome.tsx +20 -0
  77. package/src/components/ui/Calendar.tsx +116 -0
  78. package/src/components/ui/Card.tsx +60 -0
  79. package/src/components/ui/ChatBubble.tsx +71 -0
  80. package/src/components/ui/CodeBlock.tsx +48 -0
  81. package/src/components/ui/CollapsibleSection.tsx +49 -0
  82. package/src/components/ui/CommandPalette.tsx +137 -0
  83. package/src/components/ui/ComponentDocs.tsx +52 -0
  84. package/src/components/ui/Drawer.tsx +71 -0
  85. package/src/components/ui/DropdownMenu.tsx +138 -0
  86. package/src/components/ui/EmptyState.tsx +33 -0
  87. package/src/components/ui/FilterChips.tsx +50 -0
  88. package/src/components/ui/HoverCard.tsx +36 -0
  89. package/src/components/ui/Indicator.tsx +61 -0
  90. package/src/components/ui/Input.tsx +359 -0
  91. package/src/components/ui/Kbd.tsx +38 -0
  92. package/src/components/ui/Modal.tsx +75 -0
  93. package/src/components/ui/Navigation.tsx +94 -0
  94. package/src/components/ui/Panel.tsx +18 -0
  95. package/src/components/ui/Progress.tsx +59 -0
  96. package/src/components/ui/Rating.tsx +65 -0
  97. package/src/components/ui/SearchInput.tsx +106 -0
  98. package/src/components/ui/SegmentedControl.tsx +44 -0
  99. package/src/components/ui/ShowcaseWrapper.tsx +136 -0
  100. package/src/components/ui/Stat.tsx +39 -0
  101. package/src/components/ui/Stepper.tsx +75 -0
  102. package/src/components/ui/Table.tsx +55 -0
  103. package/src/components/ui/Tabs.tsx +53 -0
  104. package/src/components/ui/Terminal.tsx +54 -0
  105. package/src/components/ui/ThemeDomSync.tsx +17 -0
  106. package/src/components/ui/ThemeManager.tsx +18 -0
  107. package/src/components/ui/ThemeSwitcher.tsx +46 -0
  108. package/src/components/ui/Timeline.tsx +60 -0
  109. package/src/components/ui/Toast.tsx +70 -0
  110. package/src/components/ui/Typography.tsx +129 -0
  111. package/src/components/ui/index.ts +92 -0
  112. package/src/styles/themes.css +118 -0
package/dist/index.js CHANGED
@@ -1,8 +1,37 @@
1
1
  "use strict";
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
6
35
  var __export = (target, all) => {
7
36
  for (var name in all)
8
37
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -226,19 +255,30 @@ var shapeClass = {
226
255
  square: "ph-btn-square",
227
256
  wide: "ph-btn-wide"
228
257
  };
229
- function Button({
230
- variant = "secondary",
231
- size = "md",
232
- shape = "default",
233
- outline = false,
234
- split = false,
235
- icon,
236
- sideIcon,
237
- className,
238
- children,
239
- type = "button",
240
- ...props
241
- }) {
258
+ function Button(_a) {
259
+ var _b = _a, {
260
+ variant = "secondary",
261
+ size = "md",
262
+ shape = "default",
263
+ outline = false,
264
+ split = false,
265
+ icon,
266
+ sideIcon,
267
+ className,
268
+ children,
269
+ type = "button"
270
+ } = _b, props = __objRest(_b, [
271
+ "variant",
272
+ "size",
273
+ "shape",
274
+ "outline",
275
+ "split",
276
+ "icon",
277
+ "sideIcon",
278
+ "className",
279
+ "children",
280
+ "type"
281
+ ]);
242
282
  const usesLemonChrome = variant === "primary" || variant === "secondary";
243
283
  const content = usesLemonChrome ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ButtonChrome, { label: children, icon, sideIcon, split }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
244
284
  icon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ph-btn-icon", children: icon }) : null,
@@ -248,7 +288,7 @@ function Button({
248
288
  ] });
249
289
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
250
290
  "button",
251
- {
291
+ __spreadProps(__spreadValues({
252
292
  type,
253
293
  className: cn(
254
294
  "ph-btn",
@@ -258,39 +298,48 @@ function Button({
258
298
  shapeClass[shape],
259
299
  split && "ph-btn-split",
260
300
  className
261
- ),
262
- ...props,
301
+ )
302
+ }, props), {
263
303
  children: content
264
- }
304
+ })
265
305
  );
266
306
  }
267
307
 
268
308
  // src/components/icons/IconBase.tsx
269
309
  var import_jsx_runtime3 = require("react/jsx-runtime");
270
- function IconBase({
271
- className,
272
- size,
273
- children,
274
- viewBox = "0 0 24 24",
275
- fill: fill2 = "none",
276
- xmlns = "http://www.w3.org/2000/svg",
277
- focusable = "false",
278
- ...props
279
- }) {
310
+ function IconBase(_a) {
311
+ var _b = _a, {
312
+ className,
313
+ size,
314
+ children,
315
+ viewBox = "0 0 24 24",
316
+ fill: fill2 = "none",
317
+ xmlns = "http://www.w3.org/2000/svg",
318
+ focusable = "false"
319
+ } = _b, props = __objRest(_b, [
320
+ "className",
321
+ "size",
322
+ "children",
323
+ "viewBox",
324
+ "fill",
325
+ "xmlns",
326
+ "focusable"
327
+ ]);
328
+ var _a2;
280
329
  const dimensionProps = size != null ? { width: size, height: size } : {};
281
330
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
282
331
  "svg",
283
- {
284
- className: cn("ph-icon", className),
285
- ...dimensionProps,
332
+ __spreadProps(__spreadValues(__spreadProps(__spreadValues({
333
+ className: cn("ph-icon", className)
334
+ }, dimensionProps), {
286
335
  viewBox,
287
336
  fill: fill2,
288
337
  xmlns,
289
338
  focusable,
290
- "aria-hidden": props["aria-hidden"] ?? true,
291
- ...props,
339
+ "aria-hidden": (_a2 = props["aria-hidden"]) != null ? _a2 : true
340
+ }), props), {
292
341
  children
293
- }
342
+ })
294
343
  );
295
344
  }
296
345
 
@@ -298,7 +347,7 @@ function IconBase({
298
347
  var import_jsx_runtime4 = require("react/jsx-runtime");
299
348
  function createIconBase({ viewBox = "0 0 24 24", paths }) {
300
349
  return function IconGlyph(props) {
301
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconBase, { viewBox, ...props, children: paths });
350
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconBase, __spreadProps(__spreadValues({ viewBox }, props), { children: paths }));
302
351
  };
303
352
  }
304
353
  function createIconBasePath(d, viewBox = "0 0 24 24") {
@@ -521,8 +570,9 @@ var IconActivity = createIconBasePath(
521
570
  var IconFlask = createIconBasePath(
522
571
  "M19.8 18.4L14 10.67V6.5l1.35-1.35c.39-.39.39-1.02 0-1.41L14.65 2.7a.9959.9959 0 0 0-1.41 0L9.35 6.54c-.39.39-.39 1.02 0 1.41L10.7 9.3v4.17L4.2 18.4C3.53 19.07 4.04 20.25 5 20.25h14c.96 0 1.47-1.18.8-1.85zM6.91 18.25l5.09-5.09 5.09 5.09H6.91z"
523
572
  );
524
- function IconSpinner({ className, ...props }) {
525
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconSync, { className: cn("ph-icon-spin", className), ...props });
573
+ function IconSpinner(_a) {
574
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
575
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconSync, __spreadValues({ className: cn("ph-icon-spin", className) }, props));
526
576
  }
527
577
  var PH_ICONS = {
528
578
  activity: IconActivity,
@@ -594,9 +644,10 @@ var PH_ICONS = {
594
644
  warning: IconExclamation,
595
645
  xCircle: IconCancel
596
646
  };
597
- function IconByName({ name, ...props }) {
647
+ function IconByName(_a) {
648
+ var _b = _a, { name } = _b, props = __objRest(_b, ["name"]);
598
649
  const Icon = PH_ICONS[name];
599
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { ...props });
650
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, __spreadValues({}, props));
600
651
  }
601
652
 
602
653
  // src/components/ui/Alert.tsx
@@ -630,7 +681,7 @@ function Alert({
630
681
  role: "alert",
631
682
  className: cn("ph-alert", statusClassMap[status], className),
632
683
  children: [
633
- icon ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: cn("mt-0.5 h-5 w-5 shrink-0", config.color) }),
684
+ icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { className: cn("mt-0.5 h-5 w-5 shrink-0", config.color) }),
634
685
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1", children: [
635
686
  title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "font-semibold", children: title }),
636
687
  description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mt-1 text-sm text-ph-subtle", children: description }),
@@ -776,12 +827,13 @@ function Drawer({
776
827
 
777
828
  // src/components/ui/Kbd.tsx
778
829
  var import_jsx_runtime10 = require("react/jsx-runtime");
779
- function Kbd({ variant = "shortcut", keys, children, className, ...props }) {
830
+ function Kbd(_a) {
831
+ var _b = _a, { variant = "shortcut", keys, children, className } = _b, props = __objRest(_b, ["variant", "keys", "children", "className"]);
780
832
  if (variant === "token") {
781
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { className: cn("ph-kbd text-ph-ink", className), ...props, children });
833
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", __spreadProps(__spreadValues({ className: cn("ph-kbd text-ph-ink", className) }, props), { children }));
782
834
  }
783
835
  const content = (keys == null ? void 0 : keys.length) ? keys.join(" ") : normalizeShortcut(children);
784
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("kbd", { className: cn("ph-shortcut", className), ...props, children: content });
836
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("kbd", __spreadProps(__spreadValues({ className: cn("ph-shortcut", className) }, props), { children: content }));
785
837
  }
786
838
  function normalizeShortcut(children) {
787
839
  if (typeof children !== "string") return children;
@@ -808,16 +860,23 @@ function dropdownPanelClass(align, panelClassName) {
808
860
  panelClassName
809
861
  );
810
862
  }
811
- function DropdownMenu({
812
- trigger,
813
- children,
814
- align = "start",
815
- className,
816
- panelClassName,
817
- "aria-label": ariaLabel,
818
- ...props
819
- }) {
820
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("details", { className: cn("relative", className), ...props, children: [
863
+ function DropdownMenu(_a) {
864
+ var _b = _a, {
865
+ trigger,
866
+ children,
867
+ align = "start",
868
+ className,
869
+ panelClassName,
870
+ "aria-label": ariaLabel
871
+ } = _b, props = __objRest(_b, [
872
+ "trigger",
873
+ "children",
874
+ "align",
875
+ "className",
876
+ "panelClassName",
877
+ "aria-label"
878
+ ]);
879
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("details", __spreadProps(__spreadValues({ className: cn("relative", className) }, props), { children: [
821
880
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
822
881
  "summary",
823
882
  {
@@ -827,27 +886,40 @@ function DropdownMenu({
827
886
  }
828
887
  ),
829
888
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: dropdownPanelClass(align, panelClassName), children })
830
- ] });
889
+ ] }));
831
890
  }
832
- function DropdownButton({
833
- label,
834
- variant = "secondary",
835
- outline = false,
836
- size = "md",
837
- split = false,
838
- icon,
839
- sideIcon,
840
- children,
841
- align = "start",
842
- className,
843
- panelClassName,
844
- "aria-label": ariaLabel,
845
- ...props
846
- }) {
891
+ function DropdownButton(_a) {
892
+ var _b = _a, {
893
+ label,
894
+ variant = "secondary",
895
+ outline = false,
896
+ size = "md",
897
+ split = false,
898
+ icon,
899
+ sideIcon,
900
+ children,
901
+ align = "start",
902
+ className,
903
+ panelClassName,
904
+ "aria-label": ariaLabel
905
+ } = _b, props = __objRest(_b, [
906
+ "label",
907
+ "variant",
908
+ "outline",
909
+ "size",
910
+ "split",
911
+ "icon",
912
+ "sideIcon",
913
+ "children",
914
+ "align",
915
+ "className",
916
+ "panelClassName",
917
+ "aria-label"
918
+ ]);
847
919
  const usesLemonChrome = variant === "primary" || variant === "secondary";
848
920
  const chevron = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconChevronDown, { className: "h-4 w-4", "aria-hidden": true });
849
- const trailing = sideIcon ?? chevron;
850
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("details", { className: cn("relative", className), ...props, children: [
921
+ const trailing = sideIcon != null ? sideIcon : chevron;
922
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("details", __spreadProps(__spreadValues({ className: cn("relative", className) }, props), { children: [
851
923
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
852
924
  "summary",
853
925
  {
@@ -858,7 +930,7 @@ function DropdownButton({
858
930
  sizeClass2[size],
859
931
  split && "ph-btn-split"
860
932
  ),
861
- "aria-label": ariaLabel ?? label,
933
+ "aria-label": ariaLabel != null ? ariaLabel : label,
862
934
  children: usesLemonChrome ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ButtonChrome, { label, icon, sideIcon: trailing, split }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
863
935
  icon != null ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ph-btn-icon", children: icon }) : null,
864
936
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ph-btn-label", children: label }),
@@ -867,14 +939,17 @@ function DropdownButton({
867
939
  }
868
940
  ),
869
941
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: dropdownPanelClass(align, panelClassName), children })
870
- ] });
942
+ ] }));
871
943
  }
872
- function DropdownItem({
873
- className,
874
- children,
875
- ...props
876
- }) {
877
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: cn("ph-dropdown-item w-full text-left", className), ...props, children });
944
+ function DropdownItem(_a) {
945
+ var _b = _a, {
946
+ className,
947
+ children
948
+ } = _b, props = __objRest(_b, [
949
+ "className",
950
+ "children"
951
+ ]);
952
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", __spreadProps(__spreadValues({ type: "button", className: cn("ph-dropdown-item w-full text-left", className) }, props), { children }));
878
953
  }
879
954
 
880
955
  // src/components/ui/Input.tsx
@@ -885,21 +960,32 @@ var sizeMap3 = {
885
960
  md: "",
886
961
  lg: "ph-input-lg"
887
962
  };
888
- function Input({
889
- id: idProp,
890
- label,
891
- hideLabel = false,
892
- error,
893
- helperText,
894
- size = "md",
895
- variant = "default",
896
- className,
897
- wrapperClassName,
898
- disabled,
899
- ...props
900
- }) {
963
+ function Input(_a) {
964
+ var _b = _a, {
965
+ id: idProp,
966
+ label,
967
+ hideLabel = false,
968
+ error,
969
+ helperText,
970
+ size = "md",
971
+ variant = "default",
972
+ className,
973
+ wrapperClassName,
974
+ disabled
975
+ } = _b, props = __objRest(_b, [
976
+ "id",
977
+ "label",
978
+ "hideLabel",
979
+ "error",
980
+ "helperText",
981
+ "size",
982
+ "variant",
983
+ "className",
984
+ "wrapperClassName",
985
+ "disabled"
986
+ ]);
901
987
  const autoId = (0, import_react.useId)();
902
- const id = idProp ?? autoId;
988
+ const id = idProp != null ? idProp : autoId;
903
989
  const hasError = Boolean(error);
904
990
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
905
991
  label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
@@ -916,7 +1002,7 @@ function Input({
916
1002
  ),
917
1003
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
918
1004
  "input",
919
- {
1005
+ __spreadValues({
920
1006
  id,
921
1007
  disabled,
922
1008
  "aria-invalid": hasError || void 0,
@@ -927,29 +1013,39 @@ function Input({
927
1013
  hasError && "ph-input-error",
928
1014
  disabled && "cursor-not-allowed opacity-60",
929
1015
  className
930
- ),
931
- ...props
932
- }
1016
+ )
1017
+ }, props)
933
1018
  ),
934
1019
  helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
935
1020
  error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
936
1021
  ] });
937
1022
  }
938
- function Select({
939
- id: idProp,
940
- label,
941
- hideLabel = false,
942
- error,
943
- helperText,
944
- size = "md",
945
- className,
946
- wrapperClassName,
947
- disabled,
948
- children,
949
- ...props
950
- }) {
1023
+ function Select(_a) {
1024
+ var _b = _a, {
1025
+ id: idProp,
1026
+ label,
1027
+ hideLabel = false,
1028
+ error,
1029
+ helperText,
1030
+ size = "md",
1031
+ className,
1032
+ wrapperClassName,
1033
+ disabled,
1034
+ children
1035
+ } = _b, props = __objRest(_b, [
1036
+ "id",
1037
+ "label",
1038
+ "hideLabel",
1039
+ "error",
1040
+ "helperText",
1041
+ "size",
1042
+ "className",
1043
+ "wrapperClassName",
1044
+ "disabled",
1045
+ "children"
1046
+ ]);
951
1047
  const autoId = (0, import_react.useId)();
952
- const id = idProp ?? autoId;
1048
+ const id = idProp != null ? idProp : autoId;
953
1049
  const hasError = Boolean(error);
954
1050
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
955
1051
  label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
@@ -962,7 +1058,7 @@ function Select({
962
1058
  ),
963
1059
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
964
1060
  "select",
965
- {
1061
+ __spreadProps(__spreadValues({
966
1062
  id,
967
1063
  disabled,
968
1064
  "aria-invalid": hasError || void 0,
@@ -972,29 +1068,39 @@ function Select({
972
1068
  hasError && "border-ph-danger focus:border-ph-danger focus:ring-ph-danger/20",
973
1069
  disabled && "cursor-not-allowed opacity-60",
974
1070
  className
975
- ),
976
- ...props,
1071
+ )
1072
+ }, props), {
977
1073
  children
978
- }
1074
+ })
979
1075
  ),
980
1076
  helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
981
1077
  error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
982
1078
  ] });
983
1079
  }
984
- function Textarea({
985
- id: idProp,
986
- label,
987
- hideLabel = false,
988
- error,
989
- helperText,
990
- size = "md",
991
- className,
992
- wrapperClassName,
993
- disabled,
994
- ...props
995
- }) {
1080
+ function Textarea(_a) {
1081
+ var _b = _a, {
1082
+ id: idProp,
1083
+ label,
1084
+ hideLabel = false,
1085
+ error,
1086
+ helperText,
1087
+ size = "md",
1088
+ className,
1089
+ wrapperClassName,
1090
+ disabled
1091
+ } = _b, props = __objRest(_b, [
1092
+ "id",
1093
+ "label",
1094
+ "hideLabel",
1095
+ "error",
1096
+ "helperText",
1097
+ "size",
1098
+ "className",
1099
+ "wrapperClassName",
1100
+ "disabled"
1101
+ ]);
996
1102
  const autoId = (0, import_react.useId)();
997
- const id = idProp ?? autoId;
1103
+ const id = idProp != null ? idProp : autoId;
998
1104
  const hasError = Boolean(error);
999
1105
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
1000
1106
  label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
@@ -1007,7 +1113,7 @@ function Textarea({
1007
1113
  ),
1008
1114
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1009
1115
  "textarea",
1010
- {
1116
+ __spreadValues({
1011
1117
  id,
1012
1118
  disabled,
1013
1119
  "aria-invalid": hasError || void 0,
@@ -1017,31 +1123,38 @@ function Textarea({
1017
1123
  hasError && "border-ph-danger focus:border-ph-danger focus:ring-ph-danger/20",
1018
1124
  disabled && "cursor-not-allowed opacity-60",
1019
1125
  className
1020
- ),
1021
- ...props
1022
- }
1126
+ )
1127
+ }, props)
1023
1128
  ),
1024
1129
  helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: helperText }),
1025
1130
  error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-1 text-xs font-medium text-ph-danger", children: error })
1026
1131
  ] });
1027
1132
  }
1028
- function Checkbox({
1029
- id: idProp,
1030
- label,
1031
- error,
1032
- helperText,
1033
- className,
1034
- wrapperClassName,
1035
- disabled,
1036
- ...props
1037
- }) {
1133
+ function Checkbox(_a) {
1134
+ var _b = _a, {
1135
+ id: idProp,
1136
+ label,
1137
+ error,
1138
+ helperText,
1139
+ className,
1140
+ wrapperClassName,
1141
+ disabled
1142
+ } = _b, props = __objRest(_b, [
1143
+ "id",
1144
+ "label",
1145
+ "error",
1146
+ "helperText",
1147
+ "className",
1148
+ "wrapperClassName",
1149
+ "disabled"
1150
+ ]);
1038
1151
  const autoId = (0, import_react.useId)();
1039
- const id = idProp ?? autoId;
1152
+ const id = idProp != null ? idProp : autoId;
1040
1153
  const hasError = Boolean(error);
1041
1154
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-control-row", wrapperClassName), children: [
1042
1155
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1043
1156
  "input",
1044
- {
1157
+ __spreadValues({
1045
1158
  id,
1046
1159
  type: "checkbox",
1047
1160
  disabled,
@@ -1051,76 +1164,92 @@ function Checkbox({
1051
1164
  hasError && "border-ph-danger",
1052
1165
  disabled && "cursor-not-allowed opacity-60",
1053
1166
  className
1054
- ),
1055
- ...props
1056
- }
1167
+ )
1168
+ }, props)
1057
1169
  ),
1058
1170
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label }),
1059
1171
  helperText && !hasError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-0.5 text-xs text-ph-subtle", children: helperText }),
1060
1172
  error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-0.5 text-xs font-medium text-ph-danger", children: error })
1061
1173
  ] });
1062
1174
  }
1063
- function Radio({
1064
- id: idProp,
1065
- label,
1066
- className,
1067
- wrapperClassName,
1068
- disabled,
1069
- ...props
1070
- }) {
1175
+ function Radio(_a) {
1176
+ var _b = _a, {
1177
+ id: idProp,
1178
+ label,
1179
+ className,
1180
+ wrapperClassName,
1181
+ disabled
1182
+ } = _b, props = __objRest(_b, [
1183
+ "id",
1184
+ "label",
1185
+ "className",
1186
+ "wrapperClassName",
1187
+ "disabled"
1188
+ ]);
1071
1189
  const autoId = (0, import_react.useId)();
1072
- const id = idProp ?? autoId;
1190
+ const id = idProp != null ? idProp : autoId;
1073
1191
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-control-row", wrapperClassName, disabled && "opacity-60"), children: [
1074
1192
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1075
1193
  "input",
1076
- {
1194
+ __spreadValues({
1077
1195
  id,
1078
1196
  type: "radio",
1079
1197
  disabled,
1080
- className: cn("ph-radio", disabled && "cursor-not-allowed", className),
1081
- ...props
1082
- }
1198
+ className: cn("ph-radio", disabled && "cursor-not-allowed", className)
1199
+ }, props)
1083
1200
  ),
1084
1201
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: id, className: cn("cursor-pointer", disabled && "opacity-60"), children: label })
1085
1202
  ] });
1086
1203
  }
1087
- function Toggle({
1088
- id: idProp,
1089
- label,
1090
- className,
1091
- wrapperClassName,
1092
- disabled,
1093
- ...props
1094
- }) {
1204
+ function Toggle(_a) {
1205
+ var _b = _a, {
1206
+ id: idProp,
1207
+ label,
1208
+ className,
1209
+ wrapperClassName,
1210
+ disabled
1211
+ } = _b, props = __objRest(_b, [
1212
+ "id",
1213
+ "label",
1214
+ "className",
1215
+ "wrapperClassName",
1216
+ "disabled"
1217
+ ]);
1095
1218
  const autoId = (0, import_react.useId)();
1096
- const id = idProp ?? autoId;
1219
+ const id = idProp != null ? idProp : autoId;
1097
1220
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: cn("ph-control-row-between", wrapperClassName, disabled && "opacity-60"), children: [
1098
1221
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: disabled ? "opacity-60" : void 0, children: label }),
1099
1222
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1100
1223
  "input",
1101
- {
1224
+ __spreadValues({
1102
1225
  id,
1103
1226
  type: "checkbox",
1104
1227
  role: "switch",
1105
1228
  disabled,
1106
- className: cn("ph-toggle", disabled && "cursor-not-allowed", className),
1107
- ...props
1108
- }
1229
+ className: cn("ph-toggle", disabled && "cursor-not-allowed", className)
1230
+ }, props)
1109
1231
  )
1110
1232
  ] });
1111
1233
  }
1112
- function Range({
1113
- label,
1114
- minLabel,
1115
- maxLabel,
1116
- valueLabel,
1117
- wrapperClassName,
1118
- className,
1119
- ...props
1120
- }) {
1234
+ function Range(_a) {
1235
+ var _b = _a, {
1236
+ label,
1237
+ minLabel,
1238
+ maxLabel,
1239
+ valueLabel,
1240
+ wrapperClassName,
1241
+ className
1242
+ } = _b, props = __objRest(_b, [
1243
+ "label",
1244
+ "minLabel",
1245
+ "maxLabel",
1246
+ "valueLabel",
1247
+ "wrapperClassName",
1248
+ "className"
1249
+ ]);
1121
1250
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
1122
1251
  label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "ph-label", children: label }),
1123
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "range", className: cn("ph-range", className), ...props }),
1252
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", __spreadValues({ type: "range", className: cn("ph-range", className) }, props)),
1124
1253
  (minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between text-xs text-ph-mutedtext", children: [
1125
1254
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: minLabel }),
1126
1255
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: valueLabel }),
@@ -1128,11 +1257,12 @@ function Range({
1128
1257
  ] })
1129
1258
  ] });
1130
1259
  }
1131
- function FileUpload({ label, prompt = "Drop file or browse", wrapperClassName, className, ...props }) {
1260
+ function FileUpload(_a) {
1261
+ var _b = _a, { label, prompt = "Drop file or browse", wrapperClassName, className } = _b, props = __objRest(_b, ["label", "prompt", "wrapperClassName", "className"]);
1132
1262
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
1133
1263
  label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "ph-label", children: label }),
1134
1264
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "flex cursor-pointer items-center gap-3 rounded-lg border border-dashed border-ph-border bg-ph-surface px-4 py-6 text-sm text-ph-subtle transition hover:bg-ph-muted/60", children: [
1135
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "file", className: cn("sr-only", className), ...props }),
1265
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", __spreadValues({ type: "file", className: cn("sr-only", className) }, props)),
1136
1266
  prompt
1137
1267
  ] })
1138
1268
  ] });
@@ -1253,36 +1383,45 @@ function Pagination({
1253
1383
 
1254
1384
  // src/components/ui/Panel.tsx
1255
1385
  var import_jsx_runtime15 = require("react/jsx-runtime");
1256
- function Panel({ title, description, children, className, ...props }) {
1257
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("ph-panel", className), ...props, children: [
1386
+ function Panel(_a) {
1387
+ var _b = _a, { title, description, children, className } = _b, props = __objRest(_b, ["title", "description", "children", "className"]);
1388
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", __spreadProps(__spreadValues({ className: cn("ph-panel", className) }, props), { children: [
1258
1389
  title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { className: "text-sm font-semibold uppercase tracking-wider text-ph-mutedtext", children: title }),
1259
1390
  description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
1260
1391
  children
1261
- ] });
1392
+ ] }));
1262
1393
  }
1263
1394
 
1264
1395
  // src/components/ui/Rating.tsx
1265
1396
  var import_jsx_runtime16 = require("react/jsx-runtime");
1266
- function Rating({
1267
- label,
1268
- value = 0,
1269
- max = 5,
1270
- readOnly = true,
1271
- onChange,
1272
- className,
1273
- wrapperClassName,
1274
- ...props
1275
- }) {
1397
+ function Rating(_a) {
1398
+ var _b = _a, {
1399
+ label,
1400
+ value = 0,
1401
+ max = 5,
1402
+ readOnly = true,
1403
+ onChange,
1404
+ className,
1405
+ wrapperClassName
1406
+ } = _b, props = __objRest(_b, [
1407
+ "label",
1408
+ "value",
1409
+ "max",
1410
+ "readOnly",
1411
+ "onChange",
1412
+ "className",
1413
+ "wrapperClassName"
1414
+ ]);
1276
1415
  const stars = Array.from({ length: max }, (_, index) => index + 1);
1277
1416
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
1278
1417
  label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "ph-label", children: label }),
1279
1418
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1280
1419
  "div",
1281
- {
1420
+ __spreadProps(__spreadValues({
1282
1421
  className: cn("ph-rating flex", className),
1283
1422
  role: readOnly ? "img" : "radiogroup",
1284
- "aria-label": label ?? `Rating: ${value} out of ${max}`,
1285
- ...props,
1423
+ "aria-label": label != null ? label : `Rating: ${value} out of ${max}`
1424
+ }, props), {
1286
1425
  children: stars.map((star) => {
1287
1426
  const active = star <= value;
1288
1427
  if (readOnly) {
@@ -1309,7 +1448,7 @@ function Rating({
1309
1448
  star
1310
1449
  );
1311
1450
  })
1312
- }
1451
+ })
1313
1452
  )
1314
1453
  ] });
1315
1454
  }
@@ -1317,19 +1456,28 @@ function Rating({
1317
1456
  // src/components/ui/SearchInput.tsx
1318
1457
  var import_react2 = require("react");
1319
1458
  var import_jsx_runtime17 = require("react/jsx-runtime");
1320
- function SearchInput({
1321
- id: idProp,
1322
- label = "Search",
1323
- hideLabel = false,
1324
- shortcut,
1325
- density = "default",
1326
- className,
1327
- wrapperClassName,
1328
- placeholder,
1329
- ...props
1330
- }) {
1459
+ function SearchInput(_a) {
1460
+ var _b = _a, {
1461
+ id: idProp,
1462
+ label = "Search",
1463
+ hideLabel = false,
1464
+ shortcut,
1465
+ density = "default",
1466
+ className,
1467
+ wrapperClassName,
1468
+ placeholder
1469
+ } = _b, props = __objRest(_b, [
1470
+ "id",
1471
+ "label",
1472
+ "hideLabel",
1473
+ "shortcut",
1474
+ "density",
1475
+ "className",
1476
+ "wrapperClassName",
1477
+ "placeholder"
1478
+ ]);
1331
1479
  const autoId = (0, import_react2.useId)();
1332
- const id = idProp ?? autoId;
1480
+ const id = idProp != null ? idProp : autoId;
1333
1481
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
1334
1482
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: id, className: hideLabel ? "sr-only" : "ph-label mb-1.5 block", children: label }),
1335
1483
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
@@ -1343,7 +1491,7 @@ function SearchInput({
1343
1491
  ) : null,
1344
1492
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1345
1493
  "input",
1346
- {
1494
+ __spreadValues({
1347
1495
  id,
1348
1496
  type: "search",
1349
1497
  placeholder,
@@ -1353,36 +1501,41 @@ function SearchInput({
1353
1501
  density === "compact" && "max-w-xs !min-h-[2rem] py-1.5 text-sm",
1354
1502
  shortcut != null && "pl-[3.25rem]",
1355
1503
  className
1356
- ),
1357
- ...props
1358
- }
1504
+ )
1505
+ }, props)
1359
1506
  )
1360
1507
  ] })
1361
1508
  ] });
1362
1509
  }
1363
- function SearchGroup({
1364
- id: idProp,
1365
- label = "Search records",
1366
- submitLabel = "Search",
1367
- placeholder = "Persons, actions, flags\u2026",
1368
- wrapperClassName,
1369
- className,
1370
- ...props
1371
- }) {
1510
+ function SearchGroup(_a) {
1511
+ var _b = _a, {
1512
+ id: idProp,
1513
+ label = "Search records",
1514
+ submitLabel = "Search",
1515
+ placeholder = "Persons, actions, flags\u2026",
1516
+ wrapperClassName,
1517
+ className
1518
+ } = _b, props = __objRest(_b, [
1519
+ "id",
1520
+ "label",
1521
+ "submitLabel",
1522
+ "placeholder",
1523
+ "wrapperClassName",
1524
+ "className"
1525
+ ]);
1372
1526
  const autoId = (0, import_react2.useId)();
1373
- const id = idProp ?? autoId;
1527
+ const id = idProp != null ? idProp : autoId;
1374
1528
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("ph-field", wrapperClassName), children: [
1375
1529
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
1376
1530
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "ph-search-group flex w-full max-w-lg min-h-[2.3125rem] items-stretch divide-x divide-ph-border", children: [
1377
1531
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1378
1532
  "input",
1379
- {
1533
+ __spreadValues({
1380
1534
  id,
1381
1535
  type: "search",
1382
1536
  placeholder,
1383
- className: cn("ph-input ph-input-group-field min-w-0 flex-1", className),
1384
- ...props
1385
- }
1537
+ className: cn("ph-input ph-input-group-field min-w-0 flex-1", className)
1538
+ }, props)
1386
1539
  ),
1387
1540
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1388
1541
  Button,
@@ -1433,13 +1586,14 @@ var statMap = {
1433
1586
  purple: "",
1434
1587
  warning: "border-amber-200 bg-amber-50/70"
1435
1588
  };
1436
- function Stat({ icon, label, value, footer, tone = "default", className, ...props }) {
1437
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { className: cn("ph-stat", statMap[tone], className), ...props, children: [
1589
+ function Stat(_a) {
1590
+ var _b = _a, { icon, label, value, footer, tone = "default", className } = _b, props = __objRest(_b, ["icon", "label", "value", "footer", "tone", "className"]);
1591
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-stat", statMap[tone], className) }, props), { children: [
1438
1592
  icon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("mb-2 h-7 w-7", toneMap[tone]), children: icon }),
1439
1593
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("ph-stat-label", tone === "warning" && toneMap[tone]), children: label }),
1440
1594
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("ph-stat-val", toneMap[tone]), children: value }),
1441
1595
  footer && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-ph-subtle", children: footer })
1442
- ] });
1596
+ ] }));
1443
1597
  }
1444
1598
 
1445
1599
  // src/components/ui/Toast.tsx
@@ -1684,6 +1838,20 @@ var THEMES = [
1684
1838
  description: "Ros\xE9 Pine Main \u2014 moonlit base with iris and love accents.",
1685
1839
  colorScheme: "dark",
1686
1840
  group: "Ros\xE9 Pine"
1841
+ },
1842
+ {
1843
+ id: "notion",
1844
+ name: "Notion",
1845
+ description: "Notion light \u2014 warm off-white canvas, Notion blue accent, signature dark text.",
1846
+ colorScheme: "light",
1847
+ group: "Productivity"
1848
+ },
1849
+ {
1850
+ id: "notion-dark",
1851
+ name: "Notion Dark",
1852
+ description: "Notion dark mode \u2014 dark charcoal canvas with blue accent and clean typography.",
1853
+ colorScheme: "dark",
1854
+ group: "Productivity"
1687
1855
  }
1688
1856
  ];
1689
1857
  var THEME_GROUPS = Array.from(new Set(THEMES.map((theme) => theme.group)));
@@ -2234,12 +2402,15 @@ function ComponentDocs({ title = "Props & variants", rows, defaultOpen = false,
2234
2402
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Default" }),
2235
2403
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("th", { className: "px-4 py-2 font-semibold", children: "Use" })
2236
2404
  ] }) }),
2237
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("tbody", { className: "divide-y divide-ph-border", children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("tr", { children: [
2238
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-ink", children: row.name }),
2239
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: row.type }),
2240
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: row.defaultValue ?? "-" }),
2241
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top text-ph-subtle", children: row.description })
2242
- ] }, row.name)) })
2405
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("tbody", { className: "divide-y divide-ph-border", children: rows.map((row) => {
2406
+ var _a;
2407
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("tr", { children: [
2408
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-ink", children: row.name }),
2409
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: row.type }),
2410
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top font-mono text-xs text-ph-subtle", children: (_a = row.defaultValue) != null ? _a : "-" }),
2411
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("td", { className: "px-4 py-3 align-top text-ph-subtle", children: row.description })
2412
+ ] }, row.name);
2413
+ }) })
2243
2414
  ] }) })
2244
2415
  ] });
2245
2416
  }
@@ -2257,9 +2428,10 @@ function ShowcaseWrapper({
2257
2428
  children,
2258
2429
  className
2259
2430
  }) {
2431
+ var _a;
2260
2432
  const [showCode, setShowCode] = (0, import_react11.useState)(false);
2261
- const fallbackId = titleIdMap[title] ?? title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
2262
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { id: id ?? fallbackId, className: cn("scroll-mt-20", className), children: [
2433
+ const fallbackId = (_a = titleIdMap[title]) != null ? _a : title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
2434
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { id: id != null ? id : fallbackId, className: cn("scroll-mt-20", className), children: [
2263
2435
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ph-h2-rule mb-8", children: [
2264
2436
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-1.5", children: [
2265
2437
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h2", { children: title }),
@@ -2493,17 +2665,25 @@ var statusMap = {
2493
2665
  away: "bg-amber-400",
2494
2666
  busy: "bg-ph-danger"
2495
2667
  };
2496
- function Avatar({
2497
- label,
2498
- icon,
2499
- size = "md",
2500
- color = "bg-ph-brand text-white",
2501
- status,
2502
- badge,
2503
- className,
2504
- ...props
2505
- }) {
2506
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("relative inline-flex shrink-0", className), ...props, children: [
2668
+ function Avatar(_a) {
2669
+ var _b = _a, {
2670
+ label,
2671
+ icon,
2672
+ size = "md",
2673
+ color = "bg-ph-brand text-white",
2674
+ status,
2675
+ badge,
2676
+ className
2677
+ } = _b, props = __objRest(_b, [
2678
+ "label",
2679
+ "icon",
2680
+ "size",
2681
+ "color",
2682
+ "status",
2683
+ "badge",
2684
+ "className"
2685
+ ]);
2686
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex shrink-0", className) }, props), { children: [
2507
2687
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2508
2688
  "div",
2509
2689
  {
@@ -2525,13 +2705,14 @@ function Avatar({
2525
2705
  }
2526
2706
  ),
2527
2707
  badge && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "absolute -bottom-1 -right-1 flex min-w-[22px] items-center justify-center rounded-full bg-ph-brand px-1.5 py-px text-[10px] font-bold text-white", children: badge })
2528
- ] });
2708
+ ] }));
2529
2709
  }
2530
- function AvatarGroup({ children, max, className, ...props }) {
2710
+ function AvatarGroup(_a) {
2711
+ var _b = _a, { children, max, className } = _b, props = __objRest(_b, ["children", "max", "className"]);
2531
2712
  const items = Array.isArray(children) ? children : [children];
2532
2713
  const visible = max ? items.slice(0, max) : items;
2533
2714
  const remaining = max ? items.length - max : 0;
2534
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: cn("-space-x-3 flex rtl:space-x-reverse", className), ...props, children: [
2715
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", __spreadProps(__spreadValues({ className: cn("-space-x-3 flex rtl:space-x-reverse", className) }, props), { children: [
2535
2716
  visible,
2536
2717
  remaining > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2537
2718
  Avatar,
@@ -2541,7 +2722,7 @@ function AvatarGroup({ children, max, className, ...props }) {
2541
2722
  color: "bg-ph-toolbar text-ph-subtle"
2542
2723
  }
2543
2724
  )
2544
- ] });
2725
+ ] }));
2545
2726
  }
2546
2727
 
2547
2728
  // src/components/ui/Progress.tsx
@@ -2551,18 +2732,26 @@ var sizeMap6 = {
2551
2732
  md: "h-2",
2552
2733
  lg: "h-3"
2553
2734
  };
2554
- function Progress({
2555
- value,
2556
- max = 100,
2557
- color = "bg-ph-brand",
2558
- label,
2559
- showPercentage = false,
2560
- size = "md",
2561
- className,
2562
- ...props
2563
- }) {
2735
+ function Progress(_a) {
2736
+ var _b = _a, {
2737
+ value,
2738
+ max = 100,
2739
+ color = "bg-ph-brand",
2740
+ label,
2741
+ showPercentage = false,
2742
+ size = "md",
2743
+ className
2744
+ } = _b, props = __objRest(_b, [
2745
+ "value",
2746
+ "max",
2747
+ "color",
2748
+ "label",
2749
+ "showPercentage",
2750
+ "size",
2751
+ "className"
2752
+ ]);
2564
2753
  const percentage = Math.min(100, Math.max(0, value / max * 100));
2565
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("w-full", className), ...props, children: [
2754
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", __spreadProps(__spreadValues({ className: cn("w-full", className) }, props), { children: [
2566
2755
  (label || showPercentage) && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mb-1.5 flex justify-between text-sm text-ph-subtle", children: [
2567
2756
  label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: label }),
2568
2757
  showPercentage && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "tabular-nums", children: [
@@ -2581,31 +2770,39 @@ function Progress({
2581
2770
  "aria-valuemax": max
2582
2771
  }
2583
2772
  ) })
2584
- ] });
2773
+ ] }));
2585
2774
  }
2586
2775
 
2587
2776
  // src/components/ui/ChatBubble.tsx
2588
2777
  var import_jsx_runtime39 = require("react/jsx-runtime");
2589
- function ChatBubble({
2590
- children,
2591
- avatar,
2592
- name,
2593
- time,
2594
- variant = "from",
2595
- footer,
2596
- className,
2597
- ...props
2598
- }) {
2778
+ function ChatBubble(_a) {
2779
+ var _b = _a, {
2780
+ children,
2781
+ avatar,
2782
+ name,
2783
+ time,
2784
+ variant = "from",
2785
+ footer,
2786
+ className
2787
+ } = _b, props = __objRest(_b, [
2788
+ "children",
2789
+ "avatar",
2790
+ "name",
2791
+ "time",
2792
+ "variant",
2793
+ "footer",
2794
+ "className"
2795
+ ]);
2599
2796
  const isSelf = variant === "self";
2600
2797
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2601
2798
  "div",
2602
- {
2799
+ __spreadProps(__spreadValues({
2603
2800
  className: cn(
2604
2801
  "flex gap-3",
2605
2802
  isSelf && "flex-row-reverse",
2606
2803
  className
2607
- ),
2608
- ...props,
2804
+ )
2805
+ }, props), {
2609
2806
  children: [
2610
2807
  avatar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "shrink-0", children: avatar }),
2611
2808
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("min-w-0 flex-1", isSelf && "text-right"), children: [
@@ -2635,27 +2832,32 @@ function ChatBubble({
2635
2832
  footer && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("footer", { className: "mt-2 text-[11px] text-ph-mutedtext", children: footer })
2636
2833
  ] })
2637
2834
  ]
2638
- }
2835
+ })
2639
2836
  );
2640
2837
  }
2641
2838
 
2642
2839
  // src/components/ui/Terminal.tsx
2643
2840
  var import_jsx_runtime40 = require("react/jsx-runtime");
2644
- function Terminal({
2645
- title = "sandbox",
2646
- lines,
2647
- children,
2648
- className,
2649
- ...props
2650
- }) {
2841
+ function Terminal(_a) {
2842
+ var _b = _a, {
2843
+ title = "sandbox",
2844
+ lines,
2845
+ children,
2846
+ className
2847
+ } = _b, props = __objRest(_b, [
2848
+ "title",
2849
+ "lines",
2850
+ "children",
2851
+ "className"
2852
+ ]);
2651
2853
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
2652
2854
  "div",
2653
- {
2855
+ __spreadProps(__spreadValues({
2654
2856
  className: cn(
2655
2857
  "overflow-hidden rounded-xl border border-ph-border shadow-ph-md",
2656
2858
  className
2657
- ),
2658
- ...props,
2859
+ )
2860
+ }, props), {
2659
2861
  children: [
2660
2862
  /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("header", { className: "flex items-center gap-2 border-b border-ph-border bg-ph-muted px-4 py-3", children: [
2661
2863
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "h-3 w-3 rounded-full bg-red-400" }),
@@ -2672,7 +2874,7 @@ function Terminal({
2672
2874
  ] }, i);
2673
2875
  }) }) })
2674
2876
  ]
2675
- }
2877
+ })
2676
2878
  );
2677
2879
  }
2678
2880
 
@@ -2684,16 +2886,23 @@ var positionMap = {
2684
2886
  "bottom-right": "-right-[2px] -bottom-[2px]",
2685
2887
  "bottom-left": "-left-[2px] -bottom-[2px]"
2686
2888
  };
2687
- function Indicator({
2688
- children,
2689
- badge,
2690
- color = "bg-ph-brand",
2691
- position = "top-right",
2692
- dot = false,
2693
- className,
2694
- ...props
2695
- }) {
2696
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn("relative inline-flex items-center justify-center", className), ...props, children: [
2889
+ function Indicator(_a) {
2890
+ var _b = _a, {
2891
+ children,
2892
+ badge,
2893
+ color = "bg-ph-brand",
2894
+ position = "top-right",
2895
+ dot = false,
2896
+ className
2897
+ } = _b, props = __objRest(_b, [
2898
+ "children",
2899
+ "badge",
2900
+ "color",
2901
+ "position",
2902
+ "dot",
2903
+ "className"
2904
+ ]);
2905
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", __spreadProps(__spreadValues({ className: cn("relative inline-flex items-center justify-center", className) }, props), { children: [
2697
2906
  dot ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2698
2907
  "span",
2699
2908
  {
@@ -2715,22 +2924,26 @@ function Indicator({
2715
2924
  }
2716
2925
  ) : null,
2717
2926
  children
2718
- ] });
2927
+ ] }));
2719
2928
  }
2720
2929
 
2721
2930
  // src/components/ui/Timeline.tsx
2722
2931
  var import_jsx_runtime42 = require("react/jsx-runtime");
2723
- function Timeline({
2724
- events,
2725
- alternate = false,
2726
- className,
2727
- ...props
2728
- }) {
2932
+ function Timeline(_a) {
2933
+ var _b = _a, {
2934
+ events,
2935
+ alternate = false,
2936
+ className
2937
+ } = _b, props = __objRest(_b, [
2938
+ "events",
2939
+ "alternate",
2940
+ "className"
2941
+ ]);
2729
2942
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
2730
2943
  "ol",
2731
- {
2732
- className: cn("relative space-y-8", className),
2733
- ...props,
2944
+ __spreadProps(__spreadValues({
2945
+ className: cn("relative space-y-8", className)
2946
+ }, props), {
2734
2947
  children: events.map((event, idx) => {
2735
2948
  const align = alternate && idx % 2 !== 0 ? "lg:flex-row-reverse" : "";
2736
2949
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("li", { className: cn("relative flex gap-6", align), children: [
@@ -2753,12 +2966,41 @@ function Timeline({
2753
2966
  ] })
2754
2967
  ] }, event.id);
2755
2968
  })
2756
- }
2969
+ })
2757
2970
  );
2758
2971
  }
2759
2972
 
2760
2973
  // src/components/charts/ph-insight-charts.tsx
2761
2974
  var import_react15 = require("react");
2975
+
2976
+ // src/lib/chart/register-chartjs.ts
2977
+ var import_chart = require("chart.js");
2978
+ function synchroniseChartJsFontFamily() {
2979
+ if (typeof document === "undefined") {
2980
+ return;
2981
+ }
2982
+ const family = window.getComputedStyle(document.body).fontFamily;
2983
+ const trimmed = family == null ? void 0 : family.trim();
2984
+ if (trimmed) {
2985
+ import_chart.Chart.defaults.font.family = trimmed;
2986
+ }
2987
+ }
2988
+ import_chart.Chart.register(
2989
+ import_chart.CategoryScale,
2990
+ import_chart.LinearScale,
2991
+ import_chart.RadialLinearScale,
2992
+ import_chart.BarController,
2993
+ import_chart.BarElement,
2994
+ import_chart.DoughnutController,
2995
+ import_chart.PolarAreaController,
2996
+ import_chart.ArcElement,
2997
+ import_chart.Title,
2998
+ import_chart.Tooltip,
2999
+ import_chart.Legend
3000
+ );
3001
+ synchroniseChartJsFontFamily();
3002
+
3003
+ // src/components/charts/ph-insight-charts.tsx
2762
3004
  var import_react_chartjs_2 = require("react-chartjs-2");
2763
3005
 
2764
3006
  // src/lib/chart/with-alpha.ts
@@ -3113,7 +3355,7 @@ function readChartTokens(root) {
3113
3355
  if (typeof document === "undefined") {
3114
3356
  return FALLBACK_CHART_TOKENS;
3115
3357
  }
3116
- const el = root ?? document.documentElement;
3358
+ const el = root != null ? root : document.documentElement;
3117
3359
  const series = [1, 2, 3, 4, 5, 6, 7].map((index) => {
3118
3360
  const raw = readCssVar(el, `--ph-data-${index}`);
3119
3361
  return raw !== "" ? raw : FALLBACK_CHART_TOKENS.series[index - 1];
@@ -3128,12 +3370,24 @@ function readChartTokens(root) {
3128
3370
  }
3129
3371
 
3130
3372
  // src/lib/chart/use-ph-chart-tokens.ts
3373
+ function tokensEqual(a, b) {
3374
+ if (a.series.length !== b.series.length) return false;
3375
+ for (let i = 0; i < a.series.length; i++) {
3376
+ if (a.series[i] !== b.series[i]) return false;
3377
+ }
3378
+ return a.grid === b.grid && a.text === b.text && a.textMuted === b.textMuted && a.surface === b.surface && a.borderStrong === b.borderStrong && a.accent === b.accent;
3379
+ }
3131
3380
  function useChartTokens() {
3132
3381
  const [tokens, setTokens] = (0, import_react13.useState)(FALLBACK_CHART_TOKENS);
3382
+ const tokensRef = (0, import_react13.useRef)(FALLBACK_CHART_TOKENS);
3133
3383
  (0, import_react13.useEffect)(() => {
3134
3384
  const root = document.documentElement;
3135
3385
  const refresh = () => {
3136
- setTokens(readChartTokens(root));
3386
+ const next = readChartTokens(root);
3387
+ if (!tokensEqual(tokensRef.current, next)) {
3388
+ tokensRef.current = next;
3389
+ setTokens(next);
3390
+ }
3137
3391
  };
3138
3392
  refresh();
3139
3393
  const observer = new MutationObserver(refresh);
@@ -3167,7 +3421,7 @@ function resolveDisplayedSeries(series, palette) {
3167
3421
  return visible.map((s, visibleIndex) => {
3168
3422
  const hasExplicit = s.color != null && String(s.color).trim() !== "";
3169
3423
  const resolvedColor = hasExplicit ? String(s.color).trim() : palette[visibleIndex % palette.length];
3170
- return { ...s, resolvedColor };
3424
+ return __spreadProps(__spreadValues({}, s), { resolvedColor });
3171
3425
  });
3172
3426
  }
3173
3427
  function yDomainForSeries(resolved) {
@@ -3230,7 +3484,7 @@ function CanvasTrendLineChart({
3230
3484
  }, []);
3231
3485
  const resolved = (0, import_react14.useMemo)(() => resolveDisplayedSeries(series, theme.colors), [series, theme.colors]);
3232
3486
  const draw = (0, import_react14.useCallback)(() => {
3233
- var _a, _b, _c;
3487
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3234
3488
  const canvas = canvasRef.current;
3235
3489
  const container = containerRef.current;
3236
3490
  if (!canvas || !container) {
@@ -3258,15 +3512,15 @@ function CanvasTrendLineChart({
3258
3512
  if (plotWidth <= 4 || plotHeight <= 4) {
3259
3513
  return;
3260
3514
  }
3261
- const bg = theme.backgroundColor ?? "#ffffff";
3515
+ const bg = (_a = theme.backgroundColor) != null ? _a : "#ffffff";
3262
3516
  ctx.fillStyle = bg;
3263
3517
  ctx.fillRect(0, 0, cssW, cssH);
3264
3518
  const labelList = [...labels];
3265
3519
  const xScale = (0, import_d3_scale.scalePoint)().domain(labelList).range([plotLeft, plotLeft + plotWidth]).padding(0.5);
3266
3520
  const [y0, y1] = yDomainForSeries(resolved);
3267
3521
  const yScale = (0, import_d3_scale.scaleLinear)().domain([y0, y1]).nice().range([plotTop + plotHeight, plotTop]);
3268
- const axisColor = theme.axisColor ?? "#666";
3269
- const gridColor = theme.gridColor ?? "rgba(0,0,0,0.08)";
3522
+ const axisColor = (_b = theme.axisColor) != null ? _b : "#666";
3523
+ const gridColor = (_c = theme.gridColor) != null ? _c : "rgba(0,0,0,0.08)";
3270
3524
  if (showGrid) {
3271
3525
  const ticks = yScale.ticks(6);
3272
3526
  ctx.strokeStyle = gridColor;
@@ -3288,7 +3542,7 @@ function CanvasTrendLineChart({
3288
3542
  if (s.overlay || !s.fill) {
3289
3543
  continue;
3290
3544
  }
3291
- const opacity = s.fill.opacity ?? 0.45;
3545
+ const opacity = (_d = s.fill.opacity) != null ? _d : 0.45;
3292
3546
  const baseline = yScale(0);
3293
3547
  ctx.save();
3294
3548
  ctx.globalAlpha = opacity;
@@ -3322,10 +3576,10 @@ function CanvasTrendLineChart({
3322
3576
  ctx.restore();
3323
3577
  }
3324
3578
  for (const s of resolved) {
3325
- if ((_a = s.visibility) == null ? void 0 : _a.excluded) {
3579
+ if ((_e = s.visibility) == null ? void 0 : _e.excluded) {
3326
3580
  continue;
3327
3581
  }
3328
- const pattern = ((_b = s.stroke) == null ? void 0 : _b.pattern) ?? [];
3582
+ const pattern = (_g = (_f = s.stroke) == null ? void 0 : _f.pattern) != null ? _g : [];
3329
3583
  ctx.strokeStyle = s.resolvedColor;
3330
3584
  ctx.lineWidth = 2;
3331
3585
  ctx.lineJoin = "round";
@@ -3379,7 +3633,7 @@ function CanvasTrendLineChart({
3379
3633
  if (hi != null && hi >= 0 && hi < labels.length && showCrosshair) {
3380
3634
  const cx = xAt(hi);
3381
3635
  if (cx != null) {
3382
- const cross = theme.crosshairColor ?? gridColor;
3636
+ const cross = (_h = theme.crosshairColor) != null ? _h : gridColor;
3383
3637
  ctx.strokeStyle = cross;
3384
3638
  ctx.lineWidth = 1;
3385
3639
  ctx.setLineDash([4, 4]);
@@ -3389,7 +3643,7 @@ function CanvasTrendLineChart({
3389
3643
  ctx.stroke();
3390
3644
  ctx.setLineDash([]);
3391
3645
  for (const s of resolved) {
3392
- if (s.overlay || ((_c = s.visibility) == null ? void 0 : _c.excluded)) {
3646
+ if (s.overlay || ((_i = s.visibility) == null ? void 0 : _i.excluded)) {
3393
3647
  continue;
3394
3648
  }
3395
3649
  const v = s.data[hi];
@@ -3548,7 +3802,7 @@ function InsightVerticalBarChart() {
3548
3802
  if (!mounted) {
3549
3803
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChartSkeleton, {});
3550
3804
  }
3551
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative h-[280px] w-full min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options }) });
3805
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative h-[280px] w-full min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options, redraw: false }) });
3552
3806
  }
3553
3807
  function InsightHorizontalBarChart() {
3554
3808
  const mounted = useClientMounted();
@@ -3557,7 +3811,7 @@ function InsightHorizontalBarChart() {
3557
3811
  if (!mounted) {
3558
3812
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChartSkeleton, { className: "h-[320px]" });
3559
3813
  }
3560
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative h-[320px] w-full min-h-[260px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options }) });
3814
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative h-[320px] w-full min-h-[260px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options, redraw: false }) });
3561
3815
  }
3562
3816
  function InsightStackedBarChart() {
3563
3817
  const mounted = useClientMounted();
@@ -3566,7 +3820,7 @@ function InsightStackedBarChart() {
3566
3820
  if (!mounted) {
3567
3821
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChartSkeleton, { className: "h-[300px]" });
3568
3822
  }
3569
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative h-[300px] w-full min-h-[240px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options }) });
3823
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative h-[300px] w-full min-h-[240px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Bar, { data: config.data, options: config.options, redraw: false }) });
3570
3824
  }
3571
3825
  function InsightDoughnutChart() {
3572
3826
  const mounted = useClientMounted();
@@ -3575,7 +3829,7 @@ function InsightDoughnutChart() {
3575
3829
  if (!mounted) {
3576
3830
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChartSkeleton, { className: "h-[260px]" });
3577
3831
  }
3578
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative mx-auto h-[260px] w-full max-w-[280px] min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Doughnut, { data: config.data, options: config.options }) });
3832
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative mx-auto h-[260px] w-full max-w-[280px] min-h-[220px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.Doughnut, { data: config.data, options: config.options, redraw: false }) });
3579
3833
  }
3580
3834
  function InsightPolarAreaChart() {
3581
3835
  const mounted = useClientMounted();
@@ -3584,13 +3838,14 @@ function InsightPolarAreaChart() {
3584
3838
  if (!mounted) {
3585
3839
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChartSkeleton, { className: "h-[280px]" });
3586
3840
  }
3587
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative mx-auto h-[280px] w-full max-w-[320px] min-h-[240px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.PolarArea, { data: config.data, options: config.options }) });
3841
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative mx-auto h-[280px] w-full max-w-[320px] min-h-[240px]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_chartjs_2.PolarArea, { data: config.data, options: config.options, redraw: false }) });
3588
3842
  }
3589
3843
 
3590
3844
  // src/components/dashboard/DashboardWell.tsx
3591
3845
  var import_jsx_runtime45 = require("react/jsx-runtime");
3592
- function DashboardWell({ className, ...props }) {
3593
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cn("ph-dashboard-well", className), ...props });
3846
+ function DashboardWell(_a) {
3847
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
3848
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", __spreadValues({ className: cn("ph-dashboard-well", className) }, props));
3594
3849
  }
3595
3850
 
3596
3851
  // src/components/dashboard/DashboardToolbar.tsx
@@ -3611,78 +3866,92 @@ var presetClass = {
3611
3866
  insights: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
3612
3867
  dense: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
3613
3868
  };
3614
- function DashboardGrid({
3615
- preset = "insights",
3616
- className,
3617
- ...props
3618
- }) {
3619
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn(presetClass[preset], className), ...props });
3869
+ function DashboardGrid(_a) {
3870
+ var _b = _a, {
3871
+ preset = "insights",
3872
+ className
3873
+ } = _b, props = __objRest(_b, [
3874
+ "preset",
3875
+ "className"
3876
+ ]);
3877
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", __spreadValues({ className: cn(presetClass[preset], className) }, props));
3620
3878
  }
3621
3879
 
3622
3880
  // src/components/dashboard/DashboardFiltersBar.tsx
3623
3881
  var import_jsx_runtime48 = require("react/jsx-runtime");
3624
- function DashboardFiltersBar({ className, ...props }) {
3882
+ function DashboardFiltersBar(_a) {
3883
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
3625
3884
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
3626
3885
  "div",
3627
- {
3886
+ __spreadValues({
3628
3887
  className: cn(
3629
3888
  "flex flex-wrap items-center gap-2 rounded-[var(--ph-radius-app)] border border-solid bg-ph-surface px-3 py-2 text-sm text-ph-subtle [border-color:var(--ph-border-control)]",
3630
3889
  "[box-shadow:var(--ph-chrome-inset-face-top),var(--ph-chrome-inset-face-bottom),var(--ph-shadow-elevation-3000)]",
3631
3890
  className
3632
- ),
3633
- ...props
3634
- }
3891
+ )
3892
+ }, props)
3635
3893
  );
3636
3894
  }
3637
3895
 
3638
3896
  // src/components/dashboard/DashboardKpiCard.tsx
3639
3897
  var import_jsx_runtime49 = require("react/jsx-runtime");
3640
- function DashboardKpiCard({ label, value, footer, icon, className, children, ...props }) {
3641
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("article", { className: cn("ph-stat", className), ...props, children: [
3898
+ function DashboardKpiCard(_a) {
3899
+ var _b = _a, { label, value, footer, icon, className, children } = _b, props = __objRest(_b, ["label", "value", "footer", "icon", "className", "children"]);
3900
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-stat", className) }, props), { children: [
3642
3901
  icon != null ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mb-2 [&>svg]:h-7 [&>svg]:w-7", children: icon }) : null,
3643
3902
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ph-stat-label", children: label }),
3644
3903
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ph-stat-val", children: value }),
3645
3904
  footer != null ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: footer }) : null,
3646
3905
  children
3647
- ] });
3906
+ ] }));
3648
3907
  }
3649
3908
 
3650
3909
  // src/components/dashboard/DashboardInsightPlaceholder.tsx
3651
3910
  var import_jsx_runtime50 = require("react/jsx-runtime");
3652
- function DashboardInsightPlaceholder({
3653
- label = "Add insight",
3654
- className,
3655
- children,
3656
- type = "button",
3657
- ...props
3658
- }) {
3911
+ function DashboardInsightPlaceholder(_a) {
3912
+ var _b = _a, {
3913
+ label = "Add insight",
3914
+ className,
3915
+ children,
3916
+ type = "button"
3917
+ } = _b, props = __objRest(_b, [
3918
+ "label",
3919
+ "className",
3920
+ "children",
3921
+ "type"
3922
+ ]);
3659
3923
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3660
3924
  "button",
3661
- {
3925
+ __spreadProps(__spreadValues({
3662
3926
  type,
3663
3927
  "aria-label": label,
3664
3928
  className: cn(
3665
3929
  "ph-dashboard-placeholder group text-left outline-none transition",
3666
3930
  "focus-visible:ring-2 focus-visible:ring-ph-brand focus-visible:ring-offset-2",
3667
3931
  className
3668
- ),
3669
- ...props,
3932
+ )
3933
+ }, props), {
3670
3934
  children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "font-medium text-ph-subtle group-hover:text-ph-ink", children: label })
3671
- }
3935
+ })
3672
3936
  );
3673
3937
  }
3674
3938
 
3675
3939
  // src/components/dashboard/InsightShell.tsx
3676
3940
  var import_jsx_runtime51 = require("react/jsx-runtime");
3677
- function InsightShell({
3678
- ribbonColour,
3679
- bodyClassName,
3680
- className,
3681
- children,
3682
- ...props
3683
- }) {
3941
+ function InsightShell(_a) {
3942
+ var _b = _a, {
3943
+ ribbonColour,
3944
+ bodyClassName,
3945
+ className,
3946
+ children
3947
+ } = _b, props = __objRest(_b, [
3948
+ "ribbonColour",
3949
+ "bodyClassName",
3950
+ "className",
3951
+ "children"
3952
+ ]);
3684
3953
  const ribbon = ribbonColour != null && String(ribbonColour).trim() !== "" ? String(ribbonColour).trim() : null;
3685
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("article", { className: cn("ph-insight-shell flex-row", className), ...props, children: [
3954
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("article", __spreadProps(__spreadValues({ className: cn("ph-insight-shell flex-row", className) }, props), { children: [
3686
3955
  ribbon != null ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3687
3956
  "div",
3688
3957
  {
@@ -3692,7 +3961,7 @@ function InsightShell({
3692
3961
  }
3693
3962
  ) : null,
3694
3963
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn("flex min-w-0 flex-1 flex-col gap-3 p-4", bodyClassName), children })
3695
- ] });
3964
+ ] }));
3696
3965
  }
3697
3966
 
3698
3967
  // src/components/dashboard/InsightShellHeader.tsx
@@ -3722,7 +3991,10 @@ function MiniTrendBars({
3722
3991
  seriesResolver,
3723
3992
  className
3724
3993
  }) {
3725
- const resolveSeries = seriesResolver ?? ((i) => DEFAULT_SERIES_CYCLE[i % DEFAULT_SERIES_CYCLE.length] ?? 1);
3994
+ const resolveSeries = seriesResolver != null ? seriesResolver : ((i) => {
3995
+ var _a;
3996
+ return (_a = DEFAULT_SERIES_CYCLE[i % DEFAULT_SERIES_CYCLE.length]) != null ? _a : 1;
3997
+ });
3726
3998
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: cn("flex items-end gap-0.5", rowClassName, className), children: heights.map((raw, i) => {
3727
3999
  const pct = clampPct(raw);
3728
4000
  const series = resolveSeries(i, pct);
@@ -3737,17 +4009,22 @@ function MiniTrendBars({
3737
4009
 
3738
4010
  // src/components/dashboard/InsightMiniCard.tsx
3739
4011
  var import_jsx_runtime54 = require("react/jsx-runtime");
3740
- function InsightMiniCard({
3741
- title,
3742
- subtitle,
3743
- heights,
3744
- ribbonColour,
3745
- ...shellProps
3746
- }) {
3747
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(InsightShell, { ribbonColour, ...shellProps, children: [
4012
+ function InsightMiniCard(_a) {
4013
+ var _b = _a, {
4014
+ title,
4015
+ subtitle,
4016
+ heights,
4017
+ ribbonColour
4018
+ } = _b, shellProps = __objRest(_b, [
4019
+ "title",
4020
+ "subtitle",
4021
+ "heights",
4022
+ "ribbonColour"
4023
+ ]);
4024
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(InsightShell, __spreadProps(__spreadValues({ ribbonColour }, shellProps), { children: [
3748
4025
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(InsightShellHeader, { title, subtitle }),
3749
4026
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MiniTrendBars, { heights })
3750
- ] });
4027
+ ] }));
3751
4028
  }
3752
4029
  // Annotate the CommonJS export names for ESM import in node:
3753
4030
  0 && (module.exports = {