anicca-ui 1.0.0 → 1.1.0
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/anicca-ui.css +1 -1
- package/dist/anicca-ui.es.js +2637 -603
- package/dist/anicca-ui.umd.js +30 -1
- package/dist/auth/AuthModal/AuthModal.d.ts +92 -0
- package/dist/auth/AuthModal/index.d.ts +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/dashboard/components/ActivityFeed/ActivityFeed.d.ts +1 -10
- package/dist/dashboard/components/Breadcrumb/Breadcrumb.d.ts +1 -9
- package/dist/dashboard/components/ChartWrapper/ChartWrapper.d.ts +1 -15
- package/dist/dashboard/components/DataTable/DataTable.d.ts +3 -10
- package/dist/dashboard/components/Modal/Modal.d.ts +1 -9
- package/dist/dashboard/components/Navbar/Navbar.d.ts +1 -9
- package/dist/dashboard/components/ProgressCard/ProgressCard.d.ts +1 -14
- package/dist/dashboard/components/Sidebar/Sidebar.d.ts +2 -11
- package/dist/dashboard/components/StatCard/StatCard.d.ts +2 -12
- package/dist/dashboard/components/Tabs/Tabs.d.ts +1 -2
- package/dist/data/Avatar/Avatar.d.ts +31 -0
- package/dist/data/Avatar/index.d.ts +1 -0
- package/dist/data/Badge/Badge.d.ts +16 -0
- package/dist/data/Badge/index.d.ts +1 -0
- package/dist/data/Pagination/Pagination.d.ts +27 -0
- package/dist/data/Pagination/index.d.ts +1 -0
- package/dist/data/Skeleton/Skeleton.d.ts +18 -0
- package/dist/data/Skeleton/index.d.ts +1 -0
- package/dist/data/Spinner/Spinner.d.ts +16 -0
- package/dist/data/Spinner/index.d.ts +1 -0
- package/dist/data/index.d.ts +5 -0
- package/dist/demo/App.d.ts +1 -0
- package/dist/demo/data.d.ts +153 -0
- package/dist/demo/nav.d.ts +5 -0
- package/dist/demo/pages/AdminPage.d.ts +1 -0
- package/dist/demo/pages/DashboardPage.d.ts +1 -0
- package/dist/demo/pages/FormElementPage.d.ts +1 -0
- package/dist/demo/pages/FormValidationPage.d.ts +1 -0
- package/dist/demo/pages/FormWizardPage.d.ts +1 -0
- package/dist/demo/pages/Placeholder.d.ts +4 -0
- package/dist/demo/pages/ProfilePage.d.ts +1 -0
- package/dist/demo/pages/RtlPage.d.ts +1 -0
- package/dist/demo/pages/Settings2Page.d.ts +1 -0
- package/dist/demo/pages/SettingsPage.d.ts +1 -0
- package/dist/demo/pages/TableBasicPage.d.ts +1 -0
- package/dist/demo/pages/TableDataPage.d.ts +1 -0
- package/dist/demo/pages/auth.d.ts +5 -0
- package/dist/demo/pages/dashLayouts.d.ts +10 -0
- package/dist/demo/pages/errors.d.ts +3 -0
- package/dist/demo/pages/extra.d.ts +2 -0
- package/dist/demo/pages/icons.d.ts +3 -0
- package/dist/demo/pages/landing.d.ts +9 -0
- package/dist/demo/pages/maps.d.ts +3 -0
- package/dist/demo/pages/parts.d.ts +45 -0
- package/dist/demo/pages/plugins.d.ts +6 -0
- package/dist/demo/pages/special.d.ts +5 -0
- package/dist/demo/pages/users.d.ts +5 -0
- package/dist/demo/pages/widgets.d.ts +3 -0
- package/dist/demo/theme-init.d.ts +0 -0
- package/dist/demo/theme.d.ts +33 -0
- package/dist/demo/ui/AuthLayout.d.ts +9 -0
- package/dist/demo/ui/HeaderMenus.d.ts +2 -0
- package/dist/demo/ui/LandingLayout.d.ts +7 -0
- package/dist/demo/ui/Modal.d.ts +20 -0
- package/dist/demo/ui/Toast.d.ts +8 -0
- package/dist/demo/ui/UserMenu.d.ts +9 -0
- package/dist/demo/ui/charts.d.ts +29 -0
- package/dist/demo/ui/form.d.ts +54 -0
- package/dist/demo/ui/primitives.d.ts +32 -0
- package/dist/demo.d.ts +1 -0
- package/dist/feedback/Alert/Alert.d.ts +21 -0
- package/dist/feedback/Alert/index.d.ts +1 -0
- package/dist/feedback/Popover/Popover.d.ts +22 -0
- package/dist/feedback/Popover/index.d.ts +1 -0
- package/dist/feedback/Popup/Popup.d.ts +40 -0
- package/dist/feedback/Popup/index.d.ts +1 -0
- package/dist/feedback/Toast/Toast.d.ts +46 -0
- package/dist/feedback/Toast/index.d.ts +1 -0
- package/dist/feedback/Tooltip/Tooltip.d.ts +20 -0
- package/dist/feedback/Tooltip/index.d.ts +1 -0
- package/dist/feedback/index.d.ts +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/layout/Card/Card.d.ts +21 -0
- package/dist/layout/Card/index.d.ts +1 -0
- package/dist/layout/Divider/Divider.d.ts +15 -0
- package/dist/layout/Divider/index.d.ts +1 -0
- package/dist/layout/Grid/Grid.d.ts +23 -0
- package/dist/layout/Grid/index.d.ts +1 -0
- package/dist/layout/Stack/Stack.d.ts +22 -0
- package/dist/layout/Stack/index.d.ts +1 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/overlay/Combobox/Combobox.d.ts +39 -0
- package/dist/overlay/Combobox/index.d.ts +1 -0
- package/dist/overlay/Drawer/Drawer.d.ts +26 -0
- package/dist/overlay/Drawer/index.d.ts +1 -0
- package/dist/overlay/Dropdown/Dropdown.d.ts +20 -0
- package/dist/overlay/Dropdown/index.d.ts +1 -0
- package/dist/overlay/Menu/Menu.d.ts +22 -0
- package/dist/overlay/Menu/index.d.ts +1 -0
- package/dist/overlay/index.d.ts +4 -0
- package/dist/primitives/Button/Button.d.ts +20 -0
- package/dist/primitives/Button/index.d.ts +1 -0
- package/dist/primitives/Checkbox/Checkbox.d.ts +14 -0
- package/dist/primitives/Checkbox/index.d.ts +1 -0
- package/dist/primitives/Input/Input.d.ts +24 -0
- package/dist/primitives/Input/index.d.ts +1 -0
- package/dist/primitives/Radio/Radio.d.ts +29 -0
- package/dist/primitives/Radio/index.d.ts +1 -0
- package/dist/primitives/Select/Select.d.ts +23 -0
- package/dist/primitives/Select/index.d.ts +1 -0
- package/dist/primitives/Switch/Switch.d.ts +15 -0
- package/dist/primitives/Switch/index.d.ts +1 -0
- package/dist/primitives/Textarea/Textarea.d.ts +18 -0
- package/dist/primitives/Textarea/index.d.ts +1 -0
- package/dist/primitives/index.d.ts +7 -0
- package/dist/theme/AniccaThemeProvider.d.ts +2 -1
- package/dist/theme/types.d.ts +29 -30
- package/package.json +3 -6
package/dist/anicca-ui.umd.js
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
(function(c,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],r):(c=typeof globalThis<"u"?globalThis:c||self,r(c.AniccaUI={},c.jsxRuntime,c.React))})(this,function(c,r,b){"use strict";const F={primary:"--anicca-primary",primaryFg:"--anicca-primary-fg",primarySoft:"--anicca-primary-soft",success:"--anicca-success",successBg:"--anicca-success-bg",danger:"--anicca-danger",dangerBg:"--anicca-danger-bg",warning:"--anicca-warning",warningBg:"--anicca-warning-bg",info:"--anicca-info",infoBg:"--anicca-info-bg",surface:"--anicca-surface",surfaceMuted:"--anicca-surface-muted",surfaceOverlay:"--anicca-surface-overlay",surfaceDark:"--anicca-surface-dark",surfaceDark2:"--anicca-surface-dark-2",surfaceDarkFg:"--anicca-surface-dark-fg",surfaceDarkFgMuted:"--anicca-surface-dark-fg-muted",border:"--anicca-border",borderStrong:"--anicca-border-strong",borderDark:"--anicca-border-dark",text:"--anicca-text",textMuted:"--anicca-text-muted",textSubtle:"--anicca-text-subtle",radius:"--anicca-radius",radiusSm:"--anicca-radius-sm",radiusLg:"--anicca-radius-lg",shadowSm:"--anicca-shadow-sm",shadowMd:"--anicca-shadow-md",shadowLg:"--anicca-shadow-lg"};function Z(a){if(!a)return{};const e={};for(const t of Object.keys(a)){const n=a[t];n!==void 0&&(e[F[t]]=n)}return e}function R({theme:a,as:e="div",className:t,children:n}){const s=b.useMemo(()=>Z(a),[a]),o=e;return r.jsx(o,{style:s,className:t,"data-anicca-theme":"",children:n})}function ee({title:a,value:e,icon:t,trend:n,trendLabel:s,color:o,className:i=""}){const p=n!==void 0?n>0?"up":n<0?"down":"neutral":null,l={up:"text-a-success bg-a-success-bg",down:"text-a-danger bg-a-danger-bg",neutral:"text-a-text-muted bg-a-surface-muted"};return r.jsxs("div",{className:`relative bg-gradient-to-br from-a-surface to-a-surface-muted rounded-a p-6 border-l-4 shadow-a-sm transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] overflow-hidden hover:shadow-a-md hover:-translate-y-1 group ${i}`,style:{borderLeftColor:o??"var(--anicca-primary)"},role:"group","aria-label":`${a}: ${e}`,children:[r.jsxs("div",{className:"flex justify-between items-start mb-3",children:[r.jsx("span",{className:"text-xs text-a-text-muted font-semibold uppercase tracking-[0.06em]",children:a}),t&&r.jsx("span",{className:"text-2xl text-a-text-subtle opacity-80 transition-transform duration-300 ease-in-out group-hover:scale-110",children:t})]}),r.jsx("div",{className:"text-[2rem] font-extrabold text-a-text mb-3 tracking-tight leading-[1.1]",children:e}),n!==void 0&&r.jsxs("div",{className:`inline-flex items-center gap-[0.35rem] text-[0.8rem] font-semibold py-1 px-[0.6rem] rounded-[20px] ${l[p||"neutral"]}`,children:[r.jsx("span",{className:"text-[0.7rem]",children:p==="up"?"↑":p==="down"?"↓":"→"}),r.jsxs("span",{className:"font-bold",children:[Math.abs(n),"%"]}),s&&r.jsx("span",{className:"text-a-text-subtle font-normal ml-2 text-xs",children:s})]})]})}const re={loading:"Loading chart"};function ae({title:a,subtitle:e,children:t,loading:n=!1,empty:s=!1,emptyMessage:o="No data available",height:i=300,labels:p,className:l=""}){const h=typeof i=="number"?`${i}px`:i,d={...re,...p};return r.jsxs("div",{className:`bg-gradient-to-br from-a-surface to-a-surface-muted rounded-a p-7 shadow-a-sm border border-a-border ${l}`,children:[r.jsxs("div",{className:"mb-5",children:[r.jsx("div",{className:"text-[1.05rem] font-bold text-a-text tracking-[-0.01em]",children:a}),e&&r.jsx("div",{className:"text-[0.8rem] text-a-text-muted mt-[0.3rem] font-normal",children:e})]}),r.jsx("div",{className:"relative w-full rounded-xl overflow-hidden",style:{height:h},children:n?r.jsx("div",{className:"w-full rounded-xl anicca-shimmer",style:{height:h},"aria-label":d.loading}):s?r.jsxs("div",{className:"flex flex-col items-center justify-center text-a-text-subtle gap-4 anicca-empty-bg rounded-xl border-2 border-dashed border-a-border",style:{height:h},children:[r.jsxs("svg",{className:"w-14 h-14 opacity-40 stroke-[1.2]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[r.jsx("path",{d:"M3 3v18h18",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M7 16l4-4 4 4 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]}),r.jsx("span",{className:"text-[0.9rem] text-a-text-muted font-medium",children:o})]}):t})]})}const te={expand:"Expand sidebar",collapse:"Collapse sidebar",navigation:"Sidebar navigation"};function ne({items:a,collapsed:e=!1,onCollapse:t,logo:n,footer:s,activePath:o="",labels:i,className:p=""}){const[l,h]=b.useState({}),d={...te,...i},m=N=>{h(M=>({...M,[N]:!M[N]}))},g=()=>{t==null||t(!e)},u="flex items-center gap-3 py-[0.65rem] px-4 text-a-surface-dark-fg-muted no-underline text-sm font-medium cursor-pointer transition-all duration-200 ease-in-out border-none bg-transparent w-full text-left rounded-[10px] mb-[2px] hover:bg-a-surface-dark-2/60 hover:text-a-surface-dark-fg group/item",y="bg-a-primary-soft text-a-primary hover:bg-a-primary-soft hover:text-a-primary",$=N=>{const M=o===N.href,C=N.children&&N.children.length>0,x=l[N.href];return r.jsxs("div",{children:[C?r.jsxs("button",{className:`${u} ${M?y:""}`,onClick:()=>m(N.href),"aria-expanded":x,children:[N.icon&&r.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center text-[1.1rem] transition-transform duration-200 ease-in-out group-hover/item:scale-110",children:N.icon}),r.jsx("span",{className:`whitespace-nowrap overflow-hidden text-ellipsis transition-opacity duration-200 ease-in-out ${e?"hidden":""}`,children:N.label}),!e&&r.jsx("span",{className:`ml-auto transition-transform duration-[250ms] ease-[cubic-bezier(0.4,0,0.2,1)] text-[0.65rem] opacity-60 ${x?"rotate-90 opacity-100":""}`,children:"▶"})]}):r.jsxs("a",{href:N.href,className:`${u} ${M?y:""}`,"aria-current":M?"page":void 0,children:[N.icon&&r.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center text-[1.1rem] transition-transform duration-200 ease-in-out group-hover/item:scale-110",children:N.icon}),r.jsx("span",{className:`whitespace-nowrap overflow-hidden text-ellipsis transition-opacity duration-200 ease-in-out ${e?"hidden":""}`,children:N.label})]}),C&&!e&&r.jsx("div",{className:`pl-2 overflow-hidden transition-[max-height] duration-[350ms] ease-[cubic-bezier(0.4,0,0.2,1)] ${x?"max-h-[500px]":"max-h-0"}`,children:N.children.map(A=>r.jsxs("a",{href:A.href,className:`${u} pl-11 text-[0.82rem] ${o===A.href?y:""}`,"aria-current":o===A.href?"page":void 0,children:[A.icon&&r.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center text-[1.1rem]",children:A.icon}),r.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis",children:A.label})]},A.href))})]},N.href)};return r.jsxs("aside",{className:`flex flex-col h-screen sticky top-0 bg-gradient-to-b from-a-surface-dark to-a-surface-dark-2 text-a-surface-dark-fg transition-[width] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] overflow-hidden border-r border-a-border-dark shrink-0 ${e?"w-[72px]":"w-[260px]"} ${p}`,role:"navigation","aria-label":d.navigation,children:[n&&r.jsx("div",{className:"flex items-center justify-center py-6 px-5 border-b border-a-border-dark min-h-[72px]",children:n}),r.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2 min-h-0",children:a.map($)}),r.jsxs("div",{className:"p-4 border-t border-a-border-dark",children:[s&&!e&&s,r.jsx("button",{className:"flex items-center justify-center w-full py-[0.6rem] bg-a-surface-dark-2/60 border border-a-border-dark rounded-lg text-a-surface-dark-fg-muted cursor-pointer text-[0.9rem] transition-all duration-200 ease-in-out hover:bg-a-surface-dark-2 hover:text-a-surface-dark-fg",onClick:g,"aria-label":e?d.expand:d.collapse,children:e?"→":"←"})]})]})}const se={toggleMenu:"Toggle menu"};function ce({title:a,logo:e,actions:t,user:n,onMenuToggle:s,labels:o,className:i=""}){const p={...se,...o},l=h=>h.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return r.jsxs("header",{className:`flex items-center justify-between px-7 h-[68px] bg-a-surface/90 backdrop-blur-[12px] border-b border-a-border shadow-a-sm sticky top-0 z-[100] ${i}`,role:"banner",children:[r.jsxs("div",{className:"flex items-center gap-[0.85rem]",children:[s&&r.jsx("button",{className:"flex items-center justify-center w-[38px] h-[38px] border border-a-border bg-a-surface-muted rounded-[10px] cursor-pointer text-a-text-muted text-[1.2rem] transition-all duration-200 ease-in-out hover:bg-a-border hover:text-a-text",onClick:s,"aria-label":p.toggleMenu,children:"☰"}),e&&r.jsx("div",{className:"flex items-center",children:e}),a&&r.jsx("span",{className:"text-[1.1rem] font-bold text-a-text tracking-[-0.01em]",children:a})]}),r.jsxs("div",{className:"flex items-center gap-5",children:[t&&r.jsx("div",{className:"flex items-center gap-2",children:t}),n&&r.jsxs("div",{className:"flex items-center gap-3 py-[0.4rem] pr-[0.6rem] pl-[0.4rem] rounded-xl transition-colors duration-200 ease-in-out hover:bg-a-surface-muted",children:[r.jsx("div",{className:"w-[38px] h-[38px] rounded-[10px] text-a-primary-fg flex items-center justify-center text-[0.8rem] font-bold overflow-hidden",style:{background:"var(--anicca-primary)"},children:n.avatar?r.jsx("img",{src:n.avatar,alt:n.name,className:"w-full h-full object-cover"}):l(n.name)}),r.jsxs("div",{className:"flex flex-col",children:[r.jsx("span",{className:"text-[0.85rem] font-semibold text-a-text",children:n.name}),n.role&&r.jsx("span",{className:"text-[0.7rem] text-a-text-muted font-normal",children:n.role})]})]})]})]})}function oe({items:a,separator:e="/",ariaLabel:t="Breadcrumb",className:n=""}){return r.jsx("nav",{className:`py-[0.6rem] ${n}`,"aria-label":t,children:r.jsx("ol",{className:"flex items-center list-none m-0 p-0 flex-wrap",children:a.map((s,o)=>{const i=o===a.length-1;return r.jsx("li",{className:"flex items-center",children:i?r.jsxs("span",{className:"inline-flex items-center gap-[0.35rem] text-a-text text-[0.82rem] font-bold py-[0.3rem] px-[0.7rem] bg-a-surface-muted rounded-md",children:[s.icon&&r.jsx("span",{className:"flex items-center text-[0.85rem]",children:s.icon}),s.label]}):r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:s.href||"#",className:"inline-flex items-center gap-[0.35rem] text-a-text-muted no-underline text-[0.82rem] font-medium py-[0.3rem] px-[0.6rem] rounded-md transition-all duration-200 ease-in-out hover:text-a-primary hover:bg-a-primary-soft",children:[s.icon&&r.jsx("span",{className:"flex items-center text-[0.85rem]",children:s.icon}),s.label]}),r.jsx("span",{className:"mx-1 text-a-text-subtle text-xs select-none","aria-hidden":"true",children:e})]})},`${s.label}-${o}`)})})})}const ie={searchPlaceholder:"Search...",results:"results",emptyMessage:"No data found",page:"Page",of:"of",previous:"← Prev",next:"Next →"};function le({data:a,columns:e,searchable:t=!0,pageSize:n=5,className:s="",labels:o}){const[i,p]=b.useState(""),[l,h]=b.useState(null),[d,m]=b.useState(!0),[g,u]=b.useState(0),y={...ie,...o},$=b.useMemo(()=>{let x=a;if(i){const A=i.toLowerCase();x=x.filter(f=>e.some(w=>String(f[w.key]??"").toLowerCase().includes(A)))}return l&&(x=[...x].sort((A,f)=>{const w=String(A[l]??""),v=String(f[l]??""),k=w.localeCompare(v,void 0,{numeric:!0});return d?k:-k})),x},[a,i,l,d,e]),N=n>0?Math.ceil($.length/n):1,M=n>0?$.slice(g*n,(g+1)*n):$,C=x=>{l===x?m(!d):(h(x),m(!0))};return r.jsxs("div",{className:`bg-a-surface rounded-a shadow-a-sm border border-a-border overflow-hidden ${s}`,children:[t&&r.jsxs("div",{className:"flex items-center justify-between py-5 px-6 border-b border-a-border",children:[r.jsxs("div",{className:"flex items-center gap-2 bg-a-surface-muted border-[1.5px] border-a-border rounded-[10px] py-2 px-[0.85rem] transition-colors focus-within:border-a-primary focus-within:shadow-[0_0_0_3px_var(--anicca-primary-soft)]",children:[r.jsx("span",{className:"text-[0.85rem] opacity-50",children:"🔍"}),r.jsx("input",{className:"border-none bg-transparent outline-none text-[0.85rem] font-[inherit] text-a-text w-[200px] placeholder:text-a-text-subtle",value:i,onChange:x=>{p(x.target.value),u(0)},placeholder:y.searchPlaceholder})]}),r.jsxs("span",{className:"text-xs text-a-text-subtle font-medium",children:[$.length," ",y.results]})]}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full border-collapse border-spacing-0",children:[r.jsx("thead",{children:r.jsx("tr",{children:e.map(x=>r.jsxs("th",{className:`text-left py-3 px-5 text-[0.7rem] font-semibold text-a-text-muted uppercase tracking-[0.05em] bg-a-surface-muted whitespace-nowrap ${x.sortable?"cursor-pointer select-none transition-colors duration-150 hover:text-a-text":""}`,style:x.width?{width:x.width}:void 0,onClick:x.sortable?()=>C(x.key):void 0,children:[x.label,x.sortable&&l===x.key&&r.jsx("span",{className:"text-[0.7rem]",children:d?" ↑":" ↓"})]},x.key))})}),r.jsx("tbody",{children:M.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:e.length,className:"py-12 px-6 text-center text-a-text-subtle text-[0.9rem]",children:y.emptyMessage})}):M.map((x,A)=>r.jsx("tr",{className:"transition-colors duration-150 hover:[&>td]:bg-a-surface-muted",children:e.map(f=>r.jsx("td",{className:"py-[0.85rem] px-5 text-[0.85rem] border-b border-a-border align-middle last:border-b-0 text-a-text",children:f.render?f.render(x[f.key],x):String(x[f.key]??"")},f.key))},A))})]})}),n>0&&N>1&&r.jsxs("div",{className:"flex items-center justify-center gap-4 py-4 px-6 border-t border-a-border",children:[r.jsx("button",{className:"py-[0.4rem] px-[0.85rem] border-[1.5px] border-a-border rounded-lg bg-a-surface text-[0.78rem] font-medium text-a-text-muted cursor-pointer transition-all duration-150 font-[inherit] hover:enabled:border-a-primary hover:enabled:text-a-primary disabled:opacity-40 disabled:cursor-not-allowed",disabled:g===0,onClick:()=>u(g-1),children:y.previous}),r.jsxs("span",{className:"text-[0.78rem] text-a-text-muted font-medium",children:[y.page," ",g+1," ",y.of," ",N]}),r.jsx("button",{className:"py-[0.4rem] px-[0.85rem] border-[1.5px] border-a-border rounded-lg bg-a-surface text-[0.78rem] font-medium text-a-text-muted cursor-pointer transition-all duration-150 font-[inherit] hover:enabled:border-a-primary hover:enabled:text-a-primary disabled:opacity-40 disabled:cursor-not-allowed",disabled:g>=N-1,onClick:()=>u(g+1),children:y.next})]})]})}function de({items:a,title:e,badge:t,className:n=""}){const s=e&&e.length>0||t;return r.jsxs("div",{className:`bg-a-surface rounded-a p-6 shadow-a-sm border border-a-border ${n}`,children:[s&&r.jsxs("div",{className:"flex justify-between items-center mb-5",children:[e?r.jsx("span",{className:"text-[0.95rem] font-bold text-a-text",children:e}):r.jsx("span",{}),t&&r.jsx("span",{children:t})]}),r.jsx("div",{className:"flex flex-col",children:a.map((o,i)=>r.jsxs("div",{className:"flex gap-[0.85rem] py-[0.85rem] relative",children:[i<a.length-1&&r.jsx("div",{className:"absolute left-[18px] top-[48px] bottom-0 w-[1.5px] bg-gradient-to-b from-a-border to-transparent"}),r.jsx("div",{className:"w-9 h-9 rounded-[10px] flex items-center justify-center text-[0.95rem] shrink-0 relative z-[1]",style:{background:o.iconBg||"var(--anicca-surface-muted)"},children:o.icon}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-[0.82rem] text-a-text leading-relaxed",children:o.message}),r.jsx("div",{className:"text-[0.7rem] text-a-text-subtle mt-[0.2rem]",children:o.time})]})]},i))})]})}const ue={unit:"projects"};function fe({items:a,title:e,showCount:t=!0,labels:n,className:s=""}){const o={...ue,...n};return r.jsxs("div",{className:`bg-a-surface rounded-a p-6 shadow-a-sm border border-a-border ${s}`,children:[e&&r.jsxs("div",{className:"flex justify-between items-center mb-5",children:[r.jsx("span",{className:"text-[0.95rem] font-bold text-a-text",children:e}),t&&r.jsxs("span",{className:"text-[0.68rem] py-[0.2rem] px-[0.55rem] rounded-[20px] font-semibold bg-a-info-bg text-a-info",children:[a.length," ",o.unit]})]}),a.map((i,p)=>{const l=i.color||"var(--anicca-primary)";return r.jsxs("div",{className:`py-[0.85rem] border-b border-a-border last:border-b-0 last:pb-0 ${p===0&&!e?"pt-0":""}`,children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("span",{className:"text-[0.85rem] font-semibold text-a-text",children:i.name}),r.jsxs("span",{className:"text-xs font-bold",style:{color:l},children:[i.progress,"%"]})]}),r.jsx("div",{className:"h-[7px] bg-a-surface-muted rounded overflow-hidden",children:r.jsx("div",{className:"h-full rounded transition-[width] duration-500 ease-in-out",style:{width:`${i.progress}%`,background:l}})}),(i.status||i.team)&&r.jsxs("div",{className:"flex justify-between items-center mt-[0.4rem]",children:[i.status&&r.jsx("span",{className:"text-[0.7rem] text-a-text-subtle",children:i.status}),i.team&&r.jsx("div",{className:"flex",children:i.team.map((h,d)=>{const m=typeof h=="string"?h:h.color,g=typeof h=="string"?String.fromCharCode(65+d):h.label??String.fromCharCode(65+d);return r.jsx("div",{className:"w-[22px] h-[22px] rounded-full border-2 border-a-surface -ml-[6px] first:ml-0 flex items-center justify-center text-[0.55rem] font-bold text-a-primary-fg",style:{background:m},children:g},d)})})]})]},i.name)})]})}const be={close:"Close"};function me({open:a,onClose:e,title:t,children:n,footer:s,disableEscapeKey:o=!1,disableBackdropClick:i=!1,labels:p,className:l=""}){const h={...be,...p};return b.useEffect(()=>{if(!a||o)return;const d=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a,e,o]),b.useEffect(()=>{if(a)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[a]),a?r.jsx("div",{className:"fixed inset-0 backdrop-blur-[4px] flex items-center justify-center z-[1000] anicca-fade-in p-4",style:{background:"var(--anicca-surface-overlay)"},onClick:i?void 0:e,role:"dialog","aria-modal":"true","aria-label":t,children:r.jsxs("div",{className:`bg-a-surface rounded-a shadow-a-lg w-full max-w-[480px] max-h-[90vh] overflow-y-auto anicca-slide-up ${l}`,onClick:d=>d.stopPropagation(),children:[t&&r.jsxs("div",{className:"flex items-center justify-between py-5 px-6 border-b border-a-border",children:[r.jsx("span",{className:"text-base font-bold text-a-text",children:t}),r.jsx("button",{className:"w-8 h-8 rounded-lg border-none bg-a-surface-muted text-a-text-muted text-[1.1rem] cursor-pointer flex items-center justify-center transition-all duration-150 hover:bg-a-border hover:text-a-text",onClick:e,"aria-label":h.close,children:"×"})]}),r.jsx("div",{className:"p-6 text-a-text",children:n}),s&&r.jsx("div",{className:"flex justify-end gap-3 py-4 px-6 border-t border-a-border",children:s})]})}):null}function he({tabs:a,defaultTab:e,activeKey:t,onChange:n,className:s=""}){var d;const[o,i]=b.useState(e||((d=a[0])==null?void 0:d.key)||""),p=t??o,l=a.find(m=>m.key===p),h=m=>{t===void 0&&i(m),n==null||n(m)};return r.jsxs("div",{className:`bg-a-surface rounded-a shadow-a-sm border border-a-border overflow-hidden ${s}`,children:[r.jsx("div",{className:"flex pt-2 px-6 border-b border-a-border",role:"tablist",children:a.map(m=>r.jsxs("button",{className:`py-[0.7rem] px-[1.1rem] text-[0.82rem] font-medium cursor-pointer border-none bg-transparent border-b-2 transition-all duration-200 flex items-center gap-[0.4rem] font-[inherit] -mb-px ${p===m.key?"text-a-primary border-b-a-primary font-semibold":"text-a-text-muted border-b-transparent hover:text-a-text"}`,onClick:()=>h(m.key),role:"tab","aria-selected":p===m.key,children:[m.icon&&r.jsx("span",{className:"text-[0.9rem]",children:m.icon}),m.label]},m.key))}),r.jsx("div",{className:"p-6 text-a-text",role:"tabpanel",children:l==null?void 0:l.content})]})}function pe(a="This field is required"){return{validate:e=>e==null?!1:typeof e=="string"?e.trim().length>0:Array.isArray(e)?e.length>0:!0,message:a}}function xe(a="Invalid email address"){return{validate:e=>typeof e!="string"?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),message:a}}function ge(a,e){return{validate:t=>typeof t!="string"?!1:t.length>=a,message:e||`Must be at least ${a} characters`}}function ye(a,e){return{validate:t=>typeof t!="string"?!1:t.length<=a,message:e||`Must be at most ${a} characters`}}function ve(a,e="Invalid format"){return{validate:t=>typeof t!="string"?!1:a.test(t),message:e}}function Ne(a,e){return{validate:t=>typeof t!="number"?!1:t>=a,message:e||`Must be at least ${a}`}}function we(a,e){return{validate:t=>typeof t!="number"?!1:t<=a,message:e||`Must be at most ${a}`}}function ke(a,e){return{validate:a,message:e}}function Ae(a){const{initialValues:e,validationSchema:t,onSubmit:n}=a,[s,o]=b.useState(e),[i,p]=b.useState({}),[l,h]=b.useState({}),[d,m]=b.useState(!1),g=b.useCallback((f,w)=>{const v=t==null?void 0:t[f];if(v){for(const k of v)if(!k.validate(w))return k.message}},[t]),u=b.useCallback(()=>{const f={};for(const w of Object.keys(e)){const v=g(w,s[w]);v&&(f[w]=v)}return f},[e,g,s]),y=Object.keys(i).length===0,$=b.useCallback(f=>w=>{const v=w.target.value;if(o(k=>({...k,[f]:v})),l[f]){const k=g(f,v);p(T=>{const L={...T};return k?L[f]=k:delete L[f],L})}},[l,g]),N=b.useCallback(f=>()=>{h(v=>({...v,[f]:!0}));const w=g(f,s[f]);p(v=>{const k={...v};return w?k[f]=w:delete k[f],k})},[g,s]),M=b.useCallback(async f=>{f&&f.preventDefault();const w={};for(const k of Object.keys(e))w[k]=!0;h(w);const v=u();if(p(v),Object.keys(v).length===0&&n){m(!0);try{await n(s)}finally{m(!1)}}},[e,n,u,s]),C=b.useCallback(()=>{o(e),p({}),h({}),m(!1)},[e]),x=b.useCallback((f,w)=>{if(o(v=>({...v,[f]:w})),l[f]){const v=g(f,w);p(k=>{const T={...k};return v?T[f]=v:delete T[f],T})}},[l,g]),A=b.useCallback((f,w)=>{p(v=>({...v,[f]:w}))},[]);return{values:s,errors:i,touched:l,isValid:y,isSubmitting:d,handleChange:$,handleBlur:N,handleSubmit:M,reset:C,setFieldValue:x,setFieldError:A}}const Se=["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],Me=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$e=["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],Ce=["January","February","March","April","May","June","July","August","September","October","November","December"];function S(a){return typeof a=="string"?new Date(a):new Date(a.getTime())}function D(a){return a.toString().padStart(2,"0")}function E(a,e,t="en"){const n=S(a),s=t==="id"?Se:Me,o=t==="id"?$e:Ce;return e.replace("YYYY",n.getFullYear().toString()).replace("MM",D(n.getMonth()+1)).replace("DD",D(n.getDate())).replace("HH",D(n.getHours())).replace("mm",D(n.getMinutes())).replace("ss",D(n.getSeconds())).replace("dddd",s[n.getDay()]).replace("MMMM",o[n.getMonth()])}function B(a,e,t){const n=S(a),s=S(e);if(t==="years")return Math.abs(n.getFullYear()-s.getFullYear());if(t==="months")return Math.abs((n.getFullYear()-s.getFullYear())*12+(n.getMonth()-s.getMonth()));const o=Math.abs(n.getTime()-s.getTime());return Math.floor(o/{seconds:1e3,minutes:6e4,hours:36e5,days:864e5}[t])}function O(a,e="en"){const t=S(a),s=new Date().getTime()-t.getTime(),o=s<0,i=Math.abs(s),p=Math.floor(i/1e3),l=Math.floor(i/6e4),h=Math.floor(i/36e5),d=Math.floor(i/864e5),m=Math.floor(d/7),g=Math.floor(d/30),u=Math.floor(d/365);if(e==="id"){const y=o?"lagi":"lalu";return p<60?"baru saja":l<60?`${l} menit ${y}`:h<24?`${h} jam ${y}`:d<7?`${d} hari ${y}`:m<4?`${m} minggu ${y}`:g<12?`${g} bulan ${y}`:`${u} tahun ${y}`}return p<60?"just now":o?l<60?`in ${l} minutes`:h<24?`in ${h} hours`:d<7?`in ${d} days`:m<4?`in ${m} weeks`:g<12?`in ${g} months`:`in ${u} years`:l<60?`${l} minutes ago`:h<24?`${h} hours ago`:d<7?`${d} days ago`:m<4?`${m} weeks ago`:g<12?`${g} months ago`:`${u} years ago`}function _(a,e){const t=S(a);switch(e){case"day":return t.setHours(0,0,0,0),t;case"week":{const n=t.getDay();return t.setDate(t.getDate()-n),t.setHours(0,0,0,0),t}case"month":return t.setDate(1),t.setHours(0,0,0,0),t;case"year":return t.setMonth(0,1),t.setHours(0,0,0,0),t}}function H(a,e){const t=S(a);switch(e){case"day":return t.setHours(23,59,59,999),t;case"week":{const n=t.getDay();return t.setDate(t.getDate()+(6-n)),t.setHours(23,59,59,999),t}case"month":return t.setMonth(t.getMonth()+1,0),t.setHours(23,59,59,999),t;case"year":return t.setMonth(11,31),t.setHours(23,59,59,999),t}}function I(a,e,t){const n=S(a);switch(t){case"minutes":return n.setMinutes(n.getMinutes()+e),n;case"hours":return n.setHours(n.getHours()+e),n;case"days":return n.setDate(n.getDate()+e),n;case"months":return n.setMonth(n.getMonth()+e),n;case"years":return n.setFullYear(n.getFullYear()+e),n}}function U(a){return a instanceof Date?!isNaN(a.getTime()):typeof a=="string"?!isNaN(new Date(a).getTime()):!1}function Y(a,e){return S(a).getTime()<S(e).getTime()}function P(a,e){return S(a).getTime()>S(e).getTime()}function De(a){const[e,t]=b.useState(()=>{if(a==null)return null;const u=typeof a=="string"?new Date(a):a;return isNaN(u.getTime())?null:u}),n=b.useCallback(u=>{if(u===null){t(null);return}const y=typeof u=="string"?new Date(u):u;t(isNaN(y.getTime())?null:y)},[]),s=b.useCallback((u,y="en")=>e?E(e,u,y):"",[e]),o=b.useCallback((u,y)=>e?B(e,u,y):0,[e]),i=b.useCallback((u="en")=>e?O(e,u):"",[e]),p=b.useCallback((u,y)=>e?I(e,u,y):new Date,[e]),l=b.useCallback(u=>e?_(e,u):new Date,[e]),h=b.useCallback(u=>e?H(e,u):new Date,[e]),d=b.useCallback(()=>U(e),[e]),m=b.useCallback(u=>e?Y(e,u):!1,[e]),g=b.useCallback(u=>e?P(e,u):!1,[e]);return{date:e,setDate:n,format:s,diff:o,relative:i,add:p,startOf:l,endOf:h,isValid:d,isBefore:m,isAfter:g}}function V(a,e){let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>a(...n),e)}}function q(a,e){let t=0;return(...n)=>{const s=Date.now();s-t>=e&&(t=s,a(...n))}}function J(a,e,t="..."){return a.length<=e?a:a.slice(0,e)+t}async function z(a){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(a),!0;const e=document.createElement("textarea");e.value=a,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}catch{return!1}}function K(a){return a.toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function W(a){return a&&a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()}function G(a){return typeof structuredClone=="function"?structuredClone(a):JSON.parse(JSON.stringify(a))}function j(a,e=""){const t={};for(const n of Object.keys(a)){const s=e?`${e}.${n}`:n,o=a[n];o!==null&&typeof o=="object"&&!Array.isArray(o)?Object.assign(t,j(o,s)):t[s]=o}return t}function Q(a,e){const t={};for(const n of a){const s=String(n[e]);t[s]||(t[s]=[]),t[s].push(n)}return t}function X(a,e){const t=new Set;return a.filter(n=>{const s=n[e];return t.has(s)?!1:(t.add(s),!0)})}function Te(){return b.useMemo(()=>({debounce:V,throttle:q,truncate:J,copyToClipboard:z,slugify:K,capitalize:W,deepClone:G,flattenObject:j,groupBy:Q,uniqueBy:X}),[])}c.ANICCA_THEME_CSS_VAR_MAP=F,c.AniccaActivityFeed=de,c.AniccaBreadcrumb=oe,c.AniccaChartWrapper=ae,c.AniccaDataTable=le,c.AniccaModal=me,c.AniccaNavbar=ce,c.AniccaProgressCard=fe,c.AniccaSidebar=ne,c.AniccaStatCard=ee,c.AniccaTabs=he,c.AniccaThemeProvider=R,c.aniccaAdd=I,c.aniccaCapitalize=W,c.aniccaCopyToClipboard=z,c.aniccaDebounce=V,c.aniccaDeepClone=G,c.aniccaDiff=B,c.aniccaEndOf=H,c.aniccaFlattenObject=j,c.aniccaFormat=E,c.aniccaGroupBy=Q,c.aniccaIsAfter=P,c.aniccaIsBefore=Y,c.aniccaIsValid=U,c.aniccaRelative=O,c.aniccaSlugify=K,c.aniccaStartOf=_,c.aniccaThrottle=q,c.aniccaTruncate=J,c.aniccaUniqueBy=X,c.custom=ke,c.email=xe,c.max=we,c.maxLength=ye,c.min=Ne,c.minLength=ge,c.pattern=ve,c.required=pe,c.useAniccaDate=De,c.useAniccaForm=Ae,c.useAniccaUtils=Te,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.AniccaUI={},m.jsxRuntime,m.React,m.ReactDOM))})(this,function(m,e,u,F){"use strict";const K={primary:"--primary","on-primary":"--on-primary","primary-container":"--primary-container",secondary:"--secondary","secondary-container":"--secondary-container","on-secondary-container":"--on-secondary-container",tertiary:"--tertiary",error:"--error",surface:"--surface","surface-container-lowest":"--surface-container-lowest","surface-container-low":"--surface-container-low","surface-container":"--surface-container","surface-container-high":"--surface-container-high","surface-container-highest":"--surface-container-highest","on-surface":"--on-surface","on-surface-variant":"--on-surface-variant",outline:"--outline","outline-variant":"--outline-variant",background:"--background","sidebar-bg":"--sidebar-bg",violet:"--violet",amber:"--amber"};function Ae(t){if(!t)return{};const r={};for(const a of Object.keys(t)){const n=t[a];n!==void 0&&(r[K[a]]=n)}return r}function $e({theme:t,as:r="div",className:a,children:n}){const o=u.useMemo(()=>Ae(t),[t]),s=r;return e.jsx(s,{style:o,className:a,"data-anicca-theme":"",children:n})}const _e={primary:"bg-primary text-primary-fg border border-primary hover:opacity-90 active:opacity-100 dark:bg-primary dark:text-primary-fg dark:border-primary",secondary:"bg-surface-muted text-text border border-border hover:bg-surface-low dark:bg-surface-container dark:text-text dark:border-border dark:hover:bg-surface-container",outline:"bg-transparent text-text border border-border hover:bg-surface-muted dark:text-text dark:border-border dark:hover:bg-surface-container",ghost:"bg-transparent text-text border border-transparent hover:bg-surface-muted dark:text-text dark:hover:bg-surface-container",danger:"bg-danger text-white border border-danger hover:opacity-90 dark:bg-danger dark:text-white dark:border-danger",link:"bg-transparent text-primary border border-transparent underline-offset-4 hover:underline px-0 dark:text-primary"},Se={sm:"h-8 px-3 text-[0.78rem] gap-1.5 rounded-lg",md:"h-10 px-4 text-[0.875rem] gap-2 rounded-lg",lg:"h-12 px-6 text-[0.95rem] gap-2 rounded-a",icon:"h-10 w-10 p-0 rounded-lg"},Ce=u.forwardRef(function({variant:r="primary",size:a="md",loading:n=!1,leftIcon:o,rightIcon:s,fullWidth:d,className:b="",disabled:l,children:h,type:x="button",...c},i){const f=l||n;return e.jsxs("button",{ref:i,type:x,disabled:f,"data-loading":n||void 0,className:`relative inline-flex items-center justify-center font-semibold tracking-tight transition-[background,color,opacity,border-color] duration-200 ease-out focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 disabled:opacity-50 disabled:cursor-not-allowed font-[inherit] ${_e[r]} ${Se[a]} ${d?"w-full":""} ${b}`,...c,children:[n&&e.jsx("span",{className:"absolute inset-0 flex items-center justify-center","aria-hidden":"true",children:e.jsxs("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}),e.jsxs("span",{className:`inline-flex items-center gap-[inherit] ${n?"opacity-0":""}`,children:[o&&e.jsx("span",{className:"inline-flex shrink-0",children:o}),h,s&&e.jsx("span",{className:"inline-flex shrink-0",children:s})]})]})}),Le={sm:"h-8 text-[0.8rem] rounded-lg",md:"h-10 text-[0.875rem] rounded-lg",lg:"h-12 text-[0.95rem] rounded-a"},Ee=u.forwardRef(function({label:r,helper:a,error:n,required:o,leftAddon:s,rightAddon:d,inputSize:b="md",id:l,className:h="",wrapperClassName:x="",disabled:c,...i},f){const p=u.useId(),v=l??p,A=`${v}-helper`,$=`${v}-error`,_=n?$:a?A:void 0;return e.jsxs("div",{className:`flex flex-col gap-1.5 ${x}`,children:[r&&e.jsxs("label",{htmlFor:v,className:"text-[0.78rem] font-semibold text-text",children:[r,o&&e.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),e.jsxs("div",{className:`group flex items-center gap-2 bg-surface border border-border px-3 transition-[border-color,box-shadow] duration-200 ease-out focus-within:border-primary focus-within:ring-[var(--anicca-ring-width)] focus-within:ring-primary/20 dark:bg-surface dark:border-border dark:focus-within:border-primary ${Le[b]} ${n?"border-danger focus-within:border-danger focus-within:ring-danger/20":""} ${c?"opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container":""}`,children:[s&&e.jsx("span",{className:"text-text-muted shrink-0 inline-flex items-center",children:s}),e.jsx("input",{ref:f,id:v,disabled:c,"aria-invalid":n?!0:void 0,"aria-describedby":_,required:o,className:`flex-1 min-w-0 bg-transparent outline-none border-none text-text placeholder:text-text-subtle font-[inherit] dark:text-text dark:placeholder:text-text-subtle ${h}`,...i}),d&&e.jsx("span",{className:"text-text-muted shrink-0 inline-flex items-center",children:d})]}),n?e.jsx("span",{id:$,className:"text-[0.72rem] text-danger font-medium",children:n}):a?e.jsx("span",{id:A,className:"text-[0.72rem] text-text-muted",children:a}):null]})}),Te=u.forwardRef(function({label:r,helper:a,error:n,required:o,autoResize:s=!1,maxHeight:d,showCount:b=!1,maxLength:l,id:h,className:x="",wrapperClassName:c="",disabled:i,onInput:f,value:p,defaultValue:v,...A},$){const _=u.useId(),E=h??_,N=u.useRef(null),g=k=>{N.current=k,typeof $=="function"?$(k):$&&($.current=k)},w=()=>{const k=N.current;if(!k||!s)return;k.style.height="auto";const S=d?Math.min(k.scrollHeight,d):k.scrollHeight;k.style.height=`${S}px`};u.useEffect(()=>{w()},[p,v,s,d]);const y=typeof p=="string"?p.length:0;return e.jsxs("div",{className:`flex flex-col gap-1.5 ${c}`,children:[r&&e.jsxs("label",{htmlFor:E,className:"text-[0.78rem] font-semibold text-text",children:[r,o&&e.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),e.jsx("textarea",{ref:g,id:E,disabled:i,required:o,maxLength:l,value:p,defaultValue:v,"aria-invalid":n?!0:void 0,onInput:k=>{w(),f==null||f(k)},className:`bg-surface border border-border rounded-lg px-3 py-2 text-[0.875rem] text-text placeholder:text-text-subtle outline-none resize-y transition-[border-color,box-shadow] duration-200 ease-out focus:border-primary focus:ring-[var(--anicca-ring-width)] focus:ring-primary/20 font-[inherit] dark:bg-surface dark:border-border dark:text-text dark:placeholder:text-text-subtle dark:focus:border-primary ${n?"border-danger focus:border-danger focus:ring-danger/20":""} ${i?"opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container":""} ${s?"resize-none overflow-hidden":""} ${x}`,...A}),e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("span",{className:"text-[0.72rem] flex-1 min-w-0",children:n?e.jsx("span",{className:"text-danger font-medium",children:n}):a?e.jsx("span",{className:"text-text-muted",children:a}):null}),b&&e.jsxs("span",{className:"text-[0.72rem] text-text-subtle tabular-nums",children:[y,l?`/${l}`:""]})]})]})}),Me={sm:"h-8 text-[0.8rem] rounded-lg pl-3 pr-8",md:"h-10 text-[0.875rem] rounded-lg pl-3 pr-9",lg:"h-12 text-[0.95rem] rounded-a pl-4 pr-10"},Ie=u.forwardRef(function({label:r,helper:a,error:n,required:o,options:s,placeholder:d,selectSize:b="md",id:l,className:h="",wrapperClassName:x="",disabled:c,children:i,value:f,defaultValue:p,...v},A){const $=u.useId(),_=l??$;return e.jsxs("div",{className:`flex flex-col gap-1.5 ${x}`,children:[r&&e.jsxs("label",{htmlFor:_,className:"text-[0.78rem] font-semibold text-text",children:[r,o&&e.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{ref:A,id:_,disabled:c,required:o,"aria-invalid":n?!0:void 0,value:f,defaultValue:p??(d&&f===void 0?"":void 0),className:`appearance-none w-full bg-surface border border-border text-text outline-none cursor-pointer transition-[border-color,box-shadow] duration-200 ease-out focus:border-primary focus:ring-[var(--anicca-ring-width)] focus:ring-primary/20 font-[inherit] dark:bg-surface dark:border-border dark:text-text dark:focus:border-primary ${Me[b]} ${n?"border-danger focus:border-danger focus:ring-danger/20":""} ${c?"opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container":""} ${h}`,...v,children:[d&&e.jsx("option",{value:"",disabled:!0,hidden:!0,children:d}),i??(s==null?void 0:s.map(E=>e.jsx("option",{value:E.value,disabled:E.disabled,children:E.label},E.value)))]}),e.jsx("svg",{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e.jsx("polyline",{points:"6 9 12 15 18 9",strokeLinecap:"round",strokeLinejoin:"round"})})]}),n?e.jsx("span",{className:"text-[0.72rem] text-danger font-medium",children:n}):a?e.jsx("span",{className:"text-[0.72rem] text-text-muted",children:a}):null]})}),je=u.forwardRef(function({label:r,description:a,error:n,indeterminate:o=!1,id:s,className:d="",wrapperClassName:b="",disabled:l,checked:h,defaultChecked:x,...c},i){const f=u.useId(),p=s??f,v=u.useRef(null),A=$=>{v.current=$,typeof i=="function"?i($):i&&(i.current=$)};return u.useEffect(()=>{v.current&&(v.current.indeterminate=o)},[o]),e.jsxs("label",{htmlFor:p,className:`inline-flex items-start gap-2.5 cursor-pointer ${l?"opacity-50 cursor-not-allowed":""} ${b}`,children:[e.jsxs("span",{className:"relative inline-flex items-center justify-center shrink-0 mt-[0.15rem]",children:[e.jsx("input",{ref:A,id:p,type:"checkbox",disabled:l,checked:h,defaultChecked:x,"aria-invalid":n?!0:void 0,className:`peer appearance-none w-[18px] h-[18px] border-[1.5px] border-border-strong rounded-xs bg-surface cursor-[inherit] transition-[background-color,border-color,box-shadow] duration-150 checked:bg-primary checked:border-primary indeterminate:bg-primary indeterminate:border-primary focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 dark:bg-surface dark:border-border-strong dark:checked:bg-primary dark:checked:border-primary ${n?"border-danger":""} ${d}`,...c}),e.jsx("svg",{className:"absolute w-3 h-3 text-primary-fg pointer-events-none opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-0 transition-opacity duration-150",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"absolute w-2.5 h-[2px] bg-primary-fg pointer-events-none opacity-0 peer-indeterminate:opacity-100","aria-hidden":"true"})]}),(r||a||n)&&e.jsxs("span",{className:"flex flex-col gap-0.5 min-w-0",children:[r&&e.jsx("span",{className:"text-[0.85rem] text-text font-medium leading-tight",children:r}),a&&!n&&e.jsx("span",{className:"text-[0.75rem] text-text-muted leading-snug",children:a}),n&&e.jsx("span",{className:"text-[0.72rem] text-danger font-medium leading-snug",children:n})]})]})}),X=u.createContext(null);function De({name:t,value:r,defaultValue:a,onChange:n,orientation:o="vertical",disabled:s,label:d,error:b,className:l="",children:h}){const[x,c]=u.useState(a??""),i=r!==void 0,f=i?r:x,p=v=>{i||c(v),n==null||n(v)};return e.jsxs("div",{className:`flex flex-col gap-2 ${l}`,role:"radiogroup","aria-label":d,children:[d&&e.jsx("span",{className:"text-[0.78rem] font-semibold text-text",children:d}),e.jsx("div",{className:`flex ${o==="horizontal"?"flex-row gap-4 flex-wrap":"flex-col gap-2"}`,children:e.jsx(X.Provider,{value:{name:t,value:f,onChange:p,disabled:s},children:h})}),b&&e.jsx("span",{className:"text-[0.72rem] text-danger font-medium",children:b})]})}const Be=u.forwardRef(function({value:r,label:a,description:n,id:o,className:s="",wrapperClassName:d="",disabled:b,...l},h){const x=u.useId(),c=o??x,i=u.useContext(X),f=b||(i==null?void 0:i.disabled),p=i?i.value===r:l.checked;return e.jsxs("label",{htmlFor:c,className:`inline-flex items-start gap-2.5 cursor-pointer ${f?"opacity-50 cursor-not-allowed":""} ${d}`,children:[e.jsxs("span",{className:"relative inline-flex items-center justify-center shrink-0 mt-[0.15rem]",children:[e.jsx("input",{ref:h,id:c,type:"radio",name:(i==null?void 0:i.name)??l.name,value:r,checked:p,disabled:f,onChange:v=>{var A,$;(A=i==null?void 0:i.onChange)==null||A.call(i,r),($=l.onChange)==null||$.call(l,v)},className:`peer appearance-none w-[18px] h-[18px] border-[1.5px] border-border-strong rounded-full bg-surface cursor-[inherit] transition-[border-color,box-shadow] duration-150 checked:border-primary focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 dark:bg-surface dark:border-border-strong dark:checked:border-primary ${s}`,...l}),e.jsx("span",{className:"absolute w-[8px] h-[8px] rounded-full bg-primary pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity duration-150","aria-hidden":"true"})]}),(a||n)&&e.jsxs("span",{className:"flex flex-col gap-0.5 min-w-0",children:[a&&e.jsx("span",{className:"text-[0.85rem] text-text font-medium leading-tight",children:a}),n&&e.jsx("span",{className:"text-[0.75rem] text-text-muted leading-snug",children:n})]})]})}),Fe={sm:{track:"w-8 h-[18px]",thumb:"w-3.5 h-3.5",translate:"peer-checked:translate-x-[14px]"},md:{track:"w-10 h-[22px]",thumb:"w-[18px] h-[18px]",translate:"peer-checked:translate-x-[18px]"},lg:{track:"w-12 h-7",thumb:"w-6 h-6",translate:"peer-checked:translate-x-5"}},Pe=u.forwardRef(function({label:r,description:a,switchSize:n="md",labelPosition:o="right",id:s,className:d="",wrapperClassName:b="",disabled:l,...h},x){const c=u.useId(),i=s??c,{track:f,thumb:p,translate:v}=Fe[n],A=e.jsxs("span",{className:`relative inline-flex items-center shrink-0 ${f}`,children:[e.jsx("input",{ref:x,id:i,type:"checkbox",role:"switch",disabled:l,className:`peer appearance-none w-full h-full bg-border-strong rounded-full cursor-[inherit] transition-colors duration-200 ease-out checked:bg-primary focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary/20 dark:bg-border dark:checked:bg-primary ${d}`,...h}),e.jsx("span",{className:`absolute left-0.5 ${p} bg-surface rounded-full transition-transform duration-200 ease-out pointer-events-none ${v}`,"aria-hidden":"true",style:{boxShadow:"0 2px 4px rgba(0,0,0,0.15)"}})]}),$=(r||a)&&e.jsxs("span",{className:"flex flex-col gap-0.5 min-w-0",children:[r&&e.jsx("span",{className:"text-[0.85rem] text-text font-medium leading-tight",children:r}),a&&e.jsx("span",{className:"text-[0.75rem] text-text-muted leading-snug",children:a})]});return e.jsxs("label",{htmlFor:i,className:`inline-flex items-center gap-3 cursor-pointer ${l?"opacity-50 cursor-not-allowed":""} ${b}`,children:[o==="left"&&$,A,o==="right"&&$]})}),Oe={elevated:"bg-surface border border-text/[0.06] shadow-md dark:bg-surface dark:border-border/50 dark:shadow-md",outlined:"bg-surface border border-border dark:bg-surface dark:border-border",flat:"bg-surface-muted border border-transparent dark:bg-surface-container"};function We({variant:t="elevated",accent:r,unpadded:a,className:n="",style:o,children:s,...d}){return e.jsx("div",{className:`rounded-a ${a?"":"p-6"} ${Oe[t]} ${r?"border-l-4":""} ${n}`,style:{...r?{borderLeftColor:r}:{},...o},...d,children:s})}function ze({className:t="",children:r,...a}){return e.jsx("div",{className:`px-6 py-5 border-b border-border flex items-center justify-between gap-3 ${t}`,...a,children:r})}function He({className:t="",children:r,...a}){return e.jsx("h3",{className:`text-[1rem] font-bold text-text tracking-tight m-0 ${t}`,...a,children:r})}function Ve({className:t="",children:r,...a}){return e.jsx("p",{className:`text-[0.82rem] text-text-muted m-0 ${t}`,...a,children:r})}function Ue({className:t="",children:r,...a}){return e.jsx("div",{className:`px-6 py-5 text-text ${t}`,...a,children:r})}function Ye({className:t="",children:r,...a}){return e.jsx("div",{className:`px-6 py-4 border-t border-border flex items-center justify-end gap-2 ${t}`,...a,children:r})}const Ge={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Je={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};function qe({direction:t="vertical",gap:r=1,align:a,justify:n,wrap:o,divider:s,as:d="div",className:b="",style:l,children:h,...x}){const c=d,i=typeof r=="number"?`${r}rem`:r;if(s!==void 0){const f=u.Children.toArray(h).filter(Boolean),p=[];f.forEach((v,A)=>{p.push(v),A<f.length-1&&p.push(e.jsx(u.Fragment,{children:s},`anicca-stack-divider-${A}`))}),h=p}return e.jsx(c,{className:`flex ${t==="vertical"?"flex-col":"flex-row"} ${o&&t==="horizontal"?"flex-wrap":""} ${a?Ge[a]:""} ${n?Je[n]:""} ${b}`,style:{gap:i,...l},...x,children:h})}function Ze(t){if(t!==void 0)return typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t}function Ke({columns:t=1,responsive:r,gap:a=1,minChildWidth:n,as:o="div",className:s="",style:d,children:b,...l}){const h=o,x=typeof a=="number"?`${a}rem`:a,c=n?`repeat(auto-fit, minmax(${n}, 1fr))`:Ze((r==null?void 0:r.base)??t),i={display:"grid",gap:x,gridTemplateColumns:c,...d};return e.jsx(h,{"data-anicca-grid":"","data-responsive":r?JSON.stringify(r):void 0,className:s,style:i,...l,children:b})}function Xe({orientation:t="horizontal",label:r,variant:a="solid",thickness:n=1,className:o="",style:s,...d}){return t==="vertical"?e.jsx("div",{role:"separator","aria-orientation":"vertical",className:`self-stretch ${o}`,style:{borderLeftWidth:n,borderLeftStyle:a,borderColor:"rgb(var(--anicca-border))",...s},...d}):r?e.jsxs("div",{role:"separator","aria-orientation":"horizontal",className:`flex items-center gap-3 ${o}`,...d,children:[e.jsx("span",{className:"flex-1",style:{borderTopWidth:n,borderTopStyle:a,borderColor:"rgb(var(--anicca-border))"}}),e.jsx("span",{className:"text-[0.72rem] uppercase tracking-[0.08em] text-text-muted font-semibold dark:text-text-subtle",children:r}),e.jsx("span",{className:"flex-1",style:{borderTopWidth:n,borderTopStyle:a,borderColor:"rgb(var(--anicca-border))"}})]}):e.jsx("div",{role:"separator","aria-orientation":"horizontal",className:o,style:{borderTopWidth:n,borderTopStyle:a,borderColor:"rgb(var(--anicca-border))",...s},...d})}const Qe={neutral:"bg-surface-muted text-text-muted",primary:"bg-primary-soft text-primary",success:"bg-success-bg text-success",warning:"bg-warning-bg text-warning",danger:"bg-danger-bg text-danger",info:"bg-info-bg text-info"},Re={neutral:"bg-text text-surface",primary:"bg-primary text-primary-fg",success:"bg-success text-primary-fg",warning:"bg-warning text-primary-fg",danger:"bg-danger text-primary-fg",info:"bg-info text-primary-fg"},er={neutral:"border border-border text-text-muted",primary:"border border-primary text-primary",success:"border border-success text-success",warning:"border border-warning text-warning",danger:"border border-danger text-danger",info:"border border-info text-info"},rr={neutral:"bg-text-muted",primary:"bg-primary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"},tr={sm:"h-5 px-2 text-[0.65rem]",md:"h-6 px-2.5 text-[0.72rem]"};function ar({variant:t="neutral",size:r="md",appearance:a="soft",dot:n,className:o="",children:s,...d}){const b=a==="solid"?Re[t]:a==="outlined"?er[t]:Qe[t];return e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full font-semibold whitespace-nowrap leading-none tracking-tight ${tr[r]} ${b} ${o}`,...d,children:[n&&e.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${rr[t]}`,"aria-hidden":"true"}),s]})}const Q={xs:24,sm:32,md:40,lg:56,xl:72},nr={online:"var(--anicca-success)",offline:"var(--anicca-text-subtle)",busy:"var(--anicca-danger)",away:"var(--anicca-warning)"},or={circle:"rounded-full",rounded:"rounded-lg",square:"rounded-none"};function sr(t){return t?t.split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0].toUpperCase()).join(""):"?"}function R({src:t,alt:r,name:a,fallback:n,size:o="md",shape:s="circle",status:d,className:b="",style:l,...h}){const[x,c]=u.useState(!1),i=typeof o=="number"?o:Q[o],f=i*.4,p=t&&!x;return e.jsxs("span",{className:`relative inline-flex items-center justify-center bg-surface-muted text-text-muted overflow-hidden border border-border dark:bg-surface-container dark:text-text-muted dark:border-border ${or[s]} ${b}`,style:{width:i,height:i,fontSize:f,...l},role:"img","aria-label":r??a??"avatar",...h,children:[p?e.jsx("img",{src:t,alt:r??a??"",onError:()=>c(!0),className:"w-full h-full object-cover"}):e.jsx("span",{className:"font-bold tracking-tight",children:n??sr(a)}),d&&e.jsx("span",{className:"absolute bottom-0 right-0 rounded-full border-2 border-surface",style:{width:i*.28,height:i*.28,background:nr[d]},"aria-label":d})]})}function ir({max:t=4,spacing:r=8,size:a="md",className:n="",style:o,children:s,...d}){const b=u.Children.toArray(s).filter(Boolean),l=b.slice(0,t),h=b.length-l.length,x=typeof a=="number"?a:Q[a];return e.jsxs("div",{className:`flex ${n}`,style:o,...d,children:[l.map((c,i)=>e.jsx("span",{style:{marginLeft:i===0?0:-r},className:"ring-2 ring-surface rounded-full",children:u.isValidElement(c)&&c.type===R?u.cloneElement(c,{size:a}):c},i)),h>0&&e.jsxs("span",{className:"inline-flex items-center justify-center bg-surface-muted text-text-muted rounded-full border-2 border-surface font-semibold",style:{width:x,height:x,fontSize:x*.36,marginLeft:-r},children:["+",h]})]})}function cr({variant:t="rect",width:r,height:a,lines:n=1,static:o,className:s="",style:d,...b}){const l=`${o?"":"anicca-shimmer"} block bg-surface-muted dark:bg-surface-container`,h=typeof r=="number"?`${r}px`:r,x=typeof a=="number"?`${a}px`:a;if(t==="circle"){const c=h??x??"2.5rem";return e.jsx("span",{className:`${l} rounded-full ${s}`,style:{width:c,height:c,...d},"aria-hidden":"true",...b})}return t==="text"?e.jsx("span",{className:`flex flex-col gap-1.5 ${s}`,"aria-hidden":"true",...b,children:Array.from({length:n}).map((c,i)=>e.jsx("span",{className:`${l} rounded-xs`,style:{width:i===n-1&&n>1?"70%":h??"100%",height:x??"0.875rem"}},i))}):e.jsx("span",{className:`${l} rounded-lg ${s}`,style:{width:h??"100%",height:x??"1rem",...d},"aria-hidden":"true",...b})}const lr={xs:12,sm:16,md:24,lg:32,xl:48};function dr({size:t="md",thickness:r=2.5,color:a,label:n="Loading",className:o="",style:s,...d}){const b=typeof t=="number"?t:lr[t];return e.jsxs("span",{role:"status","aria-label":n,className:`inline-flex items-center justify-center text-primary ${o}`,style:{color:a,...s},...d,children:[e.jsxs("svg",{className:"animate-spin",width:b,height:b,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:r,opacity:"0.2"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:"currentColor",strokeWidth:r,strokeLinecap:"round"})]}),e.jsx("span",{className:"sr-only",children:n})]})}const ur={previous:"← Prev",next:"Next →",page:"Page",goToPage:t=>`Go to page ${t}`};function P(t,r){return Array.from({length:r-t+1},(a,n)=>t+n)}function fr(t,r,a,n){const o=n*2+a*2+3;if(r<=o)return P(1,r);const s=Math.max(t-a,n+2),d=Math.min(t+a,r-n-1),b=s>n+2,l=d<r-n-1,h=P(1,n),x=P(r-n+1,r),c=[...h];return b?c.push("ellipsis"):c.push(...P(n+1,s-1)),c.push(...P(s,d)),l?c.push("ellipsis"):c.push(...P(d+1,r-n)),c.push(...x),c}function br({page:t,pageCount:r,onPageChange:a,siblingCount:n=1,boundaryCount:o=1,hideControls:s=!1,labels:d,className:b="",...l}){const h={...ur,...d},x=fr(t,r,n,o),c="min-w-[34px] h-[34px] px-2 inline-flex items-center justify-center text-[0.82rem] font-semibold rounded-lg border transition-[background-color,border-color,color] duration-150 focus-visible:outline-none focus-visible:ring-[var(--anicca-ring-width)] focus-visible:ring-primary-soft disabled:opacity-40 disabled:cursor-not-allowed";return e.jsxs("nav",{className:`flex items-center gap-1.5 ${b}`,"aria-label":"Pagination",...l,children:[!s&&e.jsx("button",{type:"button",className:`${c} bg-surface text-text-muted border-border hover:enabled:border-primary hover:enabled:text-primary`,disabled:t<=1,onClick:()=>a(t-1),children:h.previous}),x.map((i,f)=>{var p;return i==="ellipsis"?e.jsx("span",{className:"px-1 text-text-subtle select-none",children:"…"},`e${f}`):e.jsx("button",{type:"button","aria-current":i===t?"page":void 0,"aria-label":(p=h.goToPage)==null?void 0:p.call(h,i),onClick:()=>a(i),className:`${c} ${i===t?"bg-primary text-primary-fg border-primary":"bg-surface text-text-muted border-border hover:enabled:border-primary hover:enabled:text-primary"}`,children:i},i)}),!s&&e.jsx("button",{type:"button",className:`${c} bg-surface text-text-muted border-border hover:enabled:border-primary hover:enabled:text-primary`,disabled:t>=r,onClick:()=>a(t+1),children:h.next})]})}const hr={info:"bg-info-bg border-info/40 text-info dark:bg-info/20 dark:border-info/30 dark:text-info",success:"bg-success-bg border-success/40 text-success dark:bg-success/20 dark:border-success/30 dark:text-success",warning:"bg-warning-bg border-warning/40 text-warning dark:bg-warning/20 dark:border-warning/30 dark:text-warning",danger:"bg-danger-bg border-danger/40 text-danger dark:bg-danger/20 dark:border-danger/30 dark:text-danger",neutral:"bg-surface-muted border-border text-text dark:bg-surface-container dark:border-border dark:text-text"},pr={info:"bg-surface border-info text-info dark:bg-surface dark:border-info dark:text-info",success:"bg-surface border-success text-success dark:bg-surface dark:border-success dark:text-success",warning:"bg-surface border-warning text-warning dark:bg-surface dark:border-warning dark:text-warning",danger:"bg-surface border-danger text-danger dark:bg-surface dark:border-danger dark:text-danger",neutral:"bg-surface border-border text-text dark:bg-surface dark:border-border dark:text-text"},xr={info:e.jsx(W,{d:"M12 8h.01M11 12h1v4h1"}),success:e.jsx(W,{d:"M20 6L9 17l-5-5"}),warning:e.jsx(W,{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),danger:e.jsx(W,{d:"M10 14l4-4m0 4l-4-4M12 22a10 10 0 110-20 10 10 0 010 20z"}),neutral:e.jsx(W,{d:"M12 8h.01M11 12h1v4h1"})};function W({d:t}){return e.jsx("svg",{className:"w-5 h-5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e.jsx("path",{d:t,strokeLinecap:"round",strokeLinejoin:"round"})})}function gr({variant:t="info",title:r,icon:a,onDismiss:n,labels:o,appearance:s="soft",className:d="",children:b,...l}){const h=(o==null?void 0:o.dismiss)??"Dismiss",x=s==="outlined"?pr[t]:hr[t],c=a===null?null:a??xr[t];return e.jsxs("div",{role:"alert",className:`flex items-start gap-3 p-4 rounded-lg border ${x} ${d}`,...l,children:[c,e.jsxs("div",{className:"flex-1 min-w-0",children:[r&&e.jsx("div",{className:"font-semibold text-[0.9rem] mb-0.5 text-text",children:r}),e.jsx("div",{className:"text-[0.82rem] text-text leading-relaxed",children:b})]}),n&&e.jsx("button",{type:"button",onClick:n,"aria-label":h,className:"shrink-0 w-6 h-6 inline-flex items-center justify-center rounded-xs text-text-muted hover:text-text hover:bg-surface-muted transition-colors",children:"×"})]})}const ee=u.createContext(null),mr={"top-right":"top-4 right-4 items-end","top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},vr={info:"border-info",success:"border-success",warning:"border-warning",danger:"border-danger",neutral:"border-border"};let yr=0;function kr({position:t="top-right",defaultDuration:r=4e3,max:a=5,children:n}){const[o,s]=u.useState([]),d=u.useRef(new Map),b=u.useCallback(c=>{s(f=>f.filter(p=>p.id!==c));const i=d.current.get(c);i&&(window.clearTimeout(i),d.current.delete(c))},[]),l=u.useCallback(c=>{const i=c.id??`t-${++yr}`,f=c.duration??r;if(s(p=>{const v=[...p,{...c,id:i,duration:f}];return v.length>a?v.slice(v.length-a):v}),f>0){const p=window.setTimeout(()=>b(i),f);d.current.set(i,p)}return i},[r,b,a]),h=u.useCallback(()=>{d.current.forEach(c=>window.clearTimeout(c)),d.current.clear(),s([])},[]);u.useEffect(()=>()=>{d.current.forEach(c=>window.clearTimeout(c))},[]);const x=typeof document<"u"?F.createPortal(e.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:`fixed z-[2000] flex flex-col gap-2 pointer-events-none ${mr[t]}`,children:o.map(c=>e.jsxs("div",{role:"status",className:`pointer-events-auto anicca-slide-up bg-surface border-l-4 ${vr[c.variant??"neutral"]} border border-border rounded-lg shadow-md min-w-[280px] max-w-[420px] p-4 flex items-start gap-3`,children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[c.title&&e.jsx("div",{className:"font-semibold text-[0.88rem] text-text",children:c.title}),c.description&&e.jsx("div",{className:"text-[0.8rem] text-text-muted mt-0.5 leading-snug",children:c.description})]}),c.action&&e.jsx("button",{type:"button",onClick:()=>{c.action.onClick(),b(c.id)},className:"text-[0.78rem] font-semibold text-primary hover:underline shrink-0",children:c.action.label}),e.jsx("button",{type:"button",onClick:()=>b(c.id),"aria-label":"Dismiss",className:"shrink-0 w-5 h-5 inline-flex items-center justify-center text-text-subtle hover:text-text transition-colors",children:"×"})]},c.id))}),document.body):null;return e.jsxs(ee.Provider,{value:{toasts:o,push:l,dismiss:b,clear:h},children:[n,x]})}function wr(){const t=u.useContext(ee);if(!t)throw new Error("useAniccaToast must be used inside <AniccaToastProvider>");return t}const re=u.createContext(null),Nr={info:"border-primary",success:"border-tertiary",warning:"border-amber",danger:"border-error",neutral:"border-outline-variant"},Ar={info:"text-primary",success:"text-tertiary",warning:"text-amber",danger:"text-error",neutral:"text-outline"},$r={info:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("circle",{cx:"10",cy:"6.5",r:"0.75",fill:"currentColor"})]}),success:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M6.5 10.5l2.5 2.5 4.5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e.jsx("path",{d:"M10 2.5L18 17H2L10 2.5z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),e.jsx("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("circle",{cx:"10",cy:"13.5",r:"0.75",fill:"currentColor"})]}),danger:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),neutral:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M6.5 10h7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},_r={primary:"bg-primary text-on-primary hover:opacity-90",secondary:"bg-surface-container text-on-surface border border-outline-variant/20 hover:bg-surface-container-high",danger:"bg-error text-on-error hover:opacity-90"};let Sr=0;function Cr({children:t}){var c,i;const[r,a]=u.useState([]),n=u.useRef(null),o=()=>{n.current!==null&&(window.clearTimeout(n.current),n.current=null)},s=u.useCallback(f=>{o(),a(p=>p.filter(v=>v.id!==f))},[]),d=u.useCallback(()=>{o(),a([])},[]),b=u.useCallback(f=>{var A;const p=f.id??`p-${++Sr}`,v=f.duration??((A=f.actions)!=null&&A.length?0:4e3);return a($=>[...$,{...f,id:p,duration:v}]),p},[]),l=r[0];u.useEffect(()=>(o(),l&&(l.duration??0)>0&&(n.current=window.setTimeout(()=>s(l.id),l.duration)),o),[l==null?void 0:l.id,l==null?void 0:l.duration,s]),u.useEffect(()=>()=>o(),[]);const h=(l==null?void 0:l.variant)??"neutral",x=typeof document<"u"&&l?F.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[2100] flex items-center justify-center anicca-fade-in","aria-modal":"true",role:"dialog","aria-labelledby":`popup-title-${l.id}`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>{var f;return!((f=l.actions)!=null&&f.length)&&s(l.id)}}),e.jsxs("div",{className:`relative anicca-slide-up bg-surface-container-lowest rounded-[22px] border-t-4 ${Nr[h]} border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] w-full max-w-sm mx-4 shadow-[0_24px_70px_-20px_rgba(11,28,48,0.35),0_8px_24px_-12px_rgb(var(--primary)/0.12)] dark:shadow-[0_20px_60px_rgba(0,0,0,0.55)]`,children:[e.jsx("div",{className:"p-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-0.5 shrink-0 ${Ar[h]}`,children:$r[h]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[l.title&&e.jsx("div",{id:`popup-title-${l.id}`,className:"font-semibold text-body-base text-on-surface",children:l.title}),l.description&&e.jsx("div",{className:"text-body-sm text-on-surface-variant mt-1 leading-relaxed",children:l.description})]}),!((c=l.actions)!=null&&c.length)&&e.jsx("button",{type:"button",onClick:()=>s(l.id),"aria-label":"Dismiss",className:"shrink-0 w-7 h-7 rounded-[8px] bg-on-surface/[0.05] text-outline text-[1rem] flex items-center justify-center hover:bg-surface-container-high hover:text-on-surface transition-all",children:"×"})]})}),(i=l.actions)!=null&&i.length?e.jsx("div",{className:"px-5 pb-5 flex justify-end gap-2 border-t border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] pt-4",children:l.actions.map((f,p)=>e.jsx("button",{type:"button",onClick:()=>{f.onClick(),s(l.id)},className:`px-4 py-2 text-label-sm font-semibold rounded-[10px] transition-opacity ${_r[f.variant??"secondary"]}`,children:f.label},p))}):null]})]}),document.body):null;return e.jsxs(re.Provider,{value:{push:b,dismiss:s,clear:d},children:[t,x]})}function Lr(){const t=u.useContext(re);if(!t)throw new Error("useAniccaPopup must be used inside <AniccaPopupProvider>");return t}const V=8;function Er({content:t,placement:r="top",delay:a=200,disabled:n,open:o,children:s,className:d=""}){const[b,l]=u.useState(!1),h=o??b,x=u.useRef(null),c=u.useRef(),[i,f]=u.useState(null),p=()=>{n||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>l(!0),a))},v=()=>{window.clearTimeout(c.current),l(!1)};if(u.useEffect(()=>{if(!h||!x.current)return;x.current.getBoundingClientRect();const N=()=>{const g=x.current.getBoundingClientRect();let w=0,y=0;r==="top"?(w=g.top-V,y=g.left+g.width/2):r==="bottom"?(w=g.bottom+V,y=g.left+g.width/2):r==="left"?(w=g.top+g.height/2,y=g.left-V):(w=g.top+g.height/2,y=g.right+V),f({top:w+window.scrollY,left:y+window.scrollX})};return N(),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[h,r]),u.useEffect(()=>()=>window.clearTimeout(c.current),[]),!u.isValidElement(s))return s;const A=s.props,$=u.cloneElement(s,{ref:N=>{x.current=N;const g=s.ref;typeof g=="function"?g(N):g&&"current"in g&&(g.current=N)},onMouseEnter:N=>{var g;p(),(g=A.onMouseEnter)==null||g.call(A,N)},onMouseLeave:N=>{var g;v(),(g=A.onMouseLeave)==null||g.call(A,N)},onFocus:N=>{var g;p(),(g=A.onFocus)==null||g.call(A,N)},onBlur:N=>{var g;v(),(g=A.onBlur)==null||g.call(A,N)}}),_={top:"translate(-50%, -100%)",bottom:"translate(-50%, 0)",left:"translate(-100%, -50%)",right:"translate(0, -50%)"},E=h&&i&&typeof document<"u"?F.createPortal(e.jsx("div",{role:"tooltip",className:`fixed z-[2100] pointer-events-none anicca-fade-in ${d}`,style:{top:i.top,left:i.left,transform:_[r]},children:e.jsx("div",{className:"bg-text text-surface text-[0.75rem] font-medium px-2.5 py-1.5 rounded-xs shadow-md leading-tight max-w-[240px] dark:bg-surface-container dark:text-text",children:t})}),document.body):null;return e.jsxs(e.Fragment,{children:[$,E]})}const U=10;function Tr({content:t,placement:r="bottom",open:a,onOpenChange:n,disableOutsideClick:o,disableEscapeKey:s,trigger:d="click",children:b,className:l=""}){const h=a!==void 0,[x,c]=u.useState(!1),i=h?a:x,f=u.useRef(null),p=u.useRef(null),[v,A]=u.useState(null),$=u.useCallback(y=>{h||c(y),n==null||n(y)},[h,n]);if(u.useEffect(()=>{if(!i||!f.current)return;const y=()=>{const k=f.current.getBoundingClientRect();let S=0,L=0;r==="top"?(S=k.top-U,L=k.left+k.width/2):r==="bottom"?(S=k.bottom+U,L=k.left+k.width/2):r==="left"?(S=k.top+k.height/2,L=k.left-U):(S=k.top+k.height/2,L=k.right+U),A({top:S+window.scrollY,left:L+window.scrollX})};return y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}},[i,r]),u.useEffect(()=>{if(!i)return;const y=S=>{var T,B;if(o)return;const L=S.target;(T=p.current)!=null&&T.contains(L)||(B=f.current)!=null&&B.contains(L)||$(!1)},k=S=>{!s&&S.key==="Escape"&&$(!1)};return document.addEventListener("mousedown",y),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",k)}},[i,o,s,$]),!u.isValidElement(b))return b;const _=b.props,E=d==="click"?{onClick:y=>{var k;$(!i),(k=_.onClick)==null||k.call(_,y)}}:{onMouseEnter:y=>{var k;$(!0),(k=_.onMouseEnter)==null||k.call(_,y)},onMouseLeave:y=>{var k;$(!1),(k=_.onMouseLeave)==null||k.call(_,y)}},N=u.cloneElement(b,{ref:y=>{f.current=y;const k=b.ref;typeof k=="function"?k(y):k&&"current"in k&&(k.current=y)},"aria-expanded":i,...E}),g={top:"translate(-50%, -100%)",bottom:"translate(-50%, 0)",left:"translate(-100%, -50%)",right:"translate(0, -50%)"},w=i&&v&&typeof document<"u"?F.createPortal(e.jsx("div",{ref:p,role:"dialog",className:`fixed z-[2050] anicca-fade-in ${l}`,style:{top:v.top,left:v.left,transform:g[r]},children:e.jsx("div",{className:"bg-surface border border-border rounded-lg shadow-md p-3 min-w-[180px] text-[0.85rem] text-text dark:bg-surface dark:border-border dark:text-text",children:t})}),document.body):null;return e.jsxs(e.Fragment,{children:[N,w]})}const te={sm:"320px",md:"400px",lg:"520px",xl:"720px",full:"100%"};function Mr({open:t,onClose:r,side:a="right",size:n="md",title:o,footer:s,disableEscapeKey:d,disableBackdropClick:b,labels:l,className:h="",children:x}){const c=(l==null?void 0:l.close)??"Close";if(u.useEffect(()=>{if(!t||d)return;const $=_=>{_.key==="Escape"&&r()};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[t,r,d]),u.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),!t||typeof document>"u")return null;const i=a==="left"||a==="right",f=n in te?te[n]:n,p={[i?"width":"height"]:f,[i?"height":"width"]:"100%"},v={left:"top-0 left-0 h-full",right:"top-0 right-0 h-full",top:"top-0 left-0 w-full",bottom:"bottom-0 left-0 w-full"}[a],A={left:"animate-[anicca-slide-from-left_0.25s_ease-out]",right:"animate-[anicca-slide-from-right_0.25s_ease-out]",top:"animate-[anicca-slide-from-top_0.25s_ease-out]",bottom:"animate-[anicca-slide-from-bottom_0.25s_ease-out]"}[a];return F.createPortal(e.jsx("div",{className:"fixed inset-0 z-[1500] anicca-fade-in bg-surface-overlay/60",onClick:b?void 0:r,role:"dialog","aria-modal":"true",children:e.jsxs("div",{className:`absolute bg-surface shadow-lg flex flex-col dark:bg-surface ${v} ${A} ${h}`,style:p,onClick:$=>$.stopPropagation(),children:[o&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[e.jsx("h2",{className:"text-[1rem] font-bold text-text m-0",children:o}),e.jsx("button",{type:"button",onClick:r,"aria-label":c,className:"w-8 h-8 rounded-lg bg-surface-muted text-text-muted hover:bg-border hover:text-text inline-flex items-center justify-center text-[1.1rem] transition-colors",children:"×"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5 text-text",children:x}),s&&e.jsx("div",{className:"px-6 py-4 border-t border-border flex justify-end gap-2 shrink-0",children:s})]})}),document.body)}const ae=6;function Ir({content:t,placement:r="bottom-start",open:a,onOpenChange:n,matchTriggerWidth:o,children:s,className:d=""}){const b=a!==void 0,[l,h]=u.useState(!1),x=b?a:l,c=u.useRef(null),i=u.useRef(null),[f,p]=u.useState(null),v=u.useCallback(g=>{b||h(g),n==null||n(g)},[b,n]);if(u.useEffect(()=>{if(!x||!c.current)return;const g=()=>{const w=c.current.getBoundingClientRect(),y=r.startsWith("bottom"),k=r.endsWith("end"),S=(y?w.bottom+ae:w.top-ae)+window.scrollY,L=(k?w.right:w.left)+window.scrollX;p({top:S,left:L,width:w.width})};return g(),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[x,r]),u.useEffect(()=>{if(!x)return;const g=y=>{var S,L;const k=y.target;(S=i.current)!=null&&S.contains(k)||(L=c.current)!=null&&L.contains(k)||v(!1)},w=y=>{y.key==="Escape"&&v(!1)};return document.addEventListener("mousedown",g),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",w)}},[x,v]),!u.isValidElement(s))return s;const A=s.props,$=u.cloneElement(s,{ref:g=>{c.current=g;const w=s.ref;typeof w=="function"?w(g):w&&"current"in w&&(w.current=g)},"aria-expanded":x,"aria-haspopup":"menu",onClick:g=>{var w;v(!x),(w=A.onClick)==null||w.call(A,g)}}),_=r.endsWith("end"),E=r.startsWith("top"),N=x&&f&&typeof document<"u"?F.createPortal(e.jsx("div",{ref:i,role:"menu",className:`fixed z-[2050] anicca-fade-in ${d}`,style:{top:f.top,left:f.left,transform:`translate(${_?"-100%":"0"}, ${E?"-100%":"0"})`,minWidth:o?f.width:180},children:e.jsx("div",{className:"bg-surface border border-border rounded-lg shadow-md py-1.5 max-h-[60vh] overflow-y-auto dark:bg-surface dark:border-border",children:t})}),document.body):null;return e.jsxs(e.Fragment,{children:[$,N]})}function jr({className:t="",children:r,...a}){return e.jsx("div",{role:"menu",className:`flex flex-col ${t}`,...a,children:r})}function Dr({leftIcon:t,rightIcon:r,destructive:a,shortcut:n,className:o="",children:s,...d}){return e.jsxs("button",{type:"button",role:"menuitem",className:`flex items-center gap-2.5 px-3 py-2 text-left text-[0.85rem] cursor-pointer border-none bg-transparent transition-colors duration-150 hover:bg-surface-muted focus-visible:outline-none focus-visible:bg-surface-muted disabled:opacity-50 disabled:cursor-not-allowed dark:hover:bg-surface-container dark:focus-visible:bg-surface-container ${a?"text-danger hover:bg-danger/10 dark:hover:bg-danger/20":"text-text dark:text-text"} ${o}`,...d,children:[t&&e.jsx("span",{className:"shrink-0 inline-flex items-center w-4 h-4",children:t}),e.jsx("span",{className:"flex-1 truncate",children:s}),n&&e.jsx("span",{className:"text-[0.72rem] text-text-subtle font-mono ml-2",children:n}),r&&e.jsx("span",{className:"shrink-0 inline-flex items-center w-4 h-4",children:r})]})}function Br({className:t=""}){return e.jsx("div",{role:"separator",className:`my-1 h-px bg-border ${t}`})}function Fr({className:t="",children:r,...a}){return e.jsx("div",{className:`px-3 py-1.5 text-[0.68rem] uppercase tracking-[0.06em] font-semibold text-text-subtle ${t}`,...a,children:r})}const Pr={noResults:"No results",searchPlaceholder:"Type to search..."},Or=(t,r)=>r.label.toLowerCase().includes(t.toLowerCase());function Wr({options:t,value:r,defaultValue:a,onChange:n,filter:o=Or,renderOption:s,label:d,helper:b,error:l,placeholder:h,required:x,disabled:c,allowCustomValue:i,labels:f,wrapperClassName:p="",className:v=""}){const A={...Pr,...f},$=u.useId(),_=r!==void 0,[E,N]=u.useState(a??""),g=_?r:E,w=t.find(C=>C.value===g),[y,k]=u.useState((w==null?void 0:w.label)??""),[S,L]=u.useState(!1),[T,B]=u.useState(0),Z=u.useRef(null),H=u.useRef(null),Y=u.useRef(null);u.useEffect(()=>{w?k(w.label):i||k("")},[w,i]);const M=u.useMemo(()=>t.filter(C=>o(y,C)),[t,y,o]);u.useEffect(()=>{B(0)},[y,S]),u.useEffect(()=>{const C=D=>{var I;(I=Y.current)!=null&&I.contains(D.target)||L(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]);const O=C=>{var D;C.disabled||(_||N(C.value),n==null||n(C.value),k(C.label),L(!1),(D=H.current)==null||D.blur())},Lt=C=>{var D;if(C.key==="ArrowDown")C.preventDefault(),L(!0),B(I=>Math.min(I+1,M.length-1));else if(C.key==="ArrowUp")C.preventDefault(),B(I=>Math.max(I-1,0));else if(C.key==="Enter"){C.preventDefault();const I=M[T];I?O(I):i&&(_||N(y),n==null||n(y),L(!1))}else C.key==="Escape"&&(L(!1),(D=H.current)==null||D.blur())};return e.jsxs("div",{ref:Y,className:`flex flex-col gap-1.5 ${p}`,children:[d&&e.jsxs("label",{htmlFor:$,className:"text-[0.78rem] font-semibold text-text",children:[d,x&&e.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:H,id:$,type:"text",role:"combobox","aria-expanded":S,"aria-controls":`${$}-listbox`,"aria-activedescendant":S?`${$}-opt-${T}`:void 0,autoComplete:"off",disabled:c,required:x,value:y,placeholder:h??A.searchPlaceholder,onChange:C=>{k(C.target.value),L(!0)},onFocus:()=>L(!0),onKeyDown:Lt,"aria-invalid":l?!0:void 0,className:`w-full h-10 px-3 pr-9 text-[0.875rem] bg-surface border border-border rounded-lg text-text placeholder:text-text-subtle outline-none transition-[border-color,box-shadow] duration-200 focus:border-primary focus:ring-[var(--anicca-ring-width)] focus:ring-primary/20 dark:bg-surface dark:border-border dark:text-text dark:placeholder:text-text-subtle dark:focus:border-primary ${l?"border-danger focus:border-danger focus:ring-danger/20":""} ${c?"opacity-50 cursor-not-allowed bg-surface-muted dark:bg-surface-container":""} ${v}`}),e.jsx("svg",{className:`absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-muted pointer-events-none transition-transform ${S?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e.jsx("polyline",{points:"6 9 12 15 18 9",strokeLinecap:"round",strokeLinejoin:"round"})}),S&&e.jsx("ul",{ref:Z,id:`${$}-listbox`,role:"listbox",className:"absolute z-[2000] top-full left-0 right-0 mt-1 bg-surface border border-border rounded-lg shadow-md max-h-[260px] overflow-y-auto py-1.5 dark:bg-surface dark:border-border",children:M.length===0?e.jsx("li",{className:"px-3 py-2 text-[0.82rem] text-text-subtle",children:A.noResults}):M.map((C,D)=>{const I=D===T,Ne=C.value===g;return e.jsx("li",{id:`${$}-opt-${D}`,role:"option","aria-selected":Ne,onMouseEnter:()=>B(D),onMouseDown:Et=>{Et.preventDefault(),O(C)},className:`px-3 py-2 cursor-pointer text-[0.85rem] flex flex-col gap-0.5 ${I?"bg-surface-muted":""} ${Ne?"text-primary font-semibold":"text-text"} ${C.disabled?"opacity-50 cursor-not-allowed":""}`,children:s?s(C,I):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:C.label}),C.description&&e.jsx("span",{className:"text-[0.72rem] text-text-muted",children:C.description})]})},C.value)})})]}),l?e.jsx("span",{className:"text-[0.72rem] text-danger font-medium",children:l}):b?e.jsx("span",{className:"text-[0.72rem] text-text-muted",children:b}):null]})}function zr({title:t,value:r,icon:a,trend:n,trendLabel:o,color:s,className:d=""}){const b=n!==void 0?n>0?"up":n<0?"down":"neutral":null,l={up:"text-[#15803d] bg-[rgba(22,163,74,0.1)] dark:text-[#10b981] dark:bg-[rgba(16,185,129,0.18)]",down:"text-[#dc2626] bg-[rgba(220,38,38,0.1)] dark:text-[#ef4444] dark:bg-[rgba(239,68,68,0.18)]",neutral:"text-[#64748b] bg-[rgba(100,116,139,0.1)] dark:text-[#94a3b8] dark:bg-[rgba(100,116,139,0.18)]"};return e.jsxs("div",{className:`
|
|
2
|
+
relative overflow-hidden group
|
|
3
|
+
bg-surface-container-lowest rounded-[20px]
|
|
4
|
+
border border-on-surface/[0.06]
|
|
5
|
+
shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)]
|
|
6
|
+
dark:shadow-[0_1px_2px_rgba(0,0,0,0.3),0_12px_32px_-14px_rgba(0,0,0,0.5)]
|
|
7
|
+
transition-[transform,box-shadow] duration-[250ms] ease-[cubic-bezier(0.4,0,0.2,1)]
|
|
8
|
+
hover:-translate-y-[3px]
|
|
9
|
+
hover:shadow-[0_1px_2px_rgba(11,28,48,0.05),0_18px_44px_-16px_rgba(11,28,48,0.22)]
|
|
10
|
+
${d}
|
|
11
|
+
`,style:{padding:"1.5rem 1.5rem 1.5rem 1.625rem",borderLeft:`3px solid ${s??"rgb(var(--primary))"}`},role:"group","aria-label":`${t}: ${r}`,children:[e.jsx("div",{"aria-hidden":"true",className:"absolute top-0 right-0 w-[100px] h-[100px] rounded-full pointer-events-none",style:{background:"radial-gradient(circle, rgb(var(--primary) / 0.05) 0%, transparent 70%)",transform:"translate(30%, -30%)"}}),e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsx("span",{className:"text-[0.7rem] font-semibold text-outline uppercase tracking-[0.08em]",children:t}),a&&e.jsx("span",{className:"text-2xl text-[#94a3b8] opacity-80 transition-transform duration-300 ease-in-out group-hover:scale-110",children:a})]}),e.jsx("div",{className:"text-[1.875rem] font-bold font-display text-on-surface mb-3 tracking-[-0.03em] leading-[1.1] [font-variant-numeric:tabular-nums]",children:r}),n!==void 0&&b&&e.jsxs("div",{className:`inline-flex items-center gap-[0.35rem] text-[0.8rem] font-semibold rounded-[20px] py-1 px-[0.6rem] ${l[b]}`,children:[e.jsx("span",{className:"text-[0.7rem]",children:b==="up"?"↑":b==="down"?"↓":"→"}),e.jsxs("span",{className:"font-bold",children:[Math.abs(n),"%"]}),o&&e.jsx("span",{className:"text-[#94a3b8] font-normal ml-2 text-[0.75rem]",children:o})]})]})}const Hr={loading:"Loading chart"};function Vr({title:t,subtitle:r,children:a,loading:n=!1,empty:o=!1,emptyMessage:s="No data available",height:d=300,labels:b,className:l=""}){const h=typeof d=="number"?`${d}px`:d,x={...Hr,...b};return e.jsxs("div",{className:`bg-surface-container-lowest rounded-[20px] p-[1.75rem] shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.3),0_4px_12px_rgba(0,0,0,0.35)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] ${l}`,children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("div",{className:"text-[1.05rem] font-semibold text-on-surface tracking-[-0.02em]",children:t}),r&&e.jsx("div",{className:"text-[0.8rem] text-outline dark:text-[#94a3b8] mt-[0.3rem] font-normal",children:r})]}),e.jsx("div",{className:"relative w-full rounded-xl overflow-hidden",style:{height:h},children:n?e.jsx("div",{className:"w-full rounded-xl anicca-shimmer",style:{height:h},"aria-label":x.loading}):o?e.jsxs("div",{className:"anicca-empty-bg flex flex-col items-center justify-center gap-4 rounded-xl border-2 border-dashed border-[#e2e8f0] dark:border-[rgba(71,85,105,0.5)]",style:{height:h},children:[e.jsxs("svg",{className:"w-14 h-14 opacity-40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[e.jsx("path",{d:"M3 3v18h18",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 16l4-4 4 4 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("span",{className:"text-[0.9rem] text-[#64748b] dark:text-[#94a3b8] font-medium",children:s})]}):a})]})}const Ur={expand:"Expand sidebar",collapse:"Collapse sidebar",navigation:"Sidebar navigation"};function Yr({items:t,collapsed:r=!1,logo:a,footer:n,activePath:o="",labels:s,className:d=""}){const[b,l]=u.useState({}),h={...Ur,...s},x=i=>l(f=>({...f,[i]:!f[i]})),c=(i,f=!1)=>{var g;const p=o===i.href,v=(((g=i.children)==null?void 0:g.length)??0)>0,A=b[i.href],$=f?"text-primary font-semibold dark:text-white dark:font-semibold":["bg-primary-container/10 text-primary font-bold translate-x-1 rounded-lg","dark:bg-primary dark:text-white dark:shadow-lg dark:shadow-primary/20"].join(" "),_=f?"text-[#767586] hover:text-on-surface dark:text-[#64748b] dark:hover:text-[#e2e8f0]":["text-on-surface-variant hover:bg-secondary-container/30 hover:text-on-surface","dark:text-secondary dark:hover:text-white dark:hover:bg-surface-container-highest/50"].join(" "),E=["flex items-center gap-3 px-4 py-3 text-[0.875rem] font-medium","cursor-pointer transition-all duration-200 border-none bg-transparent text-left no-underline",f?"pl-[2.75rem] text-[0.82rem]":""].join(" "),N=e.jsxs(e.Fragment,{children:[i.icon&&e.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center text-[1.1rem] transition-transform duration-200 ease-in-out group-hover/item:scale-110",children:i.icon}),!r&&e.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis flex-1",children:i.label}),v&&!r&&e.jsx("span",{className:"ml-auto text-[0.65rem] transition-transform duration-[250ms] ease-[cubic-bezier(0.4,0,0.2,1)]",style:{opacity:A?1:.6,transform:A?"rotate(90deg)":"none"},children:"▶"})]});return e.jsxs("div",{className:"group/item",children:[v?e.jsx("button",{className:`${E} ${p?$:_}`,onClick:()=>x(i.href),"aria-expanded":A,children:N}):e.jsx("a",{href:i.href,className:`${E} ${p?$:_}`,"aria-current":p?"page":void 0,children:N}),v&&!r&&e.jsx("div",{className:"overflow-hidden transition-[max-height] duration-[350ms] ease-[cubic-bezier(0.4,0,0.2,1)]",style:{maxHeight:A?"500px":"0"},children:i.children.map(w=>c(w,!0))})]},i.href)};return e.jsxs("aside",{className:`
|
|
12
|
+
flex flex-col h-screen sticky top-0 overflow-hidden shrink-0
|
|
13
|
+
bg-surface dark:bg-sidebar-bg
|
|
14
|
+
border-r border-on-surface/[0.08] dark:border-outline-variant/30
|
|
15
|
+
dark:shadow-2xl
|
|
16
|
+
transition-[width] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]
|
|
17
|
+
${r?"w-[72px]":"w-[260px]"}
|
|
18
|
+
${d}
|
|
19
|
+
`,role:"navigation","aria-label":h.navigation,children:[a&&e.jsx("div",{className:`
|
|
20
|
+
flex items-center px-5 shrink-0
|
|
21
|
+
h-[68px] border-b border-on-surface/[0.08] dark:border-outline-variant/30
|
|
22
|
+
${r?"justify-center":""}
|
|
23
|
+
`,children:a}),e.jsx("nav",{className:"flex-1 flex flex-col gap-1 overflow-y-auto py-3 min-h-0 [scrollbar-width:thin] [scrollbar-color:rgb(var(--outline-variant))_transparent] dark:[scrollbar-color:#334155_transparent]",children:t.map(i=>c(i))}),e.jsx("div",{className:`
|
|
24
|
+
pt-4 pb-4 border-t border-outline-variant/10 shrink-0
|
|
25
|
+
`,children:n&&!r&&e.jsx("div",{className:"px-4 dark:px-0 mb-2",children:n})})]})}const Gr={toggleMenu:"Toggle menu"};function Jr({title:t,logo:r,actions:a,user:n,onMenuToggle:o,labels:s,className:d=""}){const b={...Gr,...s},l=h=>h.split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return e.jsxs("header",{className:`glass flex items-center justify-between px-7 h-[68px] sticky top-0 z-[100] border-b border-on-surface/[0.06] shadow-[0_1px_2px_rgba(11,28,48,0.03)] dark:border-outline-variant/50 dark:shadow-[0_1px_3px_rgba(0,0,0,0.3)] ${d}`,role:"banner",children:[e.jsxs("div",{className:"flex items-center gap-[0.85rem]",children:[o&&e.jsx("button",{className:"flex items-center justify-center w-[38px] h-[38px] rounded-[10px] cursor-pointer text-[1.2rem] transition-all duration-200 ease-in-out text-[#475569] border border-[rgba(226,232,240,0.8)] bg-[rgba(248,250,252,0.8)] hover:bg-[#f1f5f9] hover:border-[#cbd5e1] hover:text-[#1e293b] dark:bg-[rgba(30,41,59,0.7)] dark:border-[rgba(71,85,105,0.5)] dark:text-[#94a3b8] dark:hover:bg-[rgba(71,85,105,0.4)] dark:hover:border-[rgba(100,116,139,0.5)] dark:hover:text-on-surface",onClick:o,"aria-label":b.toggleMenu,children:"☰"}),r&&e.jsx("div",{className:"flex items-center",children:r}),t&&e.jsx("span",{className:"text-[1.1rem] font-semibold text-on-surface tracking-[-0.02em]",children:t})]}),e.jsxs("div",{className:"flex items-center gap-5",children:[a&&e.jsx("div",{className:"flex items-center gap-2",children:a}),n&&e.jsxs("div",{className:"flex items-center gap-3 rounded-xl transition-colors duration-200 ease-in-out hover:bg-[rgba(241,245,249,0.8)] dark:hover:bg-[rgba(71,85,105,0.3)] cursor-default",style:{padding:"0.4rem 0.6rem 0.4rem 0.4rem"},children:[e.jsx("div",{className:"w-[38px] h-[38px] rounded-[10px] flex items-center justify-center text-[0.8rem] font-bold text-white overflow-hidden shrink-0",style:{background:"linear-gradient(135deg, #3b82f6 0%, #6366f1 100%)",boxShadow:"0 2px 8px rgba(59,130,246,0.25)"},children:n.avatar?e.jsx("img",{src:n.avatar,alt:n.name,className:"w-full h-full object-cover"}):l(n.name)}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[0.85rem] font-semibold text-[#0f172a] dark:text-on-surface",children:n.name}),n.role&&e.jsx("span",{className:"text-[0.7rem] text-[#64748b] dark:text-[#94a3b8] font-normal",children:n.role})]})]})]})]})}function qr({items:t,separator:r="/",ariaLabel:a="Breadcrumb",className:n=""}){return e.jsx("nav",{className:`py-[0.6rem] ${n}`,"aria-label":a,children:e.jsx("ol",{className:"flex items-center list-none m-0 p-0 flex-wrap",children:t.map((o,s)=>{const d=s===t.length-1;return e.jsx("li",{className:"flex items-center",children:d?e.jsxs("span",{className:"inline-flex items-center gap-[0.35rem] text-[#0f172a] dark:text-on-surface text-[0.82rem] font-bold py-[0.3rem] px-[0.7rem] bg-[rgba(15,23,42,0.05)] dark:bg-[rgba(71,85,105,0.4)] rounded-[6px]",children:[o.icon&&e.jsx("span",{className:"flex items-center text-[0.85rem]",children:o.icon}),o.label]}):e.jsxs(e.Fragment,{children:[e.jsxs("a",{href:o.href||"#",className:"inline-flex items-center gap-[0.35rem] text-[#64748b] dark:text-[#94a3b8] no-underline text-[0.82rem] font-medium py-[0.3rem] px-[0.6rem] rounded-[6px] transition-all duration-200 ease-in-out hover:text-[#3b82f6] hover:bg-[rgba(59,130,246,0.08)] dark:hover:bg-[rgba(59,130,246,0.12)]",children:[o.icon&&e.jsx("span",{className:"flex items-center text-[0.85rem]",children:o.icon}),o.label]}),e.jsx("span",{"aria-hidden":"true",className:"mx-1 text-[#cbd5e1] dark:text-[#475569] text-[0.75rem] select-none",children:r})]})},`${o.label}-${s}`)})})})}const Zr={searchPlaceholder:"Search...",results:"results",emptyMessage:"No data found",page:"Page",of:"of",previous:"← Prev",next:"Next →"};function Kr({data:t,columns:r,searchable:a=!0,searchPlaceholder:n,pageSize:o=5,className:s="",labels:d}){const[b,l]=u.useState(""),[h,x]=u.useState(null),[c,i]=u.useState(!0),[f,p]=u.useState(0),v={...Zr,...d},A=u.useMemo(()=>{let N=t;if(b){const g=b.toLowerCase();N=N.filter(w=>r.some(y=>String(w[y.key]??"").toLowerCase().includes(g)))}return h&&(N=[...N].sort((g,w)=>{const y=String(g[h]??""),k=String(w[h]??"");return c?y.localeCompare(k,void 0,{numeric:!0}):k.localeCompare(y,void 0,{numeric:!0})})),N},[t,b,h,c,r]),$=o>0?Math.ceil(A.length/o):1,_=o>0?A.slice(f*o,(f+1)*o):A,E=N=>{h===N?i(!c):(x(N),i(!0))};return e.jsxs("div",{className:`bg-surface-container-lowest rounded-[20px] shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] overflow-hidden ${s}`,children:[a&&e.jsxs("div",{className:"flex items-center justify-between py-5 px-6 border-b border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-[#f8fafc] dark:bg-background border border-on-surface/[0.08] dark:border-[rgba(71,85,105,0.5)] rounded-[10px] py-2 px-[0.85rem] transition-[border-color,box-shadow] duration-200 focus-within:border-primary focus-within:shadow-[0_0_0_3px_rgb(var(--primary)/0.12)] dark:focus-within:border-primary dark:focus-within:shadow-[0_0_0_3px_rgba(59,130,246,0.15)]",children:[e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"shrink-0 text-outline","aria-hidden":"true",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"m21 21-4.35-4.35",strokeLinecap:"round"})]}),e.jsx("input",{className:"border-none bg-transparent outline-none text-[0.85rem] font-[inherit] text-on-surface dark:text-on-surface w-[200px] placeholder:text-[#94a3b8] dark:placeholder:text-[#64748b]",placeholder:n??v.searchPlaceholder,value:b,onChange:N=>{l(N.target.value),p(0)}})]}),e.jsxs("span",{className:"text-[0.75rem] font-medium text-[#94a3b8]",children:[A.length," ",v.results]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",children:[e.jsx("thead",{children:e.jsx("tr",{children:r.map(N=>e.jsxs("th",{className:`text-left py-[0.9rem] px-5 text-[0.68rem] font-semibold text-[#767586] dark:text-[#94a3b8] uppercase tracking-[0.08em] bg-transparent dark:bg-background border-b border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] whitespace-nowrap ${N.sortable?"cursor-pointer select-none transition-colors duration-150 hover:text-on-surface dark:hover:text-on-surface":""}`,style:N.width?{width:N.width}:void 0,onClick:N.sortable?()=>E(N.key):void 0,children:[N.label,N.sortable&&h===N.key&&e.jsx("span",{className:"text-[0.7rem] ml-1",children:c?"↑":"↓"})]},N.key))})}),e.jsx("tbody",{children:_.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length,className:"py-12 px-6 text-center text-[#94a3b8] text-[0.85rem]",children:v.emptyMessage})}):_.map((N,g)=>e.jsx("tr",{className:"group",children:r.map(w=>e.jsx("td",{className:`py-4 px-5 text-[0.85rem] text-on-surface dark:text-[#cbd5e1] align-middle border-b border-on-surface/[0.05] dark:border-[rgba(51,65,85,0.4)] last:border-b-0 transition-colors duration-150 group-hover:bg-primary/[0.07] dark:group-hover:bg-[rgba(71,85,105,0.35)] ${g%2!==0?"bg-surface-container-low/40 dark:bg-[rgba(51,65,85,0.25)]":""}`,children:w.render?w.render(N[w.key],N):String(N[w.key]??"")},w.key))},g))})]})}),o>0&&$>1&&e.jsxs("div",{className:"flex items-center justify-center gap-4 py-4 px-6 border-t border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]",children:[e.jsx("button",{className:"py-[0.45rem] px-[0.9rem] border border-on-surface/10 dark:border-[rgba(71,85,105,0.5)] rounded-[10px] bg-surface-container-lowest dark:bg-[#1e293b] text-[0.78rem] font-semibold text-[#565e74] dark:text-[#cbd5e1] cursor-pointer font-[inherit] transition-all duration-150 disabled:opacity-40 disabled:cursor-not-allowed hover:enabled:border-primary hover:enabled:text-primary hover:enabled:bg-primary/[0.04] dark:hover:enabled:border-[#3b82f6] dark:hover:enabled:text-[#3b82f6]",disabled:f===0,onClick:()=>p(f-1),children:v.previous}),e.jsxs("span",{className:"text-[0.78rem] text-[#64748b] dark:text-[#94a3b8] font-medium",children:[v.page," ",f+1," ",v.of," ",$]}),e.jsx("button",{className:"py-[0.45rem] px-[0.9rem] border border-on-surface/10 dark:border-[rgba(71,85,105,0.5)] rounded-[10px] bg-surface-container-lowest dark:bg-[#1e293b] text-[0.78rem] font-semibold text-[#565e74] dark:text-[#cbd5e1] cursor-pointer font-[inherit] transition-all duration-150 disabled:opacity-40 disabled:cursor-not-allowed hover:enabled:border-primary hover:enabled:text-primary hover:enabled:bg-primary/[0.04] dark:hover:enabled:border-[#3b82f6] dark:hover:enabled:text-[#3b82f6]",disabled:f>=$-1,onClick:()=>p(f+1),children:v.next})]})]})}function Xr({items:t,title:r,badge:a,className:n=""}){const o=r&&r.length>0||a;return e.jsxs("div",{className:`bg-surface-container-lowest rounded-[20px] p-6 shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] ${n}`,children:[o&&e.jsxs("div",{className:"flex justify-between items-center mb-5",children:[r?e.jsx("span",{className:"text-[0.95rem] font-bold text-[#0f172a] dark:text-on-surface",children:r}):e.jsx("span",{}),a&&e.jsx("span",{children:a})]}),e.jsx("div",{className:"flex flex-col",children:t.map((s,d)=>e.jsxs("div",{className:"flex gap-[0.85rem] py-[0.85rem] relative",children:[d<t.length-1&&e.jsx("div",{"aria-hidden":"true",className:"absolute left-[18px] top-[48px] bottom-0 w-[1.5px]",style:{background:"linear-gradient(180deg, rgb(var(--outline-variant)), transparent)"}}),e.jsx("div",{className:"w-9 h-9 rounded-[10px] flex items-center justify-center text-[0.95rem] shrink-0 relative z-[1]",style:{background:s.iconBg||"rgb(var(--surface-container-low))"},children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[0.82rem] text-[#334155] dark:text-[#cbd5e1] leading-[1.5]",children:s.message}),e.jsx("div",{className:"text-[0.7rem] text-[#94a3b8] mt-[0.2rem]",children:s.time})]})]},d))})]})}const Qr={unit:"projects"};function Rr({items:t,title:r,showCount:a=!0,labels:n,className:o=""}){const s={...Qr,...n};return e.jsxs("div",{className:`bg-surface-container-lowest rounded-[20px] p-6 shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] ${o}`,children:[r&&e.jsxs("div",{className:"flex justify-between items-center mb-5",children:[e.jsx("span",{className:"text-[0.95rem] font-bold text-[#0f172a] dark:text-on-surface",children:r}),a&&e.jsxs("span",{className:"text-[0.68rem] font-semibold py-[0.2rem] px-[0.55rem] rounded-[20px] bg-[#f5f3ff] text-violet dark:bg-[rgba(59,130,246,0.18)] dark:text-[#3b82f6]",children:[t.length," ",s.unit]})]}),t.map((d,b)=>{const l=d.color||"rgb(var(--primary))";return e.jsxs("div",{className:`py-[0.85rem] ${b<t.length-1?"border-b border-[#f8fafc] dark:border-[rgba(51,65,85,0.4)]":"border-b-0 pb-0"} ${b===0&&!r?"pt-0":""}`,children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"text-[0.85rem] font-semibold text-[#0f172a] dark:text-on-surface",children:d.name}),e.jsxs("span",{className:"text-[0.75rem] font-bold",style:{color:l},children:[d.progress,"%"]})]}),e.jsx("div",{className:"h-[7px] bg-[#f1f5f9] dark:bg-[rgba(71,85,105,0.4)] rounded overflow-hidden",children:e.jsx("div",{className:"h-full rounded transition-[width] duration-500 ease-in-out",style:{width:`${d.progress}%`,background:l}})}),(d.status||d.team)&&e.jsxs("div",{className:"flex justify-between items-center mt-[0.4rem]",children:[d.status&&e.jsx("span",{className:"text-[0.7rem] text-[#94a3b8]",children:d.status}),d.team&&e.jsx("div",{className:"flex",children:d.team.map((h,x)=>{const c=typeof h=="string"?h:h.color,i=typeof h=="string"?String.fromCharCode(65+x):h.label??String.fromCharCode(65+x);return e.jsx("div",{className:"w-[22px] h-[22px] rounded-full border-2 border-surface-container-lowest dark:border-[#1e293b] flex items-center justify-center text-[0.55rem] font-bold text-white",style:{background:c,marginLeft:x===0?0:"-6px"},children:i},x)})})]})]},d.name)})]})}const et={close:"Close"};function rt({open:t,onClose:r,title:a,children:n,footer:o,disableEscapeKey:s=!1,disableBackdropClick:d=!1,labels:b,className:l=""}){const h={...et,...b};return u.useEffect(()=>{if(!t||s)return;const x=c=>{c.key==="Escape"&&r()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[t,r,s]),u.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),t?e.jsx("div",{className:"fixed inset-0 backdrop-blur-[4px] flex items-center justify-center z-[1000] anicca-fade-in p-4",style:{background:"rgba(15,23,42,0.6)"},onClick:d?void 0:r,role:"dialog","aria-modal":"true","aria-label":a,children:e.jsxs("div",{className:`bg-surface-container-lowest rounded-[22px] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] w-full max-w-[480px] max-h-[90vh] overflow-y-auto anicca-slide-up shadow-[0_24px_70px_-20px_rgba(11,28,48,0.35),0_8px_24px_-12px_rgb(var(--primary)/0.12)] dark:shadow-[0_20px_60px_rgba(0,0,0,0.55)] ${l}`,onClick:x=>x.stopPropagation(),children:[a&&e.jsxs("div",{className:"flex items-center justify-between py-5 px-6 border-b border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]",children:[e.jsx("span",{className:"text-body-base font-semibold tracking-[-0.01em] text-on-surface",children:a}),e.jsx("button",{className:"w-8 h-8 rounded-[10px] border-none bg-on-surface/[0.05] text-secondary text-[1.1rem] cursor-pointer flex items-center justify-center transition-all duration-150 font-[inherit] hover:bg-[#e2e8f0] hover:text-[#1e293b] dark:bg-[#334155] dark:text-[#94a3b8] dark:hover:bg-[#475569] dark:hover:text-on-surface",onClick:r,"aria-label":h.close,children:"×"})]}),e.jsx("div",{className:"p-6 text-on-surface",children:n}),o&&e.jsx("div",{className:"flex justify-end gap-3 py-4 px-6 border-t border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)]",children:o})]})}):null}function tt({tabs:t,defaultTab:r,activeKey:a,onChange:n,className:o=""}){var x;const[s,d]=u.useState(r||((x=t[0])==null?void 0:x.key)||""),b=a??s,l=t.find(c=>c.key===b),h=c=>{a===void 0&&d(c),n==null||n(c)};return e.jsxs("div",{className:`bg-surface-container-lowest rounded-[20px] shadow-[0_1px_2px_rgba(11,28,48,0.04),0_12px_32px_-14px_rgba(11,28,48,0.14)] dark:shadow-[0_1px_3px_rgba(0,0,0,0.3),0_2px_8px_rgba(0,0,0,0.3)] border border-on-surface/[0.06] overflow-hidden ${o}`,children:[e.jsx("div",{className:"flex pt-2 px-6 border-b border-[#f1f5f9] dark:border-outline-variant/50",role:"tablist",children:t.map(c=>{const i=b===c.key;return e.jsxs("button",{className:`
|
|
26
|
+
py-[0.7rem] px-[1.1rem] text-[0.82rem] font-medium cursor-pointer
|
|
27
|
+
border-none bg-transparent border-b-2 transition-all duration-200
|
|
28
|
+
flex items-center gap-[0.4rem] font-[inherit] -mb-px
|
|
29
|
+
${i?"text-primary border-b-primary font-semibold":"text-secondary border-b-transparent hover:text-on-surface dark:text-[#94a3b8] dark:hover:text-on-surface"}
|
|
30
|
+
`,onClick:()=>h(c.key),role:"tab","aria-selected":i,children:[c.icon&&e.jsx("span",{className:"text-[0.9rem]",children:c.icon}),c.label]},c.key)})}),e.jsx("div",{className:"p-6 text-on-surface",role:"tabpanel",children:l==null?void 0:l.content})]})}function at(t="This field is required"){return{validate:r=>r==null?!1:typeof r=="string"?r.trim().length>0:Array.isArray(r)?r.length>0:!0,message:t}}function nt(t="Invalid email address"){return{validate:r=>typeof r!="string"?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r),message:t}}function ot(t,r){return{validate:a=>typeof a!="string"?!1:a.length>=t,message:r||`Must be at least ${t} characters`}}function st(t,r){return{validate:a=>typeof a!="string"?!1:a.length<=t,message:r||`Must be at most ${t} characters`}}function it(t,r="Invalid format"){return{validate:a=>typeof a!="string"?!1:t.test(a),message:r}}function ct(t,r){return{validate:a=>typeof a!="number"?!1:a>=t,message:r||`Must be at least ${t}`}}function lt(t,r){return{validate:a=>typeof a!="number"?!1:a<=t,message:r||`Must be at most ${t}`}}function dt(t,r){return{validate:t,message:r}}function ut(t){const{initialValues:r,validationSchema:a,onSubmit:n}=t,[o,s]=u.useState(r),[d,b]=u.useState({}),[l,h]=u.useState({}),[x,c]=u.useState(!1),i=u.useCallback((g,w)=>{const y=a==null?void 0:a[g];if(y){for(const k of y)if(!k.validate(w))return k.message}},[a]),f=u.useCallback(()=>{const g={};for(const w of Object.keys(r)){const y=i(w,o[w]);y&&(g[w]=y)}return g},[r,i,o]),p=Object.keys(d).length===0,v=u.useCallback(g=>w=>{const y=w.target.value;if(s(k=>({...k,[g]:y})),l[g]){const k=i(g,y);b(S=>{const L={...S};return k?L[g]=k:delete L[g],L})}},[l,i]),A=u.useCallback(g=>()=>{h(y=>({...y,[g]:!0}));const w=i(g,o[g]);b(y=>{const k={...y};return w?k[g]=w:delete k[g],k})},[i,o]),$=u.useCallback(async g=>{g&&g.preventDefault();const w={};for(const k of Object.keys(r))w[k]=!0;h(w);const y=f();if(b(y),Object.keys(y).length===0&&n){c(!0);try{await n(o)}finally{c(!1)}}},[r,n,f,o]),_=u.useCallback(()=>{s(r),b({}),h({}),c(!1)},[r]),E=u.useCallback((g,w)=>{if(s(y=>({...y,[g]:w})),l[g]){const y=i(g,w);b(k=>{const S={...k};return y?S[g]=y:delete S[g],S})}},[l,i]),N=u.useCallback((g,w)=>{b(y=>({...y,[g]:w}))},[]);return{values:o,errors:d,touched:l,isValid:p,isSubmitting:x,handleChange:v,handleBlur:A,handleSubmit:$,reset:_,setFieldValue:E,setFieldError:N}}const ft=["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],bt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ht=["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],pt=["January","February","March","April","May","June","July","August","September","October","November","December"];function j(t){return typeof t=="string"?new Date(t):new Date(t.getTime())}function z(t){return t.toString().padStart(2,"0")}function ne(t,r,a="en"){const n=j(t),o=a==="id"?ft:bt,s=a==="id"?ht:pt;return r.replace("YYYY",n.getFullYear().toString()).replace("MM",z(n.getMonth()+1)).replace("DD",z(n.getDate())).replace("HH",z(n.getHours())).replace("mm",z(n.getMinutes())).replace("ss",z(n.getSeconds())).replace("dddd",o[n.getDay()]).replace("MMMM",s[n.getMonth()])}function oe(t,r,a){const n=j(t),o=j(r);if(a==="years")return Math.abs(n.getFullYear()-o.getFullYear());if(a==="months")return Math.abs((n.getFullYear()-o.getFullYear())*12+(n.getMonth()-o.getMonth()));const s=Math.abs(n.getTime()-o.getTime());return Math.floor(s/{seconds:1e3,minutes:6e4,hours:36e5,days:864e5}[a])}function se(t,r="en"){const a=j(t),o=new Date().getTime()-a.getTime(),s=o<0,d=Math.abs(o),b=Math.floor(d/1e3),l=Math.floor(d/6e4),h=Math.floor(d/36e5),x=Math.floor(d/864e5),c=Math.floor(x/7),i=Math.floor(x/30),f=Math.floor(x/365);if(r==="id"){const p=s?"lagi":"lalu";return b<60?"baru saja":l<60?`${l} menit ${p}`:h<24?`${h} jam ${p}`:x<7?`${x} hari ${p}`:c<4?`${c} minggu ${p}`:i<12?`${i} bulan ${p}`:`${f} tahun ${p}`}return b<60?"just now":s?l<60?`in ${l} minutes`:h<24?`in ${h} hours`:x<7?`in ${x} days`:c<4?`in ${c} weeks`:i<12?`in ${i} months`:`in ${f} years`:l<60?`${l} minutes ago`:h<24?`${h} hours ago`:x<7?`${x} days ago`:c<4?`${c} weeks ago`:i<12?`${i} months ago`:`${f} years ago`}function ie(t,r){const a=j(t);switch(r){case"day":return a.setHours(0,0,0,0),a;case"week":{const n=a.getDay();return a.setDate(a.getDate()-n),a.setHours(0,0,0,0),a}case"month":return a.setDate(1),a.setHours(0,0,0,0),a;case"year":return a.setMonth(0,1),a.setHours(0,0,0,0),a}}function ce(t,r){const a=j(t);switch(r){case"day":return a.setHours(23,59,59,999),a;case"week":{const n=a.getDay();return a.setDate(a.getDate()+(6-n)),a.setHours(23,59,59,999),a}case"month":return a.setMonth(a.getMonth()+1,0),a.setHours(23,59,59,999),a;case"year":return a.setMonth(11,31),a.setHours(23,59,59,999),a}}function le(t,r,a){const n=j(t);switch(a){case"minutes":return n.setMinutes(n.getMinutes()+r),n;case"hours":return n.setHours(n.getHours()+r),n;case"days":return n.setDate(n.getDate()+r),n;case"months":return n.setMonth(n.getMonth()+r),n;case"years":return n.setFullYear(n.getFullYear()+r),n}}function de(t){return t instanceof Date?!isNaN(t.getTime()):typeof t=="string"?!isNaN(new Date(t).getTime()):!1}function ue(t,r){return j(t).getTime()<j(r).getTime()}function fe(t,r){return j(t).getTime()>j(r).getTime()}function xt(t){const[r,a]=u.useState(()=>{if(t==null)return null;const f=typeof t=="string"?new Date(t):t;return isNaN(f.getTime())?null:f}),n=u.useCallback(f=>{if(f===null){a(null);return}const p=typeof f=="string"?new Date(f):f;a(isNaN(p.getTime())?null:p)},[]),o=u.useCallback((f,p="en")=>r?ne(r,f,p):"",[r]),s=u.useCallback((f,p)=>r?oe(r,f,p):0,[r]),d=u.useCallback((f="en")=>r?se(r,f):"",[r]),b=u.useCallback((f,p)=>r?le(r,f,p):new Date,[r]),l=u.useCallback(f=>r?ie(r,f):new Date,[r]),h=u.useCallback(f=>r?ce(r,f):new Date,[r]),x=u.useCallback(()=>de(r),[r]),c=u.useCallback(f=>r?ue(r,f):!1,[r]),i=u.useCallback(f=>r?fe(r,f):!1,[r]);return{date:r,setDate:n,format:o,diff:s,relative:d,add:b,startOf:l,endOf:h,isValid:x,isBefore:c,isAfter:i}}function be(t,r){let a=null;return(...n)=>{a&&clearTimeout(a),a=setTimeout(()=>t(...n),r)}}function he(t,r){let a=0;return(...n)=>{const o=Date.now();o-a>=r&&(a=o,t(...n))}}function pe(t,r,a="..."){return t.length<=r?t:t.slice(0,r)+a}async function xe(t){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(t),!0;const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");return document.body.removeChild(r),a}catch{return!1}}function ge(t){return t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function me(t){return t&&t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function ve(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}function G(t,r=""){const a={};for(const n of Object.keys(t)){const o=r?`${r}.${n}`:n,s=t[n];s!==null&&typeof s=="object"&&!Array.isArray(s)?Object.assign(a,G(s,o)):a[o]=s}return a}function ye(t,r){const a={};for(const n of t){const o=String(n[r]);a[o]||(a[o]=[]),a[o].push(n)}return a}function ke(t,r){const a=new Set;return t.filter(n=>{const o=n[r];return a.has(o)?!1:(a.add(o),!0)})}function gt(){return u.useMemo(()=>({debounce:be,throttle:he,truncate:pe,copyToClipboard:xe,slugify:ge,capitalize:me,deepClone:ve,flattenObject:G,groupBy:ye,uniqueBy:ke}),[])}const mt={signinTitle:"Sign in with email",signupTitle:"Create an account",recoverTitle:"Reset your password",signinSubtitle:"Welcome back! Enter your credentials.",signupSubtitle:"Start your journey today.",recoverSubtitle:"We'll send a reset link to your email.",nameLabel:"Full Name",namePlaceholder:"Jane Smith",emailLabel:"Email address",emailPlaceholder:"you@example.com",passwordLabel:"Password",passwordPlaceholder:"••••••••",showPassword:"Show password",hidePassword:"Hide password",forgotPassword:"Forgot password?",signinCta:"Get Started",signupCta:"Create Account",recoverCta:"Send Reset Link",divider:"Or sign in with",toSignup:"Don't have an account? Sign up",toSignin:"Already have an account? Sign in",toRecover:"← Return to sign in"};function we({size:t=22}){return e.jsxs("svg",{"aria-hidden":"true",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function vt(){return e.jsxs("svg",{"aria-hidden":"true",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]})}function yt(){return e.jsxs("svg",{"aria-hidden":"true",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"8",r:"4"}),e.jsx("path",{d:"M4 20c0-4 3.6-7 8-7s8 3 8 7"})]})}function kt(){return e.jsxs("svg",{"aria-hidden":"true",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function wt(){return e.jsxs("svg",{"aria-hidden":"true",width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),e.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),e.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})}function Nt(){return e.jsxs("svg",{"aria-hidden":"true",width:15,height:15,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function At(){return e.jsxs("svg",{"aria-hidden":"true",className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}function $t(){return e.jsxs("svg",{"aria-hidden":"true",width:18,height:18,viewBox:"0 0 24 24",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function _t(){return e.jsx("svg",{"aria-hidden":"true",width:18,height:18,viewBox:"0 0 24 24",fill:"#1877F2",children:e.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})}function St(){return e.jsx("svg",{"aria-hidden":"true",width:17,height:17,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})})}function J({label:t,type:r,value:a,onChange:n,placeholder:o,leftAddon:s,rightAddon:d,autoComplete:b,disabled:l}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-label-sm font-semibold text-on-surface",children:t}),e.jsxs("div",{className:`flex items-center gap-2 h-11 px-3.5 rounded-[10px] border border-outline-variant bg-surface-container-low transition-[border-color,box-shadow] duration-200 focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/15 dark:bg-surface-container dark:border-outline-variant dark:focus-within:border-primary ${l?"opacity-50 cursor-not-allowed":""}`,children:[s&&e.jsx("span",{className:"text-on-surface-variant shrink-0 inline-flex items-center",children:s}),e.jsx("input",{type:r,value:a,onChange:h=>n(h.target.value),placeholder:o,autoComplete:b,disabled:l,className:"flex-1 min-w-0 bg-transparent outline-none border-none text-body-sm text-on-surface placeholder:text-on-surface-variant/50 font-[inherit] disabled:cursor-not-allowed"}),d&&e.jsx("span",{className:"text-on-surface-variant shrink-0 inline-flex items-center",children:d})]})]})}function q({onClick:t,"aria-label":r,children:a}){return e.jsx("button",{type:"button",onClick:t,"aria-label":r,className:"w-11 h-11 rounded-full border border-outline-variant bg-surface-container-lowest flex items-center justify-center hover:bg-surface-container-low hover:border-outline transition-colors dark:bg-surface-container dark:border-outline-variant dark:hover:bg-surface-container-high",children:a})}function Ct({open:t,onClose:r,mode:a,onModeChange:n,onSubmit:o,onGoogle:s,onFacebook:d,onApple:b,loading:l=!1,error:h,labels:x,disableEscapeKey:c=!1,disableBackdropClick:i=!1,className:f=""}){const p={...mt,...x},v=a??"signin",A=!!(s||d||b),[$,_]=u.useState(""),[E,N]=u.useState(""),[g,w]=u.useState(""),[y,k]=u.useState(!1),[S,L]=u.useState(!1),T=l||S;if(u.useEffect(()=>{if(!t||c)return;const M=O=>{O.key==="Escape"&&r()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[t,r,c]),u.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),!t||typeof document>"u")return null;const B={signin:p.signinTitle,signup:p.signupTitle,recover:p.recoverTitle}[v],Z={signin:p.signinSubtitle,signup:p.signupSubtitle,recover:p.recoverSubtitle}[v],H={signin:p.signinCta,signup:p.signupCta,recover:p.recoverCta}[v],Y=async M=>{if(M.preventDefault(),!T){L(!0);try{const O={mode:v,email:$,...v!=="recover"&&{password:E},...v==="signup"&&{name:g}};await o(O)}finally{L(!1)}}};return F.createPortal(e.jsx("div",{className:"fixed inset-0 backdrop-blur-[4px] flex items-center justify-center z-[1200] anicca-fade-in p-4",style:{background:"rgba(15,23,42,0.6)"},onClick:i?void 0:r,role:"dialog","aria-modal":"true","aria-labelledby":"anicca-auth-modal-title",children:e.jsxs("div",{className:`bg-surface-container-lowest rounded-[24px] border border-on-surface/[0.06] dark:border-[rgba(51,65,85,0.5)] w-full max-w-[400px] anicca-slide-up shadow-[0_24px_70px_-20px_rgba(11,28,48,0.35),0_8px_24px_-12px_rgb(var(--primary)/0.12)] dark:shadow-[0_20px_60px_rgba(0,0,0,0.55)] ${f}`,onClick:M=>M.stopPropagation(),children:[e.jsxs("div",{className:"flex flex-col items-center pt-8 pb-2 px-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-[14px] bg-primary/10 flex items-center justify-center mb-4 text-primary",children:e.jsx(we,{size:22})}),e.jsx("h2",{id:"anicca-auth-modal-title",className:"text-headline-md text-on-surface text-center m-0",children:B}),e.jsx("p",{className:"text-body-sm text-on-surface-variant text-center mt-1 mb-0",children:Z})]}),h&&e.jsxs("div",{className:"mx-8 mt-4 flex items-center gap-2.5 px-4 py-3 rounded-[10px] bg-error/[0.08] border border-error/20 text-error text-body-sm",children:[e.jsx("span",{className:"shrink-0",children:e.jsx(Nt,{})}),h]}),e.jsxs("form",{className:"px-8 pt-5 pb-6 flex flex-col gap-4",onSubmit:Y,noValidate:!0,children:[v==="signup"&&e.jsx(J,{label:p.nameLabel,type:"text",value:g,onChange:w,placeholder:p.namePlaceholder,leftAddon:e.jsx(yt,{}),autoComplete:"name",disabled:T}),e.jsx(J,{label:p.emailLabel,type:"email",value:$,onChange:_,placeholder:p.emailPlaceholder,leftAddon:e.jsx(vt,{}),autoComplete:"email",disabled:T}),v!=="recover"&&e.jsx(J,{label:p.passwordLabel,type:y?"text":"password",value:E,onChange:N,placeholder:p.passwordPlaceholder,leftAddon:e.jsx(we,{size:16}),rightAddon:e.jsx("button",{type:"button",onClick:()=>k(M=>!M),"aria-label":y?p.hidePassword:p.showPassword,className:"text-on-surface-variant hover:text-on-surface transition-colors cursor-pointer",children:y?e.jsx(wt,{}):e.jsx(kt,{})}),autoComplete:v==="signin"?"current-password":"new-password",disabled:T}),v==="signin"&&e.jsx("div",{className:"flex justify-end -mt-2",children:e.jsx("button",{type:"button",className:"text-label-sm text-primary hover:underline underline-offset-4 transition-colors font-[inherit] cursor-pointer",onClick:()=>n==null?void 0:n("recover"),children:p.forgotPassword})}),e.jsxs("button",{type:"submit",disabled:T,className:"relative w-full h-11 rounded-[12px] font-semibold text-label-md tracking-tight hover:opacity-90 active:opacity-100 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 mt-1 font-[inherit] cursor-pointer",style:{background:"rgb(var(--on-surface))",color:"rgb(var(--surface-container-lowest))"},children:[T&&e.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(At,{})}),e.jsx("span",{className:T?"opacity-0":"",children:H})]})]}),v!=="recover"&&A&&e.jsxs("div",{className:"px-8 pb-7",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-outline-variant"}),e.jsx("span",{className:"text-label-sm text-on-surface-variant whitespace-nowrap",children:p.divider}),e.jsx("div",{className:"flex-1 h-px bg-outline-variant"})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[s&&e.jsx(q,{onClick:s,"aria-label":"Sign in with Google",children:e.jsx($t,{})}),d&&e.jsx(q,{onClick:d,"aria-label":"Sign in with Facebook",children:e.jsx(_t,{})}),b&&e.jsx(q,{onClick:b,"aria-label":"Sign in with Apple",children:e.jsx(St,{})})]})]}),e.jsxs("div",{className:"text-center pb-6 px-8 text-body-sm text-on-surface-variant",children:[v==="signin"&&e.jsx("button",{type:"button",className:"text-primary hover:underline underline-offset-4 font-[inherit] cursor-pointer",onClick:()=>n==null?void 0:n("signup"),children:p.toSignup}),v==="signup"&&e.jsx("button",{type:"button",className:"text-primary hover:underline underline-offset-4 font-[inherit] cursor-pointer",onClick:()=>n==null?void 0:n("signin"),children:p.toSignin}),v==="recover"&&e.jsx("button",{type:"button",className:"text-primary hover:underline underline-offset-4 font-[inherit] cursor-pointer",onClick:()=>n==null?void 0:n("signin"),children:p.toRecover})]})]})}),document.body)}m.ANICCA_THEME_CSS_VAR_MAP=K,m.AniccaActivityFeed=Xr,m.AniccaAlert=gr,m.AniccaAuthModal=Ct,m.AniccaAvatar=R,m.AniccaAvatarGroup=ir,m.AniccaBadge=ar,m.AniccaBreadcrumb=qr,m.AniccaButton=Ce,m.AniccaCard=We,m.AniccaCardBody=Ue,m.AniccaCardDescription=Ve,m.AniccaCardFooter=Ye,m.AniccaCardHeader=ze,m.AniccaCardTitle=He,m.AniccaChartWrapper=Vr,m.AniccaCheckbox=je,m.AniccaCombobox=Wr,m.AniccaDataTable=Kr,m.AniccaDivider=Xe,m.AniccaDrawer=Mr,m.AniccaDropdown=Ir,m.AniccaGrid=Ke,m.AniccaInput=Ee,m.AniccaMenu=jr,m.AniccaMenuDivider=Br,m.AniccaMenuItem=Dr,m.AniccaMenuLabel=Fr,m.AniccaModal=rt,m.AniccaNavbar=Jr,m.AniccaPagination=br,m.AniccaPopover=Tr,m.AniccaPopupProvider=Cr,m.AniccaProgressCard=Rr,m.AniccaRadio=Be,m.AniccaRadioGroup=De,m.AniccaSelect=Ie,m.AniccaSidebar=Yr,m.AniccaSkeleton=cr,m.AniccaSpinner=dr,m.AniccaStack=qe,m.AniccaStatCard=zr,m.AniccaSwitch=Pe,m.AniccaTabs=tt,m.AniccaTextarea=Te,m.AniccaThemeProvider=$e,m.AniccaToastProvider=kr,m.AniccaTooltip=Er,m.aniccaAdd=le,m.aniccaCapitalize=me,m.aniccaCopyToClipboard=xe,m.aniccaDebounce=be,m.aniccaDeepClone=ve,m.aniccaDiff=oe,m.aniccaEndOf=ce,m.aniccaFlattenObject=G,m.aniccaFormat=ne,m.aniccaGroupBy=ye,m.aniccaIsAfter=fe,m.aniccaIsBefore=ue,m.aniccaIsValid=de,m.aniccaRelative=se,m.aniccaSlugify=ge,m.aniccaStartOf=ie,m.aniccaThrottle=he,m.aniccaTruncate=pe,m.aniccaUniqueBy=ke,m.custom=dt,m.email=nt,m.max=lt,m.maxLength=st,m.min=ct,m.minLength=ot,m.pattern=it,m.required=at,m.useAniccaDate=xt,m.useAniccaForm=ut,m.useAniccaPopup=Lr,m.useAniccaToast=wr,m.useAniccaUtils=gt,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type AniccaAuthModalMode = 'signin' | 'signup' | 'recover';
|
|
4
|
+
/** Data passed to onSubmit; absent fields are undefined for the current mode. */
|
|
5
|
+
export interface AniccaAuthModalSubmitData {
|
|
6
|
+
mode: AniccaAuthModalMode;
|
|
7
|
+
email: string;
|
|
8
|
+
/** Absent in recover mode. */
|
|
9
|
+
password?: string;
|
|
10
|
+
/** Present only in signup mode. */
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Override any user-facing string. Unset keys fall back to English defaults. */
|
|
14
|
+
export interface AniccaAuthModalLabels {
|
|
15
|
+
signinTitle?: string;
|
|
16
|
+
signupTitle?: string;
|
|
17
|
+
recoverTitle?: string;
|
|
18
|
+
signinSubtitle?: string;
|
|
19
|
+
signupSubtitle?: string;
|
|
20
|
+
recoverSubtitle?: string;
|
|
21
|
+
nameLabel?: string;
|
|
22
|
+
namePlaceholder?: string;
|
|
23
|
+
emailLabel?: string;
|
|
24
|
+
emailPlaceholder?: string;
|
|
25
|
+
passwordLabel?: string;
|
|
26
|
+
passwordPlaceholder?: string;
|
|
27
|
+
showPassword?: string;
|
|
28
|
+
hidePassword?: string;
|
|
29
|
+
forgotPassword?: string;
|
|
30
|
+
signinCta?: string;
|
|
31
|
+
signupCta?: string;
|
|
32
|
+
recoverCta?: string;
|
|
33
|
+
divider?: string;
|
|
34
|
+
toSignup?: string;
|
|
35
|
+
toSignin?: string;
|
|
36
|
+
toRecover?: string;
|
|
37
|
+
[key: string]: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface AniccaAuthModalProps {
|
|
40
|
+
/** Controls visibility. */
|
|
41
|
+
open: boolean;
|
|
42
|
+
/** Called when modal should close (backdrop, Escape, ×). */
|
|
43
|
+
onClose: () => void;
|
|
44
|
+
/** Active form mode. Defaults to 'signin'. */
|
|
45
|
+
mode?: AniccaAuthModalMode;
|
|
46
|
+
/** Called when user clicks a mode-switch link. */
|
|
47
|
+
onModeChange?: (mode: AniccaAuthModalMode) => void;
|
|
48
|
+
/** Called on form submit. May be async; spinner shown until resolved. */
|
|
49
|
+
onSubmit: (data: AniccaAuthModalSubmitData) => void | Promise<void>;
|
|
50
|
+
/** Google OAuth callback. Button hidden when absent. */
|
|
51
|
+
onGoogle?: () => void;
|
|
52
|
+
/** Facebook OAuth callback. Button hidden when absent. */
|
|
53
|
+
onFacebook?: () => void;
|
|
54
|
+
/** Apple OAuth callback. Button hidden when absent. */
|
|
55
|
+
onApple?: () => void;
|
|
56
|
+
/** Disables form and shows spinner. */
|
|
57
|
+
loading?: boolean;
|
|
58
|
+
/** Error message shown in a red banner below the subtitle. */
|
|
59
|
+
error?: string;
|
|
60
|
+
/** i18n string overrides. */
|
|
61
|
+
labels?: AniccaAuthModalLabels;
|
|
62
|
+
/** Prevent Escape key from closing. */
|
|
63
|
+
disableEscapeKey?: boolean;
|
|
64
|
+
/** Prevent backdrop click from closing. */
|
|
65
|
+
disableBackdropClick?: boolean;
|
|
66
|
+
/** Extra className applied to the card element. */
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* AniccaAuthModal — Centered authentication dialog with sign-in, sign-up, and
|
|
71
|
+
* password-recovery modes. Includes email/password fields, optional social OAuth
|
|
72
|
+
* buttons, error banner, loading state, i18n labels, Escape key + backdrop-click
|
|
73
|
+
* close, and body scroll lock.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* const [open, setOpen] = useState(false)
|
|
78
|
+
* const [mode, setMode] = useState<AniccaAuthModalMode>('signin')
|
|
79
|
+
*
|
|
80
|
+
* <AniccaAuthModal
|
|
81
|
+
* open={open}
|
|
82
|
+
* onClose={() => setOpen(false)}
|
|
83
|
+
* mode={mode}
|
|
84
|
+
* onModeChange={setMode}
|
|
85
|
+
* onSubmit={async ({ email, password }) => { await signIn(email, password!) }}
|
|
86
|
+
* onGoogle={() => signInWithGoogle()}
|
|
87
|
+
* loading={isLoading}
|
|
88
|
+
* error={authError}
|
|
89
|
+
* />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function AniccaAuthModal({ open, onClose, mode, onModeChange, onSubmit, onGoogle, onFacebook, onApple, loading, error, labels, disableEscapeKey, disableBackdropClick, className, }: AniccaAuthModalProps): React.ReactElement | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthModal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthModal';
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* A single activity item.
|
|
5
|
-
*/
|
|
6
3
|
export interface AniccaActivityItem {
|
|
7
4
|
icon: React.ReactNode;
|
|
8
5
|
iconBg?: string;
|
|
9
6
|
message: React.ReactNode;
|
|
10
7
|
time: string;
|
|
11
8
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Props for AniccaActivityFeed.
|
|
14
|
-
*/
|
|
15
9
|
export interface AniccaActivityFeedProps {
|
|
16
10
|
items: AniccaActivityItem[];
|
|
17
|
-
/** Header title. Omit or pass empty string to hide the header entirely. */
|
|
18
11
|
title?: string;
|
|
19
|
-
/** Optional badge displayed on the right side of the header (e.g. live indicator). */
|
|
20
12
|
badge?: React.ReactNode;
|
|
21
13
|
className?: string;
|
|
22
14
|
}
|
|
23
15
|
/**
|
|
24
|
-
* AniccaActivityFeed —
|
|
25
|
-
* connector lines, icons, and timestamps.
|
|
16
|
+
* AniccaActivityFeed — Timeline-style activity feed with connector lines.
|
|
26
17
|
*/
|
|
27
18
|
export declare function AniccaActivityFeed({ items, title, badge, className, }: AniccaActivityFeedProps): React.ReactElement;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* A single breadcrumb item.
|
|
5
|
-
*/
|
|
6
3
|
export interface AniccaBreadcrumbItem {
|
|
7
4
|
label: string;
|
|
8
5
|
href?: string;
|
|
9
6
|
icon?: React.ReactNode;
|
|
10
7
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Props for the AniccaBreadcrumb component.
|
|
13
|
-
*/
|
|
14
8
|
export interface AniccaBreadcrumbProps {
|
|
15
9
|
items: AniccaBreadcrumbItem[];
|
|
16
10
|
separator?: React.ReactNode;
|
|
17
|
-
/** Aria label override for the nav element. Default "Breadcrumb". */
|
|
18
11
|
ariaLabel?: string;
|
|
19
12
|
className?: string;
|
|
20
13
|
}
|
|
21
14
|
/**
|
|
22
|
-
* AniccaBreadcrumb —
|
|
23
|
-
* the current page location within a hierarchy.
|
|
15
|
+
* AniccaBreadcrumb — Breadcrumb navigation showing current page location.
|
|
24
16
|
*/
|
|
25
17
|
export declare function AniccaBreadcrumb({ items, separator, ariaLabel, className, }: AniccaBreadcrumbProps): React.ReactElement;
|
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface AniccaChartWrapperLabels {
|
|
4
|
-
/** Aria label for the loading skeleton. Default "Loading chart". */
|
|
5
4
|
loading?: string;
|
|
6
5
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Props for the AniccaChartWrapper component.
|
|
9
|
-
*/
|
|
10
6
|
export interface AniccaChartWrapperProps {
|
|
11
|
-
/** Chart title */
|
|
12
7
|
title: string;
|
|
13
|
-
/** Optional subtitle */
|
|
14
8
|
subtitle?: string;
|
|
15
|
-
/** Chart content (any chart library or custom SVG) */
|
|
16
9
|
children: React.ReactNode;
|
|
17
|
-
/** Show loading skeleton */
|
|
18
10
|
loading?: boolean;
|
|
19
|
-
/** Show empty state */
|
|
20
11
|
empty?: boolean;
|
|
21
|
-
/** Message to display when empty. Default "No data available". */
|
|
22
12
|
emptyMessage?: string;
|
|
23
|
-
/** Height of the chart area */
|
|
24
13
|
height?: string | number;
|
|
25
|
-
/** i18n label overrides */
|
|
26
14
|
labels?: AniccaChartWrapperLabels;
|
|
27
|
-
/** Additional CSS class */
|
|
28
15
|
className?: string;
|
|
29
16
|
}
|
|
30
17
|
/**
|
|
31
|
-
* AniccaChartWrapper —
|
|
32
|
-
* skeleton and empty state support.
|
|
18
|
+
* AniccaChartWrapper — Container for charts with loading skeleton and empty state.
|
|
33
19
|
*/
|
|
34
20
|
export declare function AniccaChartWrapper({ title, subtitle, children, loading, empty, emptyMessage, height, labels, className, }: AniccaChartWrapperProps): React.ReactElement;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Column definition for AniccaDataTable.
|
|
5
|
-
*/
|
|
6
3
|
export interface AniccaColumn<T> {
|
|
7
4
|
key: keyof T & string;
|
|
8
5
|
label: string;
|
|
@@ -19,20 +16,16 @@ export interface AniccaDataTableLabels {
|
|
|
19
16
|
previous?: string;
|
|
20
17
|
next?: string;
|
|
21
18
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Props for AniccaDataTable.
|
|
24
|
-
*/
|
|
25
19
|
export interface AniccaDataTableProps<T extends object> {
|
|
26
20
|
data: T[];
|
|
27
21
|
columns: AniccaColumn<T>[];
|
|
28
22
|
searchable?: boolean;
|
|
23
|
+
searchPlaceholder?: string;
|
|
29
24
|
pageSize?: number;
|
|
30
25
|
className?: string;
|
|
31
|
-
/** i18n label overrides */
|
|
32
26
|
labels?: AniccaDataTableLabels;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
|
-
* AniccaDataTable —
|
|
36
|
-
* column sorting, pagination, and custom cell rendering.
|
|
29
|
+
* AniccaDataTable — Data table with search, column sorting, and pagination.
|
|
37
30
|
*/
|
|
38
|
-
export declare function AniccaDataTable<T extends object>({ data, columns, searchable, pageSize, className, labels, }: AniccaDataTableProps<T>): React.ReactElement;
|
|
31
|
+
export declare function AniccaDataTable<T extends object>({ data, columns, searchable, searchPlaceholder, pageSize, className, labels, }: AniccaDataTableProps<T>): React.ReactElement;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface AniccaModalLabels {
|
|
4
|
-
/** Aria label for the close (×) button. Default "Close". */
|
|
5
4
|
close?: string;
|
|
6
5
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Props for AniccaModal.
|
|
9
|
-
*/
|
|
10
6
|
export interface AniccaModalProps {
|
|
11
7
|
open: boolean;
|
|
12
8
|
onClose: () => void;
|
|
13
9
|
title?: string;
|
|
14
10
|
children: React.ReactNode;
|
|
15
11
|
footer?: React.ReactNode;
|
|
16
|
-
/** Disable escape key dismissal. Default false. */
|
|
17
12
|
disableEscapeKey?: boolean;
|
|
18
|
-
/** Disable backdrop click dismissal. Default false. */
|
|
19
13
|
disableBackdropClick?: boolean;
|
|
20
|
-
/** i18n label overrides */
|
|
21
14
|
labels?: AniccaModalLabels;
|
|
22
15
|
className?: string;
|
|
23
16
|
}
|
|
24
17
|
/**
|
|
25
|
-
* AniccaModal —
|
|
26
|
-
* slide-up animation, and keyboard dismiss support.
|
|
18
|
+
* AniccaModal — Accessible overlay dialog with backdrop blur and slide-up animation.
|
|
27
19
|
*/
|
|
28
20
|
export declare function AniccaModal({ open, onClose, title, children, footer, disableEscapeKey, disableBackdropClick, labels, className, }: AniccaModalProps): React.ReactElement | null;
|