@bzync/rui 0.0.3
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/LICENSE +15 -0
- package/README.md +115 -0
- package/dist/autocomplete-CaysJRpk.cjs +1 -0
- package/dist/autocomplete-CfbfpcO4.js +453 -0
- package/dist/calendar-Bnld4G59.cjs +1 -0
- package/dist/calendar-CdICOROs.js +573 -0
- package/dist/charts-CxEy2c3M.js +1248 -0
- package/dist/charts-UDqS1BH1.cjs +1 -0
- package/dist/cn-BdjraxxU.cjs +1 -0
- package/dist/cn-DpgY2leY.js +1736 -0
- package/dist/component-styles-Ce56hn9T.js +16 -0
- package/dist/component-styles-TkZ7v6Ef.cjs +1 -0
- package/dist/components/accordion.cjs +1 -0
- package/dist/components/accordion.d.ts +22 -0
- package/dist/components/accordion.js +122 -0
- package/dist/components/alert.cjs +1 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.js +165 -0
- package/dist/components/auth-backdrop.cjs +1 -0
- package/dist/components/auth-backdrop.d.ts +7 -0
- package/dist/components/auth-backdrop.js +10 -0
- package/dist/components/autocomplete/dropdown.d.ts +21 -0
- package/dist/components/autocomplete/icons.d.ts +8 -0
- package/dist/components/autocomplete/multi-trigger.d.ts +25 -0
- package/dist/components/autocomplete/single-trigger.d.ts +21 -0
- package/dist/components/autocomplete/types.d.ts +34 -0
- package/dist/components/autocomplete.cjs +1 -0
- package/dist/components/autocomplete.d.ts +5 -0
- package/dist/components/autocomplete.js +3 -0
- package/dist/components/avatar.cjs +1 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +56 -0
- package/dist/components/badge.cjs +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +32 -0
- package/dist/components/billing-interval-toggle.cjs +1 -0
- package/dist/components/billing-interval-toggle.d.ts +18 -0
- package/dist/components/billing-interval-toggle.js +39 -0
- package/dist/components/breadcrumb.cjs +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/button.cjs +1 -0
- package/dist/components/button.d.ts +17 -0
- package/dist/components/button.js +90 -0
- package/dist/components/calendar/month-view.d.ts +17 -0
- package/dist/components/calendar/types.d.ts +54 -0
- package/dist/components/calendar/week-view.d.ts +17 -0
- package/dist/components/calendar.cjs +1 -0
- package/dist/components/calendar.d.ts +3 -0
- package/dist/components/calendar.js +3 -0
- package/dist/components/callout.cjs +1 -0
- package/dist/components/callout.d.ts +9 -0
- package/dist/components/callout.js +131 -0
- package/dist/components/card.cjs +1 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +59 -0
- package/dist/components/charts/bar-chart.d.ts +16 -0
- package/dist/components/charts/donut-chart.d.ts +10 -0
- package/dist/components/charts/funnel-chart.d.ts +8 -0
- package/dist/components/charts/gantt-chart.d.ts +15 -0
- package/dist/components/charts/heatmap-chart.d.ts +10 -0
- package/dist/components/charts/index.d.ts +11 -0
- package/dist/components/charts/line-chart.d.ts +16 -0
- package/dist/components/charts/multi-line-chart.d.ts +18 -0
- package/dist/components/charts/radar-chart.d.ts +13 -0
- package/dist/components/charts/scatter-chart.d.ts +24 -0
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts/waterfall-chart.d.ts +14 -0
- package/dist/components/charts.cjs +1 -0
- package/dist/components/charts.d.ts +2 -0
- package/dist/components/charts.js +2 -0
- package/dist/components/checkbox.cjs +1 -0
- package/dist/components/checkbox.d.ts +9 -0
- package/dist/components/checkbox.js +135 -0
- package/dist/components/code.cjs +7 -0
- package/dist/components/code.d.ts +23 -0
- package/dist/components/code.js +276 -0
- package/dist/components/command.cjs +1 -0
- package/dist/components/command.d.ts +29 -0
- package/dist/components/command.js +208 -0
- package/dist/components/confirm-dialog.cjs +1 -0
- package/dist/components/confirm-dialog.d.ts +14 -0
- package/dist/components/confirm-dialog.js +69 -0
- package/dist/components/copy-button.cjs +1 -0
- package/dist/components/copy-button.d.ts +8 -0
- package/dist/components/copy-button.js +87 -0
- package/dist/components/datatable/pagination-footer.d.ts +10 -0
- package/dist/components/datatable/rows-dropdown.d.ts +5 -0
- package/dist/components/datatable/skeleton-row.d.ts +3 -0
- package/dist/components/datatable/sort-icon.d.ts +4 -0
- package/dist/components/datatable/types.d.ts +30 -0
- package/dist/components/datatable.cjs +1 -0
- package/dist/components/datatable.d.ts +9 -0
- package/dist/components/datatable.js +3 -0
- package/dist/components/datepicker.cjs +1 -0
- package/dist/components/datepicker.d.ts +14 -0
- package/dist/components/datepicker.js +267 -0
- package/dist/components/drawer.cjs +1 -0
- package/dist/components/drawer.d.ts +18 -0
- package/dist/components/drawer.js +3 -0
- package/dist/components/dropdown-menu.cjs +1 -0
- package/dist/components/dropdown-menu.d.ts +26 -0
- package/dist/components/dropdown-menu.js +122 -0
- package/dist/components/empty-state.cjs +1 -0
- package/dist/components/empty-state.d.ts +10 -0
- package/dist/components/empty-state.js +68 -0
- package/dist/components/error-state.cjs +1 -0
- package/dist/components/error-state.d.ts +10 -0
- package/dist/components/error-state.js +80 -0
- package/dist/components/file-upload.cjs +1 -0
- package/dist/components/file-upload.d.ts +10 -0
- package/dist/components/file-upload.js +173 -0
- package/dist/components/form-field.cjs +1 -0
- package/dist/components/form-field.d.ts +10 -0
- package/dist/components/form-field.js +36 -0
- package/dist/components/info-button.cjs +1 -0
- package/dist/components/info-button.d.ts +4 -0
- package/dist/components/info-button.js +32 -0
- package/dist/components/input.cjs +1 -0
- package/dist/components/input.d.ts +19 -0
- package/dist/components/input.js +117 -0
- package/dist/components/kbd.cjs +1 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +16 -0
- package/dist/components/label.cjs +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +31 -0
- package/dist/components/layout.cjs +1 -0
- package/dist/components/layout.d.ts +51 -0
- package/dist/components/layout.js +117 -0
- package/dist/components/link.cjs +1 -0
- package/dist/components/link.d.ts +9 -0
- package/dist/components/link.js +48 -0
- package/dist/components/list.cjs +1 -0
- package/dist/components/list.d.ts +13 -0
- package/dist/components/list.js +46 -0
- package/dist/components/modal.cjs +1 -0
- package/dist/components/modal.d.ts +31 -0
- package/dist/components/modal.js +219 -0
- package/dist/components/navigation.cjs +1 -0
- package/dist/components/navigation.d.ts +42 -0
- package/dist/components/navigation.js +127 -0
- package/dist/components/number-input.cjs +1 -0
- package/dist/components/number-input.d.ts +16 -0
- package/dist/components/number-input.js +142 -0
- package/dist/components/otp-input.cjs +1 -0
- package/dist/components/otp-input.d.ts +13 -0
- package/dist/components/otp-input.js +71 -0
- package/dist/components/pagination.cjs +1 -0
- package/dist/components/pagination.d.ts +8 -0
- package/dist/components/pagination.js +77 -0
- package/dist/components/popover.cjs +1 -0
- package/dist/components/popover.d.ts +16 -0
- package/dist/components/popover.js +115 -0
- package/dist/components/progressbar.cjs +1 -0
- package/dist/components/progressbar.d.ts +15 -0
- package/dist/components/progressbar.js +108 -0
- package/dist/components/radio.cjs +1 -0
- package/dist/components/radio.d.ts +22 -0
- package/dist/components/radio.js +96 -0
- package/dist/components/richtext.cjs +1 -0
- package/dist/components/richtext.d.ts +10 -0
- package/dist/components/richtext.js +370 -0
- package/dist/components/select/option-list.d.ts +16 -0
- package/dist/components/select/select-multi.d.ts +2 -0
- package/dist/components/select/select-single.d.ts +2 -0
- package/dist/components/select/types.d.ts +54 -0
- package/dist/components/select/utils.d.ts +10 -0
- package/dist/components/select.cjs +1 -0
- package/dist/components/select.d.ts +3 -0
- package/dist/components/select.js +2 -0
- package/dist/components/seo.cjs +1 -0
- package/dist/components/seo.d.ts +45 -0
- package/dist/components/seo.js +64 -0
- package/dist/components/separator.cjs +1 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +25 -0
- package/dist/components/skeleton.cjs +1 -0
- package/dist/components/skeleton.d.ts +37 -0
- package/dist/components/skeleton.js +146 -0
- package/dist/components/slider.cjs +1 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +72 -0
- package/dist/components/snackbar.cjs +1 -0
- package/dist/components/snackbar.d.ts +35 -0
- package/dist/components/snackbar.js +220 -0
- package/dist/components/spinner.cjs +1 -0
- package/dist/components/spinner.d.ts +7 -0
- package/dist/components/spinner.js +31 -0
- package/dist/components/stat.cjs +1 -0
- package/dist/components/stat.d.ts +18 -0
- package/dist/components/stat.js +90 -0
- package/dist/components/status-dot.cjs +1 -0
- package/dist/components/status-dot.d.ts +10 -0
- package/dist/components/status-dot.js +29 -0
- package/dist/components/stepper.cjs +1 -0
- package/dist/components/stepper.d.ts +11 -0
- package/dist/components/stepper.js +67 -0
- package/dist/components/switch.cjs +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +79 -0
- package/dist/components/table.cjs +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +54 -0
- package/dist/components/tabs.cjs +1 -0
- package/dist/components/tabs.d.ts +22 -0
- package/dist/components/tabs.js +120 -0
- package/dist/components/tag.cjs +1 -0
- package/dist/components/tag.d.ts +12 -0
- package/dist/components/tag.js +58 -0
- package/dist/components/terminal/fs.d.ts +10 -0
- package/dist/components/terminal/shell-commands-sim.d.ts +5 -0
- package/dist/components/terminal/shell-commands.d.ts +16 -0
- package/dist/components/terminal/shell-run.d.ts +11 -0
- package/dist/components/terminal/terminal-block.d.ts +13 -0
- package/dist/components/terminal/terminal-emulator.d.ts +10 -0
- package/dist/components/terminal/types.d.ts +35 -0
- package/dist/components/terminal.cjs +1 -0
- package/dist/components/terminal.d.ts +2 -0
- package/dist/components/terminal.js +2 -0
- package/dist/components/textarea.cjs +1 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +54 -0
- package/dist/components/theme-provider.cjs +1 -0
- package/dist/components/theme-provider.d.ts +89 -0
- package/dist/components/theme-provider.js +93 -0
- package/dist/components/theme-toggle.cjs +1 -0
- package/dist/components/theme-toggle.d.ts +9 -0
- package/dist/components/theme-toggle.js +4 -0
- package/dist/components/timeline.cjs +1 -0
- package/dist/components/timeline.d.ts +14 -0
- package/dist/components/timeline.js +54 -0
- package/dist/components/tooltip.cjs +1 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +84 -0
- package/dist/components/tree.cjs +1 -0
- package/dist/components/tree.d.ts +16 -0
- package/dist/components/tree.js +92 -0
- package/dist/createLucideIcon-DDY8HuQR.js +42 -0
- package/dist/createLucideIcon-b_X_3fj-.cjs +1 -0
- package/dist/datatable-BB3v__r5.cjs +1 -0
- package/dist/datatable-DlBhUhuO.js +316 -0
- package/dist/drawer-Cbuh6qdL.cjs +1 -0
- package/dist/drawer-CqkVZT9Y.js +189 -0
- package/dist/focus-Dk1YWVPN.js +42 -0
- package/dist/focus-DmG6Ge7X.cjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +215 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/component-styles.d.ts +10 -0
- package/dist/select-Ch5fp1GT.js +461 -0
- package/dist/select-q0YCMhBP.cjs +1 -0
- package/dist/styles.css +3 -0
- package/dist/terminal-BOR2cFi1.js +1060 -0
- package/dist/terminal-CpraMs50.cjs +77 -0
- package/dist/theme-toggle-CnoiorKV.js +71 -0
- package/dist/theme-toggle-Dp1-24zH.cjs +1 -0
- package/dist/use-event-callback-DGkfO_uu.js +10 -0
- package/dist/use-event-callback-Du9_9eAi.cjs +1 -0
- package/dist/utils-CQ8pvCtk.js +72 -0
- package/dist/utils-DOFJTw8o.cjs +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={default:`text-accent-400 hover:text-accent-300`,muted:`text-slate-500 hover:text-slate-700 dark:hover:text-slate-200`,underline:`text-slate-700 dark:text-slate-200 underline underline-offset-2 decoration-black/25 dark:decoration-white/25 hover:decoration-black/50 dark:hover:decoration-white/50`};function r({children:r,className:i,external:a,icon:o,variant:s=`default`,externalRel:c,...l}){return(0,t.jsxs)(`a`,{target:a?`_blank`:void 0,rel:a?c??`noopener noreferrer`:void 0,referrerPolicy:a?`strict-origin-when-cross-origin`:void 0,className:e.t(`inline-flex items-center gap-1 transition-colors cursor-pointer`,n[s],i),...l,children:[r,o&&(0,t.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:o}),a&&!o&&(0,t.jsxs)(`svg`,{"aria-hidden":`true`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,t.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}),(0,t.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,t.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]})]})}exports.Link=r;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
+
external?: boolean;
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
variant?: "default" | "muted" | "underline";
|
|
6
|
+
/** Override rel when external; defaults to "noopener noreferrer" */
|
|
7
|
+
externalRel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Link({ children, className, external, icon, variant, externalRel, ...props }: LinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/link.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
default: "text-accent-400 hover:text-accent-300",
|
|
6
|
+
muted: "text-slate-500 hover:text-slate-700 dark:hover:text-slate-200",
|
|
7
|
+
underline: "text-slate-700 dark:text-slate-200 underline underline-offset-2 decoration-black/25 dark:decoration-white/25 hover:decoration-black/50 dark:hover:decoration-white/50"
|
|
8
|
+
};
|
|
9
|
+
function i({ children: i, className: a, external: o, icon: s, variant: c = "default", externalRel: l, ...u }) {
|
|
10
|
+
return /* @__PURE__ */ n("a", {
|
|
11
|
+
target: o ? "_blank" : void 0,
|
|
12
|
+
rel: o ? l ?? "noopener noreferrer" : void 0,
|
|
13
|
+
referrerPolicy: o ? "strict-origin-when-cross-origin" : void 0,
|
|
14
|
+
className: e("inline-flex items-center gap-1 transition-colors cursor-pointer", r[c], a),
|
|
15
|
+
...u,
|
|
16
|
+
children: [
|
|
17
|
+
i,
|
|
18
|
+
s && /* @__PURE__ */ t("span", {
|
|
19
|
+
className: "shrink-0",
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
children: s
|
|
22
|
+
}),
|
|
23
|
+
o && !s && /* @__PURE__ */ n("svg", {
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
width: "11",
|
|
26
|
+
height: "11",
|
|
27
|
+
viewBox: "0 0 24 24",
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: "2",
|
|
31
|
+
strokeLinecap: "round",
|
|
32
|
+
strokeLinejoin: "round",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ t("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
35
|
+
/* @__PURE__ */ t("polyline", { points: "15 3 21 3 21 9" }),
|
|
36
|
+
/* @__PURE__ */ t("line", {
|
|
37
|
+
x1: "10",
|
|
38
|
+
y1: "14",
|
|
39
|
+
x2: "21",
|
|
40
|
+
y2: "3"
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { i as Link };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");function n({divided:n=!0,className:r,children:i,...a}){return(0,t.jsx)(`ul`,{className:e.t(n&&`divide-y divide-black/8 dark:divide-white/8`,r),...a,children:i})}function r({icon:n,trailing:r,description:i,href:a,active:o,className:s,children:c,onClick:l,...u}){let d=(0,t.jsxs)(`div`,{className:e.t(`flex items-center gap-3 px-3 py-2.5 transition-colors rounded-lg`,(!!a||!!l)&&`cursor-pointer hover:bg-black/4 dark:hover:bg-white/4`,o&&`bg-accent-500/8 text-accent-400`),children:[n&&(0,t.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400`,children:n}),(0,t.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,t.jsx)(`p`,{className:e.t(`text-sm font-medium truncate`,o?`text-accent-400`:`text-slate-700 dark:text-slate-200`),children:c}),i&&(0,t.jsx)(`p`,{className:`text-xs text-slate-500 mt-0.5 truncate`,children:i})]}),r&&(0,t.jsx)(`span`,{className:`shrink-0 text-slate-500`,children:r})]});return(0,t.jsx)(`li`,{className:e.t(s),onClick:l,...u,children:a?(0,t.jsx)(`a`,{href:a,children:d}):d})}exports.List=n,exports.ListItem=r;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
|
|
3
|
+
divided?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function List({ divided, className, children, ...props }: ListProps): import("react").JSX.Element;
|
|
6
|
+
export interface ListItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
trailing?: ReactNode;
|
|
9
|
+
description?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function ListItem({ icon, trailing, description, href, active, className, children, onClick, ...props }: ListItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/list.tsx
|
|
4
|
+
function r({ divided: n = !0, className: r, children: i, ...a }) {
|
|
5
|
+
return /* @__PURE__ */ t("ul", {
|
|
6
|
+
className: e(n && "divide-y divide-black/8 dark:divide-white/8", r),
|
|
7
|
+
...a,
|
|
8
|
+
children: i
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function i({ icon: r, trailing: i, description: a, href: o, active: s, className: c, children: l, onClick: u, ...d }) {
|
|
12
|
+
let f = /* @__PURE__ */ n("div", {
|
|
13
|
+
className: e("flex items-center gap-3 px-3 py-2.5 transition-colors rounded-lg", (!!o || !!u) && "cursor-pointer hover:bg-black/4 dark:hover:bg-white/4", s && "bg-accent-500/8 text-accent-400"),
|
|
14
|
+
children: [
|
|
15
|
+
r && /* @__PURE__ */ t("span", {
|
|
16
|
+
className: "shrink-0 text-slate-500 dark:text-slate-400",
|
|
17
|
+
children: r
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ n("div", {
|
|
20
|
+
className: "flex-1 min-w-0",
|
|
21
|
+
children: [/* @__PURE__ */ t("p", {
|
|
22
|
+
className: e("text-sm font-medium truncate", s ? "text-accent-400" : "text-slate-700 dark:text-slate-200"),
|
|
23
|
+
children: l
|
|
24
|
+
}), a && /* @__PURE__ */ t("p", {
|
|
25
|
+
className: "text-xs text-slate-500 mt-0.5 truncate",
|
|
26
|
+
children: a
|
|
27
|
+
})]
|
|
28
|
+
}),
|
|
29
|
+
i && /* @__PURE__ */ t("span", {
|
|
30
|
+
className: "shrink-0 text-slate-500",
|
|
31
|
+
children: i
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ t("li", {
|
|
36
|
+
className: e(c),
|
|
37
|
+
onClick: u,
|
|
38
|
+
...d,
|
|
39
|
+
children: o ? /* @__PURE__ */ t("a", {
|
|
40
|
+
href: o,
|
|
41
|
+
children: f
|
|
42
|
+
}) : f
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { r as List, i as ListItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-TkZ7v6Ef.cjs"),n=require("../use-event-callback-Du9_9eAi.cjs"),r=require("../focus-DmG6Ge7X.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime");var s={sm:`max-w-[380px]`,md:`max-w-[480px]`,lg:`max-w-[560px]`,xl:`max-w-[640px]`,"2xl":`max-w-[720px]`,"7xl":`max-w-3xl`,full:`max-w-[calc(100vw-2rem)]`};function c({open:c,onClose:l,children:u,className:d,overlayClassName:f,panelClassName:p,size:m=`md`,title:h,description:g,icon:_,showCloseButton:v=!0,closeAriaLabel:y=`Close dialog`,scrollable:b=!1,unstyled:x=!1,ariaLabel:S=`Dialog`,closeOnEscape:C=!0,closeOnOverlayClick:w=!0}){let T=(0,a.useRef)(null),E=(0,a.useRef)(null),D=(0,a.useRef)(c),O=(0,a.useId)(),k=(0,a.useId)(),A=n.t(l);return c&&!D.current&&typeof document<`u`&&document.activeElement instanceof HTMLElement&&(E.current=document.activeElement),D.current=c,(0,a.useEffect)(()=>{if(c)return;let e=e=>{e.target instanceof HTMLElement&&(E.current=e.target)};return!E.current&&document.activeElement instanceof HTMLElement&&(E.current=document.activeElement),document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[c]),(0,a.useEffect)(()=>{if(!c)return;!E.current&&document.activeElement instanceof HTMLElement&&(E.current=document.activeElement);let e=document.body.style.overflow,t=e=>{if(e.key===`Escape`&&C){e.preventDefault(),A();return}if(e.key!==`Tab`||!T.current)return;let t=r.t(T.current);if(t.length===0){e.preventDefault(),T.current.focus();return}let n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),n.focus())};document.addEventListener(`keydown`,t),document.body.style.overflow=`hidden`;let n=()=>{(T.current?.querySelector(`[data-autofocus]`)??T.current?.querySelector(`[data-modal-content] a[href],[data-modal-content] button:not([disabled]),[data-modal-content] input:not([disabled]),[data-modal-content] select:not([disabled]),[data-modal-content] textarea:not([disabled]),[data-modal-content] [tabindex]:not([tabindex="-1"])`)??T.current?.querySelector(`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`)??T.current)?.focus()};n();let i=window.setTimeout(n,0);return()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,t),document.body.style.overflow=e}},[C,c,A]),(0,a.useEffect)(()=>{if(c||!E.current)return;let e=E.current,t=window.setTimeout(()=>e.focus(),240);return()=>window.clearTimeout(t)},[c]),x?c?(0,o.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":`true`,className:e.t(d,p),children:u}):null:(0,o.jsx)(i.AnimatePresence,{onExitComplete:()=>{let e=E.current;E.current=null,window.setTimeout(()=>e?.focus(),0)},children:c&&(0,o.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6`,children:[(0,o.jsx)(i.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:e.t(`absolute inset-0 bg-overlay`,f),onClick:w?A:void 0}),(0,o.jsxs)(i.motion.div,{ref:T,initial:{opacity:0,scale:.98,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:10},transition:{duration:.22,ease:[.16,1,.3,1]},role:`dialog`,"aria-modal":`true`,"aria-labelledby":h?O:void 0,"aria-describedby":g?k:void 0,"aria-label":h?void 0:S,tabIndex:-1,className:e.t(`relative w-full overflow-hidden flex flex-col`,`rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,`max-h-[min(90dvh,720px)]`,s[m],p,d),children:[h&&(0,o.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-5 pb-3 pt-4 sm:px-6 shrink-0`,children:[(0,o.jsxs)(`div`,{className:`flex gap-3.5 min-w-0 flex-1`,children:[_&&(0,o.jsx)(`div`,{className:`mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-5`,"aria-hidden":`true`,children:_}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,o.jsx)(`h2`,{id:O,className:`text-base font-semibold leading-6 text-foreground`,children:h}),g&&(0,o.jsx)(`p`,{id:k,className:`mt-1 text-sm leading-5 text-muted-foreground`,children:g})]})]}),v&&(0,o.jsx)(`button`,{type:`button`,"data-modal-close":!0,"aria-label":y,onClick:A,className:t.c,children:(0,o.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),!h&&v&&(0,o.jsx)(`button`,{type:`button`,"data-modal-close":!0,"aria-label":y,onClick:A,className:e.t(`absolute right-4 top-4 z-10`,t.c),children:(0,o.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})}),(0,o.jsx)(`div`,{"data-modal-content":!0,className:e.t(`px-5 py-4 sm:px-6 flex-1`,b?`overflow-y-auto overscroll-contain`:`overflow-y-auto`),children:u})]})]})})}function l({className:t,children:n,...r}){return(0,o.jsx)(`div`,{className:e.t(`px-5 pt-4 pb-3 sm:px-6 border-b border-border shrink-0`,t),...r,children:n})}function u({as:t=`h2`,className:n,children:r,...i}){return(0,o.jsx)(t,{className:e.t(`text-base font-semibold leading-6 text-foreground`,n),...i,children:r})}function d({className:t,children:n,...r}){return(0,o.jsx)(`p`,{className:e.t(`mt-1 text-sm leading-5 text-muted-foreground`,t),...r,children:n})}function f({className:t,scrollable:n=!1,children:r,...i}){return(0,o.jsx)(`div`,{"data-modal-content":!0,className:e.t(`px-5 py-4 sm:px-6`,n&&`overflow-y-auto flex-1 overscroll-contain`,t),...i,children:r})}function p({className:t,children:n,...r}){return(0,o.jsx)(`div`,{className:e.t(`flex flex-wrap items-center justify-end gap-2 border-t border-border px-5 pb-4 pt-3 sm:px-6 max-sm:flex-col-reverse max-sm:items-stretch`,t),...r,children:n})}exports.Modal=c,exports.ModalBody=f,exports.ModalDescription=d,exports.ModalFooter=p,exports.ModalHeader=l,exports.ModalTitle=u;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
overlayClassName?: string;
|
|
8
|
+
panelClassName?: string;
|
|
9
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "7xl" | "full";
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
closeAriaLabel?: string;
|
|
15
|
+
scrollable?: boolean;
|
|
16
|
+
unstyled?: boolean;
|
|
17
|
+
ariaLabel?: string;
|
|
18
|
+
closeOnEscape?: boolean;
|
|
19
|
+
closeOnOverlayClick?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function Modal({ open, onClose, children, className, overlayClassName, panelClassName, size, title, description, icon, showCloseButton, closeAriaLabel, scrollable, unstyled, ariaLabel, closeOnEscape, closeOnOverlayClick, }: ModalProps): import("react").JSX.Element | null;
|
|
22
|
+
export declare function ModalHeader({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
23
|
+
export declare function ModalTitle({ as: Tag, className, children, ...props }: HTMLAttributes<HTMLHeadingElement> & {
|
|
24
|
+
as?: "h1" | "h2" | "h3" | "div";
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
export declare function ModalDescription({ className, children, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
|
|
27
|
+
export interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
28
|
+
scrollable?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function ModalBody({ className, scrollable, children, ...props }: ModalBodyProps): import("react").JSX.Element;
|
|
31
|
+
export declare function ModalFooter({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { c as t } from "../component-styles-Ce56hn9T.js";
|
|
4
|
+
import { t as n } from "../use-event-callback-DGkfO_uu.js";
|
|
5
|
+
import { t as r } from "../focus-Dk1YWVPN.js";
|
|
6
|
+
import { AnimatePresence as i, motion as a } from "framer-motion";
|
|
7
|
+
import { useEffect as o, useId as s, useRef as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/modal.tsx
|
|
10
|
+
var d = {
|
|
11
|
+
sm: "max-w-[380px]",
|
|
12
|
+
md: "max-w-[480px]",
|
|
13
|
+
lg: "max-w-[560px]",
|
|
14
|
+
xl: "max-w-[640px]",
|
|
15
|
+
"2xl": "max-w-[720px]",
|
|
16
|
+
"7xl": "max-w-3xl",
|
|
17
|
+
full: "max-w-[calc(100vw-2rem)]"
|
|
18
|
+
};
|
|
19
|
+
function f({ open: f, onClose: p, children: m, className: h, overlayClassName: g, panelClassName: _, size: v = "md", title: y, description: b, icon: x, showCloseButton: S = !0, closeAriaLabel: C = "Close dialog", scrollable: w = !1, unstyled: T = !1, ariaLabel: E = "Dialog", closeOnEscape: D = !0, closeOnOverlayClick: O = !0 }) {
|
|
20
|
+
let k = c(null), A = c(null), j = c(f), M = s(), N = s(), P = n(p);
|
|
21
|
+
return f && !j.current && typeof document < "u" && document.activeElement instanceof HTMLElement && (A.current = document.activeElement), j.current = f, o(() => {
|
|
22
|
+
if (f) return;
|
|
23
|
+
let e = (e) => {
|
|
24
|
+
e.target instanceof HTMLElement && (A.current = e.target);
|
|
25
|
+
};
|
|
26
|
+
return !A.current && document.activeElement instanceof HTMLElement && (A.current = document.activeElement), document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
27
|
+
}, [f]), o(() => {
|
|
28
|
+
if (!f) return;
|
|
29
|
+
!A.current && document.activeElement instanceof HTMLElement && (A.current = document.activeElement);
|
|
30
|
+
let e = document.body.style.overflow, t = (e) => {
|
|
31
|
+
if (e.key === "Escape" && D) {
|
|
32
|
+
e.preventDefault(), P();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (e.key !== "Tab" || !k.current) return;
|
|
36
|
+
let t = r(k.current);
|
|
37
|
+
if (t.length === 0) {
|
|
38
|
+
e.preventDefault(), k.current.focus();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let n = t[0], i = t[t.length - 1];
|
|
42
|
+
e.shiftKey && document.activeElement === n ? (e.preventDefault(), i.focus()) : !e.shiftKey && document.activeElement === i && (e.preventDefault(), n.focus());
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener("keydown", t), document.body.style.overflow = "hidden";
|
|
45
|
+
let n = () => {
|
|
46
|
+
(k.current?.querySelector("[data-autofocus]") ?? k.current?.querySelector("[data-modal-content] a[href],[data-modal-content] button:not([disabled]),[data-modal-content] input:not([disabled]),[data-modal-content] select:not([disabled]),[data-modal-content] textarea:not([disabled]),[data-modal-content] [tabindex]:not([tabindex=\"-1\"])") ?? k.current?.querySelector("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])") ?? k.current)?.focus();
|
|
47
|
+
};
|
|
48
|
+
n();
|
|
49
|
+
let i = window.setTimeout(n, 0);
|
|
50
|
+
return () => {
|
|
51
|
+
window.clearTimeout(i), document.removeEventListener("keydown", t), document.body.style.overflow = e;
|
|
52
|
+
};
|
|
53
|
+
}, [
|
|
54
|
+
D,
|
|
55
|
+
f,
|
|
56
|
+
P
|
|
57
|
+
]), o(() => {
|
|
58
|
+
if (f || !A.current) return;
|
|
59
|
+
let e = A.current, t = window.setTimeout(() => e.focus(), 240);
|
|
60
|
+
return () => window.clearTimeout(t);
|
|
61
|
+
}, [f]), T ? f ? /* @__PURE__ */ l("div", {
|
|
62
|
+
ref: k,
|
|
63
|
+
role: "dialog",
|
|
64
|
+
"aria-modal": "true",
|
|
65
|
+
className: e(h, _),
|
|
66
|
+
children: m
|
|
67
|
+
}) : null : /* @__PURE__ */ l(i, {
|
|
68
|
+
onExitComplete: () => {
|
|
69
|
+
let e = A.current;
|
|
70
|
+
A.current = null, window.setTimeout(() => e?.focus(), 0);
|
|
71
|
+
},
|
|
72
|
+
children: f && /* @__PURE__ */ u("div", {
|
|
73
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",
|
|
74
|
+
children: [/* @__PURE__ */ l(a.div, {
|
|
75
|
+
initial: { opacity: 0 },
|
|
76
|
+
animate: { opacity: 1 },
|
|
77
|
+
exit: { opacity: 0 },
|
|
78
|
+
transition: { duration: .2 },
|
|
79
|
+
className: e("absolute inset-0 bg-overlay", g),
|
|
80
|
+
onClick: O ? P : void 0
|
|
81
|
+
}), /* @__PURE__ */ u(a.div, {
|
|
82
|
+
ref: k,
|
|
83
|
+
initial: {
|
|
84
|
+
opacity: 0,
|
|
85
|
+
scale: .98,
|
|
86
|
+
y: 10
|
|
87
|
+
},
|
|
88
|
+
animate: {
|
|
89
|
+
opacity: 1,
|
|
90
|
+
scale: 1,
|
|
91
|
+
y: 0
|
|
92
|
+
},
|
|
93
|
+
exit: {
|
|
94
|
+
opacity: 0,
|
|
95
|
+
scale: .98,
|
|
96
|
+
y: 10
|
|
97
|
+
},
|
|
98
|
+
transition: {
|
|
99
|
+
duration: .22,
|
|
100
|
+
ease: [
|
|
101
|
+
.16,
|
|
102
|
+
1,
|
|
103
|
+
.3,
|
|
104
|
+
1
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
role: "dialog",
|
|
108
|
+
"aria-modal": "true",
|
|
109
|
+
"aria-labelledby": y ? M : void 0,
|
|
110
|
+
"aria-describedby": b ? N : void 0,
|
|
111
|
+
"aria-label": y ? void 0 : E,
|
|
112
|
+
tabIndex: -1,
|
|
113
|
+
className: e("relative w-full overflow-hidden flex flex-col", "rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay", "max-h-[min(90dvh,720px)]", d[v], _, h),
|
|
114
|
+
children: [
|
|
115
|
+
y && /* @__PURE__ */ u("div", {
|
|
116
|
+
className: "flex items-start justify-between gap-4 border-b border-border px-5 pb-3 pt-4 sm:px-6 shrink-0",
|
|
117
|
+
children: [/* @__PURE__ */ u("div", {
|
|
118
|
+
className: "flex gap-3.5 min-w-0 flex-1",
|
|
119
|
+
children: [x && /* @__PURE__ */ l("div", {
|
|
120
|
+
className: "mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-5",
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
children: x
|
|
123
|
+
}), /* @__PURE__ */ u("div", {
|
|
124
|
+
className: "min-w-0 flex-1 pt-0.5",
|
|
125
|
+
children: [/* @__PURE__ */ l("h2", {
|
|
126
|
+
id: M,
|
|
127
|
+
className: "text-base font-semibold leading-6 text-foreground",
|
|
128
|
+
children: y
|
|
129
|
+
}), b && /* @__PURE__ */ l("p", {
|
|
130
|
+
id: N,
|
|
131
|
+
className: "mt-1 text-sm leading-5 text-muted-foreground",
|
|
132
|
+
children: b
|
|
133
|
+
})]
|
|
134
|
+
})]
|
|
135
|
+
}), S && /* @__PURE__ */ l("button", {
|
|
136
|
+
type: "button",
|
|
137
|
+
"data-modal-close": !0,
|
|
138
|
+
"aria-label": C,
|
|
139
|
+
onClick: P,
|
|
140
|
+
className: t,
|
|
141
|
+
children: /* @__PURE__ */ l("svg", {
|
|
142
|
+
width: "14",
|
|
143
|
+
height: "14",
|
|
144
|
+
viewBox: "0 0 24 24",
|
|
145
|
+
fill: "none",
|
|
146
|
+
stroke: "currentColor",
|
|
147
|
+
strokeWidth: "2",
|
|
148
|
+
strokeLinecap: "round",
|
|
149
|
+
strokeLinejoin: "round",
|
|
150
|
+
children: /* @__PURE__ */ l("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
151
|
+
})
|
|
152
|
+
})]
|
|
153
|
+
}),
|
|
154
|
+
!y && S && /* @__PURE__ */ l("button", {
|
|
155
|
+
type: "button",
|
|
156
|
+
"data-modal-close": !0,
|
|
157
|
+
"aria-label": C,
|
|
158
|
+
onClick: P,
|
|
159
|
+
className: e("absolute right-4 top-4 z-10", t),
|
|
160
|
+
children: /* @__PURE__ */ l("svg", {
|
|
161
|
+
width: "14",
|
|
162
|
+
height: "14",
|
|
163
|
+
viewBox: "0 0 24 24",
|
|
164
|
+
fill: "none",
|
|
165
|
+
stroke: "currentColor",
|
|
166
|
+
strokeWidth: "2",
|
|
167
|
+
strokeLinecap: "round",
|
|
168
|
+
strokeLinejoin: "round",
|
|
169
|
+
children: /* @__PURE__ */ l("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
170
|
+
})
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ l("div", {
|
|
173
|
+
"data-modal-content": !0,
|
|
174
|
+
className: e("px-5 py-4 sm:px-6 flex-1", w ? "overflow-y-auto overscroll-contain" : "overflow-y-auto"),
|
|
175
|
+
children: m
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
})]
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function p({ className: t, children: n, ...r }) {
|
|
183
|
+
return /* @__PURE__ */ l("div", {
|
|
184
|
+
className: e("px-5 pt-4 pb-3 sm:px-6 border-b border-border shrink-0", t),
|
|
185
|
+
...r,
|
|
186
|
+
children: n
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function m({ as: t = "h2", className: n, children: r, ...i }) {
|
|
190
|
+
return /* @__PURE__ */ l(t, {
|
|
191
|
+
className: e("text-base font-semibold leading-6 text-foreground", n),
|
|
192
|
+
...i,
|
|
193
|
+
children: r
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function h({ className: t, children: n, ...r }) {
|
|
197
|
+
return /* @__PURE__ */ l("p", {
|
|
198
|
+
className: e("mt-1 text-sm leading-5 text-muted-foreground", t),
|
|
199
|
+
...r,
|
|
200
|
+
children: n
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function g({ className: t, scrollable: n = !1, children: r, ...i }) {
|
|
204
|
+
return /* @__PURE__ */ l("div", {
|
|
205
|
+
"data-modal-content": !0,
|
|
206
|
+
className: e("px-5 py-4 sm:px-6", n && "overflow-y-auto flex-1 overscroll-contain", t),
|
|
207
|
+
...i,
|
|
208
|
+
children: r
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function _({ className: t, children: n, ...r }) {
|
|
212
|
+
return /* @__PURE__ */ l("div", {
|
|
213
|
+
className: e("flex flex-wrap items-center justify-end gap-2 border-t border-border px-5 pb-4 pt-3 sm:px-6 max-sm:flex-col-reverse max-sm:items-stretch", t),
|
|
214
|
+
...r,
|
|
215
|
+
children: n
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { f as Modal, g as ModalBody, h as ModalDescription, _ as ModalFooter, p as ModalHeader, m as ModalTitle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-TkZ7v6Ef.cjs");let n=require("react/jsx-runtime");function r({id:r,label:i,href:a,icon:o,badge:s,disabled:c,active:l,compact:u,onSelect:d,className:f}){let p=(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:o}),(0,n.jsx)(`span`,{className:e.t(`truncate`,u&&`text-[11px]`),children:i}),s&&(0,n.jsx)(`span`,{className:`ml-auto shrink-0`,children:s})]}),m=e.t(`group relative inline-flex items-center justify-center gap-2 rounded-[var(--radius-md)] font-medium transition-colors`,t.s,u?`min-h-11 flex-col px-2 py-1.5`:`h-9 px-3 text-sm`,l?`bg-accent-50 text-accent-700 dark:bg-accent-500/12 dark:text-accent-300`:`text-muted-foreground hover:bg-muted hover:text-foreground`,c&&`pointer-events-none opacity-40`,f);return a?(0,n.jsx)(`a`,{href:a,className:m,"aria-current":l?`page`:void 0,"aria-disabled":c||void 0,onClick:e=>{d&&(e.preventDefault(),d(r))},children:p}):(0,n.jsx)(`button`,{type:`button`,className:m,"aria-current":l?`page`:void 0,disabled:c,onClick:()=>d?.(r),children:p})}function i({items:t,activeId:i,onSelect:a,ariaLabel:o=`Primary navigation`,className:s,children:c,...l}){return(0,n.jsxs)(`nav`,{"aria-label":o,className:e.t(`flex min-h-14 items-center gap-1 border border-border bg-surface px-3`,s),...l,children:[c,(0,n.jsx)(`div`,{className:`ml-auto flex items-center gap-1 overflow-x-auto`,children:t.map(e=>(0,n.jsx)(r,{...e,active:i===e.id,onSelect:a},e.id))})]})}function a({className:t,children:r,...i}){return(0,n.jsx)(`header`,{className:e.t(`flex min-h-14 items-center gap-3 border-b border-border bg-bg/95 px-4 backdrop-blur-sm`,t),...i,children:r})}function o({as:t=`h2`,className:r,children:i,...a}){return(0,n.jsx)(t,{className:e.t(`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,r),...a,children:i})}function s({items:t,activeId:i,onSelect:a,ariaLabel:o=`Sidebar navigation`,header:s,footer:c,className:l,...u}){return(0,n.jsxs)(`aside`,{className:e.t(`flex w-60 flex-col border border-border bg-surface`,l),...u,children:[s&&(0,n.jsx)(`div`,{className:`border-b border-border p-4`,children:s}),(0,n.jsx)(`nav`,{"aria-label":o,className:`flex flex-1 flex-col gap-1 p-2`,children:t.map(e=>(0,n.jsx)(r,{...e,active:i===e.id,onSelect:a,className:`w-full justify-start`},e.id))}),c&&(0,n.jsx)(`div`,{className:`border-t border-border p-3`,children:c})]})}function c({items:t,activeId:i,onSelect:a,ariaLabel:o=`Mobile navigation`,className:s,...c}){return(0,n.jsx)(`nav`,{"aria-label":o,className:e.t(`grid min-h-16 border border-border bg-surface/95 px-1 pb-safe-bottom shadow-floating backdrop-blur-sm`,s),style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},...c,children:t.map(e=>(0,n.jsx)(r,{...e,compact:!0,active:i===e.id,onSelect:a,className:`rounded-none`},e.id))})}function l({label:r,className:i,children:a,type:o=`button`,...s}){return(0,n.jsx)(`button`,{type:o,"aria-label":r,className:e.t(t.c,`size-9`,i),...s,children:a})}function u({mark:r,className:i,children:a,...o}){return(0,n.jsxs)(`a`,{className:e.t(`inline-flex shrink-0 items-center gap-2 text-sm font-semibold text-foreground`,t.s,i),...o,children:[r,a]})}exports.BottomBar=c,exports.BrandLink=u,exports.IconButton=l,exports.Navbar=i,exports.NavigationLink=r,exports.Sidebar=s,exports.Topbar=a,exports.TopbarTitle=o;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface NavigationItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
badge?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface NavigationItemProps extends NavigationItem {
|
|
11
|
+
active?: boolean;
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
onSelect?: (id: string) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function NavigationLink({ id, label, href, icon, badge, disabled, active, compact, onSelect, className, }: NavigationItemProps): import("react").JSX.Element;
|
|
17
|
+
export interface NavigationListProps extends Omit<HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
18
|
+
items: NavigationItem[];
|
|
19
|
+
activeId?: string;
|
|
20
|
+
onSelect?: (id: string) => void;
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function Navbar({ items, activeId, onSelect, ariaLabel, className, children, ...props }: NavigationListProps): import("react").JSX.Element;
|
|
24
|
+
export declare function Topbar({ className, children, ...props }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
25
|
+
export declare function TopbarTitle({ as: Tag, className, children, ...props }: HTMLAttributes<HTMLHeadingElement> & {
|
|
26
|
+
as?: "h1" | "h2" | "h3" | "div" | "p";
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
export interface SidebarProps extends NavigationListProps {
|
|
29
|
+
header?: ReactNode;
|
|
30
|
+
footer?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare function Sidebar({ items, activeId, onSelect, ariaLabel, header, footer, className, ...props }: SidebarProps): import("react").JSX.Element;
|
|
33
|
+
export declare function BottomBar({ items, activeId, onSelect, ariaLabel, className, ...props }: NavigationListProps): import("react").JSX.Element;
|
|
34
|
+
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
35
|
+
label: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function IconButton({ label, className, children, type, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
38
|
+
export interface BrandLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
39
|
+
mark?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare function BrandLink({ mark, className, children, ...props }: BrandLinkProps): import("react").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { c as t, s as n } from "../component-styles-Ce56hn9T.js";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/navigation.tsx
|
|
6
|
+
function o({ id: t, label: o, href: s, icon: c, badge: l, disabled: u, active: d, compact: f, onSelect: p, className: m }) {
|
|
7
|
+
let h = /* @__PURE__ */ a(r, { children: [
|
|
8
|
+
c && /* @__PURE__ */ i("span", {
|
|
9
|
+
className: "shrink-0",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
children: c
|
|
12
|
+
}),
|
|
13
|
+
/* @__PURE__ */ i("span", {
|
|
14
|
+
className: e("truncate", f && "text-[11px]"),
|
|
15
|
+
children: o
|
|
16
|
+
}),
|
|
17
|
+
l && /* @__PURE__ */ i("span", {
|
|
18
|
+
className: "ml-auto shrink-0",
|
|
19
|
+
children: l
|
|
20
|
+
})
|
|
21
|
+
] }), g = e("group relative inline-flex items-center justify-center gap-2 rounded-[var(--radius-md)] font-medium transition-colors", n, f ? "min-h-11 flex-col px-2 py-1.5" : "h-9 px-3 text-sm", d ? "bg-accent-50 text-accent-700 dark:bg-accent-500/12 dark:text-accent-300" : "text-muted-foreground hover:bg-muted hover:text-foreground", u && "pointer-events-none opacity-40", m);
|
|
22
|
+
return s ? /* @__PURE__ */ i("a", {
|
|
23
|
+
href: s,
|
|
24
|
+
className: g,
|
|
25
|
+
"aria-current": d ? "page" : void 0,
|
|
26
|
+
"aria-disabled": u || void 0,
|
|
27
|
+
onClick: (e) => {
|
|
28
|
+
p && (e.preventDefault(), p(t));
|
|
29
|
+
},
|
|
30
|
+
children: h
|
|
31
|
+
}) : /* @__PURE__ */ i("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
className: g,
|
|
34
|
+
"aria-current": d ? "page" : void 0,
|
|
35
|
+
disabled: u,
|
|
36
|
+
onClick: () => p?.(t),
|
|
37
|
+
children: h
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function s({ items: t, activeId: n, onSelect: r, ariaLabel: s = "Primary navigation", className: c, children: l, ...u }) {
|
|
41
|
+
return /* @__PURE__ */ a("nav", {
|
|
42
|
+
"aria-label": s,
|
|
43
|
+
className: e("flex min-h-14 items-center gap-1 border border-border bg-surface px-3", c),
|
|
44
|
+
...u,
|
|
45
|
+
children: [l, /* @__PURE__ */ i("div", {
|
|
46
|
+
className: "ml-auto flex items-center gap-1 overflow-x-auto",
|
|
47
|
+
children: t.map((e) => /* @__PURE__ */ i(o, {
|
|
48
|
+
...e,
|
|
49
|
+
active: n === e.id,
|
|
50
|
+
onSelect: r
|
|
51
|
+
}, e.id))
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function c({ className: t, children: n, ...r }) {
|
|
56
|
+
return /* @__PURE__ */ i("header", {
|
|
57
|
+
className: e("flex min-h-14 items-center gap-3 border-b border-border bg-bg/95 px-4 backdrop-blur-sm", t),
|
|
58
|
+
...r,
|
|
59
|
+
children: n
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function l({ as: t = "h2", className: n, children: r, ...a }) {
|
|
63
|
+
return /* @__PURE__ */ i(t, {
|
|
64
|
+
className: e("min-w-0 flex-1 truncate text-sm font-semibold text-foreground", n),
|
|
65
|
+
...a,
|
|
66
|
+
children: r
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function u({ items: t, activeId: n, onSelect: r, ariaLabel: s = "Sidebar navigation", header: c, footer: l, className: u, ...d }) {
|
|
70
|
+
return /* @__PURE__ */ a("aside", {
|
|
71
|
+
className: e("flex w-60 flex-col border border-border bg-surface", u),
|
|
72
|
+
...d,
|
|
73
|
+
children: [
|
|
74
|
+
c && /* @__PURE__ */ i("div", {
|
|
75
|
+
className: "border-b border-border p-4",
|
|
76
|
+
children: c
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ i("nav", {
|
|
79
|
+
"aria-label": s,
|
|
80
|
+
className: "flex flex-1 flex-col gap-1 p-2",
|
|
81
|
+
children: t.map((e) => /* @__PURE__ */ i(o, {
|
|
82
|
+
...e,
|
|
83
|
+
active: n === e.id,
|
|
84
|
+
onSelect: r,
|
|
85
|
+
className: "w-full justify-start"
|
|
86
|
+
}, e.id))
|
|
87
|
+
}),
|
|
88
|
+
l && /* @__PURE__ */ i("div", {
|
|
89
|
+
className: "border-t border-border p-3",
|
|
90
|
+
children: l
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function d({ items: t, activeId: n, onSelect: r, ariaLabel: a = "Mobile navigation", className: s, ...c }) {
|
|
96
|
+
return /* @__PURE__ */ i("nav", {
|
|
97
|
+
"aria-label": a,
|
|
98
|
+
className: e("grid min-h-16 border border-border bg-surface/95 px-1 pb-safe-bottom shadow-floating backdrop-blur-sm", s),
|
|
99
|
+
style: { gridTemplateColumns: `repeat(${t.length}, minmax(0, 1fr))` },
|
|
100
|
+
...c,
|
|
101
|
+
children: t.map((e) => /* @__PURE__ */ i(o, {
|
|
102
|
+
...e,
|
|
103
|
+
compact: !0,
|
|
104
|
+
active: n === e.id,
|
|
105
|
+
onSelect: r,
|
|
106
|
+
className: "rounded-none"
|
|
107
|
+
}, e.id))
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function f({ label: n, className: r, children: a, type: o = "button", ...s }) {
|
|
111
|
+
return /* @__PURE__ */ i("button", {
|
|
112
|
+
type: o,
|
|
113
|
+
"aria-label": n,
|
|
114
|
+
className: e(t, "size-9", r),
|
|
115
|
+
...s,
|
|
116
|
+
children: a
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function p({ mark: t, className: r, children: i, ...o }) {
|
|
120
|
+
return /* @__PURE__ */ a("a", {
|
|
121
|
+
className: e("inline-flex shrink-0 items-center gap-2 text-sm font-semibold text-foreground", n, r),
|
|
122
|
+
...o,
|
|
123
|
+
children: [t, i]
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { d as BottomBar, p as BrandLink, f as IconButton, s as Navbar, o as NavigationLink, u as Sidebar, c as Topbar, l as TopbarTitle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-TkZ7v6Ef.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:{wrap:`h-7 text-xs`,btn:`w-6`,input:`w-16`},md:{wrap:`h-9 text-sm`,btn:`w-8`,input:`w-20`},lg:{wrap:`h-11 text-sm`,btn:`w-9`,input:`w-24`}},a=(0,n.forwardRef)(({className:a,label:o,hint:s,error:c,size:l=`md`,min:u=-1/0,max:d=1/0,step:f=1,value:p,defaultValue:m=0,onChange:h,disabled:g,id:_,autoComplete:v=`on`,fullWidth:y=!1,formatDisplay:b,onFocus:x,onBlur:S,onKeyDown:C,required:w,...T},E)=>{let D=(0,n.useId)(),O=_??D,k=`${O}-message`,[A,j]=(0,n.useState)(m),M=p??A,N=i[l],P=f.toString().includes(`.`)?f.toString().split(`.`)[1].length:0,F=e=>P>0?Math.round(e*10**P)/10**P:Math.round(e),I=e=>Math.min(d,Math.max(u,e));function L(e){let t=I(F(e));p===void 0&&j(t),h?.(t),z(String(t))}(0,n.useEffect)(()=>{p!==void 0&&j(p)},[p]);let[R,z]=(0,n.useState)(()=>String(M)),B=(0,n.useRef)(!1);(0,n.useEffect)(()=>{B.current||z(String(M))},[M]);function V(e){z(e)}function H(e){B.current=!1;let t=Number(R);L(Number.isNaN(t)?M:t),S?.(e)}function U(e){C?.(e),!e.defaultPrevented&&e.key===`Enter`&&e.currentTarget.blur()}return(0,r.jsxs)(`div`,{className:e.t(t.o,!y&&`w-auto`,a),children:[o&&(0,r.jsxs)(`label`,{htmlFor:O,className:`text-sm font-medium leading-5 text-foreground`,children:[o,w&&(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)(`div`,{className:e.t(`inline-flex items-center overflow-hidden rounded-[var(--radius-md)]`,t.t,N.wrap,y&&`flex w-full`,c&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,g&&`opacity-50`),children:[(0,r.jsx)(`button`,{type:`button`,"aria-label":o?`Decrease ${o}`:`Decrease value`,tabIndex:-1,disabled:g||M<=u,onClick:()=>L(M-f),className:e.t(`flex items-center justify-center shrink-0 border-r border-border`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,N.btn),children:(0,r.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M5 12h14`})})}),(0,r.jsx)(`input`,{ref:E,type:`number`,id:O,required:w,"aria-invalid":c?!0:void 0,"aria-describedby":c||s?k:void 0,"aria-valuetext":b?.(M),autoComplete:v,min:Number.isFinite(u)?u:void 0,max:Number.isFinite(d)?d:void 0,step:f,value:R,disabled:g,onFocus:e=>{B.current=!0,x?.(e)},onChange:e=>V(e.target.value),onBlur:H,onKeyDown:U,className:e.t(`flex-1 text-center bg-transparent text-foreground outline-none tabular-nums`,`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`,`disabled:cursor-not-allowed`,y?`min-w-0`:N.input),...T}),(0,r.jsx)(`button`,{type:`button`,"aria-label":o?`Increase ${o}`:`Increase value`,tabIndex:-1,disabled:g||M>=d,onClick:()=>L(M+f),className:e.t(`flex items-center justify-center shrink-0 border-l border-border`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,N.btn),children:(0,r.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),c&&(0,r.jsx)(`p`,{id:k,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:c}),s&&!c&&(0,r.jsx)(`p`,{id:k,className:`text-xs leading-5 text-muted-foreground`,children:s})]})});a.displayName=`NumberInput`,exports.NumberInput=a;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
hint?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
value?: number;
|
|
11
|
+
defaultValue?: number;
|
|
12
|
+
onChange?: (value: number) => void;
|
|
13
|
+
formatDisplay?: (v: number) => string;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const NumberInput: import('react').ForwardRefExoticComponent<NumberInputProps & import('react').RefAttributes<HTMLInputElement>>;
|