@pk-design/react-tailwind 1.4.3 → 1.5.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.
@@ -1,15 +1,15 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { forwardRef, useMemo, useId, useRef, useState, useEffect, Fragment as Fragment$1, useCallback, useImperativeHandle, createContext, useContext } from 'react';
3
+ import React__default, { useId, useMemo, useState, forwardRef, Children, isValidElement, cloneElement, useRef, useEffect, Fragment as Fragment$1, useCallback, useImperativeHandle, createContext, useContext } from 'react';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import { Dialog, DialogBackdrop, DialogPanel, DialogTitle, Menu, MenuButton, MenuItems, MenuItem, RadioGroup as RadioGroup$1, Radio as Radio$1, Combobox, ComboboxInput, ComboboxButton, ComboboxOptions, ComboboxOption, TabGroup, TabList, Tab, TabPanels, TabPanel, Transition } from '@headlessui/react';
6
6
  import { FixedSizeList } from 'react-window';
7
7
 
8
8
  const buildClassName = (...classes) => twMerge(classes.filter(Boolean));
9
9
 
10
- var _path$i, _path2;
10
+ var _path$i;
11
11
  function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
12
- var SvgBadgeCheck = function SvgBadgeCheck(props) {
12
+ var SvgChevronDown = function SvgChevronDown(props) {
13
13
  return /*#__PURE__*/React.createElement("svg", _extends$i({
14
14
  xmlns: "http://www.w3.org/2000/svg",
15
15
  width: 24,
@@ -19,19 +19,90 @@ var SvgBadgeCheck = function SvgBadgeCheck(props) {
19
19
  strokeLinecap: "round",
20
20
  strokeLinejoin: "round",
21
21
  strokeWidth: 2,
22
- className: "lucide lucide-badge-check-icon lucide-badge-check",
22
+ className: "lucide lucide-chevron-down-icon lucide-chevron-down",
23
23
  viewBox: "0 0 24 24"
24
24
  }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
25
+ d: "m6 9 6 6 6-6"
26
+ })));
27
+ };
28
+
29
+ const CONTAINER_CLASS = {
30
+ bordered: 'rounded-lg border border-gray-200 dark:border-white/10 divide-y divide-gray-200 dark:divide-white/10 bg-white dark:bg-gray-800 overflow-hidden',
31
+ separated: 'space-y-2',
32
+ plain: 'divide-y divide-gray-200 dark:divide-white/10',
33
+ };
34
+ const ITEM_CLASS = {
35
+ bordered: '',
36
+ separated: 'rounded-lg border border-gray-200 dark:border-white/10 bg-white dark:bg-gray-800 overflow-hidden',
37
+ plain: '',
38
+ };
39
+ const HEADER_CLASS = 'flex w-full items-center justify-between gap-2 py-3 px-4 text-left text-sm font-medium ' +
40
+ 'text-gray-900 dark:text-white hover:bg-gray-50 dark:hover:bg-gray-700/50 ' +
41
+ 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--ui-focus-ring)] ' +
42
+ 'disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none ' +
43
+ 'transition-colors duration-150 cursor-pointer';
44
+ const Accordion = ({ items, type = 'single', variant = 'bordered', collapsible = true, defaultOpenIds, openIds: controlledOpenIds, onChange, expandIcon, className = '', titleClass = '', panelClass = '', }) => {
45
+ const baseId = useId();
46
+ const resolvedItems = useMemo(() => items.map((item, index) => { var _a; return ({ ...item, id: (_a = item.id) !== null && _a !== void 0 ? _a : index }); }), [items]);
47
+ const [uncontrolledOpenIds, setUncontrolledOpenIds] = useState(defaultOpenIds !== null && defaultOpenIds !== void 0 ? defaultOpenIds : []);
48
+ const isControlled = controlledOpenIds !== undefined;
49
+ const openIds = isControlled ? controlledOpenIds : uncontrolledOpenIds;
50
+ const toggle = (id) => {
51
+ const isOpen = openIds.includes(id);
52
+ const next = type === 'single'
53
+ ? isOpen
54
+ ? collapsible
55
+ ? []
56
+ : openIds
57
+ : [id]
58
+ : isOpen
59
+ ? openIds.filter((openId) => openId !== id)
60
+ : [...openIds, id];
61
+ if (next === openIds)
62
+ return;
63
+ if (!isControlled)
64
+ setUncontrolledOpenIds(next);
65
+ onChange === null || onChange === void 0 ? void 0 : onChange(next);
66
+ };
67
+ const renderIndicator = (isOpen) => {
68
+ if (typeof expandIcon === 'function')
69
+ return expandIcon(isOpen);
70
+ return (jsx("span", { className: buildClassName('inline-flex shrink-0 transition-transform duration-200', isOpen && 'rotate-180'), children: expandIcon !== null && expandIcon !== void 0 ? expandIcon : jsx(SvgChevronDown, { className: "size-4 stroke-gray-500 dark:stroke-gray-400" }) }));
71
+ };
72
+ return (jsx("div", { className: buildClassName(CONTAINER_CLASS[variant], className), children: resolvedItems.map((item) => {
73
+ const isOpen = openIds.includes(item.id);
74
+ const headerId = `${baseId}-${item.id}-header`;
75
+ const panelId = `${baseId}-${item.id}-panel`;
76
+ return (jsxs("div", { className: ITEM_CLASS[variant], children: [jsx("h3", { className: "m-0", children: jsxs("button", { type: "button", id: headerId, "aria-expanded": isOpen, "aria-controls": panelId, disabled: item.disabled, onClick: () => toggle(item.id), className: buildClassName(HEADER_CLASS, titleClass, item.titleClass), children: [jsxs("span", { className: "flex items-center gap-2", children: [item.icon && jsx("span", { className: "inline-flex shrink-0", children: item.icon }), item.title] }), renderIndicator(isOpen)] }) }), jsx("div", { id: panelId, role: "region", "aria-labelledby": headerId, className: buildClassName('grid transition-[grid-template-rows] duration-200 ease-in-out', isOpen ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'), children: jsx("div", { className: "overflow-hidden", children: jsx("div", { className: buildClassName('px-4 pt-2 pb-4 text-sm text-gray-600 dark:text-gray-300', panelClass, item.panelClass), children: item.content }) }) })] }, item.id));
77
+ }) }));
78
+ };
79
+ Accordion.displayName = 'Accordion';
80
+
81
+ var _path$h, _path2;
82
+ function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
83
+ var SvgBadgeCheck = function SvgBadgeCheck(props) {
84
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
85
+ xmlns: "http://www.w3.org/2000/svg",
86
+ width: 24,
87
+ height: 24,
88
+ fill: "none",
89
+ stroke: "currentColor",
90
+ strokeLinecap: "round",
91
+ strokeLinejoin: "round",
92
+ strokeWidth: 2,
93
+ className: "lucide lucide-badge-check-icon lucide-badge-check",
94
+ viewBox: "0 0 24 24"
95
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
25
96
  d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76"
26
97
  })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
27
98
  d: "m9 12 2 2 4-4"
28
99
  })));
29
100
  };
30
101
 
31
- var _circle$4, _path$h;
32
- function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
102
+ var _circle$4, _path$g;
103
+ function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
33
104
  var SvgCircleX = function SvgCircleX(props) {
34
- return /*#__PURE__*/React.createElement("svg", _extends$h({
105
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
35
106
  xmlns: "http://www.w3.org/2000/svg",
36
107
  width: 24,
37
108
  height: 24,
@@ -46,15 +117,15 @@ var SvgCircleX = function SvgCircleX(props) {
46
117
  cx: 12,
47
118
  cy: 12,
48
119
  r: 10
49
- })), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
120
+ })), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
50
121
  d: "m15 9-6 6M9 9l6 6"
51
122
  })));
52
123
  };
53
124
 
54
- var _circle$3, _path$g;
55
- function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
125
+ var _circle$3, _path$f;
126
+ function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
56
127
  var SvgCircleAlert = function SvgCircleAlert(props) {
57
- return /*#__PURE__*/React.createElement("svg", _extends$g({
128
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
58
129
  xmlns: "http://www.w3.org/2000/svg",
59
130
  width: 24,
60
131
  height: 24,
@@ -69,15 +140,15 @@ var SvgCircleAlert = function SvgCircleAlert(props) {
69
140
  cx: 12,
70
141
  cy: 12,
71
142
  r: 10
72
- })), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
143
+ })), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
73
144
  d: "M12 8v4M12 16h.01"
74
145
  })));
75
146
  };
76
147
 
77
- var _circle$2, _path$f;
78
- function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
148
+ var _circle$2, _path$e;
149
+ function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
79
150
  var SvgInfo = function SvgInfo(props) {
80
- return /*#__PURE__*/React.createElement("svg", _extends$f({
151
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
81
152
  xmlns: "http://www.w3.org/2000/svg",
82
153
  width: 24,
83
154
  height: 24,
@@ -92,15 +163,15 @@ var SvgInfo = function SvgInfo(props) {
92
163
  cx: 12,
93
164
  cy: 12,
94
165
  r: 10
95
- })), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
166
+ })), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
96
167
  d: "M12 16v-4M12 8h.01"
97
168
  })));
98
169
  };
99
170
 
100
- var _path$e;
101
- function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
171
+ var _path$d;
172
+ function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
102
173
  var SvgX = function SvgX(props) {
103
- return /*#__PURE__*/React.createElement("svg", _extends$e({
174
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
104
175
  xmlns: "http://www.w3.org/2000/svg",
105
176
  width: 24,
106
177
  height: 24,
@@ -111,7 +182,7 @@ var SvgX = function SvgX(props) {
111
182
  strokeWidth: 2,
112
183
  className: "lucide lucide-x-icon lucide-x",
113
184
  viewBox: "0 0 24 24"
114
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
185
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
115
186
  d: "M18 6 6 18M6 6l12 12"
116
187
  })));
117
188
  };
@@ -122,8 +193,8 @@ const loaderSizeMap = {
122
193
  md: 'size-8',
123
194
  lg: 'size-10',
124
195
  };
125
- const Loader = ({ className = 'text-blue-600 dark:text-white', size = 'md', ...props }) => {
126
- return (jsx("svg", { className: buildClassName(loaderSizeMap[size], className, 'spinner'), viewBox: "0 0 50 50", ...props, children: jsx("circle", { className: "path", cx: "25", cy: "25", r: "20", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeWidth: "5" }) }));
196
+ const Loader = ({ className = '', size = 'md', ...props }) => {
197
+ return (jsx("svg", { className: buildClassName('text-blue-600 dark:text-white', loaderSizeMap[size], className, 'spinner'), viewBox: "0 0 50 50", ...props, children: jsx("circle", { className: "path", cx: "25", cy: "25", r: "20", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeWidth: "5" }) }));
127
198
  };
128
199
 
129
200
  const TextContent = forwardRef((props, ref) => {
@@ -131,7 +202,7 @@ const TextContent = forwardRef((props, ref) => {
131
202
  return React__default.createElement('span', {
132
203
  ...rest,
133
204
  ref,
134
- className: buildClassName('text-gray-900 dark:text-gray-100', xsmall && 'text-xs/5', small && 'text-sm/6', strong && 'font-semibold', muted && 'text-gray-500 dark:text-gray-400', error && 'text-red-500 dark:text-red-400', className),
205
+ className: buildClassName('text-[var(--ui-text)]', xsmall && 'text-xs/5', small && 'text-sm/6', strong && 'font-semibold', muted && 'text-[var(--ui-text-muted)]', error && 'text-[var(--ui-text-danger)]', className),
135
206
  });
136
207
  });
137
208
  TextContent.displayName = 'TextContent';
@@ -156,6 +227,23 @@ const THEMED_BTN_CLASS = {
156
227
  plain: 'text-gray-700 hover:bg-black/5 dark:text-gray-200 dark:hover:bg-gray-700 focus:outline-[var(--ui-focus-ring)] disabled:text-gray-400',
157
228
  },
158
229
  };
230
+ const LOADER_TEXT_CLASS = {
231
+ primary: {
232
+ default: 'text-white',
233
+ outlined: 'text-[var(--ui-primary-text)]',
234
+ plain: 'text-[var(--ui-primary-text)]',
235
+ },
236
+ danger: {
237
+ default: 'text-white',
238
+ outlined: 'text-[var(--ui-danger-text)]',
239
+ plain: 'text-[var(--ui-danger-text)]',
240
+ },
241
+ secondary: {
242
+ default: 'text-gray-700 dark:text-white',
243
+ outlined: 'text-gray-700 dark:text-gray-200',
244
+ plain: 'text-gray-700 dark:text-gray-200',
245
+ },
246
+ };
159
247
  /**
160
248
  * Generate size classes.
161
249
  */
@@ -205,7 +293,7 @@ const Button = forwardRef(({ as, type, ...props }, ref) => {
205
293
  if (loading && iconOnly) {
206
294
  return (jsx(Component, { ref: ref, className: classes, ...buttonSpecificProps, ...cleanRest, children: jsx(Loader, { "data-testid": "btn-loader-icon", size: "xs" }) }));
207
295
  }
208
- return (jsx(Component, { ref: ref, className: classes, ...buttonSpecificProps, ...cleanRest, children: loading ? (jsxs("span", { className: "flex items-center gap-2", "aria-live": "polite", children: [jsx(Loader, { "data-testid": "btn-loader-icon", size: "xs" }), loadingText && jsx(TextContent, { children: loadingText })] })) : (children) }));
296
+ return (jsx(Component, { ref: ref, className: classes, ...buttonSpecificProps, ...cleanRest, children: loading ? (jsxs("span", { className: "flex items-center gap-2", "aria-live": "polite", children: [jsx(Loader, { "data-testid": "btn-loader-icon", size: "xs", className: buildClassName(LOADER_TEXT_CLASS[theme][variant]) }), loadingText && (jsx(TextContent, { className: buildClassName(LOADER_TEXT_CLASS[theme][variant]), children: loadingText }))] })) : (children) }));
209
297
  });
210
298
  Button.displayName = 'Button';
211
299
 
@@ -251,10 +339,10 @@ const Badge = forwardRef((props, ref) => {
251
339
  });
252
340
  Badge.displayName = 'Badge';
253
341
 
254
- var _path$d;
255
- function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
342
+ var _path$c;
343
+ function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
256
344
  var SvgTriangleAlert = function SvgTriangleAlert(props) {
257
- return /*#__PURE__*/React.createElement("svg", _extends$d({
345
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
258
346
  xmlns: "http://www.w3.org/2000/svg",
259
347
  width: 24,
260
348
  height: 24,
@@ -265,15 +353,15 @@ var SvgTriangleAlert = function SvgTriangleAlert(props) {
265
353
  strokeWidth: 2,
266
354
  className: "lucide lucide-triangle-alert-icon lucide-triangle-alert",
267
355
  viewBox: "0 0 24 24"
268
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
356
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
269
357
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01"
270
358
  })));
271
359
  };
272
360
 
273
- var _circle$1, _path$c;
274
- function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
361
+ var _circle$1, _path$b;
362
+ function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
275
363
  var SvgCircleCheck = function SvgCircleCheck(props) {
276
- return /*#__PURE__*/React.createElement("svg", _extends$c({
364
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
277
365
  xmlns: "http://www.w3.org/2000/svg",
278
366
  width: 24,
279
367
  height: 24,
@@ -288,7 +376,7 @@ var SvgCircleCheck = function SvgCircleCheck(props) {
288
376
  cx: 12,
289
377
  cy: 12,
290
378
  r: 10
291
- })), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
379
+ })), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
292
380
  d: "m9 12 2 2 4-4"
293
381
  })));
294
382
  };
@@ -321,19 +409,28 @@ const Banner = forwardRef((props, ref) => {
321
409
  Banner.displayName = 'Banner';
322
410
 
323
411
  const BodyText = forwardRef((props, ref) => {
324
- const { as = 'p', small = false, strong = false, muted = false, error = false, inline = false, className, ...rest } = props;
412
+ const { as = 'p', small = false, strong = false, muted = false, error = false, inline = false, className, invert, ...rest } = props;
413
+ const textColorClass = error
414
+ ? 'text-[var(--ui-text-danger)]'
415
+ : muted
416
+ ? invert
417
+ ? 'text-gray-300 dark:text-gray-600'
418
+ : 'text-[var(--ui-text-muted)]'
419
+ : invert
420
+ ? 'text-white dark:text-black'
421
+ : 'text-[var(--ui-text)]';
325
422
  return React__default.createElement(as, {
326
423
  ref: ref,
327
- className: buildClassName('text-gray-900 dark:text-gray-100', small && 'text-sm/6', strong && 'font-semibold', muted && 'text-gray-500 dark:text-gray-400', error && 'text-red-500 dark:text-red-400', inline && 'inline-flex items-center gap-2', className),
424
+ className: buildClassName(textColorClass, small && 'text-sm/6', strong && 'font-semibold', inline && 'inline-flex items-center gap-2', className),
328
425
  ...rest,
329
426
  });
330
427
  });
331
428
  BodyText.displayName = 'BodyText';
332
429
 
333
- var _path$b;
334
- function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
430
+ var _path$a;
431
+ function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
335
432
  var SvgSlash = function SvgSlash(props) {
336
- return /*#__PURE__*/React.createElement("svg", _extends$b({
433
+ return /*#__PURE__*/React.createElement("svg", _extends$a({
337
434
  xmlns: "http://www.w3.org/2000/svg",
338
435
  width: 24,
339
436
  height: 24,
@@ -344,7 +441,7 @@ var SvgSlash = function SvgSlash(props) {
344
441
  strokeWidth: 2,
345
442
  className: "lucide lucide-slash-icon lucide-slash",
346
443
  viewBox: "0 0 24 24"
347
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
444
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
348
445
  d: "M22 2 2 22"
349
446
  })));
350
447
  };
@@ -356,6 +453,76 @@ const Breadcrumb = ({ items, render }) => {
356
453
  };
357
454
  Breadcrumb.displayName = 'Breadcrumb';
358
455
 
456
+ /**
457
+ * Corner-rounding classes for the group's first/last button, keyed by
458
+ * orientation + size, matching Button's own size -> radius mapping
459
+ * (xs: rounded-sm, sm: rounded, md: rounded-md, lg: rounded-lg).
460
+ *
461
+ * These must stay fully static string literals (no template-literal
462
+ * interpolation) — Tailwind's JIT scanner only picks up class names that
463
+ * appear verbatim in source, and the docs site scans the library's
464
+ * *compiled* output, where interpolated fragments never appear as a
465
+ * complete class name.
466
+ */
467
+ const EDGE_ROUNDING = {
468
+ horizontal: {
469
+ xs: { first: 'rounded-l-sm rounded-r-none', last: 'rounded-r-sm rounded-l-none' },
470
+ sm: { first: 'rounded-l rounded-r-none', last: 'rounded-r rounded-l-none' },
471
+ md: { first: 'rounded-l-md rounded-r-none', last: 'rounded-r-md rounded-l-none' },
472
+ lg: { first: 'rounded-l-lg rounded-r-none', last: 'rounded-r-lg rounded-l-none' },
473
+ },
474
+ vertical: {
475
+ xs: { first: 'rounded-t-sm rounded-b-none', last: 'rounded-b-sm rounded-t-none' },
476
+ sm: { first: 'rounded-t rounded-b-none', last: 'rounded-b rounded-t-none' },
477
+ md: { first: 'rounded-t-md rounded-b-none', last: 'rounded-b-md rounded-t-none' },
478
+ lg: { first: 'rounded-t-lg rounded-b-none', last: 'rounded-b-lg rounded-t-none' },
479
+ },
480
+ };
481
+ const PILL_EDGE_ROUNDING = {
482
+ horizontal: { first: 'rounded-l-full rounded-r-none', last: 'rounded-r-full rounded-l-none' },
483
+ vertical: { first: 'rounded-t-full rounded-b-none', last: 'rounded-b-full rounded-t-none' },
484
+ };
485
+ /**
486
+ * Resolves the corner-rounding classes for a single button at `index`
487
+ * out of `count` inside the group, so only the group's outer edges stay
488
+ * rounded and interior seams go square.
489
+ */
490
+ const getEdgeRoundingClass = ({ index, count, size, orientation, pill, }) => {
491
+ if (count <= 1)
492
+ return '';
493
+ if (index !== 0 && index !== count - 1)
494
+ return 'rounded-none';
495
+ const position = index === 0 ? 'first' : 'last';
496
+ return pill
497
+ ? PILL_EDGE_ROUNDING[orientation][position]
498
+ : EDGE_ROUNDING[orientation][size][position];
499
+ };
500
+ const ButtonGroup = ({ children, orientation = 'horizontal', theme = 'secondary', variant = 'default', size = 'md', rounded = false, fullWidth = false, label, className = '', }) => {
501
+ const isVertical = orientation === 'vertical';
502
+ const items = useMemo(() => Children.toArray(children).filter(isValidElement), [children]);
503
+ const count = items.length;
504
+ return (jsx("div", { role: "group", "aria-label": label, className: buildClassName('inline-flex', isVertical ? 'flex-col' : 'flex-row', fullWidth && 'flex w-full', className), children: items.map((child, index) => {
505
+ var _a, _b, _c;
506
+ const childSize = (_a = child.props.size) !== null && _a !== void 0 ? _a : size;
507
+ return cloneElement(child, {
508
+ theme: (_b = child.props.theme) !== null && _b !== void 0 ? _b : theme,
509
+ variant: (_c = child.props.variant) !== null && _c !== void 0 ? _c : variant,
510
+ size: childSize,
511
+ className: buildClassName(child.props.className, getEdgeRoundingClass({
512
+ index,
513
+ count,
514
+ size: childSize,
515
+ orientation,
516
+ pill: rounded,
517
+ }), count > 1 && [
518
+ 'relative shadow-none hover:z-10 focus:z-10 focus-visible:z-10',
519
+ index > 0 && (isVertical ? '-mt-px' : '-ml-px'),
520
+ ], fullWidth && 'flex-1'),
521
+ });
522
+ }) }));
523
+ };
524
+ ButtonGroup.displayName = 'ButtonGroup';
525
+
359
526
  const BASE_CARD_CLASS = 'bg-white rounded-md dark:bg-gray-900 block';
360
527
  const Card = forwardRef(({ as, ...props }, ref) => {
361
528
  // Remove Card-only props from rest (avoid leaking to DOM)
@@ -491,10 +658,10 @@ const usePagination = ({ totalPages, currentPage, siblingCount = 1, // number of
491
658
  return [];
492
659
  };
493
660
 
494
- var _path$a;
495
- function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
661
+ var _path$9;
662
+ function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
496
663
  var SvgChevronLeft = function SvgChevronLeft(props) {
497
- return /*#__PURE__*/React.createElement("svg", _extends$a({
664
+ return /*#__PURE__*/React.createElement("svg", _extends$9({
498
665
  xmlns: "http://www.w3.org/2000/svg",
499
666
  width: 24,
500
667
  height: 24,
@@ -505,15 +672,15 @@ var SvgChevronLeft = function SvgChevronLeft(props) {
505
672
  strokeWidth: 2,
506
673
  className: "lucide lucide-chevron-left-icon lucide-chevron-left",
507
674
  viewBox: "0 0 24 24"
508
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
675
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
509
676
  d: "m15 18-6-6 6-6"
510
677
  })));
511
678
  };
512
679
 
513
- var _path$9;
514
- function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
680
+ var _path$8;
681
+ function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
515
682
  var SvgChevronRight = function SvgChevronRight(props) {
516
- return /*#__PURE__*/React.createElement("svg", _extends$9({
683
+ return /*#__PURE__*/React.createElement("svg", _extends$8({
517
684
  xmlns: "http://www.w3.org/2000/svg",
518
685
  width: 24,
519
686
  height: 24,
@@ -524,7 +691,7 @@ var SvgChevronRight = function SvgChevronRight(props) {
524
691
  strokeWidth: 2,
525
692
  className: "lucide lucide-chevron-right-icon lucide-chevron-right",
526
693
  viewBox: "0 0 24 24"
527
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
694
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
528
695
  d: "m9 18 6-6-6-6"
529
696
  })));
530
697
  };
@@ -604,10 +771,10 @@ const updateSortQuery = (sortQuery, name, type = 'string') => {
604
771
  return updated;
605
772
  };
606
773
 
607
- var _path$8;
608
- function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
774
+ var _path$7;
775
+ function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
609
776
  var SvgArrowDownWideNarrow = function SvgArrowDownWideNarrow(props) {
610
- return /*#__PURE__*/React.createElement("svg", _extends$8({
777
+ return /*#__PURE__*/React.createElement("svg", _extends$7({
611
778
  xmlns: "http://www.w3.org/2000/svg",
612
779
  width: 24,
613
780
  height: 24,
@@ -618,15 +785,15 @@ var SvgArrowDownWideNarrow = function SvgArrowDownWideNarrow(props) {
618
785
  strokeWidth: 2,
619
786
  className: "lucide lucide-arrow-down-wide-narrow-icon lucide-arrow-down-wide-narrow",
620
787
  viewBox: "0 0 24 24"
621
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
788
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
622
789
  d: "m3 16 4 4 4-4M7 20V4M11 4h10M11 8h7M11 12h4"
623
790
  })));
624
791
  };
625
792
 
626
- var _path$7;
627
- function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
793
+ var _path$6;
794
+ function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
628
795
  var SvgArrowDownNarrowWide = function SvgArrowDownNarrowWide(props) {
629
- return /*#__PURE__*/React.createElement("svg", _extends$7({
796
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
630
797
  xmlns: "http://www.w3.org/2000/svg",
631
798
  width: 24,
632
799
  height: 24,
@@ -637,15 +804,15 @@ var SvgArrowDownNarrowWide = function SvgArrowDownNarrowWide(props) {
637
804
  strokeWidth: 2,
638
805
  className: "lucide lucide-arrow-down-narrow-wide-icon lucide-arrow-down-narrow-wide",
639
806
  viewBox: "0 0 24 24"
640
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
807
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
641
808
  d: "m3 16 4 4 4-4M7 20V4M11 4h4M11 8h7M11 12h10"
642
809
  })));
643
810
  };
644
811
 
645
- var _path$6;
646
- function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
812
+ var _path$5;
813
+ function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
647
814
  var SvgArrowDownAz = function SvgArrowDownAz(props) {
648
- return /*#__PURE__*/React.createElement("svg", _extends$6({
815
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
649
816
  xmlns: "http://www.w3.org/2000/svg",
650
817
  width: 24,
651
818
  height: 24,
@@ -656,15 +823,15 @@ var SvgArrowDownAz = function SvgArrowDownAz(props) {
656
823
  strokeWidth: 2,
657
824
  className: "lucide lucide-arrow-down-az-icon lucide-arrow-down-a-z",
658
825
  viewBox: "0 0 24 24"
659
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
826
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
660
827
  d: "m3 16 4 4 4-4M7 20V4M20 8h-5M15 10V6.5a2.5 2.5 0 0 1 5 0V10M15 14h5l-5 6h5"
661
828
  })));
662
829
  };
663
830
 
664
- var _path$5;
665
- function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
831
+ var _path$4;
832
+ function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
666
833
  var SvgArrowDownZa = function SvgArrowDownZa(props) {
667
- return /*#__PURE__*/React.createElement("svg", _extends$5({
834
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
668
835
  xmlns: "http://www.w3.org/2000/svg",
669
836
  width: 24,
670
837
  height: 24,
@@ -675,15 +842,15 @@ var SvgArrowDownZa = function SvgArrowDownZa(props) {
675
842
  strokeWidth: 2,
676
843
  className: "lucide lucide-arrow-down-za-icon lucide-arrow-down-z-a",
677
844
  viewBox: "0 0 24 24"
678
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
845
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
679
846
  d: "m3 16 4 4 4-4M7 4v16M15 4h5l-5 6h5M15 20v-3.5a2.5 2.5 0 0 1 5 0V20M20 18h-5"
680
847
  })));
681
848
  };
682
849
 
683
- var _path$4;
684
- function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
850
+ var _path$3;
851
+ function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
685
852
  var SvgArrowUpDown = function SvgArrowUpDown(props) {
686
- return /*#__PURE__*/React.createElement("svg", _extends$4({
853
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
687
854
  xmlns: "http://www.w3.org/2000/svg",
688
855
  width: 24,
689
856
  height: 24,
@@ -694,7 +861,7 @@ var SvgArrowUpDown = function SvgArrowUpDown(props) {
694
861
  strokeWidth: 2,
695
862
  className: "lucide lucide-arrow-up-down-icon lucide-arrow-up-down",
696
863
  viewBox: "0 0 24 24"
697
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
864
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
698
865
  d: "m21 16-4 4-4-4M17 20V4M3 8l4-4 4 4M7 4v16"
699
866
  })));
700
867
  };
@@ -785,11 +952,11 @@ function DataTable({ items, columns, sorting = {}, onSort, loading, pagination,
785
952
  }
786
953
  DataTable.displayName = 'DataTable';
787
954
 
788
- const Title = ({ children, className }) => (jsx("h1", { className: buildClassName('text-3xl font-bold text-gray-900 dark:text-white', className), children: children }));
789
- const SubTitle = ({ children, className }) => (jsx("h2", { className: buildClassName('text-2xl font-semibold text-gray-900 dark:text-white', className), children: children }));
790
- const SubTitle2 = ({ children, className }) => (jsx("h3", { className: buildClassName('text-xl font-semibold text-gray-900 dark:text-white', className), children: children }));
791
- const SubTitle3 = ({ children, className }) => (jsx("h4", { className: buildClassName('text-lg font-medium text-gray-900 dark:text-white', className), children: children }));
792
- const SubTitle4 = ({ children, className }) => (jsx("h5", { className: buildClassName('text-base font-medium text-gray-900 dark:text-white', className), children: children }));
955
+ const Title = ({ children, className }) => (jsx("h1", { className: buildClassName('text-3xl font-bold text-[var(--ui-text)]', className), children: children }));
956
+ const SubTitle = ({ children, className }) => (jsx("h2", { className: buildClassName('text-2xl font-semibold text-[var(--ui-text)]', className), children: children }));
957
+ const SubTitle2 = ({ children, className }) => (jsx("h3", { className: buildClassName('text-xl font-semibold text-[var(--ui-text)]', className), children: children }));
958
+ const SubTitle3 = ({ children, className }) => (jsx("h4", { className: buildClassName('text-lg font-medium text-[var(--ui-text)]', className), children: children }));
959
+ const SubTitle4 = ({ children, className }) => (jsx("h5", { className: buildClassName('text-base font-medium text-[var(--ui-text)]', className), children: children }));
793
960
  const HeadingText = {
794
961
  Title,
795
962
  SubTitle,
@@ -846,10 +1013,10 @@ const Dropdown = ({ triggerButton, renderTriggerButton, items, renderItem, items
846
1013
  };
847
1014
  Dropdown.displayName = 'Dropdown';
848
1015
 
849
- var _path$3;
850
- function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
1016
+ var _path$2;
1017
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
851
1018
  var SvgFolderPlus = function SvgFolderPlus(props) {
852
- return /*#__PURE__*/React.createElement("svg", _extends$3({
1019
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
853
1020
  xmlns: "http://www.w3.org/2000/svg",
854
1021
  width: 24,
855
1022
  height: 24,
@@ -860,7 +1027,7 @@ var SvgFolderPlus = function SvgFolderPlus(props) {
860
1027
  strokeWidth: 2,
861
1028
  className: "lucide lucide-folder-plus-icon lucide-folder-plus",
862
1029
  viewBox: "0 0 24 24"
863
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
1030
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
864
1031
  d: "M12 10v6M9 13h6M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
865
1032
  })));
866
1033
  };
@@ -881,7 +1048,7 @@ const Input = forwardRef((props, ref) => {
881
1048
  const hasError = Boolean(error);
882
1049
  const hasRightGroup = rightGroup !== null && rightGroup !== undefined;
883
1050
  const hasLeftGroup = leftGroup != null && leftGroup !== undefined;
884
- return (jsxs("div", { className: buildClassName('group', hasError && 'has-error', containerClass), children: [label && (jsxs("div", { className: buildClassName('flex items-center justify-between mb-2', labelWrapperClass), children: [jsx(Label, { className: labelClass, htmlFor: id, children: label }), labelHint] })), jsxs("div", { className: "relative", children: [hasLeftGroup && (jsx("span", { className: "absolute top-0 h-full flex items-center justify-center w-10", children: leftGroup })), jsx("input", { ref: ref, autoComplete: "off", ...inputProps, name: name, id: id, type: type, className: buildClassName(buildInputClass(className, { disabled: inputProps.disabled }), hasRightGroup ? 'pe-10' : '', hasLeftGroup ? 'ps-10' : '') }), hasRightGroup && (jsx("span", { className: "absolute end-0.75 top-0 h-full flex items-center justify-center w-10", children: rightGroup }))] }), showErrorMessage && error && (jsx("div", { className: "mt-1", children: jsx(TextContent, { error: true, small: true, children: error }) }))] }));
1051
+ return (jsxs("div", { className: buildClassName('group', hasError && 'has-error', containerClass), children: [label && (jsxs("div", { className: buildClassName('flex items-center justify-between mb-2', labelWrapperClass), children: [jsx(Label, { className: labelClass, htmlFor: id, children: label }), jsx(TextContent, { xsmall: true, children: labelHint })] })), jsxs("div", { className: "relative", children: [hasLeftGroup && (jsx("span", { className: "absolute top-0 h-full flex items-center justify-center w-10", children: leftGroup })), jsx("input", { ref: ref, autoComplete: "off", ...inputProps, name: name, id: id, type: type, className: buildClassName(buildInputClass(className, { disabled: inputProps.disabled }), hasRightGroup ? 'pe-10' : '', hasLeftGroup ? 'ps-10' : '') }), hasRightGroup && (jsx("span", { className: "absolute end-0.75 top-0 h-full flex items-center justify-center w-10", children: rightGroup }))] }), showErrorMessage && error && (jsx("div", { className: "mt-1", children: jsx(TextContent, { error: true, small: true, children: error }) }))] }));
885
1052
  });
886
1053
  Input.displayName = 'Input';
887
1054
 
@@ -951,7 +1118,7 @@ const RadioSwitch = ({ label, items, selected, onChange, wrapperClass, switchCla
951
1118
  transform: `translate(${style.left}px, ${style.top}px)`,
952
1119
  width: style.width,
953
1120
  height: style.height,
954
- } }), items.map((item) => (jsx(Radio$1, { value: getValue(item), "data-radio-item": true, "data-value": getValue(item), className: buildClassName('relative z-10 cursor-pointer select-none group', 'px-4 py-2 rounded-md transition-colors', 'text-gray-700 dark:text-gray-300 data-checked:text-white'), children: jsxs("div", { className: buildClassName('flex flex-col items-center justify-center gap-1', contentClass), children: [jsx(BodyText, { className: "font-semibold", children: getLabel(item) }), getDescription(item) && (jsx(BodyText, { className: buildClassName('text-xs opacity-80', descriptionClass), children: getDescription(item) }))] }) }, getValue(item))))] }));
1121
+ } }), items.map((item) => (jsx(Radio$1, { value: getValue(item), "data-radio-item": true, "data-value": getValue(item), className: buildClassName('relative z-10 cursor-pointer select-none group', 'px-4 py-2 rounded-md transition-colors', 'text-gray-700 dark:text-gray-300 data-checked:text-white'), children: jsxs("div", { className: buildClassName('flex flex-col items-center justify-center gap-1', contentClass), children: [jsx(BodyText, { className: buildClassName('font-semibold', selected === getValue(item) && 'text-white'), children: getLabel(item) }), getDescription(item) && (jsx(BodyText, { className: buildClassName('text-xs opacity-80', descriptionClass, selected === getValue(item) && 'text-white'), children: getDescription(item) }))] }) }, getValue(item))))] }));
955
1122
  };
956
1123
 
957
1124
  /**
@@ -1122,28 +1289,9 @@ const useDebounceFn = (fn, ms) => {
1122
1289
  }, [fn, ms]);
1123
1290
  };
1124
1291
 
1125
- var _path$2;
1126
- function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
1127
- var SvgCheck = function SvgCheck(props) {
1128
- return /*#__PURE__*/React.createElement("svg", _extends$2({
1129
- xmlns: "http://www.w3.org/2000/svg",
1130
- width: 24,
1131
- height: 24,
1132
- fill: "none",
1133
- stroke: "currentColor",
1134
- strokeLinecap: "round",
1135
- strokeLinejoin: "round",
1136
- strokeWidth: 2,
1137
- className: "lucide lucide-check-icon lucide-check",
1138
- viewBox: "0 0 24 24"
1139
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
1140
- d: "M20 6 9 17l-5-5"
1141
- })));
1142
- };
1143
-
1144
1292
  var _path$1;
1145
1293
  function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
1146
- var SvgChevronDown = function SvgChevronDown(props) {
1294
+ var SvgCheck = function SvgCheck(props) {
1147
1295
  return /*#__PURE__*/React.createElement("svg", _extends$1({
1148
1296
  xmlns: "http://www.w3.org/2000/svg",
1149
1297
  width: 24,
@@ -1153,10 +1301,10 @@ var SvgChevronDown = function SvgChevronDown(props) {
1153
1301
  strokeLinecap: "round",
1154
1302
  strokeLinejoin: "round",
1155
1303
  strokeWidth: 2,
1156
- className: "lucide lucide-chevron-down-icon lucide-chevron-down",
1304
+ className: "lucide lucide-check-icon lucide-check",
1157
1305
  viewBox: "0 0 24 24"
1158
1306
  }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
1159
- d: "m6 9 6 6 6-6"
1307
+ d: "M20 6 9 17l-5-5"
1160
1308
  })));
1161
1309
  };
1162
1310
 
@@ -1185,7 +1333,7 @@ var SvgCirclePlus = function SvgCirclePlus(props) {
1185
1333
 
1186
1334
  const constructInputClass = (disabled) => buildInputClass('', { disabled });
1187
1335
  const SelectBox = forwardRef((props, forwardedRef) => {
1188
- const { labelKey = 'label', valueKey = 'value', name, id = name, options, selected, label = null, labelWrapperClass = '', labelClass = '', labelHint = null, disabled = false, containerClass = '', onChange = () => { }, placeholder, dropdownContainerClass = 'z-20', multiple = false, maxSelection, immediate = true, showErrorMessage = true, error = null, async = false, searchable = true, required = false, allowAdd = false, addNewText = 'Create', onAdd = () => { }, allowClear = false, } = props;
1336
+ const { labelKey = 'label', valueKey = 'value', name, id = name, options, selected, label = null, labelWrapperClass = '', labelClass = '', labelHint = null, disabled = false, containerClass = '', onChange = () => { }, placeholder, dropdownContainerClass = 'z-20', multiple = false, maxSelection, immediate = true, showErrorMessage = true, error = null, async = false, searchable = true, required = false, allowAdd = false, addNewText = 'Create', onAdd = () => { }, allowClear = false, modalDropdown = false, noOptionsText = 'No options available', } = props;
1189
1337
  const hasError = Boolean(error);
1190
1338
  const [query, setQuery] = useState('');
1191
1339
  const debouncedQuery = useDebounce(query, 500);
@@ -1280,11 +1428,18 @@ const SelectBox = forwardRef((props, forwardedRef) => {
1280
1428
  console.error('onAdd handler error', err);
1281
1429
  }
1282
1430
  }, [onAdd, handleOnChangeInternal]);
1431
+ // Kept in a ref so `handleSearch` stays referentially stable even when the
1432
+ // caller passes a non-memoized `onSearch` — otherwise the effect below would
1433
+ // re-fire (and re-search) on every render instead of only on query changes.
1434
+ const onSearchRef = useRef(props.onSearch);
1435
+ useEffect(() => {
1436
+ onSearchRef.current = props.onSearch;
1437
+ }, [props.onSearch]);
1283
1438
  const handleSearch = useCallback(async (searchString) => {
1284
1439
  var _a;
1285
1440
  try {
1286
1441
  setOptionsLoading(true);
1287
- await ((_a = props.onSearch) === null || _a === void 0 ? void 0 : _a.call(props, searchString));
1442
+ await ((_a = onSearchRef.current) === null || _a === void 0 ? void 0 : _a.call(onSearchRef, searchString));
1288
1443
  }
1289
1444
  catch (err) {
1290
1445
  console.error('Error loading options:', err);
@@ -1292,12 +1447,12 @@ const SelectBox = forwardRef((props, forwardedRef) => {
1292
1447
  finally {
1293
1448
  setOptionsLoading(false);
1294
1449
  }
1295
- }, [props.onSearch]);
1450
+ }, []);
1296
1451
  useEffect(() => {
1297
1452
  if (async && debouncedQuery)
1298
1453
  handleSearch(debouncedQuery);
1299
1454
  }, [debouncedQuery, async, handleSearch]);
1300
- return (jsxs("div", { className: buildClassName('group space-y-2', hasError && 'has-error', containerClass), ref: containerRef, children: [label && (jsxs("div", { className: buildClassName('flex items-center justify-between', labelWrapperClass), children: [jsx(Label, { className: labelClass, htmlFor: id, "aria-required": required, children: label }), labelHint] })), jsxs(Combobox, { multiple: multiple, immediate: immediate, name: name, value: selected, onChange: comboboxOnChangeWrapper, onClose: () => setQuery(''), disabled: disabled, children: [multiple ? (jsxs("div", { className: buildClassName(inputClass, 'flex flex-wrap gap-2 peer relative'), ref: forwardedRef, children: [isArray(selected) &&
1455
+ return (jsxs("div", { className: buildClassName('group space-y-2', hasError && 'has-error', containerClass), ref: containerRef, children: [label && (jsxs("div", { className: buildClassName('flex items-center justify-between', labelWrapperClass), children: [jsx(Label, { className: labelClass, htmlFor: id, "aria-required": required, children: label }), jsx(TextContent, { xsmall: true, children: labelHint })] })), jsxs(Combobox, { multiple: multiple, immediate: immediate, name: name, value: selected, onChange: comboboxOnChangeWrapper, onClose: () => setQuery(''), disabled: disabled, children: [multiple ? (jsxs("div", { className: buildClassName(inputClass, 'flex flex-wrap gap-2 peer relative'), ref: forwardedRef, children: [isArray(selected) &&
1301
1456
  (selected === null || selected === void 0 ? void 0 : selected.length) > 0 &&
1302
1457
  selected.map((option, idx) => (jsx(Badge, { theme: "secondary", removable: !disabled, onRemove: () => removeSelection(idx), children: getDisplayValue(option) }, `${getValue(option)}-${idx}`))), jsx(ComboboxInput, { className: "outline-none flex-1 dark:placeholder-gray-400 placeholder-gray-400", "aria-label": name, value: query, autoComplete: "off", placeholder: (selected === null || selected === void 0 ? void 0 : selected.length) ? '' : placeholder, onChange: (e) => setQuery(e.target.value), id: id, ref: inputRef, onKeyDown: (e) => {
1303
1458
  if (multiple && e.key === 'Backspace' && !query) {
@@ -1305,7 +1460,7 @@ const SelectBox = forwardRef((props, forwardedRef) => {
1305
1460
  removeSelection(selected.length - 1);
1306
1461
  }
1307
1462
  }
1308
- }, "data-testid": "combobox-input" }), jsx(ComboboxButton, { className: "group absolute inset-y-0 right-0 px-2.5", "data-testid": "combobox-button", children: jsx(SvgChevronDown, { className: chevronIconClass }) })] })) : (jsxs("div", { className: "relative", ref: forwardedRef, children: [jsx(ComboboxInput, { "aria-label": name, displayValue: (option) => (option ? getDisplayValue(option) : null), autoComplete: "off", placeholder: placeholder, onChange: (event) => setQuery(event.target.value), className: inputClass, disabled: disabled, id: id, readOnly: !searchable, ref: inputRef, "data-testid": "combobox-input" }), allowClear && !isEmpty(selected) && (jsx(Button, { size: "xs", iconOnly: true, "aria-label": "Clear selection", theme: "secondary", variant: "plain", className: "group absolute inset-y-0 right-8 h-6 top-2", onClick: () => handleOnChangeInternal(multiple ? [] : null), disabled: disabled, "data-testid": "combobox-clear-button", noOutlineOnFocus: true, children: jsx(SvgX, { className: "size-4 stroke-gray-500" }) })), jsx(ComboboxButton, { className: "group absolute inset-y-0 right-0 px-2.5", "data-testid": "combobox-button", children: jsx(SvgChevronDown, { className: chevronIconClass }) })] })), jsx(ComboboxOptions, { anchor: { to: 'bottom', gap: 5 }, as: "div", className: buildClassName('w-[var(--input-width)] rounded-lg border border-gray-200 dark:border-white/5 bg-white dark:bg-gray-800 p-1 [--anchor-gap:var(--spacing-1)]', '[--anchor-max-height:20rem]', 'origin-top border transition duration-200 ease-[cubic-bezier(0.4, 0.0, 0.2, 1)] data-[closed]:translate-y-[-15%] data-[closed]:opacity-0', dropdownContainerClass), transition: true, "data-testid": "combobox-options", children: optionsLoading ? (jsx("div", { "data-testid": "options-loading", className: "flex items-center justify-center py-2 px-3 select-none", children: jsx(Loader, { size: "sm" }) })) : shouldShowTypeToSearch ? (jsx("div", { className: "flex items-center justify-between py-2 px-3 select-none", children: "Type to search..." })) : (jsxs("div", { children: [filteredOptions.map((option) => (jsx(ComboboxOption, { disabled: option.disabled, value: option, className: "group rounded-lg py-1.5 px-3 select-none data-[focus]:bg-black/3 dark:data-[focus]:bg-white/10 data-disabled:opacity-50 cursor-pointer data-disabled:pointer-events-none", children: jsxs("div", { className: "flex items-center justify-between gap-2 dark:text-white group-data-[selected]:text-blue-600", children: [jsx("span", { className: "text-sm/6", children: getDisplayValue(option) }), jsx(SvgCheck, { className: "invisible size-5 dark:stroke-gray-300 group-data-[selected]:visible" })] }) }, getValue(option)))), filteredOptions.length === 0 && query && !optionsLoading && (jsxs("div", { "data-testid": "no-result-found", className: "flex items-center gap-2 py-1.5 px-3 select-none text-gray-500 dark:text-gray-400", children: ["No results found for ", jsx("span", { className: "font-semibold", children: query })] })), allowAdd && (jsx(ComboboxOption, { value: query, className: "group rounded-lg py-1.5 px-3 cursor-pointer text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700", onClick: () => void handleAddAndSelect(query), children: jsxs("div", { className: "flex items-center gap-2", children: [jsx(SvgCirclePlus, { className: "size-4.5" }), jsxs(TextContent, { children: [addNewText, " \"", query, "\""] })] }) }))] })) })] }), showErrorMessage && error && (jsx("div", { className: "mt-1", children: jsx(TextContent, { error: true, small: true, children: error }) }))] }));
1463
+ }, "data-testid": "combobox-input" }), jsx(ComboboxButton, { className: "group absolute inset-y-0 right-0 px-2.5", "data-testid": "combobox-button", children: jsx(SvgChevronDown, { className: chevronIconClass }) })] })) : (jsxs("div", { className: "relative", ref: forwardedRef, children: [jsx(ComboboxInput, { "aria-label": name, displayValue: (option) => (option ? getDisplayValue(option) : null), autoComplete: "off", placeholder: placeholder, onChange: (event) => setQuery(event.target.value), className: inputClass, disabled: disabled, id: id, readOnly: !searchable, ref: inputRef, "data-testid": "combobox-input" }), allowClear && !isEmpty(selected) && (jsx(Button, { size: "xs", iconOnly: true, "aria-label": "Clear selection", theme: "secondary", variant: "plain", className: "group absolute inset-y-0 right-8 h-6 top-2", onClick: () => handleOnChangeInternal(multiple ? [] : null), disabled: disabled, "data-testid": "combobox-clear-button", noOutlineOnFocus: true, children: jsx(SvgX, { className: "size-4 stroke-gray-500 dark:stroke-gray-300" }) })), jsx(ComboboxButton, { className: "group absolute inset-y-0 right-0 px-2.5", "data-testid": "combobox-button", children: jsx(SvgChevronDown, { className: chevronIconClass }) })] })), jsx(ComboboxOptions, { anchor: { to: 'bottom', gap: 5 }, as: "div", modal: modalDropdown, className: buildClassName('w-[var(--input-width)] rounded-lg border border-gray-200 dark:border-white/5 bg-white dark:bg-gray-800 p-1 [--anchor-gap:var(--spacing-1)]', '[--anchor-max-height:20rem]', 'origin-top border transition duration-200 ease-[cubic-bezier(0.4, 0.0, 0.2, 1)] data-[closed]:translate-y-[-15%] data-[closed]:opacity-0', dropdownContainerClass), transition: true, "data-testid": "combobox-options", children: optionsLoading ? (jsx(BodyText, { "data-testid": "options-loading", className: "flex items-center justify-center py-2 px-3 select-none", children: jsx(Loader, { size: "sm" }) })) : shouldShowTypeToSearch ? (jsx(BodyText, { className: "flex items-center justify-between py-2 px-3 select-none", children: "Type to search..." })) : (jsxs("div", { children: [filteredOptions.map((option) => (jsx(ComboboxOption, { disabled: option.disabled, value: option, className: "group rounded-lg py-1.5 px-3 select-none data-[focus]:bg-black/3 dark:data-[focus]:bg-white/10 data-disabled:opacity-50 cursor-pointer data-disabled:pointer-events-none", children: jsxs("div", { className: "flex items-center justify-between gap-2 dark:text-white group-data-[selected]:text-blue-600", children: [jsx("span", { className: "text-sm/6", children: getDisplayValue(option) }), jsx(SvgCheck, { className: "invisible size-5 dark:stroke-gray-300 group-data-[selected]:visible" })] }) }, getValue(option)))), filteredOptions.length === 0 && (jsx("div", { "data-testid": "no-result-found", className: "flex items-center gap-2 py-1.5 px-3 select-none text-gray-500 dark:text-gray-400", children: query ? (jsxs(Fragment, { children: ["No results found for ", jsx("span", { className: "font-semibold", children: query })] })) : (noOptionsText) })), allowAdd && (jsx(ComboboxOption, { value: query, className: "group rounded-lg py-1.5 px-3 cursor-pointer text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700", onClick: () => void handleAddAndSelect(query), children: jsxs("div", { className: "flex items-center gap-2", children: [jsx(SvgCirclePlus, { className: "size-4.5" }), jsxs(TextContent, { children: [addNewText, " \"", query, "\""] })] }) }))] })) })] }), showErrorMessage && error && (jsx("div", { className: "mt-1", children: jsx(TextContent, { error: true, small: true, children: error }) }))] }));
1309
1464
  });
1310
1465
 
1311
1466
  const Tabs = ({ tabs, defaultIndex = 0, selectedIndex, onChange, variant = 'underline', orientation = 'horizontal', stretch = false, className = '', listClass = '', panelsClass = '', }) => {
@@ -1357,7 +1512,7 @@ const Textarea = forwardRef((props, ref) => {
1357
1512
  const hasError = !isEmpty(error);
1358
1513
  const hasRightGroup = rightGroup != null && rightGroup !== undefined;
1359
1514
  const hasLeftGroup = leftGroup != null && leftGroup !== undefined;
1360
- return (jsxs("div", { className: buildClassName('group', hasError && 'has-error', containerClass), children: [label && (jsxs("div", { className: buildClassName('flex items-center justify-between mb-2', labelWrapperClass), children: [jsx(Label, { className: labelClass, htmlFor: id, children: label }), labelHint] })), jsxs("div", { className: "relative", children: [hasLeftGroup && (jsx("span", { className: "absolute top-0 h-full flex items-center justify-center w-10", children: leftGroup })), jsx("textarea", { ref: ref, autoComplete: "off", ...inputProps, name: name, id: id, className: buildClassName('transition-all', 'block w-full rounded-lg bg-white px-3.5 py-2 text-base sm:text-sm/6', 'text-gray-900 outline dark:outline outline-1 -outline-offset-1', 'outline-gray-300 dark:outline-gray-600', 'focus:outline-blue-600 dark:focus:outline-blue-600 focus:outline-2 focus:-outline-offset-2', 'dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-500 placeholder:text-gray-400 dark:text-white', 'invalid:group-[.has-error]:outline-red-500', 'disabled:pointer-events-none disabled:bg-gray-100', 'dark:disabled:bg-gray-500', hasRightGroup ? 'pe-10' : '', hasLeftGroup ? 'ps-10' : '', className) }), hasRightGroup && (jsx("span", { className: "absolute end-0.75 top-0 h-full flex items-center justify-center", children: rightGroup }))] }), showErrorMessage && error && (jsx("div", { className: "mt-1", children: jsx(TextContent, { error: true, small: true, children: error }) }))] }));
1515
+ return (jsxs("div", { className: buildClassName('group', hasError && 'has-error', containerClass), children: [label && (jsxs("div", { className: buildClassName('flex items-center justify-between mb-2', labelWrapperClass), children: [jsx(Label, { className: labelClass, htmlFor: id, children: label }), jsx(TextContent, { xsmall: true, children: labelHint })] })), jsxs("div", { className: "relative", children: [hasLeftGroup && (jsx("span", { className: "absolute top-0 h-full flex items-center justify-center w-10", children: leftGroup })), jsx("textarea", { ref: ref, autoComplete: "off", ...inputProps, name: name, id: id, className: buildClassName('transition-all', 'block w-full rounded-lg bg-white px-3.5 py-2 text-base sm:text-sm/6', 'text-gray-900 outline dark:outline outline-1 -outline-offset-1', 'outline-gray-300 dark:outline-gray-600', 'focus:outline-blue-600 dark:focus:outline-blue-600 focus:outline-2 focus:-outline-offset-2', 'dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-500 placeholder:text-gray-400 dark:text-white', 'invalid:group-[.has-error]:outline-red-500', 'disabled:pointer-events-none disabled:bg-gray-100', 'dark:disabled:bg-gray-500', hasRightGroup ? 'pe-10' : '', hasLeftGroup ? 'ps-10' : '', className) }), hasRightGroup && (jsx("span", { className: "absolute end-0.75 top-0 h-full flex items-center justify-center", children: rightGroup }))] }), showErrorMessage && error && (jsx("div", { className: "mt-1", children: jsx(TextContent, { error: true, small: true, children: error }) }))] }));
1361
1516
  });
1362
1517
 
1363
1518
  /**
@@ -1586,5 +1741,5 @@ const useIsTabletOrMobile = () => {
1586
1741
  return isMobile || isTablet;
1587
1742
  };
1588
1743
 
1589
- export { Alert, Badge, Banner, BodyText, Breadcrumb, Button, Card, Checkbox, CheckboxGroup, DOTS, DataTable, DetailedInformation, Dot, Drawer, Dropdown, EmptyState, EmptyTableRow, HeadingText, Input, Label, Loader, PASSWORD_PLACEHOLDER, PASSWORD_TYPE, Pagination, PasswordInput, Radio, RadioGroup, RadioSwitch, RangeInput, RangeSlider, SelectBox, SortIconMap, Table, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, TextContent, Textarea, Toast, ToastProvider, VirtualizedDataTable, buildClassName, buildInputClass, get, getSortIcon, isArray, isEmpty, nextSortDirection, updateSortQuery, useDebounce, useDebounceFn, useIsMobile, useIsTablet, useIsTabletOrMobile, usePagination, useToast };
1744
+ export { Accordion, Alert, Badge, Banner, BodyText, Breadcrumb, Button, ButtonGroup, Card, Checkbox, CheckboxGroup, DOTS, DataTable, DetailedInformation, Dot, Drawer, Dropdown, EmptyState, EmptyTableRow, HeadingText, Input, Label, Loader, PASSWORD_PLACEHOLDER, PASSWORD_TYPE, Pagination, PasswordInput, Radio, RadioGroup, RadioSwitch, RangeInput, RangeSlider, SelectBox, SortIconMap, Table, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, TextContent, Textarea, Toast, ToastProvider, VirtualizedDataTable, buildClassName, buildInputClass, get, getSortIcon, isArray, isEmpty, nextSortDirection, updateSortQuery, useDebounce, useDebounceFn, useIsMobile, useIsTablet, useIsTabletOrMobile, usePagination, useToast };
1590
1745
  //# sourceMappingURL=react-tailwind.es.js.map