prime-design-system 1.0.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/README.md +110 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/prime-design-system.css +2 -0
- package/dist/prime-design-system.es.js +2729 -0
- package/dist/prime-design-system.umd.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`,`react-dom`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.PrimeDesignSystem={},e.React,e.jsxRuntime,e.ReactDOM))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);var d=t.default.forwardRef(({className:e=``,items:r,allowMultiple:i=!1,...a},o)=>{let[s,c]=(0,t.useState)(new Set),l=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):(i||n.clear(),n.add(e)),n})};return(0,n.jsx)(`div`,{className:`nd-accordion-wrapper ${e}`,ref:o,...a,children:r.map(e=>{let t=s.has(e.id);return(0,n.jsxs)(`div`,{className:`nd-accordion-item`,children:[(0,n.jsxs)(`button`,{className:`nd-accordion-header`,onClick:()=>l(e.id),"aria-expanded":t,children:[(0,n.jsx)(`span`,{children:e.title}),(0,n.jsx)(`svg`,{className:`nd-accordion-icon ${t?`nd-accordion-icon--expanded`:``}`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),(0,n.jsx)(`div`,{className:`nd-accordion-content ${t?`nd-accordion-content--expanded`:``}`,children:e.content})]},e.id)})})});d.displayName=`Accordion`;var f={info:(0,n.jsxs)(`svg`,{width:`100%`,height:`100%`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,n.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`12`}),(0,n.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12.01`,y2:`8`})]}),success:(0,n.jsxs)(`svg`,{width:`100%`,height:`100%`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`M22 11.08V12a10 10 0 1 1-5.93-9.14`}),(0,n.jsx)(`polyline`,{points:`22 4 12 14.01 9 11.01`})]}),warning:(0,n.jsxs)(`svg`,{width:`100%`,height:`100%`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),(0,n.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,n.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),error:(0,n.jsxs)(`svg`,{width:`100%`,height:`100%`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,n.jsx)(`line`,{x1:`15`,y1:`9`,x2:`9`,y2:`15`}),(0,n.jsx)(`line`,{x1:`9`,y1:`9`,x2:`15`,y2:`15`})]})},p=t.default.forwardRef(({className:e=``,title:r,description:i,variant:a=`info`,icon:o,closable:s=!1,onClose:c,children:l,...u},d)=>{let[p,m]=(0,t.useState)(!0),h=()=>{m(!1),c&&c()};if(!p)return null;let g=o||f[a];return(0,n.jsxs)(`div`,{className:`nd-alert nd-alert--${a} ${e}`,ref:d,role:`alert`,...u,children:[(0,n.jsx)(`div`,{className:`nd-alert-icon`,children:g}),(0,n.jsxs)(`div`,{className:`nd-alert-content`,children:[r&&(0,n.jsx)(`h5`,{className:`nd-alert-title`,children:r}),i&&(0,n.jsx)(`p`,{className:`nd-alert-description`,children:i}),l&&(0,n.jsx)(`div`,{className:`nd-alert-description`,children:l})]}),s&&(0,n.jsx)(`button`,{className:`nd-alert-close`,onClick:h,"aria-label":`Close alert`,children:(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})});p.displayName=`Alert`;var m=t.default.forwardRef(({className:e=``,src:t,alt:r=`Avatar`,initials:i,size:a=`md`,...o},s)=>(0,n.jsx)(`div`,{ref:s,className:[`nd-avatar`,`nd-avatar--${a}`,e].filter(Boolean).join(` `),...o,children:t?(0,n.jsx)(`img`,{src:t,alt:r,className:`nd-avatar-image`}):(0,n.jsx)(`span`,{className:`nd-avatar-initials`,children:i?.substring(0,2)})}));m.displayName=`Avatar`;var h=t.default.forwardRef(({className:e=``,variant:t=`default`,children:r,...i},a)=>(0,n.jsx)(`span`,{ref:a,className:[`nd-badge`,t===`primary`?`nd-badge--primary`:``,e].filter(Boolean).join(` `),...i,children:r}));h.displayName=`Badge`;var g=t.default.forwardRef(({className:e=``,items:t,separator:r,...i},a)=>{let o=r||(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})});return(0,n.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,n.jsx)(`ol`,{className:`nd-breadcrumbs ${e}`,ref:a,...i,children:t.map((e,r)=>{let i=r===t.length-1;return(0,n.jsxs)(`li`,{className:`nd-breadcrumbs-item ${i?`nd-breadcrumbs-item--active`:``}`,"aria-current":i?`page`:void 0,children:[e.href&&!i?(0,n.jsx)(`a`,{href:e.href,className:`nd-breadcrumbs-link`,children:e.label}):(0,n.jsx)(`span`,{className:`nd-breadcrumbs-link`,children:e.label}),!i&&(0,n.jsx)(`span`,{className:`nd-breadcrumbs-separator`,"aria-hidden":`true`,children:o})]},r)})})})});g.displayName=`Breadcrumbs`;var _=t.default.forwardRef(({className:e=``,variant:t=`default`,isPressed:r=!1,children:i,...a},o)=>(0,n.jsx)(`button`,{ref:o,className:[`nd-button`,t===`primary`?`nd-button--primary`:``,r?`nd-button--pressed`:``,e].filter(Boolean).join(` `),...a,children:i}));_.displayName=`Button`;var v=({value:e,onChange:r,className:i=``})=>{let[a,o]=(0,t.useState)(e||new Date),s=e,c=new Date(a.getFullYear(),a.getMonth()+1,0).getDate(),l=new Date(a.getFullYear(),a.getMonth(),1).getDay(),u=()=>{o(new Date(a.getFullYear(),a.getMonth()-1,1))},d=()=>{o(new Date(a.getFullYear(),a.getMonth()+1,1))},f=e=>{let t=new Date(a.getFullYear(),a.getMonth(),e);r&&r(t)},p=e=>{let t=new Date;return t.getDate()===e&&t.getMonth()===a.getMonth()&&t.getFullYear()===a.getFullYear()},m=e=>s?s.getDate()===e&&s.getMonth()===a.getMonth()&&s.getFullYear()===a.getFullYear():!1;return(0,n.jsxs)(`div`,{className:`nd-calendar ${i}`,children:[(0,n.jsxs)(`div`,{className:`nd-calendar-header`,children:[(0,n.jsx)(`button`,{className:`nd-calendar-nav-btn`,onClick:u,"aria-label":`Previous Month`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),(0,n.jsxs)(`h2`,{className:`nd-calendar-title`,children:[[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`][a.getMonth()],` `,a.getFullYear()]}),(0,n.jsx)(`button`,{className:`nd-calendar-nav-btn`,onClick:d,"aria-label":`Next Month`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})]}),(0,n.jsxs)(`div`,{className:`nd-calendar-grid`,children:[[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`].map(e=>(0,n.jsx)(`div`,{className:`nd-calendar-weekday`,children:e},e)),Array.from({length:l}).map((e,t)=>(0,n.jsx)(`div`,{className:`nd-calendar-day nd-calendar-day--outside`},`empty-${t}`)),Array.from({length:c}).map((e,t)=>{let r=t+1,i=p(r),a=m(r);return(0,n.jsx)(`button`,{className:`nd-calendar-day ${i?`nd-calendar-day--today`:``} ${a?`nd-calendar-day--selected`:``}`,onClick:()=>f(r),children:r},`day-${r}`)})]})]})},y=t.default.forwardRef(({className:e=``,variant:t=`elevated`,children:r,...i},a)=>(0,n.jsx)(`div`,{ref:a,className:[`nd-card`,t===`elevated`?`nd-card--elevated`:`nd-card--sunken`,e].filter(Boolean).join(` `),...i,children:r}));y.displayName=`Card`;var b=t.default.forwardRef(({className:e=``,children:r,autoPlay:i=!1,interval:a=3e3,showIndicators:o=!0,showControls:s=!0,...c},l)=>{let[u,d]=(0,t.useState)(0),f=t.default.Children.count(r),p=(0,t.useCallback)(()=>{d(e=>e===f-1?0:e+1)},[f]),m=()=>{d(e=>e===0?f-1:e-1)};return(0,t.useEffect)(()=>{if(!i)return;let e=setInterval(p,a);return()=>clearInterval(e)},[i,a,p]),(0,n.jsxs)(`div`,{className:`nd-carousel ${e}`,ref:l,...c,children:[(0,n.jsx)(`div`,{className:`nd-carousel-viewport`,children:(0,n.jsx)(`div`,{className:`nd-carousel-container`,style:{transform:`translateX(-${u*100}%)`},children:t.default.Children.map(r,(e,t)=>(0,n.jsx)(`div`,{className:`nd-carousel-slide`,children:e},t))})}),s&&(0,n.jsxs)(`div`,{className:`nd-carousel-controls`,children:[(0,n.jsx)(`button`,{className:`nd-carousel-button`,onClick:m,"aria-label":`Previous slide`,children:(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),(0,n.jsx)(`button`,{className:`nd-carousel-button`,onClick:p,"aria-label":`Next slide`,children:(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})]}),o&&(0,n.jsx)(`div`,{className:`nd-carousel-indicators`,children:t.default.Children.map(r,(e,t)=>(0,n.jsx)(`button`,{className:`nd-carousel-indicator ${t===u?`nd-carousel-indicator--active`:``}`,onClick:()=>d(t),"aria-label":`Go to slide ${t+1}`},t))})]})});b.displayName=`Carousel`;var x=t.default.forwardRef(({className:e=``,label:t,disabled:r,checked:i,onChange:a,...o},s)=>(0,n.jsxs)(`label`,{className:[`nd-checkbox-wrapper`,i?`nd-checkbox-wrapper--checked`:``,r?`nd-checkbox-wrapper--disabled`:``,e].filter(Boolean).join(` `),children:[(0,n.jsxs)(`div`,{className:`nd-checkbox-box`,children:[(0,n.jsx)(`input`,{type:`checkbox`,className:`nd-checkbox-input`,ref:s,checked:i,onChange:a,disabled:r,...o}),(0,n.jsx)(`svg`,{className:`nd-checkbox-icon`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`polyline`,{points:`20 6 9 17 4 12`})})]}),t&&(0,n.jsx)(`span`,{children:t})]}));x.displayName=`Checkbox`;var S=[`#ef4444`,`#f97316`,`#f59e0b`,`#84cc16`,`#22c55e`,`#06b6d4`,`#3b82f6`,`#6366f1`,`#a855f7`,`#ec4899`,`#ffffff`,`#94a3b8`,`#475569`,`#1e293b`,`#000000`],ee=({label:e,value:r,onChange:i,presets:a=S,className:o=``})=>{let[s,c]=(0,t.useState)(`#3b82f6`),[l,u]=(0,t.useState)(!1),d=(0,t.useRef)(null),f=r!==void 0,p=f?r:s;(0,t.useEffect)(()=>{let e=e=>{d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let m=e=>{f||c(e),i&&i(e)};return(0,n.jsxs)(`div`,{className:`nd-color-picker-wrapper ${o}`,ref:d,children:[e&&(0,n.jsx)(`label`,{className:`nd-input-label`,style:{marginBottom:`0.5rem`,display:`block`},children:e}),(0,n.jsxs)(`button`,{className:`nd-color-picker-trigger`,onClick:()=>u(!l),type:`button`,children:[(0,n.jsx)(`div`,{className:`nd-color-picker-swatch`,style:{backgroundColor:p}}),(0,n.jsx)(`span`,{children:p.toUpperCase()})]}),l&&(0,n.jsxs)(`div`,{className:`nd-color-picker-popover`,children:[(0,n.jsx)(`div`,{className:`nd-color-picker-presets`,children:a.map(e=>(0,n.jsx)(`button`,{className:`nd-color-picker-preset-btn ${e.toLowerCase()===p.toLowerCase()?`nd-color-picker-preset-btn--active`:``}`,style:{backgroundColor:e},onClick:()=>m(e),"aria-label":`Select color ${e}`},e))}),(0,n.jsxs)(`div`,{className:`nd-color-picker-input-container`,children:[(0,n.jsx)(`span`,{style:{color:`var(--nd-color-text-secondary)`,fontSize:`0.875rem`,fontWeight:600},children:`Hex`}),(0,n.jsx)(`input`,{type:`text`,className:`nd-color-picker-hex-input`,value:p,onChange:e=>{let t=e.target.value;m(t)}})]})]})]})},te=({isOpen:e,onClose:i,items:a,placeholder:o=`Type a command or search...`})=>{let[s,c]=(0,t.useState)(``),l=(0,t.useRef)(null);(0,t.useEffect)(()=>(e?(document.body.style.overflow=`hidden`,setTimeout(()=>l.current?.focus(),100)):(document.body.style.overflow=``,c(``)),()=>{document.body.style.overflow=``}),[e]),(0,t.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&e.preventDefault()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let u=e=>{e.key===`Escape`&&i()},d=a.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())),f=d.reduce((e,t)=>{let n=t.group||`Suggestions`;return e[n]||(e[n]=[]),e[n].push(t),e},{}),p=(0,n.jsx)(`div`,{className:`nd-command-menu-overlay ${e?`nd-command-menu-overlay--open`:``}`,onClick:i,role:`dialog`,"aria-modal":`true`,onKeyDown:u,children:(0,n.jsxs)(`div`,{className:`nd-command-menu`,onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)(`div`,{className:`nd-command-menu-input-wrapper`,children:[(0,n.jsxs)(`svg`,{className:`nd-command-menu-icon`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,n.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,n.jsx)(`input`,{ref:l,className:`nd-command-menu-input`,placeholder:o,value:s,onChange:e=>c(e.target.value)})]}),(0,n.jsxs)(`div`,{className:`nd-command-menu-list`,children:[Object.entries(f).map(([e,r])=>(0,n.jsxs)(t.default.Fragment,{children:[(0,n.jsx)(`div`,{className:`nd-command-menu-group`,children:e}),r.map(e=>(0,n.jsxs)(`button`,{className:`nd-command-menu-item`,onClick:()=>{e.onSelect(),i()},children:[(0,n.jsxs)(`div`,{className:`nd-command-menu-item-content`,children:[e.icon,(0,n.jsx)(`span`,{children:e.label})]}),e.shortcut&&(0,n.jsx)(`div`,{className:`nd-command-menu-shortcut`,children:e.shortcut.map((e,t)=>(0,n.jsx)(`span`,{children:e},t))})]},e.id))]},e)),d.length===0&&(0,n.jsx)(`div`,{style:{padding:`2rem`,textAlign:`center`,color:`var(--nd-color-text-disabled)`},children:`No results found.`})]})]})});return typeof window<`u`?(0,r.createPortal)(p,document.body):null},ne=({children:e,items:i,className:a=``})=>{let[o,s]=(0,t.useState)(!1),[c,l]=(0,t.useState)({x:0,y:0}),u=(0,t.useRef)(null),d=(0,t.useRef)(null),f=e=>{e.preventDefault();let t=e.clientX,n=e.clientY;l({x:t,y:n}),s(!0)};(0,t.useEffect)(()=>{if(!o)return;let e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)},t=e=>{e.key===`Escape`&&s(!1)},n=()=>s(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),window.addEventListener(`scroll`,n,!0),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t),window.removeEventListener(`scroll`,n,!0)}},[o]),(0,t.useEffect)(()=>{if(o&&d.current){let e=d.current.getBoundingClientRect(),{innerWidth:t,innerHeight:n}=window,r=c.x,i=c.y;c.x+e.width>t&&(r=t-e.width-10),c.y+e.height>n&&(i=n-e.height-10),(r!==c.x||i!==c.y)&&l({x:r,y:i})}},[o,c]);let p=o?(0,n.jsx)(`div`,{className:`nd-context-menu-portal ${a}`,ref:d,style:{left:c.x,top:c.y},onContextMenu:e=>e.preventDefault(),children:i.map((e,t)=>e.isDivider?(0,n.jsx)(`div`,{className:`nd-context-menu-divider`},`divider-${t}`):(0,n.jsxs)(`button`,{className:`nd-context-menu-item`,style:e.danger?{color:`#ef4444`}:void 0,onClick:t=>{t.stopPropagation(),e.onClick&&e.onClick(),s(!1)},children:[(0,n.jsxs)(`div`,{className:`nd-context-menu-item-content`,children:[e.icon,(0,n.jsx)(`span`,{children:e.label})]}),e.shortcut&&(0,n.jsx)(`span`,{className:`nd-context-menu-shortcut`,children:e.shortcut})]},`item-${t}`))}):null;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{ref:u,className:`nd-context-menu-wrapper`,onContextMenu:f,children:e}),typeof window<`u`&&(0,r.createPortal)(p,document.body)]})},C=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],re=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],ie=({label:e,value:r,onChange:i,className:a=``})=>{let[o,s]=(0,t.useState)(!1),[c,l]=(0,t.useState)(r?r.getMonth():new Date().getMonth()),[u,d]=(0,t.useState)(r?r.getFullYear():new Date().getFullYear()),f=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let p=(e,t)=>new Date(t,e+1,0).getDate(),m=(e,t)=>new Date(t,e,1).getDay(),h=()=>{c===0?(l(11),d(u-1)):l(c-1)},g=()=>{c===11?(l(0),d(u+1)):l(c+1)},_=e=>{let t=new Date(u,c,e);i&&i(t),s(!1)},v=()=>{let e=p(c,u),t=m(c,u),i=new Date,a=i.getMonth()===c&&i.getFullYear()===u,o=[];for(let e=0;e<t;e++)o.push((0,n.jsx)(`div`,{className:`nd-datepicker-day nd-datepicker-day--empty`},`empty-${e}`));for(let t=1;t<=e;t++){let e=r&&r.getDate()===t&&r.getMonth()===c&&r.getFullYear()===u,s=a&&i.getDate()===t,l=[`nd-datepicker-day`,e?`nd-datepicker-day--selected`:``,s&&!e?`nd-datepicker-day--today`:``].filter(Boolean).join(` `);o.push((0,n.jsx)(`button`,{className:l,onClick:()=>_(t),children:t},`day-${t}`))}return o},y=r?`${r.toLocaleDateString()}`:`Select date`;return(0,n.jsxs)(`div`,{className:`nd-datepicker-wrapper ${a}`,ref:f,children:[e&&(0,n.jsx)(`label`,{className:`nd-input-label`,style:{marginBottom:`0.5rem`,display:`block`},children:e}),(0,n.jsxs)(`div`,{className:`nd-input`,onClick:()=>s(!o),style:{cursor:`pointer`,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,n.jsx)(`span`,{children:y}),(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--nd-color-text-secondary)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,n.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,n.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,n.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]})]}),o&&(0,n.jsxs)(`div`,{className:`nd-datepicker-calendar`,children:[(0,n.jsxs)(`div`,{className:`nd-datepicker-header`,children:[(0,n.jsx)(`button`,{className:`nd-datepicker-nav-button`,onClick:h,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),(0,n.jsxs)(`span`,{className:`nd-datepicker-month-year`,children:[re[c],` `,u]}),(0,n.jsx)(`button`,{className:`nd-datepicker-nav-button`,onClick:g,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})]}),(0,n.jsxs)(`div`,{className:`nd-datepicker-grid`,children:[C.map(e=>(0,n.jsx)(`div`,{className:`nd-datepicker-weekday`,children:e},e)),v()]})]})]})},w=t.default.forwardRef(({className:e=``,orientation:t=`horizontal`,variant:r=`inset`,...i},a)=>{let o=[`nd-divider`,`nd-divider--${t}`,`nd-divider--${r}`,e].filter(Boolean).join(` `);return t===`horizontal`?(0,n.jsx)(`hr`,{className:o,ref:a,...i}):(0,n.jsx)(`div`,{className:o,role:`separator`,"aria-orientation":`vertical`,ref:a,...i})});w.displayName=`Divider`;var ae=({isOpen:e,onClose:i,title:a,position:o=`right`,children:s,footer:c,className:l=``})=>{(0,t.useEffect)(()=>(e?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[e]);let u=(0,n.jsx)(`div`,{className:`nd-drawer-overlay ${e?`nd-drawer-overlay--open`:``}`,onClick:i,role:`dialog`,"aria-modal":`true`,children:(0,n.jsxs)(`div`,{className:`nd-drawer nd-drawer--${o} ${l}`,onClick:e=>e.stopPropagation(),children:[a&&(0,n.jsxs)(`div`,{className:`nd-drawer-header`,children:[(0,n.jsx)(`h2`,{className:`nd-drawer-title`,children:a}),(0,n.jsx)(`button`,{className:`nd-drawer-close`,onClick:i,"aria-label":`Close`,children:(0,n.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),!a&&(0,n.jsx)(`button`,{className:`nd-drawer-close`,onClick:i,"aria-label":`Close`,style:{position:`absolute`,top:`1rem`,right:`1rem`},children:(0,n.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}),(0,n.jsx)(`div`,{className:`nd-drawer-body`,children:s}),c&&(0,n.jsx)(`div`,{className:`nd-drawer-footer`,children:c})]})});return typeof window<`u`?(0,r.createPortal)(u,document.body):null},T=t.default.forwardRef(({children:e,className:t=``,...r},i)=>(0,n.jsx)(`button`,{className:`nd-dropdown-item ${t}`,ref:i,role:`menuitem`,...r,children:e}));T.displayName=`DropdownMenuItem`;var oe=()=>(0,n.jsx)(`div`,{className:`nd-dropdown-divider`,role:`separator`}),se=({trigger:e,children:r,align:i=`left`,className:a=``})=>{let[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let l=e=>{e.key===`Escape`&&s(!1)},u=[`nd-dropdown-menu`,o?`nd-dropdown-menu--open`:``,i===`right`?`nd-dropdown-menu--right`:``,a].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:`nd-dropdown-wrapper`,ref:c,onKeyDown:l,children:[(0,n.jsx)(`div`,{className:`nd-dropdown-trigger`,onClick:()=>s(!o),role:`button`,"aria-haspopup":`menu`,"aria-expanded":o,children:e}),(0,n.jsx)(`div`,{className:u,role:`menu`,children:t.default.Children.map(r,e=>{if(t.default.isValidElement(e)){let n=e,r=n.props;return t.default.cloneElement(n,{onClick:e=>{r.onClick&&r.onClick(e),s(!1)}})}return e})})]})},E=t.default.forwardRef(({className:e=``,label:r,onDrop:i,disabled:a,...o},s)=>{let c=(0,t.useRef)(null),[l,u]=(0,t.useState)(!1),d=e=>{e.preventDefault(),e.stopPropagation(),a||u(!0)},f=e=>{e.preventDefault(),e.stopPropagation(),u(!1)},p=e=>{e.preventDefault(),e.stopPropagation()},m=e=>{e.preventDefault(),e.stopPropagation(),u(!1),!a&&i&&e.dataTransfer.files&&i(e.dataTransfer.files)},h=()=>{a||c.current?.click()},g=e=>{!a&&i&&e.target.files&&i(e.target.files)},_=[`nd-dropzone`,l?`nd-dropzone--active`:``,a?`nd-dropzone--disabled`:``].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:[`nd-dropzone-wrapper`,e].filter(Boolean).join(` `),ref:s,...o,children:[r&&(0,n.jsx)(`label`,{className:`nd-dropzone-label`,children:r}),(0,n.jsxs)(`div`,{className:_,onDragEnter:d,onDragLeave:f,onDragOver:p,onDrop:m,onClick:h,role:`button`,tabIndex:a?-1:0,children:[(0,n.jsx)(`input`,{type:`file`,className:`nd-dropzone-input`,ref:c,onChange:g,disabled:a,multiple:!0}),(0,n.jsxs)(`svg`,{className:`nd-dropzone-icon`,width:`36`,height:`36`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,n.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,n.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`div`,{className:`nd-dropzone-text`,children:`Click or drag files here`}),(0,n.jsx)(`div`,{className:`nd-dropzone-subtext`,children:`SVG, PNG, JPG or GIF (max. 5MB)`})]})]})]})});E.displayName=`Dropzone`;var ce=({trigger:e,children:r,openDelay:i=300,closeDelay:a=300,className:o=``})=>{let[s,c]=(0,t.useState)(!1),l=(0,t.useRef)(null),u=(0,t.useRef)(null),d=(0,t.useRef)(null);return(0,t.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),(0,n.jsxs)(`div`,{className:`nd-hover-card-wrapper ${o}`,ref:l,onMouseEnter:()=>{d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>c(!0),i)},onMouseLeave:()=>{d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>c(!1),a)},children:[(0,n.jsx)(`div`,{className:`nd-hover-card-trigger`,children:e}),s&&(0,n.jsx)(`div`,{className:`nd-hover-card-portal`,ref:u,style:{top:`calc(100% + 10px)`,left:`50%`,transform:`translateX(-50%)`},children:r})]})},D=t.default.forwardRef(({className:e=``,shape:t=`circle`,isPressed:r=!1,children:i,...a},o)=>(0,n.jsx)(`button`,{ref:o,className:[`nd-icon-button`,t===`circle`?`nd-icon-button--circle`:`nd-icon-button--rounded`,r?`nd-icon-button--pressed`:``,e].filter(Boolean).join(` `),...a,children:i}));D.displayName=`IconButton`;var O=t.default.forwardRef(({className:e=``,label:t,error:r,...i},a)=>{let o=[`nd-input`,r?`nd-input--error`:``,e].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:`nd-input-wrapper`,children:[t&&(0,n.jsx)(`label`,{className:`nd-input-label`,children:t}),(0,n.jsx)(`input`,{ref:a,className:o,...i}),r&&(0,n.jsx)(`span`,{className:`nd-input-error-message`,children:r})]})});O.displayName=`Input`;var le=({value:e=0,onChange:r})=>{let[i,a]=(0,t.useState)(e),[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null);(0,t.useEffect)(()=>{a(e)},[e]);let l=(e,t)=>{if(!c.current)return;let n=c.current.getBoundingClientRect(),i=n.left+n.width/2,o=n.top+n.height/2,s=e-i,l=t-o,u=180/Math.PI*Math.atan2(l,s)+90;u<0&&(u+=360);let d=Math.round(u/360*100);a(d),r?.(d)},u=e=>{s(!0),l(e.clientX,e.clientY)};(0,t.useEffect)(()=>{let e=e=>{o&&l(e.clientX,e.clientY)},t=()=>{s(!1)};return o&&(window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t)),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[o]);let d=i/100*360;return(0,n.jsx)(`div`,{className:`nd-knob-container`,ref:c,children:(0,n.jsxs)(`div`,{className:`nd-knob-track`,children:[(0,n.jsx)(`div`,{className:`nd-knob-ring`}),(0,n.jsx)(`div`,{className:`nd-knob-dial`,onMouseDown:u,children:(0,n.jsx)(`div`,{className:`nd-knob-indicator-container`,style:{transform:`rotate(${d}deg)`},children:(0,n.jsx)(`div`,{className:`nd-knob-indicator`})})})]})})},k=t.default.forwardRef(({className:e=``,options:r,value:i,onChange:a,multiple:o=!1,...s},c)=>{let l=i!==void 0,[u,d]=(0,t.useState)(o?[]:null),f=l?i:u,p=(0,t.useRef)(null),m=c||p,h=e=>o&&Array.isArray(f)?f.includes(e):f===e,g=e=>{let t;if(o){let n=Array.isArray(f)?[...f]:[];t=n.includes(e)?n.filter(t=>t!==e):[...n,e]}else t=e;l||d(t),a&&a(t)},_=(e,t)=>{if(e.key===`Enter`||e.key===` `)e.preventDefault(),r[t].disabled||g(r[t].id);else if(e.key===`ArrowDown`){e.preventDefault();let n=(t+1)%r.length,i=m.current?.querySelectorAll(`.nd-listbox-item`);i&&i[n]&&i[n].focus()}else if(e.key===`ArrowUp`){e.preventDefault();let n=(t-1+r.length)%r.length,i=m.current?.querySelectorAll(`.nd-listbox-item`);i&&i[n]&&i[n].focus()}};return(0,n.jsx)(`ul`,{className:`nd-listbox ${e}`,role:`listbox`,"aria-multiselectable":o,ref:m,...s,children:r.map((e,t)=>{let r=h(e.id);return(0,n.jsxs)(`li`,{className:`nd-listbox-item ${r?`nd-listbox-item--selected`:``} ${e.disabled?`nd-listbox-item--disabled`:``}`,role:`option`,"aria-selected":r,"aria-disabled":e.disabled,tabIndex:e.disabled?-1:0,onClick:()=>!e.disabled&&g(e.id),onKeyDown:e=>_(e,t),children:[o&&(0,n.jsx)(`input`,{type:`checkbox`,checked:r,readOnly:!0,tabIndex:-1,style:{appearance:`none`,width:`1rem`,height:`1rem`,borderRadius:`4px`,boxShadow:r?`var(--nd-shadow-inset), var(--nd-glow-accent)`:`var(--nd-shadow-inset)`,backgroundColor:`var(--nd-color-bg)`}}),e.label]},e.id)})})});k.displayName=`Listbox`;var A=(0,t.createContext)({activeMenu:null,setActiveMenu:()=>{}}),ue=({children:e,className:r=``})=>{let[i,a]=(0,t.useState)(null),o=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&a(null)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,n.jsx)(A.Provider,{value:{activeMenu:i,setActiveMenu:a},children:(0,n.jsx)(`div`,{className:`nd-menubar ${r}`,ref:o,children:e})})},de=({id:e,label:r,children:i})=>{let{activeMenu:a,setActiveMenu:o}=(0,t.useContext)(A),s=a===e,c=(0,t.useRef)(null);return(0,n.jsxs)(`div`,{style:{position:`relative`},ref:c,children:[(0,n.jsx)(`button`,{className:`nd-menubar-trigger`,"data-state":s?`open`:`closed`,onMouseEnter:()=>{a!==null&&o(e)},onClick:()=>{o(s?null:e)},children:r}),s&&(0,n.jsx)(`div`,{className:`nd-menubar-content`,children:i})]})},fe=({label:e,shortcut:r,onClick:i})=>{let{setActiveMenu:a}=(0,t.useContext)(A);return(0,n.jsxs)(`button`,{className:`nd-menubar-item`,onClick:()=>{i&&i(),a(null)},children:[(0,n.jsx)(`span`,{children:e}),r&&(0,n.jsx)(`span`,{style:{fontSize:`0.75rem`,color:`var(--nd-color-text-disabled)`},children:r})]})},pe=()=>(0,n.jsx)(`div`,{className:`nd-menubar-separator`}),me=({isOpen:e,onClose:i,title:a,children:o,footer:s})=>{(0,t.useEffect)(()=>{let t=t=>{t.key===`Escape`&&e&&i()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,i]),(0,t.useEffect)(()=>(e?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[e]);let c=(0,n.jsx)(`div`,{className:`nd-modal-overlay ${e?`nd-modal-overlay--open`:``}`,onClick:i,children:(0,n.jsxs)(`div`,{className:`nd-modal`,onClick:e=>e.stopPropagation(),role:`dialog`,"aria-modal":`true`,children:[(0,n.jsxs)(`div`,{className:`nd-modal-header`,children:[a&&(0,n.jsx)(`h2`,{className:`nd-modal-title`,children:a}),(0,n.jsx)(`button`,{className:`nd-modal-close`,onClick:i,"aria-label":`Close`,children:(0,n.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,n.jsx)(`div`,{className:`nd-modal-content`,children:o}),s&&(0,n.jsx)(`div`,{className:`nd-modal-footer`,children:s})]})});return typeof document<`u`?(0,r.createPortal)(c,document.body):null},j=(e,t)=>{let n=t-e+1;return Array.from({length:n},(t,n)=>n+e)},M=t.default.forwardRef(({className:e=``,currentPage:t,totalPages:r,onChange:i,siblingCount:a=1,...o},s)=>{let c=(()=>{if(a+5>=r)return j(1,r);let e=Math.max(t-a,1),n=Math.min(t+a,r),i=e>2,o=n<r-2,s=r;return!i&&o?[...j(1,3+2*a),`...`,r]:i&&!o?[1,`...`,...j(r-(3+2*a)+1,r)]:i&&o?[1,`...`,...j(e,n),`...`,s]:[]})();return(0,n.jsxs)(`ul`,{className:`nd-pagination ${e}`,ref:s,...o,children:[(0,n.jsx)(`li`,{children:(0,n.jsx)(`button`,{className:`nd-pagination-item`,disabled:t===1,onClick:()=>i(t-1),"aria-label":`Previous page`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})})}),c.map((e,r)=>e===`...`?(0,n.jsx)(`li`,{className:`nd-pagination-ellipsis`,children:`…`},`ellipsis-${r}`):(0,n.jsx)(`li`,{children:(0,n.jsx)(`button`,{className:`nd-pagination-item ${e===t?`nd-pagination-item--active`:``}`,onClick:()=>i(e),"aria-current":e===t?`page`:void 0,children:e})},e)),(0,n.jsx)(`li`,{children:(0,n.jsx)(`button`,{className:`nd-pagination-item`,disabled:t===r,onClick:()=>i(t+1),"aria-label":`Next page`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})})]})});M.displayName=`Pagination`;var he=({trigger:e,content:r,header:i,placement:a=`bottom`,className:o=``,showClose:s=!1})=>{let[c,l]=(0,t.useState)(!1),u=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=e=>{u.current&&!u.current.contains(e.target)&&l(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,n.jsxs)(`div`,{className:`nd-popover-wrapper ${o}`,ref:u,children:[(0,n.jsx)(`div`,{onClick:()=>l(e=>!e),style:{display:`inline-block`},children:e}),c&&(0,n.jsxs)(`div`,{className:`nd-popover-content nd-popover-content--${a}`,children:[s&&(0,n.jsx)(`button`,{className:`nd-popover-close`,onClick:()=>l(!1),"aria-label":`Close popover`,children:(0,n.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}),i&&(0,n.jsx)(`div`,{className:`nd-popover-header`,children:i}),(0,n.jsx)(`div`,{className:`nd-popover-body`,children:r})]})]})},N=t.default.forwardRef(({className:e=``,value:t=0,max:r=100,label:i,showValue:a=!0,...o},s)=>{let c=Math.max(0,Number(t)),l=Math.max(1,Number(r)),u=Math.min(100,c/l*100);return(0,n.jsxs)(`div`,{ref:s,className:[`nd-progress-wrapper`,e].filter(Boolean).join(` `),...o,children:[(i||a)&&(0,n.jsxs)(`div`,{className:`nd-progress-label`,children:[i?(0,n.jsx)(`span`,{children:i}):(0,n.jsx)(`span`,{}),a&&(0,n.jsxs)(`span`,{className:`nd-progress-value`,children:[Math.round(u),`%`]})]}),(0,n.jsx)(`div`,{className:`nd-progress-track`,children:(0,n.jsx)(`div`,{className:`nd-progress-fill`,style:{width:`${u}%`}})})]})});N.displayName=`ProgressBar`;var P=t.default.forwardRef(({className:e=``,label:t,disabled:r,checked:i,onChange:a,...o},s)=>(0,n.jsxs)(`label`,{className:[`nd-radio-wrapper`,i?`nd-radio-wrapper--checked`:``,r?`nd-radio-wrapper--disabled`:``,e].filter(Boolean).join(` `),children:[(0,n.jsxs)(`div`,{className:`nd-radio-box`,children:[(0,n.jsx)(`input`,{type:`radio`,className:`nd-radio-input`,ref:s,checked:i,onChange:a,disabled:r,...o}),(0,n.jsx)(`div`,{className:`nd-radio-dot`})]}),t&&(0,n.jsx)(`span`,{children:t})]}));P.displayName=`Radio`;var ge=({min:e=0,max:r=100,step:i=1,defaultValue:a=[25,75],value:o,onChange:s,className:c=``})=>{let[l,u]=(0,t.useState)(a),[d,f]=(0,t.useState)(null),p=(0,t.useRef)(null),m=o!==void 0,h=m?o:l,g=t=>(t-e)/(r-e)*100,_=(e,t)=>{t.preventDefault(),f(e),t.target instanceof HTMLElement&&t.target.setPointerCapture(t.pointerId)},v=(0,t.useCallback)(t=>{if(d===null||!p.current)return;let n=p.current.getBoundingClientRect(),a=Math.min(Math.max((t.clientX-n.left)/n.width,0),1)*(r-e)+e;a=Math.round(a/i)*i;let o=[...h];d===0?o[0]=Math.min(Math.max(a,e),h[1]):o[1]=Math.max(Math.min(a,r),h[0]),m||u(o),s&&s(o)},[d,h,e,r,i,m,s]),y=(0,t.useCallback)(e=>{if(f(null),e.target instanceof HTMLElement&&e.pointerId)try{e.target.releasePointerCapture(e.pointerId)}catch{}},[]);(0,t.useEffect)(()=>(d===null?(document.removeEventListener(`pointermove`,v),document.removeEventListener(`pointerup`,y)):(document.addEventListener(`pointermove`,v),document.addEventListener(`pointerup`,y)),()=>{document.removeEventListener(`pointermove`,v),document.removeEventListener(`pointerup`,y)}),[d,v,y]);let b=g(h[0]),x=g(h[1]),S=x-b;return(0,n.jsx)(`div`,{className:`nd-range-slider ${c}`,children:(0,n.jsxs)(`div`,{className:`nd-range-slider-track`,ref:p,children:[(0,n.jsx)(`div`,{className:`nd-range-slider-fill`,style:{left:`${b}%`,width:`${S}%`}}),(0,n.jsx)(`div`,{className:`nd-range-slider-thumb`,style:{left:`${b}%`},onPointerDown:e=>_(0,e),tabIndex:0,role:`slider`,"aria-valuemin":e,"aria-valuemax":h[1],"aria-valuenow":h[0]}),(0,n.jsx)(`div`,{className:`nd-range-slider-thumb`,style:{left:`${x}%`},onPointerDown:e=>_(1,e),tabIndex:0,role:`slider`,"aria-valuemin":h[0],"aria-valuemax":r,"aria-valuenow":h[1]})]})})},F=t.default.forwardRef(({className:e=``,max:r=5,value:i=0,onChange:a,readOnly:o=!1,...s},c)=>{let[l,u]=(0,t.useState)(null),d=e=>{o||u(e)},f=()=>{o||u(null)},p=e=>{!o&&a&&a(e)},m=l===null?i:l;return(0,n.jsx)(`div`,{className:`nd-rating ${e}`,ref:c,onMouseLeave:f,role:`slider`,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":i,...s,children:Array.from({length:r}).map((e,t)=>{let r=t+1,i=r<=m;return(0,n.jsx)(`button`,{className:`nd-rating-star ${i?`nd-rating-star--filled`:`nd-rating-star--unfilled`}`,onMouseEnter:()=>d(r),onClick:()=>p(r),disabled:o,"aria-label":`Rate ${r} stars`,children:(0,n.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:i?`currentColor`:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})})},r)})})});F.displayName=`Rating`;var I=({direction:e=`horizontal`,initialRatio:r=.5,minRatio:i=.1,maxRatio:a=.9,panelA:o,panelB:s,className:c=``,style:l})=>{let[u,d]=(0,t.useState)(r),[f,p]=(0,t.useState)(!1),m=(0,t.useRef)(null),h=e=>{e.preventDefault(),p(!0)},g=(0,t.useCallback)(t=>{if(!f||!m.current)return;let n=m.current.getBoundingClientRect(),r;r=e===`horizontal`?(t.clientX-n.left)/n.width:(t.clientY-n.top)/n.height,r=Math.max(i,Math.min(a,r)),d(r)},[f,e,i,a]),_=(0,t.useCallback)(()=>{p(!1)},[]);(0,t.useEffect)(()=>(f?(document.addEventListener(`mousemove`,g),document.addEventListener(`mouseup`,_),document.body.style.userSelect=`none`,document.body.style.cursor=e===`horizontal`?`col-resize`:`row-resize`):(document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_),document.body.style.userSelect=``,document.body.style.cursor=``),()=>{document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_),document.body.style.userSelect=``,document.body.style.cursor=``}),[f,g,_,e]);let v=`${u*100}%`,y=`${(1-u)*100}%`;return(0,n.jsxs)(`div`,{className:`nd-resizable-container nd-resizable-container--${e} ${c}`,ref:m,style:l,children:[(0,n.jsx)(`div`,{className:`nd-resizable-panel`,style:{flexBasis:v,flexGrow:0},children:o}),(0,n.jsx)(`div`,{className:`nd-resizable-handle nd-resizable-handle--${e}`,onMouseDown:h,role:`separator`,"aria-orientation":e,children:(0,n.jsx)(`div`,{className:`nd-resizable-grip`})}),(0,n.jsx)(`div`,{className:`nd-resizable-panel`,style:{flexBasis:y,flexGrow:1},children:s})]})},L=t.default.forwardRef(({className:e=``,height:t=`100%`,width:r=`100%`,style:i,children:a,...o},s)=>(0,n.jsx)(`div`,{className:`nd-scroll-area ${e}`,ref:s,style:{height:t,width:r,...i},...o,children:a}));L.displayName=`ScrollArea`;var R=t.default.forwardRef(({className:e=``,label:r,error:i,options:a,value:o,onChange:s,disabled:c,...l},u)=>{let[d,f]=(0,t.useState)(!1),p=(0,t.useRef)(null),m=a.find(e=>e.value===o);(0,t.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&f(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let h=e=>{s&&s(e),f(!1)},g=[`nd-select-wrapper`,e].filter(Boolean).join(` `),_=[`nd-select-trigger`,i?`nd-select-trigger--error`:``,c?`nd-select-trigger--disabled`:``,d?`nd-select-trigger--open`:``].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:g,ref:p,...l,children:[r&&(0,n.jsx)(`label`,{className:`nd-select-label`,children:r}),(0,n.jsxs)(`div`,{className:`nd-select-container`,children:[(0,n.jsxs)(`div`,{className:_,onClick:()=>!c&&f(!d),ref:u,role:`button`,"aria-haspopup":`listbox`,"aria-expanded":d,children:[(0,n.jsx)(`span`,{children:m?m.label:`Select...`}),(0,n.jsx)(`svg`,{className:`nd-select-icon ${d?`nd-select-icon--open`:``}`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})]}),d&&!c&&(0,n.jsx)(`div`,{className:`nd-select-dropdown`,role:`listbox`,children:a.map(e=>(0,n.jsx)(`div`,{role:`option`,"aria-selected":e.value===m?.value,className:`nd-select-option ${e.value===m?.value?`nd-select-option--selected`:``}`,onClick:()=>h(e.value),children:e.label},e.value))})]}),i&&(0,n.jsx)(`span`,{className:`nd-select-error-text`,children:i})]})});R.displayName=`Select`;var z=t.default.forwardRef(({className:e=``,variant:t=`text`,width:r,height:i,style:a,...o},s)=>(0,n.jsx)(`div`,{className:[`nd-skeleton`,`nd-skeleton--${t}`,e].filter(Boolean).join(` `),style:{...a,...r&&{width:r},...i&&{height:i}},ref:s,"aria-hidden":`true`,...o}));z.displayName=`Skeleton`;var B=t.default.forwardRef(({className:e=``,label:t,value:r=0,min:i=0,max:a=100,disabled:o,onChange:s,...c},l)=>{let u=Number(r),d=Number(i),f=Number(a),p=Math.max(0,Math.min(100,(u-d)/(f-d)*100));return(0,n.jsxs)(`div`,{className:[`nd-slider-wrapper`,o?`nd-slider-wrapper--disabled`:``,e].filter(Boolean).join(` `),children:[t&&(0,n.jsxs)(`div`,{className:`nd-slider-label`,children:[(0,n.jsx)(`span`,{children:t}),(0,n.jsx)(`span`,{className:`nd-slider-value`,children:r})]}),(0,n.jsxs)(`div`,{className:`nd-slider-track-container`,children:[(0,n.jsx)(`div`,{className:`nd-slider-track`,children:(0,n.jsx)(`div`,{className:`nd-slider-fill`,style:{width:`${p}%`}})}),(0,n.jsx)(`input`,{type:`range`,className:`nd-slider-input`,ref:l,value:r,min:i,max:a,disabled:o,onChange:s,...c})]})]})});B.displayName=`Slider`;var _e=({actions:e,icon:r,className:i=``})=>{let[a,o]=(0,t.useState)(!1),s=(0,t.useRef)(null);(0,t.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let c=(0,n.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,n.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]});return(0,n.jsxs)(`div`,{className:`nd-speed-dial ${a?`nd-speed-dial--open`:``} ${i}`,ref:s,children:[(0,n.jsx)(`div`,{className:`nd-speed-dial-actions`,children:e.map((e,t)=>(0,n.jsxs)(`button`,{className:`nd-speed-dial-action`,onClick:()=>{e.onClick&&e.onClick(),o(!1)},"aria-label":e.label,children:[e.icon,(0,n.jsx)(`span`,{className:`nd-speed-dial-tooltip`,children:e.label})]},t))}),(0,n.jsx)(`button`,{className:`nd-speed-dial-trigger`,onClick:()=>o(!a),"aria-expanded":a,"aria-haspopup":`menu`,"aria-label":`Toggle Speed Dial`,children:(0,n.jsx)(`span`,{className:`nd-speed-dial-trigger-icon`,children:r||c})})]})},V=t.default.forwardRef(({className:e=``,size:t=`md`,...r},i)=>{let a=[`nd-spinner`,`nd-spinner--${t}`,e].filter(Boolean).join(` `);return(0,n.jsx)(`div`,{className:`nd-spinner-wrapper`,ref:i,...r,children:(0,n.jsx)(`div`,{className:a})})});V.displayName=`Spinner`;var ve=({label:e,onClick:r,options:i,className:a=``})=>{let[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,n.jsxs)(`div`,{className:`nd-split-button-container ${a}`,ref:c,children:[(0,n.jsxs)(`div`,{className:`nd-split-button-group`,children:[(0,n.jsx)(`button`,{className:`nd-split-button-main`,onClick:()=>{r&&r(),s(!1)},children:e}),(0,n.jsx)(`div`,{className:`nd-split-button-divider`}),(0,n.jsx)(`button`,{className:`nd-split-button-dropdown-toggle`,onClick:()=>s(!o),"aria-expanded":o,"aria-haspopup":`menu`,"aria-label":`Toggle drop-down`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{transform:o?`rotate(180deg)`:`rotate(0deg)`,transition:`transform 0.2s`},children:(0,n.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]}),o&&(0,n.jsx)(`div`,{className:`nd-split-button-menu`,role:`menu`,children:i.map((e,t)=>(0,n.jsx)(`button`,{className:`nd-split-button-menu-item`,role:`menuitem`,onClick:()=>{e.onClick(),s(!1)},children:e.label},t))})]})},H=t.default.forwardRef(({className:e=``,steps:t,currentStep:r,...i},a)=>(0,n.jsx)(`div`,{className:`nd-stepper ${e}`,ref:a,...i,children:t.map((e,t)=>{let i=t<r;return(0,n.jsxs)(`div`,{className:[`nd-stepper-item`,t===r?`nd-stepper-item--active`:``,i?`nd-stepper-item--completed`:``].filter(Boolean).join(` `),children:[(0,n.jsx)(`div`,{className:`nd-stepper-indicator`,children:i?(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,n.jsx)(`span`,{children:t+1})}),(0,n.jsx)(`div`,{className:`nd-stepper-label`,children:e.label}),(0,n.jsx)(`div`,{className:`nd-stepper-connector`})]},t)})}));H.displayName=`Stepper`;var U=t.default.forwardRef(({className:e=``,label:t,disabled:r,checked:i,onChange:a,...o},s)=>(0,n.jsxs)(`label`,{className:[`nd-switch`,i?`nd-switch--checked`:``,r?`nd-switch--disabled`:``,e].filter(Boolean).join(` `),children:[t&&(0,n.jsx)(`span`,{children:t}),(0,n.jsxs)(`div`,{className:`nd-switch-track`,children:[(0,n.jsx)(`input`,{type:`checkbox`,className:`nd-switch-input`,ref:s,checked:i,onChange:a,disabled:r,...o}),(0,n.jsx)(`div`,{className:`nd-switch-thumb`})]})]}));U.displayName=`Switch`;function ye({className:e=``,data:t,columns:r,keyExtractor:i,...a}){return(0,n.jsx)(`div`,{className:`nd-table-container`,children:(0,n.jsxs)(`table`,{className:`nd-table ${e}`,...a,children:[(0,n.jsx)(`thead`,{children:(0,n.jsx)(`tr`,{children:r.map(e=>(0,n.jsx)(`th`,{className:`nd-table-th`,children:e.header},e.key))})}),(0,n.jsxs)(`tbody`,{children:[t.map(e=>(0,n.jsx)(`tr`,{className:`nd-table-tr`,children:r.map(t=>(0,n.jsx)(`td`,{className:`nd-table-td`,children:t.render?t.render(e):e[t.key]},t.key))},i(e))),t.length===0&&(0,n.jsx)(`tr`,{children:(0,n.jsx)(`td`,{colSpan:r.length,className:`nd-table-td`,style:{textAlign:`center`,color:`var(--nd-color-text-secondary)`},children:`No data available`})})]})]})})}var W=t.default.forwardRef(({className:e=``,items:r,defaultActiveId:i,onChange:a,...o},s)=>{let[c,l]=(0,t.useState)(i||r[0]?.id),u=e=>{l(e),a&&a(e)},d=r.find(e=>e.id===c)?.content;return(0,n.jsxs)(`div`,{className:`nd-tabs-wrapper ${e}`,ref:s,...o,children:[(0,n.jsx)(`div`,{className:`nd-tabs-list`,role:`tablist`,children:r.map(e=>(0,n.jsx)(`button`,{role:`tab`,"aria-selected":c===e.id,className:`nd-tabs-tab ${c===e.id?`nd-tabs-tab--active`:``}`,onClick:()=>u(e.id),children:e.label},e.id))}),(0,n.jsx)(`div`,{className:`nd-tabs-panel`,role:`tabpanel`,children:d})]})});W.displayName=`Tabs`;var G=t.default.forwardRef(({className:e=``,label:r,tags:i,onChange:a,placeholder:o=`Add a tag...`,disabled:s=!1,...c},l)=>{let[u,d]=(0,t.useState)([]),[f,p]=(0,t.useState)(``),m=i!==void 0,h=m?i:u,g=e=>{if(e.key===`Enter`||e.key===`,`){e.preventDefault();let t=f.trim();if(t&&!h.includes(t)){let e=[...h,t];m||d(e),a&&a(e),p(``)}}else if(e.key===`Backspace`&&!f&&h.length>0){let e=h.slice(0,-1);m||d(e),a&&a(e)}},_=e=>{let t=h.filter((t,n)=>n!==e);m||d(t),a&&a(t)};return(0,n.jsxs)(`div`,{className:`nd-tags-input-wrapper ${e}`,ref:l,...c,children:[r&&(0,n.jsx)(`label`,{className:`nd-input-label`,children:r}),(0,n.jsxs)(`div`,{className:`nd-tags-input-container ${s?`nd-tags-input-container--disabled`:``}`,children:[h.map((e,t)=>(0,n.jsxs)(`span`,{className:`nd-tags-input-tag`,children:[e,(0,n.jsx)(`button`,{type:`button`,className:`nd-tags-input-tag-remove`,onClick:()=>_(t),"aria-label":`Remove ${e}`,disabled:s,children:(0,n.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]},t)),(0,n.jsx)(`input`,{type:`text`,className:`nd-tags-input-field`,value:f,onChange:e=>p(e.target.value),onKeyDown:g,placeholder:h.length===0?o:``,disabled:s})]})]})});G.displayName=`TagsInput`;var K=t.default.forwardRef(({className:e=``,label:t,error:r,...i},a)=>{let o=[`nd-textarea-wrapper`,e].filter(Boolean).join(` `),s=[`nd-textarea`,r?`nd-textarea--error`:``].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:o,children:[t&&(0,n.jsx)(`label`,{className:`nd-textarea-label`,children:t}),(0,n.jsx)(`textarea`,{className:s,ref:a,...i}),r&&(0,n.jsx)(`span`,{className:`nd-textarea-error-text`,children:r})]})});K.displayName=`Textarea`;var q=({value:e=`12:00`,onChange:r,is24Hour:i=!1,className:a=``})=>{let o=e=>{let[t,n]=e.split(`:`).map(Number);return{hours:isNaN(t)?12:t,minutes:isNaN(n)?0:n}},s=o(e),[c,l]=(0,t.useState)(s.hours),[u,d]=(0,t.useState)(s.minutes),[f,p]=(0,t.useState)(s.hours>=12?`PM`:`AM`);(0,t.useEffect)(()=>{if(e){let t=o(e);l(t.hours),d(t.minutes),p(t.hours>=12?`PM`:`AM`)}},[e]);let m=(e,t,n)=>{if(!r)return;let a=e;i||(n===`PM`&&e!==12&&(a+=12),n===`AM`&&e===12&&(a=0)),r(`${String(a).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`)},h=e=>{let t=c+e;i?(t<0&&(t=23),t>23&&(t=0)):(t<1&&(t=12),t>12&&(t=1)),l(t),m(t,u,f)},g=e=>{let t=u+e;if(t<0){t=59,h(-1);return}if(t>59){t=0,h(1);return}d(t),m(c,t,f)},_=e=>{p(e),m(c,u,e)},v=i?c:c>12?c-12:c===0?12:c;return(0,n.jsxs)(`div`,{className:`nd-timepicker ${a}`,children:[(0,n.jsxs)(`div`,{className:`nd-timepicker-segment`,children:[(0,n.jsx)(`button`,{className:`nd-timepicker-btn`,onClick:()=>h(1),"aria-label":`Increase hours`,children:(0,n.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`18 15 12 9 6 15`})})}),(0,n.jsx)(`input`,{className:`nd-timepicker-input`,value:String(v).padStart(2,`0`),readOnly:!0,"aria-label":`Hours`}),(0,n.jsx)(`button`,{className:`nd-timepicker-btn`,onClick:()=>h(-1),"aria-label":`Decrease hours`,children:(0,n.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]}),(0,n.jsx)(`span`,{className:`nd-timepicker-separator`,children:`:`}),(0,n.jsxs)(`div`,{className:`nd-timepicker-segment`,children:[(0,n.jsx)(`button`,{className:`nd-timepicker-btn`,onClick:()=>g(1),"aria-label":`Increase minutes`,children:(0,n.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`18 15 12 9 6 15`})})}),(0,n.jsx)(`input`,{className:`nd-timepicker-input`,value:String(u).padStart(2,`0`),readOnly:!0,"aria-label":`Minutes`}),(0,n.jsx)(`button`,{className:`nd-timepicker-btn`,onClick:()=>g(-1),"aria-label":`Decrease minutes`,children:(0,n.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]}),!i&&(0,n.jsxs)(`div`,{className:`nd-timepicker-ampm`,children:[(0,n.jsx)(`button`,{className:`nd-timepicker-ampm-btn ${f===`AM`?`nd-timepicker-ampm-btn--active`:``}`,onClick:()=>_(`AM`),children:`AM`}),(0,n.jsx)(`button`,{className:`nd-timepicker-ampm-btn ${f===`PM`?`nd-timepicker-ampm-btn--active`:``}`,onClick:()=>_(`PM`),children:`PM`})]})]})},J=t.default.forwardRef(({className:e=``,items:t,...r},i)=>(0,n.jsx)(`ol`,{className:`nd-timeline ${e}`,ref:i,...r,children:t.map((e,t)=>(0,n.jsxs)(`li`,{className:`nd-timeline-item ${e.isActive?`nd-timeline-item--active`:``}`,children:[(0,n.jsx)(`div`,{className:`nd-timeline-indicator`,"aria-hidden":`true`}),(0,n.jsxs)(`div`,{className:`nd-timeline-content`,children:[e.time&&(0,n.jsx)(`time`,{className:`nd-timeline-time`,children:e.time}),(0,n.jsx)(`h4`,{className:`nd-timeline-title`,children:e.title}),e.description&&(0,n.jsx)(`div`,{className:`nd-timeline-description`,children:e.description})]})]},t))}));J.displayName=`Timeline`;var Y=t.default.forwardRef(({className:e=``,title:t,description:r,variant:i=`default`,onClose:a,...o},s)=>(0,n.jsxs)(`div`,{ref:s,className:[`nd-toast`,`nd-toast--${i}`,e].filter(Boolean).join(` `),role:`alert`,...o,children:[(0,n.jsxs)(`div`,{className:`nd-toast-content`,children:[(0,n.jsx)(`span`,{className:`nd-toast-title`,children:t}),r&&(0,n.jsx)(`span`,{className:`nd-toast-description`,children:r})]}),a&&(0,n.jsx)(`button`,{className:`nd-toast-close`,onClick:a,"aria-label":`Close`,children:(0,n.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,n.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,n.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}));Y.displayName=`Toast`;var X=t.default.forwardRef(({className:e=``,items:r,type:i=`single`,defaultValue:a,onChange:o,...s},c)=>{let[l,u]=(0,t.useState)(()=>a?Array.isArray(a)?a:[a]:[]),d=e=>{let t;t=i===`single`?l.includes(e)?[]:[e]:l.includes(e)?l.filter(t=>t!==e):[...l,e],u(t),o&&o(i===`single`?t[0]||``:t)};return(0,n.jsx)(`div`,{className:`nd-togglegroup ${e}`,ref:c,...s,children:r.map(e=>{let t=l.includes(e.value);return(0,n.jsxs)(`button`,{className:`nd-togglegroup-item ${t?`nd-togglegroup-item--active`:``}`,onClick:()=>d(e.value),"aria-pressed":t,children:[e.icon&&(0,n.jsx)(`span`,{style:{marginRight:e.label?`0.5rem`:`0`},children:e.icon}),e.label&&(0,n.jsx)(`span`,{children:e.label})]},e.value)})})});X.displayName=`ToggleGroup`;var Z=t.default.forwardRef(({className:e=``,content:t,placement:r=`top`,children:i,...a},o)=>(0,n.jsxs)(`div`,{className:`nd-tooltip-wrapper ${e}`,ref:o,...a,children:[i,(0,n.jsx)(`div`,{className:`nd-tooltip nd-tooltip--${r}`,role:`tooltip`,children:t})]}));Z.displayName=`Tooltip`;var be=({availableItems:e,selectedItems:r,onChange:i,availableTitle:a=`Available`,selectedTitle:o=`Selected`,className:s=``})=>{let[c,l]=(0,t.useState)(new Set),[u,d]=(0,t.useState)(new Set),f=(e,t)=>{if(t===`available`){let t=new Set(c);t.has(e)?t.delete(e):t.add(e),l(t)}else{let t=new Set(u);t.has(e)?t.delete(e):t.add(e),d(t)}};return(0,n.jsxs)(`div`,{className:`nd-transfer-list ${s}`,children:[(0,n.jsxs)(`div`,{className:`nd-transfer-list-box`,children:[(0,n.jsx)(`h4`,{className:`nd-transfer-list-title`,children:a}),(0,n.jsx)(`ul`,{className:`nd-transfer-list-items`,children:e.map(e=>(0,n.jsxs)(`li`,{className:`nd-transfer-list-item ${c.has(e.id)?`nd-transfer-list-item--selected`:``}`,onClick:()=>f(e.id,`available`),children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:c.has(e.id),readOnly:!0,style:{appearance:`none`,width:`1rem`,height:`1rem`,borderRadius:`4px`,boxShadow:c.has(e.id)?`var(--nd-shadow-inset), var(--nd-glow-accent)`:`var(--nd-shadow-inset)`,backgroundColor:`var(--nd-color-bg)`}}),e.label]},e.id))})]}),(0,n.jsxs)(`div`,{className:`nd-transfer-list-controls`,children:[(0,n.jsx)(`button`,{className:`nd-transfer-list-btn`,onClick:()=>{i([],[...r,...e]),l(new Set)},disabled:e.length===0,"aria-label":`Move all right`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`M13 17l5-5-5-5M6 17l5-5-5-5`})})}),(0,n.jsx)(`button`,{className:`nd-transfer-list-btn`,onClick:()=>{let t=e.filter(e=>c.has(e.id));i(e.filter(e=>!c.has(e.id)),[...r,...t]),l(new Set)},disabled:c.size===0,"aria-label":`Move selected right`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})}),(0,n.jsx)(`button`,{className:`nd-transfer-list-btn`,onClick:()=>{let t=r.filter(e=>u.has(e.id)),n=r.filter(e=>!u.has(e.id));i([...e,...t],n),d(new Set)},disabled:u.size===0,"aria-label":`Move selected left`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),(0,n.jsx)(`button`,{className:`nd-transfer-list-btn`,onClick:()=>{i([...e,...r],[]),d(new Set)},disabled:r.length===0,"aria-label":`Move all left`,children:(0,n.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`M11 17l-5-5 5-5M18 17l-5-5 5-5`})})})]}),(0,n.jsxs)(`div`,{className:`nd-transfer-list-box`,children:[(0,n.jsx)(`h4`,{className:`nd-transfer-list-title`,children:o}),(0,n.jsx)(`ul`,{className:`nd-transfer-list-items`,children:r.map(e=>(0,n.jsxs)(`li`,{className:`nd-transfer-list-item ${u.has(e.id)?`nd-transfer-list-item--selected`:``}`,onClick:()=>f(e.id,`selected`),children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:u.has(e.id),readOnly:!0,style:{appearance:`none`,width:`1rem`,height:`1rem`,borderRadius:`4px`,boxShadow:u.has(e.id)?`var(--nd-shadow-inset), var(--nd-glow-accent)`:`var(--nd-shadow-inset)`,backgroundColor:`var(--nd-color-bg)`}}),e.label]},e.id))})]})]})},Q=({node:e,onSelect:r,selectedId:i,defaultExpandedIds:a=[]})=>{let[o,s]=(0,t.useState)(a.includes(e.id)),c=e.children&&e.children.length>0,l=i===e.id;return(0,n.jsxs)(`li`,{className:`nd-tree-node`,children:[(0,n.jsxs)(`div`,{className:`nd-tree-node-content ${l?`nd-tree-node-content--selected`:``}`,onClick:()=>{r&&r(e)},children:[(0,n.jsx)(`div`,{style:{width:`1.5rem`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:c&&(0,n.jsx)(`button`,{className:`nd-tree-toggle`,onClick:e=>{e.stopPropagation(),s(!o)},"aria-label":o?`Collapse`:`Expand`,children:(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{transform:o?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.2s`},children:(0,n.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})}),e.icon&&(0,n.jsx)(`span`,{className:`nd-tree-icon`,children:e.icon}),(0,n.jsx)(`span`,{className:`nd-tree-label`,children:e.label})]}),c&&o&&(0,n.jsx)(`ul`,{className:`nd-tree-children`,children:e.children.map(e=>(0,n.jsx)(Q,{node:e,onSelect:r,selectedId:i,defaultExpandedIds:a},e.id))})]})},$=t.default.forwardRef(({className:e=``,data:t,onSelect:r,selectedId:i,defaultExpandedIds:a,...o},s)=>(0,n.jsx)(`ul`,{className:`nd-tree ${e}`,ref:s,...o,children:t.map(e=>(0,n.jsx)(Q,{node:e,onSelect:r,selectedId:i,defaultExpandedIds:a},e.id))}));$.displayName=`Tree`,e.Accordion=d,e.Alert=p,e.Avatar=m,e.Badge=h,e.Breadcrumbs=g,e.Button=_,e.Calendar=v,e.Card=y,e.Carousel=b,e.Checkbox=x,e.ColorPicker=ee,e.CommandMenu=te,e.ContextMenu=ne,e.DatePicker=ie,e.Divider=w,e.Drawer=ae,e.DropdownMenu=se,e.DropdownMenuDivider=oe,e.DropdownMenuItem=T,e.Dropzone=E,e.HoverCard=ce,e.IconButton=D,e.Input=O,e.Knob=le,e.Listbox=k,e.Menubar=ue,e.MenubarItem=fe,e.MenubarMenu=de,e.MenubarSeparator=pe,e.Modal=me,e.Pagination=M,e.Popover=he,e.ProgressBar=N,e.Radio=P,e.RangeSlider=ge,e.Rating=F,e.Resizable=I,e.ScrollArea=L,e.Select=R,e.Skeleton=z,e.Slider=B,e.SpeedDial=_e,e.Spinner=V,e.SplitButton=ve,e.Stepper=H,e.Switch=U,e.Table=ye,e.Tabs=W,e.TagsInput=G,e.Textarea=K,e.TimePicker=q,e.Timeline=J,e.Toast=Y,e.ToggleGroup=X,e.Tooltip=Z,e.TransferList=be,e.Tree=$});
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "prime-design-system",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/prime-design-system.umd.js",
|
|
7
|
+
"module": "./dist/prime-design-system.es.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/prime-design-system.es.js",
|
|
12
|
+
"require": "./dist/prime-design-system.umd.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./dist/prime-design-system.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "tsc -b && vite build",
|
|
23
|
+
"lint": "eslint .",
|
|
24
|
+
"preview": "vite preview",
|
|
25
|
+
"storybook": "storybook dev -p 6006",
|
|
26
|
+
"build-storybook": "storybook build"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
34
|
+
"@eslint/js": "^10.0.1",
|
|
35
|
+
"@storybook/addon-a11y": "^10.4.1",
|
|
36
|
+
"@storybook/addon-docs": "^10.4.1",
|
|
37
|
+
"@storybook/addon-mcp": "^0.6.0",
|
|
38
|
+
"@storybook/addon-vitest": "^10.4.1",
|
|
39
|
+
"@storybook/react-vite": "^10.4.1",
|
|
40
|
+
"@types/node": "^24.12.3",
|
|
41
|
+
"@types/react": "^19.2.14",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
43
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
44
|
+
"@vitest/browser-playwright": "^4.1.8",
|
|
45
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
46
|
+
"eslint": "^10.3.0",
|
|
47
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
48
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
49
|
+
"eslint-plugin-storybook": "^10.4.1",
|
|
50
|
+
"globals": "^17.6.0",
|
|
51
|
+
"playwright": "^1.60.0",
|
|
52
|
+
"storybook": "^10.4.1",
|
|
53
|
+
"typescript": "~6.0.2",
|
|
54
|
+
"typescript-eslint": "^8.59.2",
|
|
55
|
+
"vite": "^8.0.12",
|
|
56
|
+
"vite-plugin-dts": "^5.0.2",
|
|
57
|
+
"vitest": "^4.1.8"
|
|
58
|
+
}
|
|
59
|
+
}
|