@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,64 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { Fragment as t, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/seo.tsx
|
|
4
|
+
function r({ alt: t, loading: r = "lazy", decoding: i = "async", className: a, width: o, height: s, style: c, ...l }) {
|
|
5
|
+
return (!t || t.trim() === "") && console.warn("[rtui SeoImage] alt text is required for SEO and accessibility. Provide a descriptive alt."), /* @__PURE__ */ n("img", {
|
|
6
|
+
alt: t,
|
|
7
|
+
loading: r,
|
|
8
|
+
decoding: i,
|
|
9
|
+
width: o,
|
|
10
|
+
height: s,
|
|
11
|
+
className: e(o && s ? "h-auto" : void 0, a),
|
|
12
|
+
style: o && s ? {
|
|
13
|
+
aspectRatio: `${o}/${s}`,
|
|
14
|
+
...c
|
|
15
|
+
} : c,
|
|
16
|
+
...l
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function i({ data: e, id: r }) {
|
|
20
|
+
let i = Array.isArray(e) ? e : [e];
|
|
21
|
+
return /* @__PURE__ */ n(t, { children: i.map((e, t) => /* @__PURE__ */ n("script", {
|
|
22
|
+
id: r && i.length === 1 ? r : void 0,
|
|
23
|
+
type: "application/ld+json",
|
|
24
|
+
dangerouslySetInnerHTML: { __html: JSON.stringify(e).replace(/</g, "\\u003c") }
|
|
25
|
+
}, r ? `${r}-${t}` : t)) });
|
|
26
|
+
}
|
|
27
|
+
function a({ items: e, id: t = "breadcrumb-jsonld" }) {
|
|
28
|
+
let r = {
|
|
29
|
+
"@context": "https://schema.org",
|
|
30
|
+
"@type": "BreadcrumbList",
|
|
31
|
+
itemListElement: e.map((e, t) => ({
|
|
32
|
+
"@type": "ListItem",
|
|
33
|
+
position: t + 1,
|
|
34
|
+
name: e.name,
|
|
35
|
+
...e.item ? { item: e.item } : {}
|
|
36
|
+
}))
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ n(i, {
|
|
39
|
+
data: r,
|
|
40
|
+
id: t
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function o({ headline: e, description: t, url: r, image: a, authorName: o, datePublished: s, dateModified: c, id: l = "article-jsonld" }) {
|
|
44
|
+
let u = {
|
|
45
|
+
"@context": "https://schema.org",
|
|
46
|
+
"@type": "Article",
|
|
47
|
+
headline: e,
|
|
48
|
+
...t ? { description: t } : {},
|
|
49
|
+
...r ? { url: r } : {},
|
|
50
|
+
...a ? { image: a } : {},
|
|
51
|
+
...o ? { author: {
|
|
52
|
+
"@type": "Person",
|
|
53
|
+
name: o
|
|
54
|
+
} } : {},
|
|
55
|
+
...s ? { datePublished: s } : {},
|
|
56
|
+
...c ? { dateModified: c } : {}
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ n(i, {
|
|
59
|
+
data: u,
|
|
60
|
+
id: l
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { o as ArticleJsonLd, a as BreadcrumbJsonLd, r as SeoImage, i as StructuredData };
|
|
@@ -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({orientation:n=`horizontal`,label:r,className:i,...a}){return n===`vertical`?(0,t.jsx)(`div`,{className:e.t(`w-px self-stretch bg-black/8 dark:bg-white/8`,i),...a}):r?(0,t.jsxs)(`div`,{className:e.t(`flex items-center gap-3`,i),...a,children:[(0,t.jsx)(`div`,{className:`flex-1 h-px bg-black/8 dark:bg-white/8`}),(0,t.jsx)(`span`,{className:`text-xs text-slate-500 font-medium shrink-0`,children:r}),(0,t.jsx)(`div`,{className:`flex-1 h-px bg-black/8 dark:bg-white/8`})]}):(0,t.jsx)(`div`,{className:e.t(`h-px w-full bg-black/8 dark:bg-white/8`,i),...a})}exports.Separator=n;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
orientation?: "horizontal" | "vertical";
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Separator({ orientation, label, className, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
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/separator.tsx
|
|
4
|
+
function r({ orientation: r = "horizontal", label: i, className: a, ...o }) {
|
|
5
|
+
return r === "vertical" ? /* @__PURE__ */ t("div", {
|
|
6
|
+
className: e("w-px self-stretch bg-black/8 dark:bg-white/8", a),
|
|
7
|
+
...o
|
|
8
|
+
}) : i ? /* @__PURE__ */ n("div", {
|
|
9
|
+
className: e("flex items-center gap-3", a),
|
|
10
|
+
...o,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ t("div", { className: "flex-1 h-px bg-black/8 dark:bg-white/8" }),
|
|
13
|
+
/* @__PURE__ */ t("span", {
|
|
14
|
+
className: "text-xs text-slate-500 font-medium shrink-0",
|
|
15
|
+
children: i
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ t("div", { className: "flex-1 h-px bg-black/8 dark:bg-white/8" })
|
|
18
|
+
]
|
|
19
|
+
}) : /* @__PURE__ */ t("div", {
|
|
20
|
+
className: e("h-px w-full bg-black/8 dark:bg-white/8", a),
|
|
21
|
+
...o
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { r as Separator };
|
|
@@ -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={sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,full:`rounded-full`};function r({className:r,width:i,height:a,rounded:o=`md`,style:s,...c}){return(0,t.jsx)(`div`,{className:e.t(`animate-pulse bg-muted`,n[o],r),style:{width:i,height:a,...s},"aria-hidden":`true`,...c})}function i({lines:n=3,className:i,lastLineWidth:a=`60%`}){return(0,t.jsx)(`div`,{className:e.t(`space-y-2`,i),"aria-hidden":`true`,children:Array.from({length:n}).map((e,i)=>(0,t.jsx)(r,{height:14,width:i===n-1?a:`100%`},i))})}var a={sm:32,md:36,lg:44};function o({size:e=`md`,className:n}){let i=a[e];return(0,t.jsx)(r,{width:i,height:i,rounded:`full`,className:n})}function s({lines:n=3,hasAvatar:i=!1,hasFooter:a=!1,className:s}){return(0,t.jsxs)(`div`,{className:e.t(`rounded-[var(--radius-lg)] border border-border bg-surface`,s),"aria-hidden":`true`,children:[(0,t.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-5 py-4`,children:[i&&(0,t.jsx)(o,{}),(0,t.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,t.jsx)(r,{height:14,width:`40%`}),(0,t.jsx)(r,{height:11,width:`25%`})]})]}),(0,t.jsx)(`div`,{className:`px-5 py-4 space-y-2.5`,children:Array.from({length:n}).map((e,i)=>(0,t.jsx)(r,{height:13,width:i===n-1?`65%`:`100%`},i))}),a&&(0,t.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-5 py-3.5`,children:[(0,t.jsx)(r,{height:28,width:72,rounded:`lg`}),(0,t.jsx)(r,{height:28,width:72,rounded:`lg`})]})]})}function c({hasBreadcrumb:n=!0,hasAction:i=!0,className:a}){return(0,t.jsxs)(`div`,{className:e.t(`w-full px-4 py-3 sm:px-6 sm:py-4`,`bg-surface/90`,`border-b border-border`,`sticky top-0 z-30`,a),"aria-hidden":`true`,children:[n&&(0,t.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-2.5`,children:[(0,t.jsx)(r,{height:10,width:72}),(0,t.jsx)(r,{height:10,width:6,rounded:`full`}),(0,t.jsx)(r,{height:10,width:52})]}),(0,t.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,t.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,t.jsx)(r,{height:18,width:148}),(0,t.jsx)(r,{height:11,width:196})]}),i&&(0,t.jsx)(r,{height:30,width:100,rounded:`lg`})]})]})}function l({rows:n=5,cols:i=4,className:a}){return(0,t.jsxs)(`div`,{className:e.t(`overflow-hidden rounded-[var(--radius-lg)] border border-border`,a),"aria-hidden":`true`,children:[(0,t.jsx)(`div`,{className:`flex items-center gap-4 border-b border-border bg-surface-muted px-4 py-3`,children:Array.from({length:i}).map((e,n)=>(0,t.jsx)(r,{height:11,width:`${50+n*13%50}px`},n))}),Array.from({length:n}).map((e,n)=>(0,t.jsx)(`div`,{className:`flex items-center gap-4 border-b border-border px-4 py-3 last:border-none`,children:Array.from({length:i}).map((e,i)=>(0,t.jsx)(r,{height:13,width:`${55+(n+i)*11%45}%`},i))},n))]})}exports.Skeleton=r,exports.SkeletonAvatar=o,exports.SkeletonCard=s,exports.SkeletonTable=l,exports.SkeletonText=i,exports.SkeletonTopbar=c;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
width?: string | number;
|
|
4
|
+
height?: string | number;
|
|
5
|
+
rounded?: "sm" | "md" | "lg" | "full";
|
|
6
|
+
}
|
|
7
|
+
export declare function Skeleton({ className, width, height, rounded, style, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
8
|
+
export interface SkeletonTextProps {
|
|
9
|
+
lines?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
lastLineWidth?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function SkeletonText({ lines, className, lastLineWidth, }: SkeletonTextProps): import("react").JSX.Element;
|
|
14
|
+
export interface SkeletonAvatarProps {
|
|
15
|
+
size?: "sm" | "md" | "lg";
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function SkeletonAvatar({ size, className }: SkeletonAvatarProps): import("react").JSX.Element;
|
|
19
|
+
export interface SkeletonCardProps {
|
|
20
|
+
lines?: number;
|
|
21
|
+
hasAvatar?: boolean;
|
|
22
|
+
hasFooter?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function SkeletonCard({ lines, hasAvatar, hasFooter, className, }: SkeletonCardProps): import("react").JSX.Element;
|
|
26
|
+
export interface SkeletonTopbarProps {
|
|
27
|
+
hasBreadcrumb?: boolean;
|
|
28
|
+
hasAction?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function SkeletonTopbar({ hasBreadcrumb, hasAction, className, }: SkeletonTopbarProps): import("react").JSX.Element;
|
|
32
|
+
export interface SkeletonTableProps {
|
|
33
|
+
rows?: number;
|
|
34
|
+
cols?: number;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function SkeletonTable({ rows, cols, className, }: SkeletonTableProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,146 @@
|
|
|
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/skeleton.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
sm: "rounded-sm",
|
|
6
|
+
md: "rounded-md",
|
|
7
|
+
lg: "rounded-lg",
|
|
8
|
+
full: "rounded-full"
|
|
9
|
+
};
|
|
10
|
+
function i({ className: n, width: i, height: a, rounded: o = "md", style: s, ...c }) {
|
|
11
|
+
return /* @__PURE__ */ t("div", {
|
|
12
|
+
className: e("animate-pulse bg-muted", r[o], n),
|
|
13
|
+
style: {
|
|
14
|
+
width: i,
|
|
15
|
+
height: a,
|
|
16
|
+
...s
|
|
17
|
+
},
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
...c
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function a({ lines: n = 3, className: r, lastLineWidth: a = "60%" }) {
|
|
23
|
+
return /* @__PURE__ */ t("div", {
|
|
24
|
+
className: e("space-y-2", r),
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
children: Array.from({ length: n }).map((e, r) => /* @__PURE__ */ t(i, {
|
|
27
|
+
height: 14,
|
|
28
|
+
width: r === n - 1 ? a : "100%"
|
|
29
|
+
}, r))
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
var o = {
|
|
33
|
+
sm: 32,
|
|
34
|
+
md: 36,
|
|
35
|
+
lg: 44
|
|
36
|
+
};
|
|
37
|
+
function s({ size: e = "md", className: n }) {
|
|
38
|
+
let r = o[e];
|
|
39
|
+
return /* @__PURE__ */ t(i, {
|
|
40
|
+
width: r,
|
|
41
|
+
height: r,
|
|
42
|
+
rounded: "full",
|
|
43
|
+
className: n
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function c({ lines: r = 3, hasAvatar: a = !1, hasFooter: o = !1, className: c }) {
|
|
47
|
+
return /* @__PURE__ */ n("div", {
|
|
48
|
+
className: e("rounded-[var(--radius-lg)] border border-border bg-surface", c),
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ n("div", {
|
|
52
|
+
className: "flex items-center gap-3 border-b border-border px-5 py-4",
|
|
53
|
+
children: [a && /* @__PURE__ */ t(s, {}), /* @__PURE__ */ n("div", {
|
|
54
|
+
className: "flex-1 space-y-1.5",
|
|
55
|
+
children: [/* @__PURE__ */ t(i, {
|
|
56
|
+
height: 14,
|
|
57
|
+
width: "40%"
|
|
58
|
+
}), /* @__PURE__ */ t(i, {
|
|
59
|
+
height: 11,
|
|
60
|
+
width: "25%"
|
|
61
|
+
})]
|
|
62
|
+
})]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ t("div", {
|
|
65
|
+
className: "px-5 py-4 space-y-2.5",
|
|
66
|
+
children: Array.from({ length: r }).map((e, n) => /* @__PURE__ */ t(i, {
|
|
67
|
+
height: 13,
|
|
68
|
+
width: n === r - 1 ? "65%" : "100%"
|
|
69
|
+
}, n))
|
|
70
|
+
}),
|
|
71
|
+
o && /* @__PURE__ */ n("div", {
|
|
72
|
+
className: "flex items-center gap-2 border-t border-border px-5 py-3.5",
|
|
73
|
+
children: [/* @__PURE__ */ t(i, {
|
|
74
|
+
height: 28,
|
|
75
|
+
width: 72,
|
|
76
|
+
rounded: "lg"
|
|
77
|
+
}), /* @__PURE__ */ t(i, {
|
|
78
|
+
height: 28,
|
|
79
|
+
width: 72,
|
|
80
|
+
rounded: "lg"
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function l({ hasBreadcrumb: r = !0, hasAction: a = !0, className: o }) {
|
|
87
|
+
return /* @__PURE__ */ n("div", {
|
|
88
|
+
className: e("w-full px-4 py-3 sm:px-6 sm:py-4", "bg-surface/90", "border-b border-border", "sticky top-0 z-30", o),
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
children: [r && /* @__PURE__ */ n("div", {
|
|
91
|
+
className: "flex items-center gap-1.5 mb-2.5",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ t(i, {
|
|
94
|
+
height: 10,
|
|
95
|
+
width: 72
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ t(i, {
|
|
98
|
+
height: 10,
|
|
99
|
+
width: 6,
|
|
100
|
+
rounded: "full"
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ t(i, {
|
|
103
|
+
height: 10,
|
|
104
|
+
width: 52
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
}), /* @__PURE__ */ n("div", {
|
|
108
|
+
className: "flex items-center justify-between gap-4",
|
|
109
|
+
children: [/* @__PURE__ */ n("div", {
|
|
110
|
+
className: "space-y-1.5",
|
|
111
|
+
children: [/* @__PURE__ */ t(i, {
|
|
112
|
+
height: 18,
|
|
113
|
+
width: 148
|
|
114
|
+
}), /* @__PURE__ */ t(i, {
|
|
115
|
+
height: 11,
|
|
116
|
+
width: 196
|
|
117
|
+
})]
|
|
118
|
+
}), a && /* @__PURE__ */ t(i, {
|
|
119
|
+
height: 30,
|
|
120
|
+
width: 100,
|
|
121
|
+
rounded: "lg"
|
|
122
|
+
})]
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function u({ rows: r = 5, cols: a = 4, className: o }) {
|
|
127
|
+
return /* @__PURE__ */ n("div", {
|
|
128
|
+
className: e("overflow-hidden rounded-[var(--radius-lg)] border border-border", o),
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
children: [/* @__PURE__ */ t("div", {
|
|
131
|
+
className: "flex items-center gap-4 border-b border-border bg-surface-muted px-4 py-3",
|
|
132
|
+
children: Array.from({ length: a }).map((e, n) => /* @__PURE__ */ t(i, {
|
|
133
|
+
height: 11,
|
|
134
|
+
width: `${50 + n * 13 % 50}px`
|
|
135
|
+
}, n))
|
|
136
|
+
}), Array.from({ length: r }).map((e, n) => /* @__PURE__ */ t("div", {
|
|
137
|
+
className: "flex items-center gap-4 border-b border-border px-4 py-3 last:border-none",
|
|
138
|
+
children: Array.from({ length: a }).map((e, r) => /* @__PURE__ */ t(i, {
|
|
139
|
+
height: 13,
|
|
140
|
+
width: `${55 + (n + r) * 11 % 45}%`
|
|
141
|
+
}, r))
|
|
142
|
+
}, n))]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
export { i as Skeleton, s as SkeletonAvatar, c as SkeletonCard, u as SkeletonTable, a as SkeletonText, l as SkeletonTopbar };
|
|
@@ -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=(0,n.forwardRef)(({className:i,label:a,hint:o,error:s,showValue:c=!0,formatValue:l,min:u=0,max:d=100,step:f=1,value:p,defaultValue:m,onChange:h,disabled:g,id:_,...v},y)=>{let b=(0,n.useId)(),x=_??b,S=`${x}-message`,[C,w]=(0,n.useState)(Number(p??m??u));(0,n.useEffect)(()=>{p!==void 0&&w(Number(p))},[p]);let T=Number(p??C),E=d===u?0:Math.min(100,Math.max(0,(T-u)/(d-u)*100)),D=l?l(T):String(T);return(0,r.jsxs)(`div`,{className:e.t(t.o,i),children:[(a||c)&&(0,r.jsxs)(`div`,{className:`flex items-center justify-between`,children:[a&&(0,r.jsx)(`label`,{htmlFor:x,className:`text-sm font-medium leading-5 text-foreground`,children:a}),c&&(0,r.jsx)(`output`,{htmlFor:x,className:`text-sm font-medium tabular-nums text-foreground`,children:D})]}),(0,r.jsxs)(`div`,{className:`relative flex items-center h-5`,children:[(0,r.jsx)(`div`,{className:`absolute inset-x-0 h-1.5 rounded-full bg-muted`,children:(0,r.jsx)(`div`,{className:`absolute left-0 top-0 h-full rounded-full bg-accent-500`,style:{width:`${E}%`}})}),(0,r.jsx)(`input`,{ref:y,type:`range`,id:x,min:u,max:d,step:f,value:T,disabled:g,"aria-invalid":s?!0:void 0,"aria-describedby":s||o?S:void 0,"aria-valuetext":D,onChange:e=>{let t=Number(e.target.value);p===void 0&&w(t),h?.(e)},className:e.t(`relative w-full appearance-none bg-transparent cursor-pointer`,`focus-visible:outline-none focus-visible:[&::-webkit-slider-thumb]:ring-4 focus-visible:[&::-webkit-slider-thumb]:ring-focus-ring/25`,`disabled:cursor-not-allowed disabled:opacity-50`,`[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4`,`[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white`,`[&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-accent-500`,`[&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full`,`[&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-accent-500`,`[&::-moz-range-thumb]:shadow-md`),...v})]}),s&&(0,r.jsx)(`p`,{id:S,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:s}),o&&!s&&(0,r.jsx)(`p`,{id:S,className:`text-xs leading-5 text-muted-foreground`,children:o})]})});i.displayName=`Slider`,exports.Slider=i;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
hint?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
showValue?: boolean;
|
|
7
|
+
formatValue?: (v: number) => string;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
step?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const Slider: import('react').ForwardRefExoticComponent<SliderProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { o as t } from "../component-styles-Ce56hn9T.js";
|
|
4
|
+
import { forwardRef as n, useEffect as r, useId as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/slider.tsx
|
|
7
|
+
var c = n(({ className: n, label: c, hint: l, error: u, showValue: d = !0, formatValue: f, min: p = 0, max: m = 100, step: h = 1, value: g, defaultValue: _, onChange: v, disabled: y, id: b, ...x }, S) => {
|
|
8
|
+
let C = i(), w = b ?? C, T = `${w}-message`, [E, D] = a(Number(g ?? _ ?? p));
|
|
9
|
+
r(() => {
|
|
10
|
+
g !== void 0 && D(Number(g));
|
|
11
|
+
}, [g]);
|
|
12
|
+
let O = Number(g ?? E), k = m === p ? 0 : Math.min(100, Math.max(0, (O - p) / (m - p) * 100)), A = f ? f(O) : String(O);
|
|
13
|
+
return /* @__PURE__ */ s("div", {
|
|
14
|
+
className: e(t, n),
|
|
15
|
+
children: [
|
|
16
|
+
(c || d) && /* @__PURE__ */ s("div", {
|
|
17
|
+
className: "flex items-center justify-between",
|
|
18
|
+
children: [c && /* @__PURE__ */ o("label", {
|
|
19
|
+
htmlFor: w,
|
|
20
|
+
className: "text-sm font-medium leading-5 text-foreground",
|
|
21
|
+
children: c
|
|
22
|
+
}), d && /* @__PURE__ */ o("output", {
|
|
23
|
+
htmlFor: w,
|
|
24
|
+
className: "text-sm font-medium tabular-nums text-foreground",
|
|
25
|
+
children: A
|
|
26
|
+
})]
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ s("div", {
|
|
29
|
+
className: "relative flex items-center h-5",
|
|
30
|
+
children: [/* @__PURE__ */ o("div", {
|
|
31
|
+
className: "absolute inset-x-0 h-1.5 rounded-full bg-muted",
|
|
32
|
+
children: /* @__PURE__ */ o("div", {
|
|
33
|
+
className: "absolute left-0 top-0 h-full rounded-full bg-accent-500",
|
|
34
|
+
style: { width: `${k}%` }
|
|
35
|
+
})
|
|
36
|
+
}), /* @__PURE__ */ o("input", {
|
|
37
|
+
ref: S,
|
|
38
|
+
type: "range",
|
|
39
|
+
id: w,
|
|
40
|
+
min: p,
|
|
41
|
+
max: m,
|
|
42
|
+
step: h,
|
|
43
|
+
value: O,
|
|
44
|
+
disabled: y,
|
|
45
|
+
"aria-invalid": u ? !0 : void 0,
|
|
46
|
+
"aria-describedby": u || l ? T : void 0,
|
|
47
|
+
"aria-valuetext": A,
|
|
48
|
+
onChange: (e) => {
|
|
49
|
+
let t = Number(e.target.value);
|
|
50
|
+
g === void 0 && D(t), v?.(e);
|
|
51
|
+
},
|
|
52
|
+
className: e("relative w-full appearance-none bg-transparent cursor-pointer", "focus-visible:outline-none focus-visible:[&::-webkit-slider-thumb]:ring-4 focus-visible:[&::-webkit-slider-thumb]:ring-focus-ring/25", "disabled:cursor-not-allowed disabled:opacity-50", "[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4", "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white", "[&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-accent-500", "[&::-webkit-slider-thumb]:shadow-sm", "[&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full", "[&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-accent-500", "[&::-moz-range-thumb]:shadow-md"),
|
|
53
|
+
...x
|
|
54
|
+
})]
|
|
55
|
+
}),
|
|
56
|
+
u && /* @__PURE__ */ o("p", {
|
|
57
|
+
id: T,
|
|
58
|
+
"aria-live": "polite",
|
|
59
|
+
className: "text-xs leading-5 text-destructive",
|
|
60
|
+
children: u
|
|
61
|
+
}),
|
|
62
|
+
l && !u && /* @__PURE__ */ o("p", {
|
|
63
|
+
id: T,
|
|
64
|
+
className: "text-xs leading-5 text-muted-foreground",
|
|
65
|
+
children: l
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
c.displayName = "Slider";
|
|
71
|
+
//#endregion
|
|
72
|
+
export { c as Slider };
|
|
@@ -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("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=(0,r.createContext)(null);function o(){let e=(0,r.useContext)(a);if(!e)throw Error(`useSnackbar must be inside <SnackbarProvider>`);return e}var s={default:{bg:`border-border bg-surface-raised`,icon:null},info:{bg:`bg-sky-500/[0.09] dark:bg-sky-500/[0.12] border-sky-500/25`,icon:(0,i.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-sky-400`,children:[(0,i.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,i.jsx)(`path`,{d:`M12 16v-4`}),(0,i.jsx)(`path`,{d:`M12 8h.01`})]})},success:{bg:`bg-emerald-500/[0.09] dark:bg-emerald-500/[0.12] border-emerald-500/25`,icon:(0,i.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-emerald-400`,children:[(0,i.jsx)(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),(0,i.jsx)(`path`,{d:`m9 11 3 3L22 4`})]})},warning:{bg:`bg-amber-500/[0.09] dark:bg-amber-500/[0.12] border-amber-500/25`,icon:(0,i.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-amber-400`,children:[(0,i.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,i.jsx)(`path`,{d:`M12 9v4`}),(0,i.jsx)(`path`,{d:`M12 17h.01`})]})},error:{bg:`bg-red-500/[0.09] dark:bg-red-500/[0.12] border-red-500/25`,icon:(0,i.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-red-400`,children:[(0,i.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,i.jsx)(`path`,{d:`m15 9-6 6`}),(0,i.jsx)(`path`,{d:`m9 9 6 6`})]})}},c={"top-left":`top-32 left-3 sm:top-4 sm:left-4`,"top-center":`top-32 left-1/2 -translate-x-1/2 sm:top-4`,"top-right":`top-32 right-3 sm:top-4 sm:right-4`,"bottom-left":`bottom-3 left-3 sm:bottom-4 sm:left-4`,"bottom-center":`bottom-3 left-1/2 -translate-x-1/2 sm:bottom-4`,"bottom-right":`bottom-3 right-3 sm:bottom-4 sm:right-4`},l={"top-left":{x:-14},"top-center":{y:-14},"top-right":{x:14},"bottom-left":{x:-14},"bottom-center":{y:14},"bottom-right":{x:14}};function u({children:o,position:u=`bottom-right`,maxVisible:d=5}){let[f,p]=(0,r.useState)([]),m=(0,r.useRef)({});(0,r.useEffect)(()=>()=>Object.values(m.current).forEach(clearTimeout),[]);let h=(0,r.useCallback)(e=>{clearTimeout(m.current[e]),delete m.current[e],p(t=>t.filter(t=>t.id!==e))},[]),g=(0,r.useCallback)(()=>{Object.values(m.current).forEach(clearTimeout),m.current={},p([])},[]),_=(0,r.useCallback)(e=>{let t=e.id??Math.random().toString(36).slice(2,9);p(n=>{let r=e.id?n.findIndex(e=>e.id===t):-1;if(r===-1)return[{...e,id:t},...n].slice(0,d);let i=[...n];return i[r]={...e,id:t},i}),clearTimeout(m.current[t]);let n=e.duration??4e3;return n>0&&(m.current[t]=setTimeout(()=>h(t),n)),t},[h,d]),v=l[u];return(0,i.jsxs)(a.Provider,{value:{show:_,dismiss:h,dismissAll:g},children:[o,(0,i.jsx)(`div`,{role:`region`,"aria-label":`Notifications`,"aria-live":`polite`,className:e.t(`fixed z-[100] flex flex-col gap-2 pointer-events-none`,c[u]),children:(0,i.jsx)(n.AnimatePresence,{mode:`popLayout`,children:f.map(r=>{let{bg:a,icon:o}=s[r.variant??`default`];return(0,i.jsxs)(n.motion.div,{layout:!0,initial:{...v,opacity:0,scale:.95},animate:{x:0,y:0,opacity:1,scale:1},exit:{opacity:0,scale:.92},transition:{type:`spring`,stiffness:400,damping:30},className:e.t(`pointer-events-auto flex items-start gap-3 rounded-[var(--radius-lg)] border px-4 py-3`,`w-[calc(100vw-1.5rem)] max-w-sm shadow-floating sm:w-auto sm:min-w-[280px]`,a),children:[o&&(0,i.jsx)(`span`,{className:`shrink-0 mt-0.5`,children:o}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`div`,{className:`text-sm leading-snug text-foreground`,children:r.message}),r.action&&(0,i.jsx)(`button`,{type:`button`,onClick:()=>{r.action.onClick(),h(r.id)},className:`mt-1.5 text-xs font-semibold text-accent-600 dark:text-accent-400 hover:text-accent-700 dark:hover:text-accent-300 transition-colors`,children:r.action.label})]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>h(r.id),"aria-label":`Dismiss`,className:e.t(`mt-0.5 shrink-0 text-muted-foreground transition-colors hover:text-foreground`,t.s),children:(0,i.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,i.jsx)(`path`,{d:`M18 6 6 18`}),(0,i.jsx)(`path`,{d:`m6 6 12 12`})]})})]},r.id)})})})]})}exports.SnackbarProvider=u,exports.useSnackbar=o;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type SnackbarVariant = "default" | "info" | "success" | "warning" | "error";
|
|
3
|
+
export type SnackbarPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
4
|
+
export interface SnackbarOptions {
|
|
5
|
+
message: ReactNode;
|
|
6
|
+
variant?: SnackbarVariant;
|
|
7
|
+
/** Auto-dismiss delay in ms. Set to 0 to persist until dismissed. Default: 4000 */
|
|
8
|
+
duration?: number;
|
|
9
|
+
action?: {
|
|
10
|
+
label: string;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Stable id for deduplication — if a toast with this id is already
|
|
15
|
+
* showing, calling show() again with the same id replaces it in place
|
|
16
|
+
* (and resets its dismiss timer) instead of stacking a second copy.
|
|
17
|
+
* Without an id, every call always adds a new toast, even if the
|
|
18
|
+
* message is identical to one already on screen (e.g. two components
|
|
19
|
+
* independently failing the same request in the same render pass).
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
interface SnackbarContextValue {
|
|
24
|
+
show: (opts: SnackbarOptions) => string;
|
|
25
|
+
dismiss: (id: string) => void;
|
|
26
|
+
dismissAll: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function useSnackbar(): SnackbarContextValue;
|
|
29
|
+
export interface SnackbarProviderProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
position?: SnackbarPosition;
|
|
32
|
+
maxVisible?: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function SnackbarProvider({ children, position, maxVisible, }: SnackbarProviderProps): import("react").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { s as t } from "../component-styles-Ce56hn9T.js";
|
|
4
|
+
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
5
|
+
import { createContext as i, useCallback as a, useContext as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/snackbar.tsx
|
|
8
|
+
var f = i(null);
|
|
9
|
+
function p() {
|
|
10
|
+
let e = o(f);
|
|
11
|
+
if (!e) throw Error("useSnackbar must be inside <SnackbarProvider>");
|
|
12
|
+
return e;
|
|
13
|
+
}
|
|
14
|
+
var m = {
|
|
15
|
+
default: {
|
|
16
|
+
bg: "border-border bg-surface-raised",
|
|
17
|
+
icon: null
|
|
18
|
+
},
|
|
19
|
+
info: {
|
|
20
|
+
bg: "bg-sky-500/[0.09] dark:bg-sky-500/[0.12] border-sky-500/25",
|
|
21
|
+
icon: /* @__PURE__ */ d("svg", {
|
|
22
|
+
width: "15",
|
|
23
|
+
height: "15",
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: "none",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeWidth: "2",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round",
|
|
30
|
+
className: "text-sky-400",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ u("circle", {
|
|
33
|
+
cx: "12",
|
|
34
|
+
cy: "12",
|
|
35
|
+
r: "10"
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ u("path", { d: "M12 16v-4" }),
|
|
38
|
+
/* @__PURE__ */ u("path", { d: "M12 8h.01" })
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
success: {
|
|
43
|
+
bg: "bg-emerald-500/[0.09] dark:bg-emerald-500/[0.12] border-emerald-500/25",
|
|
44
|
+
icon: /* @__PURE__ */ d("svg", {
|
|
45
|
+
width: "15",
|
|
46
|
+
height: "15",
|
|
47
|
+
viewBox: "0 0 24 24",
|
|
48
|
+
fill: "none",
|
|
49
|
+
stroke: "currentColor",
|
|
50
|
+
strokeWidth: "2",
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeLinejoin: "round",
|
|
53
|
+
className: "text-emerald-400",
|
|
54
|
+
children: [/* @__PURE__ */ u("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ u("path", { d: "m9 11 3 3L22 4" })]
|
|
55
|
+
})
|
|
56
|
+
},
|
|
57
|
+
warning: {
|
|
58
|
+
bg: "bg-amber-500/[0.09] dark:bg-amber-500/[0.12] border-amber-500/25",
|
|
59
|
+
icon: /* @__PURE__ */ d("svg", {
|
|
60
|
+
width: "15",
|
|
61
|
+
height: "15",
|
|
62
|
+
viewBox: "0 0 24 24",
|
|
63
|
+
fill: "none",
|
|
64
|
+
stroke: "currentColor",
|
|
65
|
+
strokeWidth: "2",
|
|
66
|
+
strokeLinecap: "round",
|
|
67
|
+
strokeLinejoin: "round",
|
|
68
|
+
className: "text-amber-400",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ u("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
71
|
+
/* @__PURE__ */ u("path", { d: "M12 9v4" }),
|
|
72
|
+
/* @__PURE__ */ u("path", { d: "M12 17h.01" })
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
},
|
|
76
|
+
error: {
|
|
77
|
+
bg: "bg-red-500/[0.09] dark:bg-red-500/[0.12] border-red-500/25",
|
|
78
|
+
icon: /* @__PURE__ */ d("svg", {
|
|
79
|
+
width: "15",
|
|
80
|
+
height: "15",
|
|
81
|
+
viewBox: "0 0 24 24",
|
|
82
|
+
fill: "none",
|
|
83
|
+
stroke: "currentColor",
|
|
84
|
+
strokeWidth: "2",
|
|
85
|
+
strokeLinecap: "round",
|
|
86
|
+
strokeLinejoin: "round",
|
|
87
|
+
className: "text-red-400",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ u("circle", {
|
|
90
|
+
cx: "12",
|
|
91
|
+
cy: "12",
|
|
92
|
+
r: "10"
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ u("path", { d: "m15 9-6 6" }),
|
|
95
|
+
/* @__PURE__ */ u("path", { d: "m9 9 6 6" })
|
|
96
|
+
]
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
}, h = {
|
|
100
|
+
"top-left": "top-32 left-3 sm:top-4 sm:left-4",
|
|
101
|
+
"top-center": "top-32 left-1/2 -translate-x-1/2 sm:top-4",
|
|
102
|
+
"top-right": "top-32 right-3 sm:top-4 sm:right-4",
|
|
103
|
+
"bottom-left": "bottom-3 left-3 sm:bottom-4 sm:left-4",
|
|
104
|
+
"bottom-center": "bottom-3 left-1/2 -translate-x-1/2 sm:bottom-4",
|
|
105
|
+
"bottom-right": "bottom-3 right-3 sm:bottom-4 sm:right-4"
|
|
106
|
+
}, g = {
|
|
107
|
+
"top-left": { x: -14 },
|
|
108
|
+
"top-center": { y: -14 },
|
|
109
|
+
"top-right": { x: 14 },
|
|
110
|
+
"bottom-left": { x: -14 },
|
|
111
|
+
"bottom-center": { y: 14 },
|
|
112
|
+
"bottom-right": { x: 14 }
|
|
113
|
+
};
|
|
114
|
+
function _({ children: i, position: o = "bottom-right", maxVisible: p = 5 }) {
|
|
115
|
+
let [_, v] = l([]), y = c({});
|
|
116
|
+
s(() => () => Object.values(y.current).forEach(clearTimeout), []);
|
|
117
|
+
let b = a((e) => {
|
|
118
|
+
clearTimeout(y.current[e]), delete y.current[e], v((t) => t.filter((t) => t.id !== e));
|
|
119
|
+
}, []), x = a(() => {
|
|
120
|
+
Object.values(y.current).forEach(clearTimeout), y.current = {}, v([]);
|
|
121
|
+
}, []), S = a((e) => {
|
|
122
|
+
let t = e.id ?? Math.random().toString(36).slice(2, 9);
|
|
123
|
+
v((n) => {
|
|
124
|
+
let r = e.id ? n.findIndex((e) => e.id === t) : -1;
|
|
125
|
+
if (r === -1) return [{
|
|
126
|
+
...e,
|
|
127
|
+
id: t
|
|
128
|
+
}, ...n].slice(0, p);
|
|
129
|
+
let i = [...n];
|
|
130
|
+
return i[r] = {
|
|
131
|
+
...e,
|
|
132
|
+
id: t
|
|
133
|
+
}, i;
|
|
134
|
+
}), clearTimeout(y.current[t]);
|
|
135
|
+
let n = e.duration ?? 4e3;
|
|
136
|
+
return n > 0 && (y.current[t] = setTimeout(() => b(t), n)), t;
|
|
137
|
+
}, [b, p]), C = g[o];
|
|
138
|
+
return /* @__PURE__ */ d(f.Provider, {
|
|
139
|
+
value: {
|
|
140
|
+
show: S,
|
|
141
|
+
dismiss: b,
|
|
142
|
+
dismissAll: x
|
|
143
|
+
},
|
|
144
|
+
children: [i, /* @__PURE__ */ u("div", {
|
|
145
|
+
role: "region",
|
|
146
|
+
"aria-label": "Notifications",
|
|
147
|
+
"aria-live": "polite",
|
|
148
|
+
className: e("fixed z-[100] flex flex-col gap-2 pointer-events-none", h[o]),
|
|
149
|
+
children: /* @__PURE__ */ u(n, {
|
|
150
|
+
mode: "popLayout",
|
|
151
|
+
children: _.map((n) => {
|
|
152
|
+
let { bg: i, icon: a } = m[n.variant ?? "default"];
|
|
153
|
+
return /* @__PURE__ */ d(r.div, {
|
|
154
|
+
layout: !0,
|
|
155
|
+
initial: {
|
|
156
|
+
...C,
|
|
157
|
+
opacity: 0,
|
|
158
|
+
scale: .95
|
|
159
|
+
},
|
|
160
|
+
animate: {
|
|
161
|
+
x: 0,
|
|
162
|
+
y: 0,
|
|
163
|
+
opacity: 1,
|
|
164
|
+
scale: 1
|
|
165
|
+
},
|
|
166
|
+
exit: {
|
|
167
|
+
opacity: 0,
|
|
168
|
+
scale: .92
|
|
169
|
+
},
|
|
170
|
+
transition: {
|
|
171
|
+
type: "spring",
|
|
172
|
+
stiffness: 400,
|
|
173
|
+
damping: 30
|
|
174
|
+
},
|
|
175
|
+
className: e("pointer-events-auto flex items-start gap-3 rounded-[var(--radius-lg)] border px-4 py-3", "w-[calc(100vw-1.5rem)] max-w-sm shadow-floating sm:w-auto sm:min-w-[280px]", i),
|
|
176
|
+
children: [
|
|
177
|
+
a && /* @__PURE__ */ u("span", {
|
|
178
|
+
className: "shrink-0 mt-0.5",
|
|
179
|
+
children: a
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ d("div", {
|
|
182
|
+
className: "flex-1 min-w-0",
|
|
183
|
+
children: [/* @__PURE__ */ u("div", {
|
|
184
|
+
className: "text-sm leading-snug text-foreground",
|
|
185
|
+
children: n.message
|
|
186
|
+
}), n.action && /* @__PURE__ */ u("button", {
|
|
187
|
+
type: "button",
|
|
188
|
+
onClick: () => {
|
|
189
|
+
n.action.onClick(), b(n.id);
|
|
190
|
+
},
|
|
191
|
+
className: "mt-1.5 text-xs font-semibold text-accent-600 dark:text-accent-400 hover:text-accent-700 dark:hover:text-accent-300 transition-colors",
|
|
192
|
+
children: n.action.label
|
|
193
|
+
})]
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ u("button", {
|
|
196
|
+
type: "button",
|
|
197
|
+
onClick: () => b(n.id),
|
|
198
|
+
"aria-label": "Dismiss",
|
|
199
|
+
className: e("mt-0.5 shrink-0 text-muted-foreground transition-colors hover:text-foreground", t),
|
|
200
|
+
children: /* @__PURE__ */ d("svg", {
|
|
201
|
+
width: "14",
|
|
202
|
+
height: "14",
|
|
203
|
+
viewBox: "0 0 24 24",
|
|
204
|
+
fill: "none",
|
|
205
|
+
stroke: "currentColor",
|
|
206
|
+
strokeWidth: "2.5",
|
|
207
|
+
strokeLinecap: "round",
|
|
208
|
+
strokeLinejoin: "round",
|
|
209
|
+
children: [/* @__PURE__ */ u("path", { d: "M18 6 6 18" }), /* @__PURE__ */ u("path", { d: "m6 6 12 12" })]
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
}, n.id);
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
})]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
export { _ as SnackbarProvider, p as useSnackbar };
|
|
@@ -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={xs:`w-3 h-3`,sm:`w-4 h-4`,md:`w-5 h-5`,lg:`w-7 h-7`};function r({size:r=`md`,className:i}){return(0,t.jsxs)(`svg`,{className:e.t(`animate-spin text-accent-500 dark:text-accent-400`,n[r],i),viewBox:`0 0 24 24`,fill:`none`,"aria-label":`Loading`,children:[(0,t.jsx)(`circle`,{className:`opacity-20`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`}),(0,t.jsx)(`path`,{className:`opacity-80`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]})}exports.Spinner=r;
|