sls-ui-library 1.0.2 → 1.0.3
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/sls-ui.es.js +623 -405
- package/dist/sls-ui.umd.js +30 -30
- package/package.json +1 -1
package/dist/sls-ui.umd.js
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.SlsUiLibrary={},h.jsxRuntime,h.React,h.ReactDOM))})(this,function(h,e,
|
|
1
|
+
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.SlsUiLibrary={},h.jsxRuntime,h.React,h.ReactDOM))})(this,function(h,e,D,W){"use strict";function ie(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const g=ie(D);function $(t){var r,a,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(a=$(t[r]))&&(n&&(n+=" "),n+=a)}else for(a in t)t[a]&&(n&&(n+=" "),n+=a);return n}function fe(){for(var t,r,a=0,n="",s=arguments.length;a<s;a++)(t=arguments[a])&&(r=$(t))&&(n&&(n+=" "),n+=r);return n}function u(...t){return fe(t)}const he={neutral:"bg-tag text-tag border border-tag-border",online:"bg-status-online-bg text-status-online",warn:"bg-status-warn-bg text-status-warn",offline:"bg-status-offline-bg text-status-offline",live:"bg-live-bg text-live-text",accent:"bg-accent-muted text-accent"};function be({tone:t="neutral",className:r,children:a,...n}){return e.jsx("span",{className:u("inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium",he[t],r),...n,children:a})}const ue={primary:"bg-accent text-white hover:brightness-110 focus-visible:ring-accent/50",secondary:"bg-accent-muted text-accent hover:brightness-105 focus-visible:ring-accent/40",outline:"border border-card-border text-ink-primary bg-transparent hover:bg-accent-muted focus-visible:ring-accent/30",ghost:"bg-transparent text-ink-primary hover:bg-accent-muted focus-visible:ring-accent/30",danger:"bg-status-offline text-white hover:brightness-110 focus-visible:ring-status-offline/50",add:"bg-status-online text-white hover:brightness-110 focus-visible:ring-status-online/50",cancel:"border border-card-border text-ink-secondary bg-transparent hover:bg-card focus-visible:ring-ink-muted/30"},ge={sm:"h-8 px-3 text-sm gap-1.5",md:"h-10 px-4 text-sm gap-2",lg:"h-12 px-6 text-base gap-2"},C=g.forwardRef(({variant:t="primary",size:r="md",icon:a,trailingIcon:n,loading:s,fullWidth:c,disabled:l,className:f,children:o,...d},i)=>e.jsxs("button",{ref:i,disabled:l||s,className:u("inline-flex items-center justify-center rounded-md font-primary font-medium","transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2","disabled:opacity-50 disabled:cursor-not-allowed",ue[t],ge[r],c&&"w-full",f),...d,children:[s?e.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}):a&&e.jsx("span",{className:"inline-flex shrink-0",children:a}),o,!s&&n&&e.jsx("span",{className:"inline-flex shrink-0",children:n})]}));C.displayName="Button";const H=g.forwardRef(({padded:t=!0,className:r,children:a,...n},s)=>e.jsx("div",{ref:s,className:u("rounded-lg border border-card-border bg-card shadow-md text-ink-primary",t&&"p-4",r),...n,children:a}));H.displayName="Card";/**
|
|
2
2
|
* @license lucide-react v0.400.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const xe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Y=(...t)=>t.filter((r,a,n)=>!!r&&n.indexOf(r)===a).join(" ");/**
|
|
7
7
|
* @license lucide-react v0.400.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var
|
|
11
|
+
*/var me={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"};/**
|
|
12
12
|
* @license lucide-react v0.400.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const pe=
|
|
16
|
+
*/const pe=D.forwardRef(({color:t="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:s="",children:c,iconNode:l,...f},o)=>D.createElement("svg",{ref:o,...me,width:r,height:r,stroke:t,strokeWidth:n?Number(a)*24/Number(r):a,className:Y("lucide",s),...f},[...l.map(([d,i])=>D.createElement(d,i)),...Array.isArray(c)?c:[c]]));/**
|
|
17
17
|
* @license lucide-react v0.400.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const y=(t,r)=>{const a=D.forwardRef(({className:n,...s},c)=>D.createElement(pe,{ref:c,iconNode:r,className:Y(`lucide-${xe(t)}`,n),...s}));return a.displayName=`${t}`,a};/**
|
|
22
22
|
* @license lucide-react v0.400.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const ve=y("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
27
27
|
* @license lucide-react v0.400.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const V=y("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
32
32
|
* @license lucide-react v0.400.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const ye=y("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
37
37
|
* @license lucide-react v0.400.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const ke=y("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
42
42
|
* @license lucide-react v0.400.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const _=y("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
47
47
|
* @license lucide-react v0.400.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
51
|
+
*/const G=y("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
52
52
|
* @license lucide-react v0.400.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const
|
|
56
|
+
*/const U=y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
57
57
|
* @license lucide-react v0.400.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const
|
|
61
|
+
*/const we=y("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
62
62
|
* @license lucide-react v0.400.0 - ISC
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the ISC license.
|
|
65
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const
|
|
66
|
+
*/const Ne=y("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
67
67
|
* @license lucide-react v0.400.0 - ISC
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
70
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const Q=
|
|
71
|
+
*/const Q=y("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
72
72
|
* @license lucide-react v0.400.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const Z=
|
|
76
|
+
*/const Z=y("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
77
77
|
* @license lucide-react v0.400.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const Ce=y("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
82
82
|
* @license lucide-react v0.400.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const
|
|
86
|
+
*/const Be=y("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
87
87
|
* @license lucide-react v0.400.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const
|
|
91
|
+
*/const Me=y("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
92
92
|
* @license lucide-react v0.400.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const Se=y("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
97
97
|
* @license lucide-react v0.400.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const ze=y("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
102
102
|
* @license lucide-react v0.400.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const De=y("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
107
107
|
* @license lucide-react v0.400.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const Le=y("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
112
112
|
* @license lucide-react v0.400.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const J=
|
|
116
|
+
*/const J=y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
117
117
|
* @license lucide-react v0.400.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const Te=y("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
122
122
|
* @license lucide-react v0.400.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const j=y("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
127
127
|
* @license lucide-react v0.400.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const X=
|
|
131
|
+
*/const X=y("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
132
132
|
* @license lucide-react v0.400.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const
|
|
136
|
+
*/const Pe=y("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
137
137
|
* @license lucide-react v0.400.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const Ae=y("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
142
142
|
* @license lucide-react v0.400.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const P=v("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),A=p.forwardRef(({label:t,id:r,className:a,checked:n,...s},l)=>{const c=r??p.useId();return e.jsxs("label",{htmlFor:c,className:"inline-flex cursor-pointer items-center gap-2 select-none",children:[e.jsxs("span",{className:"relative inline-flex h-4 w-4 shrink-0 items-center justify-center",children:[e.jsx("input",{ref:l,id:c,type:"checkbox",checked:n,className:"peer sr-only",...s}),e.jsx("span",{className:b("h-4 w-4 rounded border border-card-border bg-input transition-colors","peer-checked:border-accent peer-checked:bg-accent","peer-focus-visible:ring-2 peer-focus-visible:ring-accent/40",a)}),n&&e.jsx(U,{size:12,strokeWidth:3,className:"pointer-events-none absolute text-white"})]}),t&&e.jsx("span",{className:"text-sm text-ink-primary",children:t})]})});A.displayName="Checkbox";const Pe={idle:"text-icon-idle hover:text-icon-active hover:bg-accent-muted",active:"text-icon-active bg-accent-muted",danger:"text-status-offline hover:bg-status-offline-bg"},Ae={sm:"h-8 w-8",md:"h-10 w-10"},S=p.forwardRef(({icon:t,label:r,variant:a="idle",size:n="md",className:s,...l},c)=>e.jsx("button",{ref:c,"aria-label":r,title:r,className:b("inline-flex items-center justify-center rounded-full transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40","disabled:opacity-40 disabled:cursor-not-allowed",Pe[a],Ae[n],s),...l,children:t}));S.displayName="IconButton";function Te({columns:t,visible:r,onChange:a,className:n}){const[s,l]=p.useState(!1),c=p.useRef(null);p.useEffect(()=>{function i(d){c.current&&!c.current.contains(d.target)&&l(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);function u(i){a(r.includes(i)?r.filter(d=>d!==i):[...r,i])}return e.jsxs("div",{ref:c,className:b("relative",n),children:[e.jsx(S,{icon:e.jsx(Me,{size:16}),label:"Choose columns",onClick:()=>l(i=>!i),variant:s?"active":"idle"}),s&&e.jsx("div",{className:"absolute right-0 z-20 mt-1 w-52 rounded-md border border-card-border bg-card p-2 shadow-lg",children:t.map(i=>e.jsxs("label",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-accent-muted",children:[e.jsx(A,{checked:r.includes(i.key),onChange:()=>u(i.key)}),e.jsx("span",{className:"text-ink-primary",children:i.label})]},i.key))})]})}const Fe={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};function T({open:t,onClose:r,title:a,footer:n,size:s="md",children:l,className:c}){return p.useEffect(()=>{if(!t)return;function u(i){i.key==="Escape"&&r()}return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[t,r]),t?$.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r,"aria-hidden":!0}),e.jsxs("div",{role:"dialog","aria-modal":"true",className:b("relative z-10 flex max-h-[90vh] w-full flex-col rounded-lg border border-card-border bg-card shadow-xl",Fe[s],c),children:[a&&e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-5 py-4",children:[e.jsx("h2",{className:"font-secondary text-base font-semibold text-ink-primary",children:a}),e.jsx("button",{onClick:r,"aria-label":"Close",className:"text-ink-muted hover:text-ink-primary",children:e.jsx(P,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:l}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-card-border px-5 py-4",children:n})]})]}),document.body):null}function Ee({open:t,title:r,message:a,confirmLabel:n="Ok",cancelLabel:s="Close",tone:l="default",onConfirm:c,onClose:u,loading:i}){return e.jsx(T,{open:t,onClose:u,title:r,size:"sm",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"cancel",onClick:u,children:s}),e.jsx(C,{variant:l==="danger"?"danger":"primary",onClick:c,loading:i,children:n})]}),children:e.jsx("p",{className:"text-sm text-ink-secondary",children:a})})}function O({fullPage:t,label:r="Loading...",className:a}){const n=e.jsxs("div",{className:b("flex flex-col items-center justify-center gap-3",a),children:[e.jsx("span",{className:"h-10 w-10 animate-spin rounded-full border-4 border-accent-muted border-t-accent"}),r&&e.jsx("span",{className:"text-sm text-ink-secondary",children:r})]});return t?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-canvas/70 backdrop-blur-sm",children:n}):n}function I({checked:t,indeterminate:r,onChange:a,label:n="Select row"}){const s=p.useRef(null);return p.useEffect(()=>{s.current&&(s.current.indeterminate=!!r)},[r]),e.jsx(A,{ref:s,checked:t,onChange:l=>a(l.target.checked),"aria-label":n})}function Oe({columns:t,data:r,rowKey:a,loading:n,emptyMessage:s="No records found.",visibleColumns:l,sortKey:c,sortDirection:u,onSortChange:i,selectable:d,selectedKeys:o=[],onSelectedKeysChange:f,onRowClick:y,className:M}){const N=l?t.filter(g=>l.includes(g.key)):t,x=r.map(a),w=d&&r.length>0&&x.every(g=>o.includes(g)),k=d&&x.some(g=>o.includes(g));function j(g){if(!(!g.sortable||!i)){if(c!==g.key)return i(g.key,"asc");if(u==="asc")return i(g.key,"desc");i(g.key,null)}}function B(){f&&f(w?[]:x)}function q(g){f&&f(o.includes(g)?o.filter(m=>m!==g):[...o,g])}return e.jsx("div",{className:b("overflow-x-auto rounded-lg border border-card-border bg-card",M),children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-card-border bg-canvas",children:[d&&e.jsx("th",{className:"w-10 px-4 py-3",children:e.jsx(I,{checked:!!w,indeterminate:!w&&k,onChange:B,label:"Select all rows"})}),N.map(g=>e.jsx("th",{style:{width:g.width},className:b("px-4 py-3 font-medium text-ink-secondary",g.align==="right"&&"text-right",g.align==="center"&&"text-center"),children:g.sortable?e.jsxs("button",{onClick:()=>j(g),className:"inline-flex items-center gap-1 hover:text-ink-primary",children:[g.header,c===g.key?u==="asc"?e.jsx(me,{size:12}):u==="desc"?e.jsx(xe,{size:12}):e.jsx(G,{size:12,className:"opacity-40"}):e.jsx(G,{size:12,className:"opacity-40"})]}):g.header},g.key))]})}),e.jsx("tbody",{children:n?e.jsx("tr",{children:e.jsx("td",{colSpan:N.length+(d?1:0),className:"py-10",children:e.jsx(O,{label:"Loading records..."})})}):r.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:N.length+(d?1:0),className:"py-10 text-center text-ink-muted",children:s})}):r.map(g=>{const m=a(g);return e.jsxs("tr",{onClick:()=>y==null?void 0:y(g),className:b("border-b border-card-border last:border-0 hover:bg-accent-muted/60",y&&"cursor-pointer"),children:[d&&e.jsx("td",{className:"px-4 py-3",onClick:z=>z.stopPropagation(),children:e.jsx(I,{checked:o.includes(m),onChange:()=>q(m)})}),N.map(z=>e.jsx("td",{className:b("px-4 py-3 text-ink-primary",z.align==="right"&&"text-right",z.align==="center"&&"text-center"),children:z.render(g)},z.key))]},m)})})]})})}function K({children:t,className:r,...a}){return t?e.jsxs("p",{className:b("mt-1 flex items-center gap-1 text-xs text-status-offline",r),...a,children:[e.jsx(ke,{size:12,className:"shrink-0"}),t]}):null}function D({label:t,htmlFor:r,required:a,error:n,hint:s,className:l,children:c,...u}){return e.jsxs("div",{className:b("flex flex-col",l),...u,children:[t&&e.jsxs("label",{htmlFor:r,className:"mb-1.5 text-sm font-medium text-ink-primary",children:[t,a&&e.jsx("span",{className:"ml-0.5 text-status-offline",children:"*"})]}),c,s&&!n&&e.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:s}),e.jsx(K,{children:n})]})}function Ie({label:t,required:r,error:a,value:n,onChange:s,min:l,max:c,disabled:u,className:i}){const d=p.useId();return e.jsx(D,{label:t,htmlFor:d,required:r,error:a,className:i,children:e.jsxs("div",{className:"relative",children:[e.jsx(W,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-ink-muted"}),e.jsx("input",{id:d,type:"date",value:n??"",min:l,max:c,disabled:u,onChange:o=>s(o.target.value),className:b("h-10 w-full rounded-md border bg-input pl-9 pr-3 text-sm text-ink-primary","focus:outline-none focus:ring-2 focus:ring-accent/40 disabled:opacity-50",a?"border-status-offline":"border-card-border")})]})})}const R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Be=["Su","Mo","Tu","We","Th","Fr","Sa"],qe=["This Financial Year","This Month","Last Month","Next Month","This Quarter","This Year","Last Year","Custom Range"];function F(t){return t?`${String(t.getDate()).padStart(2,"0")}-${R[t.getMonth()]}-${t.getFullYear()}`:""}function $e(t,r=new Date){const a=r.getFullYear(),n=r.getMonth();switch(t){case"This Financial Year":{const s=n>=3?a:a-1;return{from:new Date(s,3,1),to:new Date(s+1,2,31)}}case"This Month":return{from:new Date(a,n,1),to:new Date(a,n+1,0)};case"Last Month":return{from:new Date(a,n-1,1),to:new Date(a,n,0)};case"Next Month":return{from:new Date(a,n+1,1),to:new Date(a,n+2,0)};case"This Quarter":{const s=Math.floor(n/3)*3;return{from:new Date(a,s,1),to:new Date(a,s+3,0)}}case"This Year":return{from:new Date(a,0,1),to:new Date(a,11,31)};case"Last Year":return{from:new Date(a-1,0,1),to:new Date(a-1,11,31)};default:return{from:null,to:null}}}function ee({year:t,month:r,from:a,to:n,onPick:s}){const c=new Date(t,r,1).getDay(),u=new Date(t,r+1,0).getDate(),i=[];for(let f=0;f<c;f++)i.push(null);for(let f=1;f<=u;f++)i.push(f);function d(f){if(!f||!a||!n)return!1;const y=new Date(t,r,f).getTime();return y>=a.getTime()&&y<=n.getTime()}function o(f){if(!f)return!1;const y=new Date(t,r,f).getTime();return a&&y===a.getTime()||n&&y===n.getTime()}return e.jsxs("div",{children:[e.jsxs("p",{className:"mb-2 text-center text-sm font-semibold text-ink-primary",children:[R[r]," ",t]}),e.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center text-xs",children:[Be.map(f=>e.jsx("span",{className:"text-ink-muted",children:f},f)),i.map((f,y)=>e.jsx("button",{type:"button",disabled:!f,onClick:()=>f&&s(new Date(t,r,f)),className:b("h-7 w-7 rounded text-ink-primary",!f&&"invisible",f&&d(f)&&"bg-accent-muted",f&&o(f)&&"bg-accent text-white"),children:f},y))]})]})}function Ye({label:t,required:r,error:a,value:n,onChange:s,className:l}){const[c,u]=p.useState(!1),[i,d]=p.useState("Custom Range"),[o,f]=p.useState(n),[y,M]=p.useState(()=>(n.from??new Date).getMonth()),[N,x]=p.useState(()=>(n.from??new Date).getFullYear()),w=p.useRef(null);p.useEffect(()=>{function m(z){w.current&&!w.current.contains(z.target)&&u(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);function k(m){d(m),m!=="Custom Range"&&f($e(m))}function j(m){d("Custom Range"),!o.from||o.from&&o.to?f({from:m,to:null}):m.getTime()<o.from.getTime()?f({from:m,to:o.from}):f({...o,to:m})}function B(){y===0?(M(11),x(m=>m-1)):M(m=>m-1)}function q(){y===11?(M(0),x(m=>m+1)):M(m=>m+1)}function g(){s(o),u(!1)}return e.jsx(D,{label:t,required:r,error:a,className:l,children:e.jsxs("div",{ref:w,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>u(m=>!m),className:b("flex h-10 w-full items-center gap-2 rounded-md border bg-input px-3 text-left text-sm","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border"),children:[e.jsx(W,{size:16,className:"shrink-0 text-ink-muted"}),e.jsx("span",{className:n.from?"text-ink-primary":"text-ink-muted",children:n.from&&n.to?`${F(n.from)} - ${F(n.to)}`:"Select date range"})]}),c&&e.jsxs("div",{className:"absolute z-20 mt-1 flex w-[560px] max-w-[90vw] overflow-hidden rounded-md border border-card-border bg-card shadow-xl",children:[e.jsx("div",{className:"w-40 shrink-0 border-r border-card-border py-2",children:qe.map(m=>e.jsx("button",{type:"button",onClick:()=>k(m),className:b("block w-full px-3 py-2 text-left text-sm",i===m?"bg-accent text-white":"text-ink-primary hover:bg-accent-muted"),children:m},m))}),e.jsxs("div",{className:"flex-1 p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:B,className:"text-ink-muted hover:text-ink-primary",children:e.jsx(ye,{size:16})}),e.jsx("button",{type:"button",onClick:q,className:"text-ink-muted hover:text-ink-primary",children:e.jsx(ve,{size:16})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(ee,{year:N,month:y,from:o.from,to:o.to,onPick:j}),e.jsx(ee,{year:y===11?N+1:N,month:y===11?0:y+1,from:o.from,to:o.to,onPick:j})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-card-border pt-3",children:[e.jsx("span",{className:"text-sm text-ink-secondary",children:o.from&&o.to?`${F(o.from)} - ${F(o.to)}`:"Select a range"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{variant:"cancel",size:"sm",onClick:()=>u(!1),children:"Cancel"}),e.jsx(C,{variant:"primary",size:"sm",onClick:g,disabled:!o.from||!o.to,children:"Apply"})]})]})]})]})]})})}function He({label:t,required:r,error:a,options:n,value:s,onChange:l,placeholder:c="Select...",searchable:u=!0,disabled:i,className:d}){const[o,f]=p.useState(!1),[y,M]=p.useState(""),N=p.useRef(null);p.useEffect(()=>{function k(j){N.current&&!N.current.contains(j.target)&&f(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const x=u&&y?n.filter(k=>k.label.toLowerCase().includes(y.toLowerCase())):n,w=n.find(k=>k.value===s);return e.jsx(D,{label:t,required:r,error:a,className:d,children:e.jsxs("div",{ref:N,className:"relative",children:[e.jsxs("button",{type:"button",disabled:i,onClick:()=>f(k=>!k),className:b("flex h-10 w-full items-center justify-between rounded-md border bg-input px-3 text-sm text-left","focus:outline-none focus:ring-2 focus:ring-accent/40 disabled:opacity-50",a?"border-status-offline":"border-card-border",w?"text-ink-primary":"text-ink-muted"),children:[e.jsx("span",{className:"truncate",children:(w==null?void 0:w.label)??c}),e.jsx(_,{size:16,className:b("shrink-0 text-ink-muted transition-transform",o&&"rotate-180")})]}),o&&e.jsxs("div",{className:"absolute z-20 mt-1 w-full overflow-hidden rounded-md border border-card-border bg-card shadow-lg",children:[u&&e.jsxs("div",{className:"flex items-center gap-2 border-b border-card-border px-3 py-2",children:[e.jsx(E,{size:14,className:"text-ink-muted"}),e.jsx("input",{autoFocus:!0,value:y,onChange:k=>M(k.target.value),placeholder:"Search...",className:"w-full bg-transparent text-sm text-ink-primary placeholder:text-ink-muted focus:outline-none"})]}),e.jsxs("ul",{className:"max-h-56 overflow-y-auto py-1",role:"listbox",children:[x.length===0&&e.jsx("li",{className:"px-3 py-2 text-sm text-ink-muted",children:"No options"}),x.map(k=>e.jsx("li",{children:e.jsxs("button",{type:"button",disabled:k.disabled,onClick:()=>{l(k.value),f(!1),M("")},className:b("flex w-full items-center justify-between px-3 py-2 text-left text-sm hover:bg-accent-muted disabled:opacity-40",k.value===s?"text-accent":"text-ink-primary"),children:[k.label,k.value===s&&e.jsx(U,{size:14})]})},k.value))]})]})]})})}function Ve({items:t,onChange:r,createItem:a,renderRow:n,addLabel:s="Add row",minRows:l=0,className:c}){function u(d,o){const f=t.slice();f[d]={...f[d],...o},r(f)}function i(d){r(t.filter((o,f)=>f!==d))}return e.jsxs("div",{className:b("flex flex-col gap-2",c),children:[t.map((d,o)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:n(d,o,f=>u(o,f))}),e.jsx(S,{icon:e.jsx(Le,{size:16}),label:"Remove row",variant:"danger",size:"sm",disabled:t.length<=l,onClick:()=>i(o)})]},o)),e.jsx(C,{variant:"ghost",size:"sm",icon:e.jsx(J,{size:14}),onClick:()=>r([...t,a()]),className:"self-start",children:s})]})}function Ge({open:t,onSearch:r,onClear:a,children:n,className:s}){return t?e.jsxs("div",{className:b("z-20 w-full max-w-md rounded-lg border border-card-border bg-card p-4 shadow-lg",s),children:[e.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:n}),e.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2 border-t border-card-border pt-3",children:[e.jsx(C,{variant:"cancel",size:"sm",onClick:a,children:"Clear filters"}),e.jsx(C,{variant:"primary",size:"sm",onClick:r,children:"Search"})]})]}):null}const te=p.forwardRef(({label:t="Add",className:r,...a},n)=>e.jsx("button",{ref:n,"aria-label":t,title:t,className:b("fixed bottom-6 right-6 z-40 flex h-14 w-14 items-center justify-center rounded-full","bg-accent text-white shadow-lg hover:brightness-110 active:scale-95","transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",r),...a,children:e.jsx(J,{size:24,strokeWidth:2.5})}));te.displayName="FloatingAddButton";function We({open:t,onClose:r,onSubmit:a,title:n,size:s="md",submitLabel:l="Ok",cancelLabel:c="Close",submitting:u,submitDisabled:i,children:d}){return e.jsx(T,{open:t,onClose:r,title:n,size:s,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"cancel",onClick:r,disabled:u,children:c}),e.jsx(C,{variant:"primary",onClick:a,loading:u,disabled:i,children:l})]}),children:e.jsx("form",{onSubmit:o=>{o.preventDefault(),a()},className:"flex flex-col gap-4",children:d})})}const re=p.forwardRef(({label:t,required:r,error:a,hint:n,icon:s,id:l,className:c,...u},i)=>{const d=l??p.useId();return e.jsx(D,{label:t,htmlFor:d,required:r,error:a,hint:n,children:e.jsxs("div",{className:"relative",children:[s&&e.jsx("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-ink-muted",children:s}),e.jsx("input",{ref:i,id:d,className:b("h-10 w-full rounded-md border bg-input px-3 text-sm text-ink-primary placeholder:text-ink-muted","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border",s&&"pl-9",c),"aria-invalid":!!a,...u})]})})});re.displayName="InputField";function Ue({label:t,required:r,error:a,options:n,value:s,onChange:l,placeholder:c="Select...",className:u}){const[i,d]=p.useState(!1),[o,f]=p.useState(""),y=p.useRef(null);p.useEffect(()=>{function x(w){y.current&&!y.current.contains(w.target)&&d(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const M=o?n.filter(x=>x.label.toLowerCase().includes(o.toLowerCase())):n;function N(x){l(s.includes(x)?s.filter(w=>w!==x):[...s,x])}return e.jsx(D,{label:t,required:r,error:a,className:u,children:e.jsxs("div",{ref:y,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>d(x=>!x),className:b("flex min-h-10 w-full flex-wrap items-center gap-1.5 rounded-md border bg-input px-2 py-1.5 text-left","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border"),children:[s.length===0&&e.jsx("span",{className:"px-1 text-sm text-ink-muted",children:c}),s.map(x=>{const w=n.find(k=>k.value===x);return e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-tag px-2 py-0.5 text-xs text-tag border border-tag-border",children:[(w==null?void 0:w.label)??x,e.jsx(P,{size:12,className:"cursor-pointer hover:text-status-offline",onClick:k=>{k.stopPropagation(),N(x)}})]},x)}),e.jsx(_,{size:16,className:b("ml-auto shrink-0 text-ink-muted transition-transform",i&&"rotate-180")})]}),i&&e.jsxs("div",{className:"absolute z-20 mt-1 w-full overflow-hidden rounded-md border border-card-border bg-card shadow-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-card-border px-3 py-2",children:[e.jsx(E,{size:14,className:"text-ink-muted"}),e.jsx("input",{autoFocus:!0,value:o,onChange:x=>f(x.target.value),placeholder:"Search...",className:"w-full bg-transparent text-sm text-ink-primary placeholder:text-ink-muted focus:outline-none"})]}),e.jsxs("ul",{className:"max-h-56 overflow-y-auto py-1",role:"listbox",children:[M.length===0&&e.jsx("li",{className:"px-3 py-2 text-sm text-ink-muted",children:"No options"}),M.map(x=>e.jsx("li",{children:e.jsxs("label",{className:"flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-sm hover:bg-accent-muted",children:[e.jsx("input",{type:"checkbox",checked:s.includes(x.value),onChange:()=>N(x.value),className:"h-3.5 w-3.5 rounded border-card-border accent-[var(--accent-primary)]"}),e.jsx("span",{className:"text-ink-primary",children:x.label})]})},x.value))]})]})]})})}function _e({page:t,pageSize:r,total:a,onPageChange:n,className:s}){const l=Math.max(1,Math.ceil(a/r)),c=a===0?0:(t-1)*r+1,u=Math.min(a,t*r);return e.jsxs("nav",{className:b("flex items-center gap-2 text-sm text-ink-secondary",s),"aria-label":"Pagination",children:[e.jsx("button",{onClick:()=>n(Math.max(1,t-1)),disabled:t===1,"aria-label":"Previous page",className:"flex h-7 w-7 items-center justify-center rounded text-ink-secondary hover:bg-accent-muted disabled:opacity-40",children:e.jsx(Q,{size:16})}),e.jsxs("span",{children:[c,"-",u," of ",a]}),e.jsx("button",{onClick:()=>n(Math.min(l,t+1)),disabled:t>=l,"aria-label":"Next page",className:"flex h-7 w-7 items-center justify-center rounded text-ink-secondary hover:bg-accent-muted disabled:opacity-40",children:e.jsx(Z,{size:16})})]})}function Qe({title:t,actions:r,className:a,children:n,...s}){return e.jsxs("div",{className:b("rounded-lg border border-card-border bg-card",a),...s,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-4 py-3",children:[e.jsx("h3",{className:"font-secondary text-sm font-semibold text-ink-primary",children:t}),r&&e.jsx("div",{className:"flex items-center gap-2",children:r})]}),e.jsx("div",{className:"p-4",children:n})]})}const ae=p.forwardRef(({label:t,required:r,error:a,hint:n,id:s,className:l,...c},u)=>{const[i,d]=p.useState(!1),o=s??p.useId();return e.jsx(D,{label:t,htmlFor:o,required:r,error:a,hint:n,children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:u,id:o,type:i?"text":"password",className:b("h-10 w-full rounded-md border bg-input pl-3 pr-10 text-sm text-ink-primary placeholder:text-ink-muted","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border",l),"aria-invalid":!!a,...c}),e.jsx("button",{type:"button",onClick:()=>d(f=>!f),"aria-label":i?"Hide password":"Show password",className:"absolute right-3 top-1/2 -translate-y-1/2 text-ink-muted hover:text-ink-primary",children:i?e.jsx(Ne,{size:16}):e.jsx(Ce,{size:16})})]})})});ae.displayName="PasswordInput";function Ze(t){let r=0;return t.length>=8&&r++,t.length>=12&&r++,/[A-Z]/.test(t)&&/[a-z]/.test(t)&&r++,/\d/.test(t)&&r++,/[^A-Za-z0-9]/.test(t)&&r++,r<=1?{score:r,label:"Weak",tone:"bg-status-offline"}:r<=3?{score:r,label:"Medium",tone:"bg-status-warn"}:{score:r,label:"Strong",tone:"bg-status-online"}}function Je({password:t,className:r}){const{score:a,label:n,tone:s}=Ze(t),l=Math.min(a/5*100,100);return t?e.jsxs("div",{className:b("mt-2",r),children:[e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-card-border",children:e.jsx("div",{className:b("h-full rounded-full transition-all duration-200",s),style:{width:`${l}%`}})}),e.jsxs("p",{className:"mt-1 text-xs text-ink-secondary",children:["Strength: ",n]})]}):null}const ne=p.forwardRef(({value:t,onChange:r,onFilterClick:a,placeholder:n="Search Data",className:s,...l},c)=>e.jsxs("div",{className:b("flex h-10 w-full items-center gap-2 rounded-md border border-card-border bg-input px-3","focus-within:ring-2 focus-within:ring-accent/40",s),children:[e.jsx(E,{size:16,className:"shrink-0 text-ink-muted"}),e.jsx("input",{ref:c,value:t,onChange:u=>r(u.target.value),placeholder:n,className:"w-full bg-transparent text-sm text-ink-primary placeholder:text-ink-muted focus:outline-none",...l}),t&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>r(""),className:"text-ink-muted hover:text-ink-primary",children:e.jsx(P,{size:14})}),a&&e.jsx("button",{type:"button","aria-label":"Filters",onClick:a,className:"text-ink-muted hover:text-accent",children:e.jsx(X,{size:16})})]}));ne.displayName="SearchBox";function se({open:t,onClose:r,title:a,width:n="480px",children:s,className:l}){return p.useEffect(()=>{if(!t)return;function c(u){u.key==="Escape"&&r()}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[t,r]),t?$.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r,"aria-hidden":!0}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:{width:n},className:b("absolute right-0 top-0 flex h-full max-w-full flex-col border-l border-card-border bg-card shadow-xl",l),children:[a&&e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-5 py-4",children:[e.jsx("h2",{className:"font-secondary text-base font-semibold text-ink-primary",children:a}),e.jsx("button",{onClick:r,"aria-label":"Close",className:"text-ink-muted hover:text-ink-primary",children:e.jsx(P,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:s})]})]}),document.body):null}function Xe({start:t,end:r,className:a,...n}){return e.jsxs("div",{className:b("flex flex-wrap items-center justify-between gap-3 py-2",a),...n,children:[e.jsx("div",{className:"flex flex-1 items-center gap-2",children:t}),e.jsx("div",{className:"flex items-center gap-1.5",children:r})]})}function le({items:t,value:r,onChange:a,className:n}){return e.jsx("div",{role:"tablist",className:b("flex items-center gap-1 border-b border-card-border",n),children:t.map(s=>{const l=s.value===r;return e.jsxs("button",{role:"tab","aria-selected":l,onClick:()=>a(s.value),className:b("flex items-center gap-1.5 border-b-2 px-4 py-2 text-sm font-medium transition-colors",l?"border-accent text-accent":"border-transparent text-ink-secondary hover:text-ink-primary"),children:[s.icon,s.label]},s.value)})})}function Ke({options:t,value:r,onChange:a,className:n}){return e.jsx("div",{className:b("inline-flex overflow-hidden rounded-md border border-card-border",n),role:"tablist",children:t.map((s,l)=>{const c=s.value===r;return e.jsx("button",{type:"button",role:"tab","aria-selected":c,onClick:()=>a(s.value),className:b("h-9 px-4 text-sm font-medium transition-colors",l===0?"border-r border-card-border":"",c?"bg-accent text-white":"bg-input text-ink-secondary hover:bg-accent-muted"),children:s.label},s.value)})})}function Re({logo:t,children:r,className:a}){return e.jsx("div",{className:b("flex min-h-screen items-center justify-center bg-canvas px-4",a),children:e.jsxs("div",{className:"w-full max-w-md",children:[t&&e.jsx("div",{className:"mb-8 flex justify-center",children:t}),e.jsx("div",{className:"rounded-lg border border-card-border bg-card p-8 shadow-lg",children:r})]})})}function et({className:t,children:r,...a}){return e.jsx("footer",{className:b("border-t border-card-border px-6 py-3 text-xs text-ink-muted",t),...a,children:r??`© ${new Date().getFullYear()} SLS — Software License System`})}function tt({title:t,search:r,profileMenu:a,actions:n,className:s}){return e.jsxs("header",{className:b("flex h-16 items-center justify-between gap-4 border-b border-topbar-border bg-chrome px-6",s),children:[e.jsx("h1",{className:"font-secondary text-lg font-semibold text-ink-onchrome truncate",children:t}),e.jsxs("div",{className:"flex flex-1 items-center justify-end gap-4",children:[r&&e.jsx("div",{className:"w-full max-w-sm",children:r}),n,a]})]})}function rt({sidebar:t,header:r,footer:a,children:n,className:s}){return e.jsxs("div",{className:b("flex h-screen w-full overflow-hidden bg-canvas",s),children:[t,e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r,e.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:n}),a]})]})}function at({name:t,role:r,avatarUrl:a,onSignOut:n,actions:s=[],className:l}){const[c,u]=p.useState(!1),i=p.useRef(null);return p.useEffect(()=>{function d(o){i.current&&!i.current.contains(o.target)&&u(!1)}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),e.jsxs("div",{ref:i,className:b("relative",l),children:[e.jsx("button",{onClick:()=>u(d=>!d),className:"flex items-center gap-2","aria-label":"Open profile menu",children:a?e.jsx("img",{src:a,alt:"",className:"h-9 w-9 rounded-full object-cover"}):e.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-accent-muted text-accent",children:e.jsx(je,{size:16})})}),c&&e.jsxs("div",{className:"absolute right-0 z-30 mt-2 w-56 rounded-lg border border-card-border bg-card p-4 shadow-lg",children:[e.jsx("p",{className:"font-secondary text-sm font-semibold text-ink-primary",children:t}),e.jsx("p",{className:"text-xs text-ink-muted",children:r}),s.length>0&&e.jsx("div",{className:"mt-3 flex flex-col gap-1 border-t border-card-border pt-3",children:s.map(d=>e.jsxs("button",{onClick:d.onClick,className:"flex items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-ink-primary hover:bg-accent-muted",children:[d.icon,d.label]},d.label))}),e.jsxs("button",{onClick:n,className:"mt-2 flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-status-offline hover:bg-status-offline-bg",children:[e.jsx(ze,{size:14}),"Sign out"]})]})]})}function nt({items:t,collapsed:r,onCollapsedChange:a,logo:n,className:s}){return e.jsxs("aside",{className:b("flex h-full flex-col border-r border-sidebar-border bg-chrome-deep transition-all duration-200",r?"w-16":"w-56",s),children:[n&&e.jsx("div",{className:"flex h-16 items-center justify-center border-b border-sidebar-border",children:n}),e.jsx("nav",{className:"flex flex-1 flex-col gap-1 p-2",children:t.map(l=>e.jsxs("button",{onClick:l.onClick,title:r?l.label:void 0,className:b("flex items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium transition-colors",l.active?"border-l-2 bg-nav-active-bg text-ink-onchrome":"text-icon-idle hover:bg-nav-active-bg hover:text-icon-active"),style:l.active?{borderColor:"var(--nav-active-border)"}:void 0,children:[e.jsx("span",{className:"shrink-0",children:l.icon}),!r&&e.jsx("span",{className:"truncate",children:l.label})]},l.key))}),a&&e.jsx("button",{onClick:()=>a(!r),className:"flex items-center justify-center border-t border-sidebar-border py-3 text-icon-idle hover:text-icon-active","aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?e.jsx(Z,{size:16}):e.jsx(Q,{size:16})})]})}function st({onOpen:t,className:r}){function a(){if(t)return t();const n=window.open("","_blank");n&&n.document.write("<title>SLS License Agent</title><body style='font-family:sans-serif;padding:40px'><h2>SLS AI License Agent</h2><p>The agent would open here.</p></body>")}return e.jsx("button",{onClick:a,"aria-label":"Open AI license agent",title:"AI License Agent",className:b("fixed bottom-24 right-6 z-40 flex h-14 w-14 items-center justify-center rounded-full","bg-accent-light text-white shadow-lg hover:brightness-110 active:scale-95 transition-all",r),children:e.jsx(ge,{size:22})})}function lt({title:t,loading:r,onReload:a,onExport:n,onFilter:s,children:l,className:c}){return e.jsxs("div",{className:b("flex flex-col rounded-lg border border-card-border bg-card",c),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-4 py-3",children:[e.jsx("h3",{className:"font-secondary text-sm font-semibold text-ink-primary",children:t}),e.jsxs("div",{className:"flex items-center gap-1",children:[s&&e.jsx(S,{icon:e.jsx(X,{size:14}),label:"Filter",size:"sm",onClick:s}),a&&e.jsx(S,{icon:e.jsx(De,{size:14}),label:"Reload",size:"sm",onClick:a}),n&&e.jsx(S,{icon:e.jsx(we,{size:14}),label:"Export",size:"sm",onClick:n})]})]}),e.jsx("div",{className:"p-4",children:r?e.jsx(O,{label:"Loading widget..."}):l})]})}const ct=[{value:"pdf",label:"Invoice PDF"},{value:"excel",label:"Renewal Excel"}];function ot({open:t,onClose:r,customerEmail:a,activeTab:n,onTabChange:s,onSendEmail:l,children:c}){return e.jsx(se,{open:t,onClose:r,title:"Invoice preview",width:"640px",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(le,{items:ct,value:n,onChange:s}),a&&e.jsxs("div",{className:"flex items-center justify-between rounded-md bg-accent-muted px-3 py-2 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-2 text-ink-secondary",children:[e.jsx(Se,{size:14}),a]}),l&&e.jsx(C,{size:"sm",variant:"secondary",onClick:l,children:"Send"})]}),e.jsx("div",{className:"min-h-[60vh]",children:c})]})})}function it({open:t,onClose:r,title:a="Changes",fields:n}){return e.jsx(T,{open:t,onClose:r,title:a,size:"md",children:e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("div",{className:"font-medium text-ink-secondary",children:"Field"}),e.jsx("div",{className:"font-medium text-ink-secondary",children:"Previous"}),e.jsx("div",{className:"font-medium text-ink-secondary",children:"Current"}),n.map(s=>e.jsxs(p.Fragment,{children:[e.jsx("div",{className:"text-ink-primary",children:s.label}),e.jsx("div",{className:"rounded bg-status-offline-bg px-2 py-1 text-status-offline",children:s.previous}),e.jsx("div",{className:"rounded bg-status-online-bg px-2 py-1 text-status-online",children:s.current})]},s.label))]})})}h.AuthLayout=Re,h.Badge=de,h.Button=C,h.Card=H,h.ChangesPreviewModal=it,h.Checkbox=A,h.ColumnFilterDropdown=Te,h.ConfirmDialog=Ee,h.DataTable=Oe,h.DatePicker=Ie,h.DateRangePicker=Ye,h.Dropdown=He,h.DynamicRowList=Ve,h.FilterPanel=Ge,h.FloatingAddButton=te,h.Footer=et,h.FormGroup=D,h.FormModal=We,h.Header=tt,h.IconButton=S,h.InputField=re,h.InvoicePreviewModal=ot,h.LicenseAgentButton=st,h.Loader=O,h.MainLayout=rt,h.Modal=T,h.MultiSelectDropdown=Ue,h.Pagination=_e,h.Panel=Qe,h.PasswordInput=ae,h.PasswordStrengthMeter=Je,h.ProfileMenu=at,h.ReportWidget=lt,h.RowSelectCheckbox=I,h.SearchBox=ne,h.Sidebar=nt,h.SlideOverModal=se,h.TableToolbar=Xe,h.Tabs=le,h.ToggleButtonGroup=Ke,h.ValidationMessage=K,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
|
146
|
+
*/const T=y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),P=g.forwardRef(({label:t,id:r,className:a,checked:n,...s},c)=>{const l=r??g.useId();return e.jsxs("label",{htmlFor:l,className:"inline-flex cursor-pointer items-center gap-2 select-none",children:[e.jsxs("span",{className:"relative inline-flex h-4 w-4 shrink-0 items-center justify-center",children:[e.jsx("input",{ref:c,id:l,type:"checkbox",checked:n,className:"peer sr-only",...s}),e.jsx("span",{className:u("h-4 w-4 rounded border border-card-border bg-input transition-colors","peer-checked:border-accent peer-checked:bg-accent","peer-focus-visible:ring-2 peer-focus-visible:ring-accent/40",a)}),n&&e.jsx(G,{size:12,strokeWidth:3,className:"pointer-events-none absolute text-white"})]}),t&&e.jsx("span",{className:"text-sm text-ink-primary",children:t})]})});P.displayName="Checkbox";const Oe={idle:"text-icon-idle hover:text-icon-active hover:bg-accent-muted",active:"text-icon-active bg-accent-muted",danger:"text-status-offline hover:bg-status-offline-bg"},je={sm:"h-8 w-8",md:"h-10 w-10"},S=g.forwardRef(({icon:t,label:r,variant:a="idle",size:n="md",className:s,...c},l)=>e.jsx("button",{ref:l,"aria-label":r,title:r,className:u("inline-flex items-center justify-center rounded-full transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40","disabled:opacity-40 disabled:cursor-not-allowed",Oe[a],je[n],s),...c,children:t}));S.displayName="IconButton";function Ee({columns:t,visible:r,onChange:a,className:n}){const[s,c]=g.useState(!1),l=g.useRef(null);g.useEffect(()=>{function o(d){l.current&&!l.current.contains(d.target)&&c(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]);function f(o){a(r.includes(o)?r.filter(d=>d!==o):[...r,o])}return e.jsxs("div",{ref:l,className:u("relative",n),children:[e.jsx(S,{icon:e.jsx(ze,{size:16}),label:"Choose columns",onClick:()=>c(o=>!o),variant:s?"active":"idle"}),s&&e.jsx("div",{className:"absolute right-0 z-20 mt-1 w-52 rounded-md border border-card-border bg-card p-2 shadow-lg",children:t.map(o=>e.jsxs("label",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-accent-muted",children:[e.jsx(P,{checked:r.includes(o.key),onChange:()=>f(o.key)}),e.jsx("span",{className:"text-ink-primary",children:o.label})]},o.key))})]})}const Fe={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};function A({open:t,onClose:r,title:a,footer:n,size:s="md",children:c,className:l}){return g.useEffect(()=>{if(!t)return;function f(o){o.key==="Escape"&&r()}return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[t,r]),t?W.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r,"aria-hidden":!0}),e.jsxs("div",{role:"dialog","aria-modal":"true",className:u("relative z-10 flex max-h-[90vh] w-full flex-col rounded-lg border border-card-border bg-card shadow-xl",Fe[s],l),children:[a&&e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-5 py-4",children:[e.jsx("h2",{className:"font-secondary text-base font-semibold text-ink-primary",children:a}),e.jsx("button",{onClick:r,"aria-label":"Close",className:"text-ink-muted hover:text-ink-primary",children:e.jsx(T,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:c}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-card-border px-5 py-4",children:n})]})]}),document.body):null}function Ie({open:t,title:r,message:a,confirmLabel:n="Ok",cancelLabel:s="Close",tone:c="default",onConfirm:l,onClose:f,loading:o}){return e.jsx(A,{open:t,onClose:f,title:r,size:"sm",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"cancel",onClick:f,children:s}),e.jsx(C,{variant:c==="danger"?"danger":"primary",onClick:l,loading:o,children:n})]}),children:e.jsx("p",{className:"text-sm text-ink-secondary",children:a})})}function E({fullPage:t,label:r="Loading...",className:a}){const n=e.jsxs("div",{className:u("flex flex-col items-center justify-center gap-3",a),children:[e.jsx("span",{className:"h-10 w-10 animate-spin rounded-full border-4 border-accent-muted border-t-accent"}),r&&e.jsx("span",{className:"text-sm text-ink-secondary",children:r})]});return t?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-canvas/70 backdrop-blur-sm",children:n}):n}function F({checked:t,indeterminate:r,onChange:a,label:n="Select row"}){const s=g.useRef(null);return g.useEffect(()=>{s.current&&(s.current.indeterminate=!!r)},[r]),e.jsx(P,{ref:s,checked:t,onChange:c=>a(c.target.checked),"aria-label":n})}function qe({columns:t,data:r,rowKey:a,loading:n,emptyMessage:s="No records found.",visibleColumns:c,sortKey:l,sortDirection:f,onSortChange:o,selectable:d,selectedKeys:i=[],onSelectedKeysChange:b,onRowClick:v,className:B}){const N=c?t.filter(p=>c.includes(p.key)):t,x=r.map(a),w=d&&r.length>0&&x.every(p=>i.includes(p)),k=d&&x.some(p=>i.includes(p));function L(p){if(!(!p.sortable||!o)){if(l!==p.key)return o(p.key,"asc");if(f==="asc")return o(p.key,"desc");o(p.key,null)}}function I(){b&&b(w?[]:x)}function q(p){b&&b(i.includes(p)?i.filter(m=>m!==p):[...i,p])}return e.jsx("div",{className:u("overflow-x-auto rounded-lg border border-card-border bg-card",B),children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-card-border bg-canvas",children:[d&&e.jsx("th",{className:"w-10 px-4 py-3",children:e.jsx(F,{checked:!!w,indeterminate:!w&&k,onChange:I,label:"Select all rows"})}),N.map(p=>e.jsx("th",{style:{width:p.width},className:u("px-4 py-3 font-medium text-ink-secondary",p.align==="right"&&"text-right",p.align==="center"&&"text-center"),children:p.sortable?e.jsxs("button",{onClick:()=>L(p),className:"inline-flex items-center gap-1 hover:text-ink-primary",children:[p.header,l===p.key?f==="asc"?e.jsx(ye,{size:12}):f==="desc"?e.jsx(ve,{size:12}):e.jsx(V,{size:12,className:"opacity-40"}):e.jsx(V,{size:12,className:"opacity-40"})]}):p.header},p.key))]})}),e.jsx("tbody",{children:n?e.jsx("tr",{children:e.jsx("td",{colSpan:N.length+(d?1:0),className:"py-10",children:e.jsx(E,{label:"Loading records..."})})}):r.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:N.length+(d?1:0),className:"py-10 text-center text-ink-muted",children:s})}):r.map(p=>{const m=a(p);return e.jsxs("tr",{onClick:()=>v==null?void 0:v(p),className:u("border-b border-card-border last:border-0 hover:bg-accent-muted/60",v&&"cursor-pointer"),children:[d&&e.jsx("td",{className:"px-4 py-3",onClick:M=>M.stopPropagation(),children:e.jsx(F,{checked:i.includes(m),onChange:()=>q(m)})}),N.map(M=>e.jsx("td",{className:u("px-4 py-3 text-ink-primary",M.align==="right"&&"text-right",M.align==="center"&&"text-center"),children:M.render(p)},M.key))]},m)})})]})})}function K({children:t,className:r,...a}){return t?e.jsxs("p",{className:u("mt-1 flex items-center gap-1 text-xs text-status-offline",r),...a,children:[e.jsx(Ce,{size:12,className:"shrink-0"}),t]}):null}function z({label:t,htmlFor:r,required:a,error:n,hint:s,className:c,children:l,...f}){return e.jsxs("div",{className:u("flex flex-col",c),...f,children:[t&&e.jsxs("label",{htmlFor:r,className:"mb-1.5 text-sm font-medium text-ink-primary",children:[t,a&&e.jsx("span",{className:"ml-0.5 text-status-offline",children:"*"})]}),l,s&&!n&&e.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:s}),e.jsx(K,{children:n})]})}function We({label:t,required:r,error:a,value:n,onChange:s,min:c,max:l,disabled:f,className:o}){const d=g.useId();return e.jsx(z,{label:t,htmlFor:d,required:r,error:a,className:o,children:e.jsxs("div",{className:"relative",children:[e.jsx(_,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-ink-muted"}),e.jsx("input",{id:d,type:"date",value:n??"",min:c,max:l,disabled:f,onChange:i=>s(i.target.value),className:u("h-10 w-full rounded-md border bg-input pl-9 pr-3 text-sm text-ink-primary","focus:outline-none focus:ring-2 focus:ring-accent/40 disabled:opacity-50",a?"border-status-offline":"border-card-border")})]})})}const R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],$e=["Su","Mo","Tu","We","Th","Fr","Sa"],He=["This Financial Year","This Month","Last Month","Next Month","This Quarter","This Year","Last Year","Custom Range"];function O(t){return t?`${String(t.getDate()).padStart(2,"0")}-${R[t.getMonth()]}-${t.getFullYear()}`:""}function Ye(t,r=new Date){const a=r.getFullYear(),n=r.getMonth();switch(t){case"This Financial Year":{const s=n>=3?a:a-1;return{from:new Date(s,3,1),to:new Date(s+1,2,31)}}case"This Month":return{from:new Date(a,n,1),to:new Date(a,n+1,0)};case"Last Month":return{from:new Date(a,n-1,1),to:new Date(a,n,0)};case"Next Month":return{from:new Date(a,n+1,1),to:new Date(a,n+2,0)};case"This Quarter":{const s=Math.floor(n/3)*3;return{from:new Date(a,s,1),to:new Date(a,s+3,0)}}case"This Year":return{from:new Date(a,0,1),to:new Date(a,11,31)};case"Last Year":return{from:new Date(a-1,0,1),to:new Date(a-1,11,31)};default:return{from:null,to:null}}}function ee({year:t,month:r,from:a,to:n,onPick:s}){const l=new Date(t,r,1).getDay(),f=new Date(t,r+1,0).getDate(),o=[];for(let b=0;b<l;b++)o.push(null);for(let b=1;b<=f;b++)o.push(b);function d(b){if(!b||!a||!n)return!1;const v=new Date(t,r,b).getTime();return v>=a.getTime()&&v<=n.getTime()}function i(b){if(!b)return!1;const v=new Date(t,r,b).getTime();return a&&v===a.getTime()||n&&v===n.getTime()}return e.jsxs("div",{children:[e.jsxs("p",{className:"mb-2 text-center text-sm font-semibold text-ink-primary",children:[R[r]," ",t]}),e.jsxs("div",{className:"grid grid-cols-7 gap-y-1 text-center text-xs",children:[$e.map(b=>e.jsx("span",{className:"text-ink-muted",children:b},b)),o.map((b,v)=>e.jsx("button",{type:"button",disabled:!b,onClick:()=>b&&s(new Date(t,r,b)),className:u("h-7 w-7 rounded text-ink-primary",!b&&"invisible",b&&d(b)&&"bg-accent-muted",b&&i(b)&&"bg-accent text-white"),children:b},v))]})]})}function Ve({label:t,required:r,error:a,value:n,onChange:s,className:c}){const[l,f]=g.useState(!1),[o,d]=g.useState("Custom Range"),[i,b]=g.useState(n),[v,B]=g.useState(()=>(n.from??new Date).getMonth()),[N,x]=g.useState(()=>(n.from??new Date).getFullYear()),w=g.useRef(null);g.useEffect(()=>{function m(M){w.current&&!w.current.contains(M.target)&&f(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);function k(m){d(m),m!=="Custom Range"&&b(Ye(m))}function L(m){d("Custom Range"),!i.from||i.from&&i.to?b({from:m,to:null}):m.getTime()<i.from.getTime()?b({from:m,to:i.from}):b({...i,to:m})}function I(){v===0?(B(11),x(m=>m-1)):B(m=>m-1)}function q(){v===11?(B(0),x(m=>m+1)):B(m=>m+1)}function p(){s(i),f(!1)}return e.jsx(z,{label:t,required:r,error:a,className:c,children:e.jsxs("div",{ref:w,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>f(m=>!m),className:u("flex h-10 w-full items-center gap-2 rounded-md border bg-input px-3 text-left text-sm","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border"),children:[e.jsx(_,{size:16,className:"shrink-0 text-ink-muted"}),e.jsx("span",{className:n.from?"text-ink-primary":"text-ink-muted",children:n.from&&n.to?`${O(n.from)} - ${O(n.to)}`:"Select date range"})]}),l&&e.jsxs("div",{className:"absolute z-20 mt-1 flex w-[560px] max-w-[90vw] overflow-hidden rounded-md border border-card-border bg-card shadow-xl",children:[e.jsx("div",{className:"w-40 shrink-0 border-r border-card-border py-2",children:He.map(m=>e.jsx("button",{type:"button",onClick:()=>k(m),className:u("block w-full px-3 py-2 text-left text-sm",o===m?"bg-accent text-white":"text-ink-primary hover:bg-accent-muted"),children:m},m))}),e.jsxs("div",{className:"flex-1 p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:I,className:"text-ink-muted hover:text-ink-primary",children:e.jsx(we,{size:16})}),e.jsx("button",{type:"button",onClick:q,className:"text-ink-muted hover:text-ink-primary",children:e.jsx(Ne,{size:16})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(ee,{year:N,month:v,from:i.from,to:i.to,onPick:L}),e.jsx(ee,{year:v===11?N+1:N,month:v===11?0:v+1,from:i.from,to:i.to,onPick:L})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-card-border pt-3",children:[e.jsx("span",{className:"text-sm text-ink-secondary",children:i.from&&i.to?`${O(i.from)} - ${O(i.to)}`:"Select a range"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{variant:"cancel",size:"sm",onClick:()=>f(!1),children:"Cancel"}),e.jsx(C,{variant:"primary",size:"sm",onClick:p,disabled:!i.from||!i.to,children:"Apply"})]})]})]})]})]})})}function _e({label:t,required:r,error:a,options:n,value:s,onChange:c,placeholder:l="Select...",searchable:f=!0,disabled:o,className:d}){const[i,b]=g.useState(!1),[v,B]=g.useState(""),N=g.useRef(null);g.useEffect(()=>{function k(L){N.current&&!N.current.contains(L.target)&&b(!1)}return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const x=f&&v?n.filter(k=>k.label.toLowerCase().includes(v.toLowerCase())):n,w=n.find(k=>k.value===s);return e.jsx(z,{label:t,required:r,error:a,className:d,children:e.jsxs("div",{ref:N,className:"relative",children:[e.jsxs("button",{type:"button",disabled:o,onClick:()=>b(k=>!k),className:u("flex h-10 w-full items-center justify-between rounded-md border bg-input px-3 text-sm text-left","focus:outline-none focus:ring-2 focus:ring-accent/40 disabled:opacity-50",a?"border-status-offline":"border-card-border",w?"text-ink-primary":"text-ink-muted"),children:[e.jsx("span",{className:"truncate",children:(w==null?void 0:w.label)??l}),e.jsx(U,{size:16,className:u("shrink-0 text-ink-muted transition-transform",i&&"rotate-180")})]}),i&&e.jsxs("div",{className:"absolute z-20 mt-1 w-full overflow-hidden rounded-md border border-card-border bg-card shadow-lg",children:[f&&e.jsxs("div",{className:"flex items-center gap-2 border-b border-card-border px-3 py-2",children:[e.jsx(j,{size:14,className:"text-ink-muted"}),e.jsx("input",{autoFocus:!0,value:v,onChange:k=>B(k.target.value),placeholder:"Search...",className:"w-full bg-transparent text-sm text-ink-primary placeholder:text-ink-muted focus:outline-none"})]}),e.jsxs("ul",{className:"max-h-56 overflow-y-auto py-1",role:"listbox",children:[x.length===0&&e.jsx("li",{className:"px-3 py-2 text-sm text-ink-muted",children:"No options"}),x.map(k=>e.jsx("li",{children:e.jsxs("button",{type:"button",disabled:k.disabled,onClick:()=>{c(k.value),b(!1),B("")},className:u("flex w-full items-center justify-between px-3 py-2 text-left text-sm hover:bg-accent-muted disabled:opacity-40",k.value===s?"text-accent":"text-ink-primary"),children:[k.label,k.value===s&&e.jsx(G,{size:14})]})},k.value))]})]})]})})}function Ge({items:t,onChange:r,createItem:a,renderRow:n,addLabel:s="Add row",minRows:c=0,className:l}){function f(d,i){const b=t.slice();b[d]={...b[d],...i},r(b)}function o(d){r(t.filter((i,b)=>b!==d))}return e.jsxs("div",{className:u("flex flex-col gap-2",l),children:[t.map((d,i)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:n(d,i,b=>f(i,b))}),e.jsx(S,{icon:e.jsx(Pe,{size:16}),label:"Remove row",variant:"danger",size:"sm",disabled:t.length<=c,onClick:()=>o(i)})]},i)),e.jsx(C,{variant:"ghost",size:"sm",icon:e.jsx(J,{size:14}),onClick:()=>r([...t,a()]),className:"self-start",children:s})]})}function Ue({open:t,onSearch:r,onClear:a,children:n,className:s}){return t?e.jsxs("div",{className:u("z-20 w-full max-w-md rounded-lg border border-card-border bg-card p-4 shadow-lg",s),children:[e.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:n}),e.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2 border-t border-card-border pt-3",children:[e.jsx(C,{variant:"cancel",size:"sm",onClick:a,children:"Clear filters"}),e.jsx(C,{variant:"primary",size:"sm",onClick:r,children:"Search"})]})]}):null}const te=g.forwardRef(({label:t="Add",className:r,...a},n)=>e.jsx("button",{ref:n,"aria-label":t,title:t,className:u("fixed bottom-6 right-6 z-40 flex h-14 w-14 items-center justify-center rounded-full","bg-accent text-white shadow-lg hover:brightness-110 active:scale-95","transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50",r),...a,children:e.jsx(J,{size:24,strokeWidth:2.5})}));te.displayName="FloatingAddButton";function Qe({open:t,onClose:r,onSubmit:a,title:n,size:s="md",submitLabel:c="Ok",cancelLabel:l="Close",submitting:f,submitDisabled:o,children:d}){return e.jsx(A,{open:t,onClose:r,title:n,size:s,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"cancel",onClick:r,disabled:f,children:l}),e.jsx(C,{variant:"primary",onClick:a,loading:f,disabled:o,children:c})]}),children:e.jsx("form",{onSubmit:i=>{i.preventDefault(),a()},className:"flex flex-col gap-4",children:d})})}const re=g.forwardRef(({label:t,required:r,error:a,hint:n,icon:s,id:c,className:l,...f},o)=>{const d=c??g.useId();return e.jsx(z,{label:t,htmlFor:d,required:r,error:a,hint:n,children:e.jsxs("div",{className:"relative",children:[s&&e.jsx("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-ink-muted",children:s}),e.jsx("input",{ref:o,id:d,className:u("h-10 w-full rounded-md border bg-input px-3 text-sm text-ink-primary placeholder:text-ink-muted","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border",s&&"pl-9",l),"aria-invalid":!!a,...f})]})})});re.displayName="InputField";function Ze({label:t,required:r,error:a,options:n,value:s,onChange:c,placeholder:l="Select...",className:f}){const[o,d]=g.useState(!1),[i,b]=g.useState(""),v=g.useRef(null);g.useEffect(()=>{function x(w){v.current&&!v.current.contains(w.target)&&d(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const B=i?n.filter(x=>x.label.toLowerCase().includes(i.toLowerCase())):n;function N(x){c(s.includes(x)?s.filter(w=>w!==x):[...s,x])}return e.jsx(z,{label:t,required:r,error:a,className:f,children:e.jsxs("div",{ref:v,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>d(x=>!x),className:u("flex min-h-10 w-full flex-wrap items-center gap-1.5 rounded-md border bg-input px-2 py-1.5 text-left","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border"),children:[s.length===0&&e.jsx("span",{className:"px-1 text-sm text-ink-muted",children:l}),s.map(x=>{const w=n.find(k=>k.value===x);return e.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-tag px-2 py-0.5 text-xs text-tag border border-tag-border",children:[(w==null?void 0:w.label)??x,e.jsx(T,{size:12,className:"cursor-pointer hover:text-status-offline",onClick:k=>{k.stopPropagation(),N(x)}})]},x)}),e.jsx(U,{size:16,className:u("ml-auto shrink-0 text-ink-muted transition-transform",o&&"rotate-180")})]}),o&&e.jsxs("div",{className:"absolute z-20 mt-1 w-full overflow-hidden rounded-md border border-card-border bg-card shadow-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-card-border px-3 py-2",children:[e.jsx(j,{size:14,className:"text-ink-muted"}),e.jsx("input",{autoFocus:!0,value:i,onChange:x=>b(x.target.value),placeholder:"Search...",className:"w-full bg-transparent text-sm text-ink-primary placeholder:text-ink-muted focus:outline-none"})]}),e.jsxs("ul",{className:"max-h-56 overflow-y-auto py-1",role:"listbox",children:[B.length===0&&e.jsx("li",{className:"px-3 py-2 text-sm text-ink-muted",children:"No options"}),B.map(x=>e.jsx("li",{children:e.jsxs("label",{className:"flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-sm hover:bg-accent-muted",children:[e.jsx("input",{type:"checkbox",checked:s.includes(x.value),onChange:()=>N(x.value),className:"h-3.5 w-3.5 rounded border-card-border accent-[var(--accent-primary)]"}),e.jsx("span",{className:"text-ink-primary",children:x.label})]})},x.value))]})]})]})})}function Je({page:t,pageSize:r,total:a,onPageChange:n,className:s}){const c=Math.max(1,Math.ceil(a/r)),l=a===0?0:(t-1)*r+1,f=Math.min(a,t*r);return e.jsxs("nav",{className:u("flex items-center gap-2 text-sm text-ink-secondary",s),"aria-label":"Pagination",children:[e.jsx("button",{onClick:()=>n(Math.max(1,t-1)),disabled:t===1,"aria-label":"Previous page",className:"flex h-7 w-7 items-center justify-center rounded text-ink-secondary hover:bg-accent-muted disabled:opacity-40",children:e.jsx(Q,{size:16})}),e.jsxs("span",{children:[l,"-",f," of ",a]}),e.jsx("button",{onClick:()=>n(Math.min(c,t+1)),disabled:t>=c,"aria-label":"Next page",className:"flex h-7 w-7 items-center justify-center rounded text-ink-secondary hover:bg-accent-muted disabled:opacity-40",children:e.jsx(Z,{size:16})})]})}function Xe({title:t,actions:r,className:a,children:n,...s}){return e.jsxs("div",{className:u("rounded-lg border border-card-border bg-card",a),...s,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-4 py-3",children:[e.jsx("h3",{className:"font-secondary text-sm font-semibold text-ink-primary",children:t}),r&&e.jsx("div",{className:"flex items-center gap-2",children:r})]}),e.jsx("div",{className:"p-4",children:n})]})}const ae=g.forwardRef(({label:t,required:r,error:a,hint:n,id:s,className:c,...l},f)=>{const[o,d]=g.useState(!1),i=s??g.useId();return e.jsx(z,{label:t,htmlFor:i,required:r,error:a,hint:n,children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:f,id:i,type:o?"text":"password",className:u("h-10 w-full rounded-md border bg-input pl-3 pr-10 text-sm text-ink-primary placeholder:text-ink-muted","focus:outline-none focus:ring-2 focus:ring-accent/40",a?"border-status-offline":"border-card-border",c),"aria-invalid":!!a,...l}),e.jsx("button",{type:"button",onClick:()=>d(b=>!b),"aria-label":o?"Hide password":"Show password",className:"absolute right-3 top-1/2 -translate-y-1/2 text-ink-muted hover:text-ink-primary",children:o?e.jsx(Me,{size:16}):e.jsx(Se,{size:16})})]})})});ae.displayName="PasswordInput";function Ke(t){let r=0;return t.length>=8&&r++,t.length>=12&&r++,/[A-Z]/.test(t)&&/[a-z]/.test(t)&&r++,/\d/.test(t)&&r++,/[^A-Za-z0-9]/.test(t)&&r++,r<=1?{score:r,label:"Weak",tone:"bg-status-offline"}:r<=3?{score:r,label:"Medium",tone:"bg-status-warn"}:{score:r,label:"Strong",tone:"bg-status-online"}}function Re({password:t,className:r}){const{score:a,label:n,tone:s}=Ke(t),c=Math.min(a/5*100,100);return t?e.jsxs("div",{className:u("mt-2",r),children:[e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-card-border",children:e.jsx("div",{className:u("h-full rounded-full transition-all duration-200",s),style:{width:`${c}%`}})}),e.jsxs("p",{className:"mt-1 text-xs text-ink-secondary",children:["Strength: ",n]})]}):null}const ne=g.forwardRef(({value:t,onChange:r,onFilterClick:a,placeholder:n="Search Data",className:s,...c},l)=>e.jsxs("div",{className:u("flex h-10 w-full items-center gap-2 rounded-md border border-card-border bg-input px-3","focus-within:ring-2 focus-within:ring-accent/40",s),children:[e.jsx(j,{size:16,className:"shrink-0 text-ink-muted"}),e.jsx("input",{ref:l,value:t,onChange:f=>r(f.target.value),placeholder:n,className:"w-full bg-transparent text-sm text-ink-primary placeholder:text-ink-muted focus:outline-none",...c}),t&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>r(""),className:"text-ink-muted hover:text-ink-primary",children:e.jsx(T,{size:14})}),a&&e.jsx("button",{type:"button","aria-label":"Filters",onClick:a,className:"text-ink-muted hover:text-accent",children:e.jsx(X,{size:16})})]}));ne.displayName="SearchBox";function se({open:t,onClose:r,title:a,width:n="480px",children:s,className:c}){return g.useEffect(()=>{if(!t)return;function l(f){f.key==="Escape"&&r()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,r]),t?W.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:r,"aria-hidden":!0}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:{width:n},className:u("absolute right-0 top-0 flex h-full max-w-full flex-col border-l border-card-border bg-card shadow-xl",c),children:[a&&e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-5 py-4",children:[e.jsx("h2",{className:"font-secondary text-base font-semibold text-ink-primary",children:a}),e.jsx("button",{onClick:r,"aria-label":"Close",className:"text-ink-muted hover:text-ink-primary",children:e.jsx(T,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:s})]})]}),document.body):null}function et({start:t,end:r,className:a,...n}){return e.jsxs("div",{className:u("flex flex-wrap items-center justify-between gap-3 py-2",a),...n,children:[e.jsx("div",{className:"flex flex-1 items-center gap-2",children:t}),e.jsx("div",{className:"flex items-center gap-1.5",children:r})]})}function ce({items:t,value:r,onChange:a,className:n}){return e.jsx("div",{role:"tablist",className:u("flex items-center gap-1 border-b border-card-border",n),children:t.map(s=>{const c=s.value===r;return e.jsxs("button",{role:"tab","aria-selected":c,onClick:()=>a(s.value),className:u("flex items-center gap-1.5 border-b-2 px-4 py-2 text-sm font-medium transition-colors",c?"border-accent text-accent":"border-transparent text-ink-secondary hover:text-ink-primary"),children:[s.icon,s.label]},s.value)})})}function tt({options:t,value:r,onChange:a,className:n}){return e.jsx("div",{className:u("inline-flex overflow-hidden rounded-md border border-card-border",n),role:"tablist",children:t.map((s,c)=>{const l=s.value===r;return e.jsx("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>a(s.value),className:u("h-9 px-4 text-sm font-medium transition-colors",c===0?"border-r border-card-border":"",l?"bg-accent text-white":"bg-input text-ink-secondary hover:bg-accent-muted"),children:s.label},s.value)})})}function rt({logo:t,children:r,className:a}){return e.jsx("div",{className:u("flex min-h-screen items-center justify-center bg-canvas px-4",a),children:e.jsxs("div",{className:"w-full max-w-md",children:[t&&e.jsx("div",{className:"mb-8 flex justify-center",children:t}),e.jsx("div",{className:"rounded-lg border border-card-border bg-card p-8 shadow-lg",children:r})]})})}function at({className:t,children:r,...a}){return e.jsx("footer",{className:u("border-t border-card-border px-6 py-3 text-xs text-ink-muted",t),...a,children:r??`© ${new Date().getFullYear()} SLS — Software License System`})}function nt({title:t,search:r,profileMenu:a,actions:n,className:s}){return e.jsxs("header",{className:u("flex h-16 items-center justify-between gap-4 border-b border-topbar-border bg-chrome px-6",s),children:[e.jsx("h1",{className:"font-secondary text-lg font-semibold text-ink-onchrome truncate",children:t}),e.jsxs("div",{className:"flex flex-1 items-center justify-end gap-4",children:[r&&e.jsx("div",{className:"w-full max-w-sm",children:r}),n,a]})]})}function st({sidebar:t,header:r,footer:a,children:n,className:s}){return e.jsxs("div",{className:u("flex h-screen w-full overflow-hidden bg-canvas",s),children:[t,e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r,e.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:n}),a]})]})}function ct({name:t,role:r,avatarUrl:a,onSignOut:n,actions:s=[],className:c}){const[l,f]=g.useState(!1),o=g.useRef(null);return g.useEffect(()=>{function d(i){o.current&&!o.current.contains(i.target)&&f(!1)}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),e.jsxs("div",{ref:o,className:u("relative",c),children:[e.jsx("button",{onClick:()=>f(d=>!d),className:"flex items-center gap-2","aria-label":"Open profile menu",children:a?e.jsx("img",{src:a,alt:"",className:"h-9 w-9 rounded-full object-cover"}):e.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-accent-muted text-accent",children:e.jsx(Ae,{size:16})})}),l&&e.jsxs("div",{className:"absolute right-0 z-30 mt-2 w-56 rounded-lg border border-card-border bg-card p-4 shadow-lg",children:[e.jsx("p",{className:"font-secondary text-sm font-semibold text-ink-primary",children:t}),e.jsx("p",{className:"text-xs text-ink-muted",children:r}),s.length>0&&e.jsx("div",{className:"mt-3 flex flex-col gap-1 border-t border-card-border pt-3",children:s.map(d=>e.jsxs("button",{onClick:d.onClick,className:"flex items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-ink-primary hover:bg-accent-muted",children:[d.icon,d.label]},d.label))}),e.jsxs("button",{onClick:n,className:"mt-2 flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm text-status-offline hover:bg-status-offline-bg",children:[e.jsx(De,{size:14}),"Sign out"]})]})]})}function lt({items:t,collapsed:r,onCollapsedChange:a,logo:n,className:s}){return e.jsxs("aside",{className:u("flex h-full flex-col border-r border-sidebar-border bg-chrome-deep transition-all duration-200",r?"w-16":"w-56",s),children:[n&&e.jsx("div",{className:"flex h-16 items-center justify-center border-b border-sidebar-border",children:n}),e.jsx("nav",{className:"flex flex-1 flex-col gap-1 p-2",children:t.map(c=>e.jsxs("button",{onClick:c.onClick,title:r?c.label:void 0,className:u("flex items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium transition-colors",c.active?"border-l-2 bg-nav-active-bg text-ink-onchrome":"text-icon-idle hover:bg-nav-active-bg hover:text-icon-active"),style:c.active?{borderColor:"var(--nav-active-border)"}:void 0,children:[e.jsx("span",{className:"shrink-0",children:c.icon}),!r&&e.jsx("span",{className:"truncate",children:c.label})]},c.key))}),a&&e.jsx("button",{onClick:()=>a(!r),className:"flex items-center justify-center border-t border-sidebar-border py-3 text-icon-idle hover:text-icon-active","aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?e.jsx(Z,{size:16}):e.jsx(Q,{size:16})})]})}function ot({onOpen:t,className:r}){function a(){if(t)return t();const n=window.open("","_blank");n&&n.document.write("<title>SLS License Agent</title><body style='font-family:sans-serif;padding:40px'><h2>SLS AI License Agent</h2><p>The agent would open here.</p></body>")}return e.jsx("button",{onClick:a,"aria-label":"Open AI license agent",title:"AI License Agent",className:u("fixed bottom-24 right-6 z-40 flex h-14 w-14 items-center justify-center rounded-full","bg-accent-light text-white shadow-lg hover:brightness-110 active:scale-95 transition-all",r),children:e.jsx(ke,{size:22})})}function dt({title:t,loading:r,onReload:a,onExport:n,onFilter:s,children:c,className:l}){return e.jsxs("div",{className:u("flex flex-col rounded-lg border border-card-border bg-card",l),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-card-border px-4 py-3",children:[e.jsx("h3",{className:"font-secondary text-sm font-semibold text-ink-primary",children:t}),e.jsxs("div",{className:"flex items-center gap-1",children:[s&&e.jsx(S,{icon:e.jsx(X,{size:14}),label:"Filter",size:"sm",onClick:s}),a&&e.jsx(S,{icon:e.jsx(Te,{size:14}),label:"Reload",size:"sm",onClick:a}),n&&e.jsx(S,{icon:e.jsx(Be,{size:14}),label:"Export",size:"sm",onClick:n})]})]}),e.jsx("div",{className:"p-4",children:r?e.jsx(E,{label:"Loading widget..."}):c})]})}const it=[{value:"pdf",label:"Invoice PDF"},{value:"excel",label:"Renewal Excel"}];function ft({open:t,onClose:r,customerEmail:a,activeTab:n,onTabChange:s,onSendEmail:c,children:l}){return e.jsx(se,{open:t,onClose:r,title:"Invoice preview",width:"640px",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ce,{items:it,value:n,onChange:s}),a&&e.jsxs("div",{className:"flex items-center justify-between rounded-md bg-accent-muted px-3 py-2 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-2 text-ink-secondary",children:[e.jsx(Le,{size:14}),a]}),c&&e.jsx(C,{size:"sm",variant:"secondary",onClick:c,children:"Send"})]}),e.jsx("div",{className:"min-h-[60vh]",children:l})]})})}function ht({open:t,onClose:r,title:a="Changes",fields:n}){return e.jsx(A,{open:t,onClose:r,title:a,size:"md",children:e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("div",{className:"font-medium text-ink-secondary",children:"Field"}),e.jsx("div",{className:"font-medium text-ink-secondary",children:"Previous"}),e.jsx("div",{className:"font-medium text-ink-secondary",children:"Current"}),n.map(s=>e.jsxs(g.Fragment,{children:[e.jsx("div",{className:"text-ink-primary",children:s.label}),e.jsx("div",{className:"rounded bg-status-offline-bg px-2 py-1 text-status-offline",children:s.previous}),e.jsx("div",{className:"rounded bg-status-online-bg px-2 py-1 text-status-online",children:s.current})]},s.label))]})})}const le={chromeBg:"--chrome-bg",chromeDeep:"--chrome-deep",canvasBg:"--canvas-bg",cardBg:"--card-bg",cardBorder:"--card-border",accentPrimary:"--accent-primary",accentLight:"--accent-light",accentMutedBg:"--accent-muted-bg",accentBorder:"--accent-border",textPrimary:"--text-primary",textSecondary:"--text-secondary",textMuted:"--text-muted",textOnChrome:"--text-on-chrome",iconIdle:"--icon-idle",iconActive:"--icon-active",statusOnline:"--status-online",statusOnlineBg:"--status-online-bg",statusWarn:"--status-warn",statusWarnBg:"--status-warn-bg",statusOffline:"--status-offline",statusOfflineBg:"--status-offline-bg",liveBg:"--live-bg",liveText:"--live-text",sidebarBorder:"--sidebar-border",topbarBorder:"--topbar-border",navActiveBg:"--nav-active-bg",navActiveBorder:"--nav-active-border",tagBg:"--tag-bg",tagText:"--tag-text",tagBorder:"--tag-border",inputBg:"--input-bg"},oe={"slate-navy":{label:"Theme 1 — Slate Navy",chromeBg:"#0d1b2e",chromeDeep:"#0a1626",canvasBg:"#f4f6f9",cardBg:"#ffffff",cardBorder:"#e2e8f0",accentPrimary:"#1d4ed8",accentLight:"#60a5fa",accentMutedBg:"#eff6ff",accentBorder:"#bfdbfe",textPrimary:"#0d1b2e",textSecondary:"#718096",textMuted:"#a0aec0",textOnChrome:"#e8edf5",iconIdle:"#4b7bab",iconActive:"#60a5fa",statusOnline:"#1a9b5a",statusOnlineBg:"#f0fdf4",statusWarn:"#e07b00",statusWarnBg:"#fffbeb",statusOffline:"#c53030",statusOfflineBg:"#fff5f5",liveBg:"#eff6ff",liveText:"#1d4ed8",barColors:["#1d4ed8","#3b82f6","#60a5fa","#93c5fd","#bfdbfe","#dbeafe","#eff6ff"],sidebarBorder:"transparent",topbarBorder:"transparent",navActiveBg:"rgba(29,78,216,0.08)",navActiveBorder:"#1d4ed8",tagBg:"#eff6ff",tagText:"#1d4ed8",tagBorder:"#bfdbfe",inputBg:"#f4f6f9"},"arctic-white":{label:"Theme 2 — Arctic White",chromeBg:"#ffffff",chromeDeep:"#f8fafc",canvasBg:"#f1f5f9",cardBg:"#ffffff",cardBorder:"#e2e8f0",accentPrimary:"#2563eb",accentLight:"#3b82f6",accentMutedBg:"#eff6ff",accentBorder:"#bfdbfe",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",textOnChrome:"#0f172a",iconIdle:"#94a3b8",iconActive:"#2563eb",statusOnline:"#15803d",statusOnlineBg:"#f0fdf4",statusWarn:"#b45309",statusWarnBg:"#fffbeb",statusOffline:"#b91c1c",statusOfflineBg:"#fef2f2",liveBg:"#f0fdf4",liveText:"#15803d",barColors:["#0ea5e9","#38bdf8","#7dd3fc","#bae6fd","#e0f2fe","#f0f9ff","#f8fafc"],sidebarBorder:"#e2e8f0",topbarBorder:"#e5e7eb",navActiveBg:"#eff6ff",navActiveBorder:"#2563eb",tagBg:"#eff6ff",tagText:"#2563eb",tagBorder:"#bfdbfe",inputBg:"#f8fafc"},"carbon-pro":{label:"Theme 3 — Carbon Pro",chromeBg:"#161b22",chromeDeep:"#0d1117",canvasBg:"#1c2128",cardBg:"#21262d",cardBorder:"#30363d",accentPrimary:"#58a6ff",accentLight:"#79c0ff",accentMutedBg:"#0d2a1f",accentBorder:"#30363d",textPrimary:"#e6edf3",textSecondary:"#c9d1d9",textMuted:"#8b949e",textOnChrome:"#e6edf3",iconIdle:"#484f58",iconActive:"#58a6ff",statusOnline:"#34d399",statusOnlineBg:"#0d2a1f",statusWarn:"#fbbf24",statusWarnBg:"#1f1a00",statusOffline:"#f87171",statusOfflineBg:"#1f0a0a",liveBg:"#0d2a1f",liveText:"#34d399",barColors:["#58a6ff","#388bfd","#1f6feb","#0d419d","#0a2d6e","#071e4a","#040f2b"],sidebarBorder:"#21262d",topbarBorder:"#30363d",navActiveBg:"rgba(88,166,255,0.08)",navActiveBorder:"#58a6ff",tagBg:"#21262d",tagText:"#58a6ff",tagBorder:"#30363d",inputBg:"#21262d"},"narnix-edge":{label:"Theme 4 — Narnix Edge",chromeBg:"#061828",chromeDeep:"#040f1a",canvasBg:"#0b1e30",cardBg:"#112035",cardBorder:"#1e3a55",accentPrimary:"#00c9a7",accentLight:"#00ddb8",accentMutedBg:"#0a2240",accentBorder:"#1e3a55",textPrimary:"#daeaf8",textSecondary:"#a8c4d9",textMuted:"#4a7fa5",textOnChrome:"#daeaf8",iconIdle:"#2e5470",iconActive:"#00c9a7",statusOnline:"#00c9a7",statusOnlineBg:"#072219",statusWarn:"#f5a623",statusWarnBg:"#1e1200",statusOffline:"#e05252",statusOfflineBg:"#1a0808",liveBg:"#072219",liveText:"#00c9a7",barColors:["#00ddb8","#00c9a7","#00b898","#00a88a","#018870","#016a55","#015a4a"],sidebarBorder:"#0e2236",topbarBorder:"#0e2236",navActiveBg:"rgba(0,201,167,0.08)",navActiveBorder:"#00c9a7",tagBg:"#0a2240",tagText:"#4a9ecf",tagBorder:"#1e3a55",inputBg:"#0b1e30"}},bt="narnix-edge",de=g.createContext(null);function ut(t,r){const a=oe[r];Object.keys(le).forEach(n=>{t.style.setProperty(le[n],a[n])}),a.barColors.forEach((n,s)=>{t.style.setProperty(`--bar-color-${s}`,n)}),t.dataset.theme=r}function gt({theme:t,onThemeChange:r,children:a}){const[n,s]=g.useState(t??bt),c=t??n,l=g.useRef(null);g.useEffect(()=>{l.current&&ut(l.current,c)},[c]);const f=g.useCallback(d=>{s(d),r==null||r(d)},[r]),o=g.useMemo(()=>({theme:c,setTheme:f,themes:oe}),[c,f]);return e.jsx(de.Provider,{value:o,children:e.jsx("div",{ref:l,"data-sls-theme-root":!0,children:a})})}function xt(){const t=g.useContext(de);if(!t)throw new Error("useTheme must be used inside <ThemeProvider>");return t}function mt({className:t}){const{theme:r,setTheme:a,themes:n}=xt();return e.jsx("select",{value:r,onChange:s=>a(s.target.value),className:u("rounded-md border border-card-border bg-input px-3 py-1.5 text-sm text-ink-primary","focus:outline-none focus:ring-2 focus:ring-accent/40",t),children:Object.keys(n).map(s=>e.jsx("option",{value:s,children:n[s].label},s))})}h.AuthLayout=rt,h.Badge=be,h.Button=C,h.Card=H,h.ChangesPreviewModal=ht,h.Checkbox=P,h.ColumnFilterDropdown=Ee,h.ConfirmDialog=Ie,h.DataTable=qe,h.DatePicker=We,h.DateRangePicker=Ve,h.Dropdown=_e,h.DynamicRowList=Ge,h.FilterPanel=Ue,h.FloatingAddButton=te,h.Footer=at,h.FormGroup=z,h.FormModal=Qe,h.Header=nt,h.IconButton=S,h.InputField=re,h.InvoicePreviewModal=ft,h.LicenseAgentButton=ot,h.Loader=E,h.MainLayout=st,h.Modal=A,h.MultiSelectDropdown=Ze,h.Pagination=Je,h.Panel=Xe,h.PasswordInput=ae,h.PasswordStrengthMeter=Re,h.ProfileMenu=ct,h.ReportWidget=dt,h.RowSelectCheckbox=F,h.SearchBox=ne,h.Sidebar=lt,h.SlideOverModal=se,h.TableToolbar=et,h.Tabs=ce,h.ThemeProvider=gt,h.ThemeSwitcher=mt,h.ToggleButtonGroup=tt,h.ValidationMessage=K,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|