@fabio.caffarello/react-design-system 1.5.2 → 1.7.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/index.cjs +29 -4
- package/dist/index.js +1866 -716
- package/dist/ui/atoms/Button/Button.d.ts +28 -5
- package/dist/ui/atoms/Button/Button.stories.d.ts +11 -3
- package/dist/ui/atoms/Checkbox/Checkbox.d.ts +24 -0
- package/dist/ui/atoms/Checkbox/Checkbox.stories.d.ts +10 -0
- package/dist/ui/atoms/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/ui/atoms/Collapsible/Collapsible.d.ts +29 -0
- package/dist/ui/atoms/Collapsible/Collapsible.stories.d.ts +9 -0
- package/dist/ui/atoms/Collapsible/Collapsible.test.d.ts +1 -0
- package/dist/ui/atoms/Input/Input.d.ts +28 -4
- package/dist/ui/atoms/Input/Input.stories.d.ts +8 -3
- package/dist/ui/atoms/Radio/Radio.d.ts +26 -0
- package/dist/ui/atoms/Radio/Radio.stories.d.ts +10 -0
- package/dist/ui/atoms/Radio/Radio.test.d.ts +1 -0
- package/dist/ui/atoms/SidebarItem/SidebarItem.d.ts +3 -1
- package/dist/ui/atoms/SidebarItem/SidebarItem.stories.d.ts +3 -0
- package/dist/ui/atoms/index.d.ts +7 -0
- package/dist/ui/hooks/useCollapsible.d.ts +27 -0
- package/dist/ui/index.d.ts +13 -0
- package/dist/ui/molecules/InputWithLabel/InputWithLabel.d.ts +4 -2
- package/dist/ui/molecules/SidebarGroup/SidebarGroup.d.ts +8 -1
- package/dist/ui/molecules/SidebarGroup/SidebarGroup.stories.d.ts +11 -0
- package/dist/ui/molecules/SidebarGroup/SidebarGroup.test.d.ts +1 -0
- package/dist/ui/providers/ThemeProvider.d.ts +34 -0
- package/dist/ui/tokens/breakpoints.d.ts +36 -0
- package/dist/ui/tokens/colors.d.ts +89 -0
- package/dist/ui/tokens/sidebar.d.ts +48 -0
- package/dist/ui/tokens/spacing.d.ts +53 -0
- package/dist/ui/tokens/themes/dark.d.ts +38 -0
- package/dist/ui/tokens/themes/light.d.ts +38 -0
- package/dist/ui/tokens/tokens.factory.d.ts +57 -0
- package/dist/ui/tokens/typography.d.ts +90 -0
- package/package.json +3 -2
- package/src/ui/atoms/Button/Button.stories.tsx +77 -7
- package/src/ui/atoms/Button/Button.tsx +176 -28
- package/src/ui/atoms/Checkbox/Checkbox.stories.tsx +61 -0
- package/src/ui/atoms/Checkbox/Checkbox.test.tsx +32 -0
- package/src/ui/atoms/Checkbox/Checkbox.tsx +103 -0
- package/src/ui/atoms/Collapsible/Collapsible.stories.tsx +124 -0
- package/src/ui/atoms/Collapsible/Collapsible.test.tsx +174 -0
- package/src/ui/atoms/Collapsible/Collapsible.tsx +115 -0
- package/src/ui/atoms/Input/Input.stories.tsx +67 -6
- package/src/ui/atoms/Input/Input.tsx +117 -14
- package/src/ui/atoms/Radio/Radio.stories.tsx +72 -0
- package/src/ui/atoms/Radio/Radio.test.tsx +32 -0
- package/src/ui/atoms/Radio/Radio.tsx +104 -0
- package/src/ui/atoms/SidebarItem/SidebarItem.stories.tsx +44 -0
- package/src/ui/atoms/SidebarItem/SidebarItem.test.tsx +40 -0
- package/src/ui/atoms/SidebarItem/SidebarItem.tsx +26 -6
- package/src/ui/atoms/index.ts +10 -0
- package/src/ui/hooks/useCollapsible.ts +83 -0
- package/src/ui/index.ts +15 -0
- package/src/ui/molecules/InputWithLabel/InputWithLabel.tsx +5 -4
- package/src/ui/molecules/SidebarGroup/SidebarGroup.stories.tsx +173 -0
- package/src/ui/molecules/SidebarGroup/SidebarGroup.test.tsx +131 -0
- package/src/ui/molecules/SidebarGroup/SidebarGroup.tsx +80 -13
- package/src/ui/providers/ThemeProvider.tsx +105 -0
- package/src/ui/tokens/breakpoints.ts +71 -0
- package/src/ui/tokens/colors.ts +250 -0
- package/src/ui/tokens/sidebar.ts +66 -0
- package/src/ui/tokens/spacing.ts +127 -0
- package/src/ui/tokens/themes/dark.ts +18 -0
- package/src/ui/tokens/themes/light.ts +18 -0
- package/src/ui/tokens/tokens.factory.ts +117 -0
- package/src/ui/tokens/typography.ts +191 -0
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),Ae=require("react-dom");var z={exports:{}},F={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var de;function $e(){if(de)return F;de=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(s,o,i){var c=null;if(i!==void 0&&(c=""+i),o.key!==void 0&&(c=""+o.key),"key"in o){i={};for(var l in o)l!=="key"&&(i[l]=o[l])}else i=o;return o=i.ref,{$$typeof:t,type:s,key:c,ref:o!==void 0?o:null,props:i}}return F.Fragment=e,F.jsx=a,F.jsxs=a,F}var I={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,34 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var ue;function Oe(){return ue||(ue=1,process.env.NODE_ENV!=="production"&&(function(){function t(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===_e?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case x:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case Te:return"Suspense";case Ce:return"SuspenseList";case Se:return"Activity"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case C:return"Portal";case Ne:return n.displayName||"Context";case P:return(n._context.displayName||"Context")+".Consumer";case ke:var h=n.render;return n=n.displayName,n||(n=h.displayName||h.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Ee:return h=n.displayName||null,h!==null?h:t(n.type)||"Memo";case K:h=n._payload,n=n._init;try{return t(n(h))}catch{}}return null}function e(n){return""+n}function a(n){try{e(n);var h=!1}catch{h=!0}if(h){h=console;var j=h.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return j.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),e(n)}}function s(n){if(n===x)return"<>";if(typeof n=="object"&&n!==null&&n.$$typeof===K)return"<...>";try{var h=t(n);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function o(){var n=q.A;return n===null?null:n.getOwner()}function i(){return Error("react-stack-top-frame")}function c(n){if(se.call(n,"key")){var h=Object.getOwnPropertyDescriptor(n,"key").get;if(h&&h.isReactWarning)return!1}return n.key!==void 0}function l(n,h){function j(){ne||(ne=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",h))}j.isReactWarning=!0,Object.defineProperty(n,"key",{get:j,configurable:!0})}function d(){var n=t(this.type);return ie[n]||(ie[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function u(n,h,j,N,W,X){var k=j.ref;return n={$$typeof:v,type:n,key:h,props:j,_owner:N},(k!==void 0?k:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:d}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function f(n,h,j,N,W,X){var k=h.children;if(k!==void 0)if(N)if(Re(k)){for(N=0;N<k.length;N++)m(k[N]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(k);if(se.call(h,"key")){k=t(n);var O=Object.keys(h).filter(function(Le){return Le!=="key"});N=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",ce[k+N]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,g,v,_,v),U[v+g]=!0)}if(v=null,h!==void 0&&(a(h),v=""+h),i(u)&&(a(u.key),v=""+u.key),"key"in u){h={};for(var z in u)z!=="key"&&(h[z]=u[z])}else h=u;return v&&c(h,typeof r=="function"?r.displayName||r.name||"Unknown":r),b(r,v,h,l(),O,Y)}function m(r){x(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===I&&(r._payload.status==="fulfilled"?x(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function x(r){return typeof r=="object"&&r!==null&&r.$$typeof===N}var y=w,N=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),se=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ie=Symbol.for("react.client.reference"),$=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,ce=Array.isArray,M=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(r){return r()}};var P,V={},q=y.react_stack_bottom_frame.bind(y,o)(),G=M(n(o)),U={};S.Fragment=f,S.jsx=function(r,u,h){var g=1e4>$.recentlyCreatedOwnerStacks++;return j(r,u,h,!1,g?Error("react-stack-top-frame"):q,g?M(n(r)):G)},S.jsxs=function(r,u,h){var g=1e4>$.recentlyCreatedOwnerStacks++;return j(r,u,h,!0,g?Error("react-stack-top-frame"):q,g?M(n(r)):G)}})()),S}var X;function xe(){return X||(X=1,process.env.NODE_ENV==="production"?L.exports=fe():L.exports=me()),L.exports}var e=xe();function be({variant:s="info",className:t,...a}){const n=[t||""];switch(s){case"warning":{n.push("bg-yellow-100 text-yellow-800 border-yellow-500");break}case"error":{n.push("bg-red-100 text-red-800 border-red-500");break}default:case"info":{n.push("bg-blue-100 text-blue-800 border-blue-500");break}}return e.jsx("div",{role:"alert",className:`border px-4 py-2 rounded-lg ${n.join(" ")}`,...a})}function R({variant:s,bold:t,italic:a,className:n,as:l,color:o,...i}){const c=[n];let d;if(l)d=l;else switch(s){case"heading":d="h2";break;case"list":d="li";break;case"paragraph":default:d="p";break}return t&&c.push("font-bold"),a&&c.push("italic"),o&&c.push(`text-${o}`),e.jsx(d,{className:c.join(" "),...i})}function Z({className:s,...t}){const a=[s,"px-large","border","border-1","border-grey-light","rounded","lh-form-element","h-form-element","text-base"];return e.jsx("input",{className:a.join(" "),...t})}function C({className:s,variant:t="regular",...a}){const n=[s,"rounded","h-form-element","lh-form-element","px-large","text-base"];switch(t){case"error":n.push("bg-red-light","text-red-dark","font-bold");break;case"secondary":n.push("bg-transparent","text-grey-minor","px-0");break;case"regular":default:n.push("bg-blue-light","text-blue-dark","font-bold");break}return e.jsx("button",{className:n.join(" "),...a})}function Q({className:s,...t}){const a=[s,"p-large","bg-bg","rounded","shadow-card"];return e.jsx("div",{className:a.join(" "),...t})}function pe({variant:s="neutral",className:t="",children:a,...n}){const l=["inline-flex","items-center","px-2","py-1","rounded","text-xs","font-medium","border"],o={success:"bg-green-100 text-green-800 border-green-500",warning:"bg-yellow-100 text-yellow-800 border-yellow-500",error:"bg-red-100 text-red-800 border-red-500",info:"bg-blue-100 text-blue-800 border-blue-500",neutral:"bg-gray-100 text-gray-800 border-gray-500"},i=[...l,o[s],t].filter(Boolean).join(" ");return e.jsx("span",{role:"status","aria-label":typeof a=="string"?a:void 0,className:i,...n,children:a})}function he({options:s,placeholder:t,error:a=!1,className:n="",...l}){const o=["block","w-full","rounded","h-form-element","px-large","border","text-base","focus:outline-none","focus:ring-2","focus:ring-offset-2"],i=a?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-indigo-500",c=[...o,i,n].filter(Boolean).join(" ");return e.jsxs("select",{className:c,"aria-invalid":a,"aria-describedby":a?`${l.id}-error`:void 0,...l,children:[t&&e.jsx("option",{value:"",disabled:!0,children:t}),s.map(d=>e.jsx("option",{value:d.value,disabled:d.disabled,children:d.label},d.value))]})}function ge({error:s=!1,resize:t="vertical",className:a="",...n}){const l=["block","w-full","rounded","px-large","py-medium","border","text-base","focus:outline-none","focus:ring-2","focus:ring-offset-2"],o={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},i=s?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-indigo-500",c=[...l,o[t],i,a].filter(Boolean).join(" ");return e.jsx("textarea",{className:c,"aria-invalid":s,"aria-describedby":s&&n.id?`${n.id}-error`:void 0,...n})}function ve({variant:s="default",className:t="",children:a,...n}){const l=["block","text-sm","font-medium","text-gray-700"],o={default:"",required:"after:content-['*'] after:ml-0.5 after:text-red-500",optional:"after:content-['(optional)'] after:ml-1 after:text-gray-400 after:font-normal"},i=[...l,o[s],t].filter(Boolean).join(" ");return e.jsx("label",{className:i,...n,children:a})}function je({message:s,id:t,className:a="",...n}){const o=[...["mt-1","text-sm","text-red-600","flex","items-center","gap-1"],a].filter(Boolean).join(" ");return e.jsxs("div",{role:"alert",id:t,className:o,"aria-live":"polite",...n,children:[e.jsx("svg",{className:"h-4 w-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),e.jsx("span",{children:s})]})}function K({variant:s="default",icon:t,className:a="",children:n,...l}){const o=["inline-flex","items-center","px-1","pt-1","border-b-2","text-sm","font-medium","transition-colors"],i={default:"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",active:"border-indigo-500 text-gray-900",disabled:"border-transparent text-gray-300 cursor-not-allowed pointer-events-none"},c=[...o,i[s],a].filter(Boolean).join(" ");return s==="disabled"?e.jsxs("span",{className:c,"aria-disabled":"true",children:[t&&e.jsx("span",{className:"flex-shrink-0",children:t}),n]}):e.jsxs("a",{className:c,...l,children:[t&&e.jsx("span",{className:"flex-shrink-0",children:t}),n]})}function ye({content:s,children:t,position:a="top",delay:n=200,className:l="",...o}){const[i,c]=w.useState(!1),[d,b]=w.useState(null),j=()=>{const N=setTimeout(()=>{c(!0)},n);b(N)},m=()=>{d&&(clearTimeout(d),b(null)),c(!1)},x={top:"bottom-full left-1/2 transform -translate-x-1/2 mb-2",bottom:"top-full left-1/2 transform -translate-x-1/2 mt-2",left:"right-full top-1/2 transform -translate-y-1/2 mr-2",right:"left-full top-1/2 transform -translate-y-1/2 ml-2"},y={top:"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900",bottom:"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900",left:"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900",right:"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900"};return e.jsxs("div",{className:`relative inline-block ${l}`,onMouseEnter:j,onMouseLeave:m,...o,children:[t,i&&e.jsxs("div",{className:`absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap ${x[a]}`,role:"tooltip",children:[s,e.jsx("div",{className:`absolute w-0 h-0 border-4 border-transparent ${y[a]}`})]})]})}function Ne({variant:s="text",width:t,height:a,lines:n=1,className:l="",...o}){const i=["animate-pulse","bg-gray-200","rounded"],c={text:"h-4",card:"h-32",list:"h-12",circle:"rounded-full"},d=[...i,c[s],l].filter(Boolean).join(" "),b={};return t&&(b.width=t),a&&(b.height=a),s==="text"&&n>1?e.jsx("div",{className:"space-y-2",...o,children:Array.from({length:n}).map((j,m)=>e.jsx("div",{className:d,style:m===n-1?{width:"75%"}:b},m))}):e.jsx("div",{className:d,style:b,...o})}function ee({href:s,isActive:t=!1,icon:a,children:n,className:l="",...o}){const i=["flex","items-center","px-4","py-2","text-sm","font-medium","rounded-md","transition-colors","hover:bg-gray-100"],c=t?"bg-indigo-50 text-indigo-700 border-r-2 border-indigo-600":"text-gray-700 hover:text-gray-900",d=[...i,c,l].filter(Boolean).join(" ");return e.jsxs("a",{href:s,className:d,...o,children:[a&&e.jsx("span",{className:"mr-3 flex-shrink-0",children:a}),e.jsx("span",{children:n})]})}function D({label:s,...t}){return t.id||console.error("InputWithLabel component requires an id prop"),e.jsxs("div",{className:"mb-medium grid gap-small",children:[e.jsx(R,{as:"label",htmlFor:t.id,className:"cursor-pointer",children:s}),e.jsx(Z,{...t})]})}function we({variant:s="default",padding:t="medium",className:a="",children:n,...l}){const o=["bg-white","rounded-lg","border","border-gray-200","shadow-sm"],i={default:"",hover:"hover:shadow-md transition-shadow cursor-pointer",selected:"border-indigo-500 shadow-md"},c={none:"",small:"p-2",medium:"p-4",large:"p-6"},d=[...o,i[s],c[t],a].filter(Boolean).join(" ");return e.jsx("div",{className:d,...l,children:n})}function ke({children:s,onSubmit:t,loading:a=!1,error:n=null,success:l=null,className:o="",...i}){const d=[...["space-y-4"],o].filter(Boolean).join(" "),b=j=>{j.preventDefault(),t&&!a&&t(j)};return e.jsxs("form",{className:d,onSubmit:b,noValidate:!0,...i,children:[s,n&&e.jsx("div",{role:"alert",className:"p-3 text-sm text-red-800 bg-red-50 border border-red-200 rounded",children:n}),l&&e.jsx("div",{role:"alert",className:"p-3 text-sm text-green-800 bg-green-50 border border-green-200 rounded",children:l})]})}function Ee({items:s,separator:t="/",className:a="",...n}){const o=[...["flex","items-center","space-x-2","text-sm"],a].filter(Boolean).join(" ");return e.jsx("nav",{"aria-label":"Breadcrumb",className:o,...n,children:e.jsx("ol",{className:"flex items-center space-x-2",children:s.map((i,c)=>{const d=c===s.length-1;return e.jsxs("li",{className:"flex items-center",children:[c>0&&e.jsx("span",{className:"mx-2 text-gray-400","aria-hidden":"true",children:t}),d?e.jsx("span",{className:"text-gray-900 font-medium","aria-current":"page",children:i.label}):i.href?e.jsx(K,{href:i.href,variant:"default",children:i.label}):e.jsx("span",{className:"text-gray-500",children:i.label})]},c)})})})}function Ce({currentPage:s,totalPages:t,onPageChange:a,totalItems:n,itemsPerPage:l,showPageInfo:o=!0,className:i="",...c}){const d=()=>{s>1&&a(s-1)},b=()=>{s<t&&a(s+1)},j=f=>{f>=1&&f<=t&&f!==s&&a(f)},m=()=>{const f=[];if(t<=5)for(let p=1;p<=t;p++)f.push(p);else if(s<=3){for(let p=1;p<=4;p++)f.push(p);f.push("ellipsis"),f.push(t)}else if(s>=t-2){f.push(1),f.push("ellipsis");for(let p=t-3;p<=t;p++)f.push(p)}else{f.push(1),f.push("ellipsis");for(let p=s-1;p<=s+1;p++)f.push(p);f.push("ellipsis"),f.push(t)}return f},x=n&&l?(s-1)*l+1:void 0,y=n&&l?Math.min(s*l,n):void 0,k=[...["flex","items-center","justify-between","px-4","py-3"],i].filter(Boolean).join(" ");return e.jsxs("nav",{className:k,"aria-label":"Pagination",...c,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"secondary",onClick:d,disabled:s===1,className:"px-3 py-1 text-sm",children:"Previous"}),e.jsx("div",{className:"flex items-center gap-1",children:m().map((f,E)=>{if(f==="ellipsis")return e.jsx("span",{className:"px-2 text-gray-500",children:"..."},`ellipsis-${E}`);const p=f,A=p===s;return e.jsx("button",{onClick:()=>j(p),className:`px-3 py-1 text-sm rounded ${A?"bg-indigo-600 text-white":"text-gray-700 hover:bg-gray-100"}`,"aria-current":A?"page":void 0,"aria-label":`Go to page ${p}`,children:p},p)})}),e.jsx(C,{variant:"secondary",onClick:b,disabled:s===t,className:"px-3 py-1 text-sm",children:"Next"})]}),o&&n&&l&&e.jsxs("div",{className:"text-sm text-gray-700",children:["Showing ",x," to ",y," of ",n," results"]})]})}function _e({title:s,message:t,actionLabel:a,onAction:n,illustration:l,variant:o="default",className:i="",...c}){const b=[...["flex","flex-col","items-center","justify-center","text-center","py-12","px-4"],i].filter(Boolean).join(" "),j=o==="withAction"||a&&n,m=o==="withIllustration"||l;return e.jsxs("div",{className:b,...c,children:[m&&l&&e.jsx("div",{className:"mb-4",children:l}),e.jsx(R,{as:"h3",className:"text-lg font-semibold text-gray-900 mb-2",children:s}),e.jsx(R,{as:"p",className:"text-sm text-gray-500 mb-6 max-w-sm",children:t}),j&&a&&n&&e.jsx(C,{variant:"regular",onClick:n,children:a})]})}function Re({trigger:s,items:t,align:a="right",variant:n="default",className:l="",...o}){const[i,c]=w.useState(!1),d=w.useRef(null);w.useEffect(()=>{const m=x=>{d.current&&!d.current.contains(x.target)&&c(!1)};return i&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[i]);const b=m=>{m.disabled||(m.onClick(),c(!1))},j=a==="right"?"right-0":"left-0";return e.jsxs("div",{className:`relative inline-block ${l}`,ref:d,...o,children:[e.jsx("div",{onClick:()=>c(!i),children:s}),i&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>c(!1)}),e.jsx("div",{className:`absolute z-20 mt-2 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 ${j}`,role:"menu","aria-orientation":"vertical",children:e.jsx("div",{className:"py-1",role:"none",children:t.map((m,x)=>{const y=["block","px-4","py-2","text-sm","w-full","text-left",m.disabled?"text-gray-400 cursor-not-allowed":m.variant==="danger"?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-100"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:y,onClick:()=>b(m),disabled:m.disabled,role:"menuitem",children:m.label},x)})})})]})]})}function re({title:s,children:t,className:a="",...n}){const o=[...["space-y-1"],a].filter(Boolean).join(" ");return e.jsxs("div",{className:o,...n,children:[s&&e.jsx(R,{as:"h3",className:"px-4 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:s}),e.jsx("div",{className:"space-y-1",children:t})]})}function F({title:s,onClose:t,showCloseButton:a=!1,children:n,className:l="",...o}){const c=[...["flex","items-center","justify-between","px-4","py-4","border-b","border-gray-200"],l].filter(Boolean).join(" ");return e.jsxs("div",{className:c,...o,children:[e.jsx(R,{as:"h2",className:"text-lg font-semibold text-gray-900",children:s}),e.jsxs("div",{className:"flex items-center space-x-2",children:[n,a&&t&&e.jsx(C,{variant:"secondary",onClick:t,className:"p-1","aria-label":"Close sidebar",children:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]})}function Te({label:s,isActive:t=!1,icon:a,onClick:n,className:l="",children:o,...i}){const c=["inline-flex","items-center","px-3","py-2","text-sm","font-medium","rounded-md","transition-colors"],d=t?"bg-indigo-100 text-indigo-700 border-b-2 border-indigo-600":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",b=[...c,d,l].filter(Boolean).join(" ");return e.jsxs("button",{type:"button",className:b,onClick:n,"aria-expanded":t,"aria-haspopup":"true",...i,children:[a&&e.jsx("span",{className:"mr-2",children:a}),e.jsx("span",{children:s}),o]})}function Se({onForgotPasswordClick:s,className:t,...a}){return e.jsx(Q,{className:t,children:e.jsxs("form",{...a,onSubmit:n=>{n.preventDefault(),a.onSubmit&&a.onSubmit(n)},children:[e.jsx(D,{id:"login-email",label:"Your email",placeholder:"myname@email.com"}),e.jsx(D,{id:"login-password",label:"Your password",placeholder:"••••••••",type:"password"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(C,{variant:"secondary",type:"button",onClick:s,children:"Forgot password?"}),e.jsx(C,{variant:"regular",type:"submit",children:"Sign in"})]})]})})}function Ae({isOpen:s,onClose:t,title:a,children:n,variant:l="default",showCloseButton:o=!0,footer:i,className:c="",...d}){const b=w.useRef(null),j=w.useRef(null);if(w.useEffect(()=>{if(!s)return;j.current=document.activeElement;const f=setTimeout(()=>{b.current?.focus()},0),E=p=>{p.key==="Escape"&&t()};return document.addEventListener("keydown",E),()=>{clearTimeout(f),document.removeEventListener("keydown",E),j.current?.focus()}},[s,t]),w.useEffect(()=>(s?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[s]),!s)return null;const m=["fixed","inset-0","z-50","overflow-y-auto"],x=["fixed","inset-0","bg-black","bg-opacity-50","transition-opacity"],N=["relative","bg-white","rounded-lg","shadow-xl","my-8","mx-auto",{default:"max-w-md",large:"max-w-2xl",fullscreen:"max-w-full h-full"}[l],"p-6",c].filter(Boolean).join(" "),k=e.jsxs("div",{className:m.join(" "),role:"dialog","aria-modal":"true","aria-labelledby":a?"modal-title":void 0,onClick:f=>{f.target===f.currentTarget&&t()},children:[e.jsx("div",{className:x.join(" "),"aria-hidden":"true"}),e.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:e.jsxs("div",{ref:b,tabIndex:-1,className:N,onClick:f=>f.stopPropagation(),...d,children:[a&&e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900",children:a}),o&&e.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500 focus:outline-none","aria-label":"Close modal",children:e.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),!a&&o&&e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-500 focus:outline-none","aria-label":"Close modal",children:e.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),e.jsx("div",{className:"mb-4",children:n}),i&&e.jsx("div",{className:"flex justify-end gap-2 mt-4",children:i})]})})]});return typeof window<"u"?ue.createPortal(k,document.body):k}function Oe({columns:s,data:t,loading:a=!1,onSort:n,sortColumn:l,sortDirection:o,emptyMessage:i="No data available",className:c="",...d}){const b=x=>{if(!n||!s.find(N=>N.key===x)?.sortable)return;n(x,l===x&&o==="asc"?"desc":"asc")},m=[...["min-w-full","divide-y","divide-gray-200"],c].filter(Boolean).join(" ");return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:m,...d,children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsx("tr",{children:s.map(x=>e.jsx("th",{scope:"col",className:`px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider ${x.sortable&&n?"cursor-pointer hover:bg-gray-100 select-none":""}`,onClick:()=>x.sortable&&b(x.key),children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x.label}),x.sortable&&l===x.key&&e.jsx("span",{className:"text-gray-400",children:o==="asc"?"↑":"↓"})]})},x.key))})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:a?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:"px-6 py-4 text-center text-gray-500",children:"Loading..."})}):t.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:"px-6 py-4 text-center text-gray-500",children:i})}):t.map((x,y)=>e.jsx("tr",{className:"hover:bg-gray-50",children:s.map(N=>{const k=x[N.key];return e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:N.render?N.render(k,x):k},N.key)})},y))})]})})}function B({variant:s="default",title:t,showHeader:a=!0,onClose:n,children:l,className:o="",...i}){const c=["flex","flex-col","bg-white","border-r","border-gray-200","h-full"],d={default:"w-64",collapsed:"w-16"},b=[...c,d[s],o].filter(Boolean).join(" ");return e.jsxs("aside",{className:b,...i,children:[a&&t&&e.jsx(F,{title:t,onClose:n,showCloseButton:!!n}),e.jsx("nav",{className:"flex-1 overflow-y-auto py-4",children:l})]})}B.Group=re;B.Item=ee;B.Header=F;exports.Badge=pe;exports.BoxWrapper=Q;exports.Breadcrumb=Ee;exports.Button=C;exports.Card=we;exports.Dropdown=Re;exports.EmptyState=_e;exports.ErrorMessage=je;exports.Form=ke;exports.Info=be;exports.Input=Z;exports.InputWithLabel=D;exports.Label=ve;exports.LoginBox=Se;exports.Modal=Ae;exports.NavLink=K;exports.NavbarGroup=Te;exports.Pagination=Ce;exports.Select=he;exports.Sidebar=B;exports.SidebarGroup=re;exports.SidebarHeader=F;exports.SidebarItem=ee;exports.Skeleton=Ne;exports.Table=Oe;exports.Text=R;exports.Textarea=ge;exports.Tooltip=ye;
|
|
22
|
+
<%s key={someKey} {...props} />`,N,k,O,k),ce[k+N]=!0)}if(k=null,j!==void 0&&(a(j),k=""+j),c(h)&&(a(h.key),k=""+h.key),"key"in h){j={};for(var Z in h)Z!=="key"&&(j[Z]=h[Z])}else j=h;return k&&l(j,typeof n=="function"?n.displayName||n.name||"Unknown":n),u(n,k,j,o(),W,X)}function m(n){g(n)?n._store&&(n._store.validated=1):typeof n=="object"&&n!==null&&n.$$typeof===K&&(n._payload.status==="fulfilled"?g(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function g(n){return typeof n=="object"&&n!==null&&n.$$typeof===v}var b=p,v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),Ne=Symbol.for("react.context"),ke=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),Ce=Symbol.for("react.suspense_list"),Ee=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),Se=Symbol.for("react.activity"),_e=Symbol.for("react.client.reference"),q=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=Object.prototype.hasOwnProperty,Re=Array.isArray,J=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(n){return n()}};var ne,ie={},oe=b.react_stack_bottom_frame.bind(b,i)(),le=J(s(i)),ce={};I.Fragment=x,I.jsx=function(n,h,j){var N=1e4>q.recentlyCreatedOwnerStacks++;return f(n,h,j,!1,N?Error("react-stack-top-frame"):oe,N?J(s(n)):le)},I.jsxs=function(n,h,j){var N=1e4>q.recentlyCreatedOwnerStacks++;return f(n,h,j,!0,N?Error("react-stack-top-frame"):oe,N?J(s(n)):le)}})()),I}var fe;function Fe(){return fe||(fe=1,process.env.NODE_ENV==="production"?z.exports=$e():z.exports=Oe()),z.exports}var r=Fe();function Ie({variant:t="info",className:e,...a}){const s=[e||""];switch(t){case"warning":{s.push("bg-yellow-100 text-yellow-800 border-yellow-500");break}case"error":{s.push("bg-red-100 text-red-800 border-red-500");break}default:case"info":{s.push("bg-blue-100 text-blue-800 border-blue-500");break}}return r.jsx("div",{role:"alert",className:`border px-4 py-2 rounded-lg ${s.join(" ")}`,...a})}function L({variant:t,bold:e,italic:a,className:s,as:o,color:i,...c}){const l=[s];let d;if(o)d=o;else switch(t){case"heading":d="h2";break;case"list":d="li";break;case"paragraph":default:d="p";break}return e&&l.push("font-bold"),a&&l.push("italic"),i&&l.push(`text-${i}`),r.jsx(d,{className:l.join(" "),...c})}class T{static createFontSize(e){const s={xs:{px:12,tailwind:"text-xs"},sm:{px:14,tailwind:"text-sm"},base:{px:16,tailwind:"text-base"},lg:{px:18,tailwind:"text-lg"},xl:{px:20,tailwind:"text-xl"},"2xl":{px:24,tailwind:"text-2xl"},"3xl":{px:30,tailwind:"text-3xl"},"4xl":{px:36,tailwind:"text-4xl"},"5xl":{px:48,tailwind:"text-5xl"},"6xl":{px:60,tailwind:"text-6xl"}}[e];return{value:s.px,rem:`${s.px/16}rem`,px:`${s.px}px`,tailwind:s.tailwind}}static createLineHeight(e){const s={none:{value:1,tailwind:"leading-none"},tight:{value:1.25,tailwind:"leading-tight"},snug:{value:1.375,tailwind:"leading-snug"},normal:{value:1.5,tailwind:"leading-normal"},relaxed:{value:1.625,tailwind:"leading-relaxed"},loose:{value:2,tailwind:"leading-loose"}}[e];return{value:s.value,tailwind:s.tailwind}}static createFontWeight(e){const s={light:{value:300,tailwind:"font-light"},normal:{value:400,tailwind:"font-normal"},medium:{value:500,tailwind:"font-medium"},semibold:{value:600,tailwind:"font-semibold"},bold:{value:700,tailwind:"font-bold"}}[e];return{value:s.value,tailwind:s.tailwind}}static create(e,a="normal",s="normal"){return{fontSize:this.createFontSize(e),lineHeight:this.createLineHeight(a),fontWeight:this.createFontWeight(s)}}}const Be={sans:{name:"sans",stack:'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',tailwind:"font-sans"},serif:{name:"serif",stack:'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',tailwind:"font-serif"},mono:{name:"mono",stack:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',tailwind:"font-mono"}},Me={light:T.createFontWeight("light"),normal:T.createFontWeight("normal"),medium:T.createFontWeight("medium"),semibold:T.createFontWeight("semibold"),bold:T.createFontWeight("bold")},B={h1:T.create("4xl","tight","bold"),h2:T.create("3xl","tight","bold"),h3:T.create("2xl","snug","semibold"),h4:T.create("xl","snug","semibold"),h5:T.create("lg","normal","medium"),h6:T.create("base","normal","medium"),body:T.create("base","relaxed","normal"),bodySmall:T.create("sm","relaxed","normal"),bodyLarge:T.create("lg","relaxed","normal"),label:T.create("sm","normal","medium"),caption:T.create("xs","normal","normal"),button:T.create("base","normal","medium")};function De(t){return B[t]}function A(t){const e=B[t];return`${e.fontSize.tailwind} ${e.lineHeight.tailwind} ${e.fontWeight.tailwind}`}class U{generatePrimary(){return{light:{hex:"#818cf8",rgb:"129, 140, 248",tailwind:"indigo-400"},DEFAULT:{hex:"#6366f1",rgb:"99, 102, 241",tailwind:"indigo-500"},dark:{hex:"#4f46e5",rgb:"79, 70, 229",tailwind:"indigo-600"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateSecondary(){return{light:{hex:"#a78bfa",rgb:"167, 139, 250",tailwind:"violet-400"},DEFAULT:{hex:"#8b5cf6",rgb:"139, 92, 246",tailwind:"violet-500"},dark:{hex:"#7c3aed",rgb:"124, 58, 237",tailwind:"violet-600"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateSuccess(){return{light:{hex:"#86efac",rgb:"134, 239, 172",tailwind:"green-300"},DEFAULT:{hex:"#22c55e",rgb:"34, 197, 94",tailwind:"green-500"},dark:{hex:"#16a34a",rgb:"22, 163, 74",tailwind:"green-600"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateWarning(){return{light:{hex:"#fde047",rgb:"253, 224, 71",tailwind:"yellow-300"},DEFAULT:{hex:"#eab308",rgb:"234, 179, 8",tailwind:"yellow-500"},dark:{hex:"#ca8a04",rgb:"202, 138, 4",tailwind:"yellow-600"},contrast:{hex:"#000000",rgb:"0, 0, 0",tailwind:"black"}}}generateError(){return{light:{hex:"#fca5a5",rgb:"252, 165, 165",tailwind:"red-300"},DEFAULT:{hex:"#ef4444",rgb:"239, 68, 68",tailwind:"red-500"},dark:{hex:"#dc2626",rgb:"220, 38, 38",tailwind:"red-600"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateInfo(){return{light:{hex:"#93c5fd",rgb:"147, 197, 253",tailwind:"blue-300"},DEFAULT:{hex:"#3b82f6",rgb:"59, 130, 246",tailwind:"blue-500"},dark:{hex:"#2563eb",rgb:"37, 99, 235",tailwind:"blue-600"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateNeutral(){return{light:{hex:"#f3f4f6",rgb:"243, 244, 246",tailwind:"gray-100"},DEFAULT:{hex:"#6b7280",rgb:"107, 114, 128",tailwind:"gray-500"},dark:{hex:"#374151",rgb:"55, 65, 81",tailwind:"gray-700"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}}class Y{generatePrimary(){return{light:{hex:"#6366f1",rgb:"99, 102, 241",tailwind:"indigo-500"},DEFAULT:{hex:"#818cf8",rgb:"129, 140, 248",tailwind:"indigo-400"},dark:{hex:"#a5b4fc",rgb:"165, 180, 252",tailwind:"indigo-300"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateSecondary(){return{light:{hex:"#8b5cf6",rgb:"139, 92, 246",tailwind:"violet-500"},DEFAULT:{hex:"#a78bfa",rgb:"167, 139, 250",tailwind:"violet-400"},dark:{hex:"#c4b5fd",rgb:"196, 181, 253",tailwind:"violet-300"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateSuccess(){return{light:{hex:"#22c55e",rgb:"34, 197, 94",tailwind:"green-500"},DEFAULT:{hex:"#4ade80",rgb:"74, 222, 128",tailwind:"green-400"},dark:{hex:"#86efac",rgb:"134, 239, 172",tailwind:"green-300"},contrast:{hex:"#000000",rgb:"0, 0, 0",tailwind:"black"}}}generateWarning(){return{light:{hex:"#eab308",rgb:"234, 179, 8",tailwind:"yellow-500"},DEFAULT:{hex:"#facc15",rgb:"250, 204, 21",tailwind:"yellow-400"},dark:{hex:"#fde047",rgb:"253, 224, 71",tailwind:"yellow-300"},contrast:{hex:"#000000",rgb:"0, 0, 0",tailwind:"black"}}}generateError(){return{light:{hex:"#ef4444",rgb:"239, 68, 68",tailwind:"red-500"},DEFAULT:{hex:"#f87171",rgb:"248, 113, 113",tailwind:"red-400"},dark:{hex:"#fca5a5",rgb:"252, 165, 165",tailwind:"red-300"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateInfo(){return{light:{hex:"#3b82f6",rgb:"59, 130, 246",tailwind:"blue-500"},DEFAULT:{hex:"#60a5fa",rgb:"96, 165, 250",tailwind:"blue-400"},dark:{hex:"#93c5fd",rgb:"147, 197, 253",tailwind:"blue-300"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}generateNeutral(){return{light:{hex:"#374151",rgb:"55, 65, 81",tailwind:"gray-700"},DEFAULT:{hex:"#9ca3af",rgb:"156, 163, 175",tailwind:"gray-400"},dark:{hex:"#d1d5db",rgb:"209, 213, 219",tailwind:"gray-300"},contrast:{hex:"#ffffff",rgb:"255, 255, 255",tailwind:"white"}}}}class H{strategy;constructor(e){this.strategy=e}setStrategy(e){this.strategy=e}generatePalette(){return{primary:this.strategy.generatePrimary(),secondary:this.strategy.generateSecondary(),success:this.strategy.generateSuccess(),warning:this.strategy.generateWarning(),error:this.strategy.generateError(),info:this.strategy.generateInfo(),neutral:this.strategy.generateNeutral()}}}const Pe=new H(new U),G=Pe.generatePalette(),We=new H(new Y),ee=We.generatePalette(),te=G;function ze(t,e="DEFAULT"){return te[t][e]}function _(t,e="DEFAULT",a="text"){const s=te[t][e];return`${a}-${s.tailwind}`}function me({id:t,label:e,error:a=!1,helperText:s,size:o="md",variant:i="outlined",className:c="",disabled:l=!1,...d}){const u=t||`input-${Math.random().toString(36).substr(2,9)}`,f=a?`${u}-error`:void 0,m=s?`${u}-helper`:void 0,g={sm:"h-8 text-sm px-3",md:"h-10 text-base px-4",lg:"h-12 text-lg px-5"},b={default:"border-0 border-b-2 border-gray-300 focus:border-indigo-500",outlined:"border border-gray-300 focus:border-indigo-500",filled:"bg-gray-100 border-0 focus:bg-white focus:ring-2 focus:ring-indigo-500"},v=["w-full","rounded-md","transition-colors","focus:outline-none","focus:ring-2","focus:ring-offset-2","disabled:opacity-50","disabled:cursor-not-allowed",g[o],b[i]],C=a?"border-red-500 focus:border-red-500 focus:ring-red-500":"",x=[...v,C,c].filter(Boolean).join(" "),S=["block",A("label"),"mb-1",l?"opacity-50":""].filter(Boolean).join(" ");return r.jsxs("div",{className:"w-full",children:[e&&r.jsx("label",{htmlFor:u,className:S,children:e}),r.jsx("input",{id:u,className:x,disabled:l,"aria-invalid":a,"aria-describedby":f||m,...d}),(a||s)&&r.jsx("div",{id:f||m,className:`mt-1 ${A("caption")} ${a?_("error","DEFAULT","text"):"text-gray-500"}`,role:a?"alert":void 0,children:a||s})]})}class Ue{classes=[];addBase(){return this.classes.push("inline-flex","items-center","justify-center","font-medium","rounded-md","transition-colors","focus:outline-none","focus:ring-2","focus:ring-offset-2","disabled:opacity-50","disabled:cursor-not-allowed"),this}addVariant(e){const a=e==="regular"?"primary":e,s={primary:[_("primary","DEFAULT","bg"),_("primary","DEFAULT","text"),"hover:opacity-90","focus:ring-indigo-500"],secondary:[_("secondary","DEFAULT","bg"),_("secondary","DEFAULT","text"),"hover:opacity-90","focus:ring-violet-500"],error:[_("error","DEFAULT","bg"),_("error","DEFAULT","text"),"hover:opacity-90","focus:ring-red-500"],outline:["border-2","border-gray-300","bg-transparent","text-gray-700","hover:bg-gray-50","focus:ring-gray-500"],ghost:["bg-transparent","text-gray-700","hover:bg-gray-100","focus:ring-gray-500"]};return this.classes.push(...s[a]),this}addSize(e){const a={sm:["px-3","py-1.5","text-sm"],md:["px-4","py-2","text-base"],lg:["px-6","py-3","text-lg"]};return this.classes.push(...a[e]),this}addCustom(e){return e&&this.classes.push(e),this}build(){return this.classes.filter(Boolean).join(" ")}}function $({variant:t="primary",size:e="md",isLoading:a=!1,leftIcon:s,rightIcon:o,className:i="",disabled:c=!1,children:l,...d}){const f=new Ue().addBase().addVariant(t).addSize(e).addCustom(i).build();return r.jsx("button",{className:f,disabled:c||a,...d,children:a?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):r.jsxs(r.Fragment,{children:[s&&r.jsx("span",{className:"mr-2",children:s}),l,o&&r.jsx("span",{className:"ml-2",children:o})]})})}function he({className:t,...e}){const a=[t,"p-large","bg-bg","rounded","shadow-card"];return r.jsx("div",{className:a.join(" "),...e})}function Ye({variant:t="neutral",className:e="",children:a,...s}){const o=["inline-flex","items-center","px-2","py-1","rounded","text-xs","font-medium","border"],i={success:"bg-green-100 text-green-800 border-green-500",warning:"bg-yellow-100 text-yellow-800 border-yellow-500",error:"bg-red-100 text-red-800 border-red-500",info:"bg-blue-100 text-blue-800 border-blue-500",neutral:"bg-gray-100 text-gray-800 border-gray-500"},c=[...o,i[t],e].filter(Boolean).join(" ");return r.jsx("span",{role:"status","aria-label":typeof a=="string"?a:void 0,className:c,...s,children:a})}function He({options:t,placeholder:e,error:a=!1,className:s="",...o}){const i=["block","w-full","rounded","h-form-element","px-large","border","text-base","focus:outline-none","focus:ring-2","focus:ring-offset-2"],c=a?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-indigo-500",l=[...i,c,s].filter(Boolean).join(" ");return r.jsxs("select",{className:l,"aria-invalid":a,"aria-describedby":a?`${o.id}-error`:void 0,...o,children:[e&&r.jsx("option",{value:"",disabled:!0,children:e}),t.map(d=>r.jsx("option",{value:d.value,disabled:d.disabled,children:d.label},d.value))]})}function Ge({error:t=!1,resize:e="vertical",className:a="",...s}){const o=["block","w-full","rounded","px-large","py-medium","border","text-base","focus:outline-none","focus:ring-2","focus:ring-offset-2"],i={none:"resize-none",both:"resize",horizontal:"resize-x",vertical:"resize-y"},c=t?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-indigo-500",l=[...o,i[e],c,a].filter(Boolean).join(" ");return r.jsx("textarea",{className:l,"aria-invalid":t,"aria-describedby":t&&s.id?`${s.id}-error`:void 0,...s})}function Ve({variant:t="default",className:e="",children:a,...s}){const o=["block","text-sm","font-medium","text-gray-700"],i={default:"",required:"after:content-['*'] after:ml-0.5 after:text-red-500",optional:"after:content-['(optional)'] after:ml-1 after:text-gray-400 after:font-normal"},c=[...o,i[t],e].filter(Boolean).join(" ");return r.jsx("label",{className:c,...s,children:a})}function Ke({message:t,id:e,className:a="",...s}){const i=[...["mt-1","text-sm","text-red-600","flex","items-center","gap-1"],a].filter(Boolean).join(" ");return r.jsxs("div",{role:"alert",id:e,className:i,"aria-live":"polite",...s,children:[r.jsx("svg",{className:"h-4 w-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),r.jsx("span",{children:t})]})}function xe({variant:t="default",icon:e,className:a="",children:s,...o}){const i=["inline-flex","items-center","px-1","pt-1","border-b-2","text-sm","font-medium","transition-colors"],c={default:"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",active:"border-indigo-500 text-gray-900",disabled:"border-transparent text-gray-300 cursor-not-allowed pointer-events-none"},l=[...i,c[t],a].filter(Boolean).join(" ");return t==="disabled"?r.jsxs("span",{className:l,"aria-disabled":"true",children:[e&&r.jsx("span",{className:"flex-shrink-0",children:e}),s]}):r.jsxs("a",{className:l,...o,children:[e&&r.jsx("span",{className:"flex-shrink-0",children:e}),s]})}function qe({content:t,children:e,position:a="top",delay:s=200,className:o="",...i}){const[c,l]=p.useState(!1),[d,u]=p.useState(null),f=()=>{const v=setTimeout(()=>{l(!0)},s);u(v)},m=()=>{d&&(clearTimeout(d),u(null)),l(!1)},g={top:"bottom-full left-1/2 transform -translate-x-1/2 mb-2",bottom:"top-full left-1/2 transform -translate-x-1/2 mt-2",left:"right-full top-1/2 transform -translate-y-1/2 mr-2",right:"left-full top-1/2 transform -translate-y-1/2 ml-2"},b={top:"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900",bottom:"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900",left:"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900",right:"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900"};return r.jsxs("div",{className:`relative inline-block ${o}`,onMouseEnter:f,onMouseLeave:m,...i,children:[e,c&&r.jsxs("div",{className:`absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap ${g[a]}`,role:"tooltip",children:[t,r.jsx("div",{className:`absolute w-0 h-0 border-4 border-transparent ${b[a]}`})]})]})}function Je({variant:t="text",width:e,height:a,lines:s=1,className:o="",...i}){const c=["animate-pulse","bg-gray-200","rounded"],l={text:"h-4",card:"h-32",list:"h-12",circle:"rounded-full"},d=[...c,l[t],o].filter(Boolean).join(" "),u={};return e&&(u.width=e),a&&(u.height=a),t==="text"&&s>1?r.jsx("div",{className:"space-y-2",...i,children:Array.from({length:s}).map((f,m)=>r.jsx("div",{className:d,style:m===s-1?{width:"75%"}:u},m))}):r.jsx("div",{className:d,style:u,...i})}const y={icon:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},text:{xs:"text-xs",sm:"text-sm",base:"text-base"},spacing:{itemPaddingX:"px-4",itemPaddingY:"py-2",nestedIndent:"pl-6",nestedIndentLevel2:"pl-10",nestedIndentLevel3:"pl-14",groupTitlePadding:"px-4 py-2",iconMargin:"mr-3"},colors:{active:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-600"},inactive:{text:"text-gray-700",hover:"hover:bg-gray-100 hover:text-gray-900"},groupTitle:"text-gray-500"},chevron:{size:"h-3 w-3",color:"text-gray-400"}};function be(t){return t<=0?y.spacing.itemPaddingX:t===1?y.spacing.nestedIndent:t===2?y.spacing.nestedIndentLevel2:t===3?y.spacing.nestedIndentLevel3:`pl-${4+t*4}`}function pe({href:t,isActive:e=!1,icon:a,nested:s=!1,iconSize:o="md",children:i,className:c="",...l}){const f=["flex","items-center",be(typeof s=="number"?s:s?1:0),y.spacing.itemPaddingY,y.text.sm,"font-medium","rounded-md","transition-colors","hover:bg-gray-100"],m=e?`${y.colors.active.bg} ${y.colors.active.text} border-r-2 ${y.colors.active.border}`:`${y.colors.inactive.text} ${y.colors.inactive.hover}`,g=y.icon[o],b=[...f,m,c].filter(Boolean).join(" ");return r.jsxs("a",{href:t,className:b,...l,children:[a&&r.jsx("span",{className:`${g} ${y.spacing.iconMargin} shrink-0`,children:a}),r.jsx("span",{children:i})]})}function Xe({defaultOpen:t=!0,open:e,onOpenChange:a,storageKey:s}){const o=p.useCallback(()=>{if(s&&typeof window<"u"){const f=localStorage.getItem(s);if(f!==null)return f==="true"}return t},[t,s]),[i,c]=p.useState(o),l=e!==void 0?e:i;p.useEffect(()=>{s&&typeof window<"u"&&e===void 0&&localStorage.setItem(s,String(i))},[i,s,e]);const d=p.useCallback(f=>{e===void 0&&c(f),a?.(f)},[e,a]),u=p.useCallback(()=>{d(!l)},[l,d]);return{isOpen:l,toggle:u,setOpen:d}}function ye({children:t,trigger:e,defaultOpen:a=!0,open:s,onOpenChange:o,disabled:i=!1,duration:c=200,storageKey:l,className:d="",...u}){const{isOpen:f,toggle:m}=Xe({defaultOpen:a,open:s,onOpenChange:o,storageKey:l}),g=p.useRef(null),[b,v]=p.useState(f?"auto":0);p.useEffect(()=>{g.current&&v(f?g.current.scrollHeight:0)},[f,t]),p.useEffect(()=>{if(!f||!g.current)return;const x=new ResizeObserver(()=>{g.current&&f&&v(g.current.scrollHeight)});return x.observe(g.current),()=>{x.disconnect()}},[f]);const C=`collapsible-content-${Math.random().toString(36).substr(2,9)}`;return r.jsxs("div",{className:d,...u,children:[r.jsx("button",{type:"button",onClick:m,disabled:i,"aria-expanded":f,"aria-controls":C,"aria-disabled":i,className:"w-full text-left focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 rounded-md",children:e}),r.jsx("div",{id:C,ref:g,style:{height:typeof b=="number"?`${b}px`:b,overflow:"hidden",transition:`height ${c}ms ease-in-out`},"aria-hidden":!f,children:r.jsx("div",{children:t})})]})}function Ze({id:t,label:e,error:a=!1,helperText:s,className:o="",disabled:i=!1,...c}){const l=t||`checkbox-${Math.random().toString(36).substr(2,9)}`,d=a?`${l}-error`:void 0,u=s?`${l}-helper`:void 0,f=["h-4","w-4","rounded","border-gray-300","text-indigo-600","focus:ring-2","focus:ring-indigo-500","focus:ring-offset-2","disabled:opacity-50","disabled:cursor-not-allowed","cursor-pointer"],m=a?"border-red-500 focus:ring-red-500":"",g=[...f,m].filter(Boolean).join(" "),b=[A("label"),"ml-2",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" ");return r.jsxs("div",{className:`flex flex-col my-2 ${o}`,children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",id:l,className:g,disabled:i,"aria-invalid":a,"aria-describedby":d||u,...c}),e&&r.jsx("label",{htmlFor:l,className:b,children:e})]}),(a||s)&&r.jsx("div",{id:d||u,className:`mt-1 ${A("caption")} ${a?"text-red-600":"text-gray-500"}`,role:a?"alert":void 0,children:a||s})]})}function Qe({id:t,label:e,error:a=!1,helperText:s,className:o="",disabled:i=!1,...c}){const l=t||`radio-${Math.random().toString(36).substr(2,9)}`,d=a?`${l}-error`:void 0,u=s?`${l}-helper`:void 0,f=["h-4","w-4","border-gray-300","text-indigo-600","focus:ring-2","focus:ring-indigo-500","focus:ring-offset-2","disabled:opacity-50","disabled:cursor-not-allowed","cursor-pointer"],m=a?"border-red-500 focus:ring-red-500":"",g=[...f,m].filter(Boolean).join(" "),b=[A("label"),"ml-2",i?"opacity-50 cursor-not-allowed":"cursor-pointer"].filter(Boolean).join(" ");return r.jsxs("div",{className:`flex flex-col my-2 ${o}`,children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"radio",id:l,className:g,disabled:i,"aria-invalid":a,"aria-describedby":d||u,...c}),e&&r.jsx("label",{htmlFor:l,className:b,children:e})]}),(a||s)&&r.jsx("div",{id:d||u,className:`mt-1 ${A("caption")} ${a?"text-red-600":"text-gray-500"}`,role:a?"alert":void 0,children:a||s})]})}function Q({label:t,size:e,...a}){return a.id||console.error("InputWithLabel component requires an id prop"),r.jsxs("div",{className:"mb-medium grid gap-small",children:[r.jsx(L,{as:"label",htmlFor:a.id,className:"cursor-pointer",children:t}),r.jsx(me,{...a,size:e})]})}function et({variant:t="default",padding:e="medium",className:a="",children:s,...o}){const i=["bg-white","rounded-lg","border","border-gray-200","shadow-sm"],c={default:"",hover:"hover:shadow-md transition-shadow cursor-pointer",selected:"border-indigo-500 shadow-md"},l={none:"",small:"p-2",medium:"p-4",large:"p-6"},d=[...i,c[t],l[e],a].filter(Boolean).join(" ");return r.jsx("div",{className:d,...o,children:s})}function tt({children:t,onSubmit:e,loading:a=!1,error:s=null,success:o=null,className:i="",...c}){const d=[...["space-y-4"],i].filter(Boolean).join(" "),u=f=>{f.preventDefault(),e&&!a&&e(f)};return r.jsxs("form",{className:d,onSubmit:u,noValidate:!0,...c,children:[t,s&&r.jsx("div",{role:"alert",className:"p-3 text-sm text-red-800 bg-red-50 border border-red-200 rounded",children:s}),o&&r.jsx("div",{role:"alert",className:"p-3 text-sm text-green-800 bg-green-50 border border-green-200 rounded",children:o})]})}function rt({items:t,separator:e="/",className:a="",...s}){const i=[...["flex","items-center","space-x-2","text-sm"],a].filter(Boolean).join(" ");return r.jsx("nav",{"aria-label":"Breadcrumb",className:i,...s,children:r.jsx("ol",{className:"flex items-center space-x-2",children:t.map((c,l)=>{const d=l===t.length-1;return r.jsxs("li",{className:"flex items-center",children:[l>0&&r.jsx("span",{className:"mx-2 text-gray-400","aria-hidden":"true",children:e}),d?r.jsx("span",{className:"text-gray-900 font-medium","aria-current":"page",children:c.label}):c.href?r.jsx(xe,{href:c.href,variant:"default",children:c.label}):r.jsx("span",{className:"text-gray-500",children:c.label})]},l)})})})}function at({currentPage:t,totalPages:e,onPageChange:a,totalItems:s,itemsPerPage:o,showPageInfo:i=!0,className:c="",...l}){const d=()=>{t>1&&a(t-1)},u=()=>{t<e&&a(t+1)},f=x=>{x>=1&&x<=e&&x!==t&&a(x)},m=()=>{const x=[];if(e<=5)for(let w=1;w<=e;w++)x.push(w);else if(t<=3){for(let w=1;w<=4;w++)x.push(w);x.push("ellipsis"),x.push(e)}else if(t>=e-2){x.push(1),x.push("ellipsis");for(let w=e-3;w<=e;w++)x.push(w)}else{x.push(1),x.push("ellipsis");for(let w=t-1;w<=t+1;w++)x.push(w);x.push("ellipsis"),x.push(e)}return x},g=s&&o?(t-1)*o+1:void 0,b=s&&o?Math.min(t*o,s):void 0,C=[...["flex","items-center","justify-between","px-4","py-3"],c].filter(Boolean).join(" ");return r.jsxs("nav",{className:C,"aria-label":"Pagination",...l,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx($,{variant:"secondary",onClick:d,disabled:t===1,className:"px-3 py-1 text-sm",children:"Previous"}),r.jsx("div",{className:"flex items-center gap-1",children:m().map((x,S)=>{if(x==="ellipsis")return r.jsx("span",{className:"px-2 text-gray-500",children:"..."},`ellipsis-${S}`);const w=x,P=w===t;return r.jsx("button",{onClick:()=>f(w),className:`px-3 py-1 text-sm rounded ${P?"bg-indigo-600 text-white":"text-gray-700 hover:bg-gray-100"}`,"aria-current":P?"page":void 0,"aria-label":`Go to page ${w}`,children:w},w)})}),r.jsx($,{variant:"secondary",onClick:u,disabled:t===e,className:"px-3 py-1 text-sm",children:"Next"})]}),i&&s&&o&&r.jsxs("div",{className:"text-sm text-gray-700",children:["Showing ",g," to ",b," of ",s," results"]})]})}function st({title:t,message:e,actionLabel:a,onAction:s,illustration:o,variant:i="default",className:c="",...l}){const u=[...["flex","flex-col","items-center","justify-center","text-center","py-12","px-4"],c].filter(Boolean).join(" "),f=i==="withAction"||a&&s,m=i==="withIllustration"||o;return r.jsxs("div",{className:u,...l,children:[m&&o&&r.jsx("div",{className:"mb-4",children:o}),r.jsx(L,{as:"h3",className:"text-lg font-semibold text-gray-900 mb-2",children:t}),r.jsx(L,{as:"p",className:"text-sm text-gray-500 mb-6 max-w-sm",children:e}),f&&a&&s&&r.jsx($,{variant:"regular",onClick:s,children:a})]})}function nt({trigger:t,items:e,align:a="right",variant:s="default",className:o="",...i}){const[c,l]=p.useState(!1),d=p.useRef(null);p.useEffect(()=>{const m=g=>{d.current&&!d.current.contains(g.target)&&l(!1)};return c&&document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[c]);const u=m=>{m.disabled||(m.onClick(),l(!1))},f=a==="right"?"right-0":"left-0";return r.jsxs("div",{className:`relative inline-block ${o}`,ref:d,...i,children:[r.jsx("div",{onClick:()=>l(!c),children:t}),c&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>l(!1)}),r.jsx("div",{className:`absolute z-20 mt-2 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 ${f}`,role:"menu","aria-orientation":"vertical",children:r.jsx("div",{className:"py-1",role:"none",children:e.map((m,g)=>{const b=["block","px-4","py-2","text-sm","w-full","text-left",m.disabled?"text-gray-400 cursor-not-allowed":m.variant==="danger"?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-100"].filter(Boolean).join(" ");return r.jsx("button",{type:"button",className:b,onClick:()=>u(m),disabled:m.disabled,role:"menuitem",children:m.label},g)})})})]})]})}/**
|
|
23
|
+
* @license lucide-react v0.552.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const it=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ot=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,s)=>s?s.toUpperCase():a.toLowerCase()),ge=t=>{const e=ot(t);return e.charAt(0).toUpperCase()+e.slice(1)},we=(...t)=>t.filter((e,a,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===a).join(" ").trim(),lt=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
28
|
+
* @license lucide-react v0.552.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/var ct={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
|
+
* @license lucide-react v0.552.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/const dt=p.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:i,iconNode:c,...l},d)=>p.createElement("svg",{ref:d,...ct,width:e,height:e,stroke:t,strokeWidth:s?Number(a)*24/Number(e):a,className:we("lucide",o),...!i&&!lt(l)&&{"aria-hidden":"true"},...l},[...c.map(([u,f])=>p.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
|
|
38
|
+
* @license lucide-react v0.552.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const ut=(t,e)=>{const a=p.forwardRef(({className:s,...o},i)=>p.createElement(dt,{ref:i,iconNode:e,className:we(`lucide-${it(ge(t))}`,`lucide-${t}`,s),...o}));return a.displayName=ge(t),a};/**
|
|
43
|
+
* @license lucide-react v0.552.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const ft=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gt=ut("chevron-right",ft);function ve({title:t,titleIcon:e,children:a,collapsible:s=!1,defaultCollapsed:o=!1,collapsed:i,onCollapseChange:c,storageKey:l,showChevron:d=!0,className:u="",...f}){const g=[...["space-y-1"],u].filter(Boolean).join(" "),b=({isOpen:v})=>r.jsx(gt,{className:`${y.chevron.size} ${y.chevron.color} transition-transform duration-200 ${v?"rotate-90":""}`});return s&&t?r.jsx(ye,{defaultOpen:!o,open:i!==void 0?!i:void 0,onOpenChange:v=>c?.(!v),storageKey:l,trigger:r.jsxs("div",{className:`${y.spacing.groupTitlePadding} flex items-center justify-between w-full hover:bg-gray-50 rounded-md transition-colors cursor-pointer`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[e&&r.jsx("span",{className:`${y.icon.md} ${y.colors.groupTitle}`,children:e}),r.jsx(L,{as:"h3",className:`${y.text.xs} font-semibold ${y.colors.groupTitle} uppercase tracking-wider`,children:t})]}),d&&r.jsx("span",{className:"ml-2",children:r.jsx(b,{isOpen:i!==void 0?!i:!o})})]}),className:g,...f,children:r.jsx("div",{className:"space-y-1",children:a})}):r.jsxs("div",{className:g,...f,children:[t&&r.jsxs("div",{className:`${y.spacing.groupTitlePadding} flex items-center gap-2`,children:[e&&r.jsx("span",{className:`${y.icon.md} ${y.colors.groupTitle}`,children:e}),r.jsx(L,{as:"h3",className:`${y.text.xs} font-semibold ${y.colors.groupTitle} uppercase tracking-wider`,children:t})]}),r.jsx("div",{className:"space-y-1",children:a})]})}function re({title:t,onClose:e,showCloseButton:a=!1,children:s,className:o="",...i}){const l=[...["flex","items-center","justify-between","px-4","py-4","border-b","border-gray-200"],o].filter(Boolean).join(" ");return r.jsxs("div",{className:l,...i,children:[r.jsx(L,{as:"h2",className:"text-lg font-semibold text-gray-900",children:t}),r.jsxs("div",{className:"flex items-center space-x-2",children:[s,a&&e&&r.jsx($,{variant:"secondary",onClick:e,className:"p-1","aria-label":"Close sidebar",children:r.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]})}function mt({label:t,isActive:e=!1,icon:a,onClick:s,className:o="",children:i,...c}){const l=["inline-flex","items-center","px-3","py-2","text-sm","font-medium","rounded-md","transition-colors"],d=e?"bg-indigo-100 text-indigo-700 border-b-2 border-indigo-600":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",u=[...l,d,o].filter(Boolean).join(" ");return r.jsxs("button",{type:"button",className:u,onClick:s,"aria-expanded":e,"aria-haspopup":"true",...c,children:[a&&r.jsx("span",{className:"mr-2",children:a}),r.jsx("span",{children:t}),i]})}function ht({onForgotPasswordClick:t,className:e,...a}){return r.jsx(he,{className:e,children:r.jsxs("form",{...a,onSubmit:s=>{s.preventDefault(),a.onSubmit&&a.onSubmit(s)},children:[r.jsx(Q,{id:"login-email",label:"Your email",placeholder:"myname@email.com"}),r.jsx(Q,{id:"login-password",label:"Your password",placeholder:"••••••••",type:"password"}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx($,{variant:"secondary",type:"button",onClick:t,children:"Forgot password?"}),r.jsx($,{variant:"regular",type:"submit",children:"Sign in"})]})]})})}function xt({isOpen:t,onClose:e,title:a,children:s,variant:o="default",showCloseButton:i=!0,footer:c,className:l="",...d}){const u=p.useRef(null),f=p.useRef(null);if(p.useEffect(()=>{if(!t)return;f.current=document.activeElement;const x=setTimeout(()=>{u.current?.focus()},0),S=w=>{w.key==="Escape"&&e()};return document.addEventListener("keydown",S),()=>{clearTimeout(x),document.removeEventListener("keydown",S),f.current?.focus()}},[t,e]),p.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),!t)return null;const m=["fixed","inset-0","z-50","overflow-y-auto"],g=["fixed","inset-0","bg-black","bg-opacity-50","transition-opacity"],v=["relative","bg-white","rounded-lg","shadow-xl","my-8","mx-auto",{default:"max-w-md",large:"max-w-2xl",fullscreen:"max-w-full h-full"}[o],"p-6",l].filter(Boolean).join(" "),C=r.jsxs("div",{className:m.join(" "),role:"dialog","aria-modal":"true","aria-labelledby":a?"modal-title":void 0,onClick:x=>{x.target===x.currentTarget&&e()},children:[r.jsx("div",{className:g.join(" "),"aria-hidden":"true"}),r.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:r.jsxs("div",{ref:u,tabIndex:-1,className:v,onClick:x=>x.stopPropagation(),...d,children:[a&&r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900",children:a}),i&&r.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 focus:outline-none","aria-label":"Close modal",children:r.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),!a&&i&&r.jsx("div",{className:"flex justify-end mb-4",children:r.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 focus:outline-none","aria-label":"Close modal",children:r.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})}),r.jsx("div",{className:"mb-4",children:s}),c&&r.jsx("div",{className:"flex justify-end gap-2 mt-4",children:c})]})})]});return typeof window<"u"?Ae.createPortal(C,document.body):C}function bt({columns:t,data:e,loading:a=!1,onSort:s,sortColumn:o,sortDirection:i,emptyMessage:c="No data available",className:l="",...d}){const u=g=>{if(!s||!t.find(v=>v.key===g)?.sortable)return;s(g,o===g&&i==="asc"?"desc":"asc")},m=[...["min-w-full","divide-y","divide-gray-200"],l].filter(Boolean).join(" ");return r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:m,...d,children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsx("tr",{children:t.map(g=>r.jsx("th",{scope:"col",className:`px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider ${g.sortable&&s?"cursor-pointer hover:bg-gray-100 select-none":""}`,onClick:()=>g.sortable&&u(g.key),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{children:g.label}),g.sortable&&o===g.key&&r.jsx("span",{className:"text-gray-400",children:i==="asc"?"↑":"↓"})]})},g.key))})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:a?r.jsx("tr",{children:r.jsx("td",{colSpan:t.length,className:"px-6 py-4 text-center text-gray-500",children:"Loading..."})}):e.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:t.length,className:"px-6 py-4 text-center text-gray-500",children:c})}):e.map((g,b)=>r.jsx("tr",{className:"hover:bg-gray-50",children:t.map(v=>{const C=g[v.key];return r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:v.render?v.render(C,g):C},v.key)})},b))})]})})}function V({variant:t="default",title:e,showHeader:a=!0,onClose:s,children:o,className:i="",...c}){const l=["flex","flex-col","bg-white","h-full","w-full"],d={default:"",collapsed:""},u=[...l,d[t],i].filter(Boolean).join(" ");return r.jsxs("div",{className:u,...c,children:[a&&e&&r.jsx("div",{className:"flex-shrink-0",children:r.jsx(re,{title:e,onClose:s,showCloseButton:!!s})}),r.jsx("div",{className:"flex-1 overflow-y-auto py-4 min-h-0",children:o})]})}V.Group=ve;V.Item=pe;V.Header=re;class E{static BASE_UNIT=4;static create(e){const a=e*this.BASE_UNIT,s=a/16;return{value:a,rem:`${s}rem`,px:`${a}px`,tailwind:this.getTailwindClass(e)}}static getTailwindClass(e){return{0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",8:"8",10:"10",12:"12",16:"16",20:"20",24:"24",32:"32",40:"40",48:"48",64:"64",80:"80",96:"96"}[e]||String(e)}}const M={none:E.create(0),xs:E.create(1),sm:E.create(2),md:E.create(3),base:E.create(4),lg:E.create(6),xl:E.create(8),"2xl":E.create(10),"3xl":E.create(12),"4xl":E.create(16),"5xl":E.create(20),"6xl":E.create(24)};function pt(t){return M[t]}function yt(t,e="p"){const s=M[t].tailwind;return`${{p:"p",m:"m",px:"px",mx:"mx",py:"py",my:"my",pt:"pt",mt:"mt",pr:"pr",mr:"mr",pb:"pb",mb:"mb",pl:"pl",ml:"ml"}[e]}-${s}`}class R{static create(e){const s={sm:{minWidth:640,tailwind:"sm"},md:{minWidth:768,tailwind:"md"},lg:{minWidth:1024,tailwind:"lg"},xl:{minWidth:1280,tailwind:"xl"},"2xl":{minWidth:1536,tailwind:"2xl"}}[e];return{name:e,minWidth:s.minWidth,px:`${s.minWidth}px`,rem:`${s.minWidth/16}rem`,tailwind:s.tailwind}}}const D={sm:R.create("sm"),md:R.create("md"),lg:R.create("lg"),xl:R.create("xl"),"2xl":R.create("2xl")};function wt(t){return D[t]}function vt(t,e="min"){const a=D[t];return`@media (${e==="min"?"min-width":"max-width"}: ${a.px})`}class ae{colorFactory;constructor(e="light"){const a=e==="light"?new U:new Y;this.colorFactory=new H(a)}createSpacing(e){return E.create(e)}createTypography(e,a,s){return T.create(e,a,s)}createColorPalette(){return this.colorFactory.generatePalette()}createBreakpoint(e){return R.create(e)}createTokenSet(){return{spacing:{xs:this.createSpacing(1),sm:this.createSpacing(2),md:this.createSpacing(3),base:this.createSpacing(4),lg:this.createSpacing(6),xl:this.createSpacing(8),"2xl":this.createSpacing(10),"3xl":this.createSpacing(12),"4xl":this.createSpacing(16)},typography:{h1:this.createTypography("4xl","tight","bold"),h2:this.createTypography("3xl","tight","bold"),h3:this.createTypography("2xl","snug","semibold"),body:this.createTypography("base","relaxed","normal"),label:this.createTypography("sm","normal","medium"),caption:this.createTypography("xs","normal","normal")},colors:this.createColorPalette(),breakpoints:{sm:this.createBreakpoint("sm"),md:this.createBreakpoint("md"),lg:this.createBreakpoint("lg"),xl:this.createBreakpoint("xl"),"2xl":this.createBreakpoint("2xl")}}}setTheme(e){const a=e==="light"?new U:new Y;this.colorFactory.setStrategy(a)}}const jt=new ae("light");function Nt(t="light"){return new ae(t).createTokenSet()}const kt={colors:G,spacing:M,typography:B,breakpoints:D,mode:"light"},Tt={colors:ee,spacing:M,typography:B,breakpoints:D,mode:"dark"},je=p.createContext(void 0);function Ct({children:t,defaultTheme:e="light",storageKey:a="theme"}){const[s,o]=p.useState(()=>{if(typeof window>"u")return e;try{const u=localStorage.getItem(a);if(u==="light"||u==="dark")return u}catch(u){console.warn("Failed to read theme from localStorage:",u)}return e});p.useEffect(()=>{try{localStorage.setItem(a,s)}catch(u){console.warn("Failed to save theme to localStorage:",u)}document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(s)},[s,a]);const d={theme:s,toggleTheme:()=>{o(u=>u==="light"?"dark":"light")},setTheme:u=>{o(u)},colors:s==="light"?G:ee,isDark:s==="dark"};return r.jsx(je.Provider,{value:d,children:t})}function Et(){const t=p.useContext(je);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}exports.BREAKPOINT_TOKENS=D;exports.Badge=Ye;exports.BoxWrapper=he;exports.Breadcrumb=rt;exports.BreakpointTokenFactory=R;exports.Button=$;exports.COLOR_TOKENS=te;exports.COLOR_TOKENS_DARK=ee;exports.COLOR_TOKENS_LIGHT=G;exports.Card=et;exports.Checkbox=Ze;exports.Collapsible=ye;exports.ColorTokenFactory=H;exports.DARK_THEME=Tt;exports.DarkColorStrategy=Y;exports.Dropdown=nt;exports.EmptyState=st;exports.ErrorMessage=Ke;exports.FONT_FAMILY_TOKENS=Be;exports.FONT_WEIGHT_TOKENS=Me;exports.Form=tt;exports.Info=Ie;exports.Input=me;exports.InputWithLabel=Q;exports.LIGHT_THEME=kt;exports.Label=Ve;exports.LightColorStrategy=U;exports.LoginBox=ht;exports.Modal=xt;exports.NavLink=xe;exports.NavbarGroup=mt;exports.Pagination=at;exports.Radio=Qe;exports.SIDEBAR_TOKENS=y;exports.SPACING_TOKENS=M;exports.Select=He;exports.Sidebar=V;exports.SidebarGroup=ve;exports.SidebarHeader=re;exports.SidebarItem=pe;exports.Skeleton=Je;exports.SpacingTokenFactory=E;exports.TYPOGRAPHY_TOKENS=B;exports.Table=bt;exports.Text=L;exports.Textarea=Ge;exports.ThemeProvider=Ct;exports.TokensFactory=ae;exports.Tooltip=qe;exports.TypographyTokenFactory=T;exports.createTokenSet=Nt;exports.defaultTokensFactory=jt;exports.getBreakpoint=wt;exports.getColor=ze;exports.getColorClass=_;exports.getMediaQuery=vt;exports.getNestedIndentClass=be;exports.getSpacing=pt;exports.getSpacingClass=yt;exports.getTypography=De;exports.getTypographyClasses=A;exports.useTheme=Et;
|