@bzync/rui 0.0.5 → 0.0.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.
- package/README.md +476 -57
- package/dist/autocomplete-D6z5B-WU.cjs +1 -0
- package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
- package/dist/calendar-CQumLNgS.cjs +1 -0
- package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
- package/dist/charts-Cot5lCgC.cjs +1 -0
- package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
- package/dist/cn-B6R3HKzx.cjs +1 -0
- package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
- package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
- package/dist/component-styles-DY4wigiq.cjs +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +3 -3
- package/dist/components/aspect-ratio.cjs +1 -1
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/auth-backdrop.cjs +1 -1
- package/dist/components/auth-backdrop.d.ts +4 -1
- package/dist/components/auth-backdrop.js +12 -8
- package/dist/components/autocomplete/dropdown.d.ts +4 -1
- package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
- package/dist/components/autocomplete/single-trigger.d.ts +3 -1
- package/dist/components/autocomplete/types.d.ts +15 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -1
- package/dist/components/avatar-group.js +1 -1
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/billing-interval-toggle.cjs +1 -1
- package/dist/components/billing-interval-toggle.d.ts +4 -6
- package/dist/components/billing-interval-toggle.js +26 -19
- package/dist/components/blockquote.cjs +1 -1
- package/dist/components/blockquote.js +3 -3
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +79 -36
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.js +14 -14
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts.cjs +1 -1
- package/dist/components/charts.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/code.cjs +3 -3
- package/dist/components/code.js +4 -4
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.d.ts +8 -1
- package/dist/components/command.js +84 -83
- package/dist/components/confirm-dialog.cjs +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -1
- package/dist/components/confirm-dialog.js +37 -31
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +3 -2
- package/dist/components/currency.cjs +1 -1
- package/dist/components/currency.js +1 -1
- package/dist/components/datatable/types.d.ts +4 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.d.ts +1 -5
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.d.ts +3 -3
- package/dist/components/datepicker.js +234 -105
- package/dist/components/description-list.cjs +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/divider.cjs +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.d.ts +6 -1
- package/dist/components/drawer.js +128 -2
- package/dist/components/dropdown-menu-panel.cjs +1 -0
- package/dist/components/dropdown-menu-panel.d.ts +24 -0
- package/dist/components/dropdown-menu-panel.js +84 -0
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +38 -93
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.ts +5 -1
- package/dist/components/empty-state.js +9 -9
- package/dist/components/error-state.cjs +1 -1
- package/dist/components/error-state.js +2 -2
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +4 -4
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.d.ts +9 -0
- package/dist/components/form-field.js +49 -14
- package/dist/components/info-button.cjs +1 -1
- package/dist/components/info-button.d.ts +5 -3
- package/dist/components/info-button.js +33 -29
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.d.ts +8 -1
- package/dist/components/modal.js +74 -120
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +2 -2
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +3 -3
- package/dist/components/otp-input.cjs +1 -1
- package/dist/components/otp-input.js +2 -2
- package/dist/components/overlay.cjs +1 -0
- package/dist/components/overlay.d.ts +52 -0
- package/dist/components/overlay.js +87 -0
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.ts +2 -1
- package/dist/components/popover.js +41 -40
- package/dist/components/progressbar.cjs +1 -1
- package/dist/components/progressbar.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +3 -3
- package/dist/components/rating.cjs +1 -1
- package/dist/components/rating.js +3 -3
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +45 -18
- package/dist/components/scroll-area.cjs +1 -1
- package/dist/components/scroll-area.js +3 -3
- package/dist/components/select/option-list.d.ts +3 -1
- package/dist/components/select/types.d.ts +4 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/seo.cjs +1 -1
- package/dist/components/seo.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +14 -1
- package/dist/components/skeleton.js +56 -4
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slot.cjs +1 -0
- package/dist/components/slot.d.ts +12 -0
- package/dist/components/slot.js +16 -0
- package/dist/components/snackbar-viewport.cjs +1 -0
- package/dist/components/snackbar-viewport.d.ts +27 -0
- package/dist/components/snackbar-viewport.js +181 -0
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.d.ts +5 -1
- package/dist/components/snackbar.js +36 -200
- package/dist/components/spinner.cjs +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.cjs +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.js +5 -5
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.js +37 -43
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.d.ts +6 -4
- package/dist/components/tabs.js +51 -81
- package/dist/components/tag.cjs +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/terminal.cjs +1 -1
- package/dist/components/terminal.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/theme-provider.cjs +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +27 -3
- package/dist/components/time-picker.cjs +1 -1
- package/dist/components/time-picker.d.ts +2 -0
- package/dist/components/time-picker.js +206 -148
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -1
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +37 -36
- package/dist/components/tree.cjs +1 -1
- package/dist/components/tree.js +1 -1
- package/dist/components/typography.cjs +1 -1
- package/dist/components/typography.d.ts +2 -3
- package/dist/components/typography.js +37 -24
- package/dist/components/visually-hidden.cjs +1 -0
- package/dist/components/visually-hidden.d.ts +16 -0
- package/dist/components/visually-hidden.js +13 -0
- package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
- package/dist/datatable-t0U7t_xh.cjs +1 -0
- package/dist/icons-Dfetr1L2.cjs +1 -0
- package/dist/icons-Dk7VZ4Ph.js +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +126 -99
- package/dist/lib/cn.d.ts +13 -1
- package/dist/lib/component-styles.d.ts +14 -2
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/motion.d.ts +58 -0
- package/dist/motion-B2shivEB.cjs +1 -0
- package/dist/motion-gnRzFS5f.js +62 -0
- package/dist/select-ByjnuEcE.cjs +1 -0
- package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
- package/dist/styles.css +1 -1
- package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
- package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
- package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
- package/dist/use-focus-trap-CS6BXJAB.js +77 -0
- package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
- package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
- package/package.json +56 -9
- package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
- package/dist/calendar-CUXpVrVE.cjs +0 -1
- package/dist/charts-UDqS1BH1.cjs +0 -1
- package/dist/cn-BdjraxxU.cjs +0 -1
- package/dist/component-styles-DOUctc8_.cjs +0 -1
- package/dist/createLucideIcon-DDY8HuQR.js +0 -42
- package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
- package/dist/datatable-rzDgQ3r6.cjs +0 -1
- package/dist/drawer-CTeBsYrO.cjs +0 -1
- package/dist/drawer-ixuzyLVS.js +0 -189
- package/dist/select-BFwx--uK.cjs +0 -1
- package/dist/theme-toggle-Bb0BYo51.js +0 -71
- package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
|
@@ -2,6 +2,7 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
export type TimePickerSize = "sm" | "md" | "lg";
|
|
3
3
|
export type TimePickerFormat = "12" | "24";
|
|
4
4
|
export type TimePickerSide = "top" | "bottom";
|
|
5
|
+
export type TimePickerAlign = "start" | "end";
|
|
5
6
|
export interface TimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
6
7
|
label?: string;
|
|
7
8
|
hint?: string;
|
|
@@ -21,6 +22,7 @@ export interface TimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "d
|
|
|
21
22
|
placeholder?: string;
|
|
22
23
|
size?: TimePickerSize;
|
|
23
24
|
side?: TimePickerSide;
|
|
25
|
+
align?: TimePickerAlign;
|
|
24
26
|
triggerClassName?: string;
|
|
25
27
|
panelClassName?: string;
|
|
26
28
|
labelClassName?: string;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { o as t, s as n, t as r } from "../component-styles-
|
|
4
|
-
import { forwardRef as i, useEffect as a, useId as o, useImperativeHandle as s,
|
|
5
|
-
import { Fragment as
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { o as t, s as n, t as r } from "../component-styles-C2CbHEEA.js";
|
|
4
|
+
import { forwardRef as i, useEffect as a, useId as o, useImperativeHandle as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
|
|
5
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/time-picker.tsx
|
|
7
|
-
var
|
|
8
|
-
sm: "h-
|
|
9
|
-
md: "h-
|
|
10
|
-
lg: "h-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
top: "bottom-full mb-1.5"
|
|
14
|
-
}, f = (e) => String(e).padStart(2, "0");
|
|
15
|
-
function p(e) {
|
|
7
|
+
var ee = {
|
|
8
|
+
sm: "h-10 px-2.5 text-xs sm:h-8",
|
|
9
|
+
md: "h-11 px-3 text-sm sm:h-9",
|
|
10
|
+
lg: "h-12 px-3.5 text-sm sm:h-10"
|
|
11
|
+
}, m = (e) => String(e).padStart(2, "0");
|
|
12
|
+
function h(e) {
|
|
16
13
|
if (!e) return null;
|
|
17
14
|
let t = /^(?:([01]\d|2[0-3])):([0-5]\d)(?::([0-5]\d))?$/.exec(e);
|
|
18
15
|
return t ? {
|
|
@@ -21,22 +18,22 @@ function p(e) {
|
|
|
21
18
|
second: Number(t[3] ?? 0)
|
|
22
19
|
} : null;
|
|
23
20
|
}
|
|
24
|
-
function
|
|
21
|
+
function g(e) {
|
|
25
22
|
return e.hour * 3600 + e.minute * 60 + e.second;
|
|
26
23
|
}
|
|
27
|
-
function
|
|
28
|
-
let n = `${
|
|
29
|
-
return t ? `${n}:${
|
|
24
|
+
function _(e, t) {
|
|
25
|
+
let n = `${m(e.hour)}:${m(e.minute)}`;
|
|
26
|
+
return t ? `${n}:${m(e.second)}` : n;
|
|
30
27
|
}
|
|
31
|
-
function
|
|
32
|
-
let r =
|
|
28
|
+
function v(e, t, n) {
|
|
29
|
+
let r = h(e);
|
|
33
30
|
if (!r) return "";
|
|
34
|
-
let i =
|
|
35
|
-
if (t === "24") return `${
|
|
31
|
+
let i = m(r.minute), a = n ? `:${m(r.second)}` : "";
|
|
32
|
+
if (t === "24") return `${m(r.hour)}:${i}${a}`;
|
|
36
33
|
let o = r.hour >= 12 ? "PM" : "AM";
|
|
37
34
|
return `${r.hour % 12 || 12}:${i}${a} ${o}`;
|
|
38
35
|
}
|
|
39
|
-
function
|
|
36
|
+
function y(e) {
|
|
40
37
|
let t = /* @__PURE__ */ new Date(), n = Math.floor(59 / e) * e;
|
|
41
38
|
return {
|
|
42
39
|
hour: t.getHours(),
|
|
@@ -44,9 +41,17 @@ function _(e) {
|
|
|
44
41
|
second: t.getSeconds()
|
|
45
42
|
};
|
|
46
43
|
}
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
|
|
44
|
+
function b(e, t, n) {
|
|
45
|
+
let r = Math.floor(59 / t) * t;
|
|
46
|
+
return {
|
|
47
|
+
...e,
|
|
48
|
+
minute: Math.min(r, Math.round(e.minute / t) * t),
|
|
49
|
+
second: n ? e.second : 0
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function x({ label: t, id: r, name: i, options: a, value: o, onSelect: s }) {
|
|
53
|
+
let c = `${r}-label`;
|
|
54
|
+
function l(e, t) {
|
|
50
55
|
if (![
|
|
51
56
|
"ArrowUp",
|
|
52
57
|
"ArrowDown",
|
|
@@ -54,124 +59,160 @@ function v({ label: t, name: r, options: i, value: a, onSelect: o }) {
|
|
|
54
59
|
"End"
|
|
55
60
|
].includes(e.key)) return;
|
|
56
61
|
e.preventDefault();
|
|
57
|
-
let n = e.key === "Home" ? 0 : e.key === "End" ?
|
|
58
|
-
r && (
|
|
62
|
+
let n = e.key === "Home" ? 0 : e.key === "End" ? a.length - 1 : (t + (e.key === "ArrowDown" ? 1 : -1) + a.length) % a.length, r = a[n];
|
|
63
|
+
r && (s(r.value), e.currentTarget.closest("[data-time-column]")?.querySelectorAll("[role=\"option\"]")[n]?.focus());
|
|
59
64
|
}
|
|
60
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ p("div", {
|
|
61
66
|
className: "min-w-0",
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
-
id:
|
|
67
|
+
children: [/* @__PURE__ */ f("p", {
|
|
68
|
+
id: c,
|
|
64
69
|
className: "mb-1.5 truncate text-center text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",
|
|
65
70
|
children: t
|
|
66
|
-
}), /* @__PURE__ */
|
|
71
|
+
}), /* @__PURE__ */ f("div", {
|
|
67
72
|
role: "listbox",
|
|
68
|
-
"aria-labelledby":
|
|
69
|
-
"data-time-column":
|
|
70
|
-
className: "max-h-
|
|
71
|
-
children:
|
|
72
|
-
let i = t.value ===
|
|
73
|
-
return /* @__PURE__ */
|
|
73
|
+
"aria-labelledby": c,
|
|
74
|
+
"data-time-column": i,
|
|
75
|
+
className: "max-h-52 min-w-0 overflow-y-auto overscroll-contain rounded-[var(--radius-md)] border border-border bg-surface p-1 scrollbar-thin sm:max-h-44",
|
|
76
|
+
children: a.map((t, r) => {
|
|
77
|
+
let i = t.value === o;
|
|
78
|
+
return /* @__PURE__ */ f("button", {
|
|
74
79
|
type: "button",
|
|
75
80
|
role: "option",
|
|
76
81
|
"aria-selected": i,
|
|
77
82
|
tabIndex: i ? 0 : -1,
|
|
78
|
-
onClick: () =>
|
|
79
|
-
onKeyDown: (e) =>
|
|
80
|
-
className: e("flex h-
|
|
83
|
+
onClick: () => s(t.value),
|
|
84
|
+
onKeyDown: (e) => l(e, r),
|
|
85
|
+
className: e("flex h-11 w-full items-center justify-center rounded-[var(--radius-sm)] px-1 text-sm tabular-nums transition-colors sm:h-9 sm:text-xs", n, i ? "bg-primary font-semibold text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"),
|
|
81
86
|
children: t.label
|
|
82
87
|
}, t.value);
|
|
83
88
|
})
|
|
84
89
|
})]
|
|
85
90
|
});
|
|
86
91
|
}
|
|
87
|
-
var
|
|
88
|
-
let
|
|
89
|
-
s(
|
|
90
|
-
let
|
|
91
|
-
let t =
|
|
92
|
-
return t ?
|
|
93
|
-
}, [
|
|
92
|
+
var S = i(({ label: i, hint: S, error: C, value: w, defaultValue: te = "", onValueChange: ne, format: T = "12", minuteStep: E = 5, showSeconds: D = !1, min: re, max: ie, name: O, disabled: k = !1, required: A = !1, clearable: ae = !0, placeholder: oe = "Select time…", size: se = "md", side: j = "bottom", align: M = "start", triggerClassName: ce, panelClassName: le, labelClassName: ue, messageClassName: N, className: de, id: fe, onBlur: pe, onKeyDown: me, ...he }, ge) => {
|
|
93
|
+
let _e = o(), P = fe ?? _e, F = `${P}-panel`, I = `${P}-message`, L = l(null), R = l(null), z = l(null);
|
|
94
|
+
s(ge, () => R.current);
|
|
95
|
+
let B = Number.isFinite(E) ? Math.max(1, Math.min(30, Math.floor(E))) : 5, V = (e) => {
|
|
96
|
+
let t = h(e);
|
|
97
|
+
return t ? _(t, D) : "";
|
|
98
|
+
}, [ve, ye] = u(() => V(te)), H = V(w ?? ve), [U, be] = u(!1), [xe, W] = u({ visibility: "hidden" }), [G, K] = u(() => b(h(H) ?? y(B), B, D)), Se = Array.from({ length: 24 }, (e, t) => ({
|
|
94
99
|
value: t,
|
|
95
|
-
label:
|
|
96
|
-
})),
|
|
100
|
+
label: m(t)
|
|
101
|
+
})), Ce = Array.from({ length: 12 }, (e, t) => ({
|
|
97
102
|
value: t + 1,
|
|
98
|
-
label:
|
|
99
|
-
})),
|
|
100
|
-
let n = t *
|
|
103
|
+
label: m(t + 1)
|
|
104
|
+
})), we = Array.from({ length: Math.floor(59 / B) + 1 }, (e, t) => {
|
|
105
|
+
let n = t * B;
|
|
101
106
|
return {
|
|
102
107
|
value: n,
|
|
103
|
-
label:
|
|
108
|
+
label: m(n)
|
|
104
109
|
};
|
|
105
|
-
}),
|
|
110
|
+
}), Te = Array.from({ length: 60 }, (e, t) => ({
|
|
106
111
|
value: t,
|
|
107
|
-
label:
|
|
108
|
-
})),
|
|
112
|
+
label: m(t)
|
|
113
|
+
})), Ee = [{
|
|
109
114
|
value: 0,
|
|
110
115
|
label: "AM"
|
|
111
116
|
}, {
|
|
112
117
|
value: 1,
|
|
113
118
|
label: "PM"
|
|
114
|
-
}],
|
|
115
|
-
function
|
|
116
|
-
k || (
|
|
119
|
+
}], q = h(re), J = h(ie), Y = g(G), X = q ? Y < g(q) : !1, De = J ? Y > g(J) : !1, Z = X || De, Oe = v(H, T, D);
|
|
120
|
+
function ke() {
|
|
121
|
+
k || (K(b(h(H) ?? y(B), B, D)), W({ visibility: "hidden" }), be(!0));
|
|
117
122
|
}
|
|
118
123
|
function Q(e = !1) {
|
|
119
|
-
|
|
124
|
+
be(!1), e && R.current?.focus();
|
|
120
125
|
}
|
|
121
126
|
function $(e) {
|
|
122
|
-
|
|
127
|
+
w === void 0 && ye(e), ne?.(e), Q(!0);
|
|
123
128
|
}
|
|
124
129
|
return a(() => {
|
|
125
|
-
if (!
|
|
130
|
+
if (!U) return;
|
|
126
131
|
let e = (e) => {
|
|
127
|
-
|
|
132
|
+
L.current?.contains(e.target) || Q();
|
|
128
133
|
};
|
|
129
134
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
130
|
-
}, [
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
}, [U]), c(() => {
|
|
136
|
+
if (!U) return;
|
|
137
|
+
let e = () => {
|
|
138
|
+
let e = R.current, t = z.current;
|
|
139
|
+
if (!e || !t) return;
|
|
140
|
+
if (window.innerWidth < 640) {
|
|
141
|
+
W({
|
|
142
|
+
insetInline: 8,
|
|
143
|
+
bottom: 8,
|
|
144
|
+
top: "auto",
|
|
145
|
+
width: "auto",
|
|
146
|
+
visibility: "visible"
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = M === "start" ? n.left : n.right - r.width, a = Math.max(16, window.innerWidth - r.width - 16), o = Math.min(Math.max(i, 16), a), s = n.bottom + 6, c = n.top - r.height - 6, l = s + r.height <= window.innerHeight - 16, u = c >= 16, d = j === "bottom" ? l || !u ? s : c : u || !l ? c : s, f = Math.max(16, window.innerHeight - r.height - 16);
|
|
151
|
+
W({
|
|
152
|
+
left: o,
|
|
153
|
+
top: Math.min(Math.max(d, 16), f),
|
|
154
|
+
visibility: "visible"
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
return e(), window.addEventListener("resize", e), document.addEventListener("scroll", e, !0), () => {
|
|
158
|
+
window.removeEventListener("resize", e), document.removeEventListener("scroll", e, !0);
|
|
159
|
+
};
|
|
160
|
+
}, [
|
|
161
|
+
M,
|
|
162
|
+
U,
|
|
163
|
+
j
|
|
164
|
+
]), a(() => {
|
|
165
|
+
if (!U || window.innerWidth >= 640) return;
|
|
166
|
+
let e = document.body.style.overflow;
|
|
167
|
+
return document.body.style.overflow = "hidden", () => {
|
|
168
|
+
document.body.style.overflow = e;
|
|
169
|
+
};
|
|
170
|
+
}, [U]), a(() => {
|
|
171
|
+
U && requestAnimationFrame(() => {
|
|
172
|
+
let e = L.current?.querySelector("[data-time-column=\"hour\"] [aria-selected=\"true\"]"), t = e?.closest("[role=\"listbox\"]");
|
|
173
|
+
e?.focus({ preventScroll: !0 }), e && t && (t.scrollTop = e.offsetTop - t.clientHeight / 2 + e.clientHeight / 2);
|
|
133
174
|
});
|
|
134
|
-
}, [
|
|
135
|
-
ref:
|
|
175
|
+
}, [U]), /* @__PURE__ */ p("div", {
|
|
176
|
+
ref: L,
|
|
136
177
|
className: e("relative", t, de),
|
|
137
178
|
onBlur: (e) => {
|
|
138
179
|
pe?.(e), e.currentTarget.contains(e.relatedTarget) || Q();
|
|
139
180
|
},
|
|
140
181
|
onKeyDown: (e) => {
|
|
141
|
-
e.key === "Escape" &&
|
|
182
|
+
me?.(e), !e.defaultPrevented && e.key === "Escape" && U && (e.preventDefault(), Q(!0));
|
|
142
183
|
},
|
|
143
|
-
...
|
|
184
|
+
...he,
|
|
144
185
|
children: [
|
|
145
|
-
i && /* @__PURE__ */
|
|
146
|
-
htmlFor:
|
|
186
|
+
i && /* @__PURE__ */ p("label", {
|
|
187
|
+
htmlFor: P,
|
|
147
188
|
className: e("text-xs font-semibold leading-5 text-foreground", ue),
|
|
148
|
-
children: [i, A && /* @__PURE__ */ d
|
|
189
|
+
children: [i, A && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
|
|
149
190
|
"aria-hidden": "true",
|
|
150
191
|
className: "ml-1 text-destructive",
|
|
151
192
|
children: "*"
|
|
152
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ f("span", {
|
|
153
194
|
className: "sr-only",
|
|
154
195
|
children: " (required)"
|
|
155
196
|
})] })]
|
|
156
197
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
ref:
|
|
159
|
-
id:
|
|
198
|
+
/* @__PURE__ */ p("button", {
|
|
199
|
+
ref: R,
|
|
200
|
+
id: P,
|
|
160
201
|
type: "button",
|
|
161
202
|
disabled: k,
|
|
162
|
-
"aria-expanded":
|
|
203
|
+
"aria-expanded": U,
|
|
163
204
|
"aria-haspopup": "dialog",
|
|
164
|
-
"aria-controls":
|
|
165
|
-
"aria-invalid":
|
|
205
|
+
"aria-controls": F,
|
|
206
|
+
"aria-invalid": C ? !0 : void 0,
|
|
166
207
|
"aria-required": A || void 0,
|
|
167
|
-
"aria-describedby":
|
|
168
|
-
onClick: () =>
|
|
208
|
+
"aria-describedby": C || S ? I : void 0,
|
|
209
|
+
onClick: () => U ? Q() : ke(),
|
|
169
210
|
onKeyDown: (e) => {
|
|
170
|
-
e.key === "ArrowDown" && !
|
|
211
|
+
e.key === "ArrowDown" && !U && (e.preventDefault(), ke());
|
|
171
212
|
},
|
|
172
|
-
className: e("flex w-full min-w-0 items-center gap-2 rounded-[var(--radius-md)] text-left", r, n,
|
|
213
|
+
className: e("flex w-full min-w-0 items-center gap-2 rounded-[var(--radius-md)] text-left", r, n, C && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", ee[se], ce),
|
|
173
214
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ p("svg", {
|
|
175
216
|
"aria-hidden": "true",
|
|
176
217
|
width: "15",
|
|
177
218
|
height: "15",
|
|
@@ -182,17 +223,17 @@ var y = i(({ label: i, hint: y, error: b, value: x, defaultValue: S = "", onValu
|
|
|
182
223
|
strokeLinecap: "round",
|
|
183
224
|
strokeLinejoin: "round",
|
|
184
225
|
className: "shrink-0 text-muted-foreground",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ f("circle", {
|
|
186
227
|
cx: "12",
|
|
187
228
|
cy: "12",
|
|
188
229
|
r: "9"
|
|
189
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ f("path", { d: "M12 7v5l3 2" })]
|
|
190
231
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
className: e("min-w-0 flex-1 truncate",
|
|
193
|
-
children:
|
|
232
|
+
/* @__PURE__ */ f("span", {
|
|
233
|
+
className: e("min-w-0 flex-1 truncate", Oe ? "text-foreground" : "text-muted-foreground"),
|
|
234
|
+
children: Oe || oe
|
|
194
235
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ f("svg", {
|
|
196
237
|
"aria-hidden": "true",
|
|
197
238
|
width: "13",
|
|
198
239
|
height: "13",
|
|
@@ -202,135 +243,152 @@ var y = i(({ label: i, hint: y, error: b, value: x, defaultValue: S = "", onValu
|
|
|
202
243
|
strokeWidth: "2.5",
|
|
203
244
|
strokeLinecap: "round",
|
|
204
245
|
strokeLinejoin: "round",
|
|
205
|
-
className: e("shrink-0 text-muted-foreground transition-transform",
|
|
206
|
-
children: /* @__PURE__ */
|
|
246
|
+
className: e("shrink-0 text-muted-foreground transition-transform", U && "rotate-180"),
|
|
247
|
+
children: /* @__PURE__ */ f("path", { d: "m6 9 6 6 6-6" })
|
|
207
248
|
})
|
|
208
249
|
]
|
|
209
250
|
}),
|
|
210
|
-
O && /* @__PURE__ */
|
|
251
|
+
O && /* @__PURE__ */ f("input", {
|
|
211
252
|
type: "hidden",
|
|
212
253
|
name: O,
|
|
213
|
-
value:
|
|
254
|
+
value: H,
|
|
214
255
|
disabled: k
|
|
215
256
|
}),
|
|
216
|
-
|
|
217
|
-
|
|
257
|
+
U && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", {
|
|
258
|
+
"aria-hidden": "true",
|
|
259
|
+
className: "fixed inset-0 z-40 bg-overlay sm:hidden",
|
|
260
|
+
onMouseDown: () => Q(!0)
|
|
261
|
+
}), /* @__PURE__ */ p("div", {
|
|
262
|
+
ref: z,
|
|
263
|
+
id: F,
|
|
218
264
|
role: "dialog",
|
|
219
265
|
"aria-label": i ? `Choose ${i.toLowerCase()}` : "Choose time",
|
|
220
|
-
|
|
266
|
+
"data-side": j,
|
|
267
|
+
"data-align": M,
|
|
268
|
+
style: xe,
|
|
269
|
+
className: e("fixed z-50 w-[min(22rem,calc(100vw-2rem))] max-h-[calc(100dvh-1rem)] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised p-3 shadow-floating", le),
|
|
221
270
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ p("div", {
|
|
223
272
|
className: "mb-3 flex items-center justify-between gap-3",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ p("div", {
|
|
225
274
|
className: "min-w-0",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
275
|
+
children: [/* @__PURE__ */ f("p", {
|
|
227
276
|
className: "truncate text-sm font-semibold text-foreground",
|
|
228
277
|
children: "Choose time"
|
|
229
|
-
}), /* @__PURE__ */
|
|
278
|
+
}), /* @__PURE__ */ p("p", {
|
|
230
279
|
className: "text-[11px] text-muted-foreground",
|
|
231
|
-
children: [
|
|
280
|
+
children: [T === "12" ? "12-hour" : "24-hour", " format"]
|
|
232
281
|
})]
|
|
233
|
-
}), /* @__PURE__ */
|
|
282
|
+
}), /* @__PURE__ */ f("button", {
|
|
234
283
|
type: "button",
|
|
235
|
-
onClick: () =>
|
|
236
|
-
className: e("h-
|
|
284
|
+
onClick: () => K(b(y(B), B, D)),
|
|
285
|
+
className: e("h-11 rounded-md px-3 text-xs font-medium text-accent-700 hover:bg-muted sm:h-8 sm:px-2.5 dark:text-accent-300", "focus-ring"),
|
|
237
286
|
children: "Now"
|
|
238
287
|
})]
|
|
239
288
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
|
|
289
|
+
/* @__PURE__ */ f("div", {
|
|
290
|
+
"aria-live": "polite",
|
|
291
|
+
className: "mb-3 flex h-11 items-center justify-center rounded-[var(--radius-md)] bg-muted px-3 text-lg font-semibold tabular-nums text-foreground",
|
|
292
|
+
children: v(_(G, D), T, D)
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ p("div", {
|
|
295
|
+
className: e("grid gap-2", T === "12" && D ? "grid-cols-4" : D || T === "12" ? "grid-cols-3" : "grid-cols-2"),
|
|
242
296
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ f(x, {
|
|
244
298
|
label: "Hour",
|
|
299
|
+
id: `${P}-hour`,
|
|
245
300
|
name: "hour",
|
|
246
|
-
options:
|
|
247
|
-
value:
|
|
248
|
-
onSelect: (e) =>
|
|
301
|
+
options: T === "24" ? Se : Ce,
|
|
302
|
+
value: T === "24" ? G.hour : G.hour % 12 || 12,
|
|
303
|
+
onSelect: (e) => K((t) => ({
|
|
249
304
|
...t,
|
|
250
|
-
hour:
|
|
305
|
+
hour: T === "24" ? e : e % 12 + (t.hour >= 12 ? 12 : 0)
|
|
251
306
|
}))
|
|
252
307
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ f(x, {
|
|
309
|
+
id: `${P}-minute`,
|
|
254
310
|
label: "Minute",
|
|
255
311
|
name: "minute",
|
|
256
|
-
options:
|
|
257
|
-
value:
|
|
258
|
-
onSelect: (e) =>
|
|
312
|
+
options: we,
|
|
313
|
+
value: G.minute,
|
|
314
|
+
onSelect: (e) => K((t) => ({
|
|
259
315
|
...t,
|
|
260
316
|
minute: e
|
|
261
317
|
}))
|
|
262
318
|
}),
|
|
263
|
-
|
|
319
|
+
D && /* @__PURE__ */ f(x, {
|
|
320
|
+
id: `${P}-second`,
|
|
264
321
|
label: "Second",
|
|
265
322
|
name: "second",
|
|
266
|
-
options:
|
|
267
|
-
value:
|
|
268
|
-
onSelect: (e) =>
|
|
323
|
+
options: Te,
|
|
324
|
+
value: G.second,
|
|
325
|
+
onSelect: (e) => K((t) => ({
|
|
269
326
|
...t,
|
|
270
327
|
second: e
|
|
271
328
|
}))
|
|
272
329
|
}),
|
|
273
|
-
|
|
330
|
+
T === "12" && /* @__PURE__ */ f(x, {
|
|
331
|
+
id: `${P}-period`,
|
|
274
332
|
label: "Period",
|
|
275
333
|
name: "period",
|
|
276
|
-
options:
|
|
277
|
-
value: +(
|
|
278
|
-
onSelect: (e) =>
|
|
334
|
+
options: Ee,
|
|
335
|
+
value: +(G.hour >= 12),
|
|
336
|
+
onSelect: (e) => K((t) => ({
|
|
279
337
|
...t,
|
|
280
338
|
hour: t.hour % 12 + e * 12
|
|
281
339
|
}))
|
|
282
340
|
})
|
|
283
341
|
]
|
|
284
342
|
}),
|
|
285
|
-
|
|
343
|
+
Z && /* @__PURE__ */ p("p", {
|
|
286
344
|
role: "status",
|
|
287
345
|
className: "mt-2 text-xs text-destructive",
|
|
288
346
|
children: [
|
|
289
347
|
"Choose a time ",
|
|
290
|
-
|
|
348
|
+
X ? `at or after ${v(_(q, D), T, D)}` : `at or before ${v(_(J, D), T, D)}`,
|
|
291
349
|
"."
|
|
292
350
|
]
|
|
293
351
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
className: "mt-3 flex flex-wrap items-center justify-end gap-2 border-t border-border pt-3",
|
|
352
|
+
/* @__PURE__ */ p("div", {
|
|
353
|
+
className: "sticky bottom-0 -mx-3 -mb-3 mt-3 flex flex-wrap items-center justify-end gap-2 border-t border-border bg-surface-raised px-3 pb-3 pt-3",
|
|
296
354
|
children: [
|
|
297
|
-
|
|
355
|
+
ae && !A && H && /* @__PURE__ */ f("button", {
|
|
298
356
|
type: "button",
|
|
299
357
|
onClick: () => $(""),
|
|
300
|
-
className: e("mr-auto h-
|
|
358
|
+
className: e("mr-auto h-11 rounded-md px-3 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground sm:h-8 sm:px-2.5", "focus-ring"),
|
|
301
359
|
children: "Clear"
|
|
302
360
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ f("button", {
|
|
304
362
|
type: "button",
|
|
305
363
|
onClick: () => Q(!0),
|
|
306
|
-
className: e("h-
|
|
364
|
+
className: e("h-11 rounded-md px-3 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground sm:h-8", "focus-ring"),
|
|
307
365
|
children: "Cancel"
|
|
308
366
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ f("button", {
|
|
310
368
|
type: "button",
|
|
311
|
-
disabled:
|
|
312
|
-
onClick: () => $(
|
|
313
|
-
className: e("h-
|
|
369
|
+
disabled: Z,
|
|
370
|
+
onClick: () => $(_(G, D)),
|
|
371
|
+
className: e("h-11 rounded-md bg-primary px-4 text-xs font-semibold text-primary-foreground hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-40 sm:h-8 sm:px-3", "focus-ring"),
|
|
314
372
|
children: "Apply"
|
|
315
373
|
})
|
|
316
374
|
]
|
|
317
375
|
})
|
|
318
376
|
]
|
|
319
|
-
}),
|
|
320
|
-
|
|
321
|
-
id:
|
|
377
|
+
})] }),
|
|
378
|
+
C && /* @__PURE__ */ f("p", {
|
|
379
|
+
id: I,
|
|
322
380
|
"aria-live": "polite",
|
|
323
|
-
className: e("text-xs leading-5 text-destructive",
|
|
324
|
-
children:
|
|
381
|
+
className: e("text-xs leading-5 text-destructive", N),
|
|
382
|
+
children: C
|
|
325
383
|
}),
|
|
326
|
-
|
|
327
|
-
id:
|
|
328
|
-
className: e("text-xs leading-5 text-muted-foreground",
|
|
329
|
-
children:
|
|
384
|
+
S && !C && /* @__PURE__ */ f("p", {
|
|
385
|
+
id: I,
|
|
386
|
+
className: e("text-xs leading-5 text-muted-foreground", N),
|
|
387
|
+
children: S
|
|
330
388
|
})
|
|
331
389
|
]
|
|
332
390
|
});
|
|
333
391
|
});
|
|
334
|
-
|
|
392
|
+
S.displayName = "TimePicker";
|
|
335
393
|
//#endregion
|
|
336
|
-
export {
|
|
394
|
+
export { S as TimePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react/jsx-runtime");var n={default:`bg-slate-400 border-slate-400/30`,success:`bg-emerald-400 border-emerald-400/30`,warning:`bg-amber-400 border-amber-400/30`,error:`bg-red-400 border-red-400/30`,info:`bg-sky-400 border-sky-400/30`},r={default:`bg-slate-500/15 text-slate-400`,success:`bg-emerald-500/15 text-emerald-400`,warning:`bg-amber-500/15 text-amber-400`,error:`bg-red-500/15 text-red-400`,info:`bg-sky-500/15 text-sky-400`};function i({events:i,className:a}){return(0,t.jsx)(`div`,{className:e.t(`flex flex-col`,a),children:i.map((a,o)=>{let s=o===i.length-1,c=a.variant??`default`;return(0,t.jsxs)(`div`,{className:`flex gap-3`,children:[(0,t.jsxs)(`div`,{className:`flex flex-col items-center`,children:[a.icon?(0,t.jsx)(`div`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center shrink-0`,r[c]),children:(0,t.jsx)(`span`,{className:`w-4 h-4 flex items-center justify-center`,children:a.icon})}):(0,t.jsx)(`div`,{className:e.t(`w-2.5 h-2.5 rounded-full shrink-0 border-2 mt-1.5`,n[c])}),!s&&(0,t.jsx)(`div`,{className:`flex-1 w-px bg-black/10 dark:bg-white/10 my-1`})]}),(0,t.jsxs)(`div`,{className:e.t(`pb-5 min-w-0`,s&&`pb-0`),children:[(0,t.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[(0,t.jsx)(`p`,{className:`text-sm font-medium text-slate-700 dark:text-slate-200`,children:a.title}),a.timestamp&&(0,t.jsx)(`span`,{className:`text-xs text-slate-500`,children:a.timestamp})]}),a.description&&(0,t.jsx)(`p`,{className:`text-sm text-slate-500 mt-0.5`,children:a.description})]})]},a.id)})})}exports.Timeline=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={default:[`border border-transparent bg-transparent text-muted-foreground`,`hover:bg-muted hover:text-foreground`,`data-[state=on]:bg-accent-100 data-[state=on]:text-accent-800`,`dark:data-[state=on]:bg-accent-900/45 dark:data-[state=on]:text-accent-200`].join(` `),outline:[`border border-border bg-surface text-muted-foreground shadow-xs`,`hover:border-border-strong hover:bg-surface-muted hover:text-foreground`,`data-[state=on]:border-accent-300 data-[state=on]:bg-accent-50 data-[state=on]:text-accent-800`,`dark:data-[state=on]:border-accent-700 dark:data-[state=on]:bg-accent-900/35 dark:data-[state=on]:text-accent-200`].join(` `)},a={sm:`h-8 rounded-[var(--radius-md)] px-2.5 text-xs gap-1.5`,md:`h-9 rounded-[var(--radius-md)] px-3 text-sm gap-2`,lg:`h-10 rounded-[var(--radius-lg)] px-4 text-sm gap-2`,icon:`size-9 rounded-[var(--radius-md)] p-0`},o=[`inline-flex shrink-0 cursor-pointer select-none items-center justify-center font-medium`,`transition-[color,background-color,border-color,box-shadow] duration-150`,`disabled:pointer-events-none disabled:opacity-40`,t.s].join(` `),s=(0,n.forwardRef)(({pressed:t,defaultPressed:s=!1,onPressedChange:c,variant:l=`default`,size:u=`md`,className:d,type:f=`button`,onClick:p,...m},h)=>{let[g,_]=(0,n.useState)(s),v=t??g;return(0,r.jsx)(`button`,{ref:h,type:f,"aria-pressed":v,"data-state":v?`on`:`off`,className:e.t(o,i[l],a[u],d),onClick:e=>{if(p?.(e),e.defaultPrevented)return;let n=!v;t===void 0&&_(n),c?.(n)},...m})});s.displayName=`Toggle`;var c=(0,n.createContext)(null);function l(){let e=(0,n.useContext)(c);if(!e)throw Error(`ToggleGroupItem must be inside <ToggleGroup>`);return e}var u=(0,n.forwardRef)(({type:t=`single`,value:i,defaultValue:a,onValueChange:o,orientation:s=`horizontal`,variant:l=`default`,size:u=`md`,disabled:d=!1,loop:f=!0,className:p,children:m,...h},g)=>{let[_,v]=(0,n.useState)(()=>a??(t===`multiple`?[]:``)),y=i??_,b=o;function x(e){return t===`multiple`?Array.isArray(y)&&y.includes(e):y===e}function S(e){let n=t===`multiple`?(()=>{let t=Array.isArray(y)?y:[];return t.includes(e)?t.filter(t=>t!==e):[...t,e]})():y===e?``:e;i===void 0&&v(n),b?.(n)}return(0,r.jsx)(c.Provider,{value:{disabled:d,isPressed:x,loop:f,orientation:s,select:S,size:u,variant:l},children:(0,r.jsx)(`div`,{ref:g,role:`group`,"data-rui-toggle-group":``,"data-orientation":s,className:e.t(`inline-flex w-fit rounded-[var(--radius-lg)]`,s===`horizontal`?`max-w-full flex-row items-center gap-1 overflow-x-auto overscroll-x-contain p-0.5 scrollbar-none [&>*]:shrink-0`:`max-w-full flex-col items-stretch gap-1`,p),...h,children:m})})});u.displayName=`ToggleGroup`;var d=(0,n.forwardRef)(({value:t,variant:n,size:s,className:c,disabled:u,type:d=`button`,onClick:f,onKeyDown:p,...m},h)=>{let g=l(),_=g.isPressed(t),v=g.disabled||u;function y(e){if(p?.(e),e.defaultPrevented)return;let t=g.orientation===`horizontal`?`ArrowLeft`:`ArrowUp`,n=g.orientation===`horizontal`?`ArrowRight`:`ArrowDown`;if(e.key!==t&&e.key!==n&&e.key!==`Home`&&e.key!==`End`)return;let r=e.currentTarget.closest(`[data-rui-toggle-group]`),i=Array.from(r?.querySelectorAll(`[data-rui-toggle-item]:not(:disabled)`)??[]).filter(e=>e.closest(`[data-rui-toggle-group]`)===r),a=i.indexOf(e.currentTarget);if(a<0||i.length===0)return;e.preventDefault();let o=e.key===`Home`?0:e.key===`End`?i.length-1:a+(e.key===n?1:-1);o=g.loop?(o+i.length)%i.length:Math.max(0,Math.min(i.length-1,o)),i[o]?.focus()}return(0,r.jsx)(`button`,{ref:h,type:d,"aria-pressed":_,"data-rui-toggle-item":``,"data-state":_?`on`:`off`,disabled:v,className:e.t(o,i[n??g.variant],a[s??g.size],c),onClick:e=>{f?.(e),e.defaultPrevented||g.select(t)},onKeyDown:y,...m})});d.displayName=`ToggleGroupItem`,exports.Toggle=s,exports.ToggleGroup=u,exports.ToggleGroupItem=d,exports.toggleSizes=a,exports.toggleVariants=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { s as t } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { createContext as n, forwardRef as r, useContext as i, useState as a } from "react";
|
|
5
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/toggle.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../motion-B2shivEB.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a={top:{container:`bottom-full left-1/2 -translate-x-1/2 mb-2`,initial:{y:4}},bottom:{container:`top-full left-1/2 -translate-x-1/2 mt-2`,initial:{y:-4}},left:{container:`right-full top-1/2 -translate-y-1/2 mr-2`,initial:{x:4}},right:{container:`left-full top-1/2 -translate-y-1/2 ml-2`,initial:{x:-4}}};function o({content:o,children:s,position:c=`top`,delayMs:l=0,className:u,wrapperClassName:d}){let[f,p]=(0,r.useState)(!1),m=(0,r.useRef)(null),h=(0,r.useId)(),{container:g,initial:_}=a[c];function v(){l>0?m.current=setTimeout(()=>p(!0),l):p(!0)}function y(){m.current&&clearTimeout(m.current),p(!1)}(0,r.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let b=(0,r.isValidElement)(s)?(0,r.cloneElement)(s,{"aria-describedby":f?h:void 0,onMouseEnter:e=>{s.props.onMouseEnter?.(e),e.defaultPrevented||v()},onMouseLeave:e=>{s.props.onMouseLeave?.(e),y()},onFocus:e=>{s.props.onFocus?.(e),e.defaultPrevented||v()},onBlur:e=>{s.props.onBlur?.(e),y()}}):(0,i.jsx)(`span`,{tabIndex:0,"aria-describedby":f?h:void 0,onMouseEnter:v,onMouseLeave:y,onFocus:v,onBlur:y,children:s});return(0,i.jsxs)(`div`,{className:e.t(`relative inline-flex`,d),children:[b,(0,i.jsx)(n.AnimatePresence,{children:f&&(0,i.jsx)(n.motion.div,{id:h,role:`tooltip`,initial:{opacity:0,..._},animate:{opacity:1,y:0,x:0},exit:{opacity:0,..._},transition:t.n.fade,className:e.t(`absolute z-50 pointer-events-none`,`max-w-[min(20rem,calc(100vw-2rem))] rounded-md px-2.5 py-1.5 text-xs font-medium leading-4`,`border border-slate-700 bg-slate-900 text-slate-50 shadow-floating dark:border-border-strong dark:bg-surface-raised dark:text-foreground`,g,u),children:o})})]})}exports.Tooltip=o;
|
|
@@ -6,6 +6,7 @@ export interface TooltipProps {
|
|
|
6
6
|
position?: Position;
|
|
7
7
|
delayMs?: number;
|
|
8
8
|
className?: string;
|
|
9
|
+
wrapperClassName?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare function Tooltip({ content, children, position, delayMs, className, }: TooltipProps): import("react").JSX.Element;
|
|
11
|
+
export declare function Tooltip({ content, children, position, delayMs, className, wrapperClassName, }: TooltipProps): import("react").JSX.Element;
|
|
11
12
|
export {};
|