@lindle/linoardo 1.0.49 → 1.0.50

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 (41) hide show
  1. package/dist/chunk-3J6Y3EQW.js +538 -0
  2. package/dist/chunk-3J6Y3EQW.js.map +1 -0
  3. package/dist/{chunk-LRWM4ZWZ.js → chunk-DEJ7ZDGL.js} +3 -3
  4. package/dist/chunk-DEJ7ZDGL.js.map +1 -0
  5. package/dist/{chunk-TRR7TDVA.js → chunk-HE44Z7XP.js} +12 -3
  6. package/dist/chunk-HE44Z7XP.js.map +1 -0
  7. package/dist/{chunk-Z5A2OIDI.js → chunk-SM2VNSPP.js} +4 -7
  8. package/dist/chunk-SM2VNSPP.js.map +1 -0
  9. package/dist/{chunk-LSIAP7ZZ.js → chunk-XLA2NCDF.js} +3 -9
  10. package/dist/chunk-XLA2NCDF.js.map +1 -0
  11. package/dist/expansion-panel.cjs +1 -7
  12. package/dist/expansion-panel.cjs.map +1 -1
  13. package/dist/expansion-panel.js +1 -1
  14. package/dist/index.cjs +581 -520
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +5 -6
  19. package/dist/index.js.map +1 -1
  20. package/dist/profileCard.cjs +1 -1
  21. package/dist/profileCard.cjs.map +1 -1
  22. package/dist/profileCard.js +1 -1
  23. package/dist/progress.cjs +2 -5
  24. package/dist/progress.cjs.map +1 -1
  25. package/dist/progress.js +1 -1
  26. package/dist/select.js +1 -2
  27. package/dist/styles.css +254 -187
  28. package/dist/textarea.cjs +484 -423
  29. package/dist/textarea.cjs.map +1 -1
  30. package/dist/textarea.d.cts +27 -23
  31. package/dist/textarea.d.ts +27 -23
  32. package/dist/textarea.js +1 -2
  33. package/package.json +7 -1
  34. package/dist/chunk-67TAA2MA.js +0 -470
  35. package/dist/chunk-67TAA2MA.js.map +0 -1
  36. package/dist/chunk-6SKW43XI.js +0 -14
  37. package/dist/chunk-6SKW43XI.js.map +0 -1
  38. package/dist/chunk-LRWM4ZWZ.js.map +0 -1
  39. package/dist/chunk-LSIAP7ZZ.js.map +0 -1
  40. package/dist/chunk-TRR7TDVA.js.map +0 -1
  41. 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
@@ -169,7 +174,7 @@ var iconOnlyIconSizeClasses = {
169
174
  large: "text-xl",
170
175
  "x-large": "text-2xl"
171
176
  };
172
- var ButtonBase = React__namespace.forwardRef(
177
+ var ButtonBase = React15__namespace.forwardRef(
173
178
  ({
174
179
  variant = "solid",
175
180
  color = "primary",
@@ -226,13 +231,13 @@ var ButtonBase = React__namespace.forwardRef(
226
231
  );
227
232
  ButtonBase.displayName = "Button";
228
233
  var isButtonElement = (element) => {
229
- if (!React__namespace.isValidElement(element)) {
234
+ if (!React15__namespace.isValidElement(element)) {
230
235
  return false;
231
236
  }
232
237
  const elementType = element.type;
233
238
  return element.type === ButtonBase || elementType.displayName === ButtonBase.displayName;
234
239
  };
235
- var ButtonGroup = React__namespace.forwardRef((props, ref) => {
240
+ var ButtonGroup = React15__namespace.forwardRef((props, ref) => {
236
241
  const {
237
242
  variant,
238
243
  color,
@@ -252,11 +257,11 @@ var ButtonGroup = React__namespace.forwardRef((props, ref) => {
252
257
  const blockClass = block ? "w-full [&>*]:flex-1" : void 0;
253
258
  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
259
  const enhanceChild = (child) => {
255
- if (!React__namespace.isValidElement(child)) {
260
+ if (!React15__namespace.isValidElement(child)) {
256
261
  return child;
257
262
  }
258
263
  if (isButtonElement(child)) {
259
- return React__namespace.cloneElement(child, {
264
+ return React15__namespace.cloneElement(child, {
260
265
  variant: child.props.variant ?? variant,
261
266
  color: child.props.color ?? color,
262
267
  size: child.props.size ?? size,
@@ -267,14 +272,14 @@ var ButtonGroup = React__namespace.forwardRef((props, ref) => {
267
272
  });
268
273
  }
269
274
  if (child.props && typeof child.props === "object" && "children" in child.props) {
270
- const nestedChildren = React__namespace.Children.map(child.props.children, enhanceChild);
275
+ const nestedChildren = React15__namespace.Children.map(child.props.children, enhanceChild);
271
276
  if (nestedChildren !== child.props.children) {
272
- return React__namespace.cloneElement(child, void 0, nestedChildren);
277
+ return React15__namespace.cloneElement(child, void 0, nestedChildren);
273
278
  }
274
279
  }
275
280
  return child;
276
281
  };
277
- const resolvedChildren = React__namespace.Children.map(children, enhanceChild);
282
+ const resolvedChildren = React15__namespace.Children.map(children, enhanceChild);
278
283
  return /* @__PURE__ */ jsxRuntime.jsx(
279
284
  "div",
280
285
  {
@@ -405,7 +410,7 @@ var chipSizeClasses = {
405
410
  large: "h-8 text-sm px-3",
406
411
  "x-large": "h-9 text-base px-3.5"
407
412
  };
408
- var Chip = React.forwardRef(
413
+ var Chip = React15.forwardRef(
409
414
  ({
410
415
  variant = "solid",
411
416
  color = "primary",
@@ -602,7 +607,7 @@ var Badge = ({
602
607
  className,
603
608
  ...rest
604
609
  }) => {
605
- const hasChildren = React__namespace.Children.count(children) > 0;
610
+ const hasChildren = React15__namespace.Children.count(children) > 0;
606
611
  const iconClassName = resolveIconClassName3(icon);
607
612
  const isNumberContent = typeof content === "number" && Number.isFinite(content);
608
613
  let displayValue = content;
@@ -743,7 +748,7 @@ var accentClasses = {
743
748
  indicator: "bg-gray-900 dark:bg-gray-100"
744
749
  }
745
750
  };
746
- var ListItem = React__namespace.forwardRef((props, ref) => {
751
+ var ListItem = React15__namespace.forwardRef((props, ref) => {
747
752
  const {
748
753
  component,
749
754
  href,
@@ -868,13 +873,13 @@ var listRoundedClasses = {
868
873
  pill: "rounded-full"
869
874
  };
870
875
  var isListItemElement = (element) => {
871
- if (!React__namespace.isValidElement(element)) {
876
+ if (!React15__namespace.isValidElement(element)) {
872
877
  return false;
873
878
  }
874
879
  const elementType = element.type;
875
880
  return element.type === Item_default || elementType.displayName === Item_default.displayName;
876
881
  };
877
- var List = React__namespace.forwardRef((props, ref) => {
882
+ var List = React15__namespace.forwardRef((props, ref) => {
878
883
  const {
879
884
  variant = "solid",
880
885
  density = "default",
@@ -896,11 +901,11 @@ var List = React__namespace.forwardRef((props, ref) => {
896
901
  const navClass = nav ? "py-1" : void 0;
897
902
  const accentColor = color;
898
903
  const enhanceChild = (child) => {
899
- if (!React__namespace.isValidElement(child)) {
904
+ if (!React15__namespace.isValidElement(child)) {
900
905
  return child;
901
906
  }
902
907
  if (isListItemElement(child)) {
903
- return React__namespace.cloneElement(child, {
908
+ return React15__namespace.cloneElement(child, {
904
909
  density: child.props.density ?? density,
905
910
  lines: child.props.lines ?? lines,
906
911
  nav: child.props.nav ?? nav,
@@ -910,14 +915,14 @@ var List = React__namespace.forwardRef((props, ref) => {
910
915
  });
911
916
  }
912
917
  if (child.props && typeof child.props === "object" && "children" in child.props) {
913
- const nestedChildren = React__namespace.Children.map(child.props.children, enhanceChild);
918
+ const nestedChildren = React15__namespace.Children.map(child.props.children, enhanceChild);
914
919
  if (nestedChildren !== child.props.children) {
915
- return React__namespace.cloneElement(child, void 0, nestedChildren);
920
+ return React15__namespace.cloneElement(child, void 0, nestedChildren);
916
921
  }
917
922
  }
918
923
  return child;
919
924
  };
920
- const resolvedChildren = React__namespace.Children.map(children, enhanceChild);
925
+ const resolvedChildren = React15__namespace.Children.map(children, enhanceChild);
921
926
  return /* @__PURE__ */ jsxRuntime.jsx(
922
927
  "div",
923
928
  {
@@ -956,7 +961,7 @@ var offsetClasses = {
956
961
  var menuWrapperBaseClasses = "absolute z-50";
957
962
  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
963
  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) => {
964
+ var Menu = React15__namespace.forwardRef((props, ref) => {
960
965
  const {
961
966
  activator,
962
967
  children,
@@ -1090,7 +1095,7 @@ var traverseNode = (node, value) => {
1090
1095
  if (node === null || node === void 0 || typeof node === "boolean" || typeof node === "string" || typeof node === "number") {
1091
1096
  return { node, changed: false };
1092
1097
  }
1093
- if (!React.isValidElement(node)) {
1098
+ if (!React15.isValidElement(node)) {
1094
1099
  return { node, changed: false };
1095
1100
  }
1096
1101
  const element = node;
@@ -1103,7 +1108,7 @@ var traverseNode = (node, value) => {
1103
1108
  return { node, changed: false };
1104
1109
  }
1105
1110
  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);
1111
+ const cloned = mappedChildren === void 0 ? React15.cloneElement(element, injectedProps) : React15.cloneElement(element, injectedProps, mappedChildren);
1107
1112
  return { node: cloned, changed: true };
1108
1113
  };
1109
1114
  var injectExpansionPanelContext = (children, value) => traverseNode(children, value).node;
@@ -1269,7 +1274,7 @@ var ExpansionPanelItemInner = (props) => {
1269
1274
  }
1270
1275
  );
1271
1276
  };
1272
- var ExpansionPanelItem = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ExpansionPanelItemInner, { ...props, forwardedRef: ref }));
1277
+ var ExpansionPanelItem = React15.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ExpansionPanelItemInner, { ...props, forwardedRef: ref }));
1273
1278
  ExpansionPanelItem.displayName = "ExpansionPanelItem";
1274
1279
  markExpansionPanelItem(ExpansionPanelItem);
1275
1280
  var ExpansionPanelItem_default = ExpansionPanelItem;
@@ -1334,18 +1339,12 @@ var ExpansionPanelInner = (props, forwardedRef) => {
1334
1339
  {
1335
1340
  ...rest,
1336
1341
  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
- ),
1342
+ className: tailwindMerge.twMerge("expansion-panel flex w-full flex-col text-gray-900 dark:text-gray-100", variantClass, shapeClass, layoutClass, className),
1344
1343
  children: enhancedChildren
1345
1344
  }
1346
1345
  );
1347
1346
  };
1348
- var ExpansionPanelBase = React.forwardRef(ExpansionPanelInner);
1347
+ var ExpansionPanelBase = React15.forwardRef(ExpansionPanelInner);
1349
1348
  var ExpansionPanel = Object.assign(ExpansionPanelBase, {
1350
1349
  Item: ExpansionPanelItem_default
1351
1350
  });
@@ -1361,7 +1360,7 @@ var resolveSizeValue = (value) => {
1361
1360
  }
1362
1361
  return typeof value === "number" ? `${value}px` : value;
1363
1362
  };
1364
- var Dialog = React__namespace.forwardRef((props, forwardedRef) => {
1363
+ var Dialog = React15__namespace.forwardRef((props, forwardedRef) => {
1365
1364
  const {
1366
1365
  activator,
1367
1366
  children,
@@ -1486,7 +1485,7 @@ var resolveSizeValue2 = (value) => {
1486
1485
  }
1487
1486
  return typeof value === "number" ? `${value}px` : value;
1488
1487
  };
1489
- var Drawer = React__namespace.forwardRef((props, ref) => {
1488
+ var Drawer = React15__namespace.forwardRef((props, ref) => {
1490
1489
  const {
1491
1490
  location = "left",
1492
1491
  floating = false,
@@ -1587,7 +1586,7 @@ Drawer.displayName = "Drawer";
1587
1586
  var Drawer_default = Drawer;
1588
1587
  var overlayBaseClasses4 = "inset-0 z-[55] transition-opacity duration-200 data-[state=closed]:opacity-0 data-[state=open]:opacity-100";
1589
1588
  var scrimClasses = "bg-gray-900/55 dark:bg-black/70 backdrop-blur-[2px]";
1590
- var Overlay = React__namespace.forwardRef((props, ref) => {
1589
+ var Overlay = React15__namespace.forwardRef((props, ref) => {
1591
1590
  const {
1592
1591
  open,
1593
1592
  keepMounted = false,
@@ -1675,7 +1674,7 @@ var arrowPlacementClasses = {
1675
1674
  "right-start": "right-full top-4 translate-x-1/2",
1676
1675
  "right-end": "right-full bottom-4 translate-x-1/2"
1677
1676
  };
1678
- var ToolTip = React__namespace.forwardRef((props, forwardedRef) => {
1677
+ var ToolTip = React15__namespace.forwardRef((props, forwardedRef) => {
1679
1678
  const {
1680
1679
  activator,
1681
1680
  children,
@@ -1792,7 +1791,7 @@ var elevationClasses = {
1792
1791
  5: "shadow-xl",
1793
1792
  6: "shadow-2xl"
1794
1793
  };
1795
- var CardRoot = React.forwardRef(function Card({ className, children, variant = "solid", padding = "md", overflow = "hidden", interactive = false, dividers = true, elevation = 0, ...rest }, ref) {
1794
+ var CardRoot = React15.forwardRef(function Card({ className, children, variant = "solid", padding = "md", overflow = "hidden", interactive = false, dividers = true, elevation = 0, ...rest }, ref) {
1796
1795
  const variantClass = variantClasses[variant] ?? variantClasses.solid;
1797
1796
  const paddingClass = paddingClasses[padding] ?? paddingClasses.md;
1798
1797
  const overflowClass = overflowClasses[overflow] ?? overflowClasses.hidden;
@@ -1863,13 +1862,13 @@ var Card2 = Object.assign(CardRoot, {
1863
1862
  });
1864
1863
  var Card_default = Card2;
1865
1864
  function applyDividers(children, dividers) {
1866
- return React.Children.map(children, (child) => {
1867
- if (!React.isValidElement(child)) return child;
1865
+ return React15.Children.map(children, (child) => {
1866
+ if (!React15.isValidElement(child)) return child;
1868
1867
  if (isDividerSection(child)) {
1869
- return React.cloneElement(child, { dividers: child.props.dividers ?? dividers });
1868
+ return React15.cloneElement(child, { dividers: child.props.dividers ?? dividers });
1870
1869
  }
1871
1870
  if (hasNestedChildren(child)) {
1872
- return React.cloneElement(child, {
1871
+ return React15.cloneElement(child, {
1873
1872
  children: applyDividers(child.props.children, dividers)
1874
1873
  });
1875
1874
  }
@@ -1903,7 +1902,7 @@ var variantClasses2 = {
1903
1902
  underlined: "rounded-xl bg-white/20 backdrop-opacity-5 border-b border-white/40 dark:bg-slate-900/30 dark:border-white/20",
1904
1903
  sharp: "rounded-none bg-white/40 backdrop-opacity-5 border border-white/30 dark:bg-slate-900/50 dark:border-white/10"
1905
1904
  };
1906
- var Block = React__namespace.forwardRef(function Block2({ className, variant = "solid", blur = "sm", interactive = false, children, ...rest }, ref) {
1905
+ var Block = React15__namespace.forwardRef(function Block2({ className, variant = "solid", blur = "sm", interactive = false, children, ...rest }, ref) {
1907
1906
  const variantClass = variantClasses2[variant] ?? variantClasses2.solid;
1908
1907
  const blurClass = blurClasses[blur] ?? blurClasses.sm;
1909
1908
  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 +1960,10 @@ var MasonryBase = (props, ref) => {
1961
1960
  const renderedItems = items && items.length ? items.map((item, index) => {
1962
1961
  const content = resolveItemContent(item, index, renderItem);
1963
1962
  return wrapItem(content, resolveItemKey(item, index, getKey));
1964
- }) : React__namespace.Children.map(children, (child, index) => wrapItem(child, resolveChildKey(child, index))) ?? null;
1963
+ }) : React15__namespace.Children.map(children, (child, index) => wrapItem(child, resolveChildKey(child, index))) ?? null;
1965
1964
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, ref, role, className: tailwindMerge.twMerge(masonryBaseClass, className), style: layoutStyle, children: renderedItems });
1966
1965
  };
1967
- var Masonry = React__namespace.forwardRef(MasonryBase);
1966
+ var Masonry = React15__namespace.forwardRef(MasonryBase);
1968
1967
  Masonry.displayName = "Masonry";
1969
1968
  var Masonry_default = Masonry;
1970
1969
  function toCssLength(value) {
@@ -1989,13 +1988,13 @@ function resolveColumnCount(column, maxColumn, hasColumnWidth) {
1989
1988
  }
1990
1989
  function resolveItemKey(item, index, getKey) {
1991
1990
  if (getKey) return getKey(item, index);
1992
- if (React__namespace.isValidElement(item) && item.key != null) {
1991
+ if (React15__namespace.isValidElement(item) && item.key != null) {
1993
1992
  return item.key;
1994
1993
  }
1995
1994
  return index;
1996
1995
  }
1997
1996
  function resolveChildKey(child, index) {
1998
- if (React__namespace.isValidElement(child) && child.key != null) {
1997
+ if (React15__namespace.isValidElement(child) && child.key != null) {
1999
1998
  return child.key;
2000
1999
  }
2001
2000
  return index;
@@ -2021,7 +2020,7 @@ var hasMarker2 = (type) => {
2021
2020
  return false;
2022
2021
  };
2023
2022
  var isTabsTabElement = (element) => {
2024
- if (!React.isValidElement(element)) {
2023
+ if (!React15.isValidElement(element)) {
2025
2024
  return false;
2026
2025
  }
2027
2026
  return hasMarker2(element.type);
@@ -2113,7 +2112,7 @@ var panelVariantClasses = {
2113
2112
  pill: "mt-3 rounded-2xl border border-gray-200 bg-white/90 p-4 dark:border-gray-700 dark:bg-gray-900/90"
2114
2113
  };
2115
2114
  var isExtraContentObject = (value) => {
2116
- return !!value && typeof value === "object" && !React__namespace.isValidElement(value) && ("left" in value || "right" in value);
2115
+ return !!value && typeof value === "object" && !React15__namespace.isValidElement(value) && ("left" in value || "right" in value);
2117
2116
  };
2118
2117
  var resolveFirstEnabledTab = (tabs) => tabs.find((tab) => !tab.disabled)?.value;
2119
2118
  var clampActive = (value, tabs) => {
@@ -2140,7 +2139,7 @@ var collectTabs = (children, tabsId) => {
2140
2139
  return;
2141
2140
  }
2142
2141
  if (!isTabsTabElement(node)) {
2143
- if (React__namespace.isValidElement(node)) {
2142
+ if (React15__namespace.isValidElement(node)) {
2144
2143
  const props = node.props;
2145
2144
  if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
2146
2145
  walk(props.children);
@@ -2184,7 +2183,7 @@ var injectTabs = (children, context, tabs) => {
2184
2183
  });
2185
2184
  return changed ? next : node;
2186
2185
  }
2187
- if (!React__namespace.isValidElement(node)) {
2186
+ if (!React15__namespace.isValidElement(node)) {
2188
2187
  return node;
2189
2188
  }
2190
2189
  if (isTabsTabElement(node)) {
@@ -2200,14 +2199,14 @@ var injectTabs = (children, context, tabs) => {
2200
2199
  __tabsTabId: tab.tabId,
2201
2200
  __tabsPanelId: tab.panelId
2202
2201
  };
2203
- return React__namespace.cloneElement(node, injectedProps);
2202
+ return React15__namespace.cloneElement(node, injectedProps);
2204
2203
  }
2205
2204
  if (node.props) {
2206
2205
  const props = node.props;
2207
2206
  if (props && Object.prototype.hasOwnProperty.call(props, "children")) {
2208
2207
  const mappedChildren = walk(props.children);
2209
2208
  if (mappedChildren !== props.children) {
2210
- return React__namespace.cloneElement(node, void 0, mappedChildren);
2209
+ return React15__namespace.cloneElement(node, void 0, mappedChildren);
2211
2210
  }
2212
2211
  }
2213
2212
  }
@@ -2241,7 +2240,7 @@ var handleTabListKeyDown = (event) => {
2241
2240
  tabs[nextIndex]?.focus();
2242
2241
  event.preventDefault();
2243
2242
  };
2244
- var Tabs = React__namespace.forwardRef((props, ref) => {
2243
+ var Tabs = React15__namespace.forwardRef((props, ref) => {
2245
2244
  const {
2246
2245
  activeKey,
2247
2246
  defaultActiveKey,
@@ -2362,7 +2361,7 @@ var Tabs = React__namespace.forwardRef((props, ref) => {
2362
2361
  );
2363
2362
  });
2364
2363
  Tabs.displayName = "Tabs";
2365
- var Tab = React__namespace.forwardRef((props, ref) => {
2364
+ var Tab = React15__namespace.forwardRef((props, ref) => {
2366
2365
  const {
2367
2366
  label: _label,
2368
2367
  value,
@@ -2437,7 +2436,7 @@ var AppBar = ({
2437
2436
  children,
2438
2437
  ...rest
2439
2438
  }) => {
2440
- const [mobileOpen, setMobileOpen] = React__namespace.useState(false);
2439
+ const [mobileOpen, setMobileOpen] = React15__namespace.useState(false);
2441
2440
  const isDark = color === "primary" || color === "dark";
2442
2441
  const isTransparent = color === "transparent";
2443
2442
  const barClass = tailwindMerge.twMerge(
@@ -2710,7 +2709,7 @@ var avatarRadiusMap = {
2710
2709
  sharp: "rounded-none"
2711
2710
  };
2712
2711
  var isDarkVariant = (variant) => variant === "filled";
2713
- var SocialIcons = ({ socials, dark }) => {
2712
+ var SocialIcons = ({ socials }) => {
2714
2713
  if (!socials) return null;
2715
2714
  if (Array.isArray(socials) && socials.length === 0) return null;
2716
2715
  const isSocialLinkArray = Array.isArray(socials) && socials.length > 0 && "href" in socials[0];
@@ -2818,14 +2817,14 @@ var ProfileCard = ({
2818
2817
  };
2819
2818
  ProfileCard.displayName = "ProfileCard";
2820
2819
  var ProfileCard_default = ProfileCard;
2821
- var Input = React__namespace.default.forwardRef(
2820
+ var Input = React15__namespace.default.forwardRef(
2822
2821
  ({ variant = "outline", size = "medium", rounded = "md", success, error, warn, className, wrapperClassName, label, prepend, append, ...props }, ref) => {
2823
2822
  const { placeholder, onFocus, onBlur, ...inputProps } = props;
2824
- const reactId = React__namespace.default.useId();
2823
+ const reactId = React15__namespace.default.useId();
2825
2824
  const hasLabel = Boolean(label);
2826
2825
  const hasProvidedPlaceholder = typeof placeholder === "string" && placeholder.trim().length > 0;
2827
2826
  const hidePlaceholderUntilFocus = hasLabel && hasProvidedPlaceholder;
2828
- const [isFocused, setIsFocused] = React__namespace.default.useState(false);
2827
+ const [isFocused, setIsFocused] = React15__namespace.default.useState(false);
2829
2828
  const classBase = "input-base transition-colors duration-200 w-full has-[input:disabled]:opacity-50 has-[input:disabled]:cursor-not-allowed";
2830
2829
  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
2830
  const variantClasses5 = {
@@ -2837,7 +2836,7 @@ var Input = React__namespace.default.forwardRef(
2837
2836
  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
2837
  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
2838
  };
2840
- const roundedClasses3 = {
2839
+ const roundedClasses4 = {
2841
2840
  sm: "rounded-sm",
2842
2841
  md: "rounded-md",
2843
2842
  lg: "rounded-lg",
@@ -2845,7 +2844,7 @@ var Input = React__namespace.default.forwardRef(
2845
2844
  "2xl": "rounded-2xl",
2846
2845
  "3xl": "rounded-3xl"
2847
2846
  };
2848
- const sizeClasses5 = {
2847
+ const sizeClasses6 = {
2849
2848
  "x-small": {
2850
2849
  paddingY: "py-2",
2851
2850
  paddingX: "px-2",
@@ -2873,23 +2872,23 @@ var Input = React__namespace.default.forwardRef(
2873
2872
  }
2874
2873
  };
2875
2874
  const status = error ? { tone: "error", message: error } : warn ? { tone: "warn", message: warn } : success ? { tone: "success", message: success } : void 0;
2876
- const statusClasses = {
2875
+ const statusClasses2 = {
2877
2876
  error: "border-red-500 focus:border-red-500 focus:ring-red-400",
2878
2877
  warn: "border-amber-500 focus:border-amber-500 focus:ring-amber-400",
2879
2878
  success: "border-emerald-500 focus:border-emerald-500 focus:ring-emerald-400"
2880
2879
  };
2881
- const statusMessageClasses = {
2880
+ const statusMessageClasses2 = {
2882
2881
  error: "text-red-600 dark:text-red-300",
2883
2882
  warn: "text-amber-600 dark:text-amber-300",
2884
2883
  success: "text-emerald-600 dark:text-emerald-300"
2885
2884
  };
2886
2885
  const variantClass = variantClasses5[variant] ?? variantClasses5.outline;
2887
- const toneClass = status ? statusClasses[status.tone] : void 0;
2886
+ const toneClass = status ? statusClasses2[status.tone] : void 0;
2888
2887
  const hasPrepend = typeof prepend === "string" ? prepend.trim().length > 0 : Boolean(prepend);
2889
2888
  const hasAppend = typeof append === "string" ? append.trim().length > 0 : Boolean(append);
2890
- const sizeConfig = sizeClasses5[size] ?? sizeClasses5.medium;
2889
+ const sizeConfig = sizeClasses6[size] ?? sizeClasses6.medium;
2891
2890
  const sizeClass = [sizeConfig.paddingY, sizeConfig.paddingX, sizeConfig.text].join(" ");
2892
- const roundedClass = variant === "sharp" || variant === "text" || variant === "underlined" ? "rounded-none" : roundedClasses3[rounded];
2891
+ const roundedClass = variant === "sharp" || variant === "text" || variant === "underlined" ? "rounded-none" : roundedClasses4[rounded];
2893
2892
  const inputName = inputProps.name || reactId;
2894
2893
  const basePlaceholder = placeholder ?? (hasLabel ? " " : void 0);
2895
2894
  const placeholderValue = hidePlaceholderUntilFocus ? isFocused ? placeholder : " " : basePlaceholder;
@@ -2944,481 +2943,546 @@ var Input = React__namespace.default.forwardRef(
2944
2943
  ] }),
2945
2944
  hasAppend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 flex items-center", children: renderAppend })
2946
2945
  ] }),
2947
- status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses[status.tone]), children: status.message })
2946
+ status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses2[status.tone]), children: status.message })
2948
2947
  ] });
2949
2948
  }
2950
2949
  );
2951
2950
  Input.displayName = "Input";
2952
2951
  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
2952
  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;
2953
+ 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",
2954
+ 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",
2955
+ 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",
2956
+ 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",
2957
+ 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",
2958
+ 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",
2959
+ 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"
2960
+ };
2961
+ var roundedClasses3 = {
2962
+ sm: "rounded-sm",
2963
+ md: "rounded-md",
2964
+ lg: "rounded-lg",
2965
+ xl: "rounded-xl",
2966
+ "2xl": "rounded-2xl",
2967
+ "3xl": "rounded-3xl"
2968
+ };
2969
+ var sizeClasses3 = {
2970
+ "x-small": {
2971
+ paddingY: "py-2",
2972
+ paddingX: "px-2",
2973
+ text: "text-xs"
2974
+ },
2975
+ small: {
2976
+ paddingY: "py-2.5",
2977
+ paddingX: "px-2.5",
2978
+ text: "text-sm"
2979
+ },
2980
+ medium: {
2981
+ paddingY: "py-3",
2982
+ paddingX: "px-3",
2983
+ text: "text-base"
2984
+ },
2985
+ large: {
2986
+ paddingY: "py-3.5",
2987
+ paddingX: "px-3.5",
2988
+ text: "text-lg"
2989
+ },
2990
+ "x-large": {
2991
+ paddingY: "py-4",
2992
+ paddingX: "px-4",
2993
+ text: "text-xl"
2994
2994
  }
2995
- if (simple) {
2996
- simple.classList.toggle("hidden", mode !== "simple");
2997
- simple.name = mode === "simple" ? textareaName : "";
2995
+ };
2996
+ var statusClasses = {
2997
+ error: "border-red-500 focus:border-red-500 focus:ring-red-400",
2998
+ warn: "border-amber-500 focus:border-amber-500 focus:ring-amber-400",
2999
+ success: "border-emerald-500 focus:border-emerald-500 focus:ring-emerald-400"
3000
+ };
3001
+ var statusMessageClasses = {
3002
+ error: "text-red-600 dark:text-red-300",
3003
+ warn: "text-amber-600 dark:text-amber-300",
3004
+ success: "text-emerald-600 dark:text-emerald-300"
3005
+ };
3006
+ var DEFAULT_TOOLBAR = ["bold", "italic", "underline", "strike", "heading", "bulletList", "orderedList", "blockquote", "codeBlock"];
3007
+ var CODE_BLOCK_LANGUAGES = ["ts", "json", "python", "bash"];
3008
+ var DEFAULT_CODE_BLOCK_LANGUAGE = CODE_BLOCK_LANGUAGES[0];
3009
+ var TEXTAREA_TAB_CHARACTER = " ";
3010
+ var lowlight = lowlight$1.createLowlight(lowlight$1.common);
3011
+ lowlight.registerAlias({ ts: "typescript" });
3012
+ var turndown = new TurndownService__default.default({
3013
+ codeBlockStyle: "fenced",
3014
+ headingStyle: "atx",
3015
+ bulletListMarker: "-"
3016
+ });
3017
+ var markdownToHtml = (markdown) => {
3018
+ if (!markdown) {
3019
+ return "<p></p>";
2998
3020
  }
2999
- if (advancedInput) {
3000
- advancedInput.classList.toggle("hidden", mode !== "advanced");
3001
- advancedInput.name = mode === "advanced" ? textareaName : "";
3021
+ return marked.marked.parse(markdown);
3022
+ };
3023
+ var htmlToMarkdown = (html) => turndown.turndown(html).trim();
3024
+ var createChangeEvent = (element) => ({
3025
+ target: element,
3026
+ currentTarget: element
3027
+ });
3028
+ var assignRef = (ref, value) => {
3029
+ if (typeof ref === "function") {
3030
+ ref(value);
3031
+ return;
3032
+ }
3033
+ if (ref) {
3034
+ ref.current = value;
3002
3035
  }
3003
3036
  };
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({
3037
+ var updateTextareaValue = (element, nextValue, selectionStart, selectionEnd) => {
3038
+ element.value = nextValue;
3039
+ element.setSelectionRange(selectionStart, selectionEnd);
3040
+ };
3041
+ var indentSelectedLines = (value, selectionStart, selectionEnd) => {
3042
+ const lineStart = value.lastIndexOf("\n", Math.max(0, selectionStart - 1)) + 1;
3043
+ const lineEndIndex = value.indexOf("\n", selectionEnd);
3044
+ const lineEnd = lineEndIndex === -1 ? value.length : lineEndIndex;
3045
+ const selectedBlock = value.slice(lineStart, lineEnd);
3046
+ const lines = selectedBlock.split("\n");
3047
+ const indentedBlock = lines.map((line) => `${TEXTAREA_TAB_CHARACTER}${line}`).join("\n");
3048
+ return {
3049
+ nextValue: `${value.slice(0, lineStart)}${indentedBlock}${value.slice(lineEnd)}`,
3050
+ selectionStart: selectionStart + TEXTAREA_TAB_CHARACTER.length,
3051
+ selectionEnd: selectionEnd + lines.length * TEXTAREA_TAB_CHARACTER.length
3052
+ };
3053
+ };
3054
+ var outdentSelectedLines = (value, selectionStart, selectionEnd) => {
3055
+ const lineStart = value.lastIndexOf("\n", Math.max(0, selectionStart - 1)) + 1;
3056
+ const lineEndIndex = value.indexOf("\n", selectionEnd);
3057
+ const lineEnd = lineEndIndex === -1 ? value.length : lineEndIndex;
3058
+ const selectedBlock = value.slice(lineStart, lineEnd);
3059
+ const lines = selectedBlock.split("\n");
3060
+ const updatedLines = lines.map((line) => line.startsWith(TEXTAREA_TAB_CHARACTER) ? line.slice(TEXTAREA_TAB_CHARACTER.length) : line);
3061
+ const removedBeforeSelectionStart = selectionStart === lineStart && !lines[0].startsWith(TEXTAREA_TAB_CHARACTER) ? 0 : lines[0].startsWith(TEXTAREA_TAB_CHARACTER) ? TEXTAREA_TAB_CHARACTER.length : 0;
3062
+ const removedTotal = lines.reduce((count, line) => count + (line.startsWith(TEXTAREA_TAB_CHARACTER) ? TEXTAREA_TAB_CHARACTER.length : 0), 0);
3063
+ return {
3064
+ nextValue: `${value.slice(0, lineStart)}${updatedLines.join("\n")}${value.slice(lineEnd)}`,
3065
+ selectionStart: Math.max(lineStart, selectionStart - removedBeforeSelectionStart),
3066
+ selectionEnd: Math.max(lineStart, selectionEnd - removedTotal)
3067
+ };
3068
+ };
3069
+ var isCodeBlockLanguage = (value) => CODE_BLOCK_LANGUAGES.includes(value);
3070
+ var ToolbarButton = ({ label, active, disabled, onMouseDown }) => /* @__PURE__ */ jsxRuntime.jsx(
3071
+ "button",
3072
+ {
3073
+ type: "button",
3074
+ disabled,
3075
+ onMouseDown,
3076
+ className: tailwindMerge.twMerge(
3077
+ "inline-flex min-w-8 items-center justify-center rounded border px-2 py-1 text-xs font-medium transition-colors",
3078
+ 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",
3079
+ disabled && "cursor-not-allowed opacity-50"
3080
+ ),
3081
+ children: label
3082
+ }
3083
+ );
3084
+ var TextArea = React15__namespace.default.forwardRef(
3085
+ ({ variant = "outline", size = "medium", rounded = "md", success, error, warn, className, wrapperClassName, label, prepend, append, rows = 4, richText = false, toolbar = DEFAULT_TOOLBAR, ...props }, ref) => {
3086
+ const { placeholder, onFocus, onBlur, onChange, onKeyDown, value, defaultValue, disabled, readOnly, ...textareaProps } = props;
3087
+ const reactId = React15__namespace.default.useId();
3088
+ const hasLabel = Boolean(label);
3089
+ const hasProvidedPlaceholder = typeof placeholder === "string" && placeholder.trim().length > 0;
3090
+ const hidePlaceholderUntilFocus = hasLabel && hasProvidedPlaceholder;
3091
+ const [isFocused, setIsFocused] = React15__namespace.default.useState(false);
3092
+ const classBase = "textarea-base transition-colors duration-200 w-full has-[textarea:disabled]:opacity-50 has-[textarea:disabled]:cursor-not-allowed";
3093
+ 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";
3094
+ 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";
3095
+ const hiddenTextareaRef = React15__namespace.default.useRef(null);
3096
+ const forwardedRef = React15__namespace.default.useRef(null);
3097
+ const isControlled = value !== void 0;
3098
+ const markdownValue = typeof value === "string" ? value : typeof defaultValue === "string" ? defaultValue : "";
3099
+ const [internalMarkdown, setInternalMarkdown] = React15__namespace.default.useState(markdownValue);
3100
+ const resolvedMarkdownValue = isControlled ? typeof value === "string" ? value : "" : internalMarkdown;
3101
+ const status = error ? { tone: "error", message: error } : warn ? { tone: "warn", message: warn } : success ? { tone: "success", message: success } : void 0;
3102
+ const variantClass = variantClasses3[variant] ?? variantClasses3.outline;
3103
+ const toneClass = status ? statusClasses[status.tone] : void 0;
3104
+ const hasPrepend = typeof prepend === "string" ? prepend.trim().length > 0 : Boolean(prepend);
3105
+ const hasAppend = typeof append === "string" ? append.trim().length > 0 : Boolean(append);
3106
+ const sizeConfig = sizeClasses3[size] ?? sizeClasses3.medium;
3107
+ const sizeClass = [sizeConfig.paddingY, sizeConfig.paddingX, sizeConfig.text].join(" ");
3108
+ const roundedClass = variant === "sharp" || variant === "text" || variant === "underlined" ? "rounded-none" : roundedClasses3[rounded];
3109
+ const inputName = textareaProps.name || reactId;
3110
+ const basePlaceholder = placeholder ?? (hasLabel ? " " : void 0);
3111
+ const placeholderValue = hidePlaceholderUntilFocus ? isFocused ? placeholder : " " : basePlaceholder;
3112
+ const placeholderClass = hidePlaceholderUntilFocus ? "placeholder-transparent focus:placeholder-gray-500 focus:dark:placeholder-gray-400" : void 0;
3113
+ const editor = react.useEditor({
3114
+ extensions: [
3115
+ StarterKit__default.default.configure({ heading: { levels: [1, 2] }, codeBlock: false }),
3116
+ CodeBlockLowlight__default.default.configure({
3117
+ defaultLanguage: DEFAULT_CODE_BLOCK_LANGUAGE,
3118
+ enableTabIndentation: true,
3119
+ lowlight,
3120
+ HTMLAttributes: {
3121
+ class: "hljs"
3122
+ }
3123
+ }),
3124
+ Underline__default.default
3125
+ ],
3126
+ content: markdownToHtml(resolvedMarkdownValue),
3127
+ editable: richText && !disabled && !readOnly,
3128
+ immediatelyRender: false,
3107
3129
  editorProps: {
3108
- ...editor.options.editorProps,
3109
3130
  attributes: {
3110
- ...editor.options.editorProps?.attributes,
3111
- class: editorContentClass,
3112
- role: "textbox",
3113
- "aria-multiline": "true",
3114
- ...label ? { "aria-labelledby": advancedLabelId } : {}
3131
+ class: tailwindMerge.twMerge(proseBase, placeholderClass),
3132
+ "data-placeholder": placeholderValue ?? ""
3133
+ }
3134
+ },
3135
+ onFocus: () => {
3136
+ if (!richText) {
3137
+ return;
3138
+ }
3139
+ if (hidePlaceholderUntilFocus) {
3140
+ setIsFocused(true);
3141
+ }
3142
+ const target = hiddenTextareaRef.current;
3143
+ if (target) {
3144
+ onFocus?.(createChangeEvent(target));
3145
+ }
3146
+ },
3147
+ onBlur: () => {
3148
+ if (!richText) {
3149
+ return;
3150
+ }
3151
+ if (hidePlaceholderUntilFocus) {
3152
+ setIsFocused(false);
3153
+ }
3154
+ const target = hiddenTextareaRef.current;
3155
+ if (target) {
3156
+ onBlur?.(createChangeEvent(target));
3157
+ }
3158
+ },
3159
+ onUpdate: ({ editor: currentEditor }) => {
3160
+ if (!richText) {
3161
+ return;
3115
3162
  }
3163
+ const nextMarkdown = htmlToMarkdown(currentEditor.getHTML());
3164
+ const target = hiddenTextareaRef.current;
3165
+ setInternalMarkdown(nextMarkdown);
3166
+ if (!target) {
3167
+ return;
3168
+ }
3169
+ target.value = nextMarkdown;
3170
+ onChange?.(createChangeEvent(target));
3116
3171
  }
3117
3172
  });
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
- ),
3173
+ const activeCodeBlockLanguage = (() => {
3174
+ const language = editor?.getAttributes("codeBlock").language;
3175
+ if (typeof language === "string" && isCodeBlockLanguage(language)) {
3176
+ return language;
3177
+ }
3178
+ return DEFAULT_CODE_BLOCK_LANGUAGE;
3179
+ })();
3180
+ React15__namespace.default.useEffect(() => {
3181
+ if (!richText) {
3182
+ return;
3183
+ }
3184
+ const target = hiddenTextareaRef.current;
3185
+ if (!target) {
3186
+ return;
3187
+ }
3188
+ target.value = resolvedMarkdownValue;
3189
+ forwardedRef.current = target;
3190
+ assignRef(ref, target);
3191
+ }, [ref, resolvedMarkdownValue, richText]);
3192
+ React15__namespace.default.useEffect(() => {
3193
+ if (!editor || !richText || !isControlled) {
3194
+ return;
3195
+ }
3196
+ const nextMarkdown = typeof value === "string" ? value : "";
3197
+ const currentMarkdown = htmlToMarkdown(editor.getHTML());
3198
+ if (currentMarkdown === nextMarkdown) {
3199
+ return;
3200
+ }
3201
+ editor.commands.setContent(markdownToHtml(nextMarkdown), { emitUpdate: false });
3202
+ }, [editor, isControlled, richText, value]);
3203
+ React15__namespace.default.useEffect(() => {
3204
+ if (!isControlled) {
3205
+ setInternalMarkdown(typeof defaultValue === "string" ? defaultValue : "");
3206
+ }
3207
+ }, [defaultValue, isControlled]);
3208
+ React15__namespace.default.useEffect(() => {
3209
+ if (!editor || !richText) {
3210
+ return;
3211
+ }
3212
+ editor.setEditable(!disabled && !readOnly);
3213
+ }, [disabled, editor, readOnly, richText]);
3214
+ 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;
3215
+ 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;
3216
+ const handleFocus = (event) => {
3217
+ if (hidePlaceholderUntilFocus) setIsFocused(true);
3218
+ onFocus?.(event);
3219
+ };
3220
+ const handleBlur = (event) => {
3221
+ if (hidePlaceholderUntilFocus) setIsFocused(false);
3222
+ onBlur?.(event);
3223
+ };
3224
+ const handleKeyDown = (event) => {
3225
+ onKeyDown?.(event);
3226
+ if (event.defaultPrevented || event.key !== "Tab" || disabled || readOnly) {
3227
+ return;
3228
+ }
3229
+ const target = event.currentTarget;
3230
+ const { selectionStart, selectionEnd, value: currentValue } = target;
3231
+ event.preventDefault();
3232
+ if (selectionStart !== selectionEnd && currentValue.slice(selectionStart, selectionEnd).includes("\n")) {
3233
+ const nextState = event.shiftKey ? outdentSelectedLines(currentValue, selectionStart, selectionEnd) : indentSelectedLines(currentValue, selectionStart, selectionEnd);
3234
+ updateTextareaValue(target, nextState.nextValue, nextState.selectionStart, nextState.selectionEnd);
3235
+ onChange?.(createChangeEvent(target));
3236
+ return;
3237
+ }
3238
+ if (event.shiftKey) {
3239
+ const lineStart = currentValue.lastIndexOf("\n", Math.max(0, selectionStart - 1)) + 1;
3240
+ if (currentValue.slice(lineStart, selectionStart).endsWith(TEXTAREA_TAB_CHARACTER)) {
3241
+ const nextValue2 = `${currentValue.slice(0, selectionStart - TEXTAREA_TAB_CHARACTER.length)}${currentValue.slice(selectionEnd)}`;
3242
+ const nextPosition2 = selectionStart - TEXTAREA_TAB_CHARACTER.length;
3243
+ updateTextareaValue(target, nextValue2, nextPosition2, nextPosition2);
3244
+ onChange?.(createChangeEvent(target));
3245
+ }
3246
+ return;
3247
+ }
3248
+ const nextValue = `${currentValue.slice(0, selectionStart)}${TEXTAREA_TAB_CHARACTER}${currentValue.slice(selectionEnd)}`;
3249
+ const nextPosition = selectionStart + TEXTAREA_TAB_CHARACTER.length;
3250
+ updateTextareaValue(target, nextValue, nextPosition, nextPosition);
3251
+ onChange?.(createChangeEvent(target));
3252
+ };
3253
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: [
3254
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex w-full items-start gap-2", classBase, variantClass, roundedClass, toneClass, sizeClass, className), children: [
3255
+ hasPrepend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start pt-0.5", children: renderPrepend }),
3256
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-w-0 flex-1", children: [
3257
+ richText ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3192
3258
  /* @__PURE__ */ jsxRuntime.jsx(
3193
- "label",
3259
+ "textarea",
3194
3260
  {
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"
3261
+ ...textareaProps,
3262
+ ref: (node) => {
3263
+ hiddenTextareaRef.current = node;
3264
+ forwardedRef.current = node;
3265
+ if (node) {
3266
+ assignRef(ref, node);
3267
+ }
3268
+ },
3269
+ id: inputName,
3270
+ name: inputName,
3271
+ rows,
3272
+ value: isControlled ? value : void 0,
3273
+ defaultValue: !isControlled ? defaultValue : void 0,
3274
+ disabled,
3275
+ readOnly: true,
3276
+ tabIndex: -1,
3277
+ "aria-hidden": true,
3278
+ className: "sr-only"
3202
3279
  }
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
3280
  ),
3213
- children: [
3214
- /* @__PURE__ */ jsxRuntime.jsx(
3215
- "textarea",
3281
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-1 border-b border-gray-200 pb-2 dark:border-slate-700", children: [
3282
+ toolbar.includes("bold") && /* @__PURE__ */ jsxRuntime.jsx(
3283
+ ToolbarButton,
3216
3284
  {
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
- )
3285
+ label: "B",
3286
+ disabled: !editor?.isEditable,
3287
+ active: editor?.isActive("bold"),
3288
+ onMouseDown: (event) => {
3289
+ event.preventDefault();
3290
+ editor?.chain().focus().toggleBold().run();
3291
+ }
3232
3292
  }
3233
3293
  ),
3234
- label && /* @__PURE__ */ jsxRuntime.jsx(
3235
- "label",
3294
+ toolbar.includes("italic") && /* @__PURE__ */ jsxRuntime.jsx(
3295
+ ToolbarButton,
3236
3296
  {
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
3297
+ label: "I",
3298
+ disabled: !editor?.isEditable,
3299
+ active: editor?.isActive("italic"),
3300
+ onMouseDown: (event) => {
3301
+ event.preventDefault();
3302
+ editor?.chain().focus().toggleItalic().run();
3303
+ }
3247
3304
  }
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",
3305
+ ),
3306
+ toolbar.includes("underline") && /* @__PURE__ */ jsxRuntime.jsx(
3307
+ ToolbarButton,
3262
3308
  {
3263
- id: advancedLabelId,
3264
- className: "text-sm font-medium text-gray-700 dark:text-gray-200",
3265
- children: label
3309
+ label: "U",
3310
+ disabled: !editor?.isEditable,
3311
+ active: editor?.isActive("underline"),
3312
+ onMouseDown: (event) => {
3313
+ event.preventDefault();
3314
+ editor?.chain().focus().toggleUnderline().run();
3315
+ }
3266
3316
  }
3267
3317
  ),
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"
3280
- }
3281
- ),
3282
- /* @__PURE__ */ jsxRuntime.jsx(
3283
- "button",
3284
- {
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"
3318
+ toolbar.includes("strike") && /* @__PURE__ */ jsxRuntime.jsx(
3319
+ ToolbarButton,
3320
+ {
3321
+ label: "S",
3322
+ disabled: !editor?.isEditable,
3323
+ active: editor?.isActive("strike"),
3324
+ onMouseDown: (event) => {
3325
+ event.preventDefault();
3326
+ editor?.chain().focus().toggleStrike().run();
3293
3327
  }
3294
- ),
3328
+ }
3329
+ ),
3330
+ toolbar.includes("heading") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3295
3331
  /* @__PURE__ */ jsxRuntime.jsx(
3296
- "button",
3332
+ ToolbarButton,
3297
3333
  {
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"
3334
+ label: "H1",
3335
+ disabled: !editor?.isEditable,
3336
+ active: editor?.isActive("heading", { level: 1 }),
3337
+ onMouseDown: (event) => {
3338
+ event.preventDefault();
3339
+ editor?.chain().focus().toggleHeading({ level: 1 }).run();
3340
+ }
3306
3341
  }
3307
3342
  ),
3308
3343
  /* @__PURE__ */ jsxRuntime.jsx(
3309
- "button",
3344
+ ToolbarButton,
3310
3345
  {
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"
3346
+ label: "H2",
3347
+ disabled: !editor?.isEditable,
3348
+ active: editor?.isActive("heading", { level: 2 }),
3349
+ onMouseDown: (event) => {
3350
+ event.preventDefault();
3351
+ editor?.chain().focus().toggleHeading({ level: 2 }).run();
3352
+ }
3319
3353
  }
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"
3354
+ )
3355
+ ] }),
3356
+ toolbar.includes("bulletList") && /* @__PURE__ */ jsxRuntime.jsx(
3357
+ ToolbarButton,
3358
+ {
3359
+ label: "List",
3360
+ disabled: !editor?.isEditable,
3361
+ active: editor?.isActive("bulletList"),
3362
+ onMouseDown: (event) => {
3363
+ event.preventDefault();
3364
+ editor?.chain().focus().toggleBulletList().run();
3332
3365
  }
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"
3366
+ }
3367
+ ),
3368
+ toolbar.includes("orderedList") && /* @__PURE__ */ jsxRuntime.jsx(
3369
+ ToolbarButton,
3370
+ {
3371
+ label: "1.",
3372
+ disabled: !editor?.isEditable,
3373
+ active: editor?.isActive("orderedList"),
3374
+ onMouseDown: (event) => {
3375
+ event.preventDefault();
3376
+ editor?.chain().focus().toggleOrderedList().run();
3345
3377
  }
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"
3378
+ }
3379
+ ),
3380
+ toolbar.includes("blockquote") && /* @__PURE__ */ jsxRuntime.jsx(
3381
+ ToolbarButton,
3382
+ {
3383
+ label: "Quote",
3384
+ disabled: !editor?.isEditable,
3385
+ active: editor?.isActive("blockquote"),
3386
+ onMouseDown: (event) => {
3387
+ event.preventDefault();
3388
+ editor?.chain().focus().toggleBlockquote().run();
3358
3389
  }
3359
- ),
3390
+ }
3391
+ ),
3392
+ toolbar.includes("codeBlock") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3360
3393
  /* @__PURE__ */ jsxRuntime.jsx(
3361
- "button",
3362
- {
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,
3394
+ ToolbarButton,
3377
3395
  {
3378
- editor,
3379
- id: advancedEditorId,
3380
- className: "w-full",
3381
- style: minHeightStyle
3396
+ label: "Code",
3397
+ disabled: !editor?.isEditable,
3398
+ active: editor?.isActive("codeBlock"),
3399
+ onMouseDown: (event) => {
3400
+ event.preventDefault();
3401
+ editor?.chain().focus().toggleCodeBlock({ language: activeCodeBlockLanguage }).run();
3402
+ }
3382
3403
  }
3383
3404
  ),
3405
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "sr-only", htmlFor: `${inputName}-code-language`, children: "Code language" }),
3384
3406
  /* @__PURE__ */ jsxRuntime.jsx(
3385
- "textarea",
3407
+ "select",
3386
3408
  {
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
- }
3409
+ id: `${inputName}-code-language`,
3410
+ value: activeCodeBlockLanguage,
3411
+ disabled: !editor?.isEditable,
3412
+ 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",
3413
+ onChange: (event) => {
3414
+ const language = event.target.value;
3415
+ if (!isCodeBlockLanguage(language)) {
3416
+ return;
3417
+ }
3418
+ editor?.chain().focus().setCodeBlock({ language }).run();
3419
+ },
3420
+ children: CODE_BLOCK_LANGUAGES.map((language) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: language, children: language }, language))
3410
3421
  }
3411
3422
  )
3412
- ] }) })
3413
- ]
3414
- }
3415
- )
3416
- ]
3417
- }
3418
- );
3419
- };
3423
+ ] })
3424
+ ] }),
3425
+ /* @__PURE__ */ jsxRuntime.jsx(react.EditorContent, { editor, className: "pt-3" })
3426
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
3427
+ "textarea",
3428
+ {
3429
+ ...textareaProps,
3430
+ ref: (node) => {
3431
+ forwardedRef.current = node;
3432
+ assignRef(ref, node);
3433
+ },
3434
+ id: inputName,
3435
+ name: inputName,
3436
+ rows,
3437
+ placeholder: placeholderValue,
3438
+ onFocus: handleFocus,
3439
+ onBlur: handleBlur,
3440
+ onKeyDown: handleKeyDown,
3441
+ onChange,
3442
+ disabled,
3443
+ readOnly,
3444
+ value,
3445
+ defaultValue,
3446
+ className: tailwindMerge.twMerge(textareaBase, placeholderClass)
3447
+ }
3448
+ ),
3449
+ label && /* @__PURE__ */ jsxRuntime.jsx(
3450
+ "label",
3451
+ {
3452
+ htmlFor: inputName,
3453
+ className: tailwindMerge.twMerge(
3454
+ "absolute left-0 z-10 transition-all duration-150 pointer-events-none text-gray-700 dark:text-gray-200",
3455
+ "-top-2 -translate-y-full text-xs bg-white px-1 dark:bg-slate-900",
3456
+ !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",
3457
+ !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",
3458
+ !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",
3459
+ richText && (isFocused || resolvedMarkdownValue) && "-top-2 -translate-y-full text-xs",
3460
+ richText && !(isFocused || resolvedMarkdownValue) && "top-3 translate-y-0 text-sm bg-transparent px-0 text-gray-500 dark:text-gray-400"
3461
+ ),
3462
+ children: label
3463
+ }
3464
+ )
3465
+ ] }),
3466
+ hasAppend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start pt-0.5", children: renderAppend })
3467
+ ] }),
3468
+ status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses[status.tone]), children: status.message })
3469
+ ] });
3470
+ }
3471
+ );
3472
+ TextArea.displayName = "TextArea";
3420
3473
  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";
3474
+
3475
+ // src/utils/helpers/randomStr.ts
3476
+ var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3477
+ function generateString(length = 5) {
3478
+ let result = "";
3479
+ const charactersLength = characters.length;
3480
+ for (let i = 0; i < length; i++) {
3481
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
3482
+ }
3483
+ return result;
3484
+ }
3485
+ 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
3486
  var variantClasses4 = {
3423
3487
  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
3488
  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 +3492,7 @@ var variantClasses4 = {
3428
3492
  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
3493
  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
3494
  };
3431
- var sizeClasses3 = {
3495
+ var sizeClasses4 = {
3432
3496
  "x-small": { padding: "pl-2 pr-8 py-2", text: "text-xs" },
3433
3497
  small: { padding: "pl-2.5 pr-9 py-2.5", text: "text-sm" },
3434
3498
  medium: { padding: "pl-3 pr-10 py-3", text: "text-base" },
@@ -3470,7 +3534,7 @@ var resolveIconClassName4 = (icon) => {
3470
3534
  const classes = [...baseClasses, normalizedName];
3471
3535
  return Array.from(new Set(classes)).join(" ");
3472
3536
  };
3473
- var Select = React__namespace.default.forwardRef(
3537
+ var Select = React15__namespace.default.forwardRef(
3474
3538
  ({
3475
3539
  options,
3476
3540
  label,
@@ -3496,7 +3560,7 @@ var Select = React__namespace.default.forwardRef(
3496
3560
  const selectId = id || name || generateString();
3497
3561
  const inputName = name || selectId;
3498
3562
  const variantClass = variantClasses4[variant] ?? variantClasses4.outline;
3499
- const sizeConfig = sizeClasses3[size] ?? sizeClasses3.medium;
3563
+ const sizeConfig = sizeClasses4[size] ?? sizeClasses4.medium;
3500
3564
  const sizeClass = `${sizeConfig.padding} ${sizeConfig.text}`;
3501
3565
  const normalizedOptions = options.map(normalizeOption);
3502
3566
  const selectedValueList = value !== void 0 ? (Array.isArray(value) ? value : [value]).map(String) : defaultValue !== void 0 ? (Array.isArray(defaultValue) ? defaultValue : [defaultValue]).map(String) : [];
@@ -3534,7 +3598,7 @@ var Select = React__namespace.default.forwardRef(
3534
3598
  "summary",
3535
3599
  {
3536
3600
  className: tailwindMerge.twMerge(
3537
- baseClass2,
3601
+ baseClass,
3538
3602
  variantClass,
3539
3603
  sizeClass,
3540
3604
  "list-none cursor-pointer flex items-center justify-between pr-10 relative [&::-webkit-details-marker]:hidden",
@@ -3668,19 +3732,19 @@ var Slider = ({
3668
3732
  const resolvedMax = toNumber(max, resolvedMin < 100 ? 100 : resolvedMin);
3669
3733
  const resolvedStep = toNumber(step, 1);
3670
3734
  const isControlled = typeof value === "number";
3671
- const [internalValue, setInternalValue] = React.useState(
3735
+ const [internalValue, setInternalValue] = React15.useState(
3672
3736
  clamp(
3673
3737
  typeof value === "number" ? value : typeof defaultValue === "number" ? defaultValue : resolvedMin,
3674
3738
  resolvedMin,
3675
3739
  resolvedMax
3676
3740
  )
3677
3741
  );
3678
- React.useEffect(() => {
3742
+ React15.useEffect(() => {
3679
3743
  if (isControlled && typeof value === "number") {
3680
3744
  setInternalValue(clamp(value, resolvedMin, resolvedMax));
3681
3745
  }
3682
3746
  }, [isControlled, value, resolvedMin, resolvedMax]);
3683
- React.useEffect(() => {
3747
+ React15.useEffect(() => {
3684
3748
  if (!isControlled) {
3685
3749
  setInternalValue((prev) => clamp(prev, resolvedMin, resolvedMax));
3686
3750
  }
@@ -3783,7 +3847,7 @@ var thumbActiveClasses = {
3783
3847
  surface: "border-gray-900 shadow-[0_4px_12px_rgba(15,23,42,0.32)]",
3784
3848
  bw: "border-black shadow-[0_4px_12px_rgba(0,0,0,0.32)]"
3785
3849
  };
3786
- var Switch = React.forwardRef(
3850
+ var Switch = React15.forwardRef(
3787
3851
  ({
3788
3852
  color = "primary",
3789
3853
  size = "medium",
@@ -3802,10 +3866,10 @@ var Switch = React.forwardRef(
3802
3866
  const focusClass = focusRingClasses[color] ?? focusRingClasses.primary;
3803
3867
  const thumbActive = thumbActiveClasses[color] ?? thumbActiveClasses.primary;
3804
3868
  const isControlled = checked !== void 0;
3805
- const [internalChecked, setInternalChecked] = React.useState(
3869
+ const [internalChecked, setInternalChecked] = React15.useState(
3806
3870
  Boolean((isControlled ? checked : defaultChecked) ?? false)
3807
3871
  );
3808
- React.useEffect(() => {
3872
+ React15.useEffect(() => {
3809
3873
  if (isControlled) {
3810
3874
  setInternalChecked(Boolean(checked));
3811
3875
  }
@@ -3878,7 +3942,7 @@ var Switch = React.forwardRef(
3878
3942
  );
3879
3943
  Switch.displayName = "Switch";
3880
3944
  var Switch_default = Switch;
3881
- var sizeClasses4 = {
3945
+ var sizeClasses5 = {
3882
3946
  "x-small": "text-xs",
3883
3947
  small: "text-sm",
3884
3948
  medium: "text-base",
@@ -3916,7 +3980,7 @@ var Icon = ({ className, icon, size, color, ...rest }) => {
3916
3980
  }
3917
3981
  }
3918
3982
  const classBase = "mdi";
3919
- const sizeClass = size ? sizeClasses4[size] ?? sizeClasses4.medium : void 0;
3983
+ const sizeClass = size ? sizeClasses5[size] ?? sizeClasses5.medium : void 0;
3920
3984
  const colorClass = color ? colorClasses2[color] ?? colorClasses2.primary : void 0;
3921
3985
  return /* @__PURE__ */ jsxRuntime.jsx("i", { ...rest, className: tailwindMerge.twMerge(classBase, iconValue, sizeClass, colorClass, className) });
3922
3986
  };
@@ -4040,7 +4104,7 @@ var resolveIconClassName5 = (icon) => {
4040
4104
  return `mdi ${library} ${normalized}`.trim();
4041
4105
  };
4042
4106
  var resolveIconNode2 = (icon, fallbackClassName) => {
4043
- if (React__namespace.isValidElement(icon)) return icon;
4107
+ if (React15__namespace.isValidElement(icon)) return icon;
4044
4108
  const iconClassName = resolveIconClassName5(icon) ?? fallbackClassName;
4045
4109
  if (!iconClassName) return null;
4046
4110
  const hasBase = iconClassName.split(" ").some((token) => token.trim() === "mdi");
@@ -4172,7 +4236,7 @@ var Notification = ({
4172
4236
  };
4173
4237
  var Notification_default = Notification;
4174
4238
  var useNotification = (defaultMessage) => {
4175
- const [messages, setMessages] = React.useState([]);
4239
+ const [messages, setMessages] = React15.useState([]);
4176
4240
  const clearNotifications = (key) => {
4177
4241
  setMessages((prev) => key ? prev.filter((notification) => notification.key !== key) : []);
4178
4242
  };
@@ -4309,10 +4373,7 @@ var LineProgress = ({
4309
4373
  /* @__PURE__ */ jsxRuntime.jsx(
4310
4374
  "div",
4311
4375
  {
4312
- className: tailwindMerge.twMerge(
4313
- "h-full rounded-full transition-[width] duration-300 ease-out",
4314
- status === "active" ? "animate-pulse" : void 0
4315
- ),
4376
+ className: tailwindMerge.twMerge("h-full rounded-full transition-[width] duration-300 ease-out", status === "active" ? "animate-pulse" : void 0),
4316
4377
  style: barStyle
4317
4378
  }
4318
4379
  ),
@@ -4451,7 +4512,7 @@ var Progress = (props) => {
4451
4512
  const percent = clampPercent(toNumber2(rawPercent));
4452
4513
  const successPercent = clampPercent(toNumber2(success?.percent));
4453
4514
  const status = providedStatus ?? (percent >= 100 ? "success" : "normal");
4454
- const resolvedClassName = tailwindMerge.twMerge("min-w-[200px]", className);
4515
+ const resolvedClassName = tailwindMerge.twMerge("min-w-50", className);
4455
4516
  if (type === "circle" || type === "dashboard") {
4456
4517
  return /* @__PURE__ */ jsxRuntime.jsx(
4457
4518
  CircleProgress,
@@ -4567,7 +4628,7 @@ var resolveIconNode3 = (icon) => {
4567
4628
  const iconClass = resolveIconClassName2(icon);
4568
4629
  return iconClass ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: iconClass, "aria-hidden": true }) : null;
4569
4630
  };
4570
- var TimeLineItem = React__namespace.forwardRef((props, ref) => {
4631
+ var TimeLineItem = React15__namespace.forwardRef((props, ref) => {
4571
4632
  const {
4572
4633
  title,
4573
4634
  subtitle,
@@ -4686,13 +4747,13 @@ var TimeLineItem = React__namespace.forwardRef((props, ref) => {
4686
4747
  });
4687
4748
  TimeLineItem.displayName = "TimeLine.Item";
4688
4749
  var isTimeLineItem = (child) => {
4689
- if (!React__namespace.isValidElement(child)) {
4750
+ if (!React15__namespace.isValidElement(child)) {
4690
4751
  return false;
4691
4752
  }
4692
4753
  const elementType = child.type;
4693
4754
  return child.type === TimeLineItem || elementType.displayName === TimeLineItem.displayName;
4694
4755
  };
4695
- var TimeLine = React__namespace.forwardRef((props, ref) => {
4756
+ var TimeLine = React15__namespace.forwardRef((props, ref) => {
4696
4757
  const {
4697
4758
  side = "right",
4698
4759
  axis = "center",
@@ -4707,12 +4768,12 @@ var TimeLine = React__namespace.forwardRef((props, ref) => {
4707
4768
  ...rest
4708
4769
  } = props;
4709
4770
  const resolvedGap = densityGapClasses[density] ?? densityGapClasses.default;
4710
- const childArray = React__namespace.Children.toArray(children);
4771
+ const childArray = React15__namespace.Children.toArray(children);
4711
4772
  const resolvedChildren = childArray.map((child, index) => {
4712
4773
  if (!isTimeLineItem(child)) {
4713
4774
  return child;
4714
4775
  }
4715
- return React__namespace.cloneElement(child, {
4776
+ return React15__namespace.cloneElement(child, {
4716
4777
  __timelineSide: side,
4717
4778
  __timelineAxis: axis,
4718
4779
  __timelineAlign: align,