@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../cn-
|
|
1
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
2
2
|
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/stepper.tsx
|
|
4
4
|
function i({ steps: i, current: a, orientation: o = "horizontal", className: s }) {
|
|
@@ -11,7 +11,7 @@ function i({ steps: i, current: a, orientation: o = "horizontal", className: s }
|
|
|
11
11
|
children: o === "horizontal" ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
12
12
|
className: "flex items-center w-full",
|
|
13
13
|
children: [/* @__PURE__ */ n("div", {
|
|
14
|
-
className: e("w-8 h-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold border-2 transition-colors", l ? "bg-primary border-primary text-primary-foreground" : u ? "border-accent-500 text-accent-400 bg-accent-500/10" : "border-
|
|
14
|
+
className: e("w-8 h-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold border-2 transition-colors", l ? "bg-primary border-primary text-primary-foreground" : u ? "border-accent-500 text-accent-400 bg-accent-500/10" : "border-border-strong text-muted-foreground"),
|
|
15
15
|
children: l ? /* @__PURE__ */ n("svg", {
|
|
16
16
|
width: "14",
|
|
17
17
|
height: "14",
|
|
@@ -27,7 +27,7 @@ function i({ steps: i, current: a, orientation: o = "horizontal", className: s }
|
|
|
27
27
|
}), /* @__PURE__ */ r("div", {
|
|
28
28
|
className: "mt-2 text-center px-1",
|
|
29
29
|
children: [/* @__PURE__ */ n("p", {
|
|
30
|
-
className: e("text-xs font-medium", u ? "text-
|
|
30
|
+
className: e("text-xs font-medium", u ? "text-foreground" : "text-muted-foreground"),
|
|
31
31
|
children: s.label
|
|
32
32
|
}), s.description && /* @__PURE__ */ n("p", {
|
|
33
33
|
className: "text-[10px] text-slate-500 mt-0.5",
|
|
@@ -36,7 +36,7 @@ function i({ steps: i, current: a, orientation: o = "horizontal", className: s }
|
|
|
36
36
|
})] }) : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
37
37
|
className: "flex flex-col items-center",
|
|
38
38
|
children: [/* @__PURE__ */ n("div", {
|
|
39
|
-
className: e("w-8 h-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold border-2 transition-colors", l ? "bg-primary border-primary text-primary-foreground" : u ? "border-accent-500 text-accent-400 bg-accent-500/10" : "border-
|
|
39
|
+
className: e("w-8 h-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold border-2 transition-colors", l ? "bg-primary border-primary text-primary-foreground" : u ? "border-accent-500 text-accent-400 bg-accent-500/10" : "border-border-strong text-muted-foreground"),
|
|
40
40
|
children: l ? /* @__PURE__ */ n("svg", {
|
|
41
41
|
width: "14",
|
|
42
42
|
height: "14",
|
|
@@ -52,7 +52,7 @@ function i({ steps: i, current: a, orientation: o = "horizontal", className: s }
|
|
|
52
52
|
}), /* @__PURE__ */ r("div", {
|
|
53
53
|
className: "pb-6",
|
|
54
54
|
children: [/* @__PURE__ */ n("p", {
|
|
55
|
-
className: e("text-sm font-medium leading-none mt-1.5", u ? "text-
|
|
55
|
+
className: e("text-sm font-medium leading-none mt-1.5", u ? "text-foreground" : "text-muted-foreground"),
|
|
56
56
|
children: s.label
|
|
57
57
|
}), s.description && /* @__PURE__ */ n("p", {
|
|
58
58
|
className: "text-xs text-slate-500 mt-1",
|
|
@@ -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");let t=require("react"),n=require("react/jsx-runtime");var r={sm:{w:36,h:20,thumb:14,gap:3},md:{w:44,h:24,thumb:18,gap:3}},i=(0,t.forwardRef)(({className:i,label:a,description:o,size:s=`md`,checked:c,defaultChecked:l,onChange:u,onCheckedChange:d,disabled:f,id:p,...m},h)=>{let[g,_]=(0,t.useState)(c===void 0?l??!1:c);(0,t.useEffect)(()=>{c!==void 0&&_(c)},[c]);let v=(0,t.useId)(),y=p??v,b=r[s],x=g?b.w-b.thumb-b.gap:b.gap;return(0,n.jsxs)(`label`,{htmlFor:y,className:e.t(`flex items-start gap-3 cursor-pointer`,f&&`cursor-not-allowed opacity-50`,i),children:[(0,n.jsxs)(`div`,{className:`relative mt-0.5 shrink-0`,style:{width:b.w,height:b.h},children:[(0,n.jsx)(`input`,{ref:h,type:`checkbox`,id:y,className:`peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed`,checked:g,disabled:f,onChange:e=>{c===void 0&&_(e.target.checked),u?.(e),d?.(e.target.checked)},...m}),(0,n.jsx)(`div`,{className:e.t(`rounded-full w-full h-full border transition-all duration-200 peer-focus-visible:ring-[3px] peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg`,g?`bg-primary border-primary`:`bg-muted border-border-strong`)}),(0,n.jsx)(`span`,{className:`absolute rounded-full bg-white shadow-md shadow-black/20 transition-transform duration-200 ease-[cubic-bezier(0.34,1.4,0.64,1)] motion-reduce:transition-none`,style:{width:b.thumb,height:b.thumb,top:b.gap,transform:`translateX(${x}px)`,boxShadow:`0 1px 4px rgba(0,0,0,0.22), 0 0 0 0.5px rgba(0,0,0,0.06)`}})]}),(a||o)&&(0,n.jsxs)(`div`,{className:`min-w-0`,children:[a&&(0,n.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:a}),o&&(0,n.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:o})]})]})});i.displayName=`Switch`,exports.Switch=i;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { forwardRef as t, useEffect as n, useId as r, useState as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/switch.tsx
|
|
7
|
-
var
|
|
6
|
+
var s = {
|
|
8
7
|
sm: {
|
|
9
8
|
w: 36,
|
|
10
9
|
h: 20,
|
|
@@ -17,63 +16,58 @@ var c = {
|
|
|
17
16
|
thumb: 18,
|
|
18
17
|
gap: 3
|
|
19
18
|
}
|
|
20
|
-
},
|
|
21
|
-
let [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
let
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
htmlFor:
|
|
28
|
-
className: e("flex items-start gap-3 cursor-pointer",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
19
|
+
}, c = t(({ className: t, label: c, description: l, size: u = "md", checked: d, defaultChecked: f, onChange: p, onCheckedChange: m, disabled: h, id: g, ..._ }, v) => {
|
|
20
|
+
let [y, b] = i(d === void 0 ? f ?? !1 : d);
|
|
21
|
+
n(() => {
|
|
22
|
+
d !== void 0 && b(d);
|
|
23
|
+
}, [d]);
|
|
24
|
+
let x = r(), S = g ?? x, C = s[u], w = y ? C.w - C.thumb - C.gap : C.gap;
|
|
25
|
+
return /* @__PURE__ */ o("label", {
|
|
26
|
+
htmlFor: S,
|
|
27
|
+
className: e("flex items-start gap-3 cursor-pointer", h && "cursor-not-allowed opacity-50", t),
|
|
28
|
+
children: [/* @__PURE__ */ o("div", {
|
|
30
29
|
className: "relative mt-0.5 shrink-0",
|
|
31
30
|
style: {
|
|
32
|
-
width:
|
|
33
|
-
height:
|
|
31
|
+
width: C.w,
|
|
32
|
+
height: C.h
|
|
34
33
|
},
|
|
35
34
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
ref:
|
|
35
|
+
/* @__PURE__ */ a("input", {
|
|
36
|
+
ref: v,
|
|
38
37
|
type: "checkbox",
|
|
39
|
-
id:
|
|
38
|
+
id: S,
|
|
40
39
|
className: "peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
41
|
-
checked:
|
|
42
|
-
disabled:
|
|
40
|
+
checked: y,
|
|
41
|
+
disabled: h,
|
|
43
42
|
onChange: (e) => {
|
|
44
|
-
|
|
43
|
+
d === void 0 && b(e.target.checked), p?.(e), m?.(e.target.checked);
|
|
45
44
|
},
|
|
46
|
-
...
|
|
45
|
+
..._
|
|
47
46
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
className: "absolute rounded-full bg-white shadow-md shadow-black/20",
|
|
47
|
+
/* @__PURE__ */ a("div", { className: e("rounded-full w-full h-full border transition-all duration-200 peer-focus-visible:ring-[3px] peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg", y ? "bg-primary border-primary" : "bg-muted border-border-strong") }),
|
|
48
|
+
/* @__PURE__ */ a("span", {
|
|
49
|
+
className: "absolute rounded-full bg-white shadow-md shadow-black/20 transition-transform duration-200 ease-[cubic-bezier(0.34,1.4,0.64,1)] motion-reduce:transition-none",
|
|
51
50
|
style: {
|
|
52
|
-
width:
|
|
53
|
-
height:
|
|
54
|
-
top:
|
|
51
|
+
width: C.thumb,
|
|
52
|
+
height: C.thumb,
|
|
53
|
+
top: C.gap,
|
|
54
|
+
transform: `translateX(${w}px)`,
|
|
55
55
|
boxShadow: "0 1px 4px rgba(0,0,0,0.22), 0 0 0 0.5px rgba(0,0,0,0.06)"
|
|
56
|
-
},
|
|
57
|
-
animate: { x: T },
|
|
58
|
-
transition: {
|
|
59
|
-
type: "spring",
|
|
60
|
-
stiffness: 600,
|
|
61
|
-
damping: 35
|
|
62
56
|
}
|
|
63
57
|
})
|
|
64
58
|
]
|
|
65
|
-
}), (
|
|
59
|
+
}), (c || l) && /* @__PURE__ */ o("div", {
|
|
66
60
|
className: "min-w-0",
|
|
67
|
-
children: [
|
|
61
|
+
children: [c && /* @__PURE__ */ a("p", {
|
|
68
62
|
className: "text-sm font-medium text-foreground",
|
|
69
|
-
children:
|
|
70
|
-
}),
|
|
63
|
+
children: c
|
|
64
|
+
}), l && /* @__PURE__ */ a("p", {
|
|
71
65
|
className: "mt-0.5 text-xs text-muted-foreground",
|
|
72
|
-
children:
|
|
66
|
+
children: l
|
|
73
67
|
})]
|
|
74
68
|
})]
|
|
75
69
|
});
|
|
76
70
|
});
|
|
77
|
-
|
|
71
|
+
c.displayName = "Switch";
|
|
78
72
|
//#endregion
|
|
79
|
-
export {
|
|
73
|
+
export { c as Switch };
|
|
@@ -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");function n({className:n,containerClassName:r,scrollAreaClassName:i,density:a=`comfortable`,children:o,...s}){return(0,t.jsx)(`div`,{className:e.t(`w-full overflow-hidden rounded-[var(--radius-lg)] border border-border bg-surface`,r),children:(0,t.jsx)(`div`,{className:e.t(`w-full overflow-x-auto overscroll-x-contain scrollbar-thin`,i),children:(0,t.jsx)(`table`,{"data-density":a,className:e.t(`group/table w-full border-collapse text-sm`,n),...s,children:o})})})}function r({className:n,children:r,...i}){return(0,t.jsx)(`thead`,{className:e.t(`border-b border-border bg-surface-muted`,n),...i,children:r})}function i({className:n,children:r,...i}){return(0,t.jsx)(`tbody`,{className:e.t(`divide-y divide-border`,n),...i,children:r})}function a({className:n,children:r,...i}){return(0,t.jsx)(`tr`,{className:e.t(`transition-colors duration-100 hover:bg-surface-muted aria-selected:bg-accent-50/70 dark:aria-selected:bg-accent-500/10`,n),...i,children:r})}function o({className:n,children:r,...i}){return(0,t.jsx)(`th`,{className:e.t(`px-4 py-2.5 text-left text-[11px] font-semibold text-muted-foreground whitespace-nowrap group-data-[density=compact]/table:px-3 group-data-[density=compact]/table:py-2`,n),...i,children:r})}function s({className:n,children:r,...i}){return(0,t.jsx)(`td`,{className:e.t(`px-4 py-3 text-sm tabular-nums text-foreground whitespace-nowrap group-data-[density=compact]/table:px-3 group-data-[density=compact]/table:py-2`,n),...i,children:r})}exports.Table=n,exports.TableBody=i,exports.TableCell=s,exports.TableHead=o,exports.TableHeader=r,exports.TableRow=a;
|
package/dist/components/table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../cn-
|
|
1
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/table.tsx
|
|
4
4
|
function n({ className: n, containerClassName: r, scrollAreaClassName: i, density: a = "comfortable", children: o, ...s }) {
|
package/dist/components/tabs.cjs
CHANGED
|
@@ -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=(0,n.createContext)(null);function a(){let e=(0,n.useContext)(i);if(!e)throw Error(`Tabs subcomponents must be inside <Tabs>`);return e}function o({defaultValue:t,value:a,children:o,className:s,orientation:c=`horizontal`,onValueChange:l,onChange:u}){let[d,f]=(0,n.useState)(t),p=a??d,m=(0,n.useId)();return(0,r.jsx)(i.Provider,{value:{active:p,setActive:e=>{a===void 0&&f(e),l?.(e),u?.(e)},orientation:c,tabsId:m},children:(0,r.jsx)(`div`,{className:e.t(c===`vertical`?`flex flex-col gap-4 sm:flex-row`:`flex flex-col`,s),children:o})})}function s({className:t,children:n,...i}){let{orientation:o}=a();return(0,r.jsx)(`div`,{className:e.t(`rounded-[var(--radius-md)] border border-border bg-surface-muted p-1`,o===`vertical`?`flex flex-row sm:flex-col gap-0.5 w-full sm:w-36 sm:shrink-0 overflow-x-auto`:`flex items-center gap-0.5 overflow-x-auto max-w-full scrollbar-none`,t),role:`tablist`,...i,children:n})}function c({value:n,className:i,children:o,icon:s,onKeyDown:c,...l}){let{active:u,setActive:d,orientation:f,tabsId:p}=a(),m=u===n,h=encodeURIComponent(n),g=`${p}-tab-${h}`,_=`${p}-panel-${h}`;function v(e){if(c?.(e),e.defaultPrevented||!(f===`vertical`?[`ArrowUp`,`ArrowDown`]:[`ArrowLeft`,`ArrowRight`]).includes(e.key)&&e.key!==`Home`&&e.key!==`End`)return;let t=e.currentTarget.closest(`[role="tablist"]`),n=Array.from(t?.querySelectorAll(`[role="tab"]:not(:disabled)`)??[]),r=n.indexOf(e.currentTarget);if(r<0||n.length===0)return;e.preventDefault();let i=e.key===`Home`?0:e.key===`End`?n.length-1:(r+(e.key===`ArrowRight`||e.key===`ArrowDown`?1:-1)+n.length)%n.length;n[i]?.focus(),n[i]?.click()}return(0,r.jsxs)(`button`,{role:`tab`,type:`button`,id:g,"aria-controls":_,"aria-selected":m,tabIndex:m?0:-1,onClick:()=>d(n),onKeyDown:v,className:e.t(`relative text-sm font-medium cursor-pointer transition-colors`,f===`vertical`?`flex items-center gap-2 w-full px-3 py-2 rounded-md text-left`:`px-3 py-1.5 rounded-md`,t.s,m?`text-foreground`:`text-muted-foreground hover:text-foreground`,i),...l,children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:e.t(`absolute inset-0 rounded-md border transition-opacity duration-200 motion-reduce:transition-none`,m?`border-border bg-surface shadow-xs opacity-100`:`border-transparent opacity-0`)}),s&&(0,r.jsx)(`span`,{className:`relative z-10 shrink-0 opacity-70`,children:s}),(0,r.jsx)(`span`,{className:`relative z-10`,children:o})]})}function l({value:t,className:n,children:i,...o}){let{active:s,orientation:c,tabsId:l}=a(),u=encodeURIComponent(t);return s===t?(0,r.jsx)(`div`,{role:`tabpanel`,id:`${l}-panel-${u}`,"aria-labelledby":`${l}-tab-${u}`,tabIndex:0,"data-orientation":c,className:e.t(`rui-tabs-content`,c===`vertical`?`flex-1 min-w-0`:`mt-4`,n),...o,children:i},t):null}exports.Tabs=o,exports.TabsContent=l,exports.TabsList=s,exports.TabsTrigger=c;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HTMLMotionProps } from 'framer-motion';
|
|
2
1
|
import { HTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
2
|
export interface TabsProps {
|
|
4
3
|
defaultValue: string;
|
|
@@ -6,17 +5,20 @@ export interface TabsProps {
|
|
|
6
5
|
children: ReactNode;
|
|
7
6
|
className?: string;
|
|
8
7
|
orientation?: "horizontal" | "vertical";
|
|
8
|
+
/** Preferred — called when the active tab changes. */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
/** @deprecated Use onValueChange */
|
|
9
11
|
onChange?: (value: string) => void;
|
|
10
12
|
}
|
|
11
|
-
export declare function Tabs({ defaultValue, value, children, className, orientation, onChange, }: TabsProps): import("react").JSX.Element;
|
|
13
|
+
export declare function Tabs({ defaultValue, value, children, className, orientation, onValueChange, onChange, }: TabsProps): import("react").JSX.Element;
|
|
12
14
|
export declare function TabsList({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
13
15
|
export interface TabsTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
16
|
value: string;
|
|
15
17
|
icon?: ReactNode;
|
|
16
18
|
}
|
|
17
19
|
export declare function TabsTrigger({ value, className, children, icon, onKeyDown, ...props }: TabsTriggerProps): import("react").JSX.Element;
|
|
18
|
-
export interface TabsContentProps extends
|
|
20
|
+
export interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
21
|
value: string;
|
|
20
22
|
children?: ReactNode;
|
|
21
23
|
}
|
|
22
|
-
export declare function TabsContent({ value, className, children, ...props }: TabsContentProps): import("react").JSX.Element;
|
|
24
|
+
export declare function TabsContent({ value, className, children, ...props }: TabsContentProps): import("react").JSX.Element | null;
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,120 +1,90 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { s as t } from "../component-styles-C2CbHEEA.js";
|
|
4
|
+
import { createContext as n, useContext as r, useId as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/tabs.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let e =
|
|
7
|
+
var c = n(null);
|
|
8
|
+
function l() {
|
|
9
|
+
let e = r(c);
|
|
11
10
|
if (!e) throw Error("Tabs subcomponents must be inside <Tabs>");
|
|
12
11
|
return e;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
let [
|
|
16
|
-
return /* @__PURE__ */ c
|
|
13
|
+
function u({ defaultValue: t, value: n, children: r, className: s, orientation: l = "horizontal", onValueChange: u, onChange: d }) {
|
|
14
|
+
let [f, p] = a(t), m = n ?? f, h = i();
|
|
15
|
+
return /* @__PURE__ */ o(c.Provider, {
|
|
17
16
|
value: {
|
|
18
|
-
active:
|
|
17
|
+
active: m,
|
|
19
18
|
setActive: (e) => {
|
|
20
|
-
n === void 0 &&
|
|
19
|
+
n === void 0 && p(e), u?.(e), d?.(e);
|
|
21
20
|
},
|
|
22
|
-
orientation:
|
|
23
|
-
tabsId:
|
|
21
|
+
orientation: l,
|
|
22
|
+
tabsId: h
|
|
24
23
|
},
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
className: e(
|
|
24
|
+
children: /* @__PURE__ */ o("div", {
|
|
25
|
+
className: e(l === "vertical" ? "flex flex-col gap-4 sm:flex-row" : "flex flex-col", s),
|
|
27
26
|
children: r
|
|
28
27
|
})
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
let { orientation: i } =
|
|
33
|
-
return /* @__PURE__ */
|
|
30
|
+
function d({ className: t, children: n, ...r }) {
|
|
31
|
+
let { orientation: i } = l();
|
|
32
|
+
return /* @__PURE__ */ o("div", {
|
|
34
33
|
className: e("rounded-[var(--radius-md)] border border-border bg-surface-muted p-1", i === "vertical" ? "flex flex-row sm:flex-col gap-0.5 w-full sm:w-36 sm:shrink-0 overflow-x-auto" : "flex items-center gap-0.5 overflow-x-auto max-w-full scrollbar-none", t),
|
|
35
34
|
role: "tablist",
|
|
36
35
|
...r,
|
|
37
36
|
children: n
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
|
-
function
|
|
41
|
-
let { active:
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
39
|
+
function f({ value: n, className: r, children: i, icon: a, onKeyDown: c, ...u }) {
|
|
40
|
+
let { active: d, setActive: f, orientation: p, tabsId: m } = l(), h = d === n, g = encodeURIComponent(n), _ = `${m}-tab-${g}`, v = `${m}-panel-${g}`;
|
|
41
|
+
function y(e) {
|
|
42
|
+
if (c?.(e), e.defaultPrevented || !(p === "vertical" ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"]).includes(e.key) && e.key !== "Home" && e.key !== "End") return;
|
|
44
43
|
let t = e.currentTarget.closest("[role=\"tablist\"]"), n = Array.from(t?.querySelectorAll("[role=\"tab\"]:not(:disabled)") ?? []), r = n.indexOf(e.currentTarget);
|
|
45
44
|
if (r < 0 || n.length === 0) return;
|
|
46
45
|
e.preventDefault();
|
|
47
46
|
let i = e.key === "Home" ? 0 : e.key === "End" ? n.length - 1 : (r + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + n.length) % n.length;
|
|
48
47
|
n[i]?.focus(), n[i]?.click();
|
|
49
48
|
}
|
|
50
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ s("button", {
|
|
51
50
|
role: "tab",
|
|
52
51
|
type: "button",
|
|
53
|
-
id:
|
|
54
|
-
"aria-controls":
|
|
55
|
-
"aria-selected":
|
|
56
|
-
tabIndex:
|
|
57
|
-
onClick: () =>
|
|
58
|
-
onKeyDown:
|
|
59
|
-
className: e("relative text-sm font-medium cursor-pointer transition-colors",
|
|
52
|
+
id: _,
|
|
53
|
+
"aria-controls": v,
|
|
54
|
+
"aria-selected": h,
|
|
55
|
+
tabIndex: h ? 0 : -1,
|
|
56
|
+
onClick: () => f(n),
|
|
57
|
+
onKeyDown: y,
|
|
58
|
+
className: e("relative text-sm font-medium cursor-pointer transition-colors", p === "vertical" ? "flex items-center gap-2 w-full px-3 py-2 rounded-md text-left" : "px-3 py-1.5 rounded-md", t, h ? "text-foreground" : "text-muted-foreground hover:text-foreground", r),
|
|
60
59
|
...u,
|
|
61
60
|
children: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className: "absolute inset-0 rounded-md border border-border bg-surface shadow-xs"
|
|
65
|
-
transition: {
|
|
66
|
-
type: "spring",
|
|
67
|
-
stiffness: 450,
|
|
68
|
-
damping: 32
|
|
69
|
-
}
|
|
61
|
+
/* @__PURE__ */ o("span", {
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
className: e("absolute inset-0 rounded-md border transition-opacity duration-200 motion-reduce:transition-none", h ? "border-border bg-surface shadow-xs opacity-100" : "border-transparent opacity-0")
|
|
70
64
|
}),
|
|
71
|
-
|
|
65
|
+
a && /* @__PURE__ */ o("span", {
|
|
72
66
|
className: "relative z-10 shrink-0 opacity-70",
|
|
73
|
-
children:
|
|
67
|
+
children: a
|
|
74
68
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ o("span", {
|
|
76
70
|
className: "relative z-10",
|
|
77
|
-
children:
|
|
71
|
+
children: i
|
|
78
72
|
})
|
|
79
73
|
]
|
|
80
74
|
});
|
|
81
75
|
}
|
|
82
|
-
function
|
|
83
|
-
let { active:
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
animate: l === "vertical" ? {
|
|
95
|
-
opacity: 1,
|
|
96
|
-
x: 0
|
|
97
|
-
} : {
|
|
98
|
-
opacity: 1,
|
|
99
|
-
y: 0
|
|
100
|
-
},
|
|
101
|
-
exit: l === "vertical" ? {
|
|
102
|
-
opacity: 0,
|
|
103
|
-
x: -6
|
|
104
|
-
} : {
|
|
105
|
-
opacity: 0,
|
|
106
|
-
y: -4
|
|
107
|
-
},
|
|
108
|
-
transition: { duration: .15 },
|
|
109
|
-
role: "tabpanel",
|
|
110
|
-
id: `${u}-panel-${f}`,
|
|
111
|
-
"aria-labelledby": `${u}-tab-${f}`,
|
|
112
|
-
tabIndex: 0,
|
|
113
|
-
className: e(l === "vertical" ? "flex-1 min-w-0" : "mt-4", i),
|
|
114
|
-
...o,
|
|
115
|
-
children: a
|
|
116
|
-
}, t)
|
|
117
|
-
});
|
|
76
|
+
function p({ value: t, className: n, children: r, ...i }) {
|
|
77
|
+
let { active: a, orientation: s, tabsId: c } = l(), u = encodeURIComponent(t);
|
|
78
|
+
return a === t ? /* @__PURE__ */ o("div", {
|
|
79
|
+
role: "tabpanel",
|
|
80
|
+
id: `${c}-panel-${u}`,
|
|
81
|
+
"aria-labelledby": `${c}-tab-${u}`,
|
|
82
|
+
tabIndex: 0,
|
|
83
|
+
"data-orientation": s,
|
|
84
|
+
className: e("rui-tabs-content", s === "vertical" ? "flex-1 min-w-0" : "mt-4", n),
|
|
85
|
+
...i,
|
|
86
|
+
children: r
|
|
87
|
+
}, t) : null;
|
|
118
88
|
}
|
|
119
89
|
//#endregion
|
|
120
|
-
export {
|
|
90
|
+
export { u as Tabs, p as TabsContent, d as TabsList, f as TabsTrigger };
|
package/dist/components/tag.cjs
CHANGED
|
@@ -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");let t=require("react/jsx-runtime");var n={default:`bg-black/8 dark:bg-white/8 text-slate-700 dark:text-slate-200 border-black/12 dark:border-white/12`,success:`bg-emerald-500/12 text-emerald-400 border-emerald-500/20`,warning:`bg-amber-500/12 text-amber-400 border-amber-500/20`,error:`bg-red-500/12 text-red-400 border-red-500/20`,info:`bg-sky-500/12 text-sky-400 border-sky-500/20`},r={default:`text-slate-500 hover:text-slate-700 dark:hover:text-slate-200`,success:`text-emerald-400 hover:text-emerald-300`,warning:`text-amber-400 hover:text-amber-300`,error:`text-red-400 hover:text-red-300`,info:`text-sky-400 hover:text-sky-300`},i={sm:`px-2 py-0.5 text-xs gap-1 rounded-md`,md:`px-2.5 py-1 text-xs gap-1.5 rounded-lg`};function a({variant:a=`default`,size:o=`md`,onRemove:s,icon:c,disabled:l,className:u,children:d,...f}){return(0,t.jsxs)(`span`,{className:e.t(`inline-flex items-center font-medium border transition-colors`,n[a],i[o],l&&`opacity-50`,u),...f,children:[c&&(0,t.jsx)(`span`,{className:`shrink-0 w-3 h-3 flex items-center justify-center`,children:c}),(0,t.jsx)(`span`,{className:`truncate`,children:d}),s&&!l&&(0,t.jsx)(`button`,{type:`button`,tabIndex:-1,onClick:e=>{e.stopPropagation(),s()},className:e.t(`shrink-0 ml-0.5 transition-colors cursor-pointer`,r[a]),"aria-label":`Remove${typeof d==`string`?` ${d}`:``}`,children:(0,t.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]})}exports.Tag=a;
|
package/dist/components/tag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../terminal-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../terminal-1U0ftG3i.cjs");exports.TerminalBlock=e.n,exports.TerminalEmulator=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../terminal-
|
|
1
|
+
import { n as e, t } from "../terminal-VXdxVoAv.js";
|
|
2
2
|
export { e as TerminalBlock, t as TerminalEmulator };
|
|
@@ -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={sm:`min-h-[64px] px-2 py-1.5 text-xs`,md:`min-h-[88px] px-3 py-2.5 text-sm`,lg:`min-h-[120px] px-4 py-3 text-sm`},a=(0,n.forwardRef)(({className:a,wrapperClassName:o,labelClassName:s,messageClassName:c,label:l,hint:u,error:d,size:f=`md`,id:p,autoComplete:m=`on`,required:h,...g},_)=>{let v=(0,n.useId)(),y=p??v,b=`${y}-message`;return(0,r.jsxs)(`div`,{className:e.t(t.o,o),children:[l&&(0,r.jsxs)(`label`,{htmlFor:y,className:e.t(`text-xs font-semibold leading-5 text-foreground`,s),children:[l,h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsx)(`textarea`,{ref:_,id:y,required:h,"aria-invalid":d?!0:void 0,"aria-describedby":d||u?b:void 0,autoComplete:m,className:e.t(`w-full rounded-[var(--radius-md)] text-foreground placeholder:text-muted-foreground outline-none resize-y`,t.t,i[f],`focus:border-accent-500 focus:ring-[3px] focus:ring-focus-ring/25`,d&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,`disabled:cursor-not-allowed disabled:opacity-50`,a),...g}),d&&(0,r.jsx)(`p`,{id:b,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,c),children:d}),u&&!d&&(0,r.jsx)(`p`,{id:b,className:e.t(`text-xs leading-5 text-muted-foreground`,c),children:u})]})});a.displayName=`Textarea`,exports.Textarea=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { o as t, t as n } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { o as t, t as n } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { forwardRef as r, useId as i } from "react";
|
|
5
5
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/textarea.tsx
|
|
@@ -32,7 +32,7 @@ var c = {
|
|
|
32
32
|
"aria-invalid": m ? !0 : void 0,
|
|
33
33
|
"aria-describedby": m || p ? C : void 0,
|
|
34
34
|
autoComplete: _,
|
|
35
|
-
className: e("w-full rounded-[var(--radius-md)] text-foreground placeholder:text-muted-foreground outline-none resize-y", n, c[h], "focus:border-accent-500 focus:ring-
|
|
35
|
+
className: e("w-full rounded-[var(--radius-md)] text-foreground placeholder:text-muted-foreground outline-none resize-y", n, c[h], "focus:border-accent-500 focus:ring-[3px] focus:ring-focus-ring/25", m && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", "disabled:cursor-not-allowed disabled:opacity-50", r),
|
|
36
36
|
...y
|
|
37
37
|
}),
|
|
38
38
|
m && /* @__PURE__ */ o("p", {
|
|
@@ -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");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.createContext)(null);function i(){return typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function a(...e){let t={};for(let n of e)if(n){for(let[e,r]of Object.entries(n.accent??{}))t[`--color-blue-${e}`]=r,t[`--color-accent-${e}`]=r;for(let[e,r]of Object.entries(n.neutral??{}))t[`--color-slate-${e}`]=r,t[`--color-gray-${e}`]=r;if(n.colors&&(n.colors.bg!==void 0&&(t[`--color-bg`]=n.colors.bg),n.colors.surface!==void 0&&(t[`--color-surface`]=n.colors.surface),n.colors.surfaceRaised!==void 0&&(t[`--color-surface-raised`]=n.colors.surfaceRaised),n.colors.surfaceMuted!==void 0&&(t[`--color-surface-muted`]=n.colors.surfaceMuted),n.colors.border!==void 0&&(t[`--color-border`]=n.colors.border),n.colors.borderStrong!==void 0&&(t[`--color-border-strong`]=n.colors.borderStrong),n.colors.text!==void 0&&(t[`--color-text`]=n.colors.text,t[`--color-foreground`]=n.colors.text),n.colors.muted!==void 0&&(t[`--color-muted`]=n.colors.muted),n.colors.mutedForeground!==void 0&&(t[`--color-muted-foreground`]=n.colors.mutedForeground),n.colors.primary!==void 0&&(t[`--color-primary`]=n.colors.primary),n.colors.primaryHover!==void 0&&(t[`--color-primary-hover`]=n.colors.primaryHover),n.colors.primaryForeground!==void 0&&(t[`--color-primary-foreground`]=n.colors.primaryForeground),n.colors.danger!==void 0&&(t[`--color-danger`]=n.colors.danger,t[`--color-destructive`]=n.colors.danger),n.colors.dangerForeground!==void 0&&(t[`--color-destructive-foreground`]=n.colors.dangerForeground),n.colors.success!==void 0&&(t[`--color-success`]=n.colors.success),n.colors.warning!==void 0&&(t[`--color-warning`]=n.colors.warning),n.colors.info!==void 0&&(t[`--color-info`]=n.colors.info),n.colors.focusRing!==void 0&&(t[`--color-focus-ring`]=n.colors.focusRing)),n.radius)for(let[e,r]of Object.entries(n.radius))t[`--radius-${e}`]=r;if(n.fonts&&(n.fonts.sans!==void 0&&(t[`--font-sans`]=n.fonts.sans,t[`--rui-font-family`]=n.fonts.sans,t[`--rtui-font-family`]=n.fonts.sans),n.fonts.mono!==void 0&&(t[`--font-mono`]=n.fonts.mono),n.fonts.display!==void 0&&(t[`--font-display`]=n.fonts.display,t[`--rui-heading-family`]=n.fonts.display,t[`--rtui-heading-family`]=n.fonts.display),n.fonts.heading!==void 0&&(t[`--rui-heading-family`]=n.fonts.heading,t[`--rtui-heading-family`]=n.fonts.heading)),n.spacing)for(let[e,r]of Object.entries(n.spacing))t[`--spacing-${e}`]=r,t[`--padding-${e}`]=r;if(n.shadows)for(let[e,r]of Object.entries(n.shadows))t[`--shadow-${e}`]=r;Object.assign(t,n.tokens)}return t}function o({children:o,defaultTheme:s=`system`,theme:c,onThemeChange:l,storageKey:u=`rui-theme`,palette:d,lightPalette:f,darkPalette:p,applyToRoot:m=!1,className:h,style:g,..._}){let[v,y]=(0,t.useState)(()=>{if(c||!u||typeof window>`u`)return s;let e=window.localStorage.getItem(u)??(u===`rui-theme`?window.localStorage.getItem(`rtui-theme`):null);return e===`light`||e===`dark`||e===`system`?e:s}),[b,x]=(0,t.useState)(i),S=c??v,C=S===`system`?b:S;(0,t.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>x(e.matches?`dark`:`light`);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let w=(0,t.useCallback)(e=>{c||y(e),u&&window.localStorage.setItem(u,e),l?.(e)},[c,l,u]),T=(0,t.useCallback)(()=>{w(C===`dark`?`light`:`dark`)},[C,w]),E=(0,t.useMemo)(()=>({theme:S,resolvedTheme:C,setTheme:w,toggleTheme:T}),[C,w,S,T]),D=(0,t.useMemo)(()=>a(d,C===`dark`?p:f),[p,f,d,C]),O={...D,...g};return(0,t.useEffect)(()=>{if(!m)return;let e=document.documentElement,t=e.classList.contains(`dark`),n=e.classList.contains(`rui-theme`),r=e.classList.contains(`rtui-theme`),i=e.dataset.theme,a=e.style.colorScheme,o=Object.keys(D).map(t=>[t,e.style.getPropertyValue(t)]);e.classList.toggle(`dark`,C===`dark`),e.classList.add(`rui-theme`,`rtui-theme`),e.dataset.theme=C,e.style.colorScheme=C;for(let[t,n]of Object.entries(D))e.style.setProperty(t,String(n));return()=>{e.classList.toggle(`dark`,t),e.classList.toggle(`rui-theme`,n),e.classList.toggle(`rtui-theme`,r),i===void 0?delete e.dataset.theme:e.dataset.theme=i,e.style.colorScheme=a;for(let[t,n]of o)n?e.style.setProperty(t,n):e.style.removeProperty(t)}},[m,D,C]),(0,n.jsx)(r.Provider,{value:E,children:(0,n.jsx)(`div`,{"data-theme":C,"data-theme-preference":S,className:e.t(`rui-theme rtui-theme`,C===`dark`&&`dark`,h),style:{colorScheme:C,...O},..._,children:o})})}function s(){let e=(0,t.useContext)(r);if(!e)throw Error(`useTheme must be used inside a ThemeProvider`);return e}exports.ThemeProvider=o,exports.useTheme=s;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
3
|
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
4
4
|
import { jsx as s } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/theme-provider.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs"),n=require("../icons-Dfetr1L2.cjs"),r=require("./theme-provider.cjs");let i=require("react/jsx-runtime");function a({lightIcon:a=(0,i.jsx)(n.r,{"aria-hidden":`true`}),darkIcon:o=(0,i.jsx)(n.n,{"aria-hidden":`true`}),showLabel:s=!1,lightLabel:c=`Use light theme`,darkLabel:l=`Use dark theme`,className:u,onClick:d,type:f=`button`,...p}){let{resolvedTheme:m,toggleTheme:h}=r.useTheme(),g=m===`dark`,_=g?c:l;return(0,i.jsxs)(`button`,{type:f,"aria-label":_,title:_,"aria-pressed":g,"data-theme":m,className:e.t(`inline-flex h-9 items-center justify-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface px-3 text-sm font-medium text-foreground shadow-xs transition-colors`,`hover:border-border-strong hover:bg-surface-muted`,t.s,!s&&`w-9 px-0 [&_svg]:size-4`,s&&`[&_svg]:size-4`,u),onClick:e=>{d?.(e),e.defaultPrevented||h()},...p,children:[(0,i.jsx)(`span`,{"aria-hidden":`true`,children:g?a:o}),s&&(0,i.jsx)(`span`,{children:_})]})}exports.ThemeToggle=a;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../
|
|
3
|
-
import "
|
|
4
|
-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { s as t } from "../component-styles-C2CbHEEA.js";
|
|
4
|
+
import { n, r } from "../icons-Dk7VZ4Ph.js";
|
|
5
|
+
import { useTheme as i } from "./theme-provider.js";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/theme-toggle.tsx
|
|
8
|
+
function s({ lightIcon: s = /* @__PURE__ */ a(r, { "aria-hidden": "true" }), darkIcon: c = /* @__PURE__ */ a(n, { "aria-hidden": "true" }), showLabel: l = !1, lightLabel: u = "Use light theme", darkLabel: d = "Use dark theme", className: f, onClick: p, type: m = "button", ...h }) {
|
|
9
|
+
let { resolvedTheme: g, toggleTheme: _ } = i(), v = g === "dark", y = v ? u : d;
|
|
10
|
+
return /* @__PURE__ */ o("button", {
|
|
11
|
+
type: m,
|
|
12
|
+
"aria-label": y,
|
|
13
|
+
title: y,
|
|
14
|
+
"aria-pressed": v,
|
|
15
|
+
"data-theme": g,
|
|
16
|
+
className: e("inline-flex h-9 items-center justify-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface px-3 text-sm font-medium text-foreground shadow-xs transition-colors", "hover:border-border-strong hover:bg-surface-muted", t, !l && "w-9 px-0 [&_svg]:size-4", l && "[&_svg]:size-4", f),
|
|
17
|
+
onClick: (e) => {
|
|
18
|
+
p?.(e), e.defaultPrevented || _();
|
|
19
|
+
},
|
|
20
|
+
...h,
|
|
21
|
+
children: [/* @__PURE__ */ a("span", {
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
children: v ? s : c
|
|
24
|
+
}), l && /* @__PURE__ */ a("span", { children: y })]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { s as ThemeToggle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:`h-8 px-2.5 text-xs`,md:`h-9 px-3 text-sm`,lg:`h-10 px-3.5 text-sm`},a={bottom:`top-full mt-1.5`,top:`bottom-full mb-1.5`},o=e=>String(e).padStart(2,`0`);function s(e){if(!e)return null;let t=/^(?:([01]\d|2[0-3])):([0-5]\d)(?::([0-5]\d))?$/.exec(e);return t?{hour:Number(t[1]),minute:Number(t[2]),second:Number(t[3]??0)}:null}function c(e){return e.hour*3600+e.minute*60+e.second}function l(e,t){let n=`${o(e.hour)}:${o(e.minute)}`;return t?`${n}:${o(e.second)}`:n}function u(e,t,n){let r=s(e);if(!r)return``;let i=o(r.minute),a=n?`:${o(r.second)}`:``;if(t===`24`)return`${o(r.hour)}:${i}${a}`;let c=r.hour>=12?`PM`:`AM`;return`${r.hour%12||12}:${i}${a} ${c}`}function d(e){let t=new Date,n=Math.floor(59/e)*e;return{hour:t.getHours(),minute:Math.min(n,Math.round(t.getMinutes()/e)*e),second:t.getSeconds()}}function f({label:n,name:i,options:a,value:o,onSelect:s}){let c=`${i}-label`;function l(e,t){if(![`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key))return;e.preventDefault();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];r&&(s(r.value),e.currentTarget.closest(`[data-time-column]`)?.querySelectorAll(`[role="option"]`)[n]?.focus())}return(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`p`,{id:c,className:`mb-1.5 truncate text-center text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:n}),(0,r.jsx)(`div`,{role:`listbox`,"aria-labelledby":c,"data-time-column":i,className:`max-h-44 min-w-0 overflow-y-auto overscroll-contain rounded-[var(--radius-md)] border border-border bg-surface p-1 scrollbar-thin`,children:a.map((n,i)=>{let a=n.value===o;return(0,r.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":a,tabIndex:a?0:-1,onClick:()=>s(n.value),onKeyDown:e=>l(e,i),className:e.t(`flex h-9 w-full items-center justify-center rounded-[var(--radius-sm)] px-1 text-xs tabular-nums transition-colors`,t.s,a?`bg-primary font-semibold text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:n.label},n.value)})})]})}var p=(0,n.forwardRef)(({label:p,hint:m,error:h,value:g,defaultValue:ee=``,onValueChange:_,format:v=`12`,minuteStep:y=5,showSeconds:b=!1,min:te,max:ne,name:x,disabled:S=!1,required:C=!1,clearable:w=!0,placeholder:re=`Select time…`,size:ie=`md`,side:ae=`bottom`,triggerClassName:oe,panelClassName:se,labelClassName:T,messageClassName:E,className:ce,id:le,onBlur:D,...O},k)=>{let A=(0,n.useId)(),j=le??A,M=`${j}-panel`,N=`${j}-message`,P=(0,n.useRef)(null),F=(0,n.useRef)(null);(0,n.useImperativeHandle)(k,()=>F.current);let I=Number.isFinite(y)?Math.max(1,Math.min(30,Math.floor(y))):5,L=e=>{let t=s(e);return t?l(t,b):``},[R,z]=(0,n.useState)(()=>L(ee)),B=L(g??R),[V,H]=(0,n.useState)(!1),[U,W]=(0,n.useState)(()=>s(B)??d(I)),ue=Array.from({length:24},(e,t)=>({value:t,label:o(t)})),de=Array.from({length:12},(e,t)=>({value:t+1,label:o(t+1)})),fe=Array.from({length:Math.floor(59/I)+1},(e,t)=>{let n=t*I;return{value:n,label:o(n)}}),pe=Array.from({length:60},(e,t)=>({value:t,label:o(t)})),me=[{value:0,label:`AM`},{value:1,label:`PM`}],G=s(te),K=s(ne),q=c(U),J=G?q<c(G):!1,he=K?q>c(K):!1,Y=J||he,X=u(B,v,b);function Z(){S||(W(s(B)??d(I)),H(!0))}function Q(e=!1){H(!1),e&&F.current?.focus()}function $(e){g===void 0&&z(e),_?.(e),Q(!0)}return(0,n.useEffect)(()=>{if(!V)return;let e=e=>{P.current?.contains(e.target)||Q()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[V]),(0,n.useEffect)(()=>{V&&requestAnimationFrame(()=>{P.current?.querySelector(`[data-time-column="hour"] [aria-selected="true"]`)?.focus()})},[V]),(0,r.jsxs)(`div`,{ref:P,className:e.t(`relative`,t.o,ce),onBlur:e=>{D?.(e),e.currentTarget.contains(e.relatedTarget)||Q()},onKeyDown:e=>{e.key===`Escape`&&V&&(e.preventDefault(),Q(!0))},...O,children:[p&&(0,r.jsxs)(`label`,{htmlFor:j,className:e.t(`text-xs font-semibold leading-5 text-foreground`,T),children:[p,C&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsxs)(`button`,{ref:F,id:j,type:`button`,disabled:S,"aria-expanded":V,"aria-haspopup":`dialog`,"aria-controls":M,"aria-invalid":h?!0:void 0,"aria-required":C||void 0,"aria-describedby":h||m?N:void 0,onClick:()=>V?Q():Z(),onKeyDown:e=>{e.key===`ArrowDown`&&!V&&(e.preventDefault(),Z())},className:e.t(`flex w-full min-w-0 items-center gap-2 rounded-[var(--radius-md)] text-left`,t.t,t.s,h&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,i[ie],oe),children:[(0,r.jsxs)(`svg`,{"aria-hidden":`true`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`shrink-0 text-muted-foreground`,children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`path`,{d:`M12 7v5l3 2`})]}),(0,r.jsx)(`span`,{className:e.t(`min-w-0 flex-1 truncate`,X?`text-foreground`:`text-muted-foreground`),children:X||re}),(0,r.jsx)(`svg`,{"aria-hidden":`true`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:e.t(`shrink-0 text-muted-foreground transition-transform`,V&&`rotate-180`),children:(0,r.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),x&&(0,r.jsx)(`input`,{type:`hidden`,name:x,value:B,disabled:S}),V&&(0,r.jsxs)(`div`,{id:M,role:`dialog`,"aria-label":p?`Choose ${p.toLowerCase()}`:`Choose time`,className:e.t(`absolute left-0 z-50 w-[min(22rem,calc(100vw-2rem))] max-h-[min(30rem,calc(100dvh-2rem))] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised p-3 shadow-floating`,a[ae],se),children:[(0,r.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:`Choose time`}),(0,r.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[v===`12`?`12-hour`:`24-hour`,` format`]})]}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>W(d(I)),className:e.t(`h-8 rounded-md px-2.5 text-xs font-medium text-accent-700 hover:bg-muted dark:text-accent-300`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:`Now`})]}),(0,r.jsxs)(`div`,{className:e.t(`grid gap-2`,v===`12`&&b?`grid-cols-4`:b||v===`12`?`grid-cols-3`:`grid-cols-2`),children:[(0,r.jsx)(f,{label:`Hour`,name:`hour`,options:v===`24`?ue:de,value:v===`24`?U.hour:U.hour%12||12,onSelect:e=>W(t=>({...t,hour:v===`24`?e:e%12+(t.hour>=12?12:0)}))}),(0,r.jsx)(f,{label:`Minute`,name:`minute`,options:fe,value:U.minute,onSelect:e=>W(t=>({...t,minute:e}))}),b&&(0,r.jsx)(f,{label:`Second`,name:`second`,options:pe,value:U.second,onSelect:e=>W(t=>({...t,second:e}))}),v===`12`&&(0,r.jsx)(f,{label:`Period`,name:`period`,options:me,value:+(U.hour>=12),onSelect:e=>W(t=>({...t,hour:t.hour%12+e*12}))})]}),Y&&(0,r.jsxs)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:[`Choose a time `,J?`at or after ${u(l(G,b),v,b)}`:`at or before ${u(l(K,b),v,b)}`,`.`]}),(0,r.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-end gap-2 border-t border-border pt-3`,children:[w&&!C&&B&&(0,r.jsx)(`button`,{type:`button`,onClick:()=>$(``),className:e.t(`mr-auto h-8 rounded-md px-2.5 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:`Clear`}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>Q(!0),className:e.t(`h-8 rounded-md px-3 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:`Cancel`}),(0,r.jsx)(`button`,{type:`button`,disabled:Y,onClick:()=>$(l(U,b)),className:e.t(`h-8 rounded-md bg-primary px-3 text-xs font-semibold text-primary-foreground hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-40`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:`Apply`})]})]}),h&&(0,r.jsx)(`p`,{id:N,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,E),children:h}),m&&!h&&(0,r.jsx)(`p`,{id:N,className:e.t(`text-xs leading-5 text-muted-foreground`,E),children:m})]})});p.displayName=`TimePicker`,exports.TimePicker=p;
|
|
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={sm:`h-10 px-2.5 text-xs sm:h-8`,md:`h-11 px-3 text-sm sm:h-9`,lg:`h-12 px-3.5 text-sm sm:h-10`},a=e=>String(e).padStart(2,`0`);function o(e){if(!e)return null;let t=/^(?:([01]\d|2[0-3])):([0-5]\d)(?::([0-5]\d))?$/.exec(e);return t?{hour:Number(t[1]),minute:Number(t[2]),second:Number(t[3]??0)}:null}function s(e){return e.hour*3600+e.minute*60+e.second}function c(e,t){let n=`${a(e.hour)}:${a(e.minute)}`;return t?`${n}:${a(e.second)}`:n}function l(e,t,n){let r=o(e);if(!r)return``;let i=a(r.minute),s=n?`:${a(r.second)}`:``;if(t===`24`)return`${a(r.hour)}:${i}${s}`;let c=r.hour>=12?`PM`:`AM`;return`${r.hour%12||12}:${i}${s} ${c}`}function u(e){let t=new Date,n=Math.floor(59/e)*e;return{hour:t.getHours(),minute:Math.min(n,Math.round(t.getMinutes()/e)*e),second:t.getSeconds()}}function d(e,t,n){let r=Math.floor(59/t)*t;return{...e,minute:Math.min(r,Math.round(e.minute/t)*t),second:n?e.second:0}}function f({label:n,id:i,name:a,options:o,value:s,onSelect:c}){let l=`${i}-label`;function u(e,t){if(![`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key))return;e.preventDefault();let n=e.key===`Home`?0:e.key===`End`?o.length-1:(t+(e.key===`ArrowDown`?1:-1)+o.length)%o.length,r=o[n];r&&(c(r.value),e.currentTarget.closest(`[data-time-column]`)?.querySelectorAll(`[role="option"]`)[n]?.focus())}return(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`p`,{id:l,className:`mb-1.5 truncate text-center text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:n}),(0,r.jsx)(`div`,{role:`listbox`,"aria-labelledby":l,"data-time-column":a,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`,children:o.map((n,i)=>{let a=n.value===s;return(0,r.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":a,tabIndex:a?0:-1,onClick:()=>c(n.value),onKeyDown:e=>u(e,i),className:e.t(`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`,t.s,a?`bg-primary font-semibold text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:n.label},n.value)})})]})}var p=(0,n.forwardRef)(({label:p,hint:m,error:h,value:g,defaultValue:ee=``,onValueChange:te,format:_=`12`,minuteStep:v=5,showSeconds:y=!1,min:ne,max:re,name:b,disabled:x=!1,required:S=!1,clearable:C=!0,placeholder:ie=`Select time…`,size:ae=`md`,side:w=`bottom`,align:T=`start`,triggerClassName:oe,panelClassName:se,labelClassName:ce,messageClassName:E,className:D,id:O,onBlur:le,onKeyDown:ue,...de},fe)=>{let pe=(0,n.useId)(),k=O??pe,A=`${k}-panel`,j=`${k}-message`,M=(0,n.useRef)(null),N=(0,n.useRef)(null),P=(0,n.useRef)(null);(0,n.useImperativeHandle)(fe,()=>N.current);let F=Number.isFinite(v)?Math.max(1,Math.min(30,Math.floor(v))):5,I=e=>{let t=o(e);return t?c(t,y):``},[L,R]=(0,n.useState)(()=>I(ee)),z=I(g??L),[B,V]=(0,n.useState)(!1),[me,H]=(0,n.useState)({visibility:`hidden`}),[U,W]=(0,n.useState)(()=>d(o(z)??u(F),F,y)),he=Array.from({length:24},(e,t)=>({value:t,label:a(t)})),ge=Array.from({length:12},(e,t)=>({value:t+1,label:a(t+1)})),_e=Array.from({length:Math.floor(59/F)+1},(e,t)=>{let n=t*F;return{value:n,label:a(n)}}),ve=Array.from({length:60},(e,t)=>({value:t,label:a(t)})),ye=[{value:0,label:`AM`},{value:1,label:`PM`}],G=o(ne),K=o(re),q=s(U),J=G?q<s(G):!1,be=K?q>s(K):!1,Y=J||be,X=l(z,_,y);function Z(){x||(W(d(o(z)??u(F),F,y)),H({visibility:`hidden`}),V(!0))}function Q(e=!1){V(!1),e&&N.current?.focus()}function $(e){g===void 0&&R(e),te?.(e),Q(!0)}return(0,n.useEffect)(()=>{if(!B)return;let e=e=>{M.current?.contains(e.target)||Q()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[B]),(0,n.useLayoutEffect)(()=>{if(!B)return;let e=()=>{let e=N.current,t=P.current;if(!e||!t)return;if(window.innerWidth<640){H({insetInline:8,bottom:8,top:`auto`,width:`auto`,visibility:`visible`});return}let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=T===`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=w===`bottom`?l||!u?s:c:u||!l?c:s,f=Math.max(16,window.innerHeight-r.height-16);H({left:o,top:Math.min(Math.max(d,16),f),visibility:`visible`})};return e(),window.addEventListener(`resize`,e),document.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),document.removeEventListener(`scroll`,e,!0)}},[T,B,w]),(0,n.useEffect)(()=>{if(!B||window.innerWidth>=640)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[B]),(0,n.useEffect)(()=>{B&&requestAnimationFrame(()=>{let e=M.current?.querySelector(`[data-time-column="hour"] [aria-selected="true"]`),t=e?.closest(`[role="listbox"]`);e?.focus({preventScroll:!0}),e&&t&&(t.scrollTop=e.offsetTop-t.clientHeight/2+e.clientHeight/2)})},[B]),(0,r.jsxs)(`div`,{ref:M,className:e.t(`relative`,t.o,D),onBlur:e=>{le?.(e),e.currentTarget.contains(e.relatedTarget)||Q()},onKeyDown:e=>{ue?.(e),!e.defaultPrevented&&e.key===`Escape`&&B&&(e.preventDefault(),Q(!0))},...de,children:[p&&(0,r.jsxs)(`label`,{htmlFor:k,className:e.t(`text-xs font-semibold leading-5 text-foreground`,ce),children:[p,S&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsxs)(`button`,{ref:N,id:k,type:`button`,disabled:x,"aria-expanded":B,"aria-haspopup":`dialog`,"aria-controls":A,"aria-invalid":h?!0:void 0,"aria-required":S||void 0,"aria-describedby":h||m?j:void 0,onClick:()=>B?Q():Z(),onKeyDown:e=>{e.key===`ArrowDown`&&!B&&(e.preventDefault(),Z())},className:e.t(`flex w-full min-w-0 items-center gap-2 rounded-[var(--radius-md)] text-left`,t.t,t.s,h&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,i[ae],oe),children:[(0,r.jsxs)(`svg`,{"aria-hidden":`true`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`shrink-0 text-muted-foreground`,children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`path`,{d:`M12 7v5l3 2`})]}),(0,r.jsx)(`span`,{className:e.t(`min-w-0 flex-1 truncate`,X?`text-foreground`:`text-muted-foreground`),children:X||ie}),(0,r.jsx)(`svg`,{"aria-hidden":`true`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:e.t(`shrink-0 text-muted-foreground transition-transform`,B&&`rotate-180`),children:(0,r.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),b&&(0,r.jsx)(`input`,{type:`hidden`,name:b,value:z,disabled:x}),B&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`div`,{"aria-hidden":`true`,className:`fixed inset-0 z-40 bg-overlay sm:hidden`,onMouseDown:()=>Q(!0)}),(0,r.jsxs)(`div`,{ref:P,id:A,role:`dialog`,"aria-label":p?`Choose ${p.toLowerCase()}`:`Choose time`,"data-side":w,"data-align":T,style:me,className:e.t(`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`,se),children:[(0,r.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:`Choose time`}),(0,r.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[_===`12`?`12-hour`:`24-hour`,` format`]})]}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>W(d(u(F),F,y)),className:e.t(`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`),children:`Now`})]}),(0,r.jsx)(`div`,{"aria-live":`polite`,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`,children:l(c(U,y),_,y)}),(0,r.jsxs)(`div`,{className:e.t(`grid gap-2`,_===`12`&&y?`grid-cols-4`:y||_===`12`?`grid-cols-3`:`grid-cols-2`),children:[(0,r.jsx)(f,{label:`Hour`,id:`${k}-hour`,name:`hour`,options:_===`24`?he:ge,value:_===`24`?U.hour:U.hour%12||12,onSelect:e=>W(t=>({...t,hour:_===`24`?e:e%12+(t.hour>=12?12:0)}))}),(0,r.jsx)(f,{id:`${k}-minute`,label:`Minute`,name:`minute`,options:_e,value:U.minute,onSelect:e=>W(t=>({...t,minute:e}))}),y&&(0,r.jsx)(f,{id:`${k}-second`,label:`Second`,name:`second`,options:ve,value:U.second,onSelect:e=>W(t=>({...t,second:e}))}),_===`12`&&(0,r.jsx)(f,{id:`${k}-period`,label:`Period`,name:`period`,options:ye,value:+(U.hour>=12),onSelect:e=>W(t=>({...t,hour:t.hour%12+e*12}))})]}),Y&&(0,r.jsxs)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:[`Choose a time `,J?`at or after ${l(c(G,y),_,y)}`:`at or before ${l(c(K,y),_,y)}`,`.`]}),(0,r.jsxs)(`div`,{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`,children:[C&&!S&&z&&(0,r.jsx)(`button`,{type:`button`,onClick:()=>$(``),className:e.t(`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`),children:`Clear`}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>Q(!0),className:e.t(`h-11 rounded-md px-3 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground sm:h-8`,`focus-ring`),children:`Cancel`}),(0,r.jsx)(`button`,{type:`button`,disabled:Y,onClick:()=>$(c(U,y)),className:e.t(`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`),children:`Apply`})]})]})]}),h&&(0,r.jsx)(`p`,{id:j,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,E),children:h}),m&&!h&&(0,r.jsx)(`p`,{id:j,className:e.t(`text-xs leading-5 text-muted-foreground`,E),children:m})]})});p.displayName=`TimePicker`,exports.TimePicker=p;
|