@synertech/ui 0.46.0 → 0.46.1
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/dist/components/badge/Badge.cjs +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/calendar/Calendar.cjs +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/chip/Chip.cjs +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/help-button/MarkdownEditor.cjs +1 -1
- package/dist/components/help-button/MarkdownEditor.js +1 -1
- package/dist/components/indicator/Indicator.cjs +1 -1
- package/dist/components/indicator/Indicator.js +1 -1
- package/dist/components/tabs/TabsTrigger.cjs +1 -1
- package/dist/components/tabs/TabsTrigger.js +1 -1
- package/dist/components/toast/Toast.cjs +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/tooltip/Tooltip.cjs +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/wizard/Wizard.cjs +1 -1
- package/dist/components/wizard/Wizard.js +1 -1
- package/dist/styles.css +122 -58
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of u(e))!k.call(t,d)&&d!==r&&g(t,d,{get:()=>e[d],enumerable:!(o=p(e,d))||o.enumerable});return t};var w=t=>c(g({},"__esModule",{value:!0}),t);var C={};y(C,{Badge:()=>
|
|
1
|
+
"use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of u(e))!k.call(t,d)&&d!==r&&g(t,d,{get:()=>e[d],enumerable:!(o=p(e,d))||o.enumerable});return t};var w=t=>c(g({},"__esModule",{value:!0}),t);var C={};y(C,{Badge:()=>b});module.exports=w(C);var l=require("../../lib/cn.cjs"),a=require("react/jsx-runtime"),f={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-gray-900",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-600 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-600 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-600 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-400"},teal:{solid:"bg-teal-600 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-600 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-600 dark:bg-teal-900/30 dark:text-teal-400"}},m={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},h={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},B={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},R={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function b({children:t,color:e="default",size:r="md",variant:o="soft",dot:d=!1,icon:n,pill:i=!0,className:s,...x}){return(0,a.jsxs)("span",{className:(0,l.cn)("inline-flex items-center font-medium",h[r],i?"rounded-full":"rounded",f[e][o],s),...x,children:[d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0 rounded-full",B[r],m[e]),"aria-hidden":"true"}),n&&!d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0",R[r]),"aria-hidden":"true",children:n}),t]})}b.displayName="Badge";0&&(module.exports={Badge});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as t}from"../../lib/cn.js";import{jsx as o,jsxs as c}from"react/jsx-runtime";var s={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-
|
|
1
|
+
import{cn as t}from"../../lib/cn.js";import{jsx as o,jsxs as c}from"react/jsx-runtime";var s={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-gray-900",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-600 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-600 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-600 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-400"},teal:{solid:"bg-teal-600 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-600 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-600 dark:bg-teal-900/30 dark:text-teal-400"}},x={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},p={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},u={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},k={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function y({children:l,color:r="default",size:e="md",variant:g="soft",dot:d=!1,icon:a,pill:n=!0,className:b,...i}){return c("span",{className:t("inline-flex items-center font-medium",p[e],n?"rounded-full":"rounded",s[r][g],b),...i,children:[d&&o("span",{className:t("shrink-0 rounded-full",u[e],x[r]),"aria-hidden":"true"}),a&&!d&&o("span",{className:t("shrink-0",k[e]),"aria-hidden":"true",children:a}),l]})}y.displayName="Badge";export{y as Badge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var se=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var et=(e,a)=>{for(var s in a)se(e,s,{get:a[s],enumerable:!0})},tt=(e,a,s,F)=>{if(a&&typeof a=="object"||typeof a=="function")for(let D of Xe(a))!Ze.call(e,D)&&D!==s&&se(e,D,{get:()=>a[D],enumerable:!(F=Qe(a,D))||F.enumerable});return e};var at=e=>tt(se({},"__esModule",{value:!0}),e);var bt={};et(bt,{Calendar:()=>ft});module.exports=at(bt);var l=require("react"),c=require("../../lib/cn.cjs"),we=require("../../lib/i18n.cjs"),n=require("react/jsx-runtime"),rt=10080*60*1e3;function g(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function V(e){return new Date(e.getFullYear(),e.getMonth(),1)}function T(e,a){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function k(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function de(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function N(e,a){return!e||!a?!1:e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function ie(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function E(e,a){return e.getFullYear()*12+e.getMonth()-(a.getFullYear()*12+a.getMonth())}function J(e){let a=`${e.getMonth()+1}`.padStart(2,"0"),s=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${a}-${s}`}function nt(e){let a=g(e);a.setDate(a.getDate()-(a.getDay()+6)%7+3);let s=new Date(a.getFullYear(),0,4);return s.setDate(s.getDate()-(s.getDay()+6)%7+3),1+Math.round((a.getTime()-s.getTime())/rt)}function ke(e,a,s){return a&&e<g(a)?g(a):s&&e>g(s)?g(s):e}function ot(e,a,s){let F=V(e),D=(F.getDay()-a+7)%7,_=T(F,-D),j=s?6:Math.ceil((D+de(e))/7);return Array.from({length:j},(X,G)=>Array.from({length:7},(ue,L)=>T(_,G*7+L)))}function lt({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function st({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var it={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},dt={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-white hover:bg-yellow-600 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},ut={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},ct={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},gt={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},z={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function Q(e,a){if(e==="multiple")return Array.isArray(a)?a.map(g):[];if(e==="range"){let s=a??null;return{from:s?.from?g(s.from):null,to:s?.to?g(s.to):null}}return a instanceof Date?g(a):null}function ve(e){return e?e instanceof Date?e:Array.isArray(e)?e[0]??null:e.from??e.to??null:null}function ft(e){let{mode:a="single",value:s,defaultValue:F,onChange:D,max:_,month:j,defaultMonth:X,onMonthChange:G,numberOfMonths:ue=1,weekStartsOn:L=0,locale:R,size:Ce="md",color:x="primary",minDate:v,maxDate:w,disabledDates:O,disabled:y=!1,showOutsideDays:Me=!0,showWeekNumbers:ce=!1,fixedWeeks:Se=!1,captionLayout:Z="label",fromYear:ge,toYear:fe,todayButton:ee=!1,clearButton:te=!1,footer:be,bordered:Ne=!0,renderDay:ye,labels:B,className:Fe,...Re}=e,I=(0,we.useUILabels)(),h=it[Ce],C=Math.max(1,ue),Y=(0,l.useMemo)(()=>g(new Date),[]),ae=s!==void 0,[Ye,Pe]=(0,l.useState)(()=>Q(a,F)),A=ae?Q(a,s):Ye,re=j!==void 0,[Te,Le]=(0,l.useState)(()=>V(X??ve(Q(a,F??s))??new Date)),f=re?V(j):Te,p=(0,l.useCallback)(t=>{let r=V(t);re||Le(r),G?.(r)},[re,G]),me=(0,l.useRef)(null),ne=(0,l.useRef)(!1),[W,U]=(0,l.useState)(()=>{let t=ve(Q(a,F??s)),r=V(X??j??t??new Date),u=t&&ie(t,r)?t:ie(g(new Date),r)?g(new Date):r;return ke(u,v,w)}),Ae=k(f,C-1),Ee=E(W,f)>=0&&E(W,Ae)<=0?W:f;(0,l.useEffect)(()=>{if(!ne.current)return;ne.current=!1,me.current?.querySelector(`[data-day="${J(W)}"]:not([data-outside])`)?.focus()},[W,f]);let P=(0,l.useCallback)(t=>{let r=ke(g(t),v,w);ne.current=!0,U(r);let u=k(f,C-1);E(r,f)<0?p(r):E(r,u)>0&&p(k(r,-(C-1)))},[f,C,v,w,p]),K=(0,l.useCallback)(t=>y||v&&t<g(v)||w&&t>g(w)?!0:typeof O=="function"?O(t):Array.isArray(O)?O.some(r=>N(r,t)):!1,[y,v,w,O]),[oe,he]=(0,l.useState)(null),M=(0,l.useCallback)(t=>{ae||Pe(t),D?.(t)},[ae,D]),q=(0,l.useCallback)(t=>{let r=g(t);if(K(r))return;if(a==="multiple"){let i=A??[];if(i.some(o=>N(o,r))){M(i.filter(o=>!N(o,r)));return}if(_!==void 0&&i.length>=_)return;M([...i,r].sort((o,b)=>o.getTime()-b.getTime()));return}if(a==="range"){let i=A??{from:null,to:null};if(!i.from||i.to){M({from:r,to:null});return}M(r<i.from?{from:r,to:i.from}:{from:i.from,to:r});return}M(N(A,r)?null:r)},[a,A,_,M,K]),Be=(0,l.useCallback)(t=>{q(t),U(g(t)),E(t,f)<0?p(t):E(t,k(f,C-1))>0&&p(k(t,-(C-1)))},[q,f,C,p]),pe=!y&&(!v||E(f,V(v))>0),De=!y&&(!w||E(k(f,C-1),V(w))<0),Ie=(0,l.useCallback)(()=>{p(k(f,-1))},[f,p]),We=(0,l.useCallback)(()=>{p(k(f,1))},[f,p]),ze=(0,l.useCallback)(t=>{if(y)return;let r=W;switch(t.key){case"ArrowLeft":t.preventDefault(),P(T(r,-1));break;case"ArrowRight":t.preventDefault(),P(T(r,1));break;case"ArrowUp":t.preventDefault(),P(T(r,-7));break;case"ArrowDown":t.preventDefault(),P(T(r,7));break;case"Home":t.preventDefault(),P(T(r,-((r.getDay()-L+7)%7)));break;case"End":t.preventDefault(),P(T(r,6-(r.getDay()-L+7)%7));break;case"PageUp":{t.preventDefault();let u=t.shiftKey?-12:-1,i=k(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}case"PageDown":{t.preventDefault();let u=t.shiftKey?12:1,i=k(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}default:break}},[y,W,P,L]),Ve=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{weekday:"short"}),r=new Intl.DateTimeFormat(R,{weekday:"long"}),u=new Date(2024,0,7);return Array.from({length:7},(i,m)=>{let o=T(u,(L+m)%7);return{short:t.format(o),long:r.format(o)}})},[R,L]),Ke=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{month:"long"});return Array.from({length:12},(r,u)=>t.format(new Date(2024,u,1)))},[R]),xe=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{month:"long",year:"numeric"}),[R]),_e=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{dateStyle:"full"}),[R]),je=(0,l.useMemo)(()=>{if(Z!=="dropdown")return[];let t=Y.getFullYear(),r=ge??v?.getFullYear()??t-100,u=fe??w?.getFullYear()??t+10;return u<r?[r]:Array.from({length:u-r+1},(i,m)=>r+m)},[Z,ge,fe,v,w,Y]),S=a==="range"?A:null,Oe=S&&S.from&&!S.to&&oe&&oe>S.from?oe:null,$=S?.to??Oe,$e=(0,l.useCallback)((t,r)=>{let u=!ie(t,r),i=K(t),m=!1,o=!1,b=!1,d=!1;return a==="multiple"?m=(A??[]).some(H=>N(H,t)):a==="range"?(o=N(S?.from,t),b=N($,t),m=o||b,d=!!(S?.from&&$&&t>S.from&&t<$)):m=N(A,t),{selected:m,today:N(t,Y),outside:u,disabled:i,rangeStart:o,rangeEnd:b,inRange:d}},[a,A,S,$,K,Y]),He=t=>{let r=k(f,t),u=ot(r,L,Se),i=t===0,m=t===C-1;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("button",{type:"button",onClick:Ie,disabled:!pe,"aria-label":B?.previousMonth??I.calendarPreviousMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[x],h.nav,!pe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!i&&"invisible"),children:(0,n.jsx)(lt,{className:h.icon})}),Z==="dropdown"?(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("select",{"aria-label":B?.monthSelect??I.calendarMonth,value:r.getMonth(),disabled:y,onChange:o=>p(new Date(r.getFullYear(),Number(o.target.value)-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[x],h.select,y&&"cursor-not-allowed opacity-50"),children:Ke.map((o,b)=>(0,n.jsx)("option",{value:b,children:o},o))}),(0,n.jsx)("select",{"aria-label":B?.yearSelect??I.calendarYear,value:r.getFullYear(),disabled:y,onChange:o=>p(new Date(Number(o.target.value),r.getMonth()-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[x],h.select,y&&"cursor-not-allowed opacity-50"),children:je.map(o=>(0,n.jsx)("option",{value:o,children:o},o))})]}):(0,n.jsx)("div",{"aria-live":"polite",className:(0,c.cn)("font-semibold text-gray-900 dark:text-gray-100",h.caption),children:xe.format(r)}),(0,n.jsx)("button",{type:"button",onClick:We,disabled:!De,"aria-label":B?.nextMonth??I.calendarNextMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[x],h.nav,!De&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!m&&"invisible"),children:(0,n.jsx)(st,{className:h.icon})})]}),(0,n.jsxs)("table",{role:"grid","aria-label":xe.format(r),onKeyDown:ze,className:"border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[ce&&(0,n.jsxs)("th",{scope:"col",className:(0,c.cn)("font-normal text-gray-400 dark:text-gray-500",h.head),children:[(0,n.jsx)("span",{className:"sr-only",children:B?.weekNumber??I.calendarWeekNumber}),(0,n.jsx)("span",{"aria-hidden":"true",children:"#"})]}),Ve.map(o=>(0,n.jsx)("th",{scope:"col",abbr:o.long,className:(0,c.cn)("font-medium uppercase text-gray-500 dark:text-gray-400",h.head),children:o.short},o.long))]})}),(0,n.jsx)("tbody",{children:u.map(o=>(0,n.jsxs)("tr",{children:[ce&&(0,n.jsx)("td",{className:(0,c.cn)("text-center align-middle text-gray-400 dark:text-gray-500",h.head),children:nt(o[0])}),o.map(b=>{let d=$e(b,r),H=J(b);if(d.outside&&!Me)return(0,n.jsx)("td",{className:"p-0"},H);let Je=N(b,Ee)&&!d.outside,le=d.inRange||d.rangeStart&&!!$||d.rangeEnd&&!!S?.from;return(0,n.jsx)("td",{role:"presentation",className:(0,c.cn)("p-0",le&&ut[x],le&&d.rangeStart&&"rounded-l-full",le&&d.rangeEnd&&"rounded-r-full"),children:(0,n.jsx)("button",{type:"button","data-day":H,"data-selected":d.selected||void 0,"data-today":d.today||void 0,"data-outside":d.outside||void 0,role:"gridcell",tabIndex:Je?0:-1,disabled:y,"aria-selected":d.selected,"aria-disabled":d.disabled||void 0,"aria-current":d.today?"date":void 0,"aria-label":_e.format(b),onClick:()=>{d.disabled||Be(b)},onMouseEnter:()=>a==="range"&&he(g(b)),onMouseLeave:()=>a==="range"&&he(null),onFocus:()=>U(g(b)),className:(0,c.cn)("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[x],h.day,d.selected?dt[x]:d.inRange?(0,c.cn)(ct[x],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):d.today?(0,c.cn)(gt[x],"hover:bg-gray-100 dark:hover:bg-gray-700"):(0,c.cn)("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),d.outside&&!d.selected&&"text-gray-400 dark:text-gray-500",d.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:ye?ye(b,d):b.getDate()})},H)})]},J(o[0])))})]})]},J(r))},Ge=(0,l.useCallback)(()=>{p(Y),U(Y),K(Y)||q(Y)},[Y,p,K,q]),Ue=(0,l.useCallback)(()=>{M(a==="multiple"?[]:a==="range"?{from:null,to:null}:null)},[a,M]),qe=!!be||ee||te;return(0,n.jsxs)("div",{ref:me,className:(0,c.cn)("inline-block bg-white dark:bg-gray-900",Ne&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",h.padding,y&&"opacity-60",Fe),...Re,children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap",h.gap),children:Array.from({length:C},(t,r)=>He(r))}),qe&&(0,n.jsxs)("div",{className:(0,c.cn)("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",h.footer),children:[(0,n.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:be}),(ee||te)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[ee&&(0,n.jsx)("button",{type:"button",onClick:Ge,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[x],y&&"cursor-not-allowed opacity-50"),children:B?.today??I.calendarToday}),te&&(0,n.jsx)("button",{type:"button",onClick:Ue,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[x],y&&"cursor-not-allowed opacity-50"),children:B?.clear??I.calendarClear})]})]})]})}0&&(module.exports={Calendar});
|
|
1
|
+
"use strict";"use client";var se=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var et=(e,a)=>{for(var s in a)se(e,s,{get:a[s],enumerable:!0})},tt=(e,a,s,F)=>{if(a&&typeof a=="object"||typeof a=="function")for(let D of Xe(a))!Ze.call(e,D)&&D!==s&&se(e,D,{get:()=>a[D],enumerable:!(F=Qe(a,D))||F.enumerable});return e};var at=e=>tt(se({},"__esModule",{value:!0}),e);var bt={};et(bt,{Calendar:()=>ft});module.exports=at(bt);var l=require("react"),c=require("../../lib/cn.cjs"),we=require("../../lib/i18n.cjs"),n=require("react/jsx-runtime"),rt=10080*60*1e3;function g(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function V(e){return new Date(e.getFullYear(),e.getMonth(),1)}function T(e,a){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function x(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function de(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function N(e,a){return!e||!a?!1:e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function ie(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function E(e,a){return e.getFullYear()*12+e.getMonth()-(a.getFullYear()*12+a.getMonth())}function J(e){let a=`${e.getMonth()+1}`.padStart(2,"0"),s=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${a}-${s}`}function nt(e){let a=g(e);a.setDate(a.getDate()-(a.getDay()+6)%7+3);let s=new Date(a.getFullYear(),0,4);return s.setDate(s.getDate()-(s.getDay()+6)%7+3),1+Math.round((a.getTime()-s.getTime())/rt)}function xe(e,a,s){return a&&e<g(a)?g(a):s&&e>g(s)?g(s):e}function ot(e,a,s){let F=V(e),D=(F.getDay()-a+7)%7,_=T(F,-D),j=s?6:Math.ceil((D+de(e))/7);return Array.from({length:j},(X,G)=>Array.from({length:7},(ue,L)=>T(_,G*7+L)))}function lt({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function st({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var it={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},dt={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-gray-900 hover:bg-yellow-600 dark:bg-yellow-400 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},ut={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},ct={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},gt={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},z={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function Q(e,a){if(e==="multiple")return Array.isArray(a)?a.map(g):[];if(e==="range"){let s=a??null;return{from:s?.from?g(s.from):null,to:s?.to?g(s.to):null}}return a instanceof Date?g(a):null}function ke(e){return e?e instanceof Date?e:Array.isArray(e)?e[0]??null:e.from??e.to??null:null}function ft(e){let{mode:a="single",value:s,defaultValue:F,onChange:D,max:_,month:j,defaultMonth:X,onMonthChange:G,numberOfMonths:ue=1,weekStartsOn:L=0,locale:R,size:Ce="md",color:v="primary",minDate:k,maxDate:w,disabledDates:O,disabled:y=!1,showOutsideDays:Me=!0,showWeekNumbers:ce=!1,fixedWeeks:Se=!1,captionLayout:Z="label",fromYear:ge,toYear:fe,todayButton:ee=!1,clearButton:te=!1,footer:be,bordered:Ne=!0,renderDay:ye,labels:B,className:Fe,...Re}=e,I=(0,we.useUILabels)(),h=it[Ce],C=Math.max(1,ue),Y=(0,l.useMemo)(()=>g(new Date),[]),ae=s!==void 0,[Ye,Pe]=(0,l.useState)(()=>Q(a,F)),A=ae?Q(a,s):Ye,re=j!==void 0,[Te,Le]=(0,l.useState)(()=>V(X??ke(Q(a,F??s))??new Date)),f=re?V(j):Te,p=(0,l.useCallback)(t=>{let r=V(t);re||Le(r),G?.(r)},[re,G]),me=(0,l.useRef)(null),ne=(0,l.useRef)(!1),[W,U]=(0,l.useState)(()=>{let t=ke(Q(a,F??s)),r=V(X??j??t??new Date),u=t&&ie(t,r)?t:ie(g(new Date),r)?g(new Date):r;return xe(u,k,w)}),Ae=x(f,C-1),Ee=E(W,f)>=0&&E(W,Ae)<=0?W:f;(0,l.useEffect)(()=>{if(!ne.current)return;ne.current=!1,me.current?.querySelector(`[data-day="${J(W)}"]:not([data-outside])`)?.focus()},[W,f]);let P=(0,l.useCallback)(t=>{let r=xe(g(t),k,w);ne.current=!0,U(r);let u=x(f,C-1);E(r,f)<0?p(r):E(r,u)>0&&p(x(r,-(C-1)))},[f,C,k,w,p]),K=(0,l.useCallback)(t=>y||k&&t<g(k)||w&&t>g(w)?!0:typeof O=="function"?O(t):Array.isArray(O)?O.some(r=>N(r,t)):!1,[y,k,w,O]),[oe,he]=(0,l.useState)(null),M=(0,l.useCallback)(t=>{ae||Pe(t),D?.(t)},[ae,D]),q=(0,l.useCallback)(t=>{let r=g(t);if(K(r))return;if(a==="multiple"){let i=A??[];if(i.some(o=>N(o,r))){M(i.filter(o=>!N(o,r)));return}if(_!==void 0&&i.length>=_)return;M([...i,r].sort((o,b)=>o.getTime()-b.getTime()));return}if(a==="range"){let i=A??{from:null,to:null};if(!i.from||i.to){M({from:r,to:null});return}M(r<i.from?{from:r,to:i.from}:{from:i.from,to:r});return}M(N(A,r)?null:r)},[a,A,_,M,K]),Be=(0,l.useCallback)(t=>{q(t),U(g(t)),E(t,f)<0?p(t):E(t,x(f,C-1))>0&&p(x(t,-(C-1)))},[q,f,C,p]),pe=!y&&(!k||E(f,V(k))>0),De=!y&&(!w||E(x(f,C-1),V(w))<0),Ie=(0,l.useCallback)(()=>{p(x(f,-1))},[f,p]),We=(0,l.useCallback)(()=>{p(x(f,1))},[f,p]),ze=(0,l.useCallback)(t=>{if(y)return;let r=W;switch(t.key){case"ArrowLeft":t.preventDefault(),P(T(r,-1));break;case"ArrowRight":t.preventDefault(),P(T(r,1));break;case"ArrowUp":t.preventDefault(),P(T(r,-7));break;case"ArrowDown":t.preventDefault(),P(T(r,7));break;case"Home":t.preventDefault(),P(T(r,-((r.getDay()-L+7)%7)));break;case"End":t.preventDefault(),P(T(r,6-(r.getDay()-L+7)%7));break;case"PageUp":{t.preventDefault();let u=t.shiftKey?-12:-1,i=x(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}case"PageDown":{t.preventDefault();let u=t.shiftKey?12:1,i=x(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}default:break}},[y,W,P,L]),Ve=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{weekday:"short"}),r=new Intl.DateTimeFormat(R,{weekday:"long"}),u=new Date(2024,0,7);return Array.from({length:7},(i,m)=>{let o=T(u,(L+m)%7);return{short:t.format(o),long:r.format(o)}})},[R,L]),Ke=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{month:"long"});return Array.from({length:12},(r,u)=>t.format(new Date(2024,u,1)))},[R]),ve=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{month:"long",year:"numeric"}),[R]),_e=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{dateStyle:"full"}),[R]),je=(0,l.useMemo)(()=>{if(Z!=="dropdown")return[];let t=Y.getFullYear(),r=ge??k?.getFullYear()??t-100,u=fe??w?.getFullYear()??t+10;return u<r?[r]:Array.from({length:u-r+1},(i,m)=>r+m)},[Z,ge,fe,k,w,Y]),S=a==="range"?A:null,Oe=S&&S.from&&!S.to&&oe&&oe>S.from?oe:null,$=S?.to??Oe,$e=(0,l.useCallback)((t,r)=>{let u=!ie(t,r),i=K(t),m=!1,o=!1,b=!1,d=!1;return a==="multiple"?m=(A??[]).some(H=>N(H,t)):a==="range"?(o=N(S?.from,t),b=N($,t),m=o||b,d=!!(S?.from&&$&&t>S.from&&t<$)):m=N(A,t),{selected:m,today:N(t,Y),outside:u,disabled:i,rangeStart:o,rangeEnd:b,inRange:d}},[a,A,S,$,K,Y]),He=t=>{let r=x(f,t),u=ot(r,L,Se),i=t===0,m=t===C-1;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("button",{type:"button",onClick:Ie,disabled:!pe,"aria-label":B?.previousMonth??I.calendarPreviousMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[v],h.nav,!pe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!i&&"invisible"),children:(0,n.jsx)(lt,{className:h.icon})}),Z==="dropdown"?(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("select",{"aria-label":B?.monthSelect??I.calendarMonth,value:r.getMonth(),disabled:y,onChange:o=>p(new Date(r.getFullYear(),Number(o.target.value)-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[v],h.select,y&&"cursor-not-allowed opacity-50"),children:Ke.map((o,b)=>(0,n.jsx)("option",{value:b,children:o},o))}),(0,n.jsx)("select",{"aria-label":B?.yearSelect??I.calendarYear,value:r.getFullYear(),disabled:y,onChange:o=>p(new Date(Number(o.target.value),r.getMonth()-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[v],h.select,y&&"cursor-not-allowed opacity-50"),children:je.map(o=>(0,n.jsx)("option",{value:o,children:o},o))})]}):(0,n.jsx)("div",{"aria-live":"polite",className:(0,c.cn)("font-semibold text-gray-900 dark:text-gray-100",h.caption),children:ve.format(r)}),(0,n.jsx)("button",{type:"button",onClick:We,disabled:!De,"aria-label":B?.nextMonth??I.calendarNextMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[v],h.nav,!De&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!m&&"invisible"),children:(0,n.jsx)(st,{className:h.icon})})]}),(0,n.jsxs)("table",{role:"grid","aria-label":ve.format(r),onKeyDown:ze,className:"border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[ce&&(0,n.jsxs)("th",{scope:"col",className:(0,c.cn)("font-normal text-gray-400 dark:text-gray-500",h.head),children:[(0,n.jsx)("span",{className:"sr-only",children:B?.weekNumber??I.calendarWeekNumber}),(0,n.jsx)("span",{"aria-hidden":"true",children:"#"})]}),Ve.map(o=>(0,n.jsx)("th",{scope:"col",abbr:o.long,className:(0,c.cn)("font-medium uppercase text-gray-500 dark:text-gray-400",h.head),children:o.short},o.long))]})}),(0,n.jsx)("tbody",{children:u.map(o=>(0,n.jsxs)("tr",{children:[ce&&(0,n.jsx)("td",{className:(0,c.cn)("text-center align-middle text-gray-400 dark:text-gray-500",h.head),children:nt(o[0])}),o.map(b=>{let d=$e(b,r),H=J(b);if(d.outside&&!Me)return(0,n.jsx)("td",{className:"p-0"},H);let Je=N(b,Ee)&&!d.outside,le=d.inRange||d.rangeStart&&!!$||d.rangeEnd&&!!S?.from;return(0,n.jsx)("td",{role:"presentation",className:(0,c.cn)("p-0",le&&ut[v],le&&d.rangeStart&&"rounded-l-full",le&&d.rangeEnd&&"rounded-r-full"),children:(0,n.jsx)("button",{type:"button","data-day":H,"data-selected":d.selected||void 0,"data-today":d.today||void 0,"data-outside":d.outside||void 0,role:"gridcell",tabIndex:Je?0:-1,disabled:y,"aria-selected":d.selected,"aria-disabled":d.disabled||void 0,"aria-current":d.today?"date":void 0,"aria-label":_e.format(b),onClick:()=>{d.disabled||Be(b)},onMouseEnter:()=>a==="range"&&he(g(b)),onMouseLeave:()=>a==="range"&&he(null),onFocus:()=>U(g(b)),className:(0,c.cn)("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[v],h.day,d.selected?dt[v]:d.inRange?(0,c.cn)(ct[v],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):d.today?(0,c.cn)(gt[v],"hover:bg-gray-100 dark:hover:bg-gray-700"):(0,c.cn)("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),d.outside&&!d.selected&&"text-gray-400 dark:text-gray-500",d.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:ye?ye(b,d):b.getDate()})},H)})]},J(o[0])))})]})]},J(r))},Ge=(0,l.useCallback)(()=>{p(Y),U(Y),K(Y)||q(Y)},[Y,p,K,q]),Ue=(0,l.useCallback)(()=>{M(a==="multiple"?[]:a==="range"?{from:null,to:null}:null)},[a,M]),qe=!!be||ee||te;return(0,n.jsxs)("div",{ref:me,className:(0,c.cn)("inline-block bg-white dark:bg-gray-900",Ne&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",h.padding,y&&"opacity-60",Fe),...Re,children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap",h.gap),children:Array.from({length:C},(t,r)=>He(r))}),qe&&(0,n.jsxs)("div",{className:(0,c.cn)("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",h.footer),children:[(0,n.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:be}),(ee||te)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[ee&&(0,n.jsx)("button",{type:"button",onClick:Ge,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[v],y&&"cursor-not-allowed opacity-50"),children:B?.today??I.calendarToday}),te&&(0,n.jsx)("button",{type:"button",onClick:Ue,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[v],y&&"cursor-not-allowed opacity-50"),children:B?.clear??I.calendarClear})]})]})]})}0&&(module.exports={Calendar});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useCallback as p,useEffect as Ze,useMemo as _,useRef as we,useState as X}from"react";import{cn as c}from"../../lib/cn.js";import{useUILabels as et}from"../../lib/i18n.js";import{jsx as o,jsxs as N}from"react/jsx-runtime";var tt=10080*60*1e3;function u(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function z(a){return new Date(a.getFullYear(),a.getMonth(),1)}function P(a,r){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+r)}function x(a,r){return new Date(a.getFullYear(),a.getMonth()+r,1)}function ce(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()}function S(a,r){return!a||!r?!1:a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()&&a.getDate()===r.getDate()}function ue(a,r){return a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()}function A(a,r){return a.getFullYear()*12+a.getMonth()-(r.getFullYear()*12+r.getMonth())}function Z(a){let r=`${a.getMonth()+1}`.padStart(2,"0"),i=`${a.getDate()}`.padStart(2,"0");return`${a.getFullYear()}-${r}-${i}`}function at(a){let r=u(a);r.setDate(r.getDate()-(r.getDay()+6)%7+3);let i=new Date(r.getFullYear(),0,4);return i.setDate(i.getDate()-(i.getDay()+6)%7+3),1+Math.round((r.getTime()-i.getTime())/tt)}function Ce(a,r,i){return r&&a<u(r)?u(r):i&&a>u(i)?u(i):a}function rt(a,r,i){let V=z(a),j=(V.getDay()-r+7)%7,O=P(V,-j),$=i?6:Math.ceil((j+ce(a))/7);return Array.from({length:$},(te,q)=>Array.from({length:7},(ge,T)=>P(O,q*7+T)))}function nt({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ot({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var lt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},st={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-white hover:bg-yellow-600 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},it={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},dt={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},ut={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},W={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function ee(a,r){if(a==="multiple")return Array.isArray(r)?r.map(u):[];if(a==="range"){let i=r??null;return{from:i?.from?u(i.from):null,to:i?.to?u(i.to):null}}return r instanceof Date?u(r):null}function Me(a){return a?a instanceof Date?a:Array.isArray(a)?a[0]??null:a.from??a.to??null:null}function yt(a){let{mode:r="single",value:i,defaultValue:V,onChange:j,max:O,month:$,defaultMonth:te,onMonthChange:q,numberOfMonths:ge=1,weekStartsOn:T=0,locale:F,size:Se="md",color:D="primary",minDate:k,maxDate:v,disabledDates:H,disabled:b=!1,showOutsideDays:Ne=!0,showWeekNumbers:fe=!1,fixedWeeks:Fe=!1,captionLayout:ae="label",fromYear:be,toYear:ye,todayButton:re=!1,clearButton:ne=!1,footer:me,bordered:Re=!0,renderDay:he,labels:E,className:Ye,...Pe}=a,B=et(),m=lt[Se],w=Math.max(1,ge),R=_(()=>u(new Date),[]),oe=i!==void 0,[Te,Le]=X(()=>ee(r,V)),L=oe?ee(r,i):Te,le=$!==void 0,[Ae,Ee]=X(()=>z(te??Me(ee(r,V??i))??new Date)),g=le?z($):Ae,h=p(e=>{let t=z(e);le||Ee(t),q?.(t)},[le,q]),pe=we(null),se=we(!1),[I,J]=X(()=>{let e=Me(ee(r,V??i)),t=z(te??$??e??new Date),d=e&&ue(e,t)?e:ue(u(new Date),t)?u(new Date):t;return Ce(d,k,v)}),Be=x(g,w-1),Ie=A(I,g)>=0&&A(I,Be)<=0?I:g;Ze(()=>{if(!se.current)return;se.current=!1,pe.current?.querySelector(`[data-day="${Z(I)}"]:not([data-outside])`)?.focus()},[I,g]);let Y=p(e=>{let t=Ce(u(e),k,v);se.current=!0,J(t);let d=x(g,w-1);A(t,g)<0?h(t):A(t,d)>0&&h(x(t,-(w-1)))},[g,w,k,v,h]),K=p(e=>b||k&&e<u(k)||v&&e>u(v)?!0:typeof H=="function"?H(e):Array.isArray(H)?H.some(t=>S(t,e)):!1,[b,k,v,H]),[ie,De]=X(null),C=p(e=>{oe||Le(e),j?.(e)},[oe,j]),Q=p(e=>{let t=u(e);if(K(t))return;if(r==="multiple"){let l=L??[];if(l.some(n=>S(n,t))){C(l.filter(n=>!S(n,t)));return}if(O!==void 0&&l.length>=O)return;C([...l,t].sort((n,f)=>n.getTime()-f.getTime()));return}if(r==="range"){let l=L??{from:null,to:null};if(!l.from||l.to){C({from:t,to:null});return}C(t<l.from?{from:t,to:l.from}:{from:l.from,to:t});return}C(S(L,t)?null:t)},[r,L,O,C,K]),We=p(e=>{Q(e),J(u(e)),A(e,g)<0?h(e):A(e,x(g,w-1))>0&&h(x(e,-(w-1)))},[Q,g,w,h]),xe=!b&&(!k||A(g,z(k))>0),ke=!b&&(!v||A(x(g,w-1),z(v))<0),ze=p(()=>{h(x(g,-1))},[g,h]),Ve=p(()=>{h(x(g,1))},[g,h]),Ke=p(e=>{if(b)return;let t=I;switch(e.key){case"ArrowLeft":e.preventDefault(),Y(P(t,-1));break;case"ArrowRight":e.preventDefault(),Y(P(t,1));break;case"ArrowUp":e.preventDefault(),Y(P(t,-7));break;case"ArrowDown":e.preventDefault(),Y(P(t,7));break;case"Home":e.preventDefault(),Y(P(t,-((t.getDay()-T+7)%7)));break;case"End":e.preventDefault(),Y(P(t,6-(t.getDay()-T+7)%7));break;case"PageUp":{e.preventDefault();let d=e.shiftKey?-12:-1,l=x(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}case"PageDown":{e.preventDefault();let d=e.shiftKey?12:1,l=x(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}default:break}},[b,I,Y,T]),_e=_(()=>{let e=new Intl.DateTimeFormat(F,{weekday:"short"}),t=new Intl.DateTimeFormat(F,{weekday:"long"}),d=new Date(2024,0,7);return Array.from({length:7},(l,y)=>{let n=P(d,(T+y)%7);return{short:e.format(n),long:t.format(n)}})},[F,T]),je=_(()=>{let e=new Intl.DateTimeFormat(F,{month:"long"});return Array.from({length:12},(t,d)=>e.format(new Date(2024,d,1)))},[F]),ve=_(()=>new Intl.DateTimeFormat(F,{month:"long",year:"numeric"}),[F]),Oe=_(()=>new Intl.DateTimeFormat(F,{dateStyle:"full"}),[F]),$e=_(()=>{if(ae!=="dropdown")return[];let e=R.getFullYear(),t=be??k?.getFullYear()??e-100,d=ye??v?.getFullYear()??e+10;return d<t?[t]:Array.from({length:d-t+1},(l,y)=>t+y)},[ae,be,ye,k,v,R]),M=r==="range"?L:null,He=M&&M.from&&!M.to&&ie&&ie>M.from?ie:null,G=M?.to??He,Ge=p((e,t)=>{let d=!ue(e,t),l=K(e),y=!1,n=!1,f=!1,s=!1;return r==="multiple"?y=(L??[]).some(U=>S(U,e)):r==="range"?(n=S(M?.from,e),f=S(G,e),y=n||f,s=!!(M?.from&&G&&e>M.from&&e<G)):y=S(L,e),{selected:y,today:S(e,R),outside:d,disabled:l,rangeStart:n,rangeEnd:f,inRange:s}},[r,L,M,G,K,R]),Ue=e=>{let t=x(g,e),d=rt(t,T,Fe),l=e===0,y=e===w-1;return N("div",{className:"flex flex-col",children:[N("div",{className:"mb-2 flex items-center justify-between",children:[o("button",{type:"button",onClick:ze,disabled:!xe,"aria-label":E?.previousMonth??B.calendarPreviousMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!xe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!l&&"invisible"),children:o(nt,{className:m.icon})}),ae==="dropdown"?N("div",{className:"flex items-center gap-1",children:[o("select",{"aria-label":E?.monthSelect??B.calendarMonth,value:t.getMonth(),disabled:b,onChange:n=>h(new Date(t.getFullYear(),Number(n.target.value)-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:je.map((n,f)=>o("option",{value:f,children:n},n))}),o("select",{"aria-label":E?.yearSelect??B.calendarYear,value:t.getFullYear(),disabled:b,onChange:n=>h(new Date(Number(n.target.value),t.getMonth()-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:$e.map(n=>o("option",{value:n,children:n},n))})]}):o("div",{"aria-live":"polite",className:c("font-semibold text-gray-900 dark:text-gray-100",m.caption),children:ve.format(t)}),o("button",{type:"button",onClick:Ve,disabled:!ke,"aria-label":E?.nextMonth??B.calendarNextMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!ke&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!y&&"invisible"),children:o(ot,{className:m.icon})})]}),N("table",{role:"grid","aria-label":ve.format(t),onKeyDown:Ke,className:"border-collapse",children:[o("thead",{children:N("tr",{children:[fe&&N("th",{scope:"col",className:c("font-normal text-gray-400 dark:text-gray-500",m.head),children:[o("span",{className:"sr-only",children:E?.weekNumber??B.calendarWeekNumber}),o("span",{"aria-hidden":"true",children:"#"})]}),_e.map(n=>o("th",{scope:"col",abbr:n.long,className:c("font-medium uppercase text-gray-500 dark:text-gray-400",m.head),children:n.short},n.long))]})}),o("tbody",{children:d.map(n=>N("tr",{children:[fe&&o("td",{className:c("text-center align-middle text-gray-400 dark:text-gray-500",m.head),children:at(n[0])}),n.map(f=>{let s=Ge(f,t),U=Z(f);if(s.outside&&!Ne)return o("td",{className:"p-0"},U);let Xe=S(f,Ie)&&!s.outside,de=s.inRange||s.rangeStart&&!!G||s.rangeEnd&&!!M?.from;return o("td",{role:"presentation",className:c("p-0",de&&it[D],de&&s.rangeStart&&"rounded-l-full",de&&s.rangeEnd&&"rounded-r-full"),children:o("button",{type:"button","data-day":U,"data-selected":s.selected||void 0,"data-today":s.today||void 0,"data-outside":s.outside||void 0,role:"gridcell",tabIndex:Xe?0:-1,disabled:b,"aria-selected":s.selected,"aria-disabled":s.disabled||void 0,"aria-current":s.today?"date":void 0,"aria-label":Oe.format(f),onClick:()=>{s.disabled||We(f)},onMouseEnter:()=>r==="range"&&De(u(f)),onMouseLeave:()=>r==="range"&&De(null),onFocus:()=>J(u(f)),className:c("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.day,s.selected?st[D]:s.inRange?c(dt[D],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):s.today?c(ut[D],"hover:bg-gray-100 dark:hover:bg-gray-700"):c("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),s.outside&&!s.selected&&"text-gray-400 dark:text-gray-500",s.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:he?he(f,s):f.getDate()})},U)})]},Z(n[0])))})]})]},Z(t))},qe=p(()=>{h(R),J(R),K(R)||Q(R)},[R,h,K,Q]),Je=p(()=>{C(r==="multiple"?[]:r==="range"?{from:null,to:null}:null)},[r,C]),Qe=!!me||re||ne;return N("div",{ref:pe,className:c("inline-block bg-white dark:bg-gray-900",Re&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",m.padding,b&&"opacity-60",Ye),...Pe,children:[o("div",{className:c("flex flex-wrap",m.gap),children:Array.from({length:w},(e,t)=>Ue(t))}),Qe&&N("div",{className:c("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",m.footer),children:[o("div",{className:"text-gray-600 dark:text-gray-400",children:me}),(re||ne)&&N("div",{className:"flex items-center gap-2",children:[re&&o("button",{type:"button",onClick:qe,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.today??B.calendarToday}),ne&&o("button",{type:"button",onClick:Je,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.clear??B.calendarClear})]})]})]})}export{yt as Calendar};
|
|
1
|
+
"use client";import{useCallback as p,useEffect as Ze,useMemo as _,useRef as we,useState as X}from"react";import{cn as c}from"../../lib/cn.js";import{useUILabels as et}from"../../lib/i18n.js";import{jsx as o,jsxs as N}from"react/jsx-runtime";var tt=10080*60*1e3;function u(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function z(a){return new Date(a.getFullYear(),a.getMonth(),1)}function P(a,r){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+r)}function v(a,r){return new Date(a.getFullYear(),a.getMonth()+r,1)}function ce(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()}function S(a,r){return!a||!r?!1:a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()&&a.getDate()===r.getDate()}function ue(a,r){return a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()}function A(a,r){return a.getFullYear()*12+a.getMonth()-(r.getFullYear()*12+r.getMonth())}function Z(a){let r=`${a.getMonth()+1}`.padStart(2,"0"),i=`${a.getDate()}`.padStart(2,"0");return`${a.getFullYear()}-${r}-${i}`}function at(a){let r=u(a);r.setDate(r.getDate()-(r.getDay()+6)%7+3);let i=new Date(r.getFullYear(),0,4);return i.setDate(i.getDate()-(i.getDay()+6)%7+3),1+Math.round((r.getTime()-i.getTime())/tt)}function Ce(a,r,i){return r&&a<u(r)?u(r):i&&a>u(i)?u(i):a}function rt(a,r,i){let V=z(a),j=(V.getDay()-r+7)%7,O=P(V,-j),$=i?6:Math.ceil((j+ce(a))/7);return Array.from({length:$},(te,q)=>Array.from({length:7},(ge,T)=>P(O,q*7+T)))}function nt({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ot({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var lt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},st={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-gray-900 hover:bg-yellow-600 dark:bg-yellow-400 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},it={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},dt={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},ut={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},W={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function ee(a,r){if(a==="multiple")return Array.isArray(r)?r.map(u):[];if(a==="range"){let i=r??null;return{from:i?.from?u(i.from):null,to:i?.to?u(i.to):null}}return r instanceof Date?u(r):null}function Me(a){return a?a instanceof Date?a:Array.isArray(a)?a[0]??null:a.from??a.to??null:null}function yt(a){let{mode:r="single",value:i,defaultValue:V,onChange:j,max:O,month:$,defaultMonth:te,onMonthChange:q,numberOfMonths:ge=1,weekStartsOn:T=0,locale:F,size:Se="md",color:D="primary",minDate:x,maxDate:k,disabledDates:H,disabled:b=!1,showOutsideDays:Ne=!0,showWeekNumbers:fe=!1,fixedWeeks:Fe=!1,captionLayout:ae="label",fromYear:be,toYear:ye,todayButton:re=!1,clearButton:ne=!1,footer:me,bordered:Re=!0,renderDay:he,labels:E,className:Ye,...Pe}=a,B=et(),m=lt[Se],w=Math.max(1,ge),R=_(()=>u(new Date),[]),oe=i!==void 0,[Te,Le]=X(()=>ee(r,V)),L=oe?ee(r,i):Te,le=$!==void 0,[Ae,Ee]=X(()=>z(te??Me(ee(r,V??i))??new Date)),g=le?z($):Ae,h=p(e=>{let t=z(e);le||Ee(t),q?.(t)},[le,q]),pe=we(null),se=we(!1),[I,J]=X(()=>{let e=Me(ee(r,V??i)),t=z(te??$??e??new Date),d=e&&ue(e,t)?e:ue(u(new Date),t)?u(new Date):t;return Ce(d,x,k)}),Be=v(g,w-1),Ie=A(I,g)>=0&&A(I,Be)<=0?I:g;Ze(()=>{if(!se.current)return;se.current=!1,pe.current?.querySelector(`[data-day="${Z(I)}"]:not([data-outside])`)?.focus()},[I,g]);let Y=p(e=>{let t=Ce(u(e),x,k);se.current=!0,J(t);let d=v(g,w-1);A(t,g)<0?h(t):A(t,d)>0&&h(v(t,-(w-1)))},[g,w,x,k,h]),K=p(e=>b||x&&e<u(x)||k&&e>u(k)?!0:typeof H=="function"?H(e):Array.isArray(H)?H.some(t=>S(t,e)):!1,[b,x,k,H]),[ie,De]=X(null),C=p(e=>{oe||Le(e),j?.(e)},[oe,j]),Q=p(e=>{let t=u(e);if(K(t))return;if(r==="multiple"){let l=L??[];if(l.some(n=>S(n,t))){C(l.filter(n=>!S(n,t)));return}if(O!==void 0&&l.length>=O)return;C([...l,t].sort((n,f)=>n.getTime()-f.getTime()));return}if(r==="range"){let l=L??{from:null,to:null};if(!l.from||l.to){C({from:t,to:null});return}C(t<l.from?{from:t,to:l.from}:{from:l.from,to:t});return}C(S(L,t)?null:t)},[r,L,O,C,K]),We=p(e=>{Q(e),J(u(e)),A(e,g)<0?h(e):A(e,v(g,w-1))>0&&h(v(e,-(w-1)))},[Q,g,w,h]),ve=!b&&(!x||A(g,z(x))>0),xe=!b&&(!k||A(v(g,w-1),z(k))<0),ze=p(()=>{h(v(g,-1))},[g,h]),Ve=p(()=>{h(v(g,1))},[g,h]),Ke=p(e=>{if(b)return;let t=I;switch(e.key){case"ArrowLeft":e.preventDefault(),Y(P(t,-1));break;case"ArrowRight":e.preventDefault(),Y(P(t,1));break;case"ArrowUp":e.preventDefault(),Y(P(t,-7));break;case"ArrowDown":e.preventDefault(),Y(P(t,7));break;case"Home":e.preventDefault(),Y(P(t,-((t.getDay()-T+7)%7)));break;case"End":e.preventDefault(),Y(P(t,6-(t.getDay()-T+7)%7));break;case"PageUp":{e.preventDefault();let d=e.shiftKey?-12:-1,l=v(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}case"PageDown":{e.preventDefault();let d=e.shiftKey?12:1,l=v(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}default:break}},[b,I,Y,T]),_e=_(()=>{let e=new Intl.DateTimeFormat(F,{weekday:"short"}),t=new Intl.DateTimeFormat(F,{weekday:"long"}),d=new Date(2024,0,7);return Array.from({length:7},(l,y)=>{let n=P(d,(T+y)%7);return{short:e.format(n),long:t.format(n)}})},[F,T]),je=_(()=>{let e=new Intl.DateTimeFormat(F,{month:"long"});return Array.from({length:12},(t,d)=>e.format(new Date(2024,d,1)))},[F]),ke=_(()=>new Intl.DateTimeFormat(F,{month:"long",year:"numeric"}),[F]),Oe=_(()=>new Intl.DateTimeFormat(F,{dateStyle:"full"}),[F]),$e=_(()=>{if(ae!=="dropdown")return[];let e=R.getFullYear(),t=be??x?.getFullYear()??e-100,d=ye??k?.getFullYear()??e+10;return d<t?[t]:Array.from({length:d-t+1},(l,y)=>t+y)},[ae,be,ye,x,k,R]),M=r==="range"?L:null,He=M&&M.from&&!M.to&&ie&&ie>M.from?ie:null,G=M?.to??He,Ge=p((e,t)=>{let d=!ue(e,t),l=K(e),y=!1,n=!1,f=!1,s=!1;return r==="multiple"?y=(L??[]).some(U=>S(U,e)):r==="range"?(n=S(M?.from,e),f=S(G,e),y=n||f,s=!!(M?.from&&G&&e>M.from&&e<G)):y=S(L,e),{selected:y,today:S(e,R),outside:d,disabled:l,rangeStart:n,rangeEnd:f,inRange:s}},[r,L,M,G,K,R]),Ue=e=>{let t=v(g,e),d=rt(t,T,Fe),l=e===0,y=e===w-1;return N("div",{className:"flex flex-col",children:[N("div",{className:"mb-2 flex items-center justify-between",children:[o("button",{type:"button",onClick:ze,disabled:!ve,"aria-label":E?.previousMonth??B.calendarPreviousMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!ve&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!l&&"invisible"),children:o(nt,{className:m.icon})}),ae==="dropdown"?N("div",{className:"flex items-center gap-1",children:[o("select",{"aria-label":E?.monthSelect??B.calendarMonth,value:t.getMonth(),disabled:b,onChange:n=>h(new Date(t.getFullYear(),Number(n.target.value)-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:je.map((n,f)=>o("option",{value:f,children:n},n))}),o("select",{"aria-label":E?.yearSelect??B.calendarYear,value:t.getFullYear(),disabled:b,onChange:n=>h(new Date(Number(n.target.value),t.getMonth()-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:$e.map(n=>o("option",{value:n,children:n},n))})]}):o("div",{"aria-live":"polite",className:c("font-semibold text-gray-900 dark:text-gray-100",m.caption),children:ke.format(t)}),o("button",{type:"button",onClick:Ve,disabled:!xe,"aria-label":E?.nextMonth??B.calendarNextMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!xe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!y&&"invisible"),children:o(ot,{className:m.icon})})]}),N("table",{role:"grid","aria-label":ke.format(t),onKeyDown:Ke,className:"border-collapse",children:[o("thead",{children:N("tr",{children:[fe&&N("th",{scope:"col",className:c("font-normal text-gray-400 dark:text-gray-500",m.head),children:[o("span",{className:"sr-only",children:E?.weekNumber??B.calendarWeekNumber}),o("span",{"aria-hidden":"true",children:"#"})]}),_e.map(n=>o("th",{scope:"col",abbr:n.long,className:c("font-medium uppercase text-gray-500 dark:text-gray-400",m.head),children:n.short},n.long))]})}),o("tbody",{children:d.map(n=>N("tr",{children:[fe&&o("td",{className:c("text-center align-middle text-gray-400 dark:text-gray-500",m.head),children:at(n[0])}),n.map(f=>{let s=Ge(f,t),U=Z(f);if(s.outside&&!Ne)return o("td",{className:"p-0"},U);let Xe=S(f,Ie)&&!s.outside,de=s.inRange||s.rangeStart&&!!G||s.rangeEnd&&!!M?.from;return o("td",{role:"presentation",className:c("p-0",de&&it[D],de&&s.rangeStart&&"rounded-l-full",de&&s.rangeEnd&&"rounded-r-full"),children:o("button",{type:"button","data-day":U,"data-selected":s.selected||void 0,"data-today":s.today||void 0,"data-outside":s.outside||void 0,role:"gridcell",tabIndex:Xe?0:-1,disabled:b,"aria-selected":s.selected,"aria-disabled":s.disabled||void 0,"aria-current":s.today?"date":void 0,"aria-label":Oe.format(f),onClick:()=>{s.disabled||We(f)},onMouseEnter:()=>r==="range"&&De(u(f)),onMouseLeave:()=>r==="range"&&De(null),onFocus:()=>J(u(f)),className:c("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.day,s.selected?st[D]:s.inRange?c(dt[D],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):s.today?c(ut[D],"hover:bg-gray-100 dark:hover:bg-gray-700"):c("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),s.outside&&!s.selected&&"text-gray-400 dark:text-gray-500",s.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:he?he(f,s):f.getDate()})},U)})]},Z(n[0])))})]})]},Z(t))},qe=p(()=>{h(R),J(R),K(R)||Q(R)},[R,h,K,Q]),Je=p(()=>{C(r==="multiple"?[]:r==="range"?{from:null,to:null}:null)},[r,C]),Qe=!!me||re||ne;return N("div",{ref:pe,className:c("inline-block bg-white dark:bg-gray-900",Re&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",m.padding,b&&"opacity-60",Ye),...Pe,children:[o("div",{className:c("flex flex-wrap",m.gap),children:Array.from({length:w},(e,t)=>Ue(t))}),Qe&&N("div",{className:c("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",m.footer),children:[o("div",{className:"text-gray-600 dark:text-gray-400",children:me}),(re||ne)&&N("div",{className:"flex items-center gap-2",children:[re&&o("button",{type:"button",onClick:qe,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.today??B.calendarToday}),ne&&o("button",{type:"button",onClick:Je,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.clear??B.calendarClear})]})]})]})}export{yt as Calendar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var g=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var A=(t,r)=>{for(var a in r)g(t,a,{get:r[a],enumerable:!0})},D=(t,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of U(r))!q.call(t,s)&&s!==a&&g(t,s,{get:()=>r[s],enumerable:!(n=T(r,s))||n.enumerable});return t};var F=t=>D(g({},"__esModule",{value:!0}),t);var _={};A(_,{Chip:()=>f});module.exports=F(_);var o=require("../../lib/cn.cjs"),k=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function G({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var J={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-600 text-white",outlined:"border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-
|
|
1
|
+
"use strict";"use client";var g=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var A=(t,r)=>{for(var a in r)g(t,a,{get:r[a],enumerable:!0})},D=(t,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of U(r))!q.call(t,s)&&s!==a&&g(t,s,{get:()=>r[s],enumerable:!(n=T(r,s))||n.enumerable});return t};var F=t=>D(g({},"__esModule",{value:!0}),t);var _={};A(_,{Chip:()=>f});module.exports=F(_);var o=require("../../lib/cn.cjs"),k=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function G({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var J={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-600 text-white",outlined:"border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-gray-900",outlined:"border-yellow-500 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400 bg-transparent",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",dot:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},error:{solid:"bg-red-600 text-white",outlined:"border-red-600 text-red-600 dark:border-red-400 dark:text-red-400 bg-transparent",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",dot:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300"},info:{solid:"bg-cyan-600 text-white",outlined:"border-cyan-600 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400 bg-transparent",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",dot:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300"}},K={default:"bg-gray-500",primary:"bg-blue-600",success:"bg-green-600",warning:"bg-yellow-500",error:"bg-red-600",info:"bg-cyan-600"},Q={sm:"h-5 text-xs px-2 gap-1",md:"h-6 text-sm px-2.5 gap-1.5",lg:"h-8 text-sm px-3 gap-2"},c={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},X={sm:"w-4 h-4 -ml-1",md:"w-5 h-5 -ml-1.5",lg:"w-6 h-6 -ml-1.5"},Y={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},Z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function f({label:t,children:r,variant:a="solid",size:n="md",color:s="default",bgColor:b,textColor:p,borderColor:u,rounded:C="full",icon:x,endIcon:h,avatar:d,onClose:w,closable:m=!1,removeLabel:v,clickable:R=!1,selected:N=!1,disabled:l=!1,as:S="span",className:L,onClick:z,...M}){let P=(0,k.useUILabels)(),E=S,V=(0,o.cn)("inline-flex items-center justify-center font-medium transition-all",Q[n],Z[C],a==="outlined"&&"border"),W=(0,o.cn)(b||p||u?(0,o.cn)(b,p,u):J[s][a]),I=N?"ring-2 ring-offset-1 ring-blue-500":"",j=R&&!l?"cursor-pointer hover:opacity-80 active:scale-95":"",B=l?"opacity-50 cursor-not-allowed":"",H=i=>{i.stopPropagation(),w?.()},O=i=>{l||z?.(i)},y=r??t;return(0,e.jsxs)(E,{className:(0,o.cn)(V,W,I,j,B,L),onClick:O,"aria-disabled":l,...M,children:[a==="dot"&&(0,e.jsx)("span",{className:(0,o.cn)("rounded-full shrink-0",Y[n],K[s]),"aria-hidden":"true"}),d&&(0,e.jsx)("span",{className:(0,o.cn)("rounded-full overflow-hidden shrink-0",X[n]),children:d}),x&&!d&&(0,e.jsx)("span",{className:(0,o.cn)("shrink-0",c[n]),children:x}),y&&(0,e.jsx)("span",{className:"truncate",children:y}),h&&!m&&(0,e.jsx)("span",{className:(0,o.cn)("shrink-0",c[n]),children:h}),m&&(0,e.jsx)("button",{type:"button",onClick:H,disabled:l,className:(0,o.cn)("shrink-0 rounded-full hover:bg-black/10 dark:hover:bg-white/10 p-0.5 -mr-1 transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current",l&&"pointer-events-none"),"aria-label":v??P.chipRemove,children:(0,e.jsx)(G,{className:c[n]})})]})}f.displayName="Chip";0&&(module.exports={Chip});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{cn as e}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{jsx as t,jsxs as G}from"react/jsx-runtime";function H({className:n}){return t("svg",{className:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var O={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-600 text-white",outlined:"border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-
|
|
1
|
+
"use client";import{cn as e}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{jsx as t,jsxs as G}from"react/jsx-runtime";function H({className:n}){return t("svg",{className:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var O={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-600 text-white",outlined:"border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-gray-900",outlined:"border-yellow-500 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400 bg-transparent",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",dot:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},error:{solid:"bg-red-600 text-white",outlined:"border-red-600 text-red-600 dark:border-red-400 dark:text-red-400 bg-transparent",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",dot:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300"},info:{solid:"bg-cyan-600 text-white",outlined:"border-cyan-600 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400 bg-transparent",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",dot:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300"}},T={default:"bg-gray-500",primary:"bg-blue-600",success:"bg-green-600",warning:"bg-yellow-500",error:"bg-red-600",info:"bg-cyan-600"},U={sm:"h-5 text-xs px-2 gap-1",md:"h-6 text-sm px-2.5 gap-1.5",lg:"h-8 text-sm px-3 gap-2"},d={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},q={sm:"w-4 h-4 -ml-1",md:"w-5 h-5 -ml-1.5",lg:"w-6 h-6 -ml-1.5"},A={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},D={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function F({label:n,children:m,variant:a="solid",size:r="md",color:i="default",bgColor:g,textColor:c,borderColor:b,rounded:y="full",icon:p,endIcon:u,avatar:s,onClose:k,closable:x=!1,removeLabel:f,clickable:C=!1,selected:w=!1,disabled:o=!1,as:v="span",className:R,onClick:N,...S}){let L=B(),z=v,M=e("inline-flex items-center justify-center font-medium transition-all",U[r],D[y],a==="outlined"&&"border"),P=e(g||c||b?e(g,c,b):O[i][a]),E=w?"ring-2 ring-offset-1 ring-blue-500":"",V=C&&!o?"cursor-pointer hover:opacity-80 active:scale-95":"",W=o?"opacity-50 cursor-not-allowed":"",I=l=>{l.stopPropagation(),k?.()},j=l=>{o||N?.(l)},h=m??n;return G(z,{className:e(M,P,E,V,W,R),onClick:j,"aria-disabled":o,...S,children:[a==="dot"&&t("span",{className:e("rounded-full shrink-0",A[r],T[i]),"aria-hidden":"true"}),s&&t("span",{className:e("rounded-full overflow-hidden shrink-0",q[r]),children:s}),p&&!s&&t("span",{className:e("shrink-0",d[r]),children:p}),h&&t("span",{className:"truncate",children:h}),u&&!x&&t("span",{className:e("shrink-0",d[r]),children:u}),x&&t("button",{type:"button",onClick:I,disabled:o,className:e("shrink-0 rounded-full hover:bg-black/10 dark:hover:bg-white/10 p-0.5 -mr-1 transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current",o&&"pointer-events-none"),"aria-label":f??L.chipRemove,children:t(H,{className:d[r]})})]})}F.displayName="Chip";export{F as Chip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var m=(t,r)=>{for(var n in r)d(t,n,{get:r[n],enumerable:!0})},p=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of c(r))!k.call(t,a)&&a!==n&&d(t,a,{get:()=>r[a],enumerable:!(i=u(r,a))||i.enumerable});return t};var h=t=>p(d({},"__esModule",{value:!0}),t);var f={};m(f,{MarkdownEditor:()=>g});module.exports=h(f);var P=require("@mdxeditor/editor/style.css"),e=require("@mdxeditor/editor"),l=require("react"),s=require("../../lib/i18n.cjs"),o=require("react/jsx-runtime"),y=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.UndoRedo,{}),(0,o.jsx)(e.BlockTypeSelect,{}),(0,o.jsx)(e.BoldItalicUnderlineToggles,{}),(0,o.jsx)(e.CodeToggle,{}),(0,o.jsx)(e.CreateLink,{}),(0,o.jsx)(e.ListsToggle,{}),(0,o.jsx)(e.InsertThematicBreak,{})]}),b=[(0,e.headingsPlugin)(),(0,e.listsPlugin)(),(0,e.quotePlugin)(),(0,e.linkPlugin)(),(0,e.linkDialogPlugin)(),(0,e.codeBlockPlugin)({defaultCodeBlockLanguage:""}),(0,e.thematicBreakPlugin)(),(0,e.markdownShortcutPlugin)(),(0,e.toolbarPlugin)({toolbarContents:y})],g=(0,l.forwardRef)(({value:t,onChange:r,placeholder:n},i)=>{let a=(0,s.useUILabels)();return(0,o.jsx)("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-800",children:(0,o.jsx)(e.MDXEditor,{ref:i,markdown:t,onChange:r,placeholder:n??a.markdownEditorPlaceholder,contentEditableClassName:"prose prose-sm dark:prose-invert dark:text-gray-300! max-w-none p-3 min-h-[16rem] focus:outline-none",plugins:b})})});g.displayName="MarkdownEditor";0&&(module.exports={MarkdownEditor});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"@mdxeditor/editor/style.css";import{MDXEditor as i,headingsPlugin as
|
|
1
|
+
"use client";import"@mdxeditor/editor/style.css";import{MDXEditor as i,headingsPlugin as d,listsPlugin as l,quotePlugin as s,linkPlugin as g,linkDialogPlugin as u,codeBlockPlugin as c,thematicBreakPlugin as k,markdownShortcutPlugin as m,toolbarPlugin as p,BlockTypeSelect as h,BoldItalicUnderlineToggles as y,CodeToggle as b,ListsToggle as f,CreateLink as w,InsertThematicBreak as P,UndoRedo as E}from"@mdxeditor/editor";import{forwardRef as M}from"react";import{useUILabels as T}from"../../lib/i18n.js";import{Fragment as N,jsx as e,jsxs as D}from"react/jsx-runtime";var B=()=>D(N,{children:[e(E,{}),e(h,{}),e(y,{}),e(b,{}),e(w,{}),e(f,{}),e(P,{})]}),C=[d(),l(),s(),g(),u(),c({defaultCodeBlockLanguage:""}),k(),m(),p({toolbarContents:B})],L=M(({value:o,onChange:r,placeholder:t},a)=>{let n=T();return e("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-800",children:e(i,{ref:a,markdown:o,onChange:r,placeholder:t??n.markdownEditorPlaceholder,contentEditableClassName:"prose prose-sm dark:prose-invert dark:text-gray-300! max-w-none p-3 min-h-[16rem] focus:outline-none",plugins:C})})});L.displayName="MarkdownEditor";export{L as MarkdownEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},P=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!w.call(e,a)&&a!==r&&p(e,a,{get:()=>t[a],enumerable:!(n=y(t,a))||n.enumerable});return e};var z=e=>P(p({},"__esModule",{value:!0}),e);var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},P=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!w.call(e,a)&&a!==r&&p(e,a,{get:()=>t[a],enumerable:!(n=y(t,a))||n.enumerable});return e};var z=e=>P(p({},"__esModule",{value:!0}),e);var W={};C(W,{Indicator:()=>x});module.exports=z(W);var i=require("../../lib/cn.cjs"),o=require("react/jsx-runtime"),m={default:"bg-gray-400",primary:"bg-blue-600",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",dark:"bg-gray-900 dark:bg-gray-700",purple:"bg-purple-600",indigo:"bg-indigo-600",teal:"bg-teal-500"},N={warning:"text-gray-900"},g={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},R={xs:"min-w-4 h-4 text-[10px] px-1",sm:"min-w-5 h-5 text-xs px-1",md:"min-w-5 h-5 text-xs px-1.5",lg:"min-w-6 h-6 text-sm px-1.5",xl:"min-w-7 h-7 text-sm px-2"},u={"top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","top-center":"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2","top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","center-left":"top-1/2 left-0 -translate-x-1/2 -translate-y-1/2",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","center-right":"top-1/2 right-0 translate-x-1/2 -translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2","bottom-center":"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2"},f={"top-left":"top-0 left-0","top-center":"top-0 left-1/2 -translate-x-1/2","top-right":"top-0 right-0","center-left":"top-1/2 left-0 -translate-y-1/2",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","center-right":"top-1/2 right-0 -translate-y-1/2","bottom-left":"bottom-0 left-0","bottom-center":"bottom-0 left-1/2 -translate-x-1/2","bottom-right":"bottom-0 right-0"};function k(e,t){return e>t?`${t}+`:`${e}`}function v({color:e="primary",size:t="md",placement:r="top-right",bordered:n=!1,borderColor:a,pulse:s=!1,offset:l=!1,className:c,...d}){return(0,o.jsx)("span",{"data-testid":"indicator",className:(0,i.cn)("absolute z-10 rounded-full",m[e],g[t],l?f[r]:u[r],n&&(0,i.cn)("ring-2 ring-white dark:ring-gray-900",a),s&&"animate-pulse",c),...d})}function S({color:e="error",size:t="md",placement:r="top-right",count:n=0,maxCount:a=99,bordered:s=!1,borderColor:l,pulse:c=!1,offset:d=!1,className:b,...h}){return(0,o.jsx)("span",{"data-testid":"indicator",className:(0,i.cn)("absolute z-10 inline-flex items-center justify-center rounded-full font-semibold",N[e]??"text-white",m[e],R[t],d?f[r]:u[r],s&&(0,i.cn)("ring-2 ring-white dark:ring-gray-900",l),c&&"animate-pulse",b),...h,children:k(n,a)})}function O({color:e="success",size:t="md",placement:r="bottom-right",bordered:n=!0,borderColor:a,pulse:s=!1,offset:l=!1,className:c,...d}){return(0,o.jsx)("span",{"data-testid":"indicator",className:(0,i.cn)("absolute z-10 rounded-full",m[e],g[t],l?f[r]:u[r],n&&(0,i.cn)("ring-2 ring-white dark:ring-gray-900",a),s&&"animate-pulse",c),...d})}function V({color:e="primary",size:t="sm",label:r,className:n,...a}){return(0,o.jsxs)("span",{"data-testid":"indicator",className:(0,i.cn)("inline-flex items-center gap-2",n),...a,children:[(0,o.jsx)("span",{className:(0,i.cn)("rounded-full shrink-0",m[e],g[t])}),r?(0,o.jsx)("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r}):null]})}function x({variant:e="dot",children:t,...r}){if(e==="legend")return(0,o.jsx)(V,{...r});let n=(()=>{switch(e){case"count":return(0,o.jsx)(S,{...r});case"status":return(0,o.jsx)(O,{...r});default:return(0,o.jsx)(v,{...r})}})();return t?(0,o.jsxs)("div",{className:"relative inline-flex",children:[t,n]}):n}x.displayName="Indicator";0&&(module.exports={Indicator});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as o}from"../../lib/cn.js";import{jsx as a,jsxs as f}from"react/jsx-runtime";var m={default:"bg-gray-400",primary:"bg-blue-600",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",dark:"bg-gray-900 dark:bg-gray-700",purple:"bg-purple-600",indigo:"bg-indigo-600",teal:"bg-teal-500"},p={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},
|
|
1
|
+
import{cn as o}from"../../lib/cn.js";import{jsx as a,jsxs as f}from"react/jsx-runtime";var m={default:"bg-gray-400",primary:"bg-blue-600",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",dark:"bg-gray-900 dark:bg-gray-700",purple:"bg-purple-600",indigo:"bg-indigo-600",teal:"bg-teal-500"},h={warning:"text-gray-900"},p={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},y={xs:"min-w-4 h-4 text-[10px] px-1",sm:"min-w-5 h-5 text-xs px-1",md:"min-w-5 h-5 text-xs px-1.5",lg:"min-w-6 h-6 text-sm px-1.5",xl:"min-w-7 h-7 text-sm px-2"},g={"top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","top-center":"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2","top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","center-left":"top-1/2 left-0 -translate-x-1/2 -translate-y-1/2",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","center-right":"top-1/2 right-0 translate-x-1/2 -translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2","bottom-center":"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2"},u={"top-left":"top-0 left-0","top-center":"top-0 left-1/2 -translate-x-1/2","top-right":"top-0 right-0","center-left":"top-1/2 left-0 -translate-y-1/2",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","center-right":"top-1/2 right-0 -translate-y-1/2","bottom-left":"bottom-0 left-0","bottom-center":"bottom-0 left-1/2 -translate-x-1/2","bottom-right":"bottom-0 right-0"};function I(e,r){return e>r?`${r}+`:`${e}`}function w({color:e="primary",size:r="md",placement:t="top-right",bordered:n=!1,borderColor:i,pulse:s=!1,offset:l=!1,className:c,...d}){return a("span",{"data-testid":"indicator",className:o("absolute z-10 rounded-full",m[e],p[r],l?u[t]:g[t],n&&o("ring-2 ring-white dark:ring-gray-900",i),s&&"animate-pulse",c),...d})}function C({color:e="error",size:r="md",placement:t="top-right",count:n=0,maxCount:i=99,bordered:s=!1,borderColor:l,pulse:c=!1,offset:d=!1,className:x,...b}){return a("span",{"data-testid":"indicator",className:o("absolute z-10 inline-flex items-center justify-center rounded-full font-semibold",h[e]??"text-white",m[e],y[r],d?u[t]:g[t],s&&o("ring-2 ring-white dark:ring-gray-900",l),c&&"animate-pulse",x),...b,children:I(n,i)})}function P({color:e="success",size:r="md",placement:t="bottom-right",bordered:n=!0,borderColor:i,pulse:s=!1,offset:l=!1,className:c,...d}){return a("span",{"data-testid":"indicator",className:o("absolute z-10 rounded-full",m[e],p[r],l?u[t]:g[t],n&&o("ring-2 ring-white dark:ring-gray-900",i),s&&"animate-pulse",c),...d})}function z({color:e="primary",size:r="sm",label:t,className:n,...i}){return f("span",{"data-testid":"indicator",className:o("inline-flex items-center gap-2",n),...i,children:[a("span",{className:o("rounded-full shrink-0",m[e],p[r])}),t?a("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:t}):null]})}function N({variant:e="dot",children:r,...t}){if(e==="legend")return a(z,{...t});let n=(()=>{switch(e){case"count":return a(C,{...t});case"status":return a(P,{...t});default:return a(w,{...t})}})();return r?f("div",{className:"relative inline-flex",children:[r,n]}):n}N.displayName="Indicator";export{N as Indicator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var s=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},A=(e,r,t,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of B(r))!L.call(e,a)&&a!==t&&s(e,a,{get:()=>r[a],enumerable:!(l=D(r,a))||l.enumerable});return e};var H=e=>A(s({},"__esModule",{value:!0}),e);var W={};P(W,{TabsTrigger:()=>w});module.exports=H(W);var
|
|
1
|
+
"use strict";"use client";var s=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},A=(e,r,t,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of B(r))!L.call(e,a)&&a!==t&&s(e,a,{get:()=>r[a],enumerable:!(l=D(r,a))||l.enumerable});return e};var H=e=>A(s({},"__esModule",{value:!0}),e);var W={};P(W,{TabsTrigger:()=>w});module.exports=H(W);var h=require("react"),d=require("../../lib/cn.cjs"),o=require("./TabsContext.cjs"),n=require("react/jsx-runtime"),M={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-2.5 text-base gap-2"},k={sm:"w-3.5 h-3.5",md:"w-4 h-4",lg:"w-5 h-5"},u={default:{underline:{active:"text-gray-900 dark:text-white border-gray-900 dark:border-white",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-gray-700 dark:hover:text-gray-300"},pills:{active:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm",inactive:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"},enclosed:{active:"bg-white dark:bg-gray-800 text-gray-900 dark:text-white border-gray-200 dark:border-gray-700 border-b-white dark:border-b-gray-800",inactive:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 border-transparent"},soft:{active:"bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700/50"}},primary:{underline:{active:"text-blue-600 dark:text-blue-400 border-blue-600 dark:border-blue-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-blue-600 dark:hover:text-blue-400"},pills:{active:"bg-blue-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400"},enclosed:{active:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 border-b-blue-50 dark:border-b-blue-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 border-transparent"},soft:{active:"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20"}},secondary:{underline:{active:"text-purple-600 dark:text-purple-400 border-purple-600 dark:border-purple-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-purple-600 dark:hover:text-purple-400"},pills:{active:"bg-purple-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400"},enclosed:{active:"bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 border-purple-200 dark:border-purple-800 border-b-purple-50 dark:border-b-purple-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 border-transparent"},soft:{active:"bg-purple-100 dark:bg-purple-900/50 text-purple-700 dark:text-purple-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-900/20"}},success:{underline:{active:"text-green-600 dark:text-green-400 border-green-600 dark:border-green-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-green-600 dark:hover:text-green-400"},pills:{active:"bg-green-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400"},enclosed:{active:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 border-b-green-50 dark:border-b-green-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400 border-transparent"},soft:{active:"bg-green-100 dark:bg-green-900/50 text-green-700 dark:text-green-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20"}},warning:{underline:{active:"text-yellow-600 dark:text-yellow-400 border-yellow-600 dark:border-yellow-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-yellow-600 dark:hover:text-yellow-400"},pills:{active:"bg-yellow-500 text-gray-900",inactive:"text-gray-600 dark:text-gray-400 hover:text-yellow-600 dark:hover:text-yellow-400"},enclosed:{active:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 border-b-yellow-50 dark:border-b-yellow-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-yellow-600 dark:hover:text-yellow-400 border-transparent"},soft:{active:"bg-yellow-100 dark:bg-yellow-900/50 text-yellow-700 dark:text-yellow-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-yellow-600 dark:hover:text-yellow-400 hover:bg-yellow-50 dark:hover:bg-yellow-900/20"}},error:{underline:{active:"text-red-600 dark:text-red-400 border-red-600 dark:border-red-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-red-600 dark:hover:text-red-400"},pills:{active:"bg-red-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400"},enclosed:{active:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 border-red-200 dark:border-red-800 border-b-red-50 dark:border-b-red-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 border-transparent"},soft:{active:"bg-red-100 dark:bg-red-900/50 text-red-700 dark:text-red-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20"}}},O={underline:"border-b-2 -mb-px",pills:"rounded-md",enclosed:"border border-b-0 rounded-t-md -mb-px",soft:"rounded-md"};function w({value:e,children:r,disabled:t=!1,icon:l,endIcon:a,className:f,activeClassName:m,inactiveClassName:T}){let{value:C,onValueChange:N,variant:b,size:g,color:v,fullWidth:R,baseId:y}=(0,o.useTabsContext)(),{fallbackTabStopId:S}=(0,h.useContext)(o.TabsListContext),i=C===e,c=(0,o.getTabsId)(y,"tab",e),z=!t&&(i||S===c),p=()=>{t||N(e)},I=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p())},E=(0,d.cn)("inline-flex items-center justify-center font-medium transition-all duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500",M[g],R&&"flex-1"),K=i?(0,d.cn)(u[v][b].active,m):(0,d.cn)(u[v][b].inactive,T),V=t?"opacity-50 cursor-not-allowed":"cursor-pointer";return(0,n.jsxs)("button",{type:"button",role:"tab",id:c,"aria-selected":i,"aria-controls":i?(0,o.getTabsId)(y,"panel",e):void 0,"aria-disabled":t,tabIndex:z?0:-1,onClick:p,onKeyDown:I,disabled:t,className:(0,d.cn)(E,O[b],K,V,f),children:[l&&(0,n.jsx)("span",{className:(0,d.cn)("shrink-0",k[g]),children:l}),(0,n.jsx)("span",{children:r}),a&&(0,n.jsx)("span",{className:(0,d.cn)("shrink-0",k[g]),children:a})]})}w.displayName="TabsTrigger";0&&(module.exports={TabsTrigger});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useContext as E}from"react";import{cn as e}from"../../lib/cn.js";import{getTabsId as
|
|
1
|
+
"use client";import{useContext as E}from"react";import{cn as e}from"../../lib/cn.js";import{getTabsId as y,TabsListContext as K,useTabsContext as V}from"./TabsContext.js";import{jsx as l,jsxs as P}from"react/jsx-runtime";var D={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-2.5 text-base gap-2"},c={sm:"w-3.5 h-3.5",md:"w-4 h-4",lg:"w-5 h-5"},p={default:{underline:{active:"text-gray-900 dark:text-white border-gray-900 dark:border-white",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-gray-700 dark:hover:text-gray-300"},pills:{active:"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm",inactive:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"},enclosed:{active:"bg-white dark:bg-gray-800 text-gray-900 dark:text-white border-gray-200 dark:border-gray-700 border-b-white dark:border-b-gray-800",inactive:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 border-transparent"},soft:{active:"bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700/50"}},primary:{underline:{active:"text-blue-600 dark:text-blue-400 border-blue-600 dark:border-blue-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-blue-600 dark:hover:text-blue-400"},pills:{active:"bg-blue-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400"},enclosed:{active:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 border-b-blue-50 dark:border-b-blue-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 border-transparent"},soft:{active:"bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20"}},secondary:{underline:{active:"text-purple-600 dark:text-purple-400 border-purple-600 dark:border-purple-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-purple-600 dark:hover:text-purple-400"},pills:{active:"bg-purple-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400"},enclosed:{active:"bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 border-purple-200 dark:border-purple-800 border-b-purple-50 dark:border-b-purple-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 border-transparent"},soft:{active:"bg-purple-100 dark:bg-purple-900/50 text-purple-700 dark:text-purple-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 hover:bg-purple-50 dark:hover:bg-purple-900/20"}},success:{underline:{active:"text-green-600 dark:text-green-400 border-green-600 dark:border-green-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-green-600 dark:hover:text-green-400"},pills:{active:"bg-green-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400"},enclosed:{active:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 border-b-green-50 dark:border-b-green-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400 border-transparent"},soft:{active:"bg-green-100 dark:bg-green-900/50 text-green-700 dark:text-green-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-green-600 dark:hover:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20"}},warning:{underline:{active:"text-yellow-600 dark:text-yellow-400 border-yellow-600 dark:border-yellow-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-yellow-600 dark:hover:text-yellow-400"},pills:{active:"bg-yellow-500 text-gray-900",inactive:"text-gray-600 dark:text-gray-400 hover:text-yellow-600 dark:hover:text-yellow-400"},enclosed:{active:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 border-b-yellow-50 dark:border-b-yellow-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-yellow-600 dark:hover:text-yellow-400 border-transparent"},soft:{active:"bg-yellow-100 dark:bg-yellow-900/50 text-yellow-700 dark:text-yellow-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-yellow-600 dark:hover:text-yellow-400 hover:bg-yellow-50 dark:hover:bg-yellow-900/20"}},error:{underline:{active:"text-red-600 dark:text-red-400 border-red-600 dark:border-red-400",inactive:"text-gray-500 dark:text-gray-400 border-transparent hover:text-red-600 dark:hover:text-red-400"},pills:{active:"bg-red-600 text-white",inactive:"text-gray-600 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400"},enclosed:{active:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 border-red-200 dark:border-red-800 border-b-red-50 dark:border-b-red-900/20",inactive:"text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 border-transparent"},soft:{active:"bg-red-100 dark:bg-red-900/50 text-red-700 dark:text-red-300",inactive:"text-gray-600 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20"}}},B={underline:"border-b-2 -mb-px",pills:"rounded-md",enclosed:"border border-b-0 rounded-t-md -mb-px",soft:"rounded-md"};function L({value:t,children:k,disabled:r=!1,icon:i,endIcon:b,className:u,activeClassName:h,inactiveClassName:w}){let{value:f,onValueChange:m,variant:d,size:o,color:g,fullWidth:T,baseId:x}=V(),{fallbackTabStopId:C}=E(K),a=f===t,s=y(x,"tab",t),N=!r&&(a||C===s),v=()=>{r||m(t)},R=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),v())},S=e("inline-flex items-center justify-center font-medium transition-all duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500",D[o],T&&"flex-1"),z=a?e(p[g][d].active,h):e(p[g][d].inactive,w),I=r?"opacity-50 cursor-not-allowed":"cursor-pointer";return P("button",{type:"button",role:"tab",id:s,"aria-selected":a,"aria-controls":a?y(x,"panel",t):void 0,"aria-disabled":r,tabIndex:N?0:-1,onClick:v,onKeyDown:R,disabled:r,className:e(S,B[d],z,I,u),children:[i&&l("span",{className:e("shrink-0",c[o]),children:i}),l("span",{children:k}),b&&l("span",{className:e("shrink-0",c[o]),children:b})]})}L.displayName="TabsTrigger";export{L as TabsTrigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var i=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(t,r)=>{for(var
|
|
1
|
+
"use strict";"use client";var i=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(t,r)=>{for(var n in r)i(t,n,{get:r[n],enumerable:!0})},L=(t,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of v(r))!N.call(t,o)&&o!==n&&i(t,o,{get:()=>r[o],enumerable:!(s=C(r,o))||s.enumerable});return t};var M=t=>L(i({},"__esModule",{value:!0}),t);var j={};T(j,{Toast:()=>b});module.exports=M(j);var a=require("../../lib/cn.cjs"),c=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function R({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function I({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function g({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function H({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var P={success:R,error:I,warning:W,info:g,default:g},V={success:{solid:"bg-green-600 text-white border-green-600",outlined:"bg-white text-green-700 border-green-600 dark:bg-gray-900 dark:text-green-400",soft:"bg-green-50 text-green-700 border-green-200 dark:bg-green-900/20 dark:text-green-400 dark:border-green-800"},error:{solid:"bg-red-600 text-white border-red-600",outlined:"bg-white text-red-700 border-red-600 dark:bg-gray-900 dark:text-red-400",soft:"bg-red-50 text-red-700 border-red-200 dark:bg-red-900/20 dark:text-red-400 dark:border-red-800"},warning:{solid:"bg-yellow-500 text-gray-900 border-yellow-500",outlined:"bg-white text-yellow-700 border-yellow-500 dark:bg-gray-900 dark:text-yellow-400",soft:"bg-yellow-50 text-yellow-700 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-400 dark:border-yellow-800"},info:{solid:"bg-blue-600 text-white border-blue-600",outlined:"bg-white text-blue-700 border-blue-600 dark:bg-gray-900 dark:text-blue-400",soft:"bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/20 dark:text-blue-400 dark:border-blue-800"},default:{solid:"bg-gray-700 text-white border-gray-700",outlined:"bg-white text-gray-700 border-gray-300 dark:bg-gray-900 dark:text-gray-300",soft:"bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"}},B={success:"text-green-600 dark:text-green-400",error:"text-red-600 dark:text-red-400",warning:"text-yellow-600 dark:text-yellow-400",info:"text-blue-600 dark:text-blue-400",default:"text-gray-600 dark:text-gray-400"};function b({children:t,title:r,description:n,type:s="default",variant:o="soft",icon:u,action:d,onClose:w,closable:x=!0,closeLabel:k,className:m,...p}){let f=(0,c.useUILabels)(),h=P[s],y=(0,e.jsx)(h,{className:"w-5 h-5"}),l=t??n;return(0,e.jsxs)("div",{role:"alert",className:(0,a.cn)("flex items-start gap-3 p-4 rounded-lg border shadow-lg min-w-[320px] max-w-md","animate-in slide-in-from-top-2 fade-in duration-300",V[s][o],m),...p,children:[(0,e.jsx)("div",{className:(0,a.cn)("flex-shrink-0 mt-0.5",o!=="solid"&&B[s]),children:u??y}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[r&&(0,e.jsx)("div",{className:"font-semibold text-sm mb-1",children:r}),l&&(0,e.jsx)("div",{className:"text-sm opacity-90",children:l}),d&&(0,e.jsx)("div",{className:"mt-3",children:d})]}),x&&(0,e.jsx)("button",{type:"button",onClick:w,className:(0,a.cn)("flex-shrink-0 rounded-md p-1 transition-colors hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":k??f.toastClose,children:(0,e.jsx)(H,{className:"w-4 h-4"})})]})}b.displayName="Toast";0&&(module.exports={Toast});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{cn as
|
|
1
|
+
"use client";import{cn as o}from"../../lib/cn.js";import{useUILabels as h}from"../../lib/i18n.js";import{jsx as e,jsxs as l}from"react/jsx-runtime";function y({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function C({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function v({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function d({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function N({className:t}){return e("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var T={success:y,error:C,warning:v,info:d,default:d},L={success:{solid:"bg-green-600 text-white border-green-600",outlined:"bg-white text-green-700 border-green-600 dark:bg-gray-900 dark:text-green-400",soft:"bg-green-50 text-green-700 border-green-200 dark:bg-green-900/20 dark:text-green-400 dark:border-green-800"},error:{solid:"bg-red-600 text-white border-red-600",outlined:"bg-white text-red-700 border-red-600 dark:bg-gray-900 dark:text-red-400",soft:"bg-red-50 text-red-700 border-red-200 dark:bg-red-900/20 dark:text-red-400 dark:border-red-800"},warning:{solid:"bg-yellow-500 text-gray-900 border-yellow-500",outlined:"bg-white text-yellow-700 border-yellow-500 dark:bg-gray-900 dark:text-yellow-400",soft:"bg-yellow-50 text-yellow-700 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-400 dark:border-yellow-800"},info:{solid:"bg-blue-600 text-white border-blue-600",outlined:"bg-white text-blue-700 border-blue-600 dark:bg-gray-900 dark:text-blue-400",soft:"bg-blue-50 text-blue-700 border-blue-200 dark:bg-blue-900/20 dark:text-blue-400 dark:border-blue-800"},default:{solid:"bg-gray-700 text-white border-gray-700",outlined:"bg-white text-gray-700 border-gray-300 dark:bg-gray-900 dark:text-gray-300",soft:"bg-gray-50 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"}},M={success:"text-green-600 dark:text-green-400",error:"text-red-600 dark:text-red-400",warning:"text-yellow-600 dark:text-yellow-400",info:"text-blue-600 dark:text-blue-400",default:"text-gray-600 dark:text-gray-400"};function R({children:t,title:n,description:g,type:r="default",variant:s="soft",icon:c,action:a,onClose:b,closable:u=!0,closeLabel:w,className:x,...k}){let m=h(),p=T[r],f=e(p,{className:"w-5 h-5"}),i=t??g;return l("div",{role:"alert",className:o("flex items-start gap-3 p-4 rounded-lg border shadow-lg min-w-[320px] max-w-md","animate-in slide-in-from-top-2 fade-in duration-300",L[r][s],x),...k,children:[e("div",{className:o("flex-shrink-0 mt-0.5",s!=="solid"&&M[r]),children:c??f}),l("div",{className:"flex-1 min-w-0",children:[n&&e("div",{className:"font-semibold text-sm mb-1",children:n}),i&&e("div",{className:"text-sm opacity-90",children:i}),a&&e("div",{className:"mt-3",children:a})]}),u&&e("button",{type:"button",onClick:b,className:o("flex-shrink-0 rounded-md p-1 transition-colors hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":w??m.toastClose,children:e(N,{className:"w-4 h-4"})})]})}R.displayName="Toast";export{R as Toast};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var g=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var M=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},L=(t,r,e,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of V(r))!S.call(t,o)&&o!==e&&g(t,o,{get:()=>r[o],enumerable:!(a=z(r,o))||a.enumerable});return t};var A=t=>L(g({},"__esModule",{value:!0}),t);var O={};M(O,{Tooltip:()=>m});module.exports=A(O);var l=require("react"),d=require("../../lib/cn.cjs"),n=require("react/jsx-runtime"),H={default:"bg-gray-900 text-white dark:bg-gray-700",light:"bg-white text-gray-900 border border-gray-200 shadow-lg dark:bg-gray-800 dark:text-white dark:border-gray-600",error:"bg-red-600 text-white",success:"bg-green-600 text-white",warning:"bg-yellow-500 text-
|
|
1
|
+
"use strict";"use client";var g=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var M=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},L=(t,r,e,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of V(r))!S.call(t,o)&&o!==e&&g(t,o,{get:()=>r[o],enumerable:!(a=z(r,o))||a.enumerable});return t};var A=t=>L(g({},"__esModule",{value:!0}),t);var O={};M(O,{Tooltip:()=>m});module.exports=A(O);var l=require("react"),d=require("../../lib/cn.cjs"),n=require("react/jsx-runtime"),H={default:"bg-gray-900 text-white dark:bg-gray-700",light:"bg-white text-gray-900 border border-gray-200 shadow-lg dark:bg-gray-800 dark:text-white dark:border-gray-600",error:"bg-red-600 text-white",success:"bg-green-600 text-white",warning:"bg-yellow-500 text-gray-900",info:"bg-blue-600 text-white"},E={default:{top:"border-t-gray-900 dark:border-t-gray-700",bottom:"border-b-gray-900 dark:border-b-gray-700",left:"border-l-gray-900 dark:border-l-gray-700",right:"border-r-gray-900 dark:border-r-gray-700"},light:{top:"border-t-white dark:border-t-gray-800",bottom:"border-b-white dark:border-b-gray-800",left:"border-l-white dark:border-l-gray-800",right:"border-r-white dark:border-r-gray-800"},error:{top:"border-t-red-600",bottom:"border-b-red-600",left:"border-l-red-600",right:"border-r-red-600"},success:{top:"border-t-green-600",bottom:"border-b-green-600",left:"border-l-green-600",right:"border-r-green-600"},warning:{top:"border-t-yellow-500",bottom:"border-b-yellow-500",left:"border-l-yellow-500",right:"border-r-yellow-500"},info:{top:"border-t-blue-600",bottom:"border-b-blue-600",left:"border-l-blue-600",right:"border-r-blue-600"}},B={sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"},D={sm:"border-4",md:"border-[5px]",lg:"border-[6px]"},F={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},I={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"};function m({children:t,content:r,position:e="top",variant:a="default",size:o="md",trigger:u="hover",open:y,delay:p=0,showArrow:h=!0,maxWidth:T="max-w-xs",className:w,contentClassName:x,disabled:i=!1,...k}){let[R,s]=(0,l.useState)(!1),b=(0,l.useRef)(null),c=(0,l.useCallback)(()=>{i||(p>0?b.current=setTimeout(()=>s(!0),p):s(!0))},[p,i]),f=(0,l.useCallback)(()=>{b.current&&(clearTimeout(b.current),b.current=null),s(!1)},[]),v=(0,l.useCallback)(()=>{i||s(N=>!N)},[i]),C=u==="manual"?y:R,P={hover:{onMouseEnter:c,onMouseLeave:f,onFocus:c,onBlur:f},click:{onClick:v},manual:{}}[u];return(0,n.jsxs)("div",{className:(0,d.cn)("relative inline-flex",w),...P,...k,children:[t,C&&!i&&(0,n.jsxs)("div",{role:"tooltip",className:(0,d.cn)("absolute z-50 whitespace-normal wrap-break-word rounded-md","transition-opacity duration-150",F[e],H[a],B[o],T,x),children:[r,h&&(0,n.jsx)("span",{className:(0,d.cn)("absolute w-0 h-0 border-solid",D[o],I[e],E[a][e]),"aria-hidden":"true"})]})]})}m.displayName="Tooltip";0&&(module.exports={Tooltip});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useState as P,useRef as N,useCallback as a}from"react";import{cn as i}from"../../lib/cn.js";import{jsx as E,jsxs as g}from"react/jsx-runtime";var z={default:"bg-gray-900 text-white dark:bg-gray-700",light:"bg-white text-gray-900 border border-gray-200 shadow-lg dark:bg-gray-800 dark:text-white dark:border-gray-600",error:"bg-red-600 text-white",success:"bg-green-600 text-white",warning:"bg-yellow-500 text-
|
|
1
|
+
"use client";import{useState as P,useRef as N,useCallback as a}from"react";import{cn as i}from"../../lib/cn.js";import{jsx as E,jsxs as g}from"react/jsx-runtime";var z={default:"bg-gray-900 text-white dark:bg-gray-700",light:"bg-white text-gray-900 border border-gray-200 shadow-lg dark:bg-gray-800 dark:text-white dark:border-gray-600",error:"bg-red-600 text-white",success:"bg-green-600 text-white",warning:"bg-yellow-500 text-gray-900",info:"bg-blue-600 text-white"},V={default:{top:"border-t-gray-900 dark:border-t-gray-700",bottom:"border-b-gray-900 dark:border-b-gray-700",left:"border-l-gray-900 dark:border-l-gray-700",right:"border-r-gray-900 dark:border-r-gray-700"},light:{top:"border-t-white dark:border-t-gray-800",bottom:"border-b-white dark:border-b-gray-800",left:"border-l-white dark:border-l-gray-800",right:"border-r-white dark:border-r-gray-800"},error:{top:"border-t-red-600",bottom:"border-b-red-600",left:"border-l-red-600",right:"border-r-red-600"},success:{top:"border-t-green-600",bottom:"border-b-green-600",left:"border-l-green-600",right:"border-r-green-600"},warning:{top:"border-t-yellow-500",bottom:"border-b-yellow-500",left:"border-l-yellow-500",right:"border-r-yellow-500"},info:{top:"border-t-blue-600",bottom:"border-b-blue-600",left:"border-l-blue-600",right:"border-r-blue-600"}},S={sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"},M={sm:"border-4",md:"border-[5px]",lg:"border-[6px]"},L={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},A={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"};function H({children:u,content:c,position:o="top",variant:n="default",size:s="md",trigger:b="hover",open:f,delay:l=0,showArrow:m=!0,maxWidth:y="max-w-xs",className:h,contentClassName:T,disabled:r=!1,...w}){let[x,t]=P(!1),e=N(null),d=a(()=>{r||(l>0?e.current=setTimeout(()=>t(!0),l):t(!0))},[l,r]),p=a(()=>{e.current&&(clearTimeout(e.current),e.current=null),t(!1)},[]),k=a(()=>{r||t(C=>!C)},[r]),R=b==="manual"?f:x,v={hover:{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p},click:{onClick:k},manual:{}}[b];return g("div",{className:i("relative inline-flex",h),...v,...w,children:[u,R&&!r&&g("div",{role:"tooltip",className:i("absolute z-50 whitespace-normal wrap-break-word rounded-md","transition-opacity duration-150",L[o],z[n],S[s],y,T),children:[c,m&&E("span",{className:i("absolute w-0 h-0 border-solid",M[s],A[o],V[n][o]),"aria-hidden":"true"})]})]})}H.displayName="Tooltip";export{H as Tooltip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var V=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var n in e)V(t,n,{get:e[n],enumerable:!0})},ae=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ee(e))!te.call(t,i)&&i!==n&&V(t,i,{get:()=>e[i],enumerable:!(s=$(e,i))||s.enumerable});return t};var ie=t=>ae(V({},"__esModule",{value:!0}),t);var oe={};re(oe,{Wizard:()=>I,WizardActions:()=>J,WizardContent:()=>q,WizardNext:()=>D,WizardPanel:()=>U,WizardPrevious:()=>E,WizardSteps:()=>H,useWizard:()=>W});module.exports=ie(oe);var u=require("react"),o=require("../../lib/cn.cjs"),A=require("../../lib/i18n.cjs"),r=require("react/jsx-runtime"),F=(0,u.createContext)(null);function W(){let t=(0,u.useContext)(F);if(!t)throw new Error("useWizard and Wizard sub-components must be used within <Wizard>");return t}var B=(t,e,n)=>Math.max(e,Math.min(t,n)),j={sm:{circle:"h-7 w-7 text-xs",dot:"h-2.5 w-2.5",icon:"h-3.5 w-3.5",title:"text-xs",desc:"text-[11px]",connector:"h-0.5"},md:{circle:"h-9 w-9 text-sm",dot:"h-3 w-3",icon:"h-4 w-4",title:"text-sm",desc:"text-xs",connector:"h-0.5"},lg:{circle:"h-11 w-11 text-base",dot:"h-3.5 w-3.5",icon:"h-5 w-5",title:"text-base",desc:"text-sm",connector:"h-1"}},x={primary:{solid:"bg-blue-600 text-white",bg:"bg-blue-600",text:"text-blue-600 dark:text-blue-400",ring:"focus-visible:ring-blue-500",ringSoft:"ring-blue-500/20"},secondary:{solid:"bg-gray-700 text-white",bg:"bg-gray-700",text:"text-gray-700 dark:text-gray-300",ring:"focus-visible:ring-gray-500",ringSoft:"ring-gray-500/20"},success:{solid:"bg-green-600 text-white",bg:"bg-green-600",text:"text-green-600 dark:text-green-400",ring:"focus-visible:ring-green-500",ringSoft:"ring-green-500/20"},warning:{solid:"bg-amber-500 text-
|
|
1
|
+
"use strict";"use client";var V=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var n in e)V(t,n,{get:e[n],enumerable:!0})},ae=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ee(e))!te.call(t,i)&&i!==n&&V(t,i,{get:()=>e[i],enumerable:!(s=$(e,i))||s.enumerable});return t};var ie=t=>ae(V({},"__esModule",{value:!0}),t);var oe={};re(oe,{Wizard:()=>I,WizardActions:()=>J,WizardContent:()=>q,WizardNext:()=>D,WizardPanel:()=>U,WizardPrevious:()=>E,WizardSteps:()=>H,useWizard:()=>W});module.exports=ie(oe);var u=require("react"),o=require("../../lib/cn.cjs"),A=require("../../lib/i18n.cjs"),r=require("react/jsx-runtime"),F=(0,u.createContext)(null);function W(){let t=(0,u.useContext)(F);if(!t)throw new Error("useWizard and Wizard sub-components must be used within <Wizard>");return t}var B=(t,e,n)=>Math.max(e,Math.min(t,n)),j={sm:{circle:"h-7 w-7 text-xs",dot:"h-2.5 w-2.5",icon:"h-3.5 w-3.5",title:"text-xs",desc:"text-[11px]",connector:"h-0.5"},md:{circle:"h-9 w-9 text-sm",dot:"h-3 w-3",icon:"h-4 w-4",title:"text-sm",desc:"text-xs",connector:"h-0.5"},lg:{circle:"h-11 w-11 text-base",dot:"h-3.5 w-3.5",icon:"h-5 w-5",title:"text-base",desc:"text-sm",connector:"h-1"}},x={primary:{solid:"bg-blue-600 text-white",bg:"bg-blue-600",text:"text-blue-600 dark:text-blue-400",ring:"focus-visible:ring-blue-500",ringSoft:"ring-blue-500/20"},secondary:{solid:"bg-gray-700 text-white",bg:"bg-gray-700",text:"text-gray-700 dark:text-gray-300",ring:"focus-visible:ring-gray-500",ringSoft:"ring-gray-500/20"},success:{solid:"bg-green-600 text-white",bg:"bg-green-600",text:"text-green-600 dark:text-green-400",ring:"focus-visible:ring-green-500",ringSoft:"ring-green-500/20"},warning:{solid:"bg-amber-500 text-gray-900",bg:"bg-amber-500",text:"text-amber-600 dark:text-amber-400",ring:"focus-visible:ring-amber-500",ringSoft:"ring-amber-500/20"},error:{solid:"bg-red-600 text-white",bg:"bg-red-600",text:"text-red-600 dark:text-red-400",ring:"focus-visible:ring-red-500",ringSoft:"ring-red-500/20"}};function ne({className:t}){return(0,r.jsx)("svg",{className:t,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}function I({steps:t,step:e,defaultStep:n=0,onStepChange:s,onComplete:i,orientation:c="horizontal",variant:l="default",size:p="md",color:d="primary",linear:g=!0,className:m,children:z}){let C=t.length,h=Math.max(0,C-1),N=e!==void 0,[P,R]=(0,u.useState)(()=>B(n,0,h)),a=B(N?e:P,0,h),[f,w]=(0,u.useState)(a);f<a&&w(a);let v=a<=0,y=a>=h,S=(0,u.useCallback)((b,M)=>{let L=B(b,0,h);L!==a&&(N||R(L),w(_=>Math.max(_,L)),s?.(L,{previous:a,direction:M}))},[a,N,h,s]),k=(0,u.useCallback)(b=>{let M=t[b];return!M||M.disabled?!1:g?b<=f:!0},[t,g,f]),K=(0,u.useCallback)(b=>{k(b)&&S(b,b>a?"jump":"backward")},[k,S,a]),Q=(0,u.useCallback)(()=>{if(y){i?.();return}S(a+1,"forward")},[y,i,S,a]),X=(0,u.useCallback)(()=>{v||S(a-1,"backward")},[v,S,a]),Y=(0,u.useCallback)(b=>t[b]?.error?"error":b===a?"active":b<a?"completed":"upcoming",[t,a]),Z={steps:t,activeStep:a,totalSteps:C,isFirstStep:v,isLastStep:y,orientation:c,variant:l,size:p,color:d,linear:g,goToStep:K,goNext:Q,goBack:X,getStepStatus:Y,isStepAccessible:k};return(0,r.jsx)(F.Provider,{value:Z,children:(0,r.jsx)("div",{className:(0,o.cn)("flex w-full flex-col gap-6",m),"data-testid":"wizard","data-orientation":c,children:z})})}function O({index:t,status:e}){let{variant:n,size:s,color:i,steps:c}=W(),l=j[s],p=c[t];if(n==="dots"){let m=e==="upcoming"?"bg-gray-300 dark:bg-gray-600":e==="error"?"bg-red-600":x[i].bg;return(0,r.jsx)("span",{className:(0,o.cn)("shrink-0 rounded-full transition-colors",l.dot,m),"aria-hidden":"true"})}let d=e==="completed"?(0,o.cn)(x[i].solid,"border-transparent"):e==="active"?(0,o.cn)(x[i].solid,"border-transparent ring-4",x[i].ringSoft):e==="error"?"border-transparent bg-red-600 text-white":"border-2 border-gray-300 bg-white text-gray-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400",g=e==="completed"?(0,r.jsx)(ne,{className:l.icon}):e==="error"?(0,r.jsx)("span",{className:"font-semibold leading-none",children:"!"}):p.icon??(0,r.jsx)("span",{className:"font-medium leading-none",children:t+1});return(0,r.jsx)("span",{className:(0,o.cn)("flex shrink-0 items-center justify-center rounded-full transition-all",l.circle,d),"aria-hidden":"true",children:g})}function T({index:t,status:e,optionalLabel:n}){let{steps:s,size:i,color:c,variant:l}=W(),p=j[i],d=s[t],m=e==="active"?x[c].text:e==="completed"?"text-gray-900 dark:text-gray-100":e==="error"?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400";return(0,r.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,r.jsxs)("span",{className:(0,o.cn)("font-medium leading-tight",p.title,m),children:[l==="simple"&&(0,r.jsxs)("span",{className:"mr-1 tabular-nums",children:[t+1,"."]}),d.title,d.optional&&(0,r.jsx)("span",{className:"ml-1 text-xs font-normal text-gray-400 dark:text-gray-500",children:n})]}),d.description&&(0,r.jsx)("span",{className:(0,o.cn)("mt-0.5 text-gray-400 dark:text-gray-500",p.desc),children:d.description})]})}function H({className:t,hideConnector:e=!1,hideLabels:n=!1,optionalLabel:s}){let i=W(),c=(0,A.useUILabels)(),l=s??c.wizardOptional,{steps:p,orientation:d,size:g,variant:m,color:z,activeStep:C}=i,h=j[g],N=d==="vertical",P=m!=="simple";return(0,r.jsx)("ol",{className:(0,o.cn)("flex w-full",N?"flex-col":"items-start",t),"data-testid":"wizard-steps","data-orientation":d,children:p.map((R,a)=>{let f=i.getStepStatus(a),w=a===C,v=i.isStepAccessible(a)&&!w,y=a===p.length-1,k=a<C?x[z].bg:"bg-gray-200 dark:bg-gray-700";return N?(0,r.jsx)("li",{className:"flex","aria-current":w?"step":void 0,"data-status":f,"data-testid":"wizard-step",children:(0,r.jsxs)("button",{type:"button",disabled:!v,onClick:()=>i.goToStep(a),className:(0,o.cn)("flex items-stretch gap-3 rounded-md text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",x[z].ring,v?"cursor-pointer":"cursor-default"),children:[(0,r.jsxs)("span",{className:"flex flex-col items-center",children:[P&&(0,r.jsx)(O,{index:a,status:f}),!e&&!y&&(0,r.jsx)("span",{className:(0,o.cn)("my-1 w-0.5 flex-1 rounded",k),"aria-hidden":"true"})]}),!n&&(0,r.jsx)("span",{className:(0,o.cn)(y?"pb-0":"pb-6"),children:(0,r.jsx)(T,{index:a,status:f,optionalLabel:l})})]})},R.id??a):(0,r.jsxs)("li",{className:(0,o.cn)("flex items-center",!y&&"flex-1"),"aria-current":w?"step":void 0,"data-status":f,"data-testid":"wizard-step",children:[(0,r.jsxs)("button",{type:"button",disabled:!v,onClick:()=>i.goToStep(a),className:(0,o.cn)("flex items-center gap-2.5 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",x[z].ring,v?"cursor-pointer":"cursor-default"),children:[P&&(0,r.jsx)(O,{index:a,status:f}),!n&&(0,r.jsx)(T,{index:a,status:f,optionalLabel:l})]}),!e&&!y&&(0,r.jsx)("span",{className:(0,o.cn)("mx-2 flex-1 rounded",h.connector,k),"aria-hidden":"true"})]},R.id??a)})})}function U({index:t,keepMounted:e=!1,className:n,children:s}){let{activeStep:i}=W(),c=t===i;return!c&&!e?null:(0,r.jsx)("div",{role:"tabpanel",hidden:!c,"data-testid":"wizard-panel","data-active":c,"data-step":t,className:(0,o.cn)("w-full",n),children:s})}function q({className:t,children:e}){let n=W();return(0,r.jsx)("div",{className:(0,o.cn)("w-full",t),"data-testid":"wizard-content",children:typeof e=="function"?e(n):e})}var G="inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";function E({children:t,label:e,className:n,onClick:s,disabled:i,...c}){let{goBack:l,isFirstStep:p}=W(),d=(0,A.useUILabels)();return(0,r.jsx)("button",{type:"button",onClick:m=>{s?.(m),m.defaultPrevented||l()},disabled:i??p,"data-testid":"wizard-previous",className:(0,o.cn)(G,"border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus-visible:ring-gray-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",n),...c,children:t??e??d.wizardPrevious})}function D({children:t,label:e,finishLabel:n,className:s,onClick:i,...c}){let{goNext:l,isLastStep:p,color:d}=W(),g=(0,A.useUILabels)();return(0,r.jsx)("button",{type:"button",onClick:z=>{i?.(z),z.defaultPrevented||l()},"data-testid":"wizard-next",className:(0,o.cn)(G,x[d].solid,x[d].ring,"hover:opacity-90",s),...c,children:t??(p?n??g.wizardFinish:e??g.wizardNext)})}function J({className:t,children:e,align:n="between"}){let s={between:"justify-between",start:"justify-start",center:"justify-center",end:"justify-end"}[n];return(0,r.jsx)("div",{className:(0,o.cn)("flex items-center gap-3",s,t),"data-testid":"wizard-actions",children:e??(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E,{}),(0,r.jsx)(D,{})]})})}I.displayName="Wizard";H.displayName="WizardSteps";U.displayName="WizardPanel";q.displayName="WizardContent";J.displayName="WizardActions";E.displayName="WizardPrevious";D.displayName="WizardNext";0&&(module.exports={Wizard,WizardActions,WizardContent,WizardNext,WizardPanel,WizardPrevious,WizardSteps,useWizard});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createContext as X,useCallback as C,useContext as Y,useState as E}from"react";import{cn as o}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{Fragment as ae,jsx as a,jsxs as y}from"react/jsx-runtime";var T=X(null);function S(){let e=Y(T);if(!e)throw new Error("useWizard and Wizard sub-components must be used within <Wizard>");return e}var V=(e,r,n)=>Math.max(r,Math.min(e,n)),j={sm:{circle:"h-7 w-7 text-xs",dot:"h-2.5 w-2.5",icon:"h-3.5 w-3.5",title:"text-xs",desc:"text-[11px]",connector:"h-0.5"},md:{circle:"h-9 w-9 text-sm",dot:"h-3 w-3",icon:"h-4 w-4",title:"text-sm",desc:"text-xs",connector:"h-0.5"},lg:{circle:"h-11 w-11 text-base",dot:"h-3.5 w-3.5",icon:"h-5 w-5",title:"text-base",desc:"text-sm",connector:"h-1"}},f={primary:{solid:"bg-blue-600 text-white",bg:"bg-blue-600",text:"text-blue-600 dark:text-blue-400",ring:"focus-visible:ring-blue-500",ringSoft:"ring-blue-500/20"},secondary:{solid:"bg-gray-700 text-white",bg:"bg-gray-700",text:"text-gray-700 dark:text-gray-300",ring:"focus-visible:ring-gray-500",ringSoft:"ring-gray-500/20"},success:{solid:"bg-green-600 text-white",bg:"bg-green-600",text:"text-green-600 dark:text-green-400",ring:"focus-visible:ring-green-500",ringSoft:"ring-green-500/20"},warning:{solid:"bg-amber-500 text-
|
|
1
|
+
"use client";import{createContext as X,useCallback as C,useContext as Y,useState as E}from"react";import{cn as o}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{Fragment as ae,jsx as a,jsxs as y}from"react/jsx-runtime";var T=X(null);function S(){let e=Y(T);if(!e)throw new Error("useWizard and Wizard sub-components must be used within <Wizard>");return e}var V=(e,r,n)=>Math.max(r,Math.min(e,n)),j={sm:{circle:"h-7 w-7 text-xs",dot:"h-2.5 w-2.5",icon:"h-3.5 w-3.5",title:"text-xs",desc:"text-[11px]",connector:"h-0.5"},md:{circle:"h-9 w-9 text-sm",dot:"h-3 w-3",icon:"h-4 w-4",title:"text-sm",desc:"text-xs",connector:"h-0.5"},lg:{circle:"h-11 w-11 text-base",dot:"h-3.5 w-3.5",icon:"h-5 w-5",title:"text-base",desc:"text-sm",connector:"h-1"}},f={primary:{solid:"bg-blue-600 text-white",bg:"bg-blue-600",text:"text-blue-600 dark:text-blue-400",ring:"focus-visible:ring-blue-500",ringSoft:"ring-blue-500/20"},secondary:{solid:"bg-gray-700 text-white",bg:"bg-gray-700",text:"text-gray-700 dark:text-gray-300",ring:"focus-visible:ring-gray-500",ringSoft:"ring-gray-500/20"},success:{solid:"bg-green-600 text-white",bg:"bg-green-600",text:"text-green-600 dark:text-green-400",ring:"focus-visible:ring-green-500",ringSoft:"ring-green-500/20"},warning:{solid:"bg-amber-500 text-gray-900",bg:"bg-amber-500",text:"text-amber-600 dark:text-amber-400",ring:"focus-visible:ring-amber-500",ringSoft:"ring-amber-500/20"},error:{solid:"bg-red-600 text-white",bg:"bg-red-600",text:"text-red-600 dark:text-red-400",ring:"focus-visible:ring-red-500",ringSoft:"ring-red-500/20"}};function Z({className:e}){return a("svg",{className:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}function _({steps:e,step:r,defaultStep:n=0,onStepChange:s,onComplete:i,orientation:c="horizontal",variant:l="default",size:u="md",color:d="primary",linear:p=!0,className:b,children:x}){let P=e.length,W=Math.max(0,P-1),N=r!==void 0,[R,M]=E(()=>V(n,0,W)),t=V(N?r:R,0,W),[m,w]=E(t);m<t&&w(t);let z=t<=0,v=t>=W,h=C((g,L)=>{let A=V(g,0,W);A!==t&&(N||M(A),w(Q=>Math.max(Q,A)),s?.(A,{previous:t,direction:L}))},[t,N,W,s]),k=C(g=>{let L=e[g];return!L||L.disabled?!1:p?g<=m:!0},[e,p,m]),U=C(g=>{k(g)&&h(g,g>t?"jump":"backward")},[k,h,t]),q=C(()=>{if(v){i?.();return}h(t+1,"forward")},[v,i,h,t]),G=C(()=>{z||h(t-1,"backward")},[z,h,t]),J=C(g=>e[g]?.error?"error":g===t?"active":g<t?"completed":"upcoming",[e,t]),K={steps:e,activeStep:t,totalSteps:P,isFirstStep:z,isLastStep:v,orientation:c,variant:l,size:u,color:d,linear:p,goToStep:U,goNext:q,goBack:G,getStepStatus:J,isStepAccessible:k};return a(T.Provider,{value:K,children:a("div",{className:o("flex w-full flex-col gap-6",b),"data-testid":"wizard","data-orientation":c,children:x})})}function D({index:e,status:r}){let{variant:n,size:s,color:i,steps:c}=S(),l=j[s],u=c[e];if(n==="dots"){let b=r==="upcoming"?"bg-gray-300 dark:bg-gray-600":r==="error"?"bg-red-600":f[i].bg;return a("span",{className:o("shrink-0 rounded-full transition-colors",l.dot,b),"aria-hidden":"true"})}let d=r==="completed"?o(f[i].solid,"border-transparent"):r==="active"?o(f[i].solid,"border-transparent ring-4",f[i].ringSoft):r==="error"?"border-transparent bg-red-600 text-white":"border-2 border-gray-300 bg-white text-gray-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400",p=r==="completed"?a(Z,{className:l.icon}):r==="error"?a("span",{className:"font-semibold leading-none",children:"!"}):u.icon??a("span",{className:"font-medium leading-none",children:e+1});return a("span",{className:o("flex shrink-0 items-center justify-center rounded-full transition-all",l.circle,d),"aria-hidden":"true",children:p})}function O({index:e,status:r,optionalLabel:n}){let{steps:s,size:i,color:c,variant:l}=S(),u=j[i],d=s[e],b=r==="active"?f[c].text:r==="completed"?"text-gray-900 dark:text-gray-100":r==="error"?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-gray-400";return y("span",{className:"flex min-w-0 flex-col",children:[y("span",{className:o("font-medium leading-tight",u.title,b),children:[l==="simple"&&y("span",{className:"mr-1 tabular-nums",children:[e+1,"."]}),d.title,d.optional&&a("span",{className:"ml-1 text-xs font-normal text-gray-400 dark:text-gray-500",children:n})]}),d.description&&a("span",{className:o("mt-0.5 text-gray-400 dark:text-gray-500",u.desc),children:d.description})]})}function $({className:e,hideConnector:r=!1,hideLabels:n=!1,optionalLabel:s}){let i=S(),c=B(),l=s??c.wizardOptional,{steps:u,orientation:d,size:p,variant:b,color:x,activeStep:P}=i,W=j[p],N=d==="vertical",R=b!=="simple";return a("ol",{className:o("flex w-full",N?"flex-col":"items-start",e),"data-testid":"wizard-steps","data-orientation":d,children:u.map((M,t)=>{let m=i.getStepStatus(t),w=t===P,z=i.isStepAccessible(t)&&!w,v=t===u.length-1,k=t<P?f[x].bg:"bg-gray-200 dark:bg-gray-700";return N?a("li",{className:"flex","aria-current":w?"step":void 0,"data-status":m,"data-testid":"wizard-step",children:y("button",{type:"button",disabled:!z,onClick:()=>i.goToStep(t),className:o("flex items-stretch gap-3 rounded-md text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",f[x].ring,z?"cursor-pointer":"cursor-default"),children:[y("span",{className:"flex flex-col items-center",children:[R&&a(D,{index:t,status:m}),!r&&!v&&a("span",{className:o("my-1 w-0.5 flex-1 rounded",k),"aria-hidden":"true"})]}),!n&&a("span",{className:o(v?"pb-0":"pb-6"),children:a(O,{index:t,status:m,optionalLabel:l})})]})},M.id??t):y("li",{className:o("flex items-center",!v&&"flex-1"),"aria-current":w?"step":void 0,"data-status":m,"data-testid":"wizard-step",children:[y("button",{type:"button",disabled:!z,onClick:()=>i.goToStep(t),className:o("flex items-center gap-2.5 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",f[x].ring,z?"cursor-pointer":"cursor-default"),children:[R&&a(D,{index:t,status:m}),!n&&a(O,{index:t,status:m,optionalLabel:l})]}),!r&&!v&&a("span",{className:o("mx-2 flex-1 rounded",W.connector,k),"aria-hidden":"true"})]},M.id??t)})})}function ee({index:e,keepMounted:r=!1,className:n,children:s}){let{activeStep:i}=S(),c=e===i;return!c&&!r?null:a("div",{role:"tabpanel",hidden:!c,"data-testid":"wizard-panel","data-active":c,"data-step":e,className:o("w-full",n),children:s})}function te({className:e,children:r}){let n=S();return a("div",{className:o("w-full",e),"data-testid":"wizard-content",children:typeof r=="function"?r(n):r})}var F="inline-flex cursor-pointer items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";function I({children:e,label:r,className:n,onClick:s,disabled:i,...c}){let{goBack:l,isFirstStep:u}=S(),d=B();return a("button",{type:"button",onClick:b=>{s?.(b),b.defaultPrevented||l()},disabled:i??u,"data-testid":"wizard-previous",className:o(F,"border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 focus-visible:ring-gray-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",n),...c,children:e??r??d.wizardPrevious})}function H({children:e,label:r,finishLabel:n,className:s,onClick:i,...c}){let{goNext:l,isLastStep:u,color:d}=S(),p=B();return a("button",{type:"button",onClick:x=>{i?.(x),x.defaultPrevented||l()},"data-testid":"wizard-next",className:o(F,f[d].solid,f[d].ring,"hover:opacity-90",s),...c,children:e??(u?n??p.wizardFinish:r??p.wizardNext)})}function re({className:e,children:r,align:n="between"}){let s={between:"justify-between",start:"justify-start",center:"justify-center",end:"justify-end"}[n];return a("div",{className:o("flex items-center gap-3",s,e),"data-testid":"wizard-actions",children:r??y(ae,{children:[a(I,{}),a(H,{})]})})}_.displayName="Wizard";$.displayName="WizardSteps";ee.displayName="WizardPanel";te.displayName="WizardContent";re.displayName="WizardActions";I.displayName="WizardPrevious";H.displayName="WizardNext";export{_ as Wizard,re as WizardActions,te as WizardContent,H as WizardNext,ee as WizardPanel,I as WizardPrevious,$ as WizardSteps,S as useWizard};
|
package/dist/styles.css
CHANGED
|
@@ -455,9 +455,6 @@
|
|
|
455
455
|
.-top-3 {
|
|
456
456
|
top: calc(var(--spacing) * -3);
|
|
457
457
|
}
|
|
458
|
-
.-top-9 {
|
|
459
|
-
top: calc(var(--spacing) * -9);
|
|
460
|
-
}
|
|
461
458
|
.top-0 {
|
|
462
459
|
top: calc(var(--spacing) * 0);
|
|
463
460
|
}
|
|
@@ -551,9 +548,6 @@
|
|
|
551
548
|
.bottom-full {
|
|
552
549
|
bottom: 100%;
|
|
553
550
|
}
|
|
554
|
-
.-left-8 {
|
|
555
|
-
left: calc(var(--spacing) * -8);
|
|
556
|
-
}
|
|
557
551
|
.-left-\[5px\] {
|
|
558
552
|
left: calc(5px * -1);
|
|
559
553
|
}
|
|
@@ -611,9 +605,6 @@
|
|
|
611
605
|
.z-\[9999\] {
|
|
612
606
|
z-index: 9999;
|
|
613
607
|
}
|
|
614
|
-
.col-span-4 {
|
|
615
|
-
grid-column: span 4 / span 4;
|
|
616
|
-
}
|
|
617
608
|
.col-span-full {
|
|
618
609
|
grid-column: 1 / -1;
|
|
619
610
|
}
|
|
@@ -803,12 +794,18 @@
|
|
|
803
794
|
.mt-8 {
|
|
804
795
|
margin-top: calc(var(--spacing) * 8);
|
|
805
796
|
}
|
|
797
|
+
.mt-10 {
|
|
798
|
+
margin-top: calc(var(--spacing) * 10);
|
|
799
|
+
}
|
|
806
800
|
.mt-12 {
|
|
807
801
|
margin-top: calc(var(--spacing) * 12);
|
|
808
802
|
}
|
|
809
803
|
.mt-14 {
|
|
810
804
|
margin-top: calc(var(--spacing) * 14);
|
|
811
805
|
}
|
|
806
|
+
.mt-auto {
|
|
807
|
+
margin-top: auto;
|
|
808
|
+
}
|
|
812
809
|
.-mr-1 {
|
|
813
810
|
margin-right: calc(var(--spacing) * -1);
|
|
814
811
|
}
|
|
@@ -1032,9 +1029,21 @@
|
|
|
1032
1029
|
.h-\[200vh\] {
|
|
1033
1030
|
height: 200vh;
|
|
1034
1031
|
}
|
|
1032
|
+
.h-\[354px\] {
|
|
1033
|
+
height: 354px;
|
|
1034
|
+
}
|
|
1035
|
+
.h-\[386px\] {
|
|
1036
|
+
height: 386px;
|
|
1037
|
+
}
|
|
1035
1038
|
.h-\[400px\] {
|
|
1036
1039
|
height: 400px;
|
|
1037
1040
|
}
|
|
1041
|
+
.h-\[432px\] {
|
|
1042
|
+
height: 432px;
|
|
1043
|
+
}
|
|
1044
|
+
.h-\[456px\] {
|
|
1045
|
+
height: 456px;
|
|
1046
|
+
}
|
|
1038
1047
|
.h-\[560px\] {
|
|
1039
1048
|
height: 560px;
|
|
1040
1049
|
}
|
|
@@ -1125,9 +1134,6 @@
|
|
|
1125
1134
|
.w-3\.5 {
|
|
1126
1135
|
width: calc(var(--spacing) * 3.5);
|
|
1127
1136
|
}
|
|
1128
|
-
.w-3\/4 {
|
|
1129
|
-
width: calc(3/4 * 100%);
|
|
1130
|
-
}
|
|
1131
1137
|
.w-4 {
|
|
1132
1138
|
width: calc(var(--spacing) * 4);
|
|
1133
1139
|
}
|
|
@@ -2597,10 +2603,6 @@
|
|
|
2597
2603
|
.bg-\[repeating-linear-gradient\(45deg\,transparent\,transparent_10px\,rgba\(255\,255\,255\,0\.2\)_10px\,rgba\(255\,255\,255\,0\.2\)_20px\)\] {
|
|
2598
2604
|
background-image: repeating-linear-gradient(45deg,transparent,transparent 10px,rgba(255,255,255,0.2) 10px,rgba(255,255,255,0.2) 20px);
|
|
2599
2605
|
}
|
|
2600
|
-
.from-amber-500 {
|
|
2601
|
-
--tw-gradient-from: var(--color-amber-500);
|
|
2602
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2603
|
-
}
|
|
2604
2606
|
.from-blue-50 {
|
|
2605
2607
|
--tw-gradient-from: var(--color-blue-50);
|
|
2606
2608
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
@@ -2677,10 +2679,6 @@
|
|
|
2677
2679
|
--tw-gradient-from: var(--color-red-400);
|
|
2678
2680
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2679
2681
|
}
|
|
2680
|
-
.from-violet-500 {
|
|
2681
|
-
--tw-gradient-from: var(--color-violet-500);
|
|
2682
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2683
|
-
}
|
|
2684
2682
|
.from-white {
|
|
2685
2683
|
--tw-gradient-from: var(--color-white);
|
|
2686
2684
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
@@ -2707,10 +2705,6 @@
|
|
|
2707
2705
|
--tw-gradient-to: var(--color-blue-700);
|
|
2708
2706
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2709
2707
|
}
|
|
2710
|
-
.to-cyan-500 {
|
|
2711
|
-
--tw-gradient-to: var(--color-cyan-500);
|
|
2712
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2713
|
-
}
|
|
2714
2708
|
.to-cyan-700 {
|
|
2715
2709
|
--tw-gradient-to: var(--color-cyan-700);
|
|
2716
2710
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
@@ -2739,10 +2733,6 @@
|
|
|
2739
2733
|
--tw-gradient-to: var(--color-indigo-700);
|
|
2740
2734
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2741
2735
|
}
|
|
2742
|
-
.to-orange-500 {
|
|
2743
|
-
--tw-gradient-to: var(--color-orange-500);
|
|
2744
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
2745
|
-
}
|
|
2746
2736
|
.to-pink-100 {
|
|
2747
2737
|
--tw-gradient-to: var(--color-pink-100);
|
|
2748
2738
|
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
@@ -3290,6 +3280,9 @@
|
|
|
3290
3280
|
.text-amber-800 {
|
|
3291
3281
|
color: var(--color-amber-800);
|
|
3292
3282
|
}
|
|
3283
|
+
.text-amber-900 {
|
|
3284
|
+
color: var(--color-amber-900);
|
|
3285
|
+
}
|
|
3293
3286
|
.text-black {
|
|
3294
3287
|
color: var(--color-black);
|
|
3295
3288
|
}
|
|
@@ -3565,12 +3558,18 @@
|
|
|
3565
3558
|
.underline {
|
|
3566
3559
|
text-decoration-line: underline;
|
|
3567
3560
|
}
|
|
3561
|
+
.decoration-gray-300 {
|
|
3562
|
+
text-decoration-color: var(--color-gray-300);
|
|
3563
|
+
}
|
|
3568
3564
|
.decoration-dotted {
|
|
3569
3565
|
text-decoration-style: dotted;
|
|
3570
3566
|
}
|
|
3571
3567
|
.underline-offset-2 {
|
|
3572
3568
|
text-underline-offset: 2px;
|
|
3573
3569
|
}
|
|
3570
|
+
.underline-offset-4 {
|
|
3571
|
+
text-underline-offset: 4px;
|
|
3572
|
+
}
|
|
3574
3573
|
.antialiased {
|
|
3575
3574
|
-webkit-font-smoothing: antialiased;
|
|
3576
3575
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -4936,11 +4935,6 @@
|
|
|
4936
4935
|
grid-column: span 2 / span 2;
|
|
4937
4936
|
}
|
|
4938
4937
|
}
|
|
4939
|
-
.sm\:ml-8 {
|
|
4940
|
-
@media (width >= 40rem) {
|
|
4941
|
-
margin-left: calc(var(--spacing) * 8);
|
|
4942
|
-
}
|
|
4943
|
-
}
|
|
4944
4938
|
.sm\:block {
|
|
4945
4939
|
@media (width >= 40rem) {
|
|
4946
4940
|
display: block;
|
|
@@ -5152,17 +5146,16 @@
|
|
|
5152
5146
|
line-height: var(--tw-leading, var(--text-4xl--line-height));
|
|
5153
5147
|
}
|
|
5154
5148
|
}
|
|
5155
|
-
.lg\:text-6xl {
|
|
5156
|
-
@media (width >= 64rem) {
|
|
5157
|
-
font-size: var(--text-6xl);
|
|
5158
|
-
line-height: var(--tw-leading, var(--text-6xl--line-height));
|
|
5159
|
-
}
|
|
5160
|
-
}
|
|
5161
5149
|
.xl\:inline {
|
|
5162
5150
|
@media (width >= 80rem) {
|
|
5163
5151
|
display: inline;
|
|
5164
5152
|
}
|
|
5165
5153
|
}
|
|
5154
|
+
.xl\:flex-row {
|
|
5155
|
+
@media (width >= 80rem) {
|
|
5156
|
+
flex-direction: row;
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5166
5159
|
.xl\:gap-7 {
|
|
5167
5160
|
@media (width >= 80rem) {
|
|
5168
5161
|
gap: calc(var(--spacing) * 7);
|
|
@@ -5263,6 +5256,25 @@
|
|
|
5263
5256
|
}
|
|
5264
5257
|
}
|
|
5265
5258
|
}
|
|
5259
|
+
.dark\:border-amber-900\/60 {
|
|
5260
|
+
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
5261
|
+
border-color: color-mix(in srgb, oklch(41.4% 0.112 45.904) 60%, transparent);
|
|
5262
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
5263
|
+
border-color: color-mix(in oklab, var(--color-amber-900) 60%, transparent);
|
|
5264
|
+
}
|
|
5265
|
+
}
|
|
5266
|
+
@media (prefers-color-scheme: dark) {
|
|
5267
|
+
&:where(
|
|
5268
|
+
:root:not(.light):not([data-theme="light"]),
|
|
5269
|
+
:root:not(.light):not([data-theme="light"]) *
|
|
5270
|
+
) {
|
|
5271
|
+
border-color: color-mix(in srgb, oklch(41.4% 0.112 45.904) 60%, transparent);
|
|
5272
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
5273
|
+
border-color: color-mix(in oklab, var(--color-amber-900) 60%, transparent);
|
|
5274
|
+
}
|
|
5275
|
+
}
|
|
5276
|
+
}
|
|
5277
|
+
}
|
|
5266
5278
|
.dark\:border-blue-400 {
|
|
5267
5279
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
5268
5280
|
border-color: var(--color-blue-400);
|
|
@@ -5941,6 +5953,19 @@
|
|
|
5941
5953
|
}
|
|
5942
5954
|
}
|
|
5943
5955
|
}
|
|
5956
|
+
.dark\:bg-\[\#101828\] {
|
|
5957
|
+
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
5958
|
+
background-color: #101828;
|
|
5959
|
+
}
|
|
5960
|
+
@media (prefers-color-scheme: dark) {
|
|
5961
|
+
&:where(
|
|
5962
|
+
:root:not(.light):not([data-theme="light"]),
|
|
5963
|
+
:root:not(.light):not([data-theme="light"]) *
|
|
5964
|
+
) {
|
|
5965
|
+
background-color: #101828;
|
|
5966
|
+
}
|
|
5967
|
+
}
|
|
5968
|
+
}
|
|
5944
5969
|
.dark\:bg-amber-900\/20 {
|
|
5945
5970
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
5946
5971
|
background-color: color-mix(in srgb, oklch(41.4% 0.112 45.904) 20%, transparent);
|
|
@@ -6464,6 +6489,25 @@
|
|
|
6464
6489
|
}
|
|
6465
6490
|
}
|
|
6466
6491
|
}
|
|
6492
|
+
.dark\:bg-gray-900\/90 {
|
|
6493
|
+
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
6494
|
+
background-color: color-mix(in srgb, oklch(21% 0.034 264.665) 90%, transparent);
|
|
6495
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
6496
|
+
background-color: color-mix(in oklab, var(--color-gray-900) 90%, transparent);
|
|
6497
|
+
}
|
|
6498
|
+
}
|
|
6499
|
+
@media (prefers-color-scheme: dark) {
|
|
6500
|
+
&:where(
|
|
6501
|
+
:root:not(.light):not([data-theme="light"]),
|
|
6502
|
+
:root:not(.light):not([data-theme="light"]) *
|
|
6503
|
+
) {
|
|
6504
|
+
background-color: color-mix(in srgb, oklch(21% 0.034 264.665) 90%, transparent);
|
|
6505
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
6506
|
+
background-color: color-mix(in oklab, var(--color-gray-900) 90%, transparent);
|
|
6507
|
+
}
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6510
|
+
}
|
|
6467
6511
|
.dark\:bg-gray-900\/95 {
|
|
6468
6512
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
6469
6513
|
background-color: color-mix(in srgb, oklch(21% 0.034 264.665) 95%, transparent);
|
|
@@ -6986,25 +7030,6 @@
|
|
|
6986
7030
|
}
|
|
6987
7031
|
}
|
|
6988
7032
|
}
|
|
6989
|
-
.dark\:bg-violet-900\/50 {
|
|
6990
|
-
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
6991
|
-
background-color: color-mix(in srgb, oklch(38% 0.189 293.745) 50%, transparent);
|
|
6992
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
6993
|
-
background-color: color-mix(in oklab, var(--color-violet-900) 50%, transparent);
|
|
6994
|
-
}
|
|
6995
|
-
}
|
|
6996
|
-
@media (prefers-color-scheme: dark) {
|
|
6997
|
-
&:where(
|
|
6998
|
-
:root:not(.light):not([data-theme="light"]),
|
|
6999
|
-
:root:not(.light):not([data-theme="light"]) *
|
|
7000
|
-
) {
|
|
7001
|
-
background-color: color-mix(in srgb, oklch(38% 0.189 293.745) 50%, transparent);
|
|
7002
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
7003
|
-
background-color: color-mix(in oklab, var(--color-violet-900) 50%, transparent);
|
|
7004
|
-
}
|
|
7005
|
-
}
|
|
7006
|
-
}
|
|
7007
|
-
}
|
|
7008
7033
|
.dark\:bg-yellow-400 {
|
|
7009
7034
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
7010
7035
|
background-color: var(--color-yellow-400);
|
|
@@ -7626,6 +7651,19 @@
|
|
|
7626
7651
|
}
|
|
7627
7652
|
}
|
|
7628
7653
|
}
|
|
7654
|
+
.dark\:text-amber-200 {
|
|
7655
|
+
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
7656
|
+
color: var(--color-amber-200);
|
|
7657
|
+
}
|
|
7658
|
+
@media (prefers-color-scheme: dark) {
|
|
7659
|
+
&:where(
|
|
7660
|
+
:root:not(.light):not([data-theme="light"]),
|
|
7661
|
+
:root:not(.light):not([data-theme="light"]) *
|
|
7662
|
+
) {
|
|
7663
|
+
color: var(--color-amber-200);
|
|
7664
|
+
}
|
|
7665
|
+
}
|
|
7666
|
+
}
|
|
7629
7667
|
.dark\:text-amber-300 {
|
|
7630
7668
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
7631
7669
|
color: var(--color-amber-300);
|
|
@@ -7795,6 +7833,19 @@
|
|
|
7795
7833
|
}
|
|
7796
7834
|
}
|
|
7797
7835
|
}
|
|
7836
|
+
.dark\:text-gray-300\! {
|
|
7837
|
+
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
7838
|
+
color: var(--color-gray-300) !important;
|
|
7839
|
+
}
|
|
7840
|
+
@media (prefers-color-scheme: dark) {
|
|
7841
|
+
&:where(
|
|
7842
|
+
:root:not(.light):not([data-theme="light"]),
|
|
7843
|
+
:root:not(.light):not([data-theme="light"]) *
|
|
7844
|
+
) {
|
|
7845
|
+
color: var(--color-gray-300) !important;
|
|
7846
|
+
}
|
|
7847
|
+
}
|
|
7848
|
+
}
|
|
7798
7849
|
.dark\:text-gray-400 {
|
|
7799
7850
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
7800
7851
|
color: var(--color-gray-400);
|
|
@@ -8269,6 +8320,19 @@
|
|
|
8269
8320
|
}
|
|
8270
8321
|
}
|
|
8271
8322
|
}
|
|
8323
|
+
.dark\:decoration-gray-600 {
|
|
8324
|
+
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
8325
|
+
text-decoration-color: var(--color-gray-600);
|
|
8326
|
+
}
|
|
8327
|
+
@media (prefers-color-scheme: dark) {
|
|
8328
|
+
&:where(
|
|
8329
|
+
:root:not(.light):not([data-theme="light"]),
|
|
8330
|
+
:root:not(.light):not([data-theme="light"]) *
|
|
8331
|
+
) {
|
|
8332
|
+
text-decoration-color: var(--color-gray-600);
|
|
8333
|
+
}
|
|
8334
|
+
}
|
|
8335
|
+
}
|
|
8272
8336
|
.dark\:placeholder-gray-400 {
|
|
8273
8337
|
&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *) {
|
|
8274
8338
|
&::-moz-placeholder {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synertech/ui",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Synertech UI component library",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsup && node scripts/check-bundle-boundary.mjs && node scripts/check-css-classes.mjs && node scripts/check-ui-strings.mjs",
|
|
45
45
|
"dev": "tsup --watch",
|
|
46
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
46
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p docs-site/snippets/tsconfig.json --noEmit",
|
|
47
47
|
"lint": "eslint src/",
|
|
48
48
|
"lint:fix": "eslint src/ --fix",
|
|
49
49
|
"format": "prettier --write src/",
|