@bzync/rui 0.0.5 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +476 -57
- package/dist/autocomplete-D6z5B-WU.cjs +1 -0
- package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
- package/dist/calendar-CQumLNgS.cjs +1 -0
- package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
- package/dist/charts-Cot5lCgC.cjs +1 -0
- package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
- package/dist/cn-B6R3HKzx.cjs +1 -0
- package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
- package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
- package/dist/component-styles-DY4wigiq.cjs +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +3 -3
- package/dist/components/aspect-ratio.cjs +1 -1
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/auth-backdrop.cjs +1 -1
- package/dist/components/auth-backdrop.d.ts +4 -1
- package/dist/components/auth-backdrop.js +12 -8
- package/dist/components/autocomplete/dropdown.d.ts +4 -1
- package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
- package/dist/components/autocomplete/single-trigger.d.ts +3 -1
- package/dist/components/autocomplete/types.d.ts +15 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -1
- package/dist/components/avatar-group.js +1 -1
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/billing-interval-toggle.cjs +1 -1
- package/dist/components/billing-interval-toggle.d.ts +4 -6
- package/dist/components/billing-interval-toggle.js +26 -19
- package/dist/components/blockquote.cjs +1 -1
- package/dist/components/blockquote.js +3 -3
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +79 -36
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.js +14 -14
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts.cjs +1 -1
- package/dist/components/charts.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/code.cjs +3 -3
- package/dist/components/code.js +4 -4
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.d.ts +8 -1
- package/dist/components/command.js +84 -83
- package/dist/components/confirm-dialog.cjs +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -1
- package/dist/components/confirm-dialog.js +37 -31
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +3 -2
- package/dist/components/currency.cjs +1 -1
- package/dist/components/currency.js +1 -1
- package/dist/components/datatable/types.d.ts +4 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.d.ts +1 -5
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.d.ts +3 -3
- package/dist/components/datepicker.js +234 -105
- package/dist/components/description-list.cjs +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/divider.cjs +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.d.ts +6 -1
- package/dist/components/drawer.js +128 -2
- package/dist/components/dropdown-menu-panel.cjs +1 -0
- package/dist/components/dropdown-menu-panel.d.ts +24 -0
- package/dist/components/dropdown-menu-panel.js +84 -0
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +38 -93
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.ts +5 -1
- package/dist/components/empty-state.js +9 -9
- package/dist/components/error-state.cjs +1 -1
- package/dist/components/error-state.js +2 -2
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +4 -4
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.d.ts +9 -0
- package/dist/components/form-field.js +49 -14
- package/dist/components/info-button.cjs +1 -1
- package/dist/components/info-button.d.ts +5 -3
- package/dist/components/info-button.js +33 -29
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.d.ts +8 -1
- package/dist/components/modal.js +74 -120
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +2 -2
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +3 -3
- package/dist/components/otp-input.cjs +1 -1
- package/dist/components/otp-input.js +2 -2
- package/dist/components/overlay.cjs +1 -0
- package/dist/components/overlay.d.ts +52 -0
- package/dist/components/overlay.js +87 -0
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.ts +2 -1
- package/dist/components/popover.js +41 -40
- package/dist/components/progressbar.cjs +1 -1
- package/dist/components/progressbar.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +3 -3
- package/dist/components/rating.cjs +1 -1
- package/dist/components/rating.js +3 -3
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +45 -18
- package/dist/components/scroll-area.cjs +1 -1
- package/dist/components/scroll-area.js +3 -3
- package/dist/components/select/option-list.d.ts +3 -1
- package/dist/components/select/types.d.ts +4 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/seo.cjs +1 -1
- package/dist/components/seo.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +14 -1
- package/dist/components/skeleton.js +56 -4
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slot.cjs +1 -0
- package/dist/components/slot.d.ts +12 -0
- package/dist/components/slot.js +16 -0
- package/dist/components/snackbar-viewport.cjs +1 -0
- package/dist/components/snackbar-viewport.d.ts +27 -0
- package/dist/components/snackbar-viewport.js +181 -0
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.d.ts +5 -1
- package/dist/components/snackbar.js +36 -200
- package/dist/components/spinner.cjs +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.cjs +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.js +5 -5
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.js +37 -43
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.d.ts +6 -4
- package/dist/components/tabs.js +51 -81
- package/dist/components/tag.cjs +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/terminal.cjs +1 -1
- package/dist/components/terminal.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/theme-provider.cjs +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +27 -3
- package/dist/components/time-picker.cjs +1 -1
- package/dist/components/time-picker.d.ts +2 -0
- package/dist/components/time-picker.js +206 -148
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -1
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +37 -36
- package/dist/components/tree.cjs +1 -1
- package/dist/components/tree.js +1 -1
- package/dist/components/typography.cjs +1 -1
- package/dist/components/typography.d.ts +2 -3
- package/dist/components/typography.js +37 -24
- package/dist/components/visually-hidden.cjs +1 -0
- package/dist/components/visually-hidden.d.ts +16 -0
- package/dist/components/visually-hidden.js +13 -0
- package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
- package/dist/datatable-t0U7t_xh.cjs +1 -0
- package/dist/icons-Dfetr1L2.cjs +1 -0
- package/dist/icons-Dk7VZ4Ph.js +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +126 -99
- package/dist/lib/cn.d.ts +13 -1
- package/dist/lib/component-styles.d.ts +14 -2
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/motion.d.ts +58 -0
- package/dist/motion-B2shivEB.cjs +1 -0
- package/dist/motion-gnRzFS5f.js +62 -0
- package/dist/select-ByjnuEcE.cjs +1 -0
- package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
- package/dist/styles.css +1 -1
- package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
- package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
- package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
- package/dist/use-focus-trap-CS6BXJAB.js +77 -0
- package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
- package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
- package/package.json +56 -9
- package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
- package/dist/calendar-CUXpVrVE.cjs +0 -1
- package/dist/charts-UDqS1BH1.cjs +0 -1
- package/dist/cn-BdjraxxU.cjs +0 -1
- package/dist/component-styles-DOUctc8_.cjs +0 -1
- package/dist/createLucideIcon-DDY8HuQR.js +0 -42
- package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
- package/dist/datatable-rzDgQ3r6.cjs +0 -1
- package/dist/drawer-CTeBsYrO.cjs +0 -1
- package/dist/drawer-ixuzyLVS.js +0 -189
- package/dist/select-BFwx--uK.cjs +0 -1
- package/dist/theme-toggle-Bb0BYo51.js +0 -71
- package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Slot — merges props onto its single child (Radix-style asChild pattern).
|
|
4
|
+
* Use for polymorphic composition without unsafe `as` strings.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* <Button asChild><a href="/dashboard">Dashboard</a></Button>
|
|
8
|
+
*/
|
|
9
|
+
export interface SlotProps extends HTMLAttributes<HTMLElement> {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Slot: import('react').ForwardRefExoticComponent<SlotProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { cloneElement as t, forwardRef as n, isValidElement as r } from "react";
|
|
4
|
+
//#region src/components/slot.tsx
|
|
5
|
+
var i = n(({ children: n, ...i }, a) => {
|
|
6
|
+
if (!r(n)) return null;
|
|
7
|
+
let o = n.props, s = e(o.className, i.className), c = {
|
|
8
|
+
...o,
|
|
9
|
+
...i,
|
|
10
|
+
className: s || void 0
|
|
11
|
+
};
|
|
12
|
+
return a && (c.ref = a), t(n, c);
|
|
13
|
+
});
|
|
14
|
+
i.displayName = "Slot";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { i as Slot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs"),n=require("../motion-B2shivEB.cjs");let r=require("framer-motion"),i=require("react/jsx-runtime");var a={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`})]})}},o={"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`},s={"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 c({items:c,position:l,className:u,toastClassName:d,onDismiss:f}){let p=s[l];return(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`,o[l],u),children:(0,i.jsx)(r.AnimatePresence,{mode:`popLayout`,children:c.map(o=>{let{bg:s,icon:c}=a[o.variant??`default`];return(0,i.jsxs)(r.motion.div,{layout:!0,initial:{...p,opacity:0,scale:.95},animate:{x:0,y:0,opacity:1,scale:1},exit:{opacity:0,scale:.92},transition:n.t.spring.snappy,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]`,s,d,o.className),children:[c&&(0,i.jsx)(`span`,{className:`shrink-0 mt-0.5`,children:c}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`div`,{className:`text-sm leading-snug text-foreground`,children:o.message}),o.action&&(0,i.jsx)(`button`,{type:`button`,onClick:()=>{o.action.onClick(),f(o.id)},className:e.t(`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`,o.actionClassName),children:o.action.label})]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>f(o.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`})]})})]},o.id)})})})}module.exports=c;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SnackbarPosition, SnackbarVariant } from './snackbar';
|
|
3
|
+
interface SnackbarItem {
|
|
4
|
+
id: string;
|
|
5
|
+
message: ReactNode;
|
|
6
|
+
variant?: SnackbarVariant;
|
|
7
|
+
className?: string;
|
|
8
|
+
actionClassName?: string;
|
|
9
|
+
action?: {
|
|
10
|
+
label: string;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface SnackbarViewportProps {
|
|
15
|
+
items: SnackbarItem[];
|
|
16
|
+
position: SnackbarPosition;
|
|
17
|
+
className?: string;
|
|
18
|
+
toastClassName?: string;
|
|
19
|
+
onDismiss: (id: string) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The framer-motion-backed toast stack for {@link SnackbarProvider}, split into
|
|
23
|
+
* its own async chunk so the motion runtime stays off the initial critical
|
|
24
|
+
* path — it loads the first time a toast is shown, not on page load.
|
|
25
|
+
*/
|
|
26
|
+
export default function SnackbarViewport({ items, position, className, toastClassName, onDismiss, }: SnackbarViewportProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { s as t } from "../component-styles-C2CbHEEA.js";
|
|
4
|
+
import { t as n } from "../motion-gnRzFS5f.js";
|
|
5
|
+
import { AnimatePresence as r, motion as i } from "framer-motion";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/snackbar-viewport.tsx
|
|
8
|
+
var s = {
|
|
9
|
+
default: {
|
|
10
|
+
bg: "border-border bg-surface-raised",
|
|
11
|
+
icon: null
|
|
12
|
+
},
|
|
13
|
+
info: {
|
|
14
|
+
bg: "bg-sky-500/[0.09] dark:bg-sky-500/[0.12] border-sky-500/25",
|
|
15
|
+
icon: /* @__PURE__ */ o("svg", {
|
|
16
|
+
width: "15",
|
|
17
|
+
height: "15",
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
fill: "none",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
strokeWidth: "2",
|
|
22
|
+
strokeLinecap: "round",
|
|
23
|
+
strokeLinejoin: "round",
|
|
24
|
+
className: "text-sky-400",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ a("circle", {
|
|
27
|
+
cx: "12",
|
|
28
|
+
cy: "12",
|
|
29
|
+
r: "10"
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ a("path", { d: "M12 16v-4" }),
|
|
32
|
+
/* @__PURE__ */ a("path", { d: "M12 8h.01" })
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
},
|
|
36
|
+
success: {
|
|
37
|
+
bg: "bg-emerald-500/[0.09] dark:bg-emerald-500/[0.12] border-emerald-500/25",
|
|
38
|
+
icon: /* @__PURE__ */ o("svg", {
|
|
39
|
+
width: "15",
|
|
40
|
+
height: "15",
|
|
41
|
+
viewBox: "0 0 24 24",
|
|
42
|
+
fill: "none",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
strokeWidth: "2",
|
|
45
|
+
strokeLinecap: "round",
|
|
46
|
+
strokeLinejoin: "round",
|
|
47
|
+
className: "text-emerald-400",
|
|
48
|
+
children: [/* @__PURE__ */ a("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ a("path", { d: "m9 11 3 3L22 4" })]
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
warning: {
|
|
52
|
+
bg: "bg-amber-500/[0.09] dark:bg-amber-500/[0.12] border-amber-500/25",
|
|
53
|
+
icon: /* @__PURE__ */ o("svg", {
|
|
54
|
+
width: "15",
|
|
55
|
+
height: "15",
|
|
56
|
+
viewBox: "0 0 24 24",
|
|
57
|
+
fill: "none",
|
|
58
|
+
stroke: "currentColor",
|
|
59
|
+
strokeWidth: "2",
|
|
60
|
+
strokeLinecap: "round",
|
|
61
|
+
strokeLinejoin: "round",
|
|
62
|
+
className: "text-amber-400",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ a("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" }),
|
|
65
|
+
/* @__PURE__ */ a("path", { d: "M12 9v4" }),
|
|
66
|
+
/* @__PURE__ */ a("path", { d: "M12 17h.01" })
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
},
|
|
70
|
+
error: {
|
|
71
|
+
bg: "bg-red-500/[0.09] dark:bg-red-500/[0.12] border-red-500/25",
|
|
72
|
+
icon: /* @__PURE__ */ o("svg", {
|
|
73
|
+
width: "15",
|
|
74
|
+
height: "15",
|
|
75
|
+
viewBox: "0 0 24 24",
|
|
76
|
+
fill: "none",
|
|
77
|
+
stroke: "currentColor",
|
|
78
|
+
strokeWidth: "2",
|
|
79
|
+
strokeLinecap: "round",
|
|
80
|
+
strokeLinejoin: "round",
|
|
81
|
+
className: "text-red-400",
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ a("circle", {
|
|
84
|
+
cx: "12",
|
|
85
|
+
cy: "12",
|
|
86
|
+
r: "10"
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ a("path", { d: "m15 9-6 6" }),
|
|
89
|
+
/* @__PURE__ */ a("path", { d: "m9 9 6 6" })
|
|
90
|
+
]
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
}, c = {
|
|
94
|
+
"top-left": "top-32 left-3 sm:top-4 sm:left-4",
|
|
95
|
+
"top-center": "top-32 left-1/2 -translate-x-1/2 sm:top-4",
|
|
96
|
+
"top-right": "top-32 right-3 sm:top-4 sm:right-4",
|
|
97
|
+
"bottom-left": "bottom-3 left-3 sm:bottom-4 sm:left-4",
|
|
98
|
+
"bottom-center": "bottom-3 left-1/2 -translate-x-1/2 sm:bottom-4",
|
|
99
|
+
"bottom-right": "bottom-3 right-3 sm:bottom-4 sm:right-4"
|
|
100
|
+
}, l = {
|
|
101
|
+
"top-left": { x: -14 },
|
|
102
|
+
"top-center": { y: -14 },
|
|
103
|
+
"top-right": { x: 14 },
|
|
104
|
+
"bottom-left": { x: -14 },
|
|
105
|
+
"bottom-center": { y: 14 },
|
|
106
|
+
"bottom-right": { x: 14 }
|
|
107
|
+
};
|
|
108
|
+
function u({ items: u, position: d, className: f, toastClassName: p, onDismiss: m }) {
|
|
109
|
+
let h = l[d];
|
|
110
|
+
return /* @__PURE__ */ a("div", {
|
|
111
|
+
role: "region",
|
|
112
|
+
"aria-label": "Notifications",
|
|
113
|
+
"aria-live": "polite",
|
|
114
|
+
className: e("fixed z-[100] flex flex-col gap-2 pointer-events-none", c[d], f),
|
|
115
|
+
children: /* @__PURE__ */ a(r, {
|
|
116
|
+
mode: "popLayout",
|
|
117
|
+
children: u.map((r) => {
|
|
118
|
+
let { bg: c, icon: l } = s[r.variant ?? "default"];
|
|
119
|
+
return /* @__PURE__ */ o(i.div, {
|
|
120
|
+
layout: !0,
|
|
121
|
+
initial: {
|
|
122
|
+
...h,
|
|
123
|
+
opacity: 0,
|
|
124
|
+
scale: .95
|
|
125
|
+
},
|
|
126
|
+
animate: {
|
|
127
|
+
x: 0,
|
|
128
|
+
y: 0,
|
|
129
|
+
opacity: 1,
|
|
130
|
+
scale: 1
|
|
131
|
+
},
|
|
132
|
+
exit: {
|
|
133
|
+
opacity: 0,
|
|
134
|
+
scale: .92
|
|
135
|
+
},
|
|
136
|
+
transition: n.spring.snappy,
|
|
137
|
+
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]", c, p, r.className),
|
|
138
|
+
children: [
|
|
139
|
+
l && /* @__PURE__ */ a("span", {
|
|
140
|
+
className: "shrink-0 mt-0.5",
|
|
141
|
+
children: l
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ o("div", {
|
|
144
|
+
className: "flex-1 min-w-0",
|
|
145
|
+
children: [/* @__PURE__ */ a("div", {
|
|
146
|
+
className: "text-sm leading-snug text-foreground",
|
|
147
|
+
children: r.message
|
|
148
|
+
}), r.action && /* @__PURE__ */ a("button", {
|
|
149
|
+
type: "button",
|
|
150
|
+
onClick: () => {
|
|
151
|
+
r.action.onClick(), m(r.id);
|
|
152
|
+
},
|
|
153
|
+
className: e("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", r.actionClassName),
|
|
154
|
+
children: r.action.label
|
|
155
|
+
})]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ a("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
onClick: () => m(r.id),
|
|
160
|
+
"aria-label": "Dismiss",
|
|
161
|
+
className: e("mt-0.5 shrink-0 text-muted-foreground transition-colors hover:text-foreground", t),
|
|
162
|
+
children: /* @__PURE__ */ o("svg", {
|
|
163
|
+
width: "14",
|
|
164
|
+
height: "14",
|
|
165
|
+
viewBox: "0 0 24 24",
|
|
166
|
+
fill: "none",
|
|
167
|
+
stroke: "currentColor",
|
|
168
|
+
strokeWidth: "2.5",
|
|
169
|
+
strokeLinecap: "round",
|
|
170
|
+
strokeLinejoin: "round",
|
|
171
|
+
children: [/* @__PURE__ */ a("path", { d: "M18 6 6 18" }), /* @__PURE__ */ a("path", { d: "m6 6 12 12" })]
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
}, r.id);
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
export { u as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime");var n=(0,e.lazy)(()=>Promise.resolve().then(()=>require("./snackbar-viewport.cjs"))),r=(0,e.createContext)(null);function i(){let t=(0,e.useContext)(r);if(!t)throw Error(`useSnackbar must be inside <SnackbarProvider>`);return t}function a({children:i,position:a=`bottom-right`,maxVisible:o=5,className:s,toastClassName:c}){let[l,u]=(0,e.useState)([]),[d,f]=(0,e.useState)(!1),p=(0,e.useRef)({});(0,e.useEffect)(()=>()=>Object.values(p.current).forEach(clearTimeout),[]),(0,e.useEffect)(()=>{l.length>0&&f(!0)},[l.length]);let m=(0,e.useCallback)(e=>{clearTimeout(p.current[e]),delete p.current[e],u(t=>t.filter(t=>t.id!==e))},[]),h=(0,e.useCallback)(()=>{Object.values(p.current).forEach(clearTimeout),p.current={},u([])},[]),g=(0,e.useCallback)(e=>{let t=e.id??Math.random().toString(36).slice(2,9);u(n=>{let r=e.id?n.findIndex(e=>e.id===t):-1;if(r===-1)return[{...e,id:t},...n].slice(0,o);let i=[...n];return i[r]={...e,id:t},i}),clearTimeout(p.current[t]);let n=e.duration??4e3;return n>0&&(p.current[t]=setTimeout(()=>m(t),n)),t},[m,o]);return(0,t.jsxs)(r.Provider,{value:{show:g,dismiss:m,dismissAll:h},children:[i,d&&(0,t.jsx)(e.Suspense,{fallback:null,children:(0,t.jsx)(n,{items:l,position:a,className:s,toastClassName:c,onDismiss:m})})]})}exports.SnackbarProvider=a,exports.useSnackbar=i;
|
|
@@ -4,6 +4,8 @@ export type SnackbarPosition = "top-left" | "top-center" | "top-right" | "bottom
|
|
|
4
4
|
export interface SnackbarOptions {
|
|
5
5
|
message: ReactNode;
|
|
6
6
|
variant?: SnackbarVariant;
|
|
7
|
+
className?: string;
|
|
8
|
+
actionClassName?: string;
|
|
7
9
|
/** Auto-dismiss delay in ms. Set to 0 to persist until dismissed. Default: 4000 */
|
|
8
10
|
duration?: number;
|
|
9
11
|
action?: {
|
|
@@ -30,6 +32,8 @@ export interface SnackbarProviderProps {
|
|
|
30
32
|
children: ReactNode;
|
|
31
33
|
position?: SnackbarPosition;
|
|
32
34
|
maxVisible?: number;
|
|
35
|
+
className?: string;
|
|
36
|
+
toastClassName?: string;
|
|
33
37
|
}
|
|
34
|
-
export declare function SnackbarProvider({ children, position, maxVisible, }: SnackbarProviderProps): import("react").JSX.Element;
|
|
38
|
+
export declare function SnackbarProvider({ children, position, maxVisible, className, toastClassName, }: SnackbarProviderProps): import("react").JSX.Element;
|
|
35
39
|
export {};
|
|
@@ -1,220 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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";
|
|
2
|
+
import { Suspense as e, createContext as t, lazy as n, useCallback as r, useContext as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
3
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
4
|
//#region src/components/snackbar.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let e =
|
|
5
|
+
var u = n(() => import("./snackbar-viewport.js")), d = t(null);
|
|
6
|
+
function f() {
|
|
7
|
+
let e = i(d);
|
|
11
8
|
if (!e) throw Error("useSnackbar must be inside <SnackbarProvider>");
|
|
12
9
|
return e;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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) => {
|
|
11
|
+
function p({ children: t, position: n = "bottom-right", maxVisible: i = 5, className: f, toastClassName: p }) {
|
|
12
|
+
let [m, h] = s([]), [g, _] = s(!1), v = o({});
|
|
13
|
+
a(() => () => Object.values(v.current).forEach(clearTimeout), []), a(() => {
|
|
14
|
+
m.length > 0 && _(!0);
|
|
15
|
+
}, [m.length]);
|
|
16
|
+
let y = r((e) => {
|
|
17
|
+
clearTimeout(v.current[e]), delete v.current[e], h((t) => t.filter((t) => t.id !== e));
|
|
18
|
+
}, []), b = r(() => {
|
|
19
|
+
Object.values(v.current).forEach(clearTimeout), v.current = {}, h([]);
|
|
20
|
+
}, []), x = r((e) => {
|
|
122
21
|
let t = e.id ?? Math.random().toString(36).slice(2, 9);
|
|
123
|
-
|
|
22
|
+
h((n) => {
|
|
124
23
|
let r = e.id ? n.findIndex((e) => e.id === t) : -1;
|
|
125
24
|
if (r === -1) return [{
|
|
126
25
|
...e,
|
|
127
26
|
id: t
|
|
128
|
-
}, ...n].slice(0,
|
|
129
|
-
let
|
|
130
|
-
return
|
|
27
|
+
}, ...n].slice(0, i);
|
|
28
|
+
let a = [...n];
|
|
29
|
+
return a[r] = {
|
|
131
30
|
...e,
|
|
132
31
|
id: t
|
|
133
|
-
},
|
|
134
|
-
}), clearTimeout(
|
|
32
|
+
}, a;
|
|
33
|
+
}), clearTimeout(v.current[t]);
|
|
135
34
|
let n = e.duration ?? 4e3;
|
|
136
|
-
return n > 0 && (
|
|
137
|
-
}, [
|
|
138
|
-
return /* @__PURE__ */ d
|
|
35
|
+
return n > 0 && (v.current[t] = setTimeout(() => y(t), n)), t;
|
|
36
|
+
}, [y, i]);
|
|
37
|
+
return /* @__PURE__ */ l(d.Provider, {
|
|
139
38
|
value: {
|
|
140
|
-
show:
|
|
141
|
-
dismiss:
|
|
142
|
-
dismissAll:
|
|
39
|
+
show: x,
|
|
40
|
+
dismiss: y,
|
|
41
|
+
dismissAll: b
|
|
143
42
|
},
|
|
144
|
-
children: [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
})
|
|
43
|
+
children: [t, g && /* @__PURE__ */ c(e, {
|
|
44
|
+
fallback: null,
|
|
45
|
+
children: /* @__PURE__ */ c(u, {
|
|
46
|
+
items: m,
|
|
47
|
+
position: n,
|
|
48
|
+
className: f,
|
|
49
|
+
toastClassName: p,
|
|
50
|
+
onDismiss: y
|
|
215
51
|
})
|
|
216
52
|
})]
|
|
217
53
|
});
|
|
218
54
|
}
|
|
219
55
|
//#endregion
|
|
220
|
-
export {
|
|
56
|
+
export { p as SnackbarProvider, f as useSnackbar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react/jsx-runtime");var n={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;
|
package/dist/components/stat.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react/jsx-runtime");var n={up:{color:`text-emerald-700 dark:text-emerald-400`,icon:(0,t.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`path`,{d:`m18 15-6-6-6 6`})})},down:{color:`text-red-700 dark:text-red-400`,icon:(0,t.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`path`,{d:`m6 9 6 6 6-6`})})},neutral:{color:`text-muted-foreground`,icon:(0,t.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`path`,{d:`M5 12h14`})})}};function r({label:r,value:i,unit:a,valueClassName:o,trend:s,trendValue:c,icon:l,description:u,action:d,className:f,...p}){return(0,t.jsxs)(`div`,{className:e.t(`flex flex-col gap-1 rounded-[var(--radius-xl)] border border-border bg-surface p-4 shadow-xs`,f),...p,children:[(0,t.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,t.jsx)(`p`,{className:`text-[11px] font-semibold text-muted-foreground uppercase tracking-[0.06em]`,children:r}),(0,t.jsxs)(`span`,{className:`flex items-center gap-1.5 shrink-0`,children:[d,l&&(0,t.jsx)(`span`,{className:`text-muted-foreground`,children:l})]})]}),(0,t.jsxs)(`div`,{className:`flex items-baseline gap-1.5 mt-1.5`,children:[(0,t.jsx)(`span`,{className:e.t(`text-[26px] font-semibold tabular-nums text-foreground leading-none tracking-tight`,o),children:i}),a&&(0,t.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:a})]}),(s||u)&&(0,t.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1`,children:[s&&c&&(0,t.jsxs)(`span`,{className:e.t(`flex items-center gap-0.5 text-xs font-medium`,n[s].color),children:[n[s].icon,c]}),u&&(0,t.jsx)(`span`,{className:`text-xs text-slate-500`,children:u})]})]})}exports.Stat=r;
|
package/dist/components/stat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react/jsx-runtime");var n={online:`bg-emerald-400`,offline:`bg-slate-500`,idle:`bg-amber-400`,busy:`bg-red-400`,error:`bg-red-500`,pending:`bg-sky-400`},r={sm:`w-1.5 h-1.5`,md:`w-2 h-2`,lg:`w-2.5 h-2.5`};function i({status:i,label:a,pulse:o=!1,size:s=`md`,className:c}){return(0,t.jsxs)(`span`,{className:e.t(`inline-flex items-center gap-1.5`,c),children:[(0,t.jsxs)(`span`,{className:`relative flex items-center justify-center`,children:[o&&(i===`online`||i===`pending`)&&(0,t.jsx)(`span`,{className:e.t(`absolute inline-flex rounded-full opacity-75 animate-ping`,n[i],r[s])}),(0,t.jsx)(`span`,{className:e.t(`relative inline-flex rounded-full`,n[i],r[s])})]}),a&&(0,t.jsx)(`span`,{className:`text-sm text-slate-600 dark:text-slate-300`,children:a})]})}exports.StatusDot=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react/jsx-runtime");function n({steps:n,current:r,orientation:i=`horizontal`,className:a}){return(0,t.jsx)(`div`,{className:e.t(i===`vertical`?`flex flex-col gap-0`:`flex items-start gap-0 min-w-0 overflow-x-auto`,a),children:n.map((a,o)=>{let s=o<r,c=o===r,l=o===n.length-1;return(0,t.jsx)(`div`,{className:e.t(i===`vertical`?`flex gap-3`:`flex flex-col items-center flex-1`),children:i===`horizontal`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:`flex items-center w-full`,children:[(0,t.jsx)(`div`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold border-2 transition-colors`,s?`bg-primary border-primary text-primary-foreground`:c?`border-accent-500 text-accent-400 bg-accent-500/10`:`border-border-strong text-muted-foreground`),children:s?(0,t.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`path`,{d:`m20 6-11 11-5-5`})}):o+1}),!l&&(0,t.jsx)(`div`,{className:e.t(`flex-1 h-0.5 mx-2 rounded-full transition-colors`,s?`bg-primary`:`bg-border`)})]}),(0,t.jsxs)(`div`,{className:`mt-2 text-center px-1`,children:[(0,t.jsx)(`p`,{className:e.t(`text-xs font-medium`,c?`text-foreground`:`text-muted-foreground`),children:a.label}),a.description&&(0,t.jsx)(`p`,{className:`text-[10px] text-slate-500 mt-0.5`,children:a.description})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,t.jsx)(`div`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold border-2 transition-colors`,s?`bg-primary border-primary text-primary-foreground`:c?`border-accent-500 text-accent-400 bg-accent-500/10`:`border-border-strong text-muted-foreground`),children:s?(0,t.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`path`,{d:`m20 6-11 11-5-5`})}):o+1}),!l&&(0,t.jsx)(`div`,{className:e.t(`w-0.5 flex-1 min-h-8 my-1 rounded-full`,s?`bg-primary`:`bg-border`)})]}),(0,t.jsxs)(`div`,{className:`pb-6`,children:[(0,t.jsx)(`p`,{className:e.t(`text-sm font-medium leading-none mt-1.5`,c?`text-foreground`:`text-muted-foreground`),children:a.label}),a.description&&(0,t.jsx)(`p`,{className:`text-xs text-slate-500 mt-1`,children:a.description})]})]})},o)})})}exports.Stepper=n;
|