jenosize-ui 0.2.2 → 0.3.1

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 (229) hide show
  1. package/README.md +183 -63
  2. package/THIRD-PARTY-NOTICES.md +95 -0
  3. package/dist/GradientPicker-Bv3V3vL_.d.ts +144 -0
  4. package/dist/{PaymentInput-Dn5WVQVy.d.ts → PaymentInput-s7_s3UDi.d.ts} +1 -1
  5. package/dist/{Select-Dt5ARIH8.d.ts → Select-r233iMaU.d.ts} +15 -1
  6. package/dist/{TagInput-BaBeve6L.d.ts → TagInput-w_l9Fp5i.d.ts} +1 -1
  7. package/dist/area-chart.d.ts +2 -2
  8. package/dist/area-chart.js +8 -6
  9. package/dist/at-least-one-BZ2dsck-.d.ts +18 -0
  10. package/dist/avatar.d.ts +1 -1
  11. package/dist/avatar.js +12 -10
  12. package/dist/badge.d.ts +1 -1
  13. package/dist/badge.js +7 -6
  14. package/dist/bar-chart.d.ts +2 -2
  15. package/dist/bar-chart.js +8 -6
  16. package/dist/breadcrumb.d.ts +1 -1
  17. package/dist/breadcrumb.js +5 -4
  18. package/dist/button.d.ts +1 -1
  19. package/dist/button.js +12 -10
  20. package/dist/calendar.d.ts +1 -1
  21. package/dist/calendar.js +16 -14
  22. package/dist/callout.d.ts +4 -2
  23. package/dist/callout.js +13 -11
  24. package/dist/card.d.ts +59 -3
  25. package/dist/card.js +4 -3
  26. package/dist/carousel.d.ts +169 -0
  27. package/dist/carousel.js +10 -0
  28. package/dist/catalog.json +11976 -0
  29. package/dist/checkbox.js +9 -7
  30. package/dist/{chunk-AIARANKE.js → chunk-2EUVBRKG.js} +4 -4
  31. package/dist/{chunk-5ZEUTSCV.js → chunk-2RRPWOKT.js} +6 -6
  32. package/dist/{chunk-DD5KJVFV.js → chunk-3JFSKCVU.js} +19 -19
  33. package/dist/{chunk-OACWA4TC.js → chunk-3ZZZPT5G.js} +6 -6
  34. package/dist/{chunk-LQURV7HQ.js → chunk-47EOHGXM.js} +4 -4
  35. package/dist/{chunk-CGHYXWTT.js → chunk-4KRCT3Q2.js} +4 -4
  36. package/dist/chunk-4P3JA653.js +1129 -0
  37. package/dist/{chunk-FWRHBMWT.js → chunk-4Y32RIC7.js} +5 -19
  38. package/dist/{chunk-BBKE4W3B.js → chunk-5Z26DU23.js} +7 -7
  39. package/dist/{chunk-7QXOGAN6.js → chunk-6CJYVYVN.js} +87 -538
  40. package/dist/{chunk-3HOHLQVP.js → chunk-6FGLABYH.js} +3 -3
  41. package/dist/{chunk-GQRSABRN.js → chunk-6Q4VVBFO.js} +4 -4
  42. package/dist/{chunk-MCQG4H6T.js → chunk-6T3QAO5K.js} +12 -4
  43. package/dist/chunk-7JOW3LEH.js +4852 -0
  44. package/dist/{chunk-AFYXSZGW.js → chunk-7LSUUEAF.js} +7 -5
  45. package/dist/{chunk-7VLYQR4D.js → chunk-7OFGPDYJ.js} +3 -3
  46. package/dist/{chunk-7GUPNTAH.js → chunk-7RD5RTHU.js} +7 -7
  47. package/dist/{chunk-X2VMIBK5.js → chunk-A36W77MQ.js} +4 -4
  48. package/dist/chunk-AZFHRLYF.js +67 -0
  49. package/dist/{chunk-CFFWYXDW.js → chunk-B6LYO33Y.js} +5 -5
  50. package/dist/{chunk-P6CON2R2.js → chunk-BH32X25C.js} +3 -3
  51. package/dist/{chunk-KHGW72BM.js → chunk-CH2XMCWX.js} +3 -3
  52. package/dist/{chunk-FNQJJO63.js → chunk-D46OKHTH.js} +4 -4
  53. package/dist/{chunk-LE44X5GS.js → chunk-D4YGYNNY.js} +9 -9
  54. package/dist/{chunk-T5574MXM.js → chunk-D7WD4SUC.js} +8 -8
  55. package/dist/{chunk-33TOK7ES.js → chunk-DCKVNHV5.js} +5 -5
  56. package/dist/chunk-EBZNUQ6E.js +525 -0
  57. package/dist/{chunk-22M75A3N.js → chunk-ED5UCYAV.js} +14 -11
  58. package/dist/{chunk-IQNVSQRK.js → chunk-EDVYLO2N.js} +5 -5
  59. package/dist/{chunk-N3RVMBPX.js → chunk-EJKQGUUM.js} +4 -4
  60. package/dist/{chunk-POQTE7JI.js → chunk-EKQLIUV5.js} +7 -7
  61. package/dist/{chunk-ULGCGKOE.js → chunk-EKV3CVTY.js} +4 -4
  62. package/dist/{chunk-LCG34A5T.js → chunk-EVINS473.js} +5 -3
  63. package/dist/{chunk-ZZSNTCCL.js → chunk-G7B2QUQP.js} +4 -4
  64. package/dist/{chunk-SB3DG572.js → chunk-GHRZC5LS.js} +6 -6
  65. package/dist/{chunk-5YWH2ANQ.js → chunk-GIC6T647.js} +11 -10
  66. package/dist/{chunk-7ZM7SNCZ.js → chunk-GPHGPY6T.js} +3 -3
  67. package/dist/chunk-GV2KTRRP.js +325 -0
  68. package/dist/{chunk-4RBIWI2Q.js → chunk-GYL4KOPT.js} +3 -3
  69. package/dist/{chunk-5KSD4WKN.js → chunk-HB6UA6EF.js} +5 -5
  70. package/dist/{chunk-CGZXQ7PA.js → chunk-HNNNJP3A.js} +3 -3
  71. package/dist/chunk-HTWGTTSF.js +1011 -0
  72. package/dist/chunk-IH2F5UNQ.js +109 -0
  73. package/dist/{chunk-QNIKRB62.js → chunk-INYUL4DX.js} +4 -4
  74. package/dist/{chunk-SKRR3ZMP.js → chunk-IUB5TSSH.js} +3 -3
  75. package/dist/chunk-JGGSRKHW.js +344 -0
  76. package/dist/{chunk-ZR6HNKSN.js → chunk-JHHJNIW2.js} +3 -3
  77. package/dist/chunk-KBI442IB.js +113 -0
  78. package/dist/chunk-KBQJIVUB.js +33 -0
  79. package/dist/{chunk-3QXLIZIX.js → chunk-KNGJ3CSB.js} +3 -3
  80. package/dist/chunk-KNKR5TUM.js +183 -0
  81. package/dist/{chunk-KZP6B6B3.js → chunk-KTWTYK5U.js} +16 -5
  82. package/dist/{chunk-5XPMY2LF.js → chunk-LKUAVDWP.js} +5 -5
  83. package/dist/{chunk-YHBI52P2.js → chunk-LPWSP523.js} +3 -3
  84. package/dist/{chunk-GLKFFA7N.js → chunk-LY7IJOUF.js} +5 -5
  85. package/dist/{chunk-R4Z7BINC.js → chunk-LYWQD5KL.js} +8 -8
  86. package/dist/{chunk-LLPWQDF7.js → chunk-MTOTPAYZ.js} +3 -3
  87. package/dist/{chunk-AZ7DKRBY.js → chunk-MVF7FA4D.js} +5 -5
  88. package/dist/{chunk-AIGYMTCU.js → chunk-MVUNB43J.js} +3 -3
  89. package/dist/{chunk-T4ZFZTY6.js → chunk-N7DLNDER.js} +4 -4
  90. package/dist/{chunk-E2YZ7IMT.js → chunk-NDRQETOQ.js} +15 -11
  91. package/dist/{chunk-ZD3MOLIB.js → chunk-O7CPRU67.js} +4 -4
  92. package/dist/{chunk-OLLD2BZN.js → chunk-OEYKTHG7.js} +3 -3
  93. package/dist/{chunk-TX57TNJS.js → chunk-OG3H3RP2.js} +9 -9
  94. package/dist/{chunk-UGBNYSBN.js → chunk-PFKPKE6O.js} +20 -34
  95. package/dist/chunk-PRWPFBA5.js +619 -0
  96. package/dist/{chunk-QDKETK7D.js → chunk-S55JKMG7.js} +5 -5
  97. package/dist/{chunk-QDYE5LVT.js → chunk-SF3HCW4G.js} +45 -4
  98. package/dist/{chunk-6MMBQVRO.js → chunk-TDKKZA63.js} +9 -9
  99. package/dist/{chunk-HHYEAFCL.js → chunk-TDXHBS2C.js} +11 -11
  100. package/dist/{chunk-74AIU53R.js → chunk-THGGU64E.js} +3 -3
  101. package/dist/chunk-UHSGD4CD.js +364 -0
  102. package/dist/{chunk-HV2W6HUR.js → chunk-URAURI6G.js} +10 -10
  103. package/dist/{chunk-D6XO4JVM.js → chunk-UU6KUS5O.js} +42 -20
  104. package/dist/{chunk-NKG4N6HA.js → chunk-V7KEEDSF.js} +5 -4
  105. package/dist/{chunk-IEAWNA3V.js → chunk-VDFWWWLL.js} +3 -3
  106. package/dist/chunk-VHAA22YE.js +11 -0
  107. package/dist/chunk-WJB5GWAZ.js +20 -0
  108. package/dist/{chunk-KJ5JUS53.js → chunk-WM6DGNIA.js} +9 -9
  109. package/dist/{chunk-MFFA5MXY.js → chunk-WUXMLJEC.js} +5 -5
  110. package/dist/{chunk-YPNL2NBD.js → chunk-XNXBO44X.js} +33 -11
  111. package/dist/chunk-XPY3XT7L.js +5671 -0
  112. package/dist/{chunk-54SIZR63.js → chunk-XVFRDKZJ.js} +7 -7
  113. package/dist/{chunk-LYXPJERB.js → chunk-YDD46AX2.js} +5 -5
  114. package/dist/{chunk-NC63TYNW.js → chunk-YHQJGNXD.js} +7 -7
  115. package/dist/{chunk-I6WMNXC7.js → chunk-YKRE5NIH.js} +6 -6
  116. package/dist/{chunk-RJTVCA62.js → chunk-ZIEGUI25.js} +3 -3
  117. package/dist/{chunk-5DP7W5HX.js → chunk-ZLDWYTDA.js} +3 -3
  118. package/dist/color-input.d.ts +93 -0
  119. package/dist/color-input.js +36 -0
  120. package/dist/color-picker.d.ts +268 -0
  121. package/dist/color-picker.js +29 -0
  122. package/dist/color-value-DYzChVOW.d.ts +129 -0
  123. package/dist/combobox.d.ts +1 -1
  124. package/dist/combobox.js +14 -12
  125. package/dist/data-map.d.ts +1673 -0
  126. package/dist/data-map.js +36 -0
  127. package/dist/date-calendar.d.ts +49 -0
  128. package/dist/date-calendar.js +13 -0
  129. package/dist/date-input.d.ts +1 -1
  130. package/dist/date-input.js +12 -10
  131. package/dist/date-picker.d.ts +15 -131
  132. package/dist/date-picker.js +26 -21
  133. package/dist/date-types-CLZek3W2.d.ts +100 -0
  134. package/dist/dialog.d.ts +1 -1
  135. package/dist/dialog.js +10 -9
  136. package/dist/drawer.d.ts +1 -1
  137. package/dist/drawer.js +9 -8
  138. package/dist/dropdown-menu.d.ts +1 -1
  139. package/dist/dropdown-menu.js +5 -4
  140. package/dist/dropzone.d.ts +3 -3
  141. package/dist/dropzone.js +18 -16
  142. package/dist/file-trigger.js +1 -0
  143. package/dist/form.d.ts +15 -5
  144. package/dist/form.js +75 -35
  145. package/dist/header-navigation.d.ts +2 -2
  146. package/dist/header-navigation.js +20 -18
  147. package/dist/helper.d.ts +1 -1
  148. package/dist/helper.js +1 -0
  149. package/dist/illustration.js +1 -0
  150. package/dist/index.d.ts +26 -11
  151. package/dist/index.js +92 -77
  152. package/dist/indicator.js +5 -4
  153. package/dist/inline-banner.d.ts +68 -0
  154. package/dist/inline-banner.js +21 -0
  155. package/dist/input.d.ts +1 -1
  156. package/dist/input.js +11 -9
  157. package/dist/kanban-board.d.ts +2 -2
  158. package/dist/kanban-board.js +15 -13
  159. package/dist/labels-CuSlirP_.d.ts +1381 -0
  160. package/dist/line-chart.d.ts +2 -2
  161. package/dist/line-chart.js +8 -6
  162. package/dist/mcp.js +231 -0
  163. package/dist/number-input.d.ts +1 -1
  164. package/dist/number-input.js +11 -9
  165. package/dist/pagination.d.ts +1 -1
  166. package/dist/pagination.js +15 -13
  167. package/dist/{card-D56VxyAe.d.ts → panel-CUGm_Mxy.d.ts} +9 -57
  168. package/dist/payment-input.d.ts +3 -3
  169. package/dist/payment-input.js +11 -9
  170. package/dist/picker-draft-BPV3MUPY.d.ts +9 -0
  171. package/dist/pie-chart.d.ts +2 -2
  172. package/dist/pie-chart.js +8 -6
  173. package/dist/popover.d.ts +65 -4
  174. package/dist/popover.js +9 -8
  175. package/dist/progress-steps.js +5 -4
  176. package/dist/progress.js +4 -3
  177. package/dist/provider.d.ts +1 -1
  178. package/dist/provider.js +4 -3
  179. package/dist/qr-code.d.ts +227 -0
  180. package/dist/qr-code.js +20 -0
  181. package/dist/radar-chart.d.ts +2 -2
  182. package/dist/radar-chart.js +8 -6
  183. package/dist/radial-chart.d.ts +2 -2
  184. package/dist/radial-chart.js +8 -6
  185. package/dist/radio.js +9 -7
  186. package/dist/rich-text-editor.d.ts +624 -0
  187. package/dist/rich-text-editor.js +52 -0
  188. package/dist/rich-text-highlight.d.ts +11 -0
  189. package/dist/rich-text-highlight.js +65 -0
  190. package/dist/rich-text-sanitize.d.ts +17 -0
  191. package/dist/rich-text-sanitize.js +176 -0
  192. package/dist/scroll-area.js +1 -0
  193. package/dist/select.d.ts +2 -2
  194. package/dist/select.js +17 -15
  195. package/dist/separator.js +3 -2
  196. package/dist/shared-CGf2D8ZX.d.ts +20 -0
  197. package/dist/sidebar-navigation.d.ts +73 -32
  198. package/dist/sidebar-navigation.js +15 -13
  199. package/dist/sidebar-state.d.ts +76 -0
  200. package/dist/sidebar-state.js +27 -0
  201. package/dist/skeleton.js +3 -2
  202. package/dist/slider.d.ts +321 -0
  203. package/dist/slider.js +14 -0
  204. package/dist/styles.css +1 -1
  205. package/dist/switch.d.ts +1 -1
  206. package/dist/switch.js +3 -2
  207. package/dist/table.d.ts +3 -19
  208. package/dist/table.js +34 -32
  209. package/dist/tabs.js +3 -2
  210. package/dist/tag-input.d.ts +3 -3
  211. package/dist/tag-input.js +14 -12
  212. package/dist/tag.d.ts +1 -1
  213. package/dist/tag.js +5 -4
  214. package/dist/textarea.js +9 -7
  215. package/dist/theme.css +965 -0
  216. package/dist/theme.js +13 -11
  217. package/dist/toast.d.ts +1 -1
  218. package/dist/toast.js +13 -11
  219. package/dist/tooltip.js +5 -3
  220. package/dist/tree.d.ts +1 -1
  221. package/dist/tree.js +7 -6
  222. package/dist/{types-DR9rAEy1.d.ts → types-BoZ6XeLB.d.ts} +1 -1
  223. package/dist/{use-uploads-KaPqDklo.d.ts → use-uploads-cHo2p7Gn.d.ts} +1 -1
  224. package/dist/verification-code-input.js +11 -9
  225. package/package.json +105 -8
  226. package/dist/chunk-BLIZ3CL3.js +0 -49
  227. package/dist/labels-DPrh0se9.d.ts +0 -627
  228. package/dist/panel-El4oI68p.d.ts +0 -9
  229. package/dist/shared-BYXJPnsN.d.ts +0 -11
@@ -0,0 +1,183 @@
1
+ import { usePickerDraft } from './chunk-KBQJIVUB.js';
2
+ import { useControllable } from './chunk-WJB5GWAZ.js';
3
+ import { COLOR_PICKER_LABELS, swatchPaint, SWATCH_INNER, ColorPicker } from './chunk-4P3JA653.js';
4
+ import { toCss, toHex, parseColor } from './chunk-UHSGD4CD.js';
5
+ import { Popover } from './chunk-XNXBO44X.js';
6
+ import { Button } from './chunk-3ZZZPT5G.js';
7
+ import { FieldShell } from './chunk-A36W77MQ.js';
8
+ import { useFieldValidity, FieldFrame } from './chunk-HB6UA6EF.js';
9
+ import { cn } from './chunk-ZSNJ6UA3.js';
10
+ import { useLabels, usePublishedLabels, LabelsContext } from './chunk-ZIEGUI25.js';
11
+ import { Field } from '@base-ui/react/field';
12
+ import * as React from 'react';
13
+ import { jsxs, jsx } from 'react/jsx-runtime';
14
+
15
+ var TRIGGER_CLASS = cn(
16
+ "flex min-w-0 flex-1 cursor-pointer items-center gap-2 self-stretch bg-transparent text-left outline-none",
17
+ "disabled:cursor-not-allowed"
18
+ );
19
+ var DEFAULT_VALUE = { kind: "solid", color: "#000000" };
20
+ function ColorApplyRow({ onCancel, onApply, labels }) {
21
+ const t = useLabels("colorPicker", COLOR_PICKER_LABELS, labels);
22
+ return (
23
+ // The footer node owns its own gutter, on the same 16px as the panel's rows — `padding="none"`
24
+ // hands ALL spacing to the caller, and that is what gives the seam above it no overhang.
25
+ /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-end gap-3 px-4 py-3", children: [
26
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "secondary", color: "neutral", size: "sm", onClick: onCancel, children: t.cancel }),
27
+ /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", onClick: onApply, children: t.apply })
28
+ ] })
29
+ );
30
+ }
31
+ function ColorInput(props) {
32
+ const {
33
+ value,
34
+ defaultValue = DEFAULT_VALUE,
35
+ onValueChange,
36
+ commit = "instant",
37
+ placeholder: placeholderProp,
38
+ side = "bottom",
39
+ align = "start",
40
+ formats,
41
+ alpha,
42
+ modes,
43
+ eyedropper,
44
+ swatches,
45
+ onAddSwatch,
46
+ gradientSwatches,
47
+ onAddGradientSwatch,
48
+ label,
49
+ tooltip,
50
+ tooltipDescription,
51
+ hint,
52
+ required = false,
53
+ hideRequiredIndicator = false,
54
+ invalid = false,
55
+ error,
56
+ disabled = false,
57
+ fullWidth = true,
58
+ leading,
59
+ trailing,
60
+ leadingAddon,
61
+ trailingAddon,
62
+ size = "md",
63
+ name,
64
+ id,
65
+ labels,
66
+ className
67
+ } = props;
68
+ const t = useLabels("colorPicker", COLOR_PICKER_LABELS, labels);
69
+ const publishedLabels = usePublishedLabels("colorPicker", labels);
70
+ const placeholder = placeholderProp ?? t.placeholder;
71
+ const [committed, setCommitted] = useControllable(value, defaultValue, onValueChange);
72
+ const { isInvalid, showError } = useFieldValidity(invalid, error);
73
+ const reactId = React.useId();
74
+ const base = id ?? reactId;
75
+ const labelId = label == null ? void 0 : `${base}-label`;
76
+ const valueId = `${base}-value`;
77
+ const requiredId = `${base}-required`;
78
+ const hintId = `${base}-hint`;
79
+ const errorId = `${base}-error`;
80
+ const describedBy = showError ? errorId : hint != null && hint !== "" ? hintId : void 0;
81
+ const picker = usePickerDraft(committed, commit, setCommitted);
82
+ const css = toCss(committed);
83
+ const printed = committed.kind === "solid" ? toHex(parseColor(committed.color, { quiet: true }) ?? { r: 0, g: 0, b: 0, a: 1 }) : css;
84
+ const empty = committed.kind === "solid" && committed.color === "";
85
+ const trigger = /* @__PURE__ */ jsxs(
86
+ "button",
87
+ {
88
+ type: "button",
89
+ disabled,
90
+ "aria-labelledby": labelId == null ? void 0 : [labelId, valueId, required && !hideRequiredIndicator ? requiredId : null].filter(Boolean).join(" "),
91
+ "aria-describedby": describedBy,
92
+ "aria-invalid": isInvalid || void 0,
93
+ className: TRIGGER_CLASS,
94
+ children: [
95
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn(SWATCH_INNER, "size-4 shrink-0"), style: { background: swatchPaint(css) } }),
96
+ /* @__PURE__ */ jsx("span", { id: valueId, className: cn("truncate", empty ? "text-quaternary" : "font-medium"), children: empty ? placeholder : printed }),
97
+ required && !hideRequiredIndicator ? /* @__PURE__ */ jsx("span", { id: requiredId, className: "sr-only", children: t.required }) : null
98
+ ]
99
+ }
100
+ );
101
+ return /* @__PURE__ */ jsx(LabelsContext.Provider, { value: publishedLabels, children: /* @__PURE__ */ jsx(
102
+ FieldFrame,
103
+ {
104
+ label,
105
+ labelId,
106
+ messageId: { hint: hintId, error: errorId },
107
+ tooltip,
108
+ tooltipDescription,
109
+ hint,
110
+ error,
111
+ isInvalid,
112
+ showError,
113
+ required,
114
+ hideRequiredIndicator,
115
+ size,
116
+ disabled,
117
+ fullWidth,
118
+ className,
119
+ children: /* @__PURE__ */ jsxs(
120
+ FieldShell,
121
+ {
122
+ size,
123
+ invalid: isInvalid,
124
+ disabled,
125
+ leading,
126
+ trailing,
127
+ leadingAddon,
128
+ trailingAddon,
129
+ className: cn(
130
+ // The open state lives on the TRIGGER (Base UI puts `data-popup-open` there), so the shell
131
+ // reads it with `has-*` rather than owning a variant it can never match.
132
+ "has-[[data-popup-open]]:outline-2 has-[[data-popup-open]]:-outline-offset-2",
133
+ isInvalid ? "has-[[data-popup-open]]:outline-focus-ring-error" : "has-[[data-popup-open]]:outline-focus-ring"
134
+ ),
135
+ onMouseDown: (event) => {
136
+ if (event.target !== event.currentTarget) return;
137
+ event.preventDefault();
138
+ event.currentTarget.querySelector("button")?.click();
139
+ },
140
+ children: [
141
+ /* @__PURE__ */ jsx(
142
+ Popover,
143
+ {
144
+ open: picker.open,
145
+ onOpenChange: picker.onOpenChange,
146
+ trigger,
147
+ side,
148
+ align,
149
+ padding: "none",
150
+ size: "panel",
151
+ dividers: commit === "confirm" ? "line" : "none",
152
+ "aria-label": label ?? t.openPicker,
153
+ footer: commit === "confirm" ? () => /* @__PURE__ */ jsx(ColorApplyRow, { onCancel: picker.close, onApply: picker.apply, labels }) : void 0,
154
+ children: /* @__PURE__ */ jsx(
155
+ ColorPicker,
156
+ {
157
+ value: picker.draft,
158
+ onValueChange: picker.setDraft,
159
+ formats,
160
+ alpha,
161
+ modes,
162
+ eyedropper,
163
+ swatches,
164
+ onAddSwatch,
165
+ gradientSwatches,
166
+ onAddGradientSwatch,
167
+ labels
168
+ }
169
+ )
170
+ }
171
+ ),
172
+ /* @__PURE__ */ jsx(Field.Control, { type: "hidden", name, required, value: empty ? "" : css, readOnly: true })
173
+ ]
174
+ }
175
+ )
176
+ }
177
+ ) });
178
+ }
179
+ ColorInput.displayName = "ColorInput";
180
+
181
+ export { ColorInput };
182
+ //# sourceMappingURL=chunk-KNKR5TUM.js.map
183
+ //# sourceMappingURL=chunk-KNKR5TUM.js.map
@@ -1,7 +1,7 @@
1
- import { TOOLTIP_TONE } from './chunk-AFYXSZGW.js';
1
+ import { TOOLTIP_TONE } from './chunk-7LSUUEAF.js';
2
2
  import { TOOLTIP_MOTION } from './chunk-O4GRKO3I.js';
3
3
  import { cn } from './chunk-ZSNJ6UA3.js';
4
- import { devWarn } from './chunk-QDYE5LVT.js';
4
+ import { devWarn } from './chunk-SF3HCW4G.js';
5
5
  import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
6
6
  import * as React from 'react';
7
7
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -118,6 +118,13 @@ function Tooltip(props) {
118
118
  onOpenChange,
119
119
  disabled = false,
120
120
  className,
121
+ // Named so it can be MERGED rather than overwritten. It used to ride `...rest` onto the
122
+ // trigger and then be written again, unconditionally, on the same line — and `describedById`
123
+ // is a `useId()`, so a wrapper's own `aria-describedby` was ALWAYS deleted. AGENTS §4: a value
124
+ // written after a spread merges or falls back, never overwrites. `aria-describedby` is an
125
+ // id-REFERENCE LIST, so the correct merge is a join: the trigger keeps whatever it was already
126
+ // described by AND gains this tooltip.
127
+ "aria-describedby": callerDescribedBy,
121
128
  // Everything else belongs to whoever wrapped this trigger. Without this rest, `<Tooltip>`
122
129
  // silently ATE every prop it did not name — so `<DropdownMenu trigger={<Tooltip …><button/>
123
130
  // </Tooltip>} />` lost `aria-haspopup`, `id`, `type`, `tabindex`, the ref and every handler,
@@ -127,8 +134,12 @@ function Tooltip(props) {
127
134
  } = props;
128
135
  const describedById = React.useId();
129
136
  if (!React.isValidElement(children)) devWarn("<Tooltip> `children` must be a single focusable React element (the trigger).");
137
+ const childDescribedBy = React.isValidElement(children) ? children.props["aria-describedby"] : void 0;
138
+ const asId = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
139
+ const describedBy = [asId(callerDescribedBy), asId(childDescribedBy), describedById].filter(Boolean).join(" ");
140
+ const trigger = childDescribedBy && React.isValidElement(children) ? React.cloneElement(children, { "aria-describedby": describedBy }) : children;
130
141
  return /* @__PURE__ */ jsxs(TooltipRoot, { defaultOpen, open, onOpenChange, disabled, children: [
131
- /* @__PURE__ */ jsx(TooltipTrigger, { ...rest, delay, closeDelay, "aria-describedby": describedById, render: children }),
142
+ /* @__PURE__ */ jsx(TooltipTrigger, { ...rest, delay, closeDelay, "aria-describedby": describedBy, render: trigger }),
132
143
  /* @__PURE__ */ jsx(
133
144
  TooltipContent,
134
145
  {
@@ -151,5 +162,5 @@ Tooltip.displayName = "Tooltip";
151
162
  var TooltipExport = Object.assign(Tooltip, { Provider: TooltipProvider });
152
163
 
153
164
  export { TooltipExport };
154
- //# sourceMappingURL=chunk-KZP6B6B3.js.map
155
- //# sourceMappingURL=chunk-KZP6B6B3.js.map
165
+ //# sourceMappingURL=chunk-KTWTYK5U.js.map
166
+ //# sourceMappingURL=chunk-KTWTYK5U.js.map
@@ -1,8 +1,8 @@
1
1
  import { OptionRow } from './chunk-D7EE5GWU.js';
2
- import { useFieldValidity, FieldGroupFrame } from './chunk-5KSD4WKN.js';
3
- import { MinusIcon, CheckIcon } from './chunk-BLIZ3CL3.js';
2
+ import { useFieldValidity, FieldGroupFrame } from './chunk-HB6UA6EF.js';
3
+ import { MinusIcon, CheckIcon } from './chunk-KBI442IB.js';
4
4
  import { cn } from './chunk-ZSNJ6UA3.js';
5
- import { devWarn, warnNeedsName } from './chunk-QDYE5LVT.js';
5
+ import { devWarn, warnNeedsName } from './chunk-SF3HCW4G.js';
6
6
  import { CheckboxGroup as CheckboxGroup$1 } from '@base-ui/react/checkbox-group';
7
7
  import * as React3 from 'react';
8
8
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
@@ -188,5 +188,5 @@ function CheckboxGroup(props) {
188
188
  CheckboxGroup.displayName = "CheckboxGroup";
189
189
 
190
190
  export { Checkbox, CheckboxGroup };
191
- //# sourceMappingURL=chunk-5XPMY2LF.js.map
192
- //# sourceMappingURL=chunk-5XPMY2LF.js.map
191
+ //# sourceMappingURL=chunk-LKUAVDWP.js.map
192
+ //# sourceMappingURL=chunk-LKUAVDWP.js.map
@@ -1,4 +1,4 @@
1
- import { Cartesian } from './chunk-5DP7W5HX.js';
1
+ import { Cartesian } from './chunk-ZLDWYTDA.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
4
  function LineChart({ curve = "monotone", dashed = false, dots = false, ...rest }) {
@@ -6,5 +6,5 @@ function LineChart({ curve = "monotone", dashed = false, dots = false, ...rest }
6
6
  }
7
7
 
8
8
  export { LineChart };
9
- //# sourceMappingURL=chunk-YHBI52P2.js.map
10
- //# sourceMappingURL=chunk-YHBI52P2.js.map
9
+ //# sourceMappingURL=chunk-LPWSP523.js.map
10
+ //# sourceMappingURL=chunk-LPWSP523.js.map
@@ -1,6 +1,6 @@
1
- import { resolveMax } from './chunk-OLLD2BZN.js';
2
- import { useCartesianColors, DEFAULT_PALETTE, POLAR_RADIUS_RINGS_DEFAULT, ChartDataTable, formatNumber, ChartFrame, RadarChart, POLAR_ROOT, MARGIN, PolarGrid, GRID, PolarAngleAxis, PolarRadiusAxis, Tooltip, TOOLTIP_CURSOR, NO_ANIMATION, ChartTooltipContent, Radar, ACTIVE_DOT, ChartLegendContent, POLAR_ANGLE_TICK_LIFT, Text, POLAR_ANGLE_TICK, POLAR_RADIUS_PILL_HEIGHT, POLAR_RADIUS_PILL_PAD_X, POLAR_RADIUS_PILL, POLAR_RADIUS_PILL_BASELINE } from './chunk-22M75A3N.js';
3
- import { devWarn } from './chunk-QDYE5LVT.js';
1
+ import { resolveMax } from './chunk-OEYKTHG7.js';
2
+ import { useCartesianColors, DEFAULT_PALETTE, POLAR_RADIUS_RINGS_DEFAULT, ChartDataTable, formatNumber, ChartFrame, RadarChart, POLAR_ROOT, MARGIN, PolarGrid, GRID, PolarAngleAxis, PolarRadiusAxis, Tooltip, TOOLTIP_CURSOR, NO_ANIMATION, ChartTooltipContent, Radar, ACTIVE_DOT, ChartLegendContent, POLAR_ANGLE_TICK_LIFT, Text, POLAR_ANGLE_TICK, POLAR_RADIUS_PILL_HEIGHT, POLAR_RADIUS_PILL_PAD_X, POLAR_RADIUS_PILL, POLAR_RADIUS_PILL_BASELINE } from './chunk-ED5UCYAV.js';
3
+ import { devWarn } from './chunk-SF3HCW4G.js';
4
4
  import * as React from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
 
@@ -167,5 +167,5 @@ function RadarChart2({
167
167
  }
168
168
 
169
169
  export { RadarChart2 as RadarChart };
170
- //# sourceMappingURL=chunk-GLKFFA7N.js.map
171
- //# sourceMappingURL=chunk-GLKFFA7N.js.map
170
+ //# sourceMappingURL=chunk-LY7IJOUF.js.map
171
+ //# sourceMappingURL=chunk-LY7IJOUF.js.map
@@ -1,10 +1,10 @@
1
- import { TAG_INPUT_LABELS, useTagInput, TAG_PILL_FOCUS_RING } from './chunk-NC63TYNW.js';
2
- import { Tag } from './chunk-LYXPJERB.js';
3
- import { useTagRow } from './chunk-IEAWNA3V.js';
4
- import { FieldShell } from './chunk-X2VMIBK5.js';
5
- import { useFieldValidity, FieldFrame } from './chunk-5KSD4WKN.js';
1
+ import { TAG_INPUT_LABELS, useTagInput, TAG_PILL_FOCUS_RING } from './chunk-YHQJGNXD.js';
2
+ import { Tag } from './chunk-YDD46AX2.js';
3
+ import { useTagRow } from './chunk-VDFWWWLL.js';
4
+ import { FieldShell } from './chunk-A36W77MQ.js';
5
+ import { useFieldValidity, FieldFrame } from './chunk-HB6UA6EF.js';
6
6
  import { cn } from './chunk-ZSNJ6UA3.js';
7
- import { useLabels } from './chunk-RJTVCA62.js';
7
+ import { useLabels } from './chunk-ZIEGUI25.js';
8
8
  import { Field } from '@base-ui/react/field';
9
9
  import 'react';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -114,5 +114,5 @@ function TagInputOuter(props) {
114
114
  }
115
115
 
116
116
  export { TagInputOuter };
117
- //# sourceMappingURL=chunk-R4Z7BINC.js.map
118
- //# sourceMappingURL=chunk-R4Z7BINC.js.map
117
+ //# sourceMappingURL=chunk-LYWQD5KL.js.map
118
+ //# sourceMappingURL=chunk-LYWQD5KL.js.map
@@ -1,5 +1,5 @@
1
1
  import { cn } from './chunk-ZSNJ6UA3.js';
2
- import { warnPositiveInt } from './chunk-QDYE5LVT.js';
2
+ import { warnPositiveInt } from './chunk-SF3HCW4G.js';
3
3
  import 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -22,5 +22,5 @@ function SkeletonText({ lines = 3, size = "md", className }) {
22
22
  SkeletonText.displayName = "SkeletonText";
23
23
 
24
24
  export { SKELETON_WIDTHS, Skeleton, SkeletonText, skeletonWidth };
25
- //# sourceMappingURL=chunk-LLPWQDF7.js.map
26
- //# sourceMappingURL=chunk-LLPWQDF7.js.map
25
+ //# sourceMappingURL=chunk-MTOTPAYZ.js.map
26
+ //# sourceMappingURL=chunk-MTOTPAYZ.js.map
@@ -1,7 +1,7 @@
1
- import { GLYPH } from './chunk-MCQG4H6T.js';
2
- import { TooltipExport } from './chunk-KZP6B6B3.js';
1
+ import { GLYPH } from './chunk-6T3QAO5K.js';
2
+ import { TooltipExport } from './chunk-KTWTYK5U.js';
3
3
  import { cn } from './chunk-ZSNJ6UA3.js';
4
- import { warnNeedsName } from './chunk-QDYE5LVT.js';
4
+ import { warnNeedsName } from './chunk-SF3HCW4G.js';
5
5
  import { mergeProps } from '@base-ui/react/merge-props';
6
6
  import { useRender } from '@base-ui/react/use-render';
7
7
  import 'react';
@@ -59,5 +59,5 @@ function ButtonUtility(props) {
59
59
  }
60
60
 
61
61
  export { ButtonUtility };
62
- //# sourceMappingURL=chunk-AZ7DKRBY.js.map
63
- //# sourceMappingURL=chunk-AZ7DKRBY.js.map
62
+ //# sourceMappingURL=chunk-MVF7FA4D.js.map
63
+ //# sourceMappingURL=chunk-MVF7FA4D.js.map
@@ -2,7 +2,7 @@ import { useScrollFade } from './chunk-O2LG3PNI.js';
2
2
  import { useIsomorphicLayoutEffect } from './chunk-EDSK6FEH.js';
3
3
  import { Slot } from './chunk-52IFGFTL.js';
4
4
  import { cn } from './chunk-ZSNJ6UA3.js';
5
- import { warnStickyNoScrollport, nearestScrollport, warnNeedsName } from './chunk-QDYE5LVT.js';
5
+ import { warnStickyNoScrollport, nearestScrollport, warnNeedsName } from './chunk-SF3HCW4G.js';
6
6
  import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
7
7
  import * as React from 'react';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -202,5 +202,5 @@ function Tabs(props) {
202
202
  Tabs.displayName = "Tabs";
203
203
 
204
204
  export { Tabs };
205
- //# sourceMappingURL=chunk-AIGYMTCU.js.map
206
- //# sourceMappingURL=chunk-AIGYMTCU.js.map
205
+ //# sourceMappingURL=chunk-MVUNB43J.js.map
206
+ //# sourceMappingURL=chunk-MVUNB43J.js.map
@@ -1,5 +1,5 @@
1
- import { usePolarData } from './chunk-OLLD2BZN.js';
2
- import { DEFAULT_PALETTE, PIE_SIZE, PIE_DONUT, ChartDataTable, formatNumber, ChartFrame, PieChart, MARGIN, Tooltip, NO_ANIMATION, ChartTooltipContent, Pie, POLAR_ROOT, POLAR_HOVER, ChartLegendContent } from './chunk-22M75A3N.js';
1
+ import { usePolarData } from './chunk-OEYKTHG7.js';
2
+ import { DEFAULT_PALETTE, PIE_SIZE, PIE_DONUT, ChartDataTable, formatNumber, ChartFrame, PieChart, MARGIN, Tooltip, NO_ANIMATION, ChartTooltipContent, Pie, POLAR_ROOT, POLAR_HOVER, ChartLegendContent } from './chunk-ED5UCYAV.js';
3
3
  import { cn } from './chunk-ZSNJ6UA3.js';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
 
@@ -58,5 +58,5 @@ function PieChart2({
58
58
  }
59
59
 
60
60
  export { PieChart2 as PieChart };
61
- //# sourceMappingURL=chunk-T4ZFZTY6.js.map
62
- //# sourceMappingURL=chunk-T4ZFZTY6.js.map
61
+ //# sourceMappingURL=chunk-N7DLNDER.js.map
62
+ //# sourceMappingURL=chunk-N7DLNDER.js.map
@@ -1,10 +1,10 @@
1
- import { DEFAULT_FORMAT, parseFormat, fromISO, toISO, dispBounds, segValueText, getDisp, parsePastedDate, applyPastedDate, clamp, pad, displaySeg, setDisp, wrap } from './chunk-3QXLIZIX.js';
1
+ import { DEFAULT_FORMAT, parseFormat, fromISO, toISO, dispBounds, segValueText, getDisp, parsePastedDate, applyPastedDate, clamp, pad, displaySeg, setDisp, wrap } from './chunk-KNGJ3CSB.js';
2
2
  import { useLocaleConfig } from './chunk-YIHKQ63K.js';
3
3
  import { useControlScrollFade } from './chunk-7EUAMHMU.js';
4
- import { FieldShell } from './chunk-X2VMIBK5.js';
5
- import { useFieldValidity, FieldFrame } from './chunk-5KSD4WKN.js';
4
+ import { FieldShell } from './chunk-A36W77MQ.js';
5
+ import { useFieldValidity, FieldFrame } from './chunk-HB6UA6EF.js';
6
6
  import { cn } from './chunk-ZSNJ6UA3.js';
7
- import { useLabels } from './chunk-RJTVCA62.js';
7
+ import { useLabels } from './chunk-ZIEGUI25.js';
8
8
  import { Field } from '@base-ui/react/field';
9
9
  import * as React from 'react';
10
10
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -66,8 +66,13 @@ function DateInput(props) {
66
66
  const specs = parsed.segs;
67
67
  const isControlled = value !== void 0;
68
68
  const [parts, setParts] = React.useState(() => fromISO(value ?? defaultValue));
69
+ const buf = React.useRef({ seg: null, str: "" });
70
+ function isoOf(p) {
71
+ const yearPending = buf.current.seg === "year" && buf.current.str.length > 0 && buf.current.str.length < 4;
72
+ return yearPending ? null : toISO(p, cfg);
73
+ }
69
74
  React.useEffect(() => {
70
- if (isControlled && value !== toISO(parts, cfg)) setParts(fromISO(value));
75
+ if (isControlled && value !== isoOf(parts)) setParts(fromISO(value));
71
76
  }, [value]);
72
77
  const lastFormat = React.useRef(format);
73
78
  React.useEffect(() => {
@@ -90,10 +95,9 @@ function DateInput(props) {
90
95
  second: React.useRef(null),
91
96
  dayPeriod: React.useRef(null)
92
97
  };
93
- const buf = React.useRef({ seg: null, str: "" });
94
98
  function update(next) {
95
99
  setParts(next);
96
- onValueChange?.(toISO(next, cfg));
100
+ onValueChange?.(isoOf(next));
97
101
  }
98
102
  function focusSeg(index) {
99
103
  const seg = specs[clamp(index, 0, specs.length - 1)].seg;
@@ -222,7 +226,7 @@ function DateInput(props) {
222
226
  setSeg(seg, clamp(Number(trimmed), lo, hi));
223
227
  }
224
228
  function onCopy(e) {
225
- const iso = toISO(parts, cfg);
229
+ const iso = isoOf(parts);
226
230
  if (iso == null) return;
227
231
  e.preventDefault();
228
232
  e.clipboardData.setData("text/plain", iso);
@@ -300,7 +304,7 @@ function DateInput(props) {
300
304
  })
301
305
  }
302
306
  ),
303
- /* @__PURE__ */ jsx(Field.Control, { type: "hidden", name, required, value: toISO(parts, cfg) ?? "", readOnly: true })
307
+ /* @__PURE__ */ jsx(Field.Control, { type: "hidden", name, required, value: isoOf(parts) ?? "", readOnly: true })
304
308
  ]
305
309
  }
306
310
  )
@@ -309,5 +313,5 @@ function DateInput(props) {
309
313
  }
310
314
 
311
315
  export { DateInput };
312
- //# sourceMappingURL=chunk-E2YZ7IMT.js.map
313
- //# sourceMappingURL=chunk-E2YZ7IMT.js.map
316
+ //# sourceMappingURL=chunk-NDRQETOQ.js.map
317
+ //# sourceMappingURL=chunk-NDRQETOQ.js.map
@@ -1,9 +1,9 @@
1
+ import { ruleEdge, RULE_WEIGHT, rulePaint } from './chunk-EVINS473.js';
1
2
  import { PopupScrollViewport } from './chunk-GWYDOZGQ.js';
2
- import { ruleEdge, RULE_WEIGHT, rulePaint } from './chunk-LCG34A5T.js';
3
3
  import { useLinkElement } from './chunk-5AZKP4KZ.js';
4
4
  import { Slot } from './chunk-52IFGFTL.js';
5
5
  import { POPUP_MOTION, POPUP_MOTION_HOST } from './chunk-O4GRKO3I.js';
6
- import { ChevronRightIcon, CheckIcon } from './chunk-BLIZ3CL3.js';
6
+ import { ChevronRightIcon, CheckIcon } from './chunk-KBI442IB.js';
7
7
  import { cn } from './chunk-ZSNJ6UA3.js';
8
8
  import { Menu } from '@base-ui/react/menu';
9
9
  import 'react';
@@ -247,5 +247,5 @@ function DropdownMenu(props) {
247
247
  DropdownMenu.displayName = "DropdownMenu";
248
248
 
249
249
  export { DropdownMenu };
250
- //# sourceMappingURL=chunk-ZD3MOLIB.js.map
251
- //# sourceMappingURL=chunk-ZD3MOLIB.js.map
250
+ //# sourceMappingURL=chunk-O7CPRU67.js.map
251
+ //# sourceMappingURL=chunk-O7CPRU67.js.map
@@ -1,4 +1,4 @@
1
- import { seriesColor, useSeriesColors, paletteLength } from './chunk-22M75A3N.js';
1
+ import { seriesColor, useSeriesColors, paletteLength } from './chunk-ED5UCYAV.js';
2
2
  import * as React from 'react';
3
3
 
4
4
  function usePolarData(component, data, palette) {
@@ -29,5 +29,5 @@ function resolveMax(max, values) {
29
29
  }
30
30
 
31
31
  export { resolveMax, usePolarData };
32
- //# sourceMappingURL=chunk-OLLD2BZN.js.map
33
- //# sourceMappingURL=chunk-OLLD2BZN.js.map
32
+ //# sourceMappingURL=chunk-OEYKTHG7.js.map
33
+ //# sourceMappingURL=chunk-OEYKTHG7.js.map
@@ -1,12 +1,12 @@
1
- import { Indicator } from './chunk-N3RVMBPX.js';
2
- import { Skeleton } from './chunk-LLPWQDF7.js';
1
+ import { Indicator } from './chunk-EJKQGUUM.js';
2
+ import { Skeleton } from './chunk-MTOTPAYZ.js';
3
3
  import { ScrollView } from './chunk-SKJC2KYD.js';
4
- import { TooltipExport } from './chunk-KZP6B6B3.js';
4
+ import { TooltipExport } from './chunk-KTWTYK5U.js';
5
5
  import { POPUP_MOTION } from './chunk-O4GRKO3I.js';
6
- import { PlusIcon, UserIcon, CheckIcon } from './chunk-BLIZ3CL3.js';
6
+ import { PlusIcon, UserIcon, CheckIcon } from './chunk-KBI442IB.js';
7
7
  import { cn } from './chunk-ZSNJ6UA3.js';
8
- import { useLabels } from './chunk-RJTVCA62.js';
9
- import { warnExclusive, devWarn } from './chunk-QDYE5LVT.js';
8
+ import { useLabels } from './chunk-ZIEGUI25.js';
9
+ import { warnExclusive, devWarn } from './chunk-SF3HCW4G.js';
10
10
  import * as React4 from 'react';
11
11
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
12
  import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
@@ -22,9 +22,9 @@ function AvatarAddButton(props) {
22
22
  return /* @__PURE__ */ jsx(TooltipExport, { content: title, children: /* @__PURE__ */ jsx(
23
23
  "button",
24
24
  {
25
+ "aria-label": title,
25
26
  ...rest,
26
27
  type,
27
- "aria-label": title,
28
28
  className: cn(
29
29
  // UUI: border-dashed border-primary bg-primary text-fg-quaternary →
30
30
  // gray-300 dashed ring-slot border on the page surface, resting-icon gray.
@@ -517,5 +517,5 @@ function AvatarProfilePhoto(props) {
517
517
  }
518
518
 
519
519
  export { Avatar, AvatarAddButton, AvatarGroup, AvatarLabelGroup, AvatarProfilePhoto };
520
- //# sourceMappingURL=chunk-TX57TNJS.js.map
521
- //# sourceMappingURL=chunk-TX57TNJS.js.map
520
+ //# sourceMappingURL=chunk-OG3H3RP2.js.map
521
+ //# sourceMappingURL=chunk-OG3H3RP2.js.map
@@ -1,19 +1,25 @@
1
- import { DropdownMenu } from './chunk-ZD3MOLIB.js';
2
- import { SKELETON_WIDTHS, Skeleton } from './chunk-LLPWQDF7.js';
1
+ import { SKELETON_WIDTHS, Skeleton } from './chunk-MTOTPAYZ.js';
2
+ import { DropdownMenu } from './chunk-O7CPRU67.js';
3
+ import { Separator } from './chunk-7OFGPDYJ.js';
3
4
  import { ScrollView } from './chunk-SKJC2KYD.js';
4
- import { Separator } from './chunk-7VLYQR4D.js';
5
5
  import { useLinkElement, LinkOrButton } from './chunk-5AZKP4KZ.js';
6
- import { ButtonUtility } from './chunk-AZ7DKRBY.js';
6
+ import { ButtonUtility } from './chunk-MVF7FA4D.js';
7
7
  import { useIsomorphicLayoutEffect } from './chunk-EDSK6FEH.js';
8
8
  import { Slot } from './chunk-52IFGFTL.js';
9
- import { TooltipExport } from './chunk-KZP6B6B3.js';
10
- import { PanelLeftIcon, ChevronRightIcon, ChevronDownIcon } from './chunk-BLIZ3CL3.js';
9
+ import { TooltipExport } from './chunk-KTWTYK5U.js';
10
+ import { PanelLeftIcon, ChevronRightIcon, ChevronDownIcon } from './chunk-KBI442IB.js';
11
11
  import { cn } from './chunk-ZSNJ6UA3.js';
12
- import { useLabels } from './chunk-RJTVCA62.js';
13
- import { devWarn } from './chunk-QDYE5LVT.js';
12
+ import { useLabels } from './chunk-ZIEGUI25.js';
13
+ import { devWarn } from './chunk-SF3HCW4G.js';
14
14
  import * as React from 'react';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
16
 
17
+ // src/lib/cookie.ts
18
+ var MAX_AGE_SECONDS = 60 * 60 * 24 * 365;
19
+ function writeCookie(name, value) {
20
+ if (typeof document === "undefined") return;
21
+ document.cookie = `${name}=${encodeURIComponent(value)}; Path=/; Max-Age=${MAX_AGE_SECONDS}; SameSite=Lax`;
22
+ }
17
23
  var SidebarContext = React.createContext(null);
18
24
  function useSidebar() {
19
25
  const value = React.useContext(SidebarContext);
@@ -29,19 +35,10 @@ var BREAKPOINT_QUERY = {
29
35
  lg: "(max-width: 1023px)",
30
36
  xl: "(max-width: 1279px)"
31
37
  };
32
- function readStored(storageKey, fallback) {
33
- if (!storageKey || typeof window === "undefined") return fallback;
34
- try {
35
- const stored = localStorage.getItem(storageKey);
36
- if (stored === "true") return true;
37
- if (stored === "false") return false;
38
- } catch {
39
- }
40
- return fallback;
41
- }
42
38
  function SidebarProvider(props) {
43
- const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange, storageKey, shortcut = true, collapseBelow, children } = props;
44
- const [uncontrolled, setUncontrolled] = React.useState(defaultCollapsed);
39
+ const { collapsed: controlled, state, defaultCollapsed = false, onCollapsedChange, shortcut = true, collapseBelow, children } = props;
40
+ const storageKey = state?.key;
41
+ const [uncontrolled, setUncontrolled] = React.useState(state?.collapsed ?? defaultCollapsed);
45
42
  const collapsed = controlled ?? uncontrolled;
46
43
  const collapsedRef = React.useRef(collapsed);
47
44
  collapsedRef.current = collapsed;
@@ -52,24 +49,13 @@ function SidebarProvider(props) {
52
49
  (next, remember) => {
53
50
  if (remember) imposedRef.current = false;
54
51
  if (controlled === void 0) setUncontrolled(next);
55
- if (remember && storageKey) {
56
- try {
57
- localStorage.setItem(storageKey, String(next));
58
- } catch {
59
- }
60
- }
52
+ if (remember && storageKey) writeCookie(storageKey, String(next));
61
53
  onChangeRef.current?.(next);
62
54
  },
63
55
  [controlled, storageKey]
64
56
  );
65
57
  const setCollapsed = React.useCallback((next) => commit(next, true), [commit]);
66
58
  const toggle = React.useCallback(() => commit(!collapsedRef.current, true), [commit]);
67
- useIsomorphicLayoutEffect(() => {
68
- if (controlled !== void 0 || !storageKey) return;
69
- const stored = readStored(storageKey, defaultCollapsed);
70
- setUncontrolled((current) => current === stored ? current : stored);
71
- collapsedRef.current = stored;
72
- }, [controlled, storageKey]);
73
59
  React.useEffect(() => {
74
60
  if (!shortcut) return;
75
61
  const onKeyDown = (event) => {
@@ -548,5 +534,5 @@ function SidebarNavigation(props) {
548
534
  SidebarNavigation.displayName = "SidebarNavigation";
549
535
 
550
536
  export { SidebarNavigation, SidebarProvider, SidebarTrigger, linkMatches, resolveActive, useSidebar };
551
- //# sourceMappingURL=chunk-UGBNYSBN.js.map
552
- //# sourceMappingURL=chunk-UGBNYSBN.js.map
537
+ //# sourceMappingURL=chunk-PFKPKE6O.js.map
538
+ //# sourceMappingURL=chunk-PFKPKE6O.js.map