@bzync/rui 0.0.3 → 0.0.5
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 +5 -0
- package/dist/{autocomplete-CfbfpcO4.js → autocomplete-BgKbj6M4.js} +2 -2
- package/dist/{autocomplete-CaysJRpk.cjs → autocomplete-Bk4pRQ2R.cjs} +1 -1
- package/dist/{calendar-Bnld4G59.cjs → calendar-CUXpVrVE.cjs} +1 -1
- package/dist/{calendar-CdICOROs.js → calendar-j2_zvum1.js} +1 -1
- package/dist/{component-styles-Ce56hn9T.js → component-styles-Bgy44fc8.js} +2 -2
- package/dist/{component-styles-TkZ7v6Ef.cjs → component-styles-DOUctc8_.cjs} +1 -1
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/aspect-ratio.cjs +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.js +20 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -0
- package/dist/components/avatar-group.d.ts +14 -0
- package/dist/components/avatar-group.js +35 -0
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/blockquote.cjs +1 -0
- package/dist/components/blockquote.d.ts +10 -0
- package/dist/components/blockquote.js +32 -0
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button-group.cjs +1 -0
- package/dist/components/button-group.d.ts +7 -0
- package/dist/components/button-group.js +26 -0
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.js +3 -3
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +3 -3
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code.cjs +1 -1
- package/dist/components/code.d.ts +4 -4
- package/dist/components/code.js +59 -57
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +3 -3
- package/dist/components/currency.cjs +1 -0
- package/dist/components/currency.d.ts +18 -0
- package/dist/components/currency.js +62 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.js +2 -2
- package/dist/components/description-list.cjs +1 -0
- package/dist/components/description-list.d.ts +14 -0
- package/dist/components/description-list.js +38 -0
- package/dist/components/divider.cjs +1 -0
- package/dist/components/divider.d.ts +12 -0
- package/dist/components/divider.js +45 -0
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +2 -2
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.js +2 -2
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +2 -2
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +2 -2
- package/dist/components/rating.cjs +1 -0
- package/dist/components/rating.d.ts +15 -0
- package/dist/components/rating.js +75 -0
- package/dist/components/scroll-area.cjs +1 -0
- package/dist/components/scroll-area.d.ts +8 -0
- package/dist/components/scroll-area.js +19 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +8 -8
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +2 -2
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +2 -2
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +1 -1
- package/dist/components/time-picker.cjs +1 -0
- package/dist/components/time-picker.d.ts +29 -0
- package/dist/components/time-picker.js +336 -0
- package/dist/components/toggle.cjs +1 -0
- package/dist/components/toggle.d.ts +42 -0
- package/dist/components/toggle.js +116 -0
- package/dist/components/typography.cjs +1 -0
- package/dist/components/typography.d.ts +51 -0
- package/dist/components/typography.js +189 -0
- package/dist/{datatable-BB3v__r5.cjs → datatable-rzDgQ3r6.cjs} +1 -1
- package/dist/{datatable-DlBhUhuO.js → datatable-yBN4M3UV.js} +3 -3
- package/dist/{drawer-Cbuh6qdL.cjs → drawer-CTeBsYrO.cjs} +1 -1
- package/dist/{drawer-CqkVZT9Y.js → drawer-ixuzyLVS.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +102 -90
- package/dist/lib/component-styles.d.ts +1 -1
- package/dist/select-BFwx--uK.cjs +1 -0
- package/dist/{select-Ch5fp1GT.js → select-ClWrcj3R.js} +3 -3
- package/dist/styles.css +1 -1
- package/dist/{theme-toggle-CnoiorKV.js → theme-toggle-Bb0BYo51.js} +1 -1
- package/dist/{theme-toggle-Dp1-24zH.cjs → theme-toggle-Cld8tktJ.cjs} +1 -1
- package/package.json +1 -1
- package/dist/select-q0YCMhBP.cjs +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/divider.tsx
|
|
5
|
+
var i = {
|
|
6
|
+
solid: "border-solid",
|
|
7
|
+
dashed: "border-dashed",
|
|
8
|
+
dotted: "border-dotted"
|
|
9
|
+
}, a = {
|
|
10
|
+
none: "my-0",
|
|
11
|
+
sm: "my-2",
|
|
12
|
+
md: "my-4",
|
|
13
|
+
lg: "my-6"
|
|
14
|
+
}, o = {
|
|
15
|
+
none: "mx-0",
|
|
16
|
+
sm: "mx-2",
|
|
17
|
+
md: "mx-4",
|
|
18
|
+
lg: "mx-6"
|
|
19
|
+
}, s = t(({ orientation: t = "horizontal", variant: s = "solid", spacing: c = "md", label: l, decorative: u = !0, className: d, ...f }, p) => {
|
|
20
|
+
let m = t === "vertical", h = e("min-w-0 flex-1 border-border", i[s], m ? "w-0 border-l" : "h-0 border-t");
|
|
21
|
+
return /* @__PURE__ */ r("div", {
|
|
22
|
+
ref: p,
|
|
23
|
+
role: u ? "presentation" : "separator",
|
|
24
|
+
"aria-orientation": u ? void 0 : t,
|
|
25
|
+
className: e("flex shrink-0 items-center", m ? "h-full min-h-4 self-stretch flex-col" : "w-full min-w-0 flex-row", m ? o[c] : a[c], d),
|
|
26
|
+
...f,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ n("span", {
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: h
|
|
31
|
+
}),
|
|
32
|
+
l && /* @__PURE__ */ n("span", {
|
|
33
|
+
className: e("shrink-0 text-xs font-medium text-muted-foreground", m ? "my-2 [writing-mode:vertical-rl]" : "mx-3"),
|
|
34
|
+
children: l
|
|
35
|
+
}),
|
|
36
|
+
l && /* @__PURE__ */ n("span", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: h
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
s.displayName = "Divider";
|
|
44
|
+
//#endregion
|
|
45
|
+
export { s as Divider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../drawer-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../drawer-CTeBsYrO.cjs");exports.Drawer=e.t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(({className:a,label:o,hint:s,error:c,accept:l,maxSizeMB:u,onFilesChange:d,disabled:f,multiple:p,id:m,...h},g)=>{let[_,v]=(0,r.useState)(!1),[y,b]=(0,r.useState)([]),[x,S]=(0,r.useState)(``),C=(0,r.useRef)(null),w=(0,r.useId)(),T=m??w,E=`${T}-message`,D=u&&(u>=1024?`${u/1024}GB`:`${u}MB`);function O(e){if(!e)return;let t=Array.from(e);if(u){let e=t.find(e=>e.size>u*1024*1024);if(e){S(`${e.name} exceeds ${D}`);return}}S(``);let n=p?[...y,...t]:t;b(n),d?.(n)}function k(e){let t=y.filter((t,n)=>n!==e);b(t),d?.(t)}function A(e){e.preventDefault(),v(!1),!f&&O(e.dataTransfer.files)}let j=c??x;return(0,i.jsxs)(`div`,{className:e.t(t.o,a),children:[o&&(0,i.jsx)(`label`,{htmlFor:T,className:`text-xs font-semibold leading-5 text-foreground`,children:o}),(0,i.jsxs)(`label`,{htmlFor:T,onDragOver:e=>{e.preventDefault(),f||v(!0)},onDragLeave:()=>v(!1),onDrop:A,className:e.t(`relative flex flex-col items-center justify-center gap-2 rounded-[var(--radius-lg)] border border-dashed px-4 py-7 text-center cursor-pointer transition-colors focus-within:ring-2 focus-within:ring-focus-ring/25`,_?`border-accent-500/60 bg-accent-500/6`:j?`border-red-500/40 bg-red-500/4`:`border-border-strong bg-surface-muted/50 hover:border-accent-500/60 hover:bg-muted`,f&&`opacity-50 cursor-not-allowed pointer-events-none`),children:[(0,i.jsx)(`input`,{ref:e=>{C.current=e,typeof g==`function`?g(e):g&&(g.current=e)},type:`file`,id:T,accept:l,multiple:p,disabled:f,"aria-invalid":j?!0:void 0,"aria-describedby":j||s?E:void 0,className:`sr-only`,onChange:e=>O(e.target.files),...h}),(0,i.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-muted-foreground`,children:[(0,i.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,i.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,i.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`p`,{className:`text-sm font-medium text-foreground`,children:[`Drop files here or `,(0,i.jsx)(`span`,{className:`text-accent-700 dark:text-accent-300`,children:`browse`})]}),(l||u)&&(0,i.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[l&&`Accepts ${l}`,D&&`Max ${D}`].filter(Boolean).join(` · `)})]})]}),(0,i.jsx)(n.AnimatePresence,{initial:!1,children:y.length>0&&(0,i.jsx)(n.motion.ul,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},className:`flex flex-col gap-1 overflow-hidden`,children:y.map((t,n)=>(0,i.jsxs)(`li`,{className:`flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-surface-muted px-3 py-2`,children:[(0,i.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`text-slate-400 shrink-0`,children:[(0,i.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,i.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]}),(0,i.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:t.name}),(0,i.jsxs)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:[(t.size/1024).toFixed(0),`KB`]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>k(n),"aria-label":`Remove ${t.name}`,className:e.t(`shrink-0 rounded-sm text-muted-foreground hover:text-destructive transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`),children:(0,i.jsx)(`svg`,{width:`12`,height:`12`,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 18M6 6l12 12`})})})]},`${t.name}-${n}`))})}),j&&(0,i.jsx)(`p`,{id:E,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:j}),s&&!j&&(0,i.jsx)(`p`,{id:E,className:`text-xs leading-5 text-muted-foreground`,children:s})]})});a.displayName=`FileUpload`,exports.FileUpload=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { o as t } from "../component-styles-
|
|
3
|
+
import { o as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
5
5
|
import { forwardRef as i, useId as a, useRef as o, useState as s } from "react";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -34,7 +34,7 @@ var u = i(({ className: i, label: u, hint: d, error: f, accept: p, maxSizeMB: m,
|
|
|
34
34
|
children: [
|
|
35
35
|
u && /* @__PURE__ */ c("label", {
|
|
36
36
|
htmlFor: k,
|
|
37
|
-
className: "text-
|
|
37
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
38
38
|
children: u
|
|
39
39
|
}),
|
|
40
40
|
/* @__PURE__ */ l("label", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react/jsx-runtime");function r({label:r,hint:i,error:a,required:o,htmlFor:s,className:c,children:l,...u}){return(0,n.jsxs)(`div`,{className:e.t(t.o,c),...u,children:[r&&(0,n.jsxs)(`label`,{htmlFor:s,className:e.t(`flex items-center gap-1`,`text-xs font-semibold leading-5 text-foreground`),children:[r,o&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:`*`}),(0,n.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),l,a&&(0,n.jsx)(`p`,{"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:a}),i&&!a&&(0,n.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:i})]})}exports.FormField=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
-
import { o as t } from "../component-styles-
|
|
2
|
+
import { o as t } from "../component-styles-Bgy44fc8.js";
|
|
3
3
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/form-field.tsx
|
|
5
5
|
function a({ label: a, hint: o, error: s, required: c, htmlFor: l, className: u, children: d, ...f }) {
|
|
@@ -9,7 +9,7 @@ function a({ label: a, hint: o, error: s, required: c, htmlFor: l, className: u,
|
|
|
9
9
|
children: [
|
|
10
10
|
a && /* @__PURE__ */ i("label", {
|
|
11
11
|
htmlFor: l,
|
|
12
|
-
className: e("flex items-center gap-1", "text-
|
|
12
|
+
className: e("flex items-center gap-1", "text-xs font-semibold leading-5 text-foreground"),
|
|
13
13
|
children: [a, c && /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("span", {
|
|
14
14
|
"aria-hidden": "true",
|
|
15
15
|
className: "text-destructive",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:{wrap:`h-7 px-2 gap-1.5`,text:`text-xs`},md:{wrap:`h-9 px-3 gap-2`,text:`text-sm`},lg:{wrap:`h-10 px-3.5 gap-2.5`,text:`text-sm`}},a=(0,n.forwardRef)(({className:a,wrapperClassName:o,wrapperStyle:s,inputClassName:c,labelClassName:l,hintClassName:u,unstyled:d=!1,label:f,hint:p,error:m,prefix:h,suffix:g,size:_=`md`,id:v,autoComplete:y=`on`,style:b,required:x,...S},C)=>{let w=(0,n.useId)(),T=v??w,E=`${T}-message`,D=i[_];return d?(0,r.jsxs)(`div`,{className:e.t(t.o,o),style:s,children:[f&&(0,r.jsxs)(`label`,{htmlFor:T,className:e.t(`text-xs font-semibold leading-5 text-foreground`,l),children:[f,x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsx)(`input`,{ref:C,id:T,required:x,"aria-invalid":m?!0:void 0,"aria-describedby":m||p?E:void 0,autoComplete:y,className:e.t(c,a),style:b,...S}),m&&(0,r.jsx)(`p`,{id:E,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,u),children:m}),p&&!m&&(0,r.jsx)(`p`,{id:E,className:e.t(`text-xs leading-5 text-muted-foreground`,u),children:p})]}):(0,r.jsxs)(`div`,{className:e.t(t.o,o),style:s,children:[f&&(0,r.jsxs)(`label`,{htmlFor:T,className:e.t(`text-xs font-semibold leading-5 text-foreground`,l),children:[f,x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsxs)(`div`,{className:e.t(`flex items-center rounded-[var(--radius-md)]`,D.wrap,t.t,m&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`),children:[h&&(0,r.jsx)(`span`,{className:e.t(`text-slate-400 dark:text-slate-500 shrink-0`,D.text),children:h}),(0,r.jsx)(`input`,{ref:C,id:T,required:x,"aria-invalid":m?!0:void 0,"aria-describedby":m||p?E:void 0,autoComplete:y,className:e.t(`flex-1 min-w-0 bg-transparent outline-none`,`text-foreground placeholder:text-muted-foreground`,`disabled:cursor-not-allowed disabled:opacity-50`,D.text,c,a),style:b,...S}),g&&(0,r.jsx)(`span`,{className:e.t(`text-slate-400 dark:text-slate-500 shrink-0`,D.text),children:g})]}),m&&(0,r.jsx)(`p`,{id:E,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,u),children:m}),p&&!m&&(0,r.jsx)(`p`,{id:E,className:e.t(`text-xs leading-5 text-muted-foreground`,u),children:p})]})});a.displayName=`Input`,exports.Input=a;
|
package/dist/components/input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { o as t, t as n } from "../component-styles-
|
|
3
|
+
import { o as t, t as n } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { forwardRef as r, useId as i } from "react";
|
|
5
5
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/input.tsx
|
|
@@ -25,7 +25,7 @@ var c = {
|
|
|
25
25
|
children: [
|
|
26
26
|
h && /* @__PURE__ */ s("label", {
|
|
27
27
|
htmlFor: O,
|
|
28
|
-
className: e("text-
|
|
28
|
+
className: e("text-xs font-semibold leading-5 text-foreground", f),
|
|
29
29
|
children: [h, w && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", {
|
|
30
30
|
"aria-hidden": "true",
|
|
31
31
|
className: "ml-1 text-destructive",
|
|
@@ -64,7 +64,7 @@ var c = {
|
|
|
64
64
|
children: [
|
|
65
65
|
h && /* @__PURE__ */ s("label", {
|
|
66
66
|
htmlFor: O,
|
|
67
|
-
className: e("text-
|
|
67
|
+
className: e("text-xs font-semibold leading-5 text-foreground", f),
|
|
68
68
|
children: [h, w && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", {
|
|
69
69
|
"aria-hidden": "true",
|
|
70
70
|
className: "ml-1 text-destructive",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react/jsx-runtime");function r({className:r,children:i,required:a,hint:o,...s}){return(0,n.jsxs)(`label`,{className:e.t(`flex items-center gap-1.5 select-none`,t.a,r),...s,children:[(0,n.jsx)(`span`,{children:i}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,className:`text-destructive leading-none`,children:`*`}),(0,n.jsx)(`span`,{className:`sr-only`,children:` (required)`})]}),o&&(0,n.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,o,`)`]})]})}exports.Label=r;
|
package/dist/components/label.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
-
import { a as t } from "../component-styles-
|
|
2
|
+
import { a as t } from "../component-styles-Bgy44fc8.js";
|
|
3
3
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/label.tsx
|
|
5
5
|
function a({ className: a, children: o, required: s, hint: c, ...l }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs"),n=require("../use-event-callback-Du9_9eAi.cjs"),r=require("../focus-DmG6Ge7X.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime");var s={sm:`max-w-[380px]`,md:`max-w-[480px]`,lg:`max-w-[560px]`,xl:`max-w-[640px]`,"2xl":`max-w-[720px]`,"7xl":`max-w-3xl`,full:`max-w-[calc(100vw-2rem)]`};function c({open:c,onClose:l,children:u,className:d,overlayClassName:f,panelClassName:p,size:m=`md`,title:h,description:g,icon:_,showCloseButton:v=!0,closeAriaLabel:y=`Close dialog`,scrollable:b=!1,unstyled:x=!1,ariaLabel:S=`Dialog`,closeOnEscape:C=!0,closeOnOverlayClick:w=!0}){let T=(0,a.useRef)(null),E=(0,a.useRef)(null),D=(0,a.useRef)(c),O=(0,a.useId)(),k=(0,a.useId)(),A=n.t(l);return c&&!D.current&&typeof document<`u`&&document.activeElement instanceof HTMLElement&&(E.current=document.activeElement),D.current=c,(0,a.useEffect)(()=>{if(c)return;let e=e=>{e.target instanceof HTMLElement&&(E.current=e.target)};return!E.current&&document.activeElement instanceof HTMLElement&&(E.current=document.activeElement),document.addEventListener(`focusin`,e),()=>document.removeEventListener(`focusin`,e)},[c]),(0,a.useEffect)(()=>{if(!c)return;!E.current&&document.activeElement instanceof HTMLElement&&(E.current=document.activeElement);let e=document.body.style.overflow,t=e=>{if(e.key===`Escape`&&C){e.preventDefault(),A();return}if(e.key!==`Tab`||!T.current)return;let t=r.t(T.current);if(t.length===0){e.preventDefault(),T.current.focus();return}let n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),n.focus())};document.addEventListener(`keydown`,t),document.body.style.overflow=`hidden`;let n=()=>{(T.current?.querySelector(`[data-autofocus]`)??T.current?.querySelector(`[data-modal-content] a[href],[data-modal-content] button:not([disabled]),[data-modal-content] input:not([disabled]),[data-modal-content] select:not([disabled]),[data-modal-content] textarea:not([disabled]),[data-modal-content] [tabindex]:not([tabindex="-1"])`)??T.current?.querySelector(`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`)??T.current)?.focus()};n();let i=window.setTimeout(n,0);return()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,t),document.body.style.overflow=e}},[C,c,A]),(0,a.useEffect)(()=>{if(c||!E.current)return;let e=E.current,t=window.setTimeout(()=>e.focus(),240);return()=>window.clearTimeout(t)},[c]),x?c?(0,o.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":`true`,className:e.t(d,p),children:u}):null:(0,o.jsx)(i.AnimatePresence,{onExitComplete:()=>{let e=E.current;E.current=null,window.setTimeout(()=>e?.focus(),0)},children:c&&(0,o.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6`,children:[(0,o.jsx)(i.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:e.t(`absolute inset-0 bg-overlay`,f),onClick:w?A:void 0}),(0,o.jsxs)(i.motion.div,{ref:T,initial:{opacity:0,scale:.98,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:10},transition:{duration:.22,ease:[.16,1,.3,1]},role:`dialog`,"aria-modal":`true`,"aria-labelledby":h?O:void 0,"aria-describedby":g?k:void 0,"aria-label":h?void 0:S,tabIndex:-1,className:e.t(`relative w-full overflow-hidden flex flex-col`,`rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,`max-h-[min(90dvh,720px)]`,s[m],p,d),children:[h&&(0,o.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-5 pb-3 pt-4 sm:px-6 shrink-0`,children:[(0,o.jsxs)(`div`,{className:`flex gap-3.5 min-w-0 flex-1`,children:[_&&(0,o.jsx)(`div`,{className:`mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-5`,"aria-hidden":`true`,children:_}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,o.jsx)(`h2`,{id:O,className:`text-base font-semibold leading-6 text-foreground`,children:h}),g&&(0,o.jsx)(`p`,{id:k,className:`mt-1 text-sm leading-5 text-muted-foreground`,children:g})]})]}),v&&(0,o.jsx)(`button`,{type:`button`,"data-modal-close":!0,"aria-label":y,onClick:A,className:t.c,children:(0,o.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),!h&&v&&(0,o.jsx)(`button`,{type:`button`,"data-modal-close":!0,"aria-label":y,onClick:A,className:e.t(`absolute right-4 top-4 z-10`,t.c),children:(0,o.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,o.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})}),(0,o.jsx)(`div`,{"data-modal-content":!0,className:e.t(`px-5 py-4 sm:px-6 flex-1`,b?`overflow-y-auto overscroll-contain`:`overflow-y-auto`),children:u})]})]})})}function l({className:t,children:n,...r}){return(0,o.jsx)(`div`,{className:e.t(`px-5 pt-4 pb-3 sm:px-6 border-b border-border shrink-0`,t),...r,children:n})}function u({as:t=`h2`,className:n,children:r,...i}){return(0,o.jsx)(t,{className:e.t(`text-base font-semibold leading-6 text-foreground`,n),...i,children:r})}function d({className:t,children:n,...r}){return(0,o.jsx)(`p`,{className:e.t(`mt-1 text-sm leading-5 text-muted-foreground`,t),...r,children:n})}function f({className:t,scrollable:n=!1,children:r,...i}){return(0,o.jsx)(`div`,{"data-modal-content":!0,className:e.t(`px-5 py-4 sm:px-6`,n&&`overflow-y-auto flex-1 overscroll-contain`,t),...i,children:r})}function p({className:t,children:n,...r}){return(0,o.jsx)(`div`,{className:e.t(`flex flex-wrap items-center justify-end gap-2 border-t border-border px-5 pb-4 pt-3 sm:px-6 max-sm:flex-col-reverse max-sm:items-stretch`,t),...r,children:n})}exports.Modal=c,exports.ModalBody=f,exports.ModalDescription=d,exports.ModalFooter=p,exports.ModalHeader=l,exports.ModalTitle=u;
|
package/dist/components/modal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { c as t } from "../component-styles-
|
|
3
|
+
import { c as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { t as n } from "../use-event-callback-DGkfO_uu.js";
|
|
5
5
|
import { t as r } from "../focus-Dk1YWVPN.js";
|
|
6
6
|
import { AnimatePresence as i, motion as a } from "framer-motion";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react/jsx-runtime");function r({id:r,label:i,href:a,icon:o,badge:s,disabled:c,active:l,compact:u,onSelect:d,className:f}){let p=(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:o}),(0,n.jsx)(`span`,{className:e.t(`truncate`,u&&`text-[11px]`),children:i}),s&&(0,n.jsx)(`span`,{className:`ml-auto shrink-0`,children:s})]}),m=e.t(`group relative inline-flex items-center justify-center gap-2 rounded-[var(--radius-md)] font-medium transition-colors`,t.s,u?`min-h-11 flex-col px-2 py-1.5`:`h-9 px-3 text-sm`,l?`bg-accent-50 text-accent-700 dark:bg-accent-500/12 dark:text-accent-300`:`text-muted-foreground hover:bg-muted hover:text-foreground`,c&&`pointer-events-none opacity-40`,f);return a?(0,n.jsx)(`a`,{href:a,className:m,"aria-current":l?`page`:void 0,"aria-disabled":c||void 0,onClick:e=>{d&&(e.preventDefault(),d(r))},children:p}):(0,n.jsx)(`button`,{type:`button`,className:m,"aria-current":l?`page`:void 0,disabled:c,onClick:()=>d?.(r),children:p})}function i({items:t,activeId:i,onSelect:a,ariaLabel:o=`Primary navigation`,className:s,children:c,...l}){return(0,n.jsxs)(`nav`,{"aria-label":o,className:e.t(`flex min-h-14 items-center gap-1 border border-border bg-surface px-3`,s),...l,children:[c,(0,n.jsx)(`div`,{className:`ml-auto flex items-center gap-1 overflow-x-auto`,children:t.map(e=>(0,n.jsx)(r,{...e,active:i===e.id,onSelect:a},e.id))})]})}function a({className:t,children:r,...i}){return(0,n.jsx)(`header`,{className:e.t(`flex min-h-14 items-center gap-3 border-b border-border bg-bg/95 px-4 backdrop-blur-sm`,t),...i,children:r})}function o({as:t=`h2`,className:r,children:i,...a}){return(0,n.jsx)(t,{className:e.t(`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,r),...a,children:i})}function s({items:t,activeId:i,onSelect:a,ariaLabel:o=`Sidebar navigation`,header:s,footer:c,className:l,...u}){return(0,n.jsxs)(`aside`,{className:e.t(`flex w-60 flex-col border border-border bg-surface`,l),...u,children:[s&&(0,n.jsx)(`div`,{className:`border-b border-border p-4`,children:s}),(0,n.jsx)(`nav`,{"aria-label":o,className:`flex flex-1 flex-col gap-1 p-2`,children:t.map(e=>(0,n.jsx)(r,{...e,active:i===e.id,onSelect:a,className:`w-full justify-start`},e.id))}),c&&(0,n.jsx)(`div`,{className:`border-t border-border p-3`,children:c})]})}function c({items:t,activeId:i,onSelect:a,ariaLabel:o=`Mobile navigation`,className:s,...c}){return(0,n.jsx)(`nav`,{"aria-label":o,className:e.t(`grid min-h-16 border border-border bg-surface/95 px-1 pb-safe-bottom shadow-floating backdrop-blur-sm`,s),style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},...c,children:t.map(e=>(0,n.jsx)(r,{...e,compact:!0,active:i===e.id,onSelect:a,className:`rounded-none`},e.id))})}function l({label:r,className:i,children:a,type:o=`button`,...s}){return(0,n.jsx)(`button`,{type:o,"aria-label":r,className:e.t(t.c,`size-9`,i),...s,children:a})}function u({mark:r,className:i,children:a,...o}){return(0,n.jsxs)(`a`,{className:e.t(`inline-flex shrink-0 items-center gap-2 text-sm font-semibold text-foreground`,t.s,i),...o,children:[r,a]})}exports.BottomBar=c,exports.BrandLink=u,exports.IconButton=l,exports.Navbar=i,exports.NavigationLink=r,exports.Sidebar=s,exports.Topbar=a,exports.TopbarTitle=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { c as t, s as n } from "../component-styles-
|
|
3
|
+
import { c as t, s as n } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/navigation.tsx
|
|
6
6
|
function o({ id: t, label: o, href: s, icon: c, badge: l, disabled: u, active: d, compact: f, onSelect: p, className: m }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:{wrap:`h-7 text-xs`,btn:`w-6`,input:`w-16`},md:{wrap:`h-9 text-sm`,btn:`w-8`,input:`w-20`},lg:{wrap:`h-11 text-sm`,btn:`w-9`,input:`w-24`}},a=(0,n.forwardRef)(({className:a,label:o,hint:s,error:c,size:l=`md`,min:u=-1/0,max:d=1/0,step:f=1,value:p,defaultValue:m=0,onChange:h,disabled:g,id:_,autoComplete:v=`on`,fullWidth:y=!1,formatDisplay:b,onFocus:x,onBlur:S,onKeyDown:C,required:w,...T},E)=>{let D=(0,n.useId)(),O=_??D,k=`${O}-message`,[A,j]=(0,n.useState)(m),M=p??A,N=i[l],P=f.toString().includes(`.`)?f.toString().split(`.`)[1].length:0,F=e=>P>0?Math.round(e*10**P)/10**P:Math.round(e),I=e=>Math.min(d,Math.max(u,e));function L(e){let t=I(F(e));p===void 0&&j(t),h?.(t),z(String(t))}(0,n.useEffect)(()=>{p!==void 0&&j(p)},[p]);let[R,z]=(0,n.useState)(()=>String(M)),B=(0,n.useRef)(!1);(0,n.useEffect)(()=>{B.current||z(String(M))},[M]);function V(e){z(e)}function H(e){B.current=!1;let t=Number(R);L(Number.isNaN(t)?M:t),S?.(e)}function U(e){C?.(e),!e.defaultPrevented&&e.key===`Enter`&&e.currentTarget.blur()}return(0,r.jsxs)(`div`,{className:e.t(t.o,!y&&`w-auto`,a),children:[o&&(0,r.jsxs)(`label`,{htmlFor:O,className:`text-xs font-semibold leading-5 text-foreground`,children:[o,w&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsxs)(`div`,{className:e.t(`inline-flex items-center overflow-hidden rounded-[var(--radius-md)]`,t.t,N.wrap,y&&`flex w-full`,c&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,g&&`opacity-50`),children:[(0,r.jsx)(`button`,{type:`button`,"aria-label":o?`Decrease ${o}`:`Decrease value`,tabIndex:-1,disabled:g||M<=u,onClick:()=>L(M-f),className:e.t(`flex items-center justify-center shrink-0 border-r border-border`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,N.btn),children:(0,r.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M5 12h14`})})}),(0,r.jsx)(`input`,{ref:E,type:`number`,id:O,required:w,"aria-invalid":c?!0:void 0,"aria-describedby":c||s?k:void 0,"aria-valuetext":b?.(M),autoComplete:v,min:Number.isFinite(u)?u:void 0,max:Number.isFinite(d)?d:void 0,step:f,value:R,disabled:g,onFocus:e=>{B.current=!0,x?.(e)},onChange:e=>V(e.target.value),onBlur:H,onKeyDown:U,className:e.t(`flex-1 text-center bg-transparent text-foreground outline-none tabular-nums`,`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`,`disabled:cursor-not-allowed`,y?`min-w-0`:N.input),...T}),(0,r.jsx)(`button`,{type:`button`,"aria-label":o?`Increase ${o}`:`Increase value`,tabIndex:-1,disabled:g||M>=d,onClick:()=>L(M+f),className:e.t(`flex items-center justify-center shrink-0 border-l border-border`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,N.btn),children:(0,r.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),c&&(0,r.jsx)(`p`,{id:k,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:c}),s&&!c&&(0,r.jsx)(`p`,{id:k,className:`text-xs leading-5 text-muted-foreground`,children:s})]})});a.displayName=`NumberInput`,exports.NumberInput=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { o as t, t as n } from "../component-styles-
|
|
3
|
+
import { o as t, t as n } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { forwardRef as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
5
5
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/number-input.tsx
|
|
@@ -49,7 +49,7 @@ var d = {
|
|
|
49
49
|
children: [
|
|
50
50
|
f && /* @__PURE__ */ u("label", {
|
|
51
51
|
htmlFor: P,
|
|
52
|
-
className: "text-
|
|
52
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
53
53
|
children: [f, A && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
|
|
54
54
|
"aria-hidden": "true",
|
|
55
55
|
className: "ml-1 text-destructive",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react/jsx-runtime");function r(e,t){return Array.from({length:t-e+1},(t,n)=>e+n)}function i(e,t,n){if(t<=7)return r(1,t);let i=Math.max(2,e-n),a=Math.min(t-1,e+n),o=i>2,s=a<t-1;return!o&&s?[...r(1,3+n*2),`…`,t]:o&&!s?[1,`…`,...r(t-2-n*2,t)]:[1,`…`,...r(i,a),`…`,t]}var a=(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`m15 18-6-6 6-6`})}),o=(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`m9 18 6-6-6-6`})});function s({page:r,totalPages:s,onPageChange:c,siblingCount:l=1,className:u}){if(s<=1)return null;let d=i(r,s,l);function f(i,a,o,s=!1){return(0,n.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>!o&&c(a),"aria-current":s?`page`:void 0,"aria-label":typeof i==`number`?`Page ${i}`:a<r?`Previous page`:`Next page`,className:e.t(`flex items-center justify-center min-w-8 h-8 px-2 rounded-[var(--radius-md)] border text-sm font-medium transition-colors`,t.s,s?`border-accent-200 bg-accent-50 text-accent-700 dark:border-accent-500/20 dark:bg-accent-500/15 dark:text-accent-300`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,o&&`opacity-40 cursor-not-allowed pointer-events-none`),children:i},typeof i==`number`?i:`${i}-${a}`)}return(0,n.jsxs)(`nav`,{className:e.t(`flex items-center gap-1`,u),"aria-label":`Pagination`,children:[f(a,r-1,r<=1),d.map((e,t)=>e===`…`?(0,n.jsx)(`span`,{className:`flex items-end justify-center w-8 h-8 text-slate-500 text-sm pb-1`,children:`…`},`dots-${t}`):f(e,e,!1,e===r)),f(o,r+1,r>=s)]})}exports.Pagination=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
3
|
+
import { s as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/pagination.tsx
|
|
6
6
|
function i(e, t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("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(`Radio must be inside <RadioGroup>`);return e}function s({name:n,value:o,onChange:s,disabled:c,label:l,hint:u,error:d,orientation:f=`vertical`,className:p,children:m}){let h=(0,r.useId)(),g=n??h,_=`${g}-label`,v=`${g}-message`;return(0,i.jsxs)(`div`,{className:e.t(t.o,p),children:[l&&(0,i.jsx)(`p`,{id:_,className:`text-xs font-semibold leading-5 text-foreground`,children:l}),(0,i.jsx)(a.Provider,{value:{name:g,value:o,onChange:s,disabled:c},children:(0,i.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":l?_:void 0,"aria-invalid":d?!0:void 0,"aria-describedby":d||u?v:void 0,className:e.t(`flex gap-2`,f===`vertical`?`flex-col`:`flex-row flex-wrap`),children:m})}),d&&(0,i.jsx)(`p`,{id:v,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:d}),u&&!d&&(0,i.jsx)(`p`,{id:v,className:`text-xs leading-5 text-muted-foreground`,children:u})]})}function c({value:t,label:a,description:s,disabled:c,className:l}){let{name:u,value:d,onChange:f,disabled:p}=o(),m=(0,r.useId)(),h=d===t,g=c??p;return(0,i.jsxs)(`label`,{htmlFor:m,className:e.t(`flex items-start gap-2.5 cursor-pointer`,g&&`cursor-not-allowed opacity-50`,l),children:[(0,i.jsxs)(`div`,{className:`relative mt-0.5 shrink-0 w-4 h-4`,children:[(0,i.jsx)(`input`,{type:`radio`,id:m,name:u,value:t,checked:h,disabled:g,onChange:()=>f(t),className:`peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed`}),(0,i.jsx)(`div`,{className:e.t(`w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors duration-[120ms] peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg`,h?`bg-primary border-primary`:`bg-transparent border-black/25 dark:border-white/25`),children:h&&(0,i.jsx)(n.motion.span,{initial:{scale:0},animate:{scale:1},transition:{type:`spring`,stiffness:600,damping:30},className:`w-1.5 h-1.5 rounded-full bg-white`})})]}),(a||s)&&(0,i.jsxs)(`div`,{className:`min-w-0`,children:[a&&(0,i.jsx)(`p`,{className:`text-sm font-medium text-foreground leading-snug`,children:a}),s&&(0,i.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:s})]})]})}exports.Radio=c,exports.RadioGroup=s;
|
package/dist/components/radio.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { o as t } from "../component-styles-
|
|
3
|
+
import { o as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { motion as n } from "framer-motion";
|
|
5
5
|
import { createContext as r, useContext as i, useId as a } from "react";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
@@ -18,7 +18,7 @@ function u({ name: n, value: r, onChange: i, disabled: l, label: u, hint: d, err
|
|
|
18
18
|
children: [
|
|
19
19
|
u && /* @__PURE__ */ o("p", {
|
|
20
20
|
id: v,
|
|
21
|
-
className: "text-
|
|
21
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
22
22
|
children: u
|
|
23
23
|
}),
|
|
24
24
|
/* @__PURE__ */ o(c.Provider, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:`size-4`,md:`size-5`,lg:`size-6`},a={sm:`size-8`,md:`size-9`,lg:`size-10`},o=(0,n.forwardRef)(({label:o,value:s,defaultValue:c=0,onValueChange:l,max:u=5,name:d,size:f=`md`,readOnly:p=!1,showLabel:m=!0,showValue:h=!1,disabled:g,className:_,...v},y)=>{let b=(0,n.useId)(),x=d??b,S=Number.isFinite(u)?Math.max(1,Math.floor(u)):5,C=e=>Number.isFinite(e)?Math.max(0,Math.min(S,e)):0,[w,T]=(0,n.useState)(()=>C(c)),E=C(s??w);function D(e){g||p||(s===void 0&&T(e),l?.(e))}return(0,r.jsxs)(`fieldset`,{ref:y,role:`radiogroup`,"aria-readonly":p||void 0,disabled:g,className:e.t(`min-w-0`,_),...v,children:[(0,r.jsx)(`legend`,{className:e.t(t.a,!m&&`sr-only`),children:o}),(0,r.jsxs)(`div`,{className:`mt-1 flex w-fit max-w-full items-center overflow-x-auto overscroll-x-contain py-1 scrollbar-none`,children:[Array.from({length:S},(t,n)=>{let o=n+1,s=o<=E;return(0,r.jsxs)(`label`,{className:e.t(`relative inline-flex shrink-0 items-center justify-center rounded-sm`,a[f],g?`cursor-not-allowed opacity-40`:p?`cursor-default`:`cursor-pointer`),children:[(0,r.jsx)(`input`,{type:`radio`,name:x,value:o,checked:E===o,disabled:g,readOnly:p,"aria-label":`${o} ${o===1?`star`:`stars`}`,onChange:()=>D(o),className:`peer sr-only`}),(0,r.jsx)(`span`,{className:`block rounded-sm peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg`,children:(0,r.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,className:e.t(i[f],`transition-colors`,s?`fill-warning text-warning`:`fill-transparent text-border-strong`,!g&&!p&&`hover:text-warning`),children:(0,r.jsx)(`path`,{stroke:`currentColor`,strokeWidth:`1.75`,strokeLinejoin:`round`,d:`m12 2.8 2.75 5.57 6.15.9-4.45 4.33 1.05 6.12L12 16.83l-5.5 2.89 1.05-6.12L3.1 9.27l6.15-.9L12 2.8Z`})})})]},o)}),h&&(0,r.jsxs)(`output`,{className:`ml-2 text-xs tabular-nums text-muted-foreground`,"aria-live":`polite`,children:[E,`/`,S]})]})]})});o.displayName=`Rating`,exports.Rating=o;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FieldsetHTMLAttributes } from 'react';
|
|
2
|
+
export type RatingSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface RatingProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange"> {
|
|
4
|
+
label: string;
|
|
5
|
+
value?: number;
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
onValueChange?: (value: number) => void;
|
|
8
|
+
max?: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
size?: RatingSize;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
showValue?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const Rating: import('react').ForwardRefExoticComponent<RatingProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { a as t } from "../component-styles-Bgy44fc8.js";
|
|
4
|
+
import { forwardRef as n, useId as r, useState as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/rating.tsx
|
|
7
|
+
var s = {
|
|
8
|
+
sm: "size-4",
|
|
9
|
+
md: "size-5",
|
|
10
|
+
lg: "size-6"
|
|
11
|
+
}, c = {
|
|
12
|
+
sm: "size-8",
|
|
13
|
+
md: "size-9",
|
|
14
|
+
lg: "size-10"
|
|
15
|
+
}, l = n(({ label: n, value: l, defaultValue: u = 0, onValueChange: d, max: f = 5, name: p, size: m = "md", readOnly: h = !1, showLabel: g = !0, showValue: _ = !1, disabled: v, className: y, ...b }, x) => {
|
|
16
|
+
let S = r(), C = p ?? S, w = Number.isFinite(f) ? Math.max(1, Math.floor(f)) : 5, T = (e) => Number.isFinite(e) ? Math.max(0, Math.min(w, e)) : 0, [E, D] = i(() => T(u)), O = T(l ?? E);
|
|
17
|
+
function k(e) {
|
|
18
|
+
v || h || (l === void 0 && D(e), d?.(e));
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ o("fieldset", {
|
|
21
|
+
ref: x,
|
|
22
|
+
role: "radiogroup",
|
|
23
|
+
"aria-readonly": h || void 0,
|
|
24
|
+
disabled: v,
|
|
25
|
+
className: e("min-w-0", y),
|
|
26
|
+
...b,
|
|
27
|
+
children: [/* @__PURE__ */ a("legend", {
|
|
28
|
+
className: e(t, !g && "sr-only"),
|
|
29
|
+
children: n
|
|
30
|
+
}), /* @__PURE__ */ o("div", {
|
|
31
|
+
className: "mt-1 flex w-fit max-w-full items-center overflow-x-auto overscroll-x-contain py-1 scrollbar-none",
|
|
32
|
+
children: [Array.from({ length: w }, (t, n) => {
|
|
33
|
+
let r = n + 1, i = r <= O;
|
|
34
|
+
return /* @__PURE__ */ o("label", {
|
|
35
|
+
className: e("relative inline-flex shrink-0 items-center justify-center rounded-sm", c[m], v ? "cursor-not-allowed opacity-40" : h ? "cursor-default" : "cursor-pointer"),
|
|
36
|
+
children: [/* @__PURE__ */ a("input", {
|
|
37
|
+
type: "radio",
|
|
38
|
+
name: C,
|
|
39
|
+
value: r,
|
|
40
|
+
checked: O === r,
|
|
41
|
+
disabled: v,
|
|
42
|
+
readOnly: h,
|
|
43
|
+
"aria-label": `${r} ${r === 1 ? "star" : "stars"}`,
|
|
44
|
+
onChange: () => k(r),
|
|
45
|
+
className: "peer sr-only"
|
|
46
|
+
}), /* @__PURE__ */ a("span", {
|
|
47
|
+
className: "block rounded-sm peer-focus-visible:ring-2 peer-focus-visible:ring-focus-ring/35 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg",
|
|
48
|
+
children: /* @__PURE__ */ a("svg", {
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: e(s[m], "transition-colors", i ? "fill-warning text-warning" : "fill-transparent text-border-strong", !v && !h && "hover:text-warning"),
|
|
52
|
+
children: /* @__PURE__ */ a("path", {
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
strokeWidth: "1.75",
|
|
55
|
+
strokeLinejoin: "round",
|
|
56
|
+
d: "m12 2.8 2.75 5.57 6.15.9-4.45 4.33 1.05 6.12L12 16.83l-5.5 2.89 1.05-6.12L3.1 9.27l6.15-.9L12 2.8Z"
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
}, r);
|
|
61
|
+
}), _ && /* @__PURE__ */ o("output", {
|
|
62
|
+
className: "ml-2 text-xs tabular-nums text-muted-foreground",
|
|
63
|
+
"aria-live": "polite",
|
|
64
|
+
children: [
|
|
65
|
+
O,
|
|
66
|
+
"/",
|
|
67
|
+
w
|
|
68
|
+
]
|
|
69
|
+
})]
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
l.displayName = "Rating";
|
|
74
|
+
//#endregion
|
|
75
|
+
export { l as Rating };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={vertical:`overflow-y-auto overflow-x-hidden`,horizontal:`overflow-x-auto overflow-y-hidden`,both:`overflow-auto`},i=(0,t.forwardRef)(({orientation:t=`vertical`,hideScrollbar:i=!1,keyboardNavigable:a=!0,className:o,tabIndex:s,...c},l)=>(0,n.jsx)(`div`,{ref:l,"data-orientation":t,tabIndex:s??(a?0:void 0),className:e.t(`relative overscroll-contain rounded-[var(--radius-sm)]`,a&&`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg`,r[t],i&&`scrollbar-none`,o),...c}));i.displayName=`ScrollArea`,exports.ScrollArea=i;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type ScrollAreaOrientation = "vertical" | "horizontal" | "both";
|
|
3
|
+
export interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
orientation?: ScrollAreaOrientation;
|
|
5
|
+
hideScrollbar?: boolean;
|
|
6
|
+
keyboardNavigable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ScrollArea: import('react').ForwardRefExoticComponent<ScrollAreaProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import "../component-styles-Bgy44fc8.js";
|
|
3
|
+
import { forwardRef as t } from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/scroll-area.tsx
|
|
6
|
+
var r = {
|
|
7
|
+
vertical: "overflow-y-auto overflow-x-hidden",
|
|
8
|
+
horizontal: "overflow-x-auto overflow-y-hidden",
|
|
9
|
+
both: "overflow-auto"
|
|
10
|
+
}, i = t(({ orientation: t = "vertical", hideScrollbar: i = !1, keyboardNavigable: a = !0, className: o, tabIndex: s, ...c }, l) => /* @__PURE__ */ n("div", {
|
|
11
|
+
ref: l,
|
|
12
|
+
"data-orientation": t,
|
|
13
|
+
tabIndex: s ?? (a ? 0 : void 0),
|
|
14
|
+
className: e("relative overscroll-contain rounded-[var(--radius-sm)]", a && "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-bg", r[t], i && "scrollbar-none", o),
|
|
15
|
+
...c
|
|
16
|
+
}));
|
|
17
|
+
i.displayName = "ScrollArea";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { i as ScrollArea };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../select-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../select-BFwx--uK.cjs");exports.Select=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../select-
|
|
1
|
+
import { t as e } from "../select-ClWrcj3R.js";
|
|
2
2
|
export { e as Select };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(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-xs font-semibold 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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { o as t } from "../component-styles-
|
|
3
|
+
import { o as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { forwardRef as n, useEffect as r, useId as i, useState as a } from "react";
|
|
5
5
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/slider.tsx
|
|
@@ -17,7 +17,7 @@ var c = n(({ className: n, label: c, hint: l, error: u, showValue: d = !0, forma
|
|
|
17
17
|
className: "flex items-center justify-between",
|
|
18
18
|
children: [c && /* @__PURE__ */ o("label", {
|
|
19
19
|
htmlFor: w,
|
|
20
|
-
className: "text-
|
|
20
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
21
21
|
children: c
|
|
22
22
|
}), d && /* @__PURE__ */ o("output", {
|
|
23
23
|
htmlFor: w,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-DOUctc8_.cjs");let n=require("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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
3
|
+
import { s as t } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
5
5
|
import { createContext as i, useCallback as a, useContext as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
6
6
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
package/dist/components/stat.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={up:{color:`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-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-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.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;
|