@skiddph/prui 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,305 @@
1
+ import { jsxs as N, Fragment as U, jsx as u } from "react/jsx-runtime";
2
+ import * as R from "react";
3
+ import { Clock as G } from "lucide-react";
4
+ import { cn as I } from "./cn.js";
5
+ import { Portal as L, useOverlayStack as J, useEscapeKey as Q } from "./overlay.js";
6
+ import { useAnchoredPosition as W } from "./anchor.js";
7
+ import { moveIndex as F } from "./list-nav.js";
8
+ import { usePruiI18n as V } from "../i18n.js";
9
+ const P = (s) => String(s).padStart(2, "0");
10
+ function _(s) {
11
+ if (!s || !/^\d{2}:\d{2}(:\d{2})?$/.test(s)) return null;
12
+ const [o, c, d] = s.split(":").map(Number);
13
+ return { h: o ?? 0, m: c ?? 0, s: d ?? 0 };
14
+ }
15
+ function X(s, o, c = 0, d) {
16
+ return d ? `${P(s)}:${P(o)}:${P(c)}` : `${P(s)}:${P(o)}`;
17
+ }
18
+ function z(s) {
19
+ const o = _(s);
20
+ return o ? o.h * 3600 + o.m * 60 + o.s : -1;
21
+ }
22
+ function Y(s) {
23
+ const o = [];
24
+ for (let c = 0; c < 60; c += Math.max(1, s)) o.push(c);
25
+ return o;
26
+ }
27
+ function C({ value: s, onSelect: o, minuteStep: c = 1, seconds: d = !1, min: h, max: y, compact: k, className: w }) {
28
+ const { t: b } = V(), t = _(s), x = h ? z(h) : -1 / 0, A = y ? z(y) : 1 / 0, p = [
29
+ { label: b.hours, items: Array.from({ length: 24 }, (e, a) => a), selected: (t == null ? void 0 : t.h) ?? null, unit: "h" },
30
+ { label: b.minutes, items: Y(c), selected: (t == null ? void 0 : t.m) ?? null, unit: "m" }
31
+ ];
32
+ d && p.push({ label: b.seconds, items: Array.from({ length: 60 }, (e, a) => a), selected: (t == null ? void 0 : t.s) ?? null, unit: "s" });
33
+ const H = (e, a) => {
34
+ const n = e === "h" ? a : (t == null ? void 0 : t.h) ?? 0, m = e === "m" ? a : (t == null ? void 0 : t.m) ?? 0, i = e === "s" ? a : (t == null ? void 0 : t.s) ?? 0, f = n * 3600 + m * 60 + i;
35
+ return f < x || f > A;
36
+ }, E = (e, a) => {
37
+ const n = e === "h" ? a : (t == null ? void 0 : t.h) ?? 0, m = e === "m" ? a : (t == null ? void 0 : t.m) ?? 0, i = e === "s" ? a : (t == null ? void 0 : t.s) ?? 0;
38
+ o(X(n, m, i, d));
39
+ }, S = (e, a) => {
40
+ var T, v, g, l, D, $, M, K;
41
+ const n = Array.from(
42
+ e.currentTarget.querySelectorAll("[role='option']:not([aria-disabled='true'])")
43
+ ), m = n.findIndex((r) => r.getAttribute("aria-selected") === "true"), i = n.indexOf(document.activeElement), f = i >= 0 ? i : m;
44
+ switch (e.key) {
45
+ case "ArrowDown":
46
+ e.preventDefault(), (T = n[F(f, 1, n.length)]) == null || T.focus();
47
+ break;
48
+ case "ArrowUp":
49
+ e.preventDefault(), (v = n[F(f, -1, n.length)]) == null || v.focus();
50
+ break;
51
+ case "Home":
52
+ e.preventDefault(), (g = n[0]) == null || g.focus();
53
+ break;
54
+ case "End":
55
+ e.preventDefault(), (l = n[n.length - 1]) == null || l.focus();
56
+ break;
57
+ case "ArrowLeft":
58
+ if (a > 0) {
59
+ e.preventDefault();
60
+ const r = (D = e.currentTarget.previousElementSibling) == null ? void 0 : D.querySelectorAll("[role='option']:not([aria-disabled='true'])");
61
+ ($ = r == null ? void 0 : r[Math.min(f < 0 ? 0 : f, r.length - 1)]) == null || $.focus();
62
+ }
63
+ break;
64
+ case "ArrowRight":
65
+ if (a < p.length - 1) {
66
+ e.preventDefault();
67
+ const r = (M = e.currentTarget.nextElementSibling) == null ? void 0 : M.querySelectorAll("[role='option']:not([aria-disabled='true'])");
68
+ (K = r == null ? void 0 : r[Math.min(f < 0 ? 0 : f, r.length - 1)]) == null || K.focus();
69
+ }
70
+ break;
71
+ }
72
+ };
73
+ return /* @__PURE__ */ u("div", { className: I("prui-time-panel flex gap-1", w), role: "group", "aria-label": b.time, children: p.map((e, a) => /* @__PURE__ */ N(
74
+ "div",
75
+ {
76
+ role: "listbox",
77
+ "aria-label": e.label,
78
+ tabIndex: -1,
79
+ onKeyDown: (n) => S(n, a),
80
+ className: I("flex w-16 flex-col rounded-[var(--prui-radius-1)] outline-none", !k && "bg-[var(--prui-raise)]/40"),
81
+ children: [
82
+ k ? null : /* @__PURE__ */ u("div", { className: "px-2 pb-1 pt-2 text-center text-[10px] font-semibold uppercase tracking-wide text-[var(--prui-dim)]", children: e.label }),
83
+ /* @__PURE__ */ u("div", { className: "flex max-h-56 flex-col overflow-y-auto p-1", children: e.items.map((n) => {
84
+ const m = e.selected === n, i = H(e.unit, n);
85
+ return /* @__PURE__ */ u(
86
+ "button",
87
+ {
88
+ type: "button",
89
+ role: "option",
90
+ "aria-selected": m,
91
+ "aria-disabled": i || void 0,
92
+ tabIndex: m ? 0 : -1,
93
+ "data-testid": `time-${e.unit}`,
94
+ onClick: () => !i && E(e.unit, n),
95
+ className: I(
96
+ "rounded-[calc(var(--prui-radius-1))] py-1 text-center text-sm tabular-nums cursor-pointer outline-none",
97
+ "focus-visible:bg-[var(--prui-raise)]",
98
+ m ? "bg-[var(--prui-brand)] text-[var(--prui-brand-fg,#fff)] font-medium" : "text-[var(--prui-fg)] hover:bg-[var(--prui-raise)]",
99
+ i && "opacity-40 pointer-events-none"
100
+ ),
101
+ children: P(n)
102
+ },
103
+ n
104
+ );
105
+ }) })
106
+ ]
107
+ },
108
+ e.unit
109
+ )) });
110
+ }
111
+ function B(s, o, c) {
112
+ const { setElement: d, isTop: h } = J(o);
113
+ Q(o, h, c);
114
+ const { ref: y, position: k } = W({ active: o, anchorRef: s, side: "bottom", align: "start", offsetHeight: 280 });
115
+ return R.useEffect(() => {
116
+ if (!o) return;
117
+ const w = (b) => {
118
+ var x;
119
+ const t = b.target;
120
+ (x = s.current) != null && x.contains(t) || (!(t instanceof Element) || !t.closest("[data-prui-time-panel-wrap]")) && c();
121
+ };
122
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
123
+ }), { setElement: d, floatingRef: y, position: k };
124
+ }
125
+ const Z = R.forwardRef(function({ value: o, defaultValue: c, onChange: d, minuteStep: h, seconds: y, min: k, max: w, disabled: b, placeholder: t = "HH:mm", ariaLabel: x, className: A }, p) {
126
+ const [H, E] = R.useState(c ?? ""), [S, e] = R.useState(!1), a = R.useRef(null), n = o !== void 0, m = n ? o : H, i = a, { setElement: f, floatingRef: T, position: v } = B(i, S, () => {
127
+ var l;
128
+ e(!1), (l = a.current) == null || l.focus();
129
+ }), g = (l) => {
130
+ n || E(l), d == null || d(l);
131
+ };
132
+ return /* @__PURE__ */ N(U, { children: [
133
+ /* @__PURE__ */ u(
134
+ "input",
135
+ {
136
+ ref: (l) => {
137
+ a.current = l, typeof p == "function" ? p(l) : p && (p.current = l);
138
+ },
139
+ type: "text",
140
+ readOnly: !0,
141
+ role: "combobox",
142
+ "aria-expanded": S,
143
+ "aria-haspopup": "dialog",
144
+ "aria-label": x,
145
+ placeholder: t,
146
+ disabled: b,
147
+ value: m,
148
+ onClick: () => e(!0),
149
+ onFocus: () => {
150
+ !b && !S && e(!0);
151
+ },
152
+ className: I(
153
+ "prui-time-picker h-9 w-full cursor-pointer rounded-[var(--prui-radius)] border border-[var(--prui-line)]",
154
+ "bg-[var(--prui-background)] px-3 pr-8 text-sm tabular-nums text-[var(--prui-fg)] placeholder:text-[var(--prui-dim)]",
155
+ "outline-none transition-colors focus:border-[var(--prui-brand)] focus:ring-2 focus:ring-[var(--prui-brand)]/30",
156
+ "disabled:opacity-50 disabled:cursor-not-allowed",
157
+ A
158
+ )
159
+ }
160
+ ),
161
+ S ? /* @__PURE__ */ u(L, { children: /* @__PURE__ */ u(
162
+ "div",
163
+ {
164
+ ref: (l) => {
165
+ T(l), f(l);
166
+ },
167
+ role: "dialog",
168
+ "aria-label": x ?? "Choose time",
169
+ "data-prui-time-panel-wrap": !0,
170
+ className: "fixed z-[var(--prui-z-overlay)] rounded-[var(--prui-radius)] border border-[var(--prui-line)] bg-[var(--prui-surface)] p-2 shadow-[var(--prui-shadow-lg)]",
171
+ style: { top: (v == null ? void 0 : v.top) ?? -9999, left: (v == null ? void 0 : v.left) ?? -9999 },
172
+ children: /* @__PURE__ */ u(C, { value: m, onSelect: g, minuteStep: h, seconds: y, min: k, max: w })
173
+ }
174
+ ) }) : null
175
+ ] });
176
+ });
177
+ Z.displayName = "TimePicker";
178
+ const ee = R.forwardRef(function({ value: o, defaultValue: c, onChange: d, minuteStep: h, seconds: y, min: k, max: w, disabled: b, placeholder: t = "HH:mm – HH:mm", ariaLabel: x, className: A }, p) {
179
+ const { t: H } = V(), [E, S] = R.useState(c ?? {}), [e, a] = R.useState(!1), n = R.useRef(null), m = o !== void 0, i = m ? o : E, f = n, { setElement: T, floatingRef: v, position: g } = B(f, e, () => {
180
+ var r;
181
+ a(!1), (r = n.current) == null || r.focus();
182
+ }), l = (r) => {
183
+ m || S(r), d == null || d(r);
184
+ }, D = (r, q) => {
185
+ const O = r === "from" ? q : i.from, j = r === "to" ? q : i.to;
186
+ if (O && j && z(j) < z(O)) {
187
+ l(r === "to" ? { from: q, to: void 0 } : { from: j, to: O });
188
+ return;
189
+ }
190
+ l({ from: O, to: j });
191
+ }, $ = i.from ? i.to ? `${i.from} – ${i.to}` : `${i.from} – …` : "", M = i.to ?? w, K = i.from ?? k;
192
+ return /* @__PURE__ */ N(U, { children: [
193
+ /* @__PURE__ */ u(
194
+ "input",
195
+ {
196
+ ref: (r) => {
197
+ n.current = r, typeof p == "function" ? p(r) : p && (p.current = r);
198
+ },
199
+ type: "text",
200
+ readOnly: !0,
201
+ role: "combobox",
202
+ "aria-expanded": e,
203
+ "aria-haspopup": "dialog",
204
+ "aria-label": x,
205
+ placeholder: t,
206
+ disabled: b,
207
+ value: $,
208
+ onClick: () => a(!0),
209
+ onFocus: () => {
210
+ !b && !e && a(!0);
211
+ },
212
+ className: I(
213
+ "prui-time-range-picker h-9 w-full cursor-pointer rounded-[var(--prui-radius)] border border-[var(--prui-line)]",
214
+ "bg-[var(--prui-background)] px-3 pr-8 text-sm tabular-nums text-[var(--prui-fg)] placeholder:text-[var(--prui-dim)]",
215
+ "outline-none transition-colors focus:border-[var(--prui-brand)] focus:ring-2 focus:ring-[var(--prui-brand)]/30",
216
+ "disabled:opacity-50 disabled:cursor-not-allowed",
217
+ A
218
+ )
219
+ }
220
+ ),
221
+ /* @__PURE__ */ u(G, { className: "pointer-events-none -ml-7 h-4 w-4 text-[var(--prui-dim)]", "aria-hidden": !0 }),
222
+ e ? /* @__PURE__ */ u(L, { children: /* @__PURE__ */ u(
223
+ "div",
224
+ {
225
+ ref: (r) => {
226
+ v(r), T(r);
227
+ },
228
+ role: "dialog",
229
+ "aria-label": x ?? "Choose time range",
230
+ "data-prui-time-panel-wrap": !0,
231
+ className: "fixed z-[var(--prui-z-overlay)] rounded-[var(--prui-radius)] border border-[var(--prui-line)] bg-[var(--prui-surface)] p-3 shadow-[var(--prui-shadow-lg)]",
232
+ style: { top: (g == null ? void 0 : g.top) ?? -9999, left: (g == null ? void 0 : g.left) ?? -9999 },
233
+ children: /* @__PURE__ */ N("div", { className: "flex flex-col gap-3", children: [
234
+ /* @__PURE__ */ N("div", { className: "flex gap-4", children: [
235
+ /* @__PURE__ */ N("div", { children: [
236
+ /* @__PURE__ */ u("div", { className: "mb-1 text-xs font-semibold text-[var(--prui-dim)]", children: H.from }),
237
+ /* @__PURE__ */ u(C, { compact: !0, value: i.from, onSelect: (r) => D("from", r), minuteStep: h, seconds: y, min: k, max: M })
238
+ ] }),
239
+ /* @__PURE__ */ N("div", { children: [
240
+ /* @__PURE__ */ u("div", { className: "mb-1 text-xs font-semibold text-[var(--prui-dim)]", children: H.to }),
241
+ /* @__PURE__ */ u(C, { compact: !0, value: i.to, onSelect: (r) => D("to", r), minuteStep: h, seconds: y, min: K, max: w })
242
+ ] })
243
+ ] }),
244
+ /* @__PURE__ */ N("div", { className: "flex items-center justify-between border-t border-[var(--prui-line)] pt-2 text-xs text-[var(--prui-dim)]", children: [
245
+ /* @__PURE__ */ u("span", { "data-testid": "timerange-label", children: $ || H.time }),
246
+ /* @__PURE__ */ N("div", { className: "flex gap-2", children: [
247
+ /* @__PURE__ */ u(
248
+ "button",
249
+ {
250
+ type: "button",
251
+ onClick: () => l({}),
252
+ className: "cursor-pointer rounded-[var(--prui-radius-1)] px-2 py-1 transition-colors hover:bg-[var(--prui-raise)]",
253
+ children: H.clear
254
+ }
255
+ ),
256
+ /* @__PURE__ */ u(
257
+ "button",
258
+ {
259
+ type: "button",
260
+ onClick: () => {
261
+ var r;
262
+ a(!1), (r = n.current) == null || r.focus();
263
+ },
264
+ className: "cursor-pointer rounded-[var(--prui-radius-1)] bg-[var(--prui-brand)]/15 px-2 py-1 text-[var(--prui-brand)] transition-colors hover:bg-[var(--prui-brand)]/25",
265
+ children: H.apply
266
+ }
267
+ )
268
+ ] })
269
+ ] })
270
+ ] })
271
+ }
272
+ ) }) : null
273
+ ] });
274
+ });
275
+ ee.displayName = "TimeRangePicker";
276
+ const le = {
277
+ name: "TimePicker",
278
+ props: [
279
+ { name: "value", type: "string 'HH:mm' | 'HH:mm:ss'", default: "undefined", control: "text" },
280
+ { name: "defaultValue", type: "string", default: "undefined", control: "text" },
281
+ { name: "onChange", type: "(time: string) => void", default: null, control: "none" },
282
+ { name: "minuteStep", type: "number (minutes)", default: "1", control: "number" },
283
+ { name: "seconds", type: "boolean", default: "false", control: "boolean", description: "Adds a seconds column ('HH:mm:ss')." },
284
+ { name: "min", type: "string 'HH:mm'", default: "undefined", control: "text" },
285
+ { name: "max", type: "string 'HH:mm'", default: "undefined", control: "text" }
286
+ ]
287
+ }, ue = {
288
+ name: "TimeRangePicker",
289
+ props: [
290
+ { name: "value", type: "{ from?: string, to?: string }", default: "{}", control: "object" },
291
+ { name: "defaultValue", type: "{ from?: string, to?: string }", default: "{}", control: "object" },
292
+ { name: "onChange", type: "(range: TimeRange) => void", default: null, control: "none" },
293
+ { name: "minuteStep", type: "number (minutes)", default: "1", control: "number" },
294
+ { name: "seconds", type: "boolean", default: "false", control: "boolean" },
295
+ { name: "min", type: "string 'HH:mm'", default: "undefined", control: "text" },
296
+ { name: "max", type: "string 'HH:mm'", default: "undefined", control: "text" }
297
+ ]
298
+ };
299
+ export {
300
+ C as TimePanel,
301
+ Z as TimePicker,
302
+ ee as TimeRangePicker,
303
+ le as timePickerPropsMeta,
304
+ ue as timeRangePickerPropsMeta
305
+ };
package/dist/core.js CHANGED
@@ -1,75 +1,77 @@
1
1
  import { cn as r } from "./core/cn.js";
2
2
  import { resolveSurface as a, withSurface as p } from "./core/surface.js";
3
- import { Portal as l, getFocusable as i, isTopOverlay as m, overlayCount as c, overlayPropsMeta as d, pushOverlay as P, removeOverlay as n, useEscapeKey as x, useFocusTrap as M, useInertBackground as f, useOverlay as u, useOverlayStack as b, useReducedMotion as g, useScrollLock as T } from "./core/overlay.js";
4
- import { endIndex as v, homeIndex as C, moveIndex as D, typeaheadIndex as h } from "./core/list-nav.js";
5
- import { Button as y, buttonPropsMeta as w } from "./core/button.js";
6
- import { Input as A, Textarea as B, inputPropsMeta as F, textareaPropsMeta as O } from "./core/input.js";
3
+ import { Portal as i, getFocusable as l, isTopOverlay as m, overlayCount as P, overlayPropsMeta as c, pushOverlay as d, removeOverlay as n, useEscapeKey as x, useFocusTrap as M, useInertBackground as f, useOverlay as u, useOverlayStack as g, useReducedMotion as b, useScrollLock as T } from "./core/overlay.js";
4
+ import { endIndex as D, homeIndex as S, moveIndex as v, typeaheadIndex as C } from "./core/list-nav.js";
5
+ import { Button as h, buttonPropsMeta as w } from "./core/button.js";
6
+ import { Input as A, Textarea as B, inputPropsMeta as R, textareaPropsMeta as F } from "./core/input.js";
7
7
  import { Label as K, Separator as L, labelPropsMeta as V, separatorPropsMeta as E } from "./core/label.js";
8
8
  import { Select as H, SelectContent as U, SelectItem as j, SelectTrigger as q, SelectValue as z, selectPropsMeta as J } from "./core/select.js";
9
9
  import { Switch as Q, switchPropsMeta as W } from "./core/switch.js";
10
10
  import { Tabs as Y, TabsContent as Z, TabsList as _, TabsTrigger as $, tabsPropsMeta as ee } from "./core/tabs.js";
11
- import { Avatar as re, Badge as te, Card as ae, CardContent as pe, CardDescription as se, CardFooter as le, CardHeader as ie, CardTitle as me, avatarPropsMeta as ce, badgePropsMeta as de, cardPropsMeta as Pe } from "./core/card.js";
12
- import { Dialog as xe, DialogContent as Me, DialogDescription as fe, DialogFooter as ue, DialogHeader as be, DialogTitle as ge, dialogPropsMeta as Te } from "./core/dialog.js";
11
+ import { Avatar as re, Badge as te, Card as ae, CardContent as pe, CardDescription as se, CardFooter as ie, CardHeader as le, CardTitle as me, avatarPropsMeta as Pe, badgePropsMeta as ce, cardPropsMeta as de } from "./core/card.js";
12
+ import { Dialog as xe, DialogBody as Me, DialogContent as fe, DialogDescription as ue, DialogFooter as ge, DialogHeader as be, DialogTitle as Te, dialogBodyPropsMeta as ke, dialogPropsMeta as De } from "./core/dialog.js";
13
13
  import { Dropdown as ve, dropdownPropsMeta as Ce } from "./core/dropdown.js";
14
- import { ScrollArea as he, scrollAreaPropsMeta as ke } from "./core/scroll-area.js";
15
- import { Modal as we, confirmModal as Ie, confirmModalPropsMeta as Ae, modalPropsMeta as Be } from "./core/modal.js";
16
- import { computePosition as Oe, useAnchoredPosition as Re } from "./core/anchor.js";
17
- import { Spinner as Le, spinnerPropsMeta as Ve } from "./core/spinner.js";
18
- import { Skeleton as Ge, skeletonPropsMeta as He } from "./core/skeleton.js";
19
- import { Alert as je, alertPropsMeta as qe } from "./core/alert.js";
20
- import { Progress as Je, progressPropsMeta as Ne } from "./core/progress.js";
21
- import { Toaster as We, dismissAllToasts as Xe, toast as Ye, toastPropsMeta as Ze, toasterPropsMeta as _e } from "./core/toast.js";
22
- import { Tooltip as eo, tooltipPropsMeta as oo } from "./core/tooltip.js";
23
- import { Popover as to, popoverPropsMeta as ao } from "./core/popover.js";
24
- import { Drawer as so, Sheet as lo, drawerPropsMeta as io, sheetPropsMeta as mo } from "./core/drawer.js";
25
- import { Checkbox as Po, checkboxPropsMeta as no } from "./core/checkbox.js";
26
- import { Radio as Mo, RadioGroup as fo, radioGroupPropsMeta as uo } from "./core/radio.js";
27
- import { Combobox as go, comboboxPropsMeta as To } from "./core/combobox.js";
28
- import { Accordion as vo, AccordionItem as Co, accordionPropsMeta as Do } from "./core/accordion.js";
29
- import { Breadcrumb as ko, BreadcrumbEllipsis as yo, BreadcrumbItem as wo, breadcrumbPropsMeta as Io } from "./core/breadcrumb.js";
30
- import { TreeView as Bo, treeViewPropsMeta as Fo } from "./core/tree-view.js";
31
- import { Timeline as Ro, timelinePropsMeta as Ko } from "./core/timeline.js";
32
- import { Calendar as Vo, calendarPropsMeta as Eo, fromDateKey as Go, toDateKey as Ho } from "./core/calendar.js";
33
- import { DatePicker as jo, DateRangePicker as qo, datePickerPropsMeta as zo, dateRangePickerPropsMeta as Jo } from "./core/date-picker.js";
34
- import { FileUpload as Qo, fileUploadPropsMeta as Wo } from "./core/file-upload.js";
14
+ import { ScrollArea as he, scrollAreaPropsMeta as we } from "./core/scroll-area.js";
15
+ import { Modal as Ae, confirmModal as Be, confirmModalPropsMeta as Re, modalPropsMeta as Fe } from "./core/modal.js";
16
+ import { computePosition as Ke, useAnchoredPosition as Le } from "./core/anchor.js";
17
+ import { Spinner as Ee, spinnerPropsMeta as Ge } from "./core/spinner.js";
18
+ import { Skeleton as Ue, skeletonPropsMeta as je } from "./core/skeleton.js";
19
+ import { Alert as ze, alertPropsMeta as Je } from "./core/alert.js";
20
+ import { Progress as Qe, progressPropsMeta as We } from "./core/progress.js";
21
+ import { Toaster as Ye, dismissAllToasts as Ze, toast as _e, toastPropsMeta as $e, toasterPropsMeta as eo } from "./core/toast.js";
22
+ import { Tooltip as ro, tooltipPropsMeta as to } from "./core/tooltip.js";
23
+ import { Popover as po, popoverPropsMeta as so } from "./core/popover.js";
24
+ import { Drawer as lo, Sheet as mo, drawerPropsMeta as Po, sheetPropsMeta as co } from "./core/drawer.js";
25
+ import { Checkbox as xo, checkboxPropsMeta as Mo } from "./core/checkbox.js";
26
+ import { Radio as uo, RadioGroup as go, radioGroupPropsMeta as bo } from "./core/radio.js";
27
+ import { Combobox as ko, comboboxPropsMeta as Do } from "./core/combobox.js";
28
+ import { Accordion as vo, AccordionItem as Co, accordionPropsMeta as yo } from "./core/accordion.js";
29
+ import { Breadcrumb as wo, BreadcrumbEllipsis as Io, BreadcrumbItem as Ao, breadcrumbPropsMeta as Bo } from "./core/breadcrumb.js";
30
+ import { TreeView as Fo, treeViewPropsMeta as Oo } from "./core/tree-view.js";
31
+ import { Timeline as Lo, timelinePropsMeta as Vo } from "./core/timeline.js";
32
+ import { Calendar as Go, calendarPropsMeta as Ho, fromDateKey as Uo, toDateKey as jo } from "./core/calendar.js";
33
+ import { DatePicker as zo, DateRangePicker as Jo, datePickerPropsMeta as No, dateRangePickerPropsMeta as Qo } from "./core/date-picker.js";
34
+ import { TimePanel as Xo, TimePicker as Yo, TimeRangePicker as Zo, timePickerPropsMeta as _o, timeRangePickerPropsMeta as $o } from "./core/time-picker.js";
35
+ import { FileUpload as or, fileUploadPropsMeta as rr } from "./core/file-upload.js";
35
36
  export {
36
37
  vo as Accordion,
37
38
  Co as AccordionItem,
38
- je as Alert,
39
+ ze as Alert,
39
40
  re as Avatar,
40
41
  te as Badge,
41
- ko as Breadcrumb,
42
- yo as BreadcrumbEllipsis,
43
- wo as BreadcrumbItem,
44
- y as Button,
45
- Vo as Calendar,
42
+ wo as Breadcrumb,
43
+ Io as BreadcrumbEllipsis,
44
+ Ao as BreadcrumbItem,
45
+ h as Button,
46
+ Go as Calendar,
46
47
  ae as Card,
47
48
  pe as CardContent,
48
49
  se as CardDescription,
49
- le as CardFooter,
50
- ie as CardHeader,
50
+ ie as CardFooter,
51
+ le as CardHeader,
51
52
  me as CardTitle,
52
- Po as Checkbox,
53
- go as Combobox,
54
- jo as DatePicker,
55
- qo as DateRangePicker,
53
+ xo as Checkbox,
54
+ ko as Combobox,
55
+ zo as DatePicker,
56
+ Jo as DateRangePicker,
56
57
  xe as Dialog,
57
- Me as DialogContent,
58
- fe as DialogDescription,
59
- ue as DialogFooter,
58
+ Me as DialogBody,
59
+ fe as DialogContent,
60
+ ue as DialogDescription,
61
+ ge as DialogFooter,
60
62
  be as DialogHeader,
61
- ge as DialogTitle,
62
- so as Drawer,
63
+ Te as DialogTitle,
64
+ lo as Drawer,
63
65
  ve as Dropdown,
64
- Qo as FileUpload,
66
+ or as FileUpload,
65
67
  A as Input,
66
68
  K as Label,
67
- we as Modal,
68
- to as Popover,
69
- l as Portal,
70
- Je as Progress,
71
- Mo as Radio,
72
- fo as RadioGroup,
69
+ Ae as Modal,
70
+ po as Popover,
71
+ i as Portal,
72
+ Qe as Progress,
73
+ uo as Radio,
74
+ go as RadioGroup,
73
75
  he as ScrollArea,
74
76
  H as Select,
75
77
  U as SelectContent,
@@ -77,81 +79,87 @@ export {
77
79
  q as SelectTrigger,
78
80
  z as SelectValue,
79
81
  L as Separator,
80
- lo as Sheet,
81
- Ge as Skeleton,
82
- Le as Spinner,
82
+ mo as Sheet,
83
+ Ue as Skeleton,
84
+ Ee as Spinner,
83
85
  Q as Switch,
84
86
  Y as Tabs,
85
87
  Z as TabsContent,
86
88
  _ as TabsList,
87
89
  $ as TabsTrigger,
88
90
  B as Textarea,
89
- Ro as Timeline,
90
- We as Toaster,
91
- eo as Tooltip,
92
- Bo as TreeView,
93
- Do as accordionPropsMeta,
94
- qe as alertPropsMeta,
95
- ce as avatarPropsMeta,
96
- de as badgePropsMeta,
97
- Io as breadcrumbPropsMeta,
91
+ Xo as TimePanel,
92
+ Yo as TimePicker,
93
+ Zo as TimeRangePicker,
94
+ Lo as Timeline,
95
+ Ye as Toaster,
96
+ ro as Tooltip,
97
+ Fo as TreeView,
98
+ yo as accordionPropsMeta,
99
+ Je as alertPropsMeta,
100
+ Pe as avatarPropsMeta,
101
+ ce as badgePropsMeta,
102
+ Bo as breadcrumbPropsMeta,
98
103
  w as buttonPropsMeta,
99
- Eo as calendarPropsMeta,
100
- Pe as cardPropsMeta,
101
- no as checkboxPropsMeta,
104
+ Ho as calendarPropsMeta,
105
+ de as cardPropsMeta,
106
+ Mo as checkboxPropsMeta,
102
107
  r as cn,
103
- To as comboboxPropsMeta,
104
- Oe as computePosition,
105
- Ie as confirmModal,
106
- Ae as confirmModalPropsMeta,
107
- zo as datePickerPropsMeta,
108
- Jo as dateRangePickerPropsMeta,
109
- Te as dialogPropsMeta,
110
- Xe as dismissAllToasts,
111
- io as drawerPropsMeta,
108
+ Do as comboboxPropsMeta,
109
+ Ke as computePosition,
110
+ Be as confirmModal,
111
+ Re as confirmModalPropsMeta,
112
+ No as datePickerPropsMeta,
113
+ Qo as dateRangePickerPropsMeta,
114
+ ke as dialogBodyPropsMeta,
115
+ De as dialogPropsMeta,
116
+ Ze as dismissAllToasts,
117
+ Po as drawerPropsMeta,
112
118
  Ce as dropdownPropsMeta,
113
- v as endIndex,
114
- Wo as fileUploadPropsMeta,
115
- Go as fromDateKey,
116
- i as getFocusable,
117
- C as homeIndex,
118
- F as inputPropsMeta,
119
+ D as endIndex,
120
+ rr as fileUploadPropsMeta,
121
+ Uo as fromDateKey,
122
+ l as getFocusable,
123
+ S as homeIndex,
124
+ R as inputPropsMeta,
119
125
  m as isTopOverlay,
120
126
  V as labelPropsMeta,
121
- Be as modalPropsMeta,
122
- D as moveIndex,
123
- c as overlayCount,
124
- d as overlayPropsMeta,
125
- ao as popoverPropsMeta,
126
- Ne as progressPropsMeta,
127
- P as pushOverlay,
128
- uo as radioGroupPropsMeta,
127
+ Fe as modalPropsMeta,
128
+ v as moveIndex,
129
+ P as overlayCount,
130
+ c as overlayPropsMeta,
131
+ so as popoverPropsMeta,
132
+ We as progressPropsMeta,
133
+ d as pushOverlay,
134
+ bo as radioGroupPropsMeta,
129
135
  n as removeOverlay,
130
136
  a as resolveSurface,
131
- ke as scrollAreaPropsMeta,
137
+ we as scrollAreaPropsMeta,
132
138
  J as selectPropsMeta,
133
139
  E as separatorPropsMeta,
134
- mo as sheetPropsMeta,
135
- He as skeletonPropsMeta,
136
- Ve as spinnerPropsMeta,
140
+ co as sheetPropsMeta,
141
+ je as skeletonPropsMeta,
142
+ Ge as spinnerPropsMeta,
137
143
  W as switchPropsMeta,
138
144
  ee as tabsPropsMeta,
139
- O as textareaPropsMeta,
140
- Ko as timelinePropsMeta,
141
- Ho as toDateKey,
142
- Ye as toast,
143
- Ze as toastPropsMeta,
144
- _e as toasterPropsMeta,
145
- oo as tooltipPropsMeta,
146
- Fo as treeViewPropsMeta,
147
- h as typeaheadIndex,
148
- Re as useAnchoredPosition,
145
+ F as textareaPropsMeta,
146
+ _o as timePickerPropsMeta,
147
+ $o as timeRangePickerPropsMeta,
148
+ Vo as timelinePropsMeta,
149
+ jo as toDateKey,
150
+ _e as toast,
151
+ $e as toastPropsMeta,
152
+ eo as toasterPropsMeta,
153
+ to as tooltipPropsMeta,
154
+ Oo as treeViewPropsMeta,
155
+ C as typeaheadIndex,
156
+ Le as useAnchoredPosition,
149
157
  x as useEscapeKey,
150
158
  M as useFocusTrap,
151
159
  f as useInertBackground,
152
160
  u as useOverlay,
153
- b as useOverlayStack,
154
- g as useReducedMotion,
161
+ g as useOverlayStack,
162
+ b as useReducedMotion,
155
163
  T as useScrollLock,
156
164
  p as withSurface
157
165
  };
@@ -54,6 +54,12 @@ export interface PruiDictionary {
54
54
  today: string;
55
55
  clear: string;
56
56
  apply: string;
57
+ time: string;
58
+ hours: string;
59
+ minutes: string;
60
+ seconds: string;
61
+ from: string;
62
+ to: string;
57
63
  dropFiles: string;
58
64
  browseFiles: string;
59
65
  removeFile: string;
package/dist/i18n.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import * as a from "react";
2
+ import * as r from "react";
3
3
  const s = {
4
4
  close: "Close",
5
5
  closeDialog: "Close dialog",
@@ -46,6 +46,12 @@ const s = {
46
46
  today: "Today",
47
47
  clear: "Clear",
48
48
  apply: "Apply",
49
+ time: "Time",
50
+ hours: "Hours",
51
+ minutes: "Minutes",
52
+ seconds: "Seconds",
53
+ from: "From",
54
+ to: "To",
49
55
  dropFiles: "Drag files here or click to browse",
50
56
  browseFiles: "Browse files",
51
57
  removeFile: "Remove file",
@@ -65,25 +71,25 @@ function f() {
65
71
  function p() {
66
72
  return o;
67
73
  }
68
- const l = a.createContext(null);
74
+ const l = r.createContext(null);
69
75
  function g({
70
76
  dictionary: e,
71
- children: r
77
+ children: a
72
78
  }) {
73
- a.useEffect(() => {
79
+ r.useEffect(() => {
74
80
  if (!e) return;
75
81
  const c = o;
76
82
  return u(e), () => {
77
83
  o = c, i();
78
84
  };
79
85
  }, [e]);
80
- const t = a.useMemo(() => ({ ...o, ...e }), [e]);
81
- return /* @__PURE__ */ m(l.Provider, { value: t, children: r });
86
+ const t = r.useMemo(() => ({ ...o, ...e }), [e]);
87
+ return /* @__PURE__ */ m(l.Provider, { value: t, children: a });
82
88
  }
83
- function b() {
84
- const e = a.useContext(l), [, r] = a.useReducer((t) => t + 1, 0);
85
- return a.useEffect(() => {
86
- const t = r;
89
+ function h() {
90
+ const e = r.useContext(l), [, a] = r.useReducer((t) => t + 1, 0);
91
+ return r.useEffect(() => {
92
+ const t = a;
87
93
  return n.add(t), () => {
88
94
  n.delete(t);
89
95
  };
@@ -95,5 +101,5 @@ export {
95
101
  p as getPruiDictionary,
96
102
  f as resetPruiDictionary,
97
103
  u as setPruiDictionary,
98
- b as usePruiI18n
104
+ h as usePruiI18n
99
105
  };