@lindle/linoardo 1.0.49 → 1.0.51

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.
Files changed (53) hide show
  1. package/dist/button.cjs +2 -4
  2. package/dist/button.cjs.map +1 -1
  3. package/dist/button.js +1 -1
  4. package/dist/chunk-3J6Y3EQW.js +538 -0
  5. package/dist/chunk-3J6Y3EQW.js.map +1 -0
  6. package/dist/{chunk-TRR7TDVA.js → chunk-4C6XQI62.js} +72 -40
  7. package/dist/chunk-4C6XQI62.js.map +1 -0
  8. package/dist/{chunk-HVGCLUW2.js → chunk-NJN7T34X.js} +4 -6
  9. package/dist/chunk-NJN7T34X.js.map +1 -0
  10. package/dist/{chunk-LRWM4ZWZ.js → chunk-QCRQUSET.js} +4 -4
  11. package/dist/chunk-QCRQUSET.js.map +1 -0
  12. package/dist/{chunk-Z5A2OIDI.js → chunk-SM2VNSPP.js} +4 -7
  13. package/dist/chunk-SM2VNSPP.js.map +1 -0
  14. package/dist/{chunk-LSIAP7ZZ.js → chunk-XLA2NCDF.js} +3 -9
  15. package/dist/chunk-XLA2NCDF.js.map +1 -0
  16. package/dist/expansion-panel.cjs +1 -7
  17. package/dist/expansion-panel.cjs.map +1 -1
  18. package/dist/expansion-panel.js +1 -1
  19. package/dist/index.cjs +643 -561
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +6 -7
  24. package/dist/index.js.map +1 -1
  25. package/dist/profileCard.cjs +3 -5
  26. package/dist/profileCard.cjs.map +1 -1
  27. package/dist/profileCard.js +2 -2
  28. package/dist/progress.cjs +2 -5
  29. package/dist/progress.cjs.map +1 -1
  30. package/dist/progress.js +1 -1
  31. package/dist/select.cjs +60 -37
  32. package/dist/select.cjs.map +1 -1
  33. package/dist/select.d.cts +4 -0
  34. package/dist/select.d.ts +4 -0
  35. package/dist/select.js +1 -2
  36. package/dist/styles.css +254 -187
  37. package/dist/textarea.cjs +484 -423
  38. package/dist/textarea.cjs.map +1 -1
  39. package/dist/textarea.d.cts +27 -23
  40. package/dist/textarea.d.ts +27 -23
  41. package/dist/textarea.js +1 -2
  42. package/dist/timeline.d.cts +1 -1
  43. package/dist/timeline.d.ts +1 -1
  44. package/package.json +7 -1
  45. package/dist/chunk-67TAA2MA.js +0 -470
  46. package/dist/chunk-67TAA2MA.js.map +0 -1
  47. package/dist/chunk-6SKW43XI.js +0 -14
  48. package/dist/chunk-6SKW43XI.js.map +0 -1
  49. package/dist/chunk-HVGCLUW2.js.map +0 -1
  50. package/dist/chunk-LRWM4ZWZ.js.map +0 -1
  51. package/dist/chunk-LSIAP7ZZ.js.map +0 -1
  52. package/dist/chunk-TRR7TDVA.js.map +0 -1
  53. package/dist/chunk-Z5A2OIDI.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,13 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
3
+ var React15 = require('react');
4
4
  var tailwindMerge = require('tailwind-merge');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var reactDom = require('react-dom');
7
- var react = require('@tiptap/react');
7
+ var CodeBlockLowlight = require('@tiptap/extension-code-block-lowlight');
8
8
  var StarterKit = require('@tiptap/starter-kit');
9
- var marked = require('marked');
9
+ var Underline = require('@tiptap/extension-underline');
10
+ var react = require('@tiptap/react');
11
+ var lowlight$1 = require('lowlight');
10
12
  var TurndownService = require('turndown');
13
+ var marked = require('marked');
11
14
 
12
15
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
16
 
@@ -29,8 +32,10 @@ function _interopNamespace(e) {
29
32
  return Object.freeze(n);
30
33
  }
31
34
 
32
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
35
+ var React15__namespace = /*#__PURE__*/_interopNamespace(React15);
36
+ var CodeBlockLowlight__default = /*#__PURE__*/_interopDefault(CodeBlockLowlight);
33
37
  var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
38
+ var Underline__default = /*#__PURE__*/_interopDefault(Underline);
34
39
  var TurndownService__default = /*#__PURE__*/_interopDefault(TurndownService);
35
40
 
36
41
  // src/Containment/Button/index.tsx
@@ -41,7 +46,7 @@ var iconBaseClasses = {
41
46
  };
42
47
 
43
48
  // src/Containment/Button/states.button.ts
44
- var base = "btn-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900 rounded-lg transition-colors duration-200 font-medium disabled:opacity-50 disabled:cursor-not-allowed";
49
+ var base = "btn-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900 rounded-lg transition-colors duration-200 font-medium disabled:opacity-50 disabled:cursor-not-allowed";
45
50
  var blackAndWhitePaletteClasses = {
46
51
  solid: "bg-black text-white hover:bg-black/90 focus-visible:ring-black/40 focus-visible:ring-offset-white dark:bg-white dark:text-black dark:hover:bg-white/90 dark:focus-visible:ring-white/40 dark:focus-visible:ring-offset-gray-900",
47
52
  outline: "border-2 border-black text-black bg-white hover:bg-black hover:text-white focus-visible:ring-black/40 focus-visible:ring-offset-white dark:border-white dark:text-white dark:bg-transparent dark:hover:bg-white dark:hover:text-black dark:focus-visible:ring-white/40 dark:focus-visible:ring-offset-gray-900",
@@ -138,9 +143,7 @@ var resolveIconClassName = (icon) => {
138
143
  }
139
144
  const [library, providedName] = icon;
140
145
  const normalizedLibrary = library.trim();
141
- const baseClasses = iconBaseClasses[normalizedLibrary] ?? [
142
- normalizedLibrary
143
- ];
146
+ const baseClasses = iconBaseClasses[normalizedLibrary] ?? [normalizedLibrary];
144
147
  const iconName = providedName.trim();
145
148
  if (!iconName) {
146
149
  return baseClasses.join(" ");
@@ -169,7 +172,7 @@ var iconOnlyIconSizeClasses = {
169
172
  large: "text-xl",
170
173
  "x-large": "text-2xl"
171
174
  };
172
- var ButtonBase = React__namespace.forwardRef(
175
+ var ButtonBase = React15__namespace.forwardRef(
173
176
  ({
174
177
  variant = "solid",
175
178
  color = "primary",
@@ -226,13 +229,13 @@ var ButtonBase = React__namespace.forwardRef(
226
229
  );
227
230
  ButtonBase.displayName = "Button";
228
231
  var isButtonElement = (element) => {
229
- if (!React__namespace.isValidElement(element)) {
232
+ if (!React15__namespace.isValidElement(element)) {
230
233
  return false;
231
234
  }
232
235
  const elementType = element.type;
233
236
  return element.type === ButtonBase || elementType.displayName === ButtonBase.displayName;
234
237
  };
235
- var ButtonGroup = React__namespace.forwardRef((props, ref) => {
238
+ var ButtonGroup = React15__namespace.forwardRef((props, ref) => {
236
239
  const {
237
240
  variant,
238
241
  color,
@@ -252,11 +255,11 @@ var ButtonGroup = React__namespace.forwardRef((props, ref) => {
252
255
  const blockClass = block ? "w-full [&>*]:flex-1" : void 0;
253
256
  const attachedClass = attached ? vertical ? "[&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none" : "[&>*:not(:first-child)]:-ml-px [&>*:not(:first-child)]:rounded-l-none [&>*:not(:last-child)]:rounded-r-none" : void 0;
254
257
  const enhanceChild = (child) => {
255
- if (!React__namespace.isValidElement(child)) {
258
+ if (!React15__namespace.isValidElement(child)) {
256
259
  return child;
257
260
  }
258
261
  if (isButtonElement(child)) {
259
- return React__namespace.cloneElement(child, {
262
+ return React15__namespace.cloneElement(child, {
260
263
  variant: child.props.variant ?? variant,
261
264
  color: child.props.color ?? color,
262
265
  size: child.props.size ?? size,
@@ -267,14 +270,14 @@ var ButtonGroup = React__namespace.forwardRef((props, ref) => {
267
270
  });
268
271
  }
269
272
  if (child.props && typeof child.props === "object" && "children" in child.props) {
270
- const nestedChildren = React__namespace.Children.map(child.props.children, enhanceChild);
273
+ const nestedChildren = React15__namespace.Children.map(child.props.children, enhanceChild);
271
274
  if (nestedChildren !== child.props.children) {
272
- return React__namespace.cloneElement(child, void 0, nestedChildren);
275
+ return React15__namespace.cloneElement(child, void 0, nestedChildren);
273
276
  }
274
277
  }
275
278
  return child;
276
279
  };
277
- const resolvedChildren = React__namespace.Children.map(children, enhanceChild);
280
+ const resolvedChildren = React15__namespace.Children.map(children, enhanceChild);
278
281
  return /* @__PURE__ */ jsxRuntime.jsx(
279
282
  "div",
280
283
  {
@@ -405,7 +408,7 @@ var chipSizeClasses = {
405
408
  large: "h-8 text-sm px-3",
406
409
  "x-large": "h-9 text-base px-3.5"
407
410
  };
408
- var Chip = React.forwardRef(
411
+ var Chip = React15.forwardRef(
409
412
  ({
410
413
  variant = "solid",
411
414
  color = "primary",
@@ -602,7 +605,7 @@ var Badge = ({
602
605
  className,
603
606
  ...rest
604
607
  }) => {
605
- const hasChildren = React__namespace.Children.count(children) > 0;
608
+ const hasChildren = React15__namespace.Children.count(children) > 0;
606
609
  const iconClassName = resolveIconClassName3(icon);
607
610
  const isNumberContent = typeof content === "number" && Number.isFinite(content);
608
611
  let displayValue = content;
@@ -743,7 +746,7 @@ var accentClasses = {
743
746
  indicator: "bg-gray-900 dark:bg-gray-100"
744
747
  }
745
748
  };
746
- var ListItem = React__namespace.forwardRef((props, ref) => {
749
+ var ListItem = React15__namespace.forwardRef((props, ref) => {
747
750
  const {
748
751
  component,
749
752
  href,
@@ -868,13 +871,13 @@ var listRoundedClasses = {
868
871
  pill: "rounded-full"
869
872
  };
870
873
  var isListItemElement = (element) => {
871
- if (!React__namespace.isValidElement(element)) {
874
+ if (!React15__namespace.isValidElement(element)) {
872
875
  return false;
873
876
  }
874
877
  const elementType = element.type;
875
878
  return element.type === Item_default || elementType.displayName === Item_default.displayName;
876
879
  };
877
- var List = React__namespace.forwardRef((props, ref) => {
880
+ var List = React15__namespace.forwardRef((props, ref) => {
878
881
  const {
879
882
  variant = "solid",
880
883
  density = "default",
@@ -896,11 +899,11 @@ var List = React__namespace.forwardRef((props, ref) => {
896
899
  const navClass = nav ? "py-1" : void 0;
897
900
  const accentColor = color;
898
901
  const enhanceChild = (child) => {
899
- if (!React__namespace.isValidElement(child)) {
902
+ if (!React15__namespace.isValidElement(child)) {
900
903
  return child;
901
904
  }
902
905
  if (isListItemElement(child)) {
903
- return React__namespace.cloneElement(child, {
906
+ return React15__namespace.cloneElement(child, {
904
907
  density: child.props.density ?? density,
905
908
  lines: child.props.lines ?? lines,
906
909
  nav: child.props.nav ?? nav,
@@ -910,14 +913,14 @@ var List = React__namespace.forwardRef((props, ref) => {
910
913
  });
911
914
  }
912
915
  if (child.props && typeof child.props === "object" && "children" in child.props) {
913
- const nestedChildren = React__namespace.Children.map(child.props.children, enhanceChild);
916
+ const nestedChildren = React15__namespace.Children.map(child.props.children, enhanceChild);
914
917
  if (nestedChildren !== child.props.children) {
915
- return React__namespace.cloneElement(child, void 0, nestedChildren);
918
+ return React15__namespace.cloneElement(child, void 0, nestedChildren);
916
919
  }
917
920
  }
918
921
  return child;
919
922
  };
920
- const resolvedChildren = React__namespace.Children.map(children, enhanceChild);
923
+ const resolvedChildren = React15__namespace.Children.map(children, enhanceChild);
921
924
  return /* @__PURE__ */ jsxRuntime.jsx(
922
925
  "div",
923
926
  {
@@ -956,7 +959,7 @@ var offsetClasses = {
956
959
  var menuWrapperBaseClasses = "absolute z-50";
957
960
  var menuBaseClasses = "min-w-[10rem] rounded-xl border border-gray-200/80 bg-white/95 p-2 text-sm text-gray-700 shadow-lg shadow-gray-900/10 ring-1 ring-black/5 backdrop-blur-md transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-gray-700/80 dark:bg-gray-900/95 dark:text-gray-100 dark:shadow-black/30 dark:ring-white/10 dark:focus-visible:ring-offset-gray-900";
958
961
  var overlayBaseClasses = "fixed inset-0 z-40 bg-gray-900/30 backdrop-blur-[1px] dark:bg-black/50";
959
- var Menu = React__namespace.forwardRef((props, ref) => {
962
+ var Menu = React15__namespace.forwardRef((props, ref) => {
960
963
  const {
961
964
  activator,
962
965
  children,
@@ -1090,7 +1093,7 @@ var traverseNode = (node, value) => {
1090
1093
  if (node === null || node === void 0 || typeof node === "boolean" || typeof node === "string" || typeof node === "number") {
1091
1094
  return { node, changed: false };
1092
1095
  }
1093
- if (!React.isValidElement(node)) {
1096
+ if (!React15.isValidElement(node)) {
1094
1097
  return { node, changed: false };
1095
1098
  }
1096
1099
  const element = node;
@@ -1103,7 +1106,7 @@ var traverseNode = (node, value) => {
1103
1106
  return { node, changed: false };
1104
1107
  }
1105
1108
  const injectedProps = shouldInject ? { [EXPANSION_PANEL_CONTEXT_PROP]: value } : void 0;
1106
- const cloned = mappedChildren === void 0 ? React.cloneElement(element, injectedProps) : React.cloneElement(element, injectedProps, mappedChildren);
1109
+ const cloned = mappedChildren === void 0 ? React15.cloneElement(element, injectedProps) : React15.cloneElement(element, injectedProps, mappedChildren);
1107
1110
  return { node: cloned, changed: true };
1108
1111
  };
1109
1112
  var injectExpansionPanelContext = (children, value) => traverseNode(children, value).node;
@@ -1269,7 +1272,7 @@ var ExpansionPanelItemInner = (props) => {
1269
1272
  }
1270
1273
  );
1271
1274
  };
1272
- var ExpansionPanelItem = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ExpansionPanelItemInner, { ...props, forwardedRef: ref }));
1275
+ var ExpansionPanelItem = React15.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ExpansionPanelItemInner, { ...props, forwardedRef: ref }));
1273
1276
  ExpansionPanelItem.displayName = "ExpansionPanelItem";
1274
1277
  markExpansionPanelItem(ExpansionPanelItem);
1275
1278
  var ExpansionPanelItem_default = ExpansionPanelItem;
@@ -1334,18 +1337,12 @@ var ExpansionPanelInner = (props, forwardedRef) => {
1334
1337
  {
1335
1338
  ...rest,
1336
1339
  ref: forwardedRef,
1337
- className: tailwindMerge.twMerge(
1338
- "expansion-panel flex w-full flex-col text-gray-900 dark:text-gray-100",
1339
- variantClass,
1340
- shapeClass,
1341
- layoutClass,
1342
- className
1343
- ),
1340
+ className: tailwindMerge.twMerge("expansion-panel flex w-full flex-col text-gray-900 dark:text-gray-100", variantClass, shapeClass, layoutClass, className),
1344
1341
  children: enhancedChildren
1345
1342
  }
1346
1343
  );
1347
1344
  };
1348
- var ExpansionPanelBase = React.forwardRef(ExpansionPanelInner);
1345
+ var ExpansionPanelBase = React15.forwardRef(ExpansionPanelInner);
1349
1346
  var ExpansionPanel = Object.assign(ExpansionPanelBase, {
1350
1347
  Item: ExpansionPanelItem_default
1351
1348
  });
@@ -1361,7 +1358,7 @@ var resolveSizeValue = (value) => {
1361
1358
  }
1362
1359
  return typeof value === "number" ? `${value}px` : value;
1363
1360
  };
1364
- var Dialog = React__namespace.forwardRef((props, forwardedRef) => {
1361
+ var Dialog = React15__namespace.forwardRef((props, forwardedRef) => {
1365
1362
  const {
1366
1363
  activator,
1367
1364
  children,
@@ -1486,7 +1483,7 @@ var resolveSizeValue2 = (value) => {
1486
1483
  }
1487
1484
  return typeof value === "number" ? `${value}px` : value;
1488
1485
  };
1489
- var Drawer = React__namespace.forwardRef((props, ref) => {
1486
+ var Drawer = React15__namespace.forwardRef((props, ref) => {
1490
1487
  const {
1491
1488
  location = "left",
1492
1489
  floating = false,
@@ -1587,7 +1584,7 @@ Drawer.displayName = "Drawer";
1587
1584
  var Drawer_default = Drawer;
1588
1585
  var overlayBaseClasses4 = "inset-0 z-[55] transition-opacity duration-200 data-[state=closed]:opacity-0 data-[state=open]:opacity-100";
1589
1586
  var scrimClasses = "bg-gray-900/55 dark:bg-black/70 backdrop-blur-[2px]";
1590
- var Overlay = React__namespace.forwardRef((props, ref) => {
1587
+ var Overlay = React15__namespace.forwardRef((props, ref) => {
1591
1588
  const {
1592
1589
  open,
1593
1590
  keepMounted = false,
@@ -1675,7 +1672,7 @@ var arrowPlacementClasses = {
1675
1672
  "right-start": "right-full top-4 translate-x-1/2",
1676
1673
  "right-end": "right-full bottom-4 translate-x-1/2"
1677
1674
  };
1678
- var ToolTip = React__namespace.forwardRef((props, forwardedRef) => {
1675
+ var ToolTip = React15__namespace.forwardRef((props, forwardedRef) => {
1679
1676
  const {
1680
1677
  activator,
1681
1678
  children,
@@ -1792,7 +1789,7 @@ var elevationClasses = {
1792
1789
  5: "shadow-xl",
1793
1790
  6: "shadow-2xl"
1794
1791
  };
1795
- var CardRoot = React.forwardRef(function Card({ className, children, variant = "solid", padding = "md", overflow = "hidden", interactive = false, dividers = true, elevation = 0, ...rest }, ref) {
1792
+ var CardRoot = React15.forwardRef(function Card({ className, children, variant = "solid", padding = "md", overflow = "hidden", interactive = false, dividers = true, elevation = 0, ...rest }, ref) {
1796
1793
  const variantClass = variantClasses[variant] ?? variantClasses.solid;
1797
1794
  const paddingClass = paddingClasses[padding] ?? paddingClasses.md;
1798
1795
  const overflowClass = overflowClasses[overflow] ?? overflowClasses.hidden;
@@ -1863,13 +1860,13 @@ var Card2 = Object.assign(CardRoot, {
1863
1860
  });
1864
1861
  var Card_default = Card2;
1865
1862
  function applyDividers(children, dividers) {
1866
- return React.Children.map(children, (child) => {
1867
- if (!React.isValidElement(child)) return child;
1863
+ return React15.Children.map(children, (child) => {
1864
+ if (!React15.isValidElement(child)) return child;
1868
1865
  if (isDividerSection(child)) {
1869
- return React.cloneElement(child, { dividers: child.props.dividers ?? dividers });
1866
+ return React15.cloneElement(child, { dividers: child.props.dividers ?? dividers });
1870
1867
  }
1871
1868
  if (hasNestedChildren(child)) {
1872
- return React.cloneElement(child, {
1869
+ return React15.cloneElement(child, {
1873
1870
  children: applyDividers(child.props.children, dividers)
1874
1871
  });
1875
1872
  }
@@ -1903,7 +1900,7 @@ var variantClasses2 = {
1903
1900
  underlined: "rounded-xl bg-white/20 backdrop-opacity-5 border-b border-white/40 dark:bg-slate-900/30 dark:border-white/20",
1904
1901
  sharp: "rounded-none bg-white/40 backdrop-opacity-5 border border-white/30 dark:bg-slate-900/50 dark:border-white/10"
1905
1902
  };
1906
- var Block = React__namespace.forwardRef(function Block2({ className, variant = "solid", blur = "sm", interactive = false, children, ...rest }, ref) {
1903
+ var Block = React15__namespace.forwardRef(function Block2({ className, variant = "solid", blur = "sm", interactive = false, children, ...rest }, ref) {
1907
1904
  const variantClass = variantClasses2[variant] ?? variantClasses2.solid;
1908
1905
  const blurClass = blurClasses[blur] ?? blurClasses.sm;
1909
1906
  const interactiveClass = interactive ? "transition-all duration-200 hover:-translate-y-0.5 hover:shadow-xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-slate-900" : void 0;
@@ -1961,10 +1958,10 @@ var MasonryBase = (props, ref) => {
1961
1958
  const renderedItems = items && items.length ? items.map((item, index) => {
1962
1959
  const content = resolveItemContent(item, index, renderItem);
1963
1960
  return wrapItem(content, resolveItemKey(item, index, getKey));
1964
- }) : React__namespace.Children.map(children, (child, index) => wrapItem(child, resolveChildKey(child, index))) ?? null;
1961
+ }) : React15__namespace.Children.map(children, (child, index) => wrapItem(child, resolveChildKey(child, index))) ?? null;
1965
1962
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, ref, role, className: tailwindMerge.twMerge(masonryBaseClass, className), style: layoutStyle, children: renderedItems });
1966
1963
  };
1967
- var Masonry = React__namespace.forwardRef(MasonryBase);
1964
+ var Masonry = React15__namespace.forwardRef(MasonryBase);
1968
1965
  Masonry.displayName = "Masonry";
1969
1966
  var Masonry_default = Masonry;
1970
1967
  function toCssLength(value) {
@@ -1989,13 +1986,13 @@ function resolveColumnCount(column, maxColumn, hasColumnWidth) {
1989
1986
  }
1990
1987
  function resolveItemKey(item, index, getKey) {
1991
1988
  if (getKey) return getKey(item, index);
1992
- if (React__namespace.isValidElement(item) && item.key != null) {
1989
+ if (React15__namespace.isValidElement(item) && item.key != null) {
1993
1990
  return item.key;
1994
1991
  }
1995
1992
  return index;
1996
1993
  }
1997
1994
  function resolveChildKey(child, index) {
1998
- if (React__namespace.isValidElement(child) && child.key != null) {
1995
+ if (React15__namespace.isValidElement(child) && child.key != null) {
1999
1996
  return child.key;
2000
1997
  }
2001
1998
  return index;
@@ -2021,7 +2018,7 @@ var hasMarker2 = (type) => {
2021
2018
  return false;
2022
2019
  };
2023
2020
  var isTabsTabElement = (element) => {
2024
- if (!React.isValidElement(element)) {
2021
+ if (!React15.isValidElement(element)) {
2025
2022
  return false;
2026
2023
  }
2027
2024
  return hasMarker2(element.type);
@@ -2113,7 +2110,7 @@ var panelVariantClasses = {
2113
2110
  pill: "mt-3 rounded-2xl border border-gray-200 bg-white/90 p-4 dark:border-gray-700 dark:bg-gray-900/90"
2114
2111
  };
2115
2112
  var isExtraContentObject = (value) => {
2116
- return !!value && typeof value === "object" && !React__namespace.isValidElement(value) && ("left" in value || "right" in value);
2113
+ return !!value && typeof value === "object" && !React15__namespace.isValidElement(value) && ("left" in value || "right" in value);
2117
2114
  };
2118
2115
  var resolveFirstEnabledTab = (tabs) => tabs.find((tab) => !tab.disabled)?.value;
2119
2116
  var clampActive = (value, tabs) => {
@@ -2140,7 +2137,7 @@ var collectTabs = (children, tabsId) => {
2140
2137
  return;
2141
2138
  }
2142
2139
  if (!isTabsTabElement(node)) {
2143
- if (React__namespace.isValidElement(node)) {
2140
+ if (React15__namespace.isValidElement(node)) {
2144
2141
  const props = node.props;
2145
2142
  if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
2146
2143
  walk(props.children);
@@ -2184,7 +2181,7 @@ var injectTabs = (children, context, tabs) => {
2184
2181
  });
2185
2182
  return changed ? next : node;
2186
2183
  }
2187
- if (!React__namespace.isValidElement(node)) {
2184
+ if (!React15__namespace.isValidElement(node)) {
2188
2185
  return node;
2189
2186
  }
2190
2187
  if (isTabsTabElement(node)) {
@@ -2200,14 +2197,14 @@ var injectTabs = (children, context, tabs) => {
2200
2197
  __tabsTabId: tab.tabId,
2201
2198
  __tabsPanelId: tab.panelId
2202
2199
  };
2203
- return React__namespace.cloneElement(node, injectedProps);
2200
+ return React15__namespace.cloneElement(node, injectedProps);
2204
2201
  }
2205
2202
  if (node.props) {
2206
2203
  const props = node.props;
2207
2204
  if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
2208
2205
  const mappedChildren = walk(props.children);
2209
2206
  if (mappedChildren !== props.children) {
2210
- return React__namespace.cloneElement(node, void 0, mappedChildren);
2207
+ return React15__namespace.cloneElement(node, void 0, mappedChildren);
2211
2208
  }
2212
2209
  }
2213
2210
  }
@@ -2241,7 +2238,7 @@ var handleTabListKeyDown = (event) => {
2241
2238
  tabs[nextIndex]?.focus();
2242
2239
  event.preventDefault();
2243
2240
  };
2244
- var Tabs = React__namespace.forwardRef((props, ref) => {
2241
+ var Tabs = React15__namespace.forwardRef((props, ref) => {
2245
2242
  const {
2246
2243
  activeKey,
2247
2244
  defaultActiveKey,
@@ -2362,7 +2359,7 @@ var Tabs = React__namespace.forwardRef((props, ref) => {
2362
2359
  );
2363
2360
  });
2364
2361
  Tabs.displayName = "Tabs";
2365
- var Tab = React__namespace.forwardRef((props, ref) => {
2362
+ var Tab = React15__namespace.forwardRef((props, ref) => {
2366
2363
  const {
2367
2364
  label: _label,
2368
2365
  value,
@@ -2437,7 +2434,7 @@ var AppBar = ({
2437
2434
  children,
2438
2435
  ...rest
2439
2436
  }) => {
2440
- const [mobileOpen, setMobileOpen] = React__namespace.useState(false);
2437
+ const [mobileOpen, setMobileOpen] = React15__namespace.useState(false);
2441
2438
  const isDark = color === "primary" || color === "dark";
2442
2439
  const isTransparent = color === "transparent";
2443
2440
  const barClass = tailwindMerge.twMerge(
@@ -2710,7 +2707,7 @@ var avatarRadiusMap = {
2710
2707
  sharp: "rounded-none"
2711
2708
  };
2712
2709
  var isDarkVariant = (variant) => variant === "filled";
2713
- var SocialIcons = ({ socials, dark }) => {
2710
+ var SocialIcons = ({ socials }) => {
2714
2711
  if (!socials) return null;
2715
2712
  if (Array.isArray(socials) && socials.length === 0) return null;
2716
2713
  const isSocialLinkArray = Array.isArray(socials) && socials.length > 0 && "href" in socials[0];
@@ -2818,14 +2815,14 @@ var ProfileCard = ({
2818
2815
  };
2819
2816
  ProfileCard.displayName = "ProfileCard";
2820
2817
  var ProfileCard_default = ProfileCard;
2821
- var Input = React__namespace.default.forwardRef(
2818
+ var Input = React15__namespace.default.forwardRef(
2822
2819
  ({ variant = "outline", size = "medium", rounded = "md", success, error, warn, className, wrapperClassName, label, prepend, append, ...props }, ref) => {
2823
2820
  const { placeholder, onFocus, onBlur, ...inputProps } = props;
2824
- const reactId = React__namespace.default.useId();
2821
+ const reactId = React15__namespace.default.useId();
2825
2822
  const hasLabel = Boolean(label);
2826
2823
  const hasProvidedPlaceholder = typeof placeholder === "string" && placeholder.trim().length > 0;
2827
2824
  const hidePlaceholderUntilFocus = hasLabel && hasProvidedPlaceholder;
2828
- const [isFocused, setIsFocused] = React__namespace.default.useState(false);
2825
+ const [isFocused, setIsFocused] = React15__namespace.default.useState(false);
2829
2826
  const classBase = "input-base transition-colors duration-200 w-full has-[input:disabled]:opacity-50 has-[input:disabled]:cursor-not-allowed";
2830
2827
  const inputBase = "peer block w-full min-w-0 border-0 bg-transparent p-0 text-gray-900 dark:text-gray-100 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-0";
2831
2828
  const variantClasses5 = {
@@ -2837,7 +2834,7 @@ var Input = React__namespace.default.forwardRef(
2837
2834
  filled: "rounded border border-gray-200 bg-gray-100 focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/25 dark:border-gray-700 dark:bg-slate-800 dark:focus-within:border-primary/60 dark:focus-within:ring-primary/30",
2838
2835
  underlined: "rounded-none border-0 border-b border-gray-300 px-0 bg-transparent focus-within:border-primary focus-within:ring-0 focus-within:ring-transparent dark:border-b-gray-600 dark:focus-within:border-primary/70"
2839
2836
  };
2840
- const roundedClasses3 = {
2837
+ const roundedClasses4 = {
2841
2838
  sm: "rounded-sm",
2842
2839
  md: "rounded-md",
2843
2840
  lg: "rounded-lg",
@@ -2845,7 +2842,7 @@ var Input = React__namespace.default.forwardRef(
2845
2842
  "2xl": "rounded-2xl",
2846
2843
  "3xl": "rounded-3xl"
2847
2844
  };
2848
- const sizeClasses5 = {
2845
+ const sizeClasses6 = {
2849
2846
  "x-small": {
2850
2847
  paddingY: "py-2",
2851
2848
  paddingX: "px-2",
@@ -2873,23 +2870,23 @@ var Input = React__namespace.default.forwardRef(
2873
2870
  }
2874
2871
  };
2875
2872
  const status = error ? { tone: "error", message: error } : warn ? { tone: "warn", message: warn } : success ? { tone: "success", message: success } : void 0;
2876
- const statusClasses = {
2873
+ const statusClasses2 = {
2877
2874
  error: "border-red-500 focus:border-red-500 focus:ring-red-400",
2878
2875
  warn: "border-amber-500 focus:border-amber-500 focus:ring-amber-400",
2879
2876
  success: "border-emerald-500 focus:border-emerald-500 focus:ring-emerald-400"
2880
2877
  };
2881
- const statusMessageClasses = {
2878
+ const statusMessageClasses2 = {
2882
2879
  error: "text-red-600 dark:text-red-300",
2883
2880
  warn: "text-amber-600 dark:text-amber-300",
2884
2881
  success: "text-emerald-600 dark:text-emerald-300"
2885
2882
  };
2886
2883
  const variantClass = variantClasses5[variant] ?? variantClasses5.outline;
2887
- const toneClass = status ? statusClasses[status.tone] : void 0;
2884
+ const toneClass = status ? statusClasses2[status.tone] : void 0;
2888
2885
  const hasPrepend = typeof prepend === "string" ? prepend.trim().length > 0 : Boolean(prepend);
2889
2886
  const hasAppend = typeof append === "string" ? append.trim().length > 0 : Boolean(append);
2890
- const sizeConfig = sizeClasses5[size] ?? sizeClasses5.medium;
2887
+ const sizeConfig = sizeClasses6[size] ?? sizeClasses6.medium;
2891
2888
  const sizeClass = [sizeConfig.paddingY, sizeConfig.paddingX, sizeConfig.text].join(" ");
2892
- const roundedClass = variant === "sharp" || variant === "text" || variant === "underlined" ? "rounded-none" : roundedClasses3[rounded];
2889
+ const roundedClass = variant === "sharp" || variant === "text" || variant === "underlined" ? "rounded-none" : roundedClasses4[rounded];
2893
2890
  const inputName = inputProps.name || reactId;
2894
2891
  const basePlaceholder = placeholder ?? (hasLabel ? " " : void 0);
2895
2892
  const placeholderValue = hidePlaceholderUntilFocus ? isFocused ? placeholder : " " : basePlaceholder;
@@ -2944,481 +2941,546 @@ var Input = React__namespace.default.forwardRef(
2944
2941
  ] }),
2945
2942
  hasAppend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 flex items-center", children: renderAppend })
2946
2943
  ] }),
2947
- status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses[status.tone]), children: status.message })
2944
+ status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses2[status.tone]), children: status.message })
2948
2945
  ] });
2949
2946
  }
2950
2947
  );
2951
2948
  Input.displayName = "Input";
2952
2949
  var Input_default = Input;
2953
-
2954
- // src/utils/helpers/randomStr.ts
2955
- var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
2956
- function generateString(length = 5) {
2957
- let result = "";
2958
- const charactersLength = characters.length;
2959
- for (let i = 0; i < length; i++) {
2960
- result += characters.charAt(Math.floor(Math.random() * charactersLength));
2961
- }
2962
- return result;
2963
- }
2964
- var baseClass = "textarea-base px-3 py-2 focus-visible:outline-none transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed w-full text-gray-900 dark:text-gray-100 placeholder:text-gray-500 dark:placeholder:text-gray-400";
2965
2950
  var variantClasses3 = {
2966
- outlined: "rounded border-2 border-black bg-white focus-visible:border-black focus-visible:ring-2 focus-visible:ring-black/30 dark:border-black dark:bg-slate-900 dark:focus-visible:border-black dark:focus-visible:ring-black/40",
2967
- filled: "rounded border border-gray-200 bg-gray-100 focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/25 dark:border-gray-700 dark:bg-slate-800 dark:focus-visible:border-primary/60 dark:focus-visible:ring-primary/30",
2968
- standard: "rounded-none border-0 border-b border-gray-300 px-0 bg-transparent focus-visible:border-primary focus-visible:ring-0 dark:border-b-gray-700 dark:focus-visible:border-primary/70"
2969
- };
2970
- var labelBackground = {
2971
- outlined: "bg-white/90 dark:bg-slate-900",
2972
- filled: "bg-gray-100 dark:bg-slate-800",
2973
- standard: "bg-transparent"
2974
- };
2975
- var advancedContainerVariant = {
2976
- outlined: "rounded border-2 border-black bg-white dark:border-black dark:bg-slate-900",
2977
- filled: "rounded border border-gray-200 bg-gray-100 dark:border-gray-700 dark:bg-slate-800",
2978
- standard: "border-b border-gray-300 bg-transparent dark:border-gray-700"
2979
- };
2980
- var renderMarkdown = (value) => marked.marked.parse(value || "", { async: false });
2981
- var dispatchInputEvent = (element) => {
2982
- const event = new Event("input", { bubbles: true });
2983
- element.dispatchEvent(event);
2984
- };
2985
- var toolbarButtonBase = "px-3 py-1 text-gray-700 transition-colors hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-slate-700 disabled:cursor-not-allowed disabled:opacity-50";
2986
- var toolbarButtonActive = "bg-white text-gray-900 dark:bg-slate-900 dark:text-gray-100";
2987
- var handleModeToggle = (wrapperId, mode, textareaName, simpleId, advancedInputId) => {
2988
- if (typeof document === "undefined") return;
2989
- const wrapper = document.getElementById(wrapperId);
2990
- const simple = document.getElementById(simpleId);
2991
- const advancedInput = document.getElementById(advancedInputId);
2992
- if (wrapper) {
2993
- wrapper.dataset.mode = mode;
2951
+ solid: "rounded border border-gray-400 bg-white shadow-sm focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 dark:border-gray-600 dark:bg-slate-900 dark:shadow-black/20 dark:focus-within:border-primary/70 dark:focus-within:ring-primary/40",
2952
+ sharp: "rounded-none border border-gray-400 bg-white shadow-sm focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 dark:border-gray-600 dark:bg-slate-900 dark:shadow-black/20 dark:focus-within:border-primary/70 dark:focus-within:ring-primary/40",
2953
+ outline: "rounded border-2 border-black bg-white focus-within:border-black focus-within:ring-2 focus-within:ring-black/30 dark:border-black dark:bg-transparent dark:focus-within:border-black dark:focus-within:ring-black/40",
2954
+ text: "rounded-none border-0 border-b border-transparent px-0 bg-transparent focus-within:border-primary focus-within:ring-0 focus-within:ring-transparent dark:border-b-gray-600 dark:focus-within:border-primary/70",
2955
+ ghost: "rounded border border-transparent bg-gray-50 text-gray-900 focus-within:bg-white focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/15 dark:bg-slate-800 dark:text-gray-100 dark:focus-within:bg-slate-700 dark:focus-within:border-primary/60 dark:focus-within:ring-primary/25",
2956
+ filled: "rounded border border-gray-200 bg-gray-100 focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/25 dark:border-gray-700 dark:bg-slate-800 dark:focus-within:border-primary/60 dark:focus-within:ring-primary/30",
2957
+ underlined: "rounded-none border-0 border-b border-gray-300 px-0 bg-transparent focus-within:border-primary focus-within:ring-0 focus-within:ring-transparent dark:border-b-gray-600 dark:focus-within:border-primary/70"
2958
+ };
2959
+ var roundedClasses3 = {
2960
+ sm: "rounded-sm",
2961
+ md: "rounded-md",
2962
+ lg: "rounded-lg",
2963
+ xl: "rounded-xl",
2964
+ "2xl": "rounded-2xl",
2965
+ "3xl": "rounded-3xl"
2966
+ };
2967
+ var sizeClasses3 = {
2968
+ "x-small": {
2969
+ paddingY: "py-2",
2970
+ paddingX: "px-2",
2971
+ text: "text-xs"
2972
+ },
2973
+ small: {
2974
+ paddingY: "py-2.5",
2975
+ paddingX: "px-2.5",
2976
+ text: "text-sm"
2977
+ },
2978
+ medium: {
2979
+ paddingY: "py-3",
2980
+ paddingX: "px-3",
2981
+ text: "text-base"
2982
+ },
2983
+ large: {
2984
+ paddingY: "py-3.5",
2985
+ paddingX: "px-3.5",
2986
+ text: "text-lg"
2987
+ },
2988
+ "x-large": {
2989
+ paddingY: "py-4",
2990
+ paddingX: "px-4",
2991
+ text: "text-xl"
2994
2992
  }
2995
- if (simple) {
2996
- simple.classList.toggle("hidden", mode !== "simple");
2997
- simple.name = mode === "simple" ? textareaName : "";
2993
+ };
2994
+ var statusClasses = {
2995
+ error: "border-red-500 focus:border-red-500 focus:ring-red-400",
2996
+ warn: "border-amber-500 focus:border-amber-500 focus:ring-amber-400",
2997
+ success: "border-emerald-500 focus:border-emerald-500 focus:ring-emerald-400"
2998
+ };
2999
+ var statusMessageClasses = {
3000
+ error: "text-red-600 dark:text-red-300",
3001
+ warn: "text-amber-600 dark:text-amber-300",
3002
+ success: "text-emerald-600 dark:text-emerald-300"
3003
+ };
3004
+ var DEFAULT_TOOLBAR = ["bold", "italic", "underline", "strike", "heading", "bulletList", "orderedList", "blockquote", "codeBlock"];
3005
+ var CODE_BLOCK_LANGUAGES = ["ts", "json", "python", "bash"];
3006
+ var DEFAULT_CODE_BLOCK_LANGUAGE = CODE_BLOCK_LANGUAGES[0];
3007
+ var TEXTAREA_TAB_CHARACTER = " ";
3008
+ var lowlight = lowlight$1.createLowlight(lowlight$1.common);
3009
+ lowlight.registerAlias({ ts: "typescript" });
3010
+ var turndown = new TurndownService__default.default({
3011
+ codeBlockStyle: "fenced",
3012
+ headingStyle: "atx",
3013
+ bulletListMarker: "-"
3014
+ });
3015
+ var markdownToHtml = (markdown) => {
3016
+ if (!markdown) {
3017
+ return "<p></p>";
2998
3018
  }
2999
- if (advancedInput) {
3000
- advancedInput.classList.toggle("hidden", mode !== "advanced");
3001
- advancedInput.name = mode === "advanced" ? textareaName : "";
3019
+ return marked.marked.parse(markdown);
3020
+ };
3021
+ var htmlToMarkdown = (html) => turndown.turndown(html).trim();
3022
+ var createChangeEvent = (element) => ({
3023
+ target: element,
3024
+ currentTarget: element
3025
+ });
3026
+ var assignRef = (ref, value) => {
3027
+ if (typeof ref === "function") {
3028
+ ref(value);
3029
+ return;
3030
+ }
3031
+ if (ref) {
3032
+ ref.current = value;
3002
3033
  }
3003
3034
  };
3004
- var TextArea = ({
3005
- variant = "outlined",
3006
- label,
3007
- className,
3008
- wrapperClassName,
3009
- id,
3010
- name,
3011
- placeholder,
3012
- rows = 4,
3013
- allowModeSwitch = true,
3014
- mode,
3015
- view = "editor",
3016
- value,
3017
- defaultValue,
3018
- disabled,
3019
- readOnly,
3020
- onChange,
3021
- onInput,
3022
- ...props
3023
- }) => {
3024
- const textareaId = id || name || generateString();
3025
- const textareaName = name || textareaId;
3026
- const wrapperId = `${textareaId}-wrapper`;
3027
- const simpleTextareaId = `${textareaId}-simple`;
3028
- const advancedInputId = `${textareaId}-advanced-input`;
3029
- const advancedEditorId = `${textareaId}-advanced-editor`;
3030
- const advancedLabelId = `${textareaId}-advanced-label`;
3031
- const previewId = `${textareaId}-preview`;
3032
- const variantClass = variantClasses3[variant] ?? variantClasses3.outlined;
3033
- const labelPadding = label ? "pt-6" : void 0;
3034
- const placeholderValue = placeholder ?? (label ? " " : void 0);
3035
- const placeholderClass = label ? "placeholder-transparent" : void 0;
3036
- const labelBg = labelBackground[variant] ?? labelBackground.outlined;
3037
- const focusLabelBg = variant === "filled" ? "peer-focus:bg-gray-100 dark:peer-focus:bg-slate-800" : variant === "standard" ? "peer-focus:bg-transparent" : "peer-focus:bg-white/90 dark:peer-focus:bg-slate-900";
3038
- const resolvedMode = allowModeSwitch ? mode ?? "simple" : "simple";
3039
- const resolvedView = view ?? "editor";
3040
- const showEditor = resolvedView === "editor";
3041
- const showPreview = resolvedView === "view";
3042
- const contentValue = typeof value === "string" ? value : typeof defaultValue === "string" ? defaultValue : "";
3043
- const isControlled = typeof value === "string";
3044
- const editorEditable = !(disabled || readOnly);
3045
- const modeToggleName = `${textareaId}-mode-toggle`;
3046
- const simpleToggleId = `${modeToggleName}-simple`;
3047
- const advancedToggleId = `${modeToggleName}-advanced`;
3048
- const turndownService = React__namespace.default.useMemo(() => {
3049
- const service = new TurndownService__default.default({
3050
- codeBlockStyle: "fenced",
3051
- emDelimiter: "*",
3052
- strongDelimiter: "**",
3053
- bulletListMarker: "-"
3054
- });
3055
- service.addRule("strikethrough", {
3056
- filter: (node) => ["DEL", "S", "STRIKE"].includes(node.nodeName),
3057
- replacement: (content) => `~~${content}~~`
3058
- });
3059
- return service;
3060
- }, []);
3061
- const hiddenTextareaRef = React__namespace.default.useRef(null);
3062
- const lastMarkdownRef = React__namespace.default.useRef(contentValue);
3063
- const editorContentClass = tailwindMerge.twMerge(
3064
- baseClass,
3065
- "min-h-45 rounded border-0 bg-transparent outline-none whitespace-pre-wrap wrap-break-words",
3066
- "[&_p]:m-0 [&_p]:leading-6",
3067
- "[&_ul]:my-0 [&_ul]:list-disc [&_ul]:pl-5",
3068
- "[&_ol]:my-0 [&_ol]:list-decimal [&_ol]:pl-5",
3069
- "[&_li]:my-0",
3070
- "[&_blockquote]:border-l-2 [&_blockquote]:border-gray-300 [&_blockquote]:pl-3 [&_blockquote]:text-gray-600",
3071
- "dark:[&_blockquote]:border-gray-600 dark:[&_blockquote]:text-gray-300",
3072
- "[&_pre]:bg-gray-100 [&_pre]:rounded [&_pre]:p-3 [&_pre]:text-sm [&_pre]:overflow-x-auto",
3073
- "dark:[&_pre]:bg-slate-800",
3074
- "[&_code]:font-mono",
3075
- className,
3076
- !editorEditable ? "cursor-not-allowed opacity-50" : void 0
3077
- );
3078
- const editor = react.useEditor({
3079
- extensions: [StarterKit__default.default],
3080
- content: renderMarkdown(contentValue),
3081
- immediatelyRender: false,
3082
- editable: editorEditable,
3083
- editorProps: {
3084
- attributes: {
3085
- class: editorContentClass,
3086
- role: "textbox",
3087
- "aria-multiline": "true",
3088
- ...label ? { "aria-labelledby": advancedLabelId } : {}
3089
- }
3090
- },
3091
- onUpdate: ({ editor: currentEditor }) => {
3092
- const markdown = turndownService.turndown(currentEditor.getHTML());
3093
- if (markdown === lastMarkdownRef.current) return;
3094
- lastMarkdownRef.current = markdown;
3095
- if (!hiddenTextareaRef.current) return;
3096
- hiddenTextareaRef.current.value = markdown;
3097
- dispatchInputEvent(hiddenTextareaRef.current);
3098
- }
3099
- });
3100
- React__namespace.default.useEffect(() => {
3101
- if (!editor) return;
3102
- editor.setEditable(editorEditable);
3103
- }, [editor, editorEditable]);
3104
- React__namespace.default.useEffect(() => {
3105
- if (!editor) return;
3106
- editor.setOptions({
3035
+ var updateTextareaValue = (element, nextValue, selectionStart, selectionEnd) => {
3036
+ element.value = nextValue;
3037
+ element.setSelectionRange(selectionStart, selectionEnd);
3038
+ };
3039
+ var indentSelectedLines = (value, selectionStart, selectionEnd) => {
3040
+ const lineStart = value.lastIndexOf("\n", Math.max(0, selectionStart - 1)) + 1;
3041
+ const lineEndIndex = value.indexOf("\n", selectionEnd);
3042
+ const lineEnd = lineEndIndex === -1 ? value.length : lineEndIndex;
3043
+ const selectedBlock = value.slice(lineStart, lineEnd);
3044
+ const lines = selectedBlock.split("\n");
3045
+ const indentedBlock = lines.map((line) => `${TEXTAREA_TAB_CHARACTER}${line}`).join("\n");
3046
+ return {
3047
+ nextValue: `${value.slice(0, lineStart)}${indentedBlock}${value.slice(lineEnd)}`,
3048
+ selectionStart: selectionStart + TEXTAREA_TAB_CHARACTER.length,
3049
+ selectionEnd: selectionEnd + lines.length * TEXTAREA_TAB_CHARACTER.length
3050
+ };
3051
+ };
3052
+ var outdentSelectedLines = (value, selectionStart, selectionEnd) => {
3053
+ const lineStart = value.lastIndexOf("\n", Math.max(0, selectionStart - 1)) + 1;
3054
+ const lineEndIndex = value.indexOf("\n", selectionEnd);
3055
+ const lineEnd = lineEndIndex === -1 ? value.length : lineEndIndex;
3056
+ const selectedBlock = value.slice(lineStart, lineEnd);
3057
+ const lines = selectedBlock.split("\n");
3058
+ const updatedLines = lines.map((line) => line.startsWith(TEXTAREA_TAB_CHARACTER) ? line.slice(TEXTAREA_TAB_CHARACTER.length) : line);
3059
+ const removedBeforeSelectionStart = selectionStart === lineStart && !lines[0].startsWith(TEXTAREA_TAB_CHARACTER) ? 0 : lines[0].startsWith(TEXTAREA_TAB_CHARACTER) ? TEXTAREA_TAB_CHARACTER.length : 0;
3060
+ const removedTotal = lines.reduce((count, line) => count + (line.startsWith(TEXTAREA_TAB_CHARACTER) ? TEXTAREA_TAB_CHARACTER.length : 0), 0);
3061
+ return {
3062
+ nextValue: `${value.slice(0, lineStart)}${updatedLines.join("\n")}${value.slice(lineEnd)}`,
3063
+ selectionStart: Math.max(lineStart, selectionStart - removedBeforeSelectionStart),
3064
+ selectionEnd: Math.max(lineStart, selectionEnd - removedTotal)
3065
+ };
3066
+ };
3067
+ var isCodeBlockLanguage = (value) => CODE_BLOCK_LANGUAGES.includes(value);
3068
+ var ToolbarButton = ({ label, active, disabled, onMouseDown }) => /* @__PURE__ */ jsxRuntime.jsx(
3069
+ "button",
3070
+ {
3071
+ type: "button",
3072
+ disabled,
3073
+ onMouseDown,
3074
+ className: tailwindMerge.twMerge(
3075
+ "inline-flex min-w-8 items-center justify-center rounded border px-2 py-1 text-xs font-medium transition-colors",
3076
+ active ? "border-primary bg-primary text-white" : "border-gray-300 bg-white text-gray-700 hover:border-gray-400 hover:bg-gray-50 dark:border-slate-600 dark:bg-slate-900 dark:text-gray-200 dark:hover:bg-slate-800",
3077
+ disabled && "cursor-not-allowed opacity-50"
3078
+ ),
3079
+ children: label
3080
+ }
3081
+ );
3082
+ var TextArea = React15__namespace.default.forwardRef(
3083
+ ({ variant = "outline", size = "medium", rounded = "md", success, error, warn, className, wrapperClassName, label, prepend, append, rows = 4, richText = false, toolbar = DEFAULT_TOOLBAR, ...props }, ref) => {
3084
+ const { placeholder, onFocus, onBlur, onChange, onKeyDown, value, defaultValue, disabled, readOnly, ...textareaProps } = props;
3085
+ const reactId = React15__namespace.default.useId();
3086
+ const hasLabel = Boolean(label);
3087
+ const hasProvidedPlaceholder = typeof placeholder === "string" && placeholder.trim().length > 0;
3088
+ const hidePlaceholderUntilFocus = hasLabel && hasProvidedPlaceholder;
3089
+ const [isFocused, setIsFocused] = React15__namespace.default.useState(false);
3090
+ const classBase = "textarea-base transition-colors duration-200 w-full has-[textarea:disabled]:opacity-50 has-[textarea:disabled]:cursor-not-allowed";
3091
+ const textareaBase = "peer block w-full min-w-0 resize-y border-0 bg-transparent p-0 text-gray-900 dark:text-gray-100 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-0";
3092
+ const proseBase = "ProseMirror min-h-[7rem] w-full border-0 bg-transparent p-0 text-gray-900 dark:text-gray-100 focus:outline-none [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-3 [&_blockquote]:italic dark:[&_blockquote]:border-slate-600 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:bg-black [&_:not(pre)>code]:px-1 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:text-white dark:[&_:not(pre)>code]:bg-black dark:[&_:not(pre)>code]:text-white [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:bg-black [&_pre]:p-3 [&_pre]:text-white [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-white [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_h1]:text-2xl [&_h1]:font-semibold [&_h2]:text-xl [&_h2]:font-semibold";
3093
+ const hiddenTextareaRef = React15__namespace.default.useRef(null);
3094
+ const forwardedRef = React15__namespace.default.useRef(null);
3095
+ const isControlled = value !== void 0;
3096
+ const markdownValue = typeof value === "string" ? value : typeof defaultValue === "string" ? defaultValue : "";
3097
+ const [internalMarkdown, setInternalMarkdown] = React15__namespace.default.useState(markdownValue);
3098
+ const resolvedMarkdownValue = isControlled ? typeof value === "string" ? value : "" : internalMarkdown;
3099
+ const status = error ? { tone: "error", message: error } : warn ? { tone: "warn", message: warn } : success ? { tone: "success", message: success } : void 0;
3100
+ const variantClass = variantClasses3[variant] ?? variantClasses3.outline;
3101
+ const toneClass = status ? statusClasses[status.tone] : void 0;
3102
+ const hasPrepend = typeof prepend === "string" ? prepend.trim().length > 0 : Boolean(prepend);
3103
+ const hasAppend = typeof append === "string" ? append.trim().length > 0 : Boolean(append);
3104
+ const sizeConfig = sizeClasses3[size] ?? sizeClasses3.medium;
3105
+ const sizeClass = [sizeConfig.paddingY, sizeConfig.paddingX, sizeConfig.text].join(" ");
3106
+ const roundedClass = variant === "sharp" || variant === "text" || variant === "underlined" ? "rounded-none" : roundedClasses3[rounded];
3107
+ const inputName = textareaProps.name || reactId;
3108
+ const basePlaceholder = placeholder ?? (hasLabel ? " " : void 0);
3109
+ const placeholderValue = hidePlaceholderUntilFocus ? isFocused ? placeholder : " " : basePlaceholder;
3110
+ const placeholderClass = hidePlaceholderUntilFocus ? "placeholder-transparent focus:placeholder-gray-500 focus:dark:placeholder-gray-400" : void 0;
3111
+ const editor = react.useEditor({
3112
+ extensions: [
3113
+ StarterKit__default.default.configure({ heading: { levels: [1, 2] }, codeBlock: false }),
3114
+ CodeBlockLowlight__default.default.configure({
3115
+ defaultLanguage: DEFAULT_CODE_BLOCK_LANGUAGE,
3116
+ enableTabIndentation: true,
3117
+ lowlight,
3118
+ HTMLAttributes: {
3119
+ class: "hljs"
3120
+ }
3121
+ }),
3122
+ Underline__default.default
3123
+ ],
3124
+ content: markdownToHtml(resolvedMarkdownValue),
3125
+ editable: richText && !disabled && !readOnly,
3126
+ immediatelyRender: false,
3107
3127
  editorProps: {
3108
- ...editor.options.editorProps,
3109
3128
  attributes: {
3110
- ...editor.options.editorProps?.attributes,
3111
- class: editorContentClass,
3112
- role: "textbox",
3113
- "aria-multiline": "true",
3114
- ...label ? { "aria-labelledby": advancedLabelId } : {}
3129
+ class: tailwindMerge.twMerge(proseBase, placeholderClass),
3130
+ "data-placeholder": placeholderValue ?? ""
3131
+ }
3132
+ },
3133
+ onFocus: () => {
3134
+ if (!richText) {
3135
+ return;
3136
+ }
3137
+ if (hidePlaceholderUntilFocus) {
3138
+ setIsFocused(true);
3139
+ }
3140
+ const target = hiddenTextareaRef.current;
3141
+ if (target) {
3142
+ onFocus?.(createChangeEvent(target));
3143
+ }
3144
+ },
3145
+ onBlur: () => {
3146
+ if (!richText) {
3147
+ return;
3148
+ }
3149
+ if (hidePlaceholderUntilFocus) {
3150
+ setIsFocused(false);
3151
+ }
3152
+ const target = hiddenTextareaRef.current;
3153
+ if (target) {
3154
+ onBlur?.(createChangeEvent(target));
3115
3155
  }
3156
+ },
3157
+ onUpdate: ({ editor: currentEditor }) => {
3158
+ if (!richText) {
3159
+ return;
3160
+ }
3161
+ const nextMarkdown = htmlToMarkdown(currentEditor.getHTML());
3162
+ const target = hiddenTextareaRef.current;
3163
+ setInternalMarkdown(nextMarkdown);
3164
+ if (!target) {
3165
+ return;
3166
+ }
3167
+ target.value = nextMarkdown;
3168
+ onChange?.(createChangeEvent(target));
3116
3169
  }
3117
3170
  });
3118
- }, [editor, editorContentClass, label, advancedLabelId]);
3119
- React__namespace.default.useEffect(() => {
3120
- if (!editor || typeof value !== "string") return;
3121
- if (value === lastMarkdownRef.current) return;
3122
- editor.commands.setContent(renderMarkdown(value), { emitUpdate: false });
3123
- lastMarkdownRef.current = value;
3124
- if (hiddenTextareaRef.current) {
3125
- hiddenTextareaRef.current.value = value;
3126
- }
3127
- }, [editor, value]);
3128
- React__namespace.default.useEffect(() => {
3129
- if (!hiddenTextareaRef.current) return;
3130
- if (hiddenTextareaRef.current.value === contentValue) return;
3131
- hiddenTextareaRef.current.value = contentValue;
3132
- }, [contentValue]);
3133
- const textareaProps = {
3134
- ...props,
3135
- onChange,
3136
- onInput,
3137
- disabled,
3138
- readOnly
3139
- };
3140
- const minHeightStyle = rows ? { minHeight: `${rows * 20}px` } : void 0;
3141
- return /* @__PURE__ */ jsxRuntime.jsxs(
3142
- "div",
3143
- {
3144
- id: wrapperId,
3145
- "data-mode": resolvedMode,
3146
- className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName),
3147
- children: [
3148
- allowModeSwitch && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3149
- /* @__PURE__ */ jsxRuntime.jsx(
3150
- "input",
3151
- {
3152
- type: "radio",
3153
- name: modeToggleName,
3154
- id: simpleToggleId,
3155
- value: "simple",
3156
- defaultChecked: resolvedMode === "simple",
3157
- className: "peer/simple sr-only",
3158
- onChange: () => handleModeToggle(wrapperId, "simple", textareaName, simpleTextareaId, advancedInputId)
3159
- }
3160
- ),
3161
- /* @__PURE__ */ jsxRuntime.jsx(
3162
- "input",
3163
- {
3164
- type: "radio",
3165
- name: modeToggleName,
3166
- id: advancedToggleId,
3167
- value: "advanced",
3168
- defaultChecked: resolvedMode === "advanced",
3169
- className: "peer/advanced sr-only",
3170
- onChange: () => handleModeToggle(
3171
- wrapperId,
3172
- "advanced",
3173
- textareaName,
3174
- simpleTextareaId,
3175
- advancedInputId
3176
- )
3177
- }
3178
- ),
3179
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex overflow-hidden rounded-md border border-gray-200 bg-gray-50 text-xs font-medium dark:border-gray-700 dark:bg-slate-800", children: [
3180
- /* @__PURE__ */ jsxRuntime.jsx(
3181
- "label",
3182
- {
3183
- htmlFor: simpleToggleId,
3184
- className: tailwindMerge.twMerge(
3185
- "cursor-pointer px-3 py-1 transition-colors",
3186
- "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-slate-700",
3187
- "peer-checked/simple:bg-white peer-checked/simple:text-gray-900 peer-checked/simple:dark:bg-slate-900 peer-checked/simple:dark:text-gray-100"
3188
- ),
3189
- children: "Jednoduch\xFD"
3190
- }
3191
- ),
3171
+ const activeCodeBlockLanguage = (() => {
3172
+ const language = editor?.getAttributes("codeBlock").language;
3173
+ if (typeof language === "string" && isCodeBlockLanguage(language)) {
3174
+ return language;
3175
+ }
3176
+ return DEFAULT_CODE_BLOCK_LANGUAGE;
3177
+ })();
3178
+ React15__namespace.default.useEffect(() => {
3179
+ if (!richText) {
3180
+ return;
3181
+ }
3182
+ const target = hiddenTextareaRef.current;
3183
+ if (!target) {
3184
+ return;
3185
+ }
3186
+ target.value = resolvedMarkdownValue;
3187
+ forwardedRef.current = target;
3188
+ assignRef(ref, target);
3189
+ }, [ref, resolvedMarkdownValue, richText]);
3190
+ React15__namespace.default.useEffect(() => {
3191
+ if (!editor || !richText || !isControlled) {
3192
+ return;
3193
+ }
3194
+ const nextMarkdown = typeof value === "string" ? value : "";
3195
+ const currentMarkdown = htmlToMarkdown(editor.getHTML());
3196
+ if (currentMarkdown === nextMarkdown) {
3197
+ return;
3198
+ }
3199
+ editor.commands.setContent(markdownToHtml(nextMarkdown), { emitUpdate: false });
3200
+ }, [editor, isControlled, richText, value]);
3201
+ React15__namespace.default.useEffect(() => {
3202
+ if (!isControlled) {
3203
+ setInternalMarkdown(typeof defaultValue === "string" ? defaultValue : "");
3204
+ }
3205
+ }, [defaultValue, isControlled]);
3206
+ React15__namespace.default.useEffect(() => {
3207
+ if (!editor || !richText) {
3208
+ return;
3209
+ }
3210
+ editor.setEditable(!disabled && !readOnly);
3211
+ }, [disabled, editor, readOnly, richText]);
3212
+ const renderPrepend = hasPrepend ? typeof prepend === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-gray-500 dark:text-gray-400", sizeConfig.text), children: prepend }) : prepend : null;
3213
+ const renderAppend = hasAppend ? typeof append === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-gray-500 dark:text-gray-400", sizeConfig.text), children: append }) : append : null;
3214
+ const handleFocus = (event) => {
3215
+ if (hidePlaceholderUntilFocus) setIsFocused(true);
3216
+ onFocus?.(event);
3217
+ };
3218
+ const handleBlur = (event) => {
3219
+ if (hidePlaceholderUntilFocus) setIsFocused(false);
3220
+ onBlur?.(event);
3221
+ };
3222
+ const handleKeyDown = (event) => {
3223
+ onKeyDown?.(event);
3224
+ if (event.defaultPrevented || event.key !== "Tab" || disabled || readOnly) {
3225
+ return;
3226
+ }
3227
+ const target = event.currentTarget;
3228
+ const { selectionStart, selectionEnd, value: currentValue } = target;
3229
+ event.preventDefault();
3230
+ if (selectionStart !== selectionEnd && currentValue.slice(selectionStart, selectionEnd).includes("\n")) {
3231
+ const nextState = event.shiftKey ? outdentSelectedLines(currentValue, selectionStart, selectionEnd) : indentSelectedLines(currentValue, selectionStart, selectionEnd);
3232
+ updateTextareaValue(target, nextState.nextValue, nextState.selectionStart, nextState.selectionEnd);
3233
+ onChange?.(createChangeEvent(target));
3234
+ return;
3235
+ }
3236
+ if (event.shiftKey) {
3237
+ const lineStart = currentValue.lastIndexOf("\n", Math.max(0, selectionStart - 1)) + 1;
3238
+ if (currentValue.slice(lineStart, selectionStart).endsWith(TEXTAREA_TAB_CHARACTER)) {
3239
+ const nextValue2 = `${currentValue.slice(0, selectionStart - TEXTAREA_TAB_CHARACTER.length)}${currentValue.slice(selectionEnd)}`;
3240
+ const nextPosition2 = selectionStart - TEXTAREA_TAB_CHARACTER.length;
3241
+ updateTextareaValue(target, nextValue2, nextPosition2, nextPosition2);
3242
+ onChange?.(createChangeEvent(target));
3243
+ }
3244
+ return;
3245
+ }
3246
+ const nextValue = `${currentValue.slice(0, selectionStart)}${TEXTAREA_TAB_CHARACTER}${currentValue.slice(selectionEnd)}`;
3247
+ const nextPosition = selectionStart + TEXTAREA_TAB_CHARACTER.length;
3248
+ updateTextareaValue(target, nextValue, nextPosition, nextPosition);
3249
+ onChange?.(createChangeEvent(target));
3250
+ };
3251
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: [
3252
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex w-full items-start gap-2", classBase, variantClass, roundedClass, toneClass, sizeClass, className), children: [
3253
+ hasPrepend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start pt-0.5", children: renderPrepend }),
3254
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-w-0 flex-1", children: [
3255
+ richText ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3192
3256
  /* @__PURE__ */ jsxRuntime.jsx(
3193
- "label",
3257
+ "textarea",
3194
3258
  {
3195
- htmlFor: advancedToggleId,
3196
- className: tailwindMerge.twMerge(
3197
- "cursor-pointer px-3 py-1 transition-colors",
3198
- "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-slate-700",
3199
- "peer-checked/advanced:bg-white peer-checked/advanced:text-gray-900 peer-checked/advanced:dark:bg-slate-900 peer-checked/advanced:dark:text-gray-100"
3200
- ),
3201
- children: "Pokro\u010Dil\xFD"
3259
+ ...textareaProps,
3260
+ ref: (node) => {
3261
+ hiddenTextareaRef.current = node;
3262
+ forwardedRef.current = node;
3263
+ if (node) {
3264
+ assignRef(ref, node);
3265
+ }
3266
+ },
3267
+ id: inputName,
3268
+ name: inputName,
3269
+ rows,
3270
+ value: isControlled ? value : void 0,
3271
+ defaultValue: !isControlled ? defaultValue : void 0,
3272
+ disabled,
3273
+ readOnly: true,
3274
+ tabIndex: -1,
3275
+ "aria-hidden": true,
3276
+ className: "sr-only"
3202
3277
  }
3203
- )
3204
- ] }) })
3205
- ] }),
3206
- (resolvedMode === "simple" || allowModeSwitch) && /* @__PURE__ */ jsxRuntime.jsxs(
3207
- "div",
3208
- {
3209
- className: tailwindMerge.twMerge(
3210
- "relative flex items-start",
3211
- allowModeSwitch ? "hidden peer-checked/simple:flex peer-checked/advanced:hidden" : void 0
3212
3278
  ),
3213
- children: [
3214
- /* @__PURE__ */ jsxRuntime.jsx(
3215
- "textarea",
3279
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-1 border-b border-gray-200 pb-2 dark:border-slate-700", children: [
3280
+ toolbar.includes("bold") && /* @__PURE__ */ jsxRuntime.jsx(
3281
+ ToolbarButton,
3216
3282
  {
3217
- ...textareaProps,
3218
- id: simpleTextareaId,
3219
- name: !allowModeSwitch || resolvedMode === "simple" ? textareaName : "",
3220
- rows,
3221
- placeholder: placeholderValue,
3222
- value,
3223
- defaultValue,
3224
- className: tailwindMerge.twMerge(
3225
- "peer",
3226
- baseClass,
3227
- variantClass,
3228
- labelPadding,
3229
- placeholderClass,
3230
- className
3231
- )
3283
+ label: "B",
3284
+ disabled: !editor?.isEditable,
3285
+ active: editor?.isActive("bold"),
3286
+ onMouseDown: (event) => {
3287
+ event.preventDefault();
3288
+ editor?.chain().focus().toggleBold().run();
3289
+ }
3232
3290
  }
3233
3291
  ),
3234
- label && /* @__PURE__ */ jsxRuntime.jsx(
3235
- "label",
3292
+ toolbar.includes("italic") && /* @__PURE__ */ jsxRuntime.jsx(
3293
+ ToolbarButton,
3236
3294
  {
3237
- htmlFor: simpleTextareaId,
3238
- className: tailwindMerge.twMerge(
3239
- "absolute transition-all duration-150 pointer-events-none left-3 text-gray-700 dark:text-gray-200",
3240
- "top-0 -translate-y-2/3 text-xs px-1",
3241
- labelBg,
3242
- focusLabelBg,
3243
- "peer-focus:top-0 peer-focus:-translate-y-1/2 peer-focus:text-xs peer-focus:px-1 peer-focus:text-gray-600 dark:peer-focus:text-gray-300",
3244
- "peer-placeholder-shown:top-3 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:text-sm peer-placeholder-shown:bg-transparent peer-placeholder-shown:text-gray-500 dark:peer-placeholder-shown:text-gray-400"
3245
- ),
3246
- children: label
3295
+ label: "I",
3296
+ disabled: !editor?.isEditable,
3297
+ active: editor?.isActive("italic"),
3298
+ onMouseDown: (event) => {
3299
+ event.preventDefault();
3300
+ editor?.chain().focus().toggleItalic().run();
3301
+ }
3247
3302
  }
3248
- )
3249
- ]
3250
- }
3251
- ),
3252
- (resolvedMode === "advanced" || allowModeSwitch) && /* @__PURE__ */ jsxRuntime.jsxs(
3253
- "div",
3254
- {
3255
- className: tailwindMerge.twMerge(
3256
- "flex flex-col gap-2",
3257
- allowModeSwitch ? "hidden peer-checked/advanced:flex peer-checked/simple:hidden" : void 0
3258
- ),
3259
- children: [
3260
- label && /* @__PURE__ */ jsxRuntime.jsx(
3261
- "label",
3303
+ ),
3304
+ toolbar.includes("underline") && /* @__PURE__ */ jsxRuntime.jsx(
3305
+ ToolbarButton,
3262
3306
  {
3263
- id: advancedLabelId,
3264
- className: "text-sm font-medium text-gray-700 dark:text-gray-200",
3265
- children: label
3307
+ label: "U",
3308
+ disabled: !editor?.isEditable,
3309
+ active: editor?.isActive("underline"),
3310
+ onMouseDown: (event) => {
3311
+ event.preventDefault();
3312
+ editor?.chain().focus().toggleUnderline().run();
3313
+ }
3266
3314
  }
3267
3315
  ),
3268
- showEditor && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex overflow-hidden rounded-md border border-gray-200 bg-gray-50 text-xs font-medium dark:border-gray-700 dark:bg-slate-800", children: [
3269
- /* @__PURE__ */ jsxRuntime.jsx(
3270
- "button",
3271
- {
3272
- type: "button",
3273
- className: tailwindMerge.twMerge(
3274
- toolbarButtonBase,
3275
- editor?.isActive("bold") ? toolbarButtonActive : void 0
3276
- ),
3277
- onClick: () => editor?.chain().focus().toggleBold().run(),
3278
- disabled: !editor || !editorEditable,
3279
- children: "B"
3316
+ toolbar.includes("strike") && /* @__PURE__ */ jsxRuntime.jsx(
3317
+ ToolbarButton,
3318
+ {
3319
+ label: "S",
3320
+ disabled: !editor?.isEditable,
3321
+ active: editor?.isActive("strike"),
3322
+ onMouseDown: (event) => {
3323
+ event.preventDefault();
3324
+ editor?.chain().focus().toggleStrike().run();
3280
3325
  }
3281
- ),
3326
+ }
3327
+ ),
3328
+ toolbar.includes("heading") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3282
3329
  /* @__PURE__ */ jsxRuntime.jsx(
3283
- "button",
3330
+ ToolbarButton,
3284
3331
  {
3285
- type: "button",
3286
- className: tailwindMerge.twMerge(
3287
- toolbarButtonBase,
3288
- editor?.isActive("italic") ? toolbarButtonActive : void 0
3289
- ),
3290
- onClick: () => editor?.chain().focus().toggleItalic().run(),
3291
- disabled: !editor || !editorEditable,
3292
- children: "I"
3293
- }
3294
- ),
3295
- /* @__PURE__ */ jsxRuntime.jsx(
3296
- "button",
3297
- {
3298
- type: "button",
3299
- className: tailwindMerge.twMerge(
3300
- toolbarButtonBase,
3301
- editor?.isActive("strike") ? toolbarButtonActive : void 0
3302
- ),
3303
- onClick: () => editor?.chain().focus().toggleStrike().run(),
3304
- disabled: !editor || !editorEditable,
3305
- children: "S"
3332
+ label: "H1",
3333
+ disabled: !editor?.isEditable,
3334
+ active: editor?.isActive("heading", { level: 1 }),
3335
+ onMouseDown: (event) => {
3336
+ event.preventDefault();
3337
+ editor?.chain().focus().toggleHeading({ level: 1 }).run();
3338
+ }
3306
3339
  }
3307
3340
  ),
3308
3341
  /* @__PURE__ */ jsxRuntime.jsx(
3309
- "button",
3342
+ ToolbarButton,
3310
3343
  {
3311
- type: "button",
3312
- className: tailwindMerge.twMerge(
3313
- toolbarButtonBase,
3314
- editor?.isActive("bulletList") ? toolbarButtonActive : void 0
3315
- ),
3316
- onClick: () => editor?.chain().focus().toggleBulletList().run(),
3317
- disabled: !editor || !editorEditable,
3318
- children: "\u2022 List"
3344
+ label: "H2",
3345
+ disabled: !editor?.isEditable,
3346
+ active: editor?.isActive("heading", { level: 2 }),
3347
+ onMouseDown: (event) => {
3348
+ event.preventDefault();
3349
+ editor?.chain().focus().toggleHeading({ level: 2 }).run();
3350
+ }
3319
3351
  }
3320
- ),
3321
- /* @__PURE__ */ jsxRuntime.jsx(
3322
- "button",
3323
- {
3324
- type: "button",
3325
- className: tailwindMerge.twMerge(
3326
- toolbarButtonBase,
3327
- editor?.isActive("orderedList") ? toolbarButtonActive : void 0
3328
- ),
3329
- onClick: () => editor?.chain().focus().toggleOrderedList().run(),
3330
- disabled: !editor || !editorEditable,
3331
- children: "1. List"
3352
+ )
3353
+ ] }),
3354
+ toolbar.includes("bulletList") && /* @__PURE__ */ jsxRuntime.jsx(
3355
+ ToolbarButton,
3356
+ {
3357
+ label: "List",
3358
+ disabled: !editor?.isEditable,
3359
+ active: editor?.isActive("bulletList"),
3360
+ onMouseDown: (event) => {
3361
+ event.preventDefault();
3362
+ editor?.chain().focus().toggleBulletList().run();
3332
3363
  }
3333
- ),
3334
- /* @__PURE__ */ jsxRuntime.jsx(
3335
- "button",
3336
- {
3337
- type: "button",
3338
- className: tailwindMerge.twMerge(
3339
- toolbarButtonBase,
3340
- editor?.isActive("blockquote") ? toolbarButtonActive : void 0
3341
- ),
3342
- onClick: () => editor?.chain().focus().toggleBlockquote().run(),
3343
- disabled: !editor || !editorEditable,
3344
- children: "Quote"
3364
+ }
3365
+ ),
3366
+ toolbar.includes("orderedList") && /* @__PURE__ */ jsxRuntime.jsx(
3367
+ ToolbarButton,
3368
+ {
3369
+ label: "1.",
3370
+ disabled: !editor?.isEditable,
3371
+ active: editor?.isActive("orderedList"),
3372
+ onMouseDown: (event) => {
3373
+ event.preventDefault();
3374
+ editor?.chain().focus().toggleOrderedList().run();
3345
3375
  }
3346
- ),
3347
- /* @__PURE__ */ jsxRuntime.jsx(
3348
- "button",
3349
- {
3350
- type: "button",
3351
- className: tailwindMerge.twMerge(
3352
- toolbarButtonBase,
3353
- editor?.isActive("code") ? toolbarButtonActive : void 0
3354
- ),
3355
- onClick: () => editor?.chain().focus().toggleCode().run(),
3356
- disabled: !editor || !editorEditable,
3357
- children: "Code"
3376
+ }
3377
+ ),
3378
+ toolbar.includes("blockquote") && /* @__PURE__ */ jsxRuntime.jsx(
3379
+ ToolbarButton,
3380
+ {
3381
+ label: "Quote",
3382
+ disabled: !editor?.isEditable,
3383
+ active: editor?.isActive("blockquote"),
3384
+ onMouseDown: (event) => {
3385
+ event.preventDefault();
3386
+ editor?.chain().focus().toggleBlockquote().run();
3358
3387
  }
3359
- ),
3388
+ }
3389
+ ),
3390
+ toolbar.includes("codeBlock") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3360
3391
  /* @__PURE__ */ jsxRuntime.jsx(
3361
- "button",
3392
+ ToolbarButton,
3362
3393
  {
3363
- type: "button",
3364
- className: tailwindMerge.twMerge(
3365
- toolbarButtonBase,
3366
- editor?.isActive("codeBlock") ? toolbarButtonActive : void 0
3367
- ),
3368
- onClick: () => editor?.chain().focus().toggleCodeBlock().run(),
3369
- disabled: !editor || !editorEditable,
3370
- children: "Code block"
3371
- }
3372
- )
3373
- ] }) }),
3374
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("overflow-hidden", advancedContainerVariant[variant]), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-3 space-y-3", children: [
3375
- showEditor && /* @__PURE__ */ jsxRuntime.jsx(
3376
- react.EditorContent,
3377
- {
3378
- editor,
3379
- id: advancedEditorId,
3380
- className: "w-full",
3381
- style: minHeightStyle
3394
+ label: "Code",
3395
+ disabled: !editor?.isEditable,
3396
+ active: editor?.isActive("codeBlock"),
3397
+ onMouseDown: (event) => {
3398
+ event.preventDefault();
3399
+ editor?.chain().focus().toggleCodeBlock({ language: activeCodeBlockLanguage }).run();
3400
+ }
3382
3401
  }
3383
3402
  ),
3403
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "sr-only", htmlFor: `${inputName}-code-language`, children: "Code language" }),
3384
3404
  /* @__PURE__ */ jsxRuntime.jsx(
3385
- "textarea",
3405
+ "select",
3386
3406
  {
3387
- ...textareaProps,
3388
- ref: hiddenTextareaRef,
3389
- id: advancedInputId,
3390
- name: !allowModeSwitch || resolvedMode === "advanced" ? textareaName : "",
3391
- rows,
3392
- placeholder: placeholderValue,
3393
- className: "sr-only",
3394
- ...isControlled ? { value } : { defaultValue: contentValue }
3395
- }
3396
- ),
3397
- showPreview && /* @__PURE__ */ jsxRuntime.jsx(
3398
- "div",
3399
- {
3400
- id: previewId,
3401
- className: tailwindMerge.twMerge(
3402
- baseClass,
3403
- "min-h-45 rounded border-0 px-0 focus:outline-none whitespace-pre-wrap wrap-break-words",
3404
- className
3405
- ),
3406
- style: minHeightStyle,
3407
- dangerouslySetInnerHTML: {
3408
- __html: renderMarkdown(contentValue)
3409
- }
3407
+ id: `${inputName}-code-language`,
3408
+ value: activeCodeBlockLanguage,
3409
+ disabled: !editor?.isEditable,
3410
+ className: "min-w-24 rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-600 dark:bg-slate-900 dark:text-gray-200",
3411
+ onChange: (event) => {
3412
+ const language = event.target.value;
3413
+ if (!isCodeBlockLanguage(language)) {
3414
+ return;
3415
+ }
3416
+ editor?.chain().focus().setCodeBlock({ language }).run();
3417
+ },
3418
+ children: CODE_BLOCK_LANGUAGES.map((language) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: language, children: language }, language))
3410
3419
  }
3411
3420
  )
3412
- ] }) })
3413
- ]
3414
- }
3415
- )
3416
- ]
3417
- }
3418
- );
3419
- };
3421
+ ] })
3422
+ ] }),
3423
+ /* @__PURE__ */ jsxRuntime.jsx(react.EditorContent, { editor, className: "pt-3" })
3424
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
3425
+ "textarea",
3426
+ {
3427
+ ...textareaProps,
3428
+ ref: (node) => {
3429
+ forwardedRef.current = node;
3430
+ assignRef(ref, node);
3431
+ },
3432
+ id: inputName,
3433
+ name: inputName,
3434
+ rows,
3435
+ placeholder: placeholderValue,
3436
+ onFocus: handleFocus,
3437
+ onBlur: handleBlur,
3438
+ onKeyDown: handleKeyDown,
3439
+ onChange,
3440
+ disabled,
3441
+ readOnly,
3442
+ value,
3443
+ defaultValue,
3444
+ className: tailwindMerge.twMerge(textareaBase, placeholderClass)
3445
+ }
3446
+ ),
3447
+ label && /* @__PURE__ */ jsxRuntime.jsx(
3448
+ "label",
3449
+ {
3450
+ htmlFor: inputName,
3451
+ className: tailwindMerge.twMerge(
3452
+ "absolute left-0 z-10 transition-all duration-150 pointer-events-none text-gray-700 dark:text-gray-200",
3453
+ "-top-2 -translate-y-full text-xs bg-white px-1 dark:bg-slate-900",
3454
+ !richText && "peer-focus:left-0 peer-focus:-top-5 peer-focus:-translate-y-full peer-focus:text-xs peer-focus:text-gray-600 dark:peer-focus:text-gray-300",
3455
+ !richText && "peer-placeholder-shown:top-3 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:text-sm peer-placeholder-shown:bg-transparent peer-placeholder-shown:px-0 peer-placeholder-shown:text-gray-500 dark:peer-placeholder-shown:text-gray-400",
3456
+ !richText && "peer-[&:not(:placeholder-shown)]:left-0 peer-[&:not(:placeholder-shown)]:-top-2 peer-[&:not(:placeholder-shown)]:-translate-y-full peer-[&:not(:placeholder-shown)]:text-xs peer-[&:not(:placeholder-shown)]:bg-white peer-[&:not(:placeholder-shown)]:px-1 peer-[&:not(:placeholder-shown)]:text-gray-700 dark:peer-[&:not(:placeholder-shown)]:bg-slate-900 dark:peer-[&:not(:placeholder-shown)]:text-gray-200",
3457
+ richText && (isFocused || resolvedMarkdownValue) && "-top-2 -translate-y-full text-xs",
3458
+ richText && !(isFocused || resolvedMarkdownValue) && "top-3 translate-y-0 text-sm bg-transparent px-0 text-gray-500 dark:text-gray-400"
3459
+ ),
3460
+ children: label
3461
+ }
3462
+ )
3463
+ ] }),
3464
+ hasAppend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start pt-0.5", children: renderAppend })
3465
+ ] }),
3466
+ status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses[status.tone]), children: status.message })
3467
+ ] });
3468
+ }
3469
+ );
3470
+ TextArea.displayName = "TextArea";
3420
3471
  var TextArea_default = TextArea;
3421
- var baseClass2 = "select-base w-full appearance-none focus-visible:outline-none focus-visible:ring-primary transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed bg-white text-gray-900 placeholder:text-gray-500 dark:bg-slate-900 dark:text-gray-100 dark:placeholder:text-gray-400";
3472
+
3473
+ // src/utils/helpers/randomStr.ts
3474
+ var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3475
+ function generateString(length = 5) {
3476
+ let result = "";
3477
+ const charactersLength = characters.length;
3478
+ for (let i = 0; i < length; i++) {
3479
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
3480
+ }
3481
+ return result;
3482
+ }
3483
+ var baseClass = "select-base w-full appearance-none focus-visible:outline-none focus-visible:ring-primary transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed bg-white text-gray-900 placeholder:text-gray-500 dark:bg-slate-900 dark:text-gray-100 dark:placeholder:text-gray-400";
3422
3484
  var variantClasses4 = {
3423
3485
  solid: "rounded border border-gray-400 bg-white shadow-sm focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 dark:border-gray-600 dark:bg-slate-900 dark:shadow-black/20 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/40",
3424
3486
  sharp: "rounded-none border border-gray-400 bg-white shadow-sm focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 dark:border-gray-600 dark:bg-slate-900 dark:shadow-black/20 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/40",
@@ -3428,7 +3490,7 @@ var variantClasses4 = {
3428
3490
  filled: "rounded border border-gray-200 bg-gray-100 focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/25 dark:border-gray-700 dark:bg-slate-800 dark:focus-visible:border-primary/60 dark:focus-visible:ring-primary/30",
3429
3491
  underlined: "rounded-none border-0 border-b border-gray-300 pl-0 pr-10 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-300 dark:focus-visible:border-primary/70"
3430
3492
  };
3431
- var sizeClasses3 = {
3493
+ var sizeClasses4 = {
3432
3494
  "x-small": { padding: "pl-2 pr-8 py-2", text: "text-xs" },
3433
3495
  small: { padding: "pl-2.5 pr-9 py-2.5", text: "text-sm" },
3434
3496
  medium: { padding: "pl-3 pr-10 py-3", text: "text-base" },
@@ -3470,7 +3532,7 @@ var resolveIconClassName4 = (icon) => {
3470
3532
  const classes = [...baseClasses, normalizedName];
3471
3533
  return Array.from(new Set(classes)).join(" ");
3472
3534
  };
3473
- var Select = React__namespace.default.forwardRef(
3535
+ var Select = React15__namespace.default.forwardRef(
3474
3536
  ({
3475
3537
  options,
3476
3538
  label,
@@ -3491,12 +3553,13 @@ var Select = React__namespace.default.forwardRef(
3491
3553
  onChange,
3492
3554
  onBlur,
3493
3555
  onFocus,
3556
+ addOptionAction,
3494
3557
  ...props
3495
3558
  }, ref) => {
3496
3559
  const selectId = id || name || generateString();
3497
3560
  const inputName = name || selectId;
3498
3561
  const variantClass = variantClasses4[variant] ?? variantClasses4.outline;
3499
- const sizeConfig = sizeClasses3[size] ?? sizeClasses3.medium;
3562
+ const sizeConfig = sizeClasses4[size] ?? sizeClasses4.medium;
3500
3563
  const sizeClass = `${sizeConfig.padding} ${sizeConfig.text}`;
3501
3564
  const normalizedOptions = options.map(normalizeOption);
3502
3565
  const selectedValueList = value !== void 0 ? (Array.isArray(value) ? value : [value]).map(String) : defaultValue !== void 0 ? (Array.isArray(defaultValue) ? defaultValue : [defaultValue]).map(String) : [];
@@ -3519,6 +3582,13 @@ var Select = React__namespace.default.forwardRef(
3519
3582
  onFocus?.(event);
3520
3583
  }
3521
3584
  };
3585
+ const handleAddOptionActionClick = (event) => {
3586
+ event.preventDefault();
3587
+ if (disabled || !addOptionAction) return;
3588
+ addOptionAction.onClick();
3589
+ const detailsEl = event.currentTarget.closest("details");
3590
+ detailsEl?.removeAttribute("open");
3591
+ };
3522
3592
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: [
3523
3593
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3524
3594
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3534,7 +3604,7 @@ var Select = React__namespace.default.forwardRef(
3534
3604
  "summary",
3535
3605
  {
3536
3606
  className: tailwindMerge.twMerge(
3537
- baseClass2,
3607
+ baseClass,
3538
3608
  variantClass,
3539
3609
  sizeClass,
3540
3610
  "list-none cursor-pointer flex items-center justify-between pr-10 relative [&::-webkit-details-marker]:hidden",
@@ -3550,46 +3620,61 @@ var Select = React__namespace.default.forwardRef(
3550
3620
  ]
3551
3621
  }
3552
3622
  ),
3553
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:border-slate-700", children: normalizedOptions.map((option, index) => {
3554
- const optionValueStr = String(option.value);
3555
- const isSelected = Array.isArray(value) ? value.map(String).includes(optionValueStr) : String(value) === optionValueStr;
3556
- const isDefaultSelected = Array.isArray(defaultValue) ? defaultValue.map(String).includes(optionValueStr) : String(defaultValue) === optionValueStr;
3557
- const iconClassName = resolveIconClassName4(option.icon);
3558
- const inputId = `${selectId}-${toIdSafe(optionValueStr)}-${index}`;
3559
- return /* @__PURE__ */ jsxRuntime.jsxs(
3560
- "label",
3623
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:border-slate-700", children: [
3624
+ normalizedOptions.map((option, index) => {
3625
+ const optionValueStr = String(option.value);
3626
+ const isSelected = Array.isArray(value) ? value.map(String).includes(optionValueStr) : String(value) === optionValueStr;
3627
+ const isDefaultSelected = Array.isArray(defaultValue) ? defaultValue.map(String).includes(optionValueStr) : String(defaultValue) === optionValueStr;
3628
+ const iconClassName = resolveIconClassName4(option.icon);
3629
+ const inputId = `${selectId}-${toIdSafe(optionValueStr)}-${index}`;
3630
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3631
+ "label",
3632
+ {
3633
+ htmlFor: inputId,
3634
+ className: tailwindMerge.twMerge(
3635
+ "relative flex cursor-pointer select-none items-center gap-2 px-4 py-2 text-sm text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-slate-700",
3636
+ option.disabled && "cursor-not-allowed opacity-50"
3637
+ ),
3638
+ children: [
3639
+ /* @__PURE__ */ jsxRuntime.jsx(
3640
+ "input",
3641
+ {
3642
+ type: multiple ? "checkbox" : "radio",
3643
+ id: inputId,
3644
+ name: inputName,
3645
+ value: option.value,
3646
+ disabled: option.disabled || disabled,
3647
+ checked: value !== void 0 ? isSelected : void 0,
3648
+ defaultChecked: defaultValue !== void 0 ? isDefaultSelected : void 0,
3649
+ onChange: handleOptionChange,
3650
+ onBlur,
3651
+ ref,
3652
+ required: required && !multiple,
3653
+ className: "peer sr-only"
3654
+ }
3655
+ ),
3656
+ iconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge(iconClassName, "text-lg text-gray-500 peer-checked:text-primary dark:text-gray-400") }),
3657
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate peer-checked:font-medium peer-checked:text-primary", children: option.label }),
3658
+ /* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-check invisible ml-auto text-primary peer-checked:visible" })
3659
+ ]
3660
+ },
3661
+ `${optionValueStr}-${index}`
3662
+ );
3663
+ }),
3664
+ addOptionAction && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 border-t border-gray-100 pt-1 dark:border-slate-700", children: /* @__PURE__ */ jsxRuntime.jsxs(
3665
+ "button",
3561
3666
  {
3562
- htmlFor: inputId,
3563
- className: tailwindMerge.twMerge(
3564
- "relative flex cursor-pointer select-none items-center gap-2 px-4 py-2 text-sm text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-slate-700",
3565
- option.disabled && "cursor-not-allowed opacity-50"
3566
- ),
3667
+ type: "button",
3668
+ className: "flex w-full cursor-pointer items-center gap-2 px-4 py-2 text-left text-sm font-medium text-primary hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50 dark:hover:bg-slate-700",
3669
+ onClick: handleAddOptionActionClick,
3670
+ disabled,
3567
3671
  children: [
3568
- /* @__PURE__ */ jsxRuntime.jsx(
3569
- "input",
3570
- {
3571
- type: multiple ? "checkbox" : "radio",
3572
- id: inputId,
3573
- name: inputName,
3574
- value: option.value,
3575
- disabled: option.disabled || disabled,
3576
- checked: value !== void 0 ? isSelected : void 0,
3577
- defaultChecked: defaultValue !== void 0 ? isDefaultSelected : void 0,
3578
- onChange: handleOptionChange,
3579
- onBlur,
3580
- ref,
3581
- required: required && !multiple,
3582
- className: "peer sr-only"
3583
- }
3584
- ),
3585
- iconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge(iconClassName, "text-lg text-gray-500 peer-checked:text-primary dark:text-gray-400") }),
3586
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate peer-checked:font-medium peer-checked:text-primary", children: option.label }),
3587
- /* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-check invisible ml-auto text-primary peer-checked:visible" })
3672
+ /* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-plus", "aria-hidden": true }),
3673
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: addOptionAction.label })
3588
3674
  ]
3589
- },
3590
- `${optionValueStr}-${index}`
3591
- );
3592
- }) })
3675
+ }
3676
+ ) })
3677
+ ] })
3593
3678
  ]
3594
3679
  }
3595
3680
  ),
@@ -3668,19 +3753,19 @@ var Slider = ({
3668
3753
  const resolvedMax = toNumber(max, resolvedMin < 100 ? 100 : resolvedMin);
3669
3754
  const resolvedStep = toNumber(step, 1);
3670
3755
  const isControlled = typeof value === "number";
3671
- const [internalValue, setInternalValue] = React.useState(
3756
+ const [internalValue, setInternalValue] = React15.useState(
3672
3757
  clamp(
3673
3758
  typeof value === "number" ? value : typeof defaultValue === "number" ? defaultValue : resolvedMin,
3674
3759
  resolvedMin,
3675
3760
  resolvedMax
3676
3761
  )
3677
3762
  );
3678
- React.useEffect(() => {
3763
+ React15.useEffect(() => {
3679
3764
  if (isControlled && typeof value === "number") {
3680
3765
  setInternalValue(clamp(value, resolvedMin, resolvedMax));
3681
3766
  }
3682
3767
  }, [isControlled, value, resolvedMin, resolvedMax]);
3683
- React.useEffect(() => {
3768
+ React15.useEffect(() => {
3684
3769
  if (!isControlled) {
3685
3770
  setInternalValue((prev) => clamp(prev, resolvedMin, resolvedMax));
3686
3771
  }
@@ -3783,7 +3868,7 @@ var thumbActiveClasses = {
3783
3868
  surface: "border-gray-900 shadow-[0_4px_12px_rgba(15,23,42,0.32)]",
3784
3869
  bw: "border-black shadow-[0_4px_12px_rgba(0,0,0,0.32)]"
3785
3870
  };
3786
- var Switch = React.forwardRef(
3871
+ var Switch = React15.forwardRef(
3787
3872
  ({
3788
3873
  color = "primary",
3789
3874
  size = "medium",
@@ -3802,10 +3887,10 @@ var Switch = React.forwardRef(
3802
3887
  const focusClass = focusRingClasses[color] ?? focusRingClasses.primary;
3803
3888
  const thumbActive = thumbActiveClasses[color] ?? thumbActiveClasses.primary;
3804
3889
  const isControlled = checked !== void 0;
3805
- const [internalChecked, setInternalChecked] = React.useState(
3890
+ const [internalChecked, setInternalChecked] = React15.useState(
3806
3891
  Boolean((isControlled ? checked : defaultChecked) ?? false)
3807
3892
  );
3808
- React.useEffect(() => {
3893
+ React15.useEffect(() => {
3809
3894
  if (isControlled) {
3810
3895
  setInternalChecked(Boolean(checked));
3811
3896
  }
@@ -3878,7 +3963,7 @@ var Switch = React.forwardRef(
3878
3963
  );
3879
3964
  Switch.displayName = "Switch";
3880
3965
  var Switch_default = Switch;
3881
- var sizeClasses4 = {
3966
+ var sizeClasses5 = {
3882
3967
  "x-small": "text-xs",
3883
3968
  small: "text-sm",
3884
3969
  medium: "text-base",
@@ -3916,7 +4001,7 @@ var Icon = ({ className, icon, size, color, ...rest }) => {
3916
4001
  }
3917
4002
  }
3918
4003
  const classBase = "mdi";
3919
- const sizeClass = size ? sizeClasses4[size] ?? sizeClasses4.medium : void 0;
4004
+ const sizeClass = size ? sizeClasses5[size] ?? sizeClasses5.medium : void 0;
3920
4005
  const colorClass = color ? colorClasses2[color] ?? colorClasses2.primary : void 0;
3921
4006
  return /* @__PURE__ */ jsxRuntime.jsx("i", { ...rest, className: tailwindMerge.twMerge(classBase, iconValue, sizeClass, colorClass, className) });
3922
4007
  };
@@ -4040,7 +4125,7 @@ var resolveIconClassName5 = (icon) => {
4040
4125
  return `mdi ${library} ${normalized}`.trim();
4041
4126
  };
4042
4127
  var resolveIconNode2 = (icon, fallbackClassName) => {
4043
- if (React__namespace.isValidElement(icon)) return icon;
4128
+ if (React15__namespace.isValidElement(icon)) return icon;
4044
4129
  const iconClassName = resolveIconClassName5(icon) ?? fallbackClassName;
4045
4130
  if (!iconClassName) return null;
4046
4131
  const hasBase = iconClassName.split(" ").some((token) => token.trim() === "mdi");
@@ -4172,7 +4257,7 @@ var Notification = ({
4172
4257
  };
4173
4258
  var Notification_default = Notification;
4174
4259
  var useNotification = (defaultMessage) => {
4175
- const [messages, setMessages] = React.useState([]);
4260
+ const [messages, setMessages] = React15.useState([]);
4176
4261
  const clearNotifications = (key) => {
4177
4262
  setMessages((prev) => key ? prev.filter((notification) => notification.key !== key) : []);
4178
4263
  };
@@ -4309,10 +4394,7 @@ var LineProgress = ({
4309
4394
  /* @__PURE__ */ jsxRuntime.jsx(
4310
4395
  "div",
4311
4396
  {
4312
- className: tailwindMerge.twMerge(
4313
- "h-full rounded-full transition-[width] duration-300 ease-out",
4314
- status === "active" ? "animate-pulse" : void 0
4315
- ),
4397
+ className: tailwindMerge.twMerge("h-full rounded-full transition-[width] duration-300 ease-out", status === "active" ? "animate-pulse" : void 0),
4316
4398
  style: barStyle
4317
4399
  }
4318
4400
  ),
@@ -4451,7 +4533,7 @@ var Progress = (props) => {
4451
4533
  const percent = clampPercent(toNumber2(rawPercent));
4452
4534
  const successPercent = clampPercent(toNumber2(success?.percent));
4453
4535
  const status = providedStatus ?? (percent >= 100 ? "success" : "normal");
4454
- const resolvedClassName = tailwindMerge.twMerge("min-w-[200px]", className);
4536
+ const resolvedClassName = tailwindMerge.twMerge("min-w-50", className);
4455
4537
  if (type === "circle" || type === "dashboard") {
4456
4538
  return /* @__PURE__ */ jsxRuntime.jsx(
4457
4539
  CircleProgress,
@@ -4567,7 +4649,7 @@ var resolveIconNode3 = (icon) => {
4567
4649
  const iconClass = resolveIconClassName2(icon);
4568
4650
  return iconClass ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: iconClass, "aria-hidden": true }) : null;
4569
4651
  };
4570
- var TimeLineItem = React__namespace.forwardRef((props, ref) => {
4652
+ var TimeLineItem = React15__namespace.forwardRef((props, ref) => {
4571
4653
  const {
4572
4654
  title,
4573
4655
  subtitle,
@@ -4686,13 +4768,13 @@ var TimeLineItem = React__namespace.forwardRef((props, ref) => {
4686
4768
  });
4687
4769
  TimeLineItem.displayName = "TimeLine.Item";
4688
4770
  var isTimeLineItem = (child) => {
4689
- if (!React__namespace.isValidElement(child)) {
4771
+ if (!React15__namespace.isValidElement(child)) {
4690
4772
  return false;
4691
4773
  }
4692
4774
  const elementType = child.type;
4693
4775
  return child.type === TimeLineItem || elementType.displayName === TimeLineItem.displayName;
4694
4776
  };
4695
- var TimeLine = React__namespace.forwardRef((props, ref) => {
4777
+ var TimeLine = React15__namespace.forwardRef((props, ref) => {
4696
4778
  const {
4697
4779
  side = "right",
4698
4780
  axis = "center",
@@ -4707,12 +4789,12 @@ var TimeLine = React__namespace.forwardRef((props, ref) => {
4707
4789
  ...rest
4708
4790
  } = props;
4709
4791
  const resolvedGap = densityGapClasses[density] ?? densityGapClasses.default;
4710
- const childArray = React__namespace.Children.toArray(children);
4792
+ const childArray = React15__namespace.Children.toArray(children);
4711
4793
  const resolvedChildren = childArray.map((child, index) => {
4712
4794
  if (!isTimeLineItem(child)) {
4713
4795
  return child;
4714
4796
  }
4715
- return React__namespace.cloneElement(child, {
4797
+ return React15__namespace.cloneElement(child, {
4716
4798
  __timelineSide: side,
4717
4799
  __timelineAxis: axis,
4718
4800
  __timelineAlign: align,