@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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime");var i={sm:{box:`w-3.5 h-3.5 rounded`,check:10,label:`text-xs`,desc:`text-[10px]`},md:{box:`w-4 h-4 rounded-[4px]`,check:11,label:`text-sm`,desc:`text-xs`},lg:{box:`w-5 h-5 rounded-md`,check:13,label:`text-sm`,desc:`text-xs`}},a=(0,n.forwardRef)(({className:a,label:o,description:s,size:c=`md`,checked:l,defaultChecked:u,indeterminate:d=!1,onChange:f,disabled:p,error:m,id:h,...g},_)=>{let[v,y]=(0,n.useState)(l===void 0?u??!1:l);(0,n.useEffect)(()=>{l!==void 0&&y(l)},[l]);let b=(0,n.useId)(),x=h??b,S=`${x}-message`,C=(0,n.useRef)(null),w=i[c],T=v||d;return(0,n.useEffect)(()=>{C.current&&(C.current.indeterminate=d)},[d]),(0,r.jsxs)(`div`,{className:e.t(`flex flex-col gap-1`,a),children:[(0,r.jsxs)(`label`,{htmlFor:x,className:e.t(`flex items-start gap-2.5 cursor-pointer`,p&&`cursor-not-allowed opacity-50`),children:[(0,r.jsxs)(`div`,{className:e.t(`relative mt-0.5 shrink-0`,w.box),children:[(0,r.jsx)(`input`,{ref:e=>{C.current=e,typeof _==`function`?_(e):_&&(_.current=e)},type:`checkbox`,id:x,className:`peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed`,"aria-invalid":m?!0:void 0,"aria-describedby":m||s?S:void 0,"aria-checked":d?`mixed`:v,checked:v,disabled:p,onChange:e=>{l===void 0&&y(e.target.checked),f?.(e)},...g}),(0,r.jsx)(`div`,{className:e.t(`w-full h-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`,w.box,T?`bg-accent-600 border-accent-600 dark:bg-accent-500 dark:border-accent-500`:m?`bg-transparent border-red-500/50`:`bg-transparent border-black/25 dark:border-white/25`),children:(0,r.jsx)(t.AnimatePresence,{mode:`wait`,children:d?(0,r.jsx)(t.motion.svg,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{duration:.1},width:w.check,height:w.check,viewBox:`0 0 14 14`,fill:`none`,stroke:`white`,strokeWidth:`2.5`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M3 7h8`})},`minus`):v?(0,r.jsx)(t.motion.svg,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:600,damping:30},width:w.check,height:w.check,viewBox:`0 0 14 14`,fill:`none`,stroke:`white`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.jsx)(`path`,{d:`M2.5 7l3 3 6-6`})},`check`):null})})]}),(o||s)&&(0,r.jsxs)(`div`,{className:`min-w-0`,children:[o&&(0,r.jsx)(`p`,{className:e.t(`font-medium text-foreground leading-snug`,w.label),children:o}),s&&(0,r.jsx)(`p`,{id:m?void 0:S,className:e.t(`mt-0.5 text-muted-foreground`,w.desc),children:s})]})]}),m&&(0,r.jsx)(`p`,{id:S,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,`ml-[26px]`),children:m})]})});a.displayName=`Checkbox`,exports.Checkbox=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import "../component-styles-
|
|
3
|
+
import "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as t, motion as n } from "framer-motion";
|
|
5
5
|
import { forwardRef as r, useEffect 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";
|
package/dist/components/code.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={js:`const.let.var.function.return.if.else.for.while.class.import.export.default.from.async.await.new.typeof.instanceof.true.false.null.undefined.throw.try.catch.finally.switch.case.break.continue.extends.super.this.of.in.delete.void`.split(`.`),python:`def.return.if.else.elif.for.while.class.import.from.as.with.try.except.finally.raise.pass.break.continue.and.or.not.in.is.True.False.None.lambda.yield.global.nonlocal.del.print.async.await`.split(`.`),bash:[`if`,`then`,`else`,`elif`,`fi`,`for`,`do`,`done`,`while`,`case`,`esac`,`in`,`function`,`return`,`exit`,`echo`,`export`,`source`,`local`,`readonly`],sql:`SELECT.FROM.WHERE.AND.OR.NOT.INSERT.INTO.VALUES.UPDATE.SET.DELETE.CREATE.TABLE.DROP.ALTER.INDEX.JOIN.INNER.LEFT.RIGHT.ON.GROUP.BY.ORDER.HAVING.LIMIT.OFFSET.AS.DISTINCT.COUNT.SUM.AVG.MAX.MIN.NULL.IS.IN.LIKE.BETWEEN.EXISTS`.split(`.`)};r.ts=r.js,r.tsx=r.js,r.jsx=r.js,r.json=[];function i(e,t){let n=new Set(r[t.toLowerCase()]??r.js),i=[],a=0;for(;a<e.length;){if(t===`bash`&&e[a]===`#`||e.slice(a,a+2)===`//`&&t!==`bash`){let t=e.indexOf(`
|
|
2
2
|
`,a),n=t===-1?e.slice(a):e.slice(a,t);i.push({type:`comment`,value:n}),a+=n.length;continue}if(e.slice(a,a+2)===`/*`){let t=e.indexOf(`*/`,a+2),n=t===-1?e.slice(a):e.slice(a,t+2);i.push({type:`comment`,value:n}),a+=n.length;continue}if(e[a]===`#`&&(t===`python`||t===`sql`)){let t=e.indexOf(`
|
|
3
3
|
`,a),n=t===-1?e.slice(a):e.slice(a,t);i.push({type:`comment`,value:n}),a+=n.length;continue}if(e[a]===`"`||e[a]===`'`||e[a]==="`"){let t=e[a],n=a+1;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){n+=2;continue}if(e[n]===t){n++;break}n++}i.push({type:`string`,value:e.slice(a,n)}),a=n;continue}if(/[0-9]/.test(e[a])||e[a]===`.`&&/[0-9]/.test(e[a+1]??``)){let t=a;for(;t<e.length&&/[0-9._xXa-fA-F]/.test(e[t]);)t++;i.push({type:`number`,value:e.slice(a,t)}),a=t;continue}if(/[a-zA-Z_$]/.test(e[a])){let t=a;for(;t<e.length&&/[a-zA-Z0-9_$]/.test(e[t]);)t++;let r=e.slice(a,t);i.push({type:n.has(r)?`keyword`:`plain`,value:r}),a=t;continue}if(/[=<>!&|+\-*/%^~?:,;.()[\]{}]/.test(e[a])){i.push({type:`operator`,value:e[a]}),a++;continue}i.push({type:`plain`,value:e[a]}),a++}return i}var a={keyword:`text-violet-500 dark:text-violet-400`,string:`text-emerald-600 dark:text-emerald-400`,comment:`text-slate-400 dark:text-slate-500 italic`,number:`text-amber-600 dark:text-amber-400`,operator:`text-slate-500 dark:text-slate-400`,builtin:`text-sky-500 dark:text-sky-400`,plain:`text-slate-800 dark:text-slate-200`};function o({code:r,language:o=`js`,filename:s,showLineNumbers:c=!1,className:l}){let[u,d]=(0,t.useState)(!1),f=r.replace(/^\n/,``).replace(/\n$/,``),p=f.split(`
|
|
4
|
-
`);async function m(){let e=!1;try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard API unavailable`);await navigator.clipboard.writeText(f),e=!0}catch{let t=document.createElement(`textarea`);t.value=f,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),e=document.execCommand(`copy`),t.remove()}e&&(d(!0),window.setTimeout(()=>d(!1),1500))}return(0,n.jsxs)(`div`,{className:e.t(`group relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]`,l),children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3`,children:[(0,n.jsx)(`div`,{className:`flex items-center gap-2`,children:s&&(0,n.jsx)(`span`,{className:`text-xs font-mono text-slate-500 dark:text-slate-400`,children:s})}),(0,n.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!s&&(0,n.jsx)(`span`,{className:`text-xs font-mono text-slate-400 dark:text-slate-500 uppercase`,children:o}),(0,n.jsx)(`button`,{type:`button`,onClick:m,"aria-label":u?`Copied code`:`Copy code`,className:`h-6 px-2 flex items-center gap-1 rounded text-xs text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white hover:bg-black/6 dark:hover:bg-white/8 transition-colors`,children:u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),`Copied`]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,n.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),`Copy`]})})]})]}),(0,n.jsx)(`div`,{className:`overflow-x-auto`,children:(0,n.jsx)(`table`,{className:`w-full border-collapse text-sm font-mono leading-6`,children:(0,n.jsx)(`tbody`,{children:p.map((e,t)=>(0,n.jsxs)(`tr`,{className:`hover:bg-black/3 dark:hover:bg-white/3`,children:[c&&(0,n.jsx)(`td`,{className:`select-none w-10 pr-4 pl-4 text-right text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6`,children:t+1}),(0,n.jsx)(`td`,{className:`px-4 py-0 whitespace-pre`,children:i(e,o).map((e,t)=>(0,n.jsx)(`span`,{className:a[e.type],children:e.value},t))})]},t))})})})]})}
|
|
4
|
+
`);async function m(){let e=!1;try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard API unavailable`);await navigator.clipboard.writeText(f),e=!0}catch{let t=document.createElement(`textarea`);t.value=f,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),e=document.execCommand(`copy`),t.remove()}e&&(d(!0),window.setTimeout(()=>d(!1),1500))}return(0,n.jsxs)(`div`,{className:e.t(`group relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]`,l),children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3`,children:[(0,n.jsx)(`div`,{className:`flex items-center gap-2`,children:s&&(0,n.jsx)(`span`,{className:`text-xs font-mono text-slate-500 dark:text-slate-400`,children:s})}),(0,n.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!s&&(0,n.jsx)(`span`,{className:`text-xs font-mono text-slate-400 dark:text-slate-500 uppercase`,children:o}),(0,n.jsx)(`button`,{type:`button`,onClick:m,"aria-label":u?`Copied code`:`Copy code`,className:`h-6 shrink-0 px-2 flex items-center gap-1 whitespace-nowrap rounded text-xs text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white hover:bg-black/6 dark:hover:bg-white/8 transition-colors`,children:u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`svg`,{className:`shrink-0`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),`Copied`]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`svg`,{className:`shrink-0`,width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,n.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),`Copy`]})})]})]}),(0,n.jsx)(`div`,{className:`overflow-x-auto`,children:(0,n.jsx)(`table`,{className:`w-full border-collapse text-sm font-mono leading-6`,children:(0,n.jsx)(`tbody`,{children:p.map((e,t)=>(0,n.jsxs)(`tr`,{className:`hover:bg-black/3 dark:hover:bg-white/3`,children:[c&&(0,n.jsx)(`td`,{className:`select-none w-10 pr-4 pl-4 text-right text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6`,children:t+1}),(0,n.jsx)(`td`,{className:`px-4 py-0 whitespace-pre`,children:i(e,o).map((e,t)=>(0,n.jsx)(`span`,{className:a[e.type],children:e.value},t))})]},t))})})})]})}var s=(0,t.forwardRef)(({className:t,...r},i)=>(0,n.jsx)(`code`,{ref:i,className:e.t(`break-words rounded-md border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground`,t),...r}));s.displayName=`InlineCode`;function c({value:r,onChange:i,language:a=`js`,placeholder:o=`// Start typing…`,minRows:s=6,maxRows:c=24,readOnly:l=!1,className:u}){let d=(0,t.useRef)(null),f=Math.min(c,Math.max(s,r.split(`
|
|
5
5
|
`).length));function p(e){let t=e.currentTarget,{selectionStart:n,selectionEnd:a}=t;if(e.key===`Tab`){e.preventDefault();let o=r.slice(0,n)+` `+r.slice(a);i?.(o),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=n+2})}if(e.key===`Enter`){let o=r.lastIndexOf(`
|
|
6
6
|
`,n-1)+1,s=r.slice(o).match(/^(\s*)/)?.[1]??``;e.preventDefault();let c=r.slice(0,n)+`
|
|
7
7
|
`+s+r.slice(a);i?.(c),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=n+1+s.length})}let o={"(":`)`,"[":`]`,"{":`}`,'"':`"`,"'":`'`,"`":"`"};if(o[e.key]&&n===a){e.preventDefault();let s=r.slice(0,n)+e.key+o[e.key]+r.slice(a);i?.(s),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=n+1})}}return(0,n.jsxs)(`div`,{className:e.t(`relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]`,u),children:[(0,n.jsx)(`div`,{className:`flex items-center gap-1.5 px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3`,children:(0,n.jsx)(`span`,{className:`text-xs font-mono text-slate-400 dark:text-slate-500 uppercase`,children:a})}),(0,n.jsxs)(`div`,{className:`relative flex`,children:[(0,n.jsx)(`div`,{className:`select-none shrink-0 py-3 px-3 text-right text-sm font-mono leading-6 text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6 bg-black/2 dark:bg-black/20`,"aria-hidden":!0,children:Array.from({length:f},(e,t)=>(0,n.jsx)(`div`,{children:t+1},t))}),(0,n.jsx)(`textarea`,{ref:d,value:r,onChange:e=>i?.(e.target.value),onKeyDown:p,readOnly:l,placeholder:o,spellCheck:!1,rows:f,className:`flex-1 py-3 px-4 text-sm font-mono leading-6 bg-transparent text-slate-800 dark:text-slate-200 placeholder:text-slate-400 dark:placeholder:text-slate-600 focus:outline-none resize-none`})]})]})}exports.CodeBlock=o,exports.CodeEditor=c,exports.InlineCode=s;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
1
2
|
export interface CodeBlockProps {
|
|
2
3
|
code: string;
|
|
3
4
|
language?: string;
|
|
@@ -6,10 +7,9 @@ export interface CodeBlockProps {
|
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare function CodeBlock({ code, language, filename, showLineNumbers, className }: CodeBlockProps): import("react").JSX.Element;
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}): import("react").JSX.Element;
|
|
10
|
+
export interface InlineCodeProps extends HTMLAttributes<HTMLElement> {
|
|
11
|
+
}
|
|
12
|
+
export declare const InlineCode: import('react').ForwardRefExoticComponent<InlineCodeProps & import('react').RefAttributes<HTMLElement>>;
|
|
13
13
|
export interface CodeEditorProps {
|
|
14
14
|
value: string;
|
|
15
15
|
onChange?: (value: string) => void;
|
package/dist/components/code.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
3
|
+
import { forwardRef as t, useRef as n, useState as r } from "react";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/code.tsx
|
|
6
|
-
var
|
|
6
|
+
var s = {
|
|
7
7
|
js: /* @__PURE__ */ "const.let.var.function.return.if.else.for.while.class.import.export.default.from.async.await.new.typeof.instanceof.true.false.null.undefined.throw.try.catch.finally.switch.case.break.continue.extends.super.this.of.in.delete.void".split("."),
|
|
8
8
|
python: /* @__PURE__ */ "def.return.if.else.elif.for.while.class.import.from.as.with.try.except.finally.raise.pass.break.continue.and.or.not.in.is.True.False.None.lambda.yield.global.nonlocal.del.print.async.await".split("."),
|
|
9
9
|
bash: [
|
|
@@ -30,9 +30,9 @@ var o = {
|
|
|
30
30
|
],
|
|
31
31
|
sql: /* @__PURE__ */ "SELECT.FROM.WHERE.AND.OR.NOT.INSERT.INTO.VALUES.UPDATE.SET.DELETE.CREATE.TABLE.DROP.ALTER.INDEX.JOIN.INNER.LEFT.RIGHT.ON.GROUP.BY.ORDER.HAVING.LIMIT.OFFSET.AS.DISTINCT.COUNT.SUM.AVG.MAX.MIN.NULL.IS.IN.LIKE.BETWEEN.EXISTS".split(".")
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
let n = new Set(
|
|
33
|
+
s.ts = s.js, s.tsx = s.js, s.jsx = s.js, s.json = [];
|
|
34
|
+
function c(e, t) {
|
|
35
|
+
let n = new Set(s[t.toLowerCase()] ?? s.js), r = [], i = 0;
|
|
36
36
|
for (; i < e.length;) {
|
|
37
37
|
if (t === "bash" && e[i] === "#" || e.slice(i, i + 2) === "//" && t !== "bash") {
|
|
38
38
|
let t = e.indexOf("\n", i), n = t === -1 ? e.slice(i) : e.slice(i, t);
|
|
@@ -110,7 +110,7 @@ function s(e, t) {
|
|
|
110
110
|
}
|
|
111
111
|
return r;
|
|
112
112
|
}
|
|
113
|
-
var
|
|
113
|
+
var l = {
|
|
114
114
|
keyword: "text-violet-500 dark:text-violet-400",
|
|
115
115
|
string: "text-emerald-600 dark:text-emerald-400",
|
|
116
116
|
comment: "text-slate-400 dark:text-slate-500 italic",
|
|
@@ -119,8 +119,8 @@ var c = {
|
|
|
119
119
|
builtin: "text-sky-500 dark:text-sky-400",
|
|
120
120
|
plain: "text-slate-800 dark:text-slate-200"
|
|
121
121
|
};
|
|
122
|
-
function
|
|
123
|
-
let [f, p] =
|
|
122
|
+
function u({ code: t, language: n = "js", filename: s, showLineNumbers: u = !1, className: d }) {
|
|
123
|
+
let [f, p] = r(!1), m = t.replace(/^\n/, "").replace(/\n$/, ""), h = m.split("\n");
|
|
124
124
|
async function g() {
|
|
125
125
|
let e = !1;
|
|
126
126
|
try {
|
|
@@ -132,27 +132,28 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
|
|
|
132
132
|
}
|
|
133
133
|
e && (p(!0), window.setTimeout(() => p(!1), 1500));
|
|
134
134
|
}
|
|
135
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ o("div", {
|
|
136
136
|
className: e("group relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]", d),
|
|
137
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ o("div", {
|
|
138
138
|
className: "flex items-center justify-between px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ a("div", {
|
|
140
140
|
className: "flex items-center gap-2",
|
|
141
|
-
children:
|
|
141
|
+
children: s && /* @__PURE__ */ a("span", {
|
|
142
142
|
className: "text-xs font-mono text-slate-500 dark:text-slate-400",
|
|
143
|
-
children:
|
|
143
|
+
children: s
|
|
144
144
|
})
|
|
145
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ o("div", {
|
|
146
146
|
className: "flex items-center gap-2",
|
|
147
|
-
children: [!
|
|
147
|
+
children: [!s && /* @__PURE__ */ a("span", {
|
|
148
148
|
className: "text-xs font-mono text-slate-400 dark:text-slate-500 uppercase",
|
|
149
|
-
children:
|
|
150
|
-
}), /* @__PURE__ */
|
|
149
|
+
children: n
|
|
150
|
+
}), /* @__PURE__ */ a("button", {
|
|
151
151
|
type: "button",
|
|
152
152
|
onClick: g,
|
|
153
153
|
"aria-label": f ? "Copied code" : "Copy code",
|
|
154
|
-
className: "h-6 px-2 flex items-center gap-1 rounded text-xs text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white hover:bg-black/6 dark:hover:bg-white/8 transition-colors",
|
|
155
|
-
children: f ? /* @__PURE__ */
|
|
154
|
+
className: "h-6 shrink-0 px-2 flex items-center gap-1 whitespace-nowrap rounded text-xs text-slate-500 dark:text-slate-400 hover:text-gray-900 dark:hover:text-white hover:bg-black/6 dark:hover:bg-white/8 transition-colors",
|
|
155
|
+
children: f ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("svg", {
|
|
156
|
+
className: "shrink-0",
|
|
156
157
|
width: "11",
|
|
157
158
|
height: "11",
|
|
158
159
|
viewBox: "0 0 24 24",
|
|
@@ -161,8 +162,9 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
|
|
|
161
162
|
strokeWidth: "2.5",
|
|
162
163
|
strokeLinecap: "round",
|
|
163
164
|
strokeLinejoin: "round",
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
-
}), "Copied"] }) : /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ a("path", { d: "M20 6 9 17l-5-5" })
|
|
166
|
+
}), "Copied"] }) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("svg", {
|
|
167
|
+
className: "shrink-0",
|
|
166
168
|
width: "11",
|
|
167
169
|
height: "11",
|
|
168
170
|
viewBox: "0 0 24 24",
|
|
@@ -171,30 +173,30 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
|
|
|
171
173
|
strokeWidth: "2",
|
|
172
174
|
strokeLinecap: "round",
|
|
173
175
|
strokeLinejoin: "round",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ a("rect", {
|
|
175
177
|
width: "14",
|
|
176
178
|
height: "14",
|
|
177
179
|
x: "8",
|
|
178
180
|
y: "8",
|
|
179
181
|
rx: "2",
|
|
180
182
|
ry: "2"
|
|
181
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ a("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
|
|
182
184
|
}), "Copy"] })
|
|
183
185
|
})]
|
|
184
186
|
})]
|
|
185
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ a("div", {
|
|
186
188
|
className: "overflow-x-auto",
|
|
187
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ a("table", {
|
|
188
190
|
className: "w-full border-collapse text-sm font-mono leading-6",
|
|
189
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ a("tbody", { children: h.map((e, t) => /* @__PURE__ */ o("tr", {
|
|
190
192
|
className: "hover:bg-black/3 dark:hover:bg-white/3",
|
|
191
|
-
children: [u && /* @__PURE__ */
|
|
193
|
+
children: [u && /* @__PURE__ */ a("td", {
|
|
192
194
|
className: "select-none w-10 pr-4 pl-4 text-right text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6",
|
|
193
195
|
children: t + 1
|
|
194
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ a("td", {
|
|
195
197
|
className: "px-4 py-0 whitespace-pre",
|
|
196
|
-
children:
|
|
197
|
-
className:
|
|
198
|
+
children: c(e, n).map((e, t) => /* @__PURE__ */ a("span", {
|
|
199
|
+
className: l[e.type],
|
|
198
200
|
children: e.value
|
|
199
201
|
}, t))
|
|
200
202
|
})]
|
|
@@ -203,29 +205,29 @@ function l({ code: t, language: o = "js", filename: l, showLineNumbers: u = !1,
|
|
|
203
205
|
})]
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
function
|
|
213
|
-
let f =
|
|
208
|
+
var d = t(({ className: t, ...n }, r) => /* @__PURE__ */ a("code", {
|
|
209
|
+
ref: r,
|
|
210
|
+
className: e("break-words rounded-md border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground", t),
|
|
211
|
+
...n
|
|
212
|
+
}));
|
|
213
|
+
d.displayName = "InlineCode";
|
|
214
|
+
function f({ value: t, onChange: r, language: i = "js", placeholder: s = "// Start typing…", minRows: c = 6, maxRows: l = 24, readOnly: u = !1, className: d }) {
|
|
215
|
+
let f = n(null), p = Math.min(l, Math.max(c, t.split("\n").length));
|
|
214
216
|
function m(e) {
|
|
215
|
-
let
|
|
217
|
+
let n = e.currentTarget, { selectionStart: i, selectionEnd: a } = n;
|
|
216
218
|
if (e.key === "Tab") {
|
|
217
219
|
e.preventDefault();
|
|
218
|
-
let o =
|
|
220
|
+
let o = t.slice(0, i) + " " + t.slice(a);
|
|
219
221
|
r?.(o), requestAnimationFrame(() => {
|
|
220
|
-
|
|
222
|
+
n.selectionStart = n.selectionEnd = i + 2;
|
|
221
223
|
});
|
|
222
224
|
}
|
|
223
225
|
if (e.key === "Enter") {
|
|
224
|
-
let o =
|
|
226
|
+
let o = t.lastIndexOf("\n", i - 1) + 1, s = t.slice(o).match(/^(\s*)/)?.[1] ?? "";
|
|
225
227
|
e.preventDefault();
|
|
226
|
-
let c =
|
|
228
|
+
let c = t.slice(0, i) + "\n" + s + t.slice(a);
|
|
227
229
|
r?.(c), requestAnimationFrame(() => {
|
|
228
|
-
|
|
230
|
+
n.selectionStart = n.selectionEnd = i + 1 + s.length;
|
|
229
231
|
});
|
|
230
232
|
}
|
|
231
233
|
let o = {
|
|
@@ -238,29 +240,29 @@ function d({ value: n, onChange: r, language: o = "js", placeholder: s = "// Sta
|
|
|
238
240
|
};
|
|
239
241
|
if (o[e.key] && i === a) {
|
|
240
242
|
e.preventDefault();
|
|
241
|
-
let s =
|
|
243
|
+
let s = t.slice(0, i) + e.key + o[e.key] + t.slice(a);
|
|
242
244
|
r?.(s), requestAnimationFrame(() => {
|
|
243
|
-
|
|
245
|
+
n.selectionStart = n.selectionEnd = i + 1;
|
|
244
246
|
});
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ o("div", {
|
|
248
250
|
className: e("relative rounded-xl overflow-hidden border border-black/10 dark:border-white/10 bg-slate-50 dark:bg-[#0d1117]", d),
|
|
249
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ a("div", {
|
|
250
252
|
className: "flex items-center gap-1.5 px-4 py-2.5 border-b border-black/[0.07] dark:border-white/[0.07] bg-black/3 dark:bg-white/3",
|
|
251
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ a("span", {
|
|
252
254
|
className: "text-xs font-mono text-slate-400 dark:text-slate-500 uppercase",
|
|
253
|
-
children:
|
|
255
|
+
children: i
|
|
254
256
|
})
|
|
255
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ o("div", {
|
|
256
258
|
className: "relative flex",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ a("div", {
|
|
258
260
|
className: "select-none shrink-0 py-3 px-3 text-right text-sm font-mono leading-6 text-slate-400 dark:text-slate-600 border-r border-black/6 dark:border-white/6 bg-black/2 dark:bg-black/20",
|
|
259
261
|
"aria-hidden": !0,
|
|
260
|
-
children: Array.from({ length: p }, (e, t) => /* @__PURE__ */
|
|
261
|
-
}), /* @__PURE__ */
|
|
262
|
+
children: Array.from({ length: p }, (e, t) => /* @__PURE__ */ a("div", { children: t + 1 }, t))
|
|
263
|
+
}), /* @__PURE__ */ a("textarea", {
|
|
262
264
|
ref: f,
|
|
263
|
-
value:
|
|
265
|
+
value: t,
|
|
264
266
|
onChange: (e) => r?.(e.target.value),
|
|
265
267
|
onKeyDown: m,
|
|
266
268
|
readOnly: u,
|
|
@@ -273,4 +275,4 @@ function d({ value: n, onChange: r, language: o = "js", placeholder: s = "// Sta
|
|
|
273
275
|
});
|
|
274
276
|
}
|
|
275
277
|
//#endregion
|
|
276
|
-
export {
|
|
278
|
+
export { u as CodeBlock, f as CodeEditor, d as InlineCode };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");require("../component-styles-DOUctc8_.cjs");const t=require("../focus-DmG6Ge7X.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(`useCommand must be inside <CommandProvider>`);return e}function s({children:e,shortcut:t=`k`}){let[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===t&&(e.preventDefault(),o(e=>!e))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,i.jsx)(a.Provider,{value:{open:n,setOpen:o},children:e})}function c({items:a,placeholder:s=`Search commands…`,emptyText:c=`No results found.`,ariaLabel:l=`Command palette`}){let{open:u,setOpen:d}=o(),[f,p]=(0,r.useState)(``),[m,h]=(0,r.useState)(0),g=(0,r.useRef)(null),_=(0,r.useRef)(null),v=(0,r.useRef)(null),y=(0,r.useId)();(0,r.useEffect)(()=>{if(!u)return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.body.style.overflow,r=window.setTimeout(()=>g.current?.focus(),0),i=e=>{if(e.key===`Escape`){e.preventDefault(),d(!1);return}if(e.key!==`Tab`||!v.current)return;let n=t.t(v.current);if(n.length===0){e.preventDefault(),v.current.focus();return}let r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus())};return p(``),h(0),document.body.style.overflow=`hidden`,document.addEventListener(`keydown`,i),()=>{window.clearTimeout(r),document.body.style.overflow=n,document.removeEventListener(`keydown`,i),e?.focus()}},[u,d]);let b=(0,r.useMemo)(()=>{if(!f)return a;let e=f.toLowerCase();return a.filter(t=>t.label.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[f,a]),x=(0,r.useMemo)(()=>{let e=new Map;for(let t of b){let n=t.group??``;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[b]),S=(0,r.useMemo)(()=>Array.from(x.values()).flat(),[x]);function C(e){e.key===`ArrowDown`?(e.preventDefault(),h(e=>Math.min(e+1,Math.max(S.length-1,0)))):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),S[m]?.onSelect(),d(!1)):e.key===`Escape`&&d(!1)}(0,r.useEffect)(()=>{_.current&&_.current.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[m]);let w=0;return(0,i.jsx)(n.AnimatePresence,{children:u&&(0,i.jsxs)(`div`,{className:`fixed inset-0 z-[200] flex items-start justify-center pt-[15vh] p-4`,children:[(0,i.jsx)(n.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`absolute inset-0 bg-overlay`,onClick:()=>d(!1),"aria-hidden":`true`}),(0,i.jsxs)(n.motion.div,{ref:v,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":l,initial:{opacity:0,scale:.96,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:-8},transition:{type:`spring`,stiffness:400,damping:30},className:`relative w-full max-w-lg overflow-hidden rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4`,children:[(0,i.jsxs)(`svg`,{width:`16`,height:`16`,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)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,i.jsx)(`path`,{d:`m21 21-4.35-4.35`})]}),(0,i.jsx)(`input`,{ref:g,type:`search`,role:`combobox`,"aria-label":l,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":y,"aria-activedescendant":S[m]?`${y}-option-${m}`:void 0,value:f,onChange:e=>{p(e.target.value),h(0)},onKeyDown:C,placeholder:s,className:`min-w-0 flex-1 bg-transparent py-3.5 text-sm text-foreground outline-none placeholder:text-muted-foreground`}),(0,i.jsx)(`kbd`,{className:`shrink-0 rounded-[var(--radius-sm)] border border-border-strong bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`ESC`})]}),(0,i.jsx)(`div`,{id:y,ref:_,role:`listbox`,"aria-label":`Commands`,className:`max-h-80 overflow-y-auto py-1.5`,children:b.length===0?(0,i.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:c}):Array.from(x.entries()).map(([t,n])=>(0,i.jsxs)(`div`,{role:`group`,"aria-label":t||void 0,children:[t&&(0,i.jsx)(`p`,{className:`px-4 py-1 text-[10px] font-semibold text-slate-500 uppercase tracking-widest`,children:t}),n.map(t=>{let n=w++,r=n===m;return(0,i.jsxs)(`button`,{id:`${y}-option-${n}`,type:`button`,role:`option`,"aria-selected":r,"data-active":r,onClick:()=>{t.onSelect(),d(!1)},onMouseEnter:()=>h(n),className:e.t(`flex w-full items-center gap-3 px-4 py-2.5 text-left 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`,r?`bg-surface-muted`:`hover:bg-surface-muted/70`),children:[t.icon&&(0,i.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-slate-400 w-5 flex items-center justify-center`,children:t.icon}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsx)(`p`,{className:`truncate text-sm text-foreground`,children:t.label}),t.description&&(0,i.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:t.description})]}),t.shortcut&&(0,i.jsx)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:t.shortcut.map((e,t)=>(0,i.jsx)(`kbd`,{className:`rounded-[var(--radius-sm)] border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e},t))})]},t.id)})]},t))})]})]})})}exports.CommandPalette=c,exports.CommandProvider=s,exports.useCommand=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import "../component-styles-
|
|
3
|
+
import "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { t } from "../focus-Dk1YWVPN.js";
|
|
5
5
|
import { AnimatePresence as n, motion as r } from "framer-motion";
|
|
6
6
|
import { createContext as i, useContext as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime");var i=()=>(0,r.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,r.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),a=()=>(0,r.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.jsx)(`path`,{d:`m20 6-11 11-5-5`})});function o({value:o,timeout:s=2e3,label:c,size:l=`sm`,className:u,...d}){let[f,p]=(0,n.useState)(!1);async function m(){try{await navigator.clipboard.writeText(o),p(!0),setTimeout(()=>p(!1),s)}catch{}}return(0,r.jsx)(`button`,{type:`button`,onClick:m,className:e.t(`inline-flex items-center font-medium transition-colors select-none`,`border border-black/10 dark:border-white/10`,f?`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`:`bg-black/4 dark:bg-white/4 text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-black/8 dark:hover:bg-white/8`,l===`sm`?`h-6 px-2 text-xs gap-1 rounded-md`:`h-8 px-3 text-sm gap-1.5 rounded-lg`,u),...d,children:(0,r.jsx)(t.AnimatePresence,{mode:`wait`,initial:!1,children:f?(0,r.jsxs)(t.motion.span,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.1},className:`flex items-center gap-1`,children:[(0,r.jsx)(a,{}),c&&`Copied`]},`check`):(0,r.jsxs)(t.motion.span,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.1},className:`flex items-center gap-1`,children:[(0,r.jsx)(i,{}),c&&c]},`copy`)})})}exports.CopyButton=o;
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime");var i=()=>(0,r.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,r.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),a=()=>(0,r.jsx)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.jsx)(`path`,{d:`m20 6-11 11-5-5`})});function o({value:o,timeout:s=2e3,label:c,size:l=`sm`,className:u,...d}){let[f,p]=(0,n.useState)(!1);async function m(){try{await navigator.clipboard.writeText(o),p(!0),setTimeout(()=>p(!1),s)}catch{}}return(0,r.jsx)(`button`,{type:`button`,onClick:m,className:e.t(`inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors select-none`,`border border-black/10 dark:border-white/10`,f?`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`:`bg-black/4 dark:bg-white/4 text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-black/8 dark:hover:bg-white/8`,l===`sm`?`h-6 px-2 text-xs gap-1 rounded-md`:`h-8 px-3 text-sm gap-1.5 rounded-lg`,u),...d,children:(0,r.jsx)(t.AnimatePresence,{mode:`wait`,initial:!1,children:f?(0,r.jsxs)(t.motion.span,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.1},className:`inline-flex items-center gap-1 whitespace-nowrap`,children:[(0,r.jsx)(a,{}),c&&`Copied`]},`check`):(0,r.jsxs)(t.motion.span,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.1},className:`inline-flex items-center gap-1 whitespace-nowrap`,children:[(0,r.jsx)(i,{}),c&&c]},`copy`)})})}exports.CopyButton=o;
|
|
@@ -42,7 +42,7 @@ function c({ value: c, timeout: l = 2e3, label: u, size: d = "sm", className: f,
|
|
|
42
42
|
return /* @__PURE__ */ i("button", {
|
|
43
43
|
type: "button",
|
|
44
44
|
onClick: g,
|
|
45
|
-
className: e("inline-flex items-center font-medium transition-colors select-none", "border border-black/10 dark:border-white/10", m ? "bg-emerald-500/10 text-emerald-400 border-emerald-500/20" : "bg-black/4 dark:bg-white/4 text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-black/8 dark:hover:bg-white/8", d === "sm" ? "h-6 px-2 text-xs gap-1 rounded-md" : "h-8 px-3 text-sm gap-1.5 rounded-lg", f),
|
|
45
|
+
className: e("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors select-none", "border border-black/10 dark:border-white/10", m ? "bg-emerald-500/10 text-emerald-400 border-emerald-500/20" : "bg-black/4 dark:bg-white/4 text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-black/8 dark:hover:bg-white/8", d === "sm" ? "h-6 px-2 text-xs gap-1 rounded-md" : "h-8 px-3 text-sm gap-1.5 rounded-lg", f),
|
|
46
46
|
...p,
|
|
47
47
|
children: /* @__PURE__ */ i(t, {
|
|
48
48
|
mode: "wait",
|
|
@@ -61,7 +61,7 @@ function c({ value: c, timeout: l = 2e3, label: u, size: d = "sm", className: f,
|
|
|
61
61
|
opacity: 0
|
|
62
62
|
},
|
|
63
63
|
transition: { duration: .1 },
|
|
64
|
-
className: "flex items-center gap-1",
|
|
64
|
+
className: "inline-flex items-center gap-1 whitespace-nowrap",
|
|
65
65
|
children: [/* @__PURE__ */ i(s, {}), u && "Copied"]
|
|
66
66
|
}, "check") : /* @__PURE__ */ a(n.span, {
|
|
67
67
|
initial: {
|
|
@@ -77,7 +77,7 @@ function c({ value: c, timeout: l = 2e3, label: u, size: d = "sm", className: f,
|
|
|
77
77
|
opacity: 0
|
|
78
78
|
},
|
|
79
79
|
transition: { duration: .1 },
|
|
80
|
-
className: "flex items-center gap-1",
|
|
80
|
+
className: "inline-flex items-center gap-1 whitespace-nowrap",
|
|
81
81
|
children: [/* @__PURE__ */ i(o, {}), u && u]
|
|
82
82
|
}, "copy")
|
|
83
83
|
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={default:`text-foreground`,positive:`text-success`,negative:`text-destructive`,muted:`text-muted-foreground`},i={xs:`text-xs`,sm:`text-sm`,md:`text-base`,lg:`text-lg`,xl:`text-2xl`};function a(e){return typeof e==`bigint`?e<0n:e<0}function o(e){return typeof e==`bigint`||Number.isFinite(e)}function s(e,{currency:t=`USD`,locale:n=`en-US`,accounting:r=!1,options:i}={}){if(!o(e))return null;try{return new Intl.NumberFormat(n,{...i,style:`currency`,currency:t,currencySign:r?`accounting`:`standard`}).format(e)}catch{return null}}var c=(0,t.forwardRef)(({value:t,currency:o=`USD`,locale:c=`en-US`,accounting:l=!1,options:u,tone:d=`auto`,size:f=`md`,fallback:p=`—`,className:m,...h},g)=>{let _=s(t,{currency:o,locale:c,accounting:l,options:u}),v=d===`auto`?a(t)?`negative`:`default`:d,y=u?.notation===`compact`?s(t,{currency:o,locale:c,accounting:l,options:{...u,notation:`standard`}})??void 0:void 0;return(0,n.jsx)(`span`,{ref:g,"data-invalid":_===null||void 0,"aria-label":y,className:e.t(`inline whitespace-nowrap font-medium tabular-nums`,r[v],i[f],m),...h,children:_??p})});c.displayName=`Currency`,exports.Currency=c,exports.formatCurrency=s;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type CurrencyTone = "auto" | "default" | "positive" | "negative" | "muted";
|
|
3
|
+
export type CurrencySize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
export type CurrencyFormatOptions = Omit<Intl.NumberFormatOptions, "style" | "currency" | "currencySign">;
|
|
5
|
+
export interface FormatCurrencyOptions {
|
|
6
|
+
currency?: string;
|
|
7
|
+
locale?: Intl.LocalesArgument;
|
|
8
|
+
accounting?: boolean;
|
|
9
|
+
options?: CurrencyFormatOptions;
|
|
10
|
+
}
|
|
11
|
+
export declare function formatCurrency(value: number | bigint, { currency, locale, accounting, options, }?: FormatCurrencyOptions): string | null;
|
|
12
|
+
export interface CurrencyProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children">, FormatCurrencyOptions {
|
|
13
|
+
value: number | bigint;
|
|
14
|
+
tone?: CurrencyTone;
|
|
15
|
+
size?: CurrencySize;
|
|
16
|
+
fallback?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const Currency: import('react').ForwardRefExoticComponent<CurrencyProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/currency.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
default: "text-foreground",
|
|
7
|
+
positive: "text-success",
|
|
8
|
+
negative: "text-destructive",
|
|
9
|
+
muted: "text-muted-foreground"
|
|
10
|
+
}, i = {
|
|
11
|
+
xs: "text-xs",
|
|
12
|
+
sm: "text-sm",
|
|
13
|
+
md: "text-base",
|
|
14
|
+
lg: "text-lg",
|
|
15
|
+
xl: "text-2xl"
|
|
16
|
+
};
|
|
17
|
+
function a(e) {
|
|
18
|
+
return typeof e == "bigint" ? e < 0n : e < 0;
|
|
19
|
+
}
|
|
20
|
+
function o(e) {
|
|
21
|
+
return typeof e == "bigint" || Number.isFinite(e);
|
|
22
|
+
}
|
|
23
|
+
function s(e, { currency: t = "USD", locale: n = "en-US", accounting: r = !1, options: i } = {}) {
|
|
24
|
+
if (!o(e)) return null;
|
|
25
|
+
try {
|
|
26
|
+
return new Intl.NumberFormat(n, {
|
|
27
|
+
...i,
|
|
28
|
+
style: "currency",
|
|
29
|
+
currency: t,
|
|
30
|
+
currencySign: r ? "accounting" : "standard"
|
|
31
|
+
}).format(e);
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
var c = t(({ value: t, currency: o = "USD", locale: c = "en-US", accounting: l = !1, options: u, tone: d = "auto", size: f = "md", fallback: p = "—", className: m, ...h }, g) => {
|
|
37
|
+
let _ = s(t, {
|
|
38
|
+
currency: o,
|
|
39
|
+
locale: c,
|
|
40
|
+
accounting: l,
|
|
41
|
+
options: u
|
|
42
|
+
}), v = d === "auto" ? a(t) ? "negative" : "default" : d, y = u?.notation === "compact" ? s(t, {
|
|
43
|
+
currency: o,
|
|
44
|
+
locale: c,
|
|
45
|
+
accounting: l,
|
|
46
|
+
options: {
|
|
47
|
+
...u,
|
|
48
|
+
notation: "standard"
|
|
49
|
+
}
|
|
50
|
+
}) ?? void 0 : void 0;
|
|
51
|
+
return /* @__PURE__ */ n("span", {
|
|
52
|
+
ref: g,
|
|
53
|
+
"data-invalid": _ === null || void 0,
|
|
54
|
+
"aria-label": y,
|
|
55
|
+
className: e("inline whitespace-nowrap font-medium tabular-nums", r[v], i[f], m),
|
|
56
|
+
...h,
|
|
57
|
+
children: _ ?? p
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
c.displayName = "Currency";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { c as Currency, s as formatCurrency };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../datatable-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../datatable-rzDgQ3r6.cjs");exports.DataTable=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=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],o=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function s(e){return`${o[e.getMonth()].slice(0,3)} ${e.getDate()}, ${e.getFullYear()}`}function c(e,t){return new Date(e,t+1,0).getDate()}function l(e,t){return new Date(e,t,1).getDay()}function u(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function d({value:d,onChange:f,label:p,hint:m,error:h,placeholder:g=`Select date…`,disabled:_,clearable:v=!0,minDate:y,maxDate:b,className:x}){let[S,C]=(0,r.useState)(null),w=d===void 0?S:d,T=new Date,[E,D]=(0,r.useState)(!1),[O,k]=(0,r.useState)((w??T).getFullYear()),[A,j]=(0,r.useState)((w??T).getMonth()),M=(0,r.useRef)(null),N=(0,r.useId)(),P=`${N}-message`;function F(e){d===void 0&&C(e),f?.(e),D(!1)}function I(e){e.stopPropagation(),d===void 0&&C(null),f?.(null)}function L(){A===0?(j(11),k(e=>e-1)):j(e=>e-1)}function R(){A===11?(j(0),k(e=>e+1)):j(e=>e+1)}(0,r.useEffect)(()=>{function e(e){M.current?.contains(e.target)||D(!1)}function t(e){e.key===`Escape`&&D(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[]);let z=c(O,A),B=l(O,A),V=[...Array(B).fill(null),...Array.from({length:z},(e,t)=>t+1)];return(0,i.jsxs)(`div`,{ref:M,className:e.t(`relative`,t.o,x),children:[p&&(0,i.jsx)(`label`,{htmlFor:N,className:`text-xs font-semibold leading-5 text-foreground`,children:p}),(0,i.jsxs)(`button`,{type:`button`,id:N,"aria-expanded":E,"aria-haspopup":`dialog`,"aria-invalid":h?!0:void 0,"aria-describedby":h||m?P:void 0,disabled:_,onClick:()=>D(e=>!e),className:e.t(`flex h-9 w-full items-center gap-2 rounded-[var(--radius-md)] px-3 text-left outline-none`,t.t,`focus:border-accent-500 focus:ring-2 focus:ring-focus-ring/20`,h&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,_&&`opacity-50 cursor-not-allowed`),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-500 shrink-0`,children:[(0,i.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,ry:`2`}),(0,i.jsx)(`line`,{x1:`16`,x2:`16`,y1:`2`,y2:`6`}),(0,i.jsx)(`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`6`}),(0,i.jsx)(`line`,{x1:`3`,x2:`21`,y1:`10`,y2:`10`})]}),(0,i.jsx)(`span`,{className:e.t(`flex-1 text-sm truncate`,w?`text-foreground`:`text-muted-foreground`),children:w?s(w):g}),v&&w&&!_&&(0,i.jsx)(`span`,{role:`button`,tabIndex:-1,onClick:I,className:`shrink-0 text-slate-500 hover:text-slate-700 dark:hover:text-slate-300 transition-colors`,children:(0,i.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,i.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),(0,i.jsx)(n.AnimatePresence,{children:E&&(0,i.jsxs)(n.motion.div,{initial:{opacity:0,y:-4,scaleY:.97},animate:{opacity:1,y:0,scaleY:1},exit:{opacity:0,y:-4,scaleY:.97},transition:{duration:.13},style:{originY:0},role:`dialog`,"aria-label":`Choose date`,className:`absolute left-0 top-full z-50 mt-1.5 w-[min(18rem,calc(100vw-2rem))] rounded-[var(--radius-lg)] border border-border bg-surface-raised p-3 shadow-floating`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:L,"aria-label":`Previous month`,className:e.t(t.c,`size-7`),children:(0,i.jsx)(`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:`m15 18-6-6 6-6`})})}),(0,i.jsxs)(`span`,{"aria-live":`polite`,className:`text-sm font-semibold text-foreground`,children:[o[A],` `,O]}),(0,i.jsx)(`button`,{type:`button`,onClick:R,"aria-label":`Next month`,className:e.t(t.c,`size-7`),children:(0,i.jsx)(`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:`m9 18 6-6-6-6`})})})]}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 gap-0.5 mb-1`,children:a.map(e=>(0,i.jsx)(`div`,{"aria-hidden":`true`,className:`text-center text-[10px] font-semibold text-muted-foreground py-1`,children:e},e))}),(0,i.jsx)(`div`,{className:`grid grid-cols-7 gap-0.5`,children:V.map((t,n)=>{if(!t)return(0,i.jsx)(`div`,{},`empty-${n}`);let r=new Date(O,A,t),a=w?u(r,w):!1,o=u(r,T),s=y&&r<y||b&&r>b;return(0,i.jsx)(`button`,{type:`button`,disabled:!!s,onClick:()=>F(r),"aria-label":r.toLocaleDateString(void 0,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),"aria-pressed":a,"aria-current":o?`date`:void 0,className:e.t(`h-8 w-full rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring/35`,a?`bg-primary text-primary-foreground font-medium`:o?`border border-accent-500/40 text-accent-400 hover:bg-accent-500/10`:`text-slate-700 dark:text-slate-200 hover:bg-black/6 dark:hover:bg-white/6`,s&&`opacity-30 cursor-not-allowed`),children:t},t)})})]})}),h&&(0,i.jsx)(`p`,{id:P,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:h}),m&&!h&&(0,i.jsx)(`p`,{id:P,className:`text-xs leading-5 text-muted-foreground`,children:m})]})}exports.DatePicker=d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
-
import { c as t, o as n, t as r } from "../component-styles-
|
|
3
|
+
import { c as t, o as n, t as r } from "../component-styles-Bgy44fc8.js";
|
|
4
4
|
import { AnimatePresence as i, motion as a } from "framer-motion";
|
|
5
5
|
import { useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
6
6
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
@@ -71,7 +71,7 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
71
71
|
children: [
|
|
72
72
|
b && /* @__PURE__ */ u("label", {
|
|
73
73
|
htmlFor: B,
|
|
74
|
-
className: "text-
|
|
74
|
+
className: "text-xs font-semibold leading-5 text-foreground",
|
|
75
75
|
children: b
|
|
76
76
|
}),
|
|
77
77
|
/* @__PURE__ */ d("button", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`},i={compact:`gap-x-4 gap-y-3`,default:`gap-x-6 gap-y-5`,relaxed:`gap-x-8 gap-y-7`},a=(0,t.forwardRef)(({columns:t=1,density:a=`default`,className:o,...s},c)=>(0,n.jsx)(`dl`,{ref:c,className:e.t(`grid min-w-0`,r[t],i[a],o),...s}));a.displayName=`DescriptionList`;var o=(0,t.forwardRef)(({orientation:t=`stacked`,className:r,...i},a)=>(0,n.jsx)(`div`,{ref:a,className:e.t(`min-w-0`,t===`inline`?`flex flex-col gap-1 sm:flex-row sm:items-baseline sm:justify-between sm:gap-4`:`flex flex-col gap-1`,r),...i}));o.displayName=`DescriptionItem`;var s=(0,t.forwardRef)(({className:t,...r},i)=>(0,n.jsx)(`dt`,{ref:i,className:e.t(`text-xs font-medium text-muted-foreground`,t),...r}));s.displayName=`DescriptionTerm`;var c=(0,t.forwardRef)(({className:t,...r},i)=>(0,n.jsx)(`dd`,{ref:i,className:e.t(`min-w-0 break-words text-sm font-medium text-foreground`,t),...r}));c.displayName=`DescriptionDetails`,exports.DescriptionDetails=c,exports.DescriptionItem=o,exports.DescriptionList=a,exports.DescriptionTerm=s;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type DescriptionListColumns = 1 | 2 | 3;
|
|
3
|
+
export type DescriptionListDensity = "compact" | "default" | "relaxed";
|
|
4
|
+
export interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
5
|
+
columns?: DescriptionListColumns;
|
|
6
|
+
density?: DescriptionListDensity;
|
|
7
|
+
}
|
|
8
|
+
export declare const DescriptionList: import('react').ForwardRefExoticComponent<DescriptionListProps & import('react').RefAttributes<HTMLDListElement>>;
|
|
9
|
+
export interface DescriptionItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
orientation?: "stacked" | "inline";
|
|
11
|
+
}
|
|
12
|
+
export declare const DescriptionItem: import('react').ForwardRefExoticComponent<DescriptionItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const DescriptionTerm: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
14
|
+
export declare const DescriptionDetails: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/description-list.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
1: "grid-cols-1",
|
|
7
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
8
|
+
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
|
|
9
|
+
}, i = {
|
|
10
|
+
compact: "gap-x-4 gap-y-3",
|
|
11
|
+
default: "gap-x-6 gap-y-5",
|
|
12
|
+
relaxed: "gap-x-8 gap-y-7"
|
|
13
|
+
}, a = t(({ columns: t = 1, density: a = "default", className: o, ...s }, c) => /* @__PURE__ */ n("dl", {
|
|
14
|
+
ref: c,
|
|
15
|
+
className: e("grid min-w-0", r[t], i[a], o),
|
|
16
|
+
...s
|
|
17
|
+
}));
|
|
18
|
+
a.displayName = "DescriptionList";
|
|
19
|
+
var o = t(({ orientation: t = "stacked", className: r, ...i }, a) => /* @__PURE__ */ n("div", {
|
|
20
|
+
ref: a,
|
|
21
|
+
className: e("min-w-0", t === "inline" ? "flex flex-col gap-1 sm:flex-row sm:items-baseline sm:justify-between sm:gap-4" : "flex flex-col gap-1", r),
|
|
22
|
+
...i
|
|
23
|
+
}));
|
|
24
|
+
o.displayName = "DescriptionItem";
|
|
25
|
+
var s = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("dt", {
|
|
26
|
+
ref: i,
|
|
27
|
+
className: e("text-xs font-medium text-muted-foreground", t),
|
|
28
|
+
...r
|
|
29
|
+
}));
|
|
30
|
+
s.displayName = "DescriptionTerm";
|
|
31
|
+
var c = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("dd", {
|
|
32
|
+
ref: i,
|
|
33
|
+
className: e("min-w-0 break-words text-sm font-medium text-foreground", t),
|
|
34
|
+
...r
|
|
35
|
+
}));
|
|
36
|
+
c.displayName = "DescriptionDetails";
|
|
37
|
+
//#endregion
|
|
38
|
+
export { c as DescriptionDetails, o as DescriptionItem, a as DescriptionList, s as DescriptionTerm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={solid:`border-solid`,dashed:`border-dashed`,dotted:`border-dotted`},i={none:`my-0`,sm:`my-2`,md:`my-4`,lg:`my-6`},a={none:`mx-0`,sm:`mx-2`,md:`mx-4`,lg:`mx-6`},o=(0,t.forwardRef)(({orientation:t=`horizontal`,variant:o=`solid`,spacing:s=`md`,label:c,decorative:l=!0,className:u,...d},f)=>{let p=t===`vertical`,m=e.t(`min-w-0 flex-1 border-border`,r[o],p?`w-0 border-l`:`h-0 border-t`);return(0,n.jsxs)(`div`,{ref:f,role:l?`presentation`:`separator`,"aria-orientation":l?void 0:t,className:e.t(`flex shrink-0 items-center`,p?`h-full min-h-4 self-stretch flex-col`:`w-full min-w-0 flex-row`,p?a[s]:i[s],u),...d,children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,className:m}),c&&(0,n.jsx)(`span`,{className:e.t(`shrink-0 text-xs font-medium text-muted-foreground`,p?`my-2 [writing-mode:vertical-rl]`:`mx-3`),children:c}),c&&(0,n.jsx)(`span`,{"aria-hidden":`true`,className:m})]})});o.displayName=`Divider`,exports.Divider=o;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type DividerOrientation = "horizontal" | "vertical";
|
|
3
|
+
export type DividerVariant = "solid" | "dashed" | "dotted";
|
|
4
|
+
export type DividerSpacing = "none" | "sm" | "md" | "lg";
|
|
5
|
+
export interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
orientation?: DividerOrientation;
|
|
7
|
+
variant?: DividerVariant;
|
|
8
|
+
spacing?: DividerSpacing;
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLDivElement>>;
|