@keboola/design 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +25 -0
  2. package/dist/icons.cjs +731 -0
  3. package/dist/icons.cjs.map +1 -0
  4. package/dist/icons.js +29 -0
  5. package/dist/icons.js.map +1 -0
  6. package/dist/index.cjs +429 -333
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +426 -331
  9. package/dist/index.js.map +1 -1
  10. package/dist/markdown-editor.cjs +270 -135
  11. package/dist/markdown-editor.cjs.map +1 -1
  12. package/dist/markdown-editor.js +270 -135
  13. package/dist/markdown-editor.js.map +1 -1
  14. package/dist/mermaid.cjs +24 -15
  15. package/dist/mermaid.cjs.map +1 -1
  16. package/dist/mermaid.js +24 -15
  17. package/dist/mermaid.js.map +1 -1
  18. package/dist/styles.css +1 -1
  19. package/package.json +12 -5
  20. package/src/blocks/AIKit/CollapsibleStepHeader.tsx +7 -8
  21. package/src/blocks/AIKit/InlineStepLabel.tsx +7 -7
  22. package/src/blocks/AIKit/MessageBubble.stories.tsx +11 -3
  23. package/src/blocks/AIKit/MessageBubble.tsx +1 -1
  24. package/src/blocks/AIKit/PlanApproval.tsx +9 -8
  25. package/src/blocks/AIKit/PlanRewritingIndicator.tsx +2 -2
  26. package/src/blocks/AIKit/PromptInput.stories.tsx +10 -2
  27. package/src/blocks/AIKit/PromptInputSubmit.tsx +12 -8
  28. package/src/blocks/AIKit/Question.tsx +8 -9
  29. package/src/blocks/AIKit/SuggestedPrompt.tsx +12 -5
  30. package/src/blocks/AIKit/ThinkingIndicator.tsx +2 -2
  31. package/src/blocks/AutoSaveTextarea/AutoSaveTextarea.tsx +4 -4
  32. package/src/blocks/ClipboardButton/ClipboardButton.tsx +7 -5
  33. package/src/blocks/ClipboardButton/ClipboardInline.tsx +2 -3
  34. package/src/blocks/ColorInput/ColorInput.tsx +4 -2
  35. package/src/blocks/ColorInput/ColorPicker.tsx +5 -2
  36. package/src/blocks/EmptyState/EmptyState.tsx +16 -0
  37. package/src/blocks/ErrorState/ErrorState.tsx +15 -0
  38. package/src/blocks/Form/formHook.ts +15 -0
  39. package/src/blocks/MultiActionButtonGroup/MultiActionButton.stories.tsx +12 -11
  40. package/src/blocks/MultiActionButtonGroup/MultiActionButton.tsx +4 -4
  41. package/src/blocks/MultiCombobox/MultiCombobox.tsx +28 -12
  42. package/src/blocks/PageHeader/AGENTS.md +63 -3
  43. package/src/blocks/PageHeader/PageHeader.stories.tsx +124 -28
  44. package/src/blocks/PageHeader/PageHeader.tsx +15 -0
  45. package/src/blocks/PageHeader/PageHeaderDetail.tsx +23 -1
  46. package/src/blocks/PageHeader/PageHeaderIndex.tsx +20 -1
  47. package/src/blocks/PageLayout/PageLayout.tsx +26 -0
  48. package/src/blocks/PageToolbar/PageToolbar.stories.tsx +348 -0
  49. package/src/blocks/PageToolbar/PageToolbar.tsx +119 -0
  50. package/src/blocks/PageToolbar/index.ts +1 -0
  51. package/src/blocks/PasswordInput/PasswordInput.tsx +10 -10
  52. package/src/blocks/SearchInput/SearchInput.tsx +30 -4
  53. package/src/blocks/SearchInputWithNavigation/SearchInputWithNavigation.tsx +9 -6
  54. package/src/blocks/SplitButton/SplitButton.stories.tsx +7 -4
  55. package/src/blocks/SplitButton/SplitButton.tsx +17 -4
  56. package/src/blocks/Tagger/TagItem.tsx +4 -1
  57. package/src/blocks/Tagger/TagSelectPopover/TagSelectCreateItem.tsx +3 -1
  58. package/src/blocks/Tagger/TagSelectPopover/TagSelectList.tsx +2 -2
  59. package/src/blocks/Tagger/Tagger.tsx +2 -2
  60. package/src/components/Alert/Alert.stories.tsx +11 -3
  61. package/src/components/Alert/Alert.tsx +19 -1
  62. package/src/components/Alert/AlertCollapsibleIcon.tsx +3 -4
  63. package/src/components/Alert/AlertIcon.tsx +18 -21
  64. package/src/components/Badge/Badge.stories.tsx +22 -4
  65. package/src/components/Badge/Badge.tsx +16 -0
  66. package/src/components/Badge/BadgeButton.tsx +7 -6
  67. package/src/components/Breadcrumb/BreadcrumbEllipsis.tsx +2 -2
  68. package/src/components/Breadcrumb/BreadcrumbSeparator.tsx +2 -2
  69. package/src/components/Button/Button.stories.tsx +14 -2
  70. package/src/components/Button/Button.tsx +42 -5
  71. package/src/components/Button/styles.ts +4 -6
  72. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +32 -10
  73. package/src/components/Card/Card.tsx +17 -0
  74. package/src/components/Checkbox/Checkbox.tsx +3 -6
  75. package/src/components/CodeEditor/highlighting.ts +1 -1
  76. package/src/components/CollapsiblePanel.tsx +2 -5
  77. package/src/components/Combobox/Combobox.tsx +12 -14
  78. package/src/components/Combobox/ComboboxChips.tsx +6 -1
  79. package/src/components/Combobox/ComboboxItem.tsx +3 -4
  80. package/src/components/Combobox/ComboboxItemIndicator.tsx +6 -4
  81. package/src/components/Combobox/types.ts +2 -6
  82. package/src/components/Command/Command.stories.tsx +47 -56
  83. package/src/components/Command/CommandItem/CheckIndicator.tsx +26 -14
  84. package/src/components/Command/CommandItem/CommandItem.tsx +6 -3
  85. package/src/components/DropdownMenu/DropdownMenu.stories.tsx +8 -4
  86. package/src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx +4 -1
  87. package/src/components/DropdownMenu/DropdownMenuItem.tsx +12 -6
  88. package/src/components/DropdownMenu/DropdownMenuItemIndicator.tsx +12 -6
  89. package/src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx +8 -5
  90. package/src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubTrigger.tsx +2 -2
  91. package/src/components/DropdownMenu/ItemIcon.tsx +16 -8
  92. package/src/components/FormGroup/FormGroup.tsx +15 -0
  93. package/src/components/FullScreenModal/FullScreenModalHeader.tsx +4 -1
  94. package/src/components/Input/DateInput/DateInput.tsx +4 -1
  95. package/src/components/Input/DateRangeInput/DateRangeInput.tsx +4 -6
  96. package/src/components/Input/Input.tsx +18 -2
  97. package/src/components/Input/TextInput/TextInput.tsx +16 -0
  98. package/src/components/Input/TimeInput/TimeInput.tsx +4 -1
  99. package/src/components/InputGroup/InputGroup.stories.tsx +11 -3
  100. package/src/components/MarkdownEditor/MarkdownEditor.stories.tsx +63 -1
  101. package/src/components/MarkdownEditor/MarkdownEditor.tsx +105 -15
  102. package/src/components/MarkdownEditor/nodes/ImageNode.tsx +10 -10
  103. package/src/components/MarkdownEditor/nodes/MermaidNode.tsx +8 -8
  104. package/src/components/MarkdownEditor/plugins/KeyboardPlugin.tsx +47 -3
  105. package/src/components/MarkdownEditor/plugins/MarkdownSyncPlugin.tsx +12 -3
  106. package/src/components/MarkdownEditor/plugins/ToolbarPlugin.tsx +20 -10
  107. package/src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx +20 -14
  108. package/src/components/MarkdownEditor/plugins/toolbar/BlockTypeDropdown.tsx +25 -16
  109. package/src/components/MarkdownEditor/plugins/toolbar/LinkPanel.tsx +3 -3
  110. package/src/components/MarkdownEditor/transformers.ts +10 -0
  111. package/src/components/MergeEditor/AcceptControls/AcceptButton.tsx +9 -4
  112. package/src/components/MergeEditor/AcceptControls/AcceptControls.tsx +25 -14
  113. package/src/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.tsx +2 -2
  114. package/src/components/MergeEditor/MergeEditor.stories.tsx +15 -0
  115. package/src/components/MergeEditor/MergeEditor.tsx +9 -0
  116. package/src/components/MergeEditor/MergePane.tsx +22 -4
  117. package/src/components/MergeEditor/decorations.ts +2 -2
  118. package/src/components/Modal/Modal.stories.tsx +6 -4
  119. package/src/components/Modal/Modal.tsx +26 -0
  120. package/src/components/Modal/ModalBody.tsx +5 -0
  121. package/src/components/Modal/ModalCloseIcon.tsx +2 -3
  122. package/src/components/Modal/ModalContent.tsx +8 -0
  123. package/src/components/Modal/ModalFooter.tsx +5 -0
  124. package/src/components/Modal/ModalHeader.tsx +11 -0
  125. package/src/components/Modal/ModalIcon.tsx +45 -19
  126. package/src/components/Navbar/Navbar.stories.tsx +26 -13
  127. package/src/components/Navbar/NavbarMenuButton.tsx +11 -10
  128. package/src/components/Pagination/PaginationEllipsis.tsx +2 -2
  129. package/src/components/Pagination/PaginationNext.tsx +2 -1
  130. package/src/components/Pagination/PaginationPrevious.tsx +4 -1
  131. package/src/components/PanelWithDetails.tsx +3 -4
  132. package/src/components/Popconfirm/Popconfirm.stories.tsx +13 -5
  133. package/src/components/RadioGroup/Radio.tsx +6 -12
  134. package/src/components/Search/ClearButton.tsx +2 -2
  135. package/src/components/Search/Search.tsx +3 -3
  136. package/src/components/Select/Select.tsx +16 -5
  137. package/src/components/Select/SelectContent.tsx +13 -4
  138. package/src/components/Select/SelectItem.tsx +6 -5
  139. package/src/components/Select/SelectTrigger.tsx +2 -2
  140. package/src/components/Sidebar/Sidebar.stories.tsx +55 -19
  141. package/src/components/Sidebar/SidebarGroup/SidebarGroupAction.tsx +8 -4
  142. package/src/components/Sidebar/SidebarMenu/SidebarMenuButton.tsx +4 -2
  143. package/src/components/Sidebar/SidebarMenu/SidebarMenuCard.tsx +3 -2
  144. package/src/components/Sidebar/SidebarMenu/SidebarMenuIcon.tsx +12 -12
  145. package/src/components/Sidebar/SidebarMenu/SidebarMenuSub.tsx +3 -7
  146. package/src/components/Sidebar/SidebarMenu/SidebarSearchInput.tsx +3 -5
  147. package/src/components/Skeleton/Skeleton.stories.tsx +52 -0
  148. package/src/components/Skeleton/Skeleton.tsx +24 -1
  149. package/src/components/Table/Table.stories.tsx +223 -1
  150. package/src/components/Table/Table.tsx +17 -0
  151. package/src/components/Tabs.tsx +25 -2
  152. package/src/components/Toast/ToastDismiss.tsx +3 -3
  153. package/src/components/Toast/ToastRoot.tsx +24 -19
  154. package/src/components/Toggle/Toggle.tsx +11 -6
  155. package/src/components/Tooltip/Tooltip.tsx +23 -0
  156. package/src/components/ZoomableSvg/ZoomableSvg.tsx +8 -6
  157. package/src/icons/Keboola.tsx +28 -0
  158. package/src/icons/icons.stories.tsx +174 -0
  159. package/src/icons/index.ts +180 -0
  160. package/src/index.ts +1 -0
  161. package/src/patterns/AlertWithAction.stories.tsx +30 -0
  162. package/src/patterns/CardWithEmptyState.stories.tsx +66 -0
  163. package/src/patterns/ConfirmDialog.stories.tsx +72 -0
  164. package/src/patterns/CreatableMultiCombobox.stories.tsx +33 -0
  165. package/src/patterns/DataCardWithSkeleton.stories.tsx +48 -0
  166. package/src/patterns/DisabledButtonTooltip.stories.tsx +30 -0
  167. package/src/patterns/FilterToolbar.stories.tsx +71 -0
  168. package/src/patterns/InfoTooltip.stories.tsx +56 -0
  169. package/src/patterns/ListDetail.stories.tsx +65 -0
  170. package/src/patterns/ModalForm.stories.tsx +59 -0
  171. package/src/patterns/PageHeaderTabs.stories.tsx +48 -0
  172. package/src/styles.css +16 -8
  173. package/src/utils/legacyIcon.tsx +28 -0
@@ -6,6 +6,7 @@ var reactTooltip = require('@radix-ui/react-tooltip');
6
6
  var classVarianceAuthority = require('class-variance-authority');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var react = require('react');
9
+ var lucideReact = require('lucide-react');
9
10
  var reactFontawesome = require('@fortawesome/react-fontawesome');
10
11
  require('@awesome.me/kit-be8bcf7e5e/icons');
11
12
  var reactSlot = require('@radix-ui/react-slot');
@@ -39,6 +40,7 @@ var utils = require('@lexical/utils');
39
40
  var DropdownMenuPrimitive3 = require('@radix-ui/react-dropdown-menu');
40
41
  var ScrollAreaPrimitive2 = require('@radix-ui/react-scroll-area');
41
42
  var TextareaAutosize = require('react-textarea-autosize');
43
+ var icons = require('@keboola/design/icons');
42
44
  var RLabel = require('@radix-ui/react-label');
43
45
 
44
46
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -459,10 +461,21 @@ var init_Skeleton = __esm({
459
461
  Skeleton = ({ height = "md", className, count = 1 }) => {
460
462
  const prefixId = react.useId();
461
463
  const keys = Array.from({ length: count }, (_, i) => `${prefixId}-${i}`);
462
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: keys.map((key) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(HEIGHT_CLASS_NAME[height], ANIMATION_CLASS_NAME, className) }, key)) });
464
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: keys.map((key) => /* @__PURE__ */ jsxRuntime.jsx(
465
+ "div",
466
+ {
467
+ "data-skeleton": "true",
468
+ className: cn(HEIGHT_CLASS_NAME[height], ANIMATION_CLASS_NAME, className)
469
+ },
470
+ key
471
+ )) });
463
472
  };
464
473
  }
465
474
  });
475
+ var init_icons = __esm({
476
+ "src/icons/index.ts"() {
477
+ }
478
+ });
466
479
  var Icon;
467
480
  var init_Icon = __esm({
468
481
  "src/components/Icon/Icon.tsx"() {
@@ -668,12 +681,10 @@ var init_styles = __esm({
668
681
  "focus-visible:tw-ring-primary/50"
669
682
  ],
670
683
  secondary: [
671
- "tw-bg-secondary",
672
- "tw-text-secondary-foreground",
673
- "hover:tw-bg-secondary/80",
674
- "hover:tw-text-secondary-foreground",
675
- "focus:tw-text-secondary-foreground",
676
- "focus-visible:tw-border-secondary",
684
+ "tw-bg-primary/10",
685
+ "tw-text-primary",
686
+ "hover:not-disabled:tw-bg-primary/20",
687
+ "focus-visible:tw-border-primary",
677
688
  "focus-visible:tw-ring-primary/50"
678
689
  ],
679
690
  // should be called "destructive" by Figma
@@ -735,6 +746,7 @@ var init_styles = __esm({
735
746
  var Button;
736
747
  var init_Button = __esm({
737
748
  "src/components/Button/Button.tsx"() {
749
+ init_icons();
738
750
  init_utils();
739
751
  init_Icon2();
740
752
  init_styles();
@@ -744,7 +756,6 @@ var init_Button = __esm({
744
756
  disabled = false,
745
757
  className,
746
758
  type = "button",
747
- icon: iconProp,
748
759
  isLoading = false,
749
760
  asChild = false,
750
761
  onClick,
@@ -752,10 +763,10 @@ var init_Button = __esm({
752
763
  variant = "primary",
753
764
  size = "medium",
754
765
  block = false,
766
+ icon,
755
767
  ...buttonProps
756
768
  }) => {
757
769
  const Comp = asChild ? reactSlot.Root : "button";
758
- const icon = isLoading ? "spinner" : iconProp;
759
770
  const classNames = argo ? argoVariants({ variant, size, block, className }) : variants({
760
771
  size,
761
772
  variant,
@@ -778,12 +789,13 @@ var init_Button = __esm({
778
789
  disabled,
779
790
  "aria-disabled": disabled,
780
791
  "data-variant": variant,
781
- "data-icon-only": !children,
792
+ "data-icon-only": String(size).startsWith("icon"),
782
793
  type,
783
794
  onClick: handleClick,
784
795
  className: cn(classNames),
785
796
  children: [
786
- icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { spin: isLoading, icon }),
797
+ isLoading && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "tw-size-4 tw-shrink-0 tw-animate-spin" }),
798
+ !isLoading && icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon }),
787
799
  /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children })
788
800
  ]
789
801
  }
@@ -922,7 +934,8 @@ var init_ClipboardButton = __esm({
922
934
  "src/blocks/ClipboardButton/ClipboardButton.tsx"() {
923
935
  init_Button2();
924
936
  init_Clipboard2();
925
- DEFAULT_ICON = "copy";
937
+ init_icons();
938
+ DEFAULT_ICON = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, {});
926
939
  ClipboardButton = ({
927
940
  // clipboard props
928
941
  text,
@@ -942,7 +955,10 @@ var init_ClipboardButton = __esm({
942
955
  tooltipPlacement,
943
956
  tooltipVariant,
944
957
  text,
945
- children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...rest, icon, variant, disabled: !text, children })
958
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { ...rest, variant, disabled: !text, children: [
959
+ icon,
960
+ children
961
+ ] })
946
962
  }
947
963
  );
948
964
  }
@@ -958,6 +974,7 @@ var MIN_SCALE, MAX_SCALE, ZOOM_STEP, ZoomableSvg;
958
974
  var init_ZoomableSvg = __esm({
959
975
  "src/components/ZoomableSvg/ZoomableSvg.tsx"() {
960
976
  init_ClipboardButton2();
977
+ init_icons();
961
978
  init_utils();
962
979
  init_Button2();
963
980
  init_Tooltip2();
@@ -1094,10 +1111,10 @@ var init_ZoomableSvg = __esm({
1094
1111
  {
1095
1112
  size: "icon-sm",
1096
1113
  variant: "outline",
1097
- icon: isFullscreen ? "down-left-and-up-right-to-center" : "up-right-and-down-left-from-center",
1098
1114
  "aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
1099
1115
  onClick: () => setIsFullscreen((f) => !f),
1100
- argo: true
1116
+ argo: true,
1117
+ children: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, { className: "tw-size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { className: "tw-size-4" })
1101
1118
  }
1102
1119
  )
1103
1120
  }
@@ -1538,8 +1555,13 @@ var $isMermaidNode = (node) => {
1538
1555
  init_utils();
1539
1556
 
1540
1557
  // src/components/Toast/ToastRoot.tsx
1558
+ init_icons();
1541
1559
  init_utils();
1560
+
1561
+ // src/utils/legacyIcon.tsx
1542
1562
  init_Icon2();
1563
+ var isFAIconValue = (value) => typeof value === "string" || Array.isArray(value) && value.length === 2 && typeof value[0] === "string" && typeof value[1] === "string";
1564
+ var renderLegacyIcon = (value) => isFAIconValue(value) ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: value }) : value;
1543
1565
 
1544
1566
  // src/components/Toast/ToastAction.tsx
1545
1567
  init_utils();
@@ -1602,8 +1624,8 @@ var ToastDescription = ({
1602
1624
  );
1603
1625
 
1604
1626
  // src/components/Toast/ToastDismiss.tsx
1627
+ init_icons();
1605
1628
  init_utils();
1606
- init_Icon2();
1607
1629
  var ToastDismiss = ({
1608
1630
  ref,
1609
1631
  className,
@@ -1621,7 +1643,7 @@ var ToastDismiss = ({
1621
1643
  "tailwindcss-preflight",
1622
1644
  "[&_svg]:tw-aspect-square",
1623
1645
  "[&_svg]:tw-size-4",
1624
- "[&_svg]:tw-p-1",
1646
+ "[&_svg]:tw-m-1",
1625
1647
  "tw-text-white",
1626
1648
  "group-data-[variant=default]/toast:[&_svg]:tw-text-popover-foreground",
1627
1649
  className
@@ -1629,7 +1651,7 @@ var ToastDismiss = ({
1629
1651
  type: "button",
1630
1652
  ...rest,
1631
1653
  children: [
1632
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "times" }),
1654
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}),
1633
1655
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-sr-only", children: "Dismiss" })
1634
1656
  ]
1635
1657
  }
@@ -1737,10 +1759,10 @@ var variants2 = classVarianceAuthority.cva(
1737
1759
  }
1738
1760
  );
1739
1761
  var DEFAULT_VARIANT_ICON = {
1740
- error: "exclamation-triangle",
1741
- info: "info-circle",
1742
- success: "check-circle",
1743
- warning: "exclamation-circle"
1762
+ error: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, {}),
1763
+ info: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, {}),
1764
+ success: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, {}),
1765
+ warning: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, {})
1744
1766
  };
1745
1767
  var ToastRoot = ({
1746
1768
  id,
@@ -1753,8 +1775,8 @@ var ToastRoot = ({
1753
1775
  icon: iconProp
1754
1776
  }) => {
1755
1777
  const icon = (() => {
1756
- if (loading) return "spinner";
1757
- if (iconProp) return iconProp;
1778
+ if (loading) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "tw-animate-spin" });
1779
+ if (iconProp) return renderLegacyIcon(iconProp);
1758
1780
  if (variant === "default" || variant === null) return null;
1759
1781
  return DEFAULT_VARIANT_ICON[variant];
1760
1782
  })();
@@ -1764,20 +1786,24 @@ var ToastRoot = ({
1764
1786
  };
1765
1787
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-variant": variant, className: cn(variants2({ variant })), children: [
1766
1788
  icon && /* @__PURE__ */ jsxRuntime.jsx(
1767
- Icon,
1789
+ "span",
1768
1790
  {
1769
1791
  "data-slot": "toast-icon",
1770
- spin: loading,
1771
1792
  className: cn(
1772
- // styles
1793
+ "tw-inline-flex",
1794
+ "tw-items-center",
1795
+ "tw-justify-center",
1796
+ // styles — container at 20px with no padding so the 20px Lucide
1797
+ // glyph fills the slot (previous tw-size-4 + tw-p-1 clipped a
1798
+ // 16px child into 8px of visible space)
1773
1799
  "tw-aspect-square",
1774
- "tw-size-4",
1800
+ "tw-size-5",
1775
1801
  "tw-shrink-0",
1776
- "tw-p-1",
1802
+ "[&_svg]:tw-size-5",
1777
1803
  "tw-text-white",
1778
1804
  "group-data-[variant=default]/toast:tw-text-popover-foreground"
1779
1805
  ),
1780
- icon
1806
+ children: icon
1781
1807
  }
1782
1808
  ),
1783
1809
  /* @__PURE__ */ jsxRuntime.jsx(ToastTitle, { children: title }),
@@ -1952,12 +1978,23 @@ var ImagePastePlugin = ({ onImageUpload }) => {
1952
1978
  }, [editor]);
1953
1979
  return null;
1954
1980
  };
1955
- var KeyboardPlugin = ({ onSave, onCancel }) => {
1981
+ var KeyboardPlugin = ({
1982
+ onSave,
1983
+ onCancel,
1984
+ singleLine,
1985
+ blurOnEscape,
1986
+ skipBlurSaveRef
1987
+ }) => {
1956
1988
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
1957
1989
  const onSaveRef = react.useRef(onSave);
1958
1990
  onSaveRef.current = onSave;
1959
1991
  const onCancelRef = react.useRef(onCancel);
1960
1992
  onCancelRef.current = onCancel;
1993
+ const singleLineRef = react.useRef(singleLine);
1994
+ singleLineRef.current = singleLine;
1995
+ const blurOnEscapeRef = react.useRef(blurOnEscape);
1996
+ blurOnEscapeRef.current = blurOnEscape;
1997
+ const skipBlurSaveExternalRef = skipBlurSaveRef;
1961
1998
  react.useEffect(() => {
1962
1999
  return editor.registerCommand(
1963
2000
  lexical.KEY_DOWN_COMMAND,
@@ -1967,15 +2004,22 @@ var KeyboardPlugin = ({ onSave, onCancel }) => {
1967
2004
  onSaveRef.current?.();
1968
2005
  return true;
1969
2006
  }
1970
- if (event.key === "Escape") {
2007
+ if (event.key === "Enter" && !event.shiftKey && !event.altKey && singleLineRef.current) {
2008
+ event.preventDefault();
2009
+ editor.getRootElement()?.blur();
2010
+ return true;
2011
+ }
2012
+ if (event.key === "Escape" && blurOnEscapeRef.current) {
2013
+ if (skipBlurSaveExternalRef) skipBlurSaveExternalRef.current = true;
1971
2014
  onCancelRef.current?.();
2015
+ editor.getRootElement()?.blur();
1972
2016
  return true;
1973
2017
  }
1974
2018
  return false;
1975
2019
  },
1976
2020
  lexical.COMMAND_PRIORITY_HIGH
1977
2021
  );
1978
- }, [editor]);
2022
+ }, [editor, skipBlurSaveExternalRef]);
1979
2023
  return null;
1980
2024
  };
1981
2025
  var IMAGE = {
@@ -2058,6 +2102,9 @@ var CUSTOM_TRANSFORMERS = [
2058
2102
  MERMAID,
2059
2103
  ...markdown.TRANSFORMERS
2060
2104
  ];
2105
+ var SINGLE_LINE_TRANSFORMERS = CUSTOM_TRANSFORMERS.filter(
2106
+ (t) => t.type === "text-format" || t.type === "text-match"
2107
+ );
2061
2108
  var TABLE_FENCE_LANG = "__kbc_table__";
2062
2109
  var isTableLine = (line) => {
2063
2110
  const trimmed = line.trim();
@@ -2107,11 +2154,18 @@ var postprocessMarkdown = (markdown) => {
2107
2154
 
2108
2155
  // src/components/MarkdownEditor/plugins/MarkdownSyncPlugin.tsx
2109
2156
  var IMPORT_TAG = "markdown-import";
2110
- var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2157
+ var MarkdownSyncPlugin = ({
2158
+ value,
2159
+ editable,
2160
+ onChange,
2161
+ transformers = CUSTOM_TRANSFORMERS
2162
+ }) => {
2111
2163
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
2112
2164
  const lastExportedRef = react.useRef(value);
2113
2165
  const onChangeRef = react.useRef(onChange);
2114
2166
  onChangeRef.current = onChange;
2167
+ const transformersRef = react.useRef(transformers);
2168
+ transformersRef.current = transformers;
2115
2169
  react.useEffect(() => {
2116
2170
  editor.setEditable(editable);
2117
2171
  }, [editor, editable]);
@@ -2120,7 +2174,7 @@ var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2120
2174
  lastExportedRef.current = value;
2121
2175
  editor.update(
2122
2176
  () => {
2123
- markdown.$convertFromMarkdownString(preprocessMarkdown(value), CUSTOM_TRANSFORMERS);
2177
+ markdown.$convertFromMarkdownString(preprocessMarkdown(value), transformersRef.current);
2124
2178
  },
2125
2179
  { tag: IMPORT_TAG }
2126
2180
  );
@@ -2129,7 +2183,7 @@ var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2129
2183
  return editor.registerUpdateListener(({ tags }) => {
2130
2184
  if (tags.has(IMPORT_TAG)) return;
2131
2185
  editor.getEditorState().read(() => {
2132
- const raw = markdown.$convertToMarkdownString(CUSTOM_TRANSFORMERS);
2186
+ const raw = markdown.$convertToMarkdownString(transformersRef.current);
2133
2187
  const markdown$1 = postprocessMarkdown(raw);
2134
2188
  if (markdown$1 !== lastExportedRef.current) {
2135
2189
  lastExportedRef.current = markdown$1;
@@ -2142,16 +2196,18 @@ var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2142
2196
  };
2143
2197
 
2144
2198
  // src/components/MarkdownEditor/plugins/ToolbarPlugin.tsx
2145
- init_Icon2();
2199
+ init_icons();
2146
2200
 
2147
2201
  // src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx
2202
+ init_icons();
2148
2203
  init_utils();
2149
2204
 
2150
2205
  // src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx
2206
+ init_icons();
2151
2207
  init_utils();
2152
2208
 
2153
2209
  // src/components/DropdownMenu/DropdownMenuItemIndicator.tsx
2154
- init_Icon2();
2210
+ init_icons();
2155
2211
  var variants3 = classVarianceAuthority.cva(
2156
2212
  [
2157
2213
  "tailwindcss-preflight",
@@ -2177,6 +2233,9 @@ var variants3 = classVarianceAuthority.cva(
2177
2233
  "tw-bg-white",
2178
2234
  "[&_svg]:tw-size-2",
2179
2235
  "[&_svg]:data-[state=unchecked]:tw-hidden",
2236
+ // Lucide Circle is stroke-only — force fill to match the stroke
2237
+ // (currentColor) so the indicator reads as a solid dot.
2238
+ "[&_svg]:tw-fill-current",
2180
2239
  "group-data-[variant=argo]/dropdown-menu-content:[&_svg]:tw-text-primary",
2181
2240
  "group-data-[variant=default]/dropdown-menu-content:[&_svg]:tw-text-secondary-500"
2182
2241
  ],
@@ -2196,6 +2255,9 @@ var variants3 = classVarianceAuthority.cva(
2196
2255
  ],
2197
2256
  switch: [
2198
2257
  "tw-size-5",
2258
+ // Lucide SVGs default to 24×24 — constrain the rendered ToggleRight
2259
+ // to the indicator slot so it doesn't overflow.
2260
+ "[&_svg]:tw-size-5",
2199
2261
  "tw-text-neutral-400",
2200
2262
  "data-[state=unchecked]:tw-rotate-180",
2201
2263
  "group-data-[variant=default]/dropdown-menu-content:data-[state=checked]:tw-text-secondary-500",
@@ -2211,10 +2273,10 @@ var DropdownMenuItemIndicator = ({
2211
2273
  forceMount: forceMountProp,
2212
2274
  ...rest
2213
2275
  }) => {
2214
- const icon = (() => {
2215
- if (variant === "switch") return "toggle-large-on";
2216
- if (variant === "radio") return "circle";
2217
- return "check";
2276
+ const IconComp = (() => {
2277
+ if (variant === "switch") return lucideReact.ToggleRight;
2278
+ if (variant === "radio") return lucideReact.Circle;
2279
+ return lucideReact.Check;
2218
2280
  })();
2219
2281
  const forceMount = (() => {
2220
2282
  if (forceMountProp) return true;
@@ -2227,28 +2289,33 @@ var DropdownMenuItemIndicator = ({
2227
2289
  ...rest,
2228
2290
  forceMount,
2229
2291
  className: variants3({ variant, className }),
2230
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon })
2292
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconComp, {})
2231
2293
  }
2232
2294
  );
2233
2295
  };
2234
2296
 
2235
2297
  // src/components/DropdownMenu/ItemIcon.tsx
2236
2298
  init_utils();
2237
- init_Icon2();
2238
- var ItemIcon = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2239
- Icon,
2299
+ var ItemIcon = ({ className, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2300
+ "span",
2240
2301
  {
2241
2302
  ...props,
2242
2303
  className: cn(
2304
+ "tw-inline-flex",
2305
+ "tw-items-center",
2306
+ "tw-justify-center",
2243
2307
  "tw-aspect-square",
2244
- "tw-p-0.5",
2245
- "tw-size-4",
2308
+ // 20px container fits the 16px Lucide glyph plus 2px breathing room
2309
+ // each side — the previous tw-size-4 + tw-p-0.5 clipped the 16px child.
2310
+ "tw-size-5",
2311
+ "[&_svg]:tw-size-4",
2246
2312
  "group-data-[variant=default]/dropdown-menu-content:tw-text-neutral-400",
2247
2313
  "group-data-[variant=argo]/dropdown-menu-content:tw-text-primary",
2248
2314
  "group-data-[variant=argo]/dropdown-menu-content:group-aria-disabled:tw-text-muted-foreground",
2249
2315
  "group-data-[variant=default]/dropdown-menu-content:group-hover:tw-text-secondary-500",
2250
2316
  className
2251
- )
2317
+ ),
2318
+ children
2252
2319
  }
2253
2320
  );
2254
2321
 
@@ -2330,7 +2397,7 @@ var DropdownMenuCheckboxItem = ({
2330
2397
  ...props
2331
2398
  }) => {
2332
2399
  const isAtStart = indicatorAlign === "start";
2333
- const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { spin: true, icon: "spinner", className: isAtStart ? "" : "tw-ml-auto" }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItemIndicator, { variant: indicator, className: isAtStart ? "" : "tw-ml-auto" });
2400
+ const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: isAtStart ? "" : "tw-ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "tw-animate-spin" }) }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItemIndicator, { variant: indicator, className: isAtStart ? "" : "tw-ml-auto" });
2334
2401
  const handleSelect = (event) => {
2335
2402
  if (!closeOnSelect) event.preventDefault();
2336
2403
  onSelect?.(event);
@@ -2463,6 +2530,7 @@ var DropdownMenuContent = ({
2463
2530
  };
2464
2531
 
2465
2532
  // src/components/DropdownMenu/DropdownMenuItem.tsx
2533
+ init_icons();
2466
2534
  init_utils();
2467
2535
  var DropdownMenuItem = ({
2468
2536
  ref,
@@ -2473,13 +2541,13 @@ var DropdownMenuItem = ({
2473
2541
  onPointerMove,
2474
2542
  children,
2475
2543
  asChild,
2476
- icon: iconProp,
2544
+ icon,
2477
2545
  iconClassName,
2478
2546
  isLoading = false,
2479
2547
  ...props
2480
2548
  }) => {
2481
2549
  const Comp = asChild ? reactSlot.Root : "div";
2482
- const icon = isLoading ? "spinner" : iconProp;
2550
+ const adornment = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "tw-animate-spin" }) : renderLegacyIcon(icon);
2483
2551
  const handleOnSelect = (event) => {
2484
2552
  if (asModalTrigger) event.preventDefault();
2485
2553
  onSelect?.(event);
@@ -2503,7 +2571,7 @@ var DropdownMenuItem = ({
2503
2571
  className: cn(itemVariants, className),
2504
2572
  asChild: true,
2505
2573
  children: /* @__PURE__ */ jsxRuntime.jsxs(Comp, { children: [
2506
- icon && /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { spin: isLoading, icon, className: iconClassName }),
2574
+ adornment && /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: iconClassName, children: adornment }),
2507
2575
  /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children })
2508
2576
  ] })
2509
2577
  }
@@ -2579,6 +2647,7 @@ var DropdownMenuRadioGroup = ({
2579
2647
  };
2580
2648
 
2581
2649
  // src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx
2650
+ init_icons();
2582
2651
  init_utils();
2583
2652
  var DropdownMenuRadioItem = ({
2584
2653
  className,
@@ -2593,7 +2662,7 @@ var DropdownMenuRadioItem = ({
2593
2662
  ...props
2594
2663
  }) => {
2595
2664
  const isAtStart = indicatorAlign === "start";
2596
- const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { spin: true, icon: "spinner", className: iconClassName }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItemIndicator, { variant: indicator });
2665
+ const indicatorEle = isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: iconClassName, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "tw-animate-spin" }) }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItemIndicator, { variant: indicator });
2597
2666
  const handleSelect = (event) => {
2598
2667
  if (!closeOnSelect) event.preventDefault();
2599
2668
  onSelect?.(event);
@@ -2614,7 +2683,7 @@ var DropdownMenuRadioItem = ({
2614
2683
  ...props,
2615
2684
  children: [
2616
2685
  isAtStart && indicatorEle,
2617
- icon && /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { icon, className: iconClassName }),
2686
+ icon && /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { className: iconClassName, children: renderLegacyIcon(icon) }),
2618
2687
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-flex tw-min-w-0 tw-flex-1 tw-items-center tw-gap-2", children }),
2619
2688
  !isAtStart && indicatorEle
2620
2689
  ]
@@ -2665,12 +2734,12 @@ var DropdownMenuSubContent = ({ className, ...props }) => {
2665
2734
  };
2666
2735
 
2667
2736
  // src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubTrigger.tsx
2737
+ init_icons();
2668
2738
  init_utils();
2669
- init_Icon2();
2670
2739
  var DropdownMenuSubTrigger = ({ className, children, ...props }) => {
2671
2740
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive3__namespace.SubTrigger, { className: cn(itemVariants, className), ...props, children: [
2672
2741
  children,
2673
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "chevron-right", className: "tw-ml-auto" })
2742
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "tw-ml-auto tw-size-5" })
2674
2743
  ] });
2675
2744
  };
2676
2745
 
@@ -2713,13 +2782,12 @@ DropdownMenu.RadioItem = DropdownMenuRadioItem;
2713
2782
  DropdownMenu.ItemDescription = DropdownMenuItemDescription;
2714
2783
 
2715
2784
  // src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx
2716
- init_Icon2();
2717
2785
  init_Tooltip2();
2718
2786
  var ALIGNMENT_OPTIONS = [
2719
- { value: "left", label: "Left", icon: ["far", "align-left"] },
2720
- { value: "center", label: "Center", icon: ["far", "align-center"] },
2721
- { value: "right", label: "Right", icon: ["far", "align-right"] },
2722
- { value: "justify", label: "Justify", icon: ["far", "align-justify"] }
2787
+ { value: "left", label: "Left", icon: lucideReact.AlignLeft },
2788
+ { value: "center", label: "Center", icon: lucideReact.AlignCenter },
2789
+ { value: "right", label: "Right", icon: lucideReact.AlignRight },
2790
+ { value: "justify", label: "Justify", icon: lucideReact.AlignJustify }
2723
2791
  ];
2724
2792
  var ALIGNMENT_ICONS = Object.fromEntries(
2725
2793
  ALIGNMENT_OPTIONS.map(({ value, icon }) => [value, icon])
@@ -2745,6 +2813,7 @@ var AlignmentDropdown = ({
2745
2813
  editor.dispatchCommand(lexical.FORMAT_ELEMENT_COMMAND, align);
2746
2814
  });
2747
2815
  };
2816
+ const CurrentAlignmentIcon = ALIGNMENT_ICONS[alignment] ?? lucideReact.AlignLeft;
2748
2817
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { onOpenChange: handleOpenChange, children: [
2749
2818
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip: "Text alignment", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
2750
2819
  "button",
@@ -2755,12 +2824,12 @@ var AlignmentDropdown = ({
2755
2824
  "hover:tw-bg-neutral-100"
2756
2825
  ),
2757
2826
  children: [
2758
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ALIGNMENT_ICONS[alignment] ?? ["far", "align-left"], fixedWidth: true }),
2759
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["fas", "caret-down"], className: "tw-text-[8px]" })
2827
+ /* @__PURE__ */ jsxRuntime.jsx(CurrentAlignmentIcon, { className: "tw-size-4" }),
2828
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "tw-size-3" })
2760
2829
  ]
2761
2830
  }
2762
2831
  ) }) }),
2763
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-32", children: ALIGNMENT_OPTIONS.map(({ value, label, icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
2832
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-32", children: ALIGNMENT_OPTIONS.map(({ value, label, icon: IconComp }) => /* @__PURE__ */ jsxRuntime.jsxs(
2764
2833
  DropdownMenu.Item,
2765
2834
  {
2766
2835
  onSelect: () => handleSelect(value),
@@ -2769,7 +2838,7 @@ var AlignmentDropdown = ({
2769
2838
  alignment === value && "tw-bg-secondary-50 tw-text-secondary-500"
2770
2839
  ),
2771
2840
  children: [
2772
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, fixedWidth: true }),
2841
+ /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: "tw-size-4" }),
2773
2842
  label
2774
2843
  ]
2775
2844
  },
@@ -2779,18 +2848,18 @@ var AlignmentDropdown = ({
2779
2848
  };
2780
2849
 
2781
2850
  // src/components/MarkdownEditor/plugins/toolbar/BlockTypeDropdown.tsx
2851
+ init_icons();
2782
2852
  init_utils();
2783
- init_Icon2();
2784
2853
  init_Tooltip2();
2785
2854
  var BLOCK_TYPE_META = {
2786
- paragraph: { label: "Normal", icon: ["far", "font"], selectable: true },
2787
- h1: { label: "Heading 1", icon: ["far", "h1"], selectable: true },
2788
- h2: { label: "Heading 2", icon: ["far", "h2"], selectable: true },
2789
- h3: { label: "Heading 3", icon: ["far", "h3"], selectable: true },
2790
- bullet: { label: "Bullet List", icon: ["far", "list-ul"], selectable: false },
2791
- number: { label: "Numbered List", icon: ["far", "list-ol"], selectable: false },
2792
- quote: { label: "Quote", icon: ["far", "block-quote"], selectable: false },
2793
- code: { label: "Code Block", icon: "square-code", selectable: false }
2855
+ paragraph: { label: "Normal", icon: lucideReact.Type, selectable: true },
2856
+ h1: { label: "Heading 1", icon: lucideReact.Heading1, selectable: true },
2857
+ h2: { label: "Heading 2", icon: lucideReact.Heading2, selectable: true },
2858
+ h3: { label: "Heading 3", icon: lucideReact.Heading3, selectable: true },
2859
+ bullet: { label: "Bullet List", icon: lucideReact.List, selectable: false },
2860
+ number: { label: "Numbered List", icon: lucideReact.ListOrdered, selectable: false },
2861
+ quote: { label: "Quote", icon: lucideReact.Quote, selectable: false },
2862
+ code: { label: "Code Block", icon: lucideReact.SquareCode, selectable: false }
2794
2863
  };
2795
2864
  var BLOCK_TYPE_OPTIONS = Object.entries(BLOCK_TYPE_META).filter(([, meta]) => meta.selectable).map(([value, { label, icon }]) => ({ value, label, icon }));
2796
2865
  var isBlockType = (value) => Object.prototype.hasOwnProperty.call(BLOCK_TYPE_META, value);
@@ -2800,6 +2869,7 @@ var BlockTypeDropdown = ({
2800
2869
  }) => {
2801
2870
  const savedSelectionRef = react.useRef(null);
2802
2871
  const currentMeta = isBlockType(blockType) ? BLOCK_TYPE_META[blockType] : null;
2872
+ const CurrentBlockIcon = currentMeta?.icon ?? lucideReact.Type;
2803
2873
  const handleOpenChange = (open) => {
2804
2874
  if (open) {
2805
2875
  editor.getEditorState().read(() => {
@@ -2840,13 +2910,13 @@ var BlockTypeDropdown = ({
2840
2910
  "hover:tw-bg-neutral-100"
2841
2911
  ),
2842
2912
  children: [
2843
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: currentMeta?.icon ?? ["far", "font"], fixedWidth: true }),
2913
+ /* @__PURE__ */ jsxRuntime.jsx(CurrentBlockIcon, { className: "tw-size-4" }),
2844
2914
  currentMeta?.label ?? "Normal",
2845
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["fas", "caret-down"], className: "tw-text-[8px]" })
2915
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "tw-size-3" })
2846
2916
  ]
2847
2917
  }
2848
2918
  ) }) }),
2849
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-40", children: BLOCK_TYPE_OPTIONS.map(({ value, label, icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
2919
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-40", children: BLOCK_TYPE_OPTIONS.map(({ value, label, icon: IconComp }) => /* @__PURE__ */ jsxRuntime.jsxs(
2850
2920
  DropdownMenu.Item,
2851
2921
  {
2852
2922
  onSelect: () => handleSelect(value),
@@ -2855,7 +2925,7 @@ var BlockTypeDropdown = ({
2855
2925
  blockType === value && "tw-bg-secondary-50 tw-text-secondary-500"
2856
2926
  ),
2857
2927
  children: [
2858
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, fixedWidth: true }),
2928
+ /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: "tw-size-4" }),
2859
2929
  label
2860
2930
  ]
2861
2931
  },
@@ -2865,6 +2935,7 @@ var BlockTypeDropdown = ({
2865
2935
  };
2866
2936
 
2867
2937
  // src/components/MarkdownEditor/plugins/toolbar/LinkPanel.tsx
2938
+ init_icons();
2868
2939
  init_Button2();
2869
2940
  var buttonGroupVariant = classVarianceAuthority.cva(
2870
2941
  ["tailwindcss-preflight", "tw-inline-flex", "tw-items-center", "tw-group/button-group"],
@@ -3301,6 +3372,7 @@ InputGroup.TextArea = InputGroupTextArea;
3301
3372
  InputGroup.Text = InputGroupText;
3302
3373
 
3303
3374
  // src/blocks/ColorInput/ColorInput.tsx
3375
+ init_icons();
3304
3376
  init_utils();
3305
3377
 
3306
3378
  // src/blocks/ColorInput/utils.ts
@@ -3364,9 +3436,9 @@ var ColorPicker = ({ value, disabled, readOnly, ...props }) => {
3364
3436
  {
3365
3437
  onMouseDown: (event) => event.preventDefault(),
3366
3438
  disabled: disabled || readOnly,
3367
- icon: "eye-dropper",
3368
3439
  onClick: handleOpenPicker,
3369
- "aria-label": "Pick color"
3440
+ "aria-label": "Pick color",
3441
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.Pipette, { className: "tw-size-4" })
3370
3442
  }
3371
3443
  )
3372
3444
  ] });
@@ -3482,10 +3554,10 @@ var ColorInput = ({
3482
3554
  canClear && /* @__PURE__ */ jsxRuntime.jsx(
3483
3555
  InputGroup.Button,
3484
3556
  {
3485
- icon: "xmark",
3486
3557
  onMouseDown: (event) => event.preventDefault(),
3487
3558
  onClick: handleClear,
3488
- "aria-label": "Clear color"
3559
+ "aria-label": "Clear color",
3560
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "tw-size-4" })
3489
3561
  }
3490
3562
  ),
3491
3563
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3618,6 +3690,7 @@ var FormGroupTextarea = (props) => {
3618
3690
  };
3619
3691
 
3620
3692
  // src/components/Input/Input.tsx
3693
+ init_icons();
3621
3694
  init_utils();
3622
3695
 
3623
3696
  // src/components/Input/utils.ts
@@ -3715,10 +3788,11 @@ var Input = ({
3715
3788
  allowClear && isClearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(
3716
3789
  InputGroup.Button,
3717
3790
  {
3718
- icon: "xmark",
3791
+ "aria-label": "Clear",
3719
3792
  onMouseDown: (e) => e.preventDefault(),
3720
3793
  onClick: handleClear,
3721
- "data-testid": testId.clearButton
3794
+ "data-testid": testId.clearButton,
3795
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "tw-size-4" })
3722
3796
  }
3723
3797
  ),
3724
3798
  rightSuffix && /* @__PURE__ */ jsxRuntime.jsx(
@@ -3787,9 +3861,6 @@ FormGroup.NumberInput = FormGroupNumberInput;
3787
3861
  FormGroup.ColorInput = FormGroupColorInput;
3788
3862
  FormGroup.Textarea = FormGroupTextarea;
3789
3863
 
3790
- // src/components/MarkdownEditor/plugins/toolbar/LinkPanel.tsx
3791
- init_Icon2();
3792
-
3793
3864
  // src/components/Label/Label.tsx
3794
3865
  init_utils();
3795
3866
  var Optional = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("tw-text-neutral-400", className), children: "(optional)" });
@@ -3901,12 +3972,12 @@ var LinkPanel = ({ editor, isLink }) => {
3901
3972
  active: true,
3902
3973
  onClick: () => editor.dispatchCommand(link.TOGGLE_LINK_COMMAND, null),
3903
3974
  tooltip: "Remove Link",
3904
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "link"] })
3975
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "tw-size-4" })
3905
3976
  }
3906
3977
  );
3907
3978
  }
3908
3979
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-relative", children: [
3909
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { active: open, onClick: handleOpen, tooltip: "Insert Link", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "link"] }) }),
3980
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { active: open, onClick: handleOpen, tooltip: "Insert Link", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "tw-size-4" }) }),
3910
3981
  open && /* @__PURE__ */ jsxRuntime.jsx(
3911
3982
  "div",
3912
3983
  {
@@ -4070,7 +4141,7 @@ var ToolbarPlugin = () => {
4070
4141
  active: isBold,
4071
4142
  onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "bold"),
4072
4143
  tooltip: "Bold (Ctrl+B)",
4073
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "bold"] })
4144
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: "tw-size-4" })
4074
4145
  }
4075
4146
  ),
4076
4147
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4079,7 +4150,7 @@ var ToolbarPlugin = () => {
4079
4150
  active: isItalic,
4080
4151
  onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "italic"),
4081
4152
  tooltip: "Italic (Ctrl+I)",
4082
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "italic"] })
4153
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: "tw-size-4" })
4083
4154
  }
4084
4155
  ),
4085
4156
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4088,7 +4159,7 @@ var ToolbarPlugin = () => {
4088
4159
  active: isUnderline,
4089
4160
  onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "underline"),
4090
4161
  tooltip: "Underline (Ctrl+U)",
4091
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "underline"] })
4162
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { className: "tw-size-4" })
4092
4163
  }
4093
4164
  ),
4094
4165
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4097,7 +4168,7 @@ var ToolbarPlugin = () => {
4097
4168
  active: isStrikethrough,
4098
4169
  onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "strikethrough"),
4099
4170
  tooltip: "Strikethrough",
4100
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "strikethrough"] })
4171
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Strikethrough, { className: "tw-size-4" })
4101
4172
  }
4102
4173
  ),
4103
4174
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4106,7 +4177,7 @@ var ToolbarPlugin = () => {
4106
4177
  active: isCode,
4107
4178
  onClick: () => editor.dispatchCommand(lexical.FORMAT_TEXT_COMMAND, "code"),
4108
4179
  tooltip: "Inline Code",
4109
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "code"] })
4180
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Code, { className: "tw-size-4" })
4110
4181
  }
4111
4182
  ),
4112
4183
  /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
@@ -4124,7 +4195,7 @@ var ToolbarPlugin = () => {
4124
4195
  }
4125
4196
  },
4126
4197
  tooltip: "Bullet List",
4127
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "list-ul"] })
4198
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "tw-size-4" })
4128
4199
  }
4129
4200
  ),
4130
4201
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4139,7 +4210,7 @@ var ToolbarPlugin = () => {
4139
4210
  }
4140
4211
  },
4141
4212
  tooltip: "Numbered List",
4142
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "list-ol"] })
4213
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "tw-size-4" })
4143
4214
  }
4144
4215
  ),
4145
4216
  /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
@@ -4161,7 +4232,7 @@ var ToolbarPlugin = () => {
4161
4232
  });
4162
4233
  },
4163
4234
  tooltip: "Quote",
4164
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: ["far", "block-quote"] })
4235
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Quote, { className: "tw-size-4" })
4165
4236
  }
4166
4237
  ),
4167
4238
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4180,7 +4251,7 @@ var ToolbarPlugin = () => {
4180
4251
  });
4181
4252
  },
4182
4253
  tooltip: "Code Block",
4183
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "square-code" })
4254
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquareCode, { className: "tw-size-4" })
4184
4255
  }
4185
4256
  )
4186
4257
  ]
@@ -4245,9 +4316,14 @@ var MarkdownEditor = ({
4245
4316
  onImageUpload,
4246
4317
  className,
4247
4318
  imageRenderer,
4248
- showToolbar = false
4319
+ showToolbar = false,
4320
+ compact = false,
4321
+ saveOnBlur = false,
4322
+ singleLine = false,
4323
+ clampDisplay = false
4249
4324
  }) => {
4250
4325
  const editable = !readOnly && !disabled;
4326
+ const transformers = singleLine ? SINGLE_LINE_TRANSFORMERS : CUSTOM_TRANSFORMERS;
4251
4327
  const [initialConfig] = react.useState(() => ({
4252
4328
  namespace: "MarkdownEditor",
4253
4329
  theme: editorTheme,
@@ -4257,47 +4333,106 @@ var MarkdownEditor = ({
4257
4333
  },
4258
4334
  editable,
4259
4335
  editorState: () => {
4260
- markdown.$convertFromMarkdownString(preprocessMarkdown(value), CUSTOM_TRANSFORMERS);
4336
+ markdown.$convertFromMarkdownString(preprocessMarkdown(value), transformers);
4261
4337
  }
4262
4338
  }));
4263
- return /* @__PURE__ */ jsxRuntime.jsx(LexicalComposer.LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsxRuntime.jsx(ImageRendererProvider, { value: imageRenderer ?? null, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("tw-prose", className), children: [
4264
- showToolbar && editable && /* @__PURE__ */ jsxRuntime.jsx(ToolbarPlugin, {}),
4265
- /* @__PURE__ */ jsxRuntime.jsx(
4266
- "div",
4267
- {
4268
- className: cn(
4269
- "tw-relative tw-rounded-md tw-p-2 tw-transition-colors",
4270
- editable && "tw-cursor-text hover:tw-bg-neutral-50 focus-within:tw-ring-2 focus-within:tw-ring-secondary-500/40"
4271
- ),
4272
- children: /* @__PURE__ */ jsxRuntime.jsx(
4273
- LexicalRichTextPlugin.RichTextPlugin,
4339
+ const skipBlurSaveRef = react.useRef(false);
4340
+ const handleBlur = saveOnBlur && onSave ? (event) => {
4341
+ if (skipBlurSaveRef.current) {
4342
+ skipBlurSaveRef.current = false;
4343
+ return;
4344
+ }
4345
+ if (!event.currentTarget.contains(event.relatedTarget)) {
4346
+ onSave();
4347
+ }
4348
+ } : void 0;
4349
+ return /* @__PURE__ */ jsxRuntime.jsx(LexicalComposer.LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsxRuntime.jsx(ImageRendererProvider, { value: imageRenderer ?? null, children: /* @__PURE__ */ jsxRuntime.jsxs(
4350
+ "div",
4351
+ {
4352
+ className: cn(
4353
+ !compact && "tw-prose",
4354
+ // Compact mode drops `tw-prose`, so Lexical's <p> wrappers fall back to the browser
4355
+ // default `margin: 1em 0` — visually huge at heading sizes. Zero them, and use the
4356
+ // adjacent-sibling selector for paragraph spacing so single-paragraph blocks (titles,
4357
+ // short descriptions) stay tight while multi-paragraph blocks still breathe.
4358
+ compact && "[&_p]:tw-m-0 [&_p+p]:tw-mt-2",
4359
+ // Display-state clamp: 2 lines + bottom fade. Drops in focus-within so editing
4360
+ // expands to full height. Fade replaces ellipsis per the pattern spec — the
4361
+ // mask gradient overlays line-clamp's default ellipsis so it's invisible.
4362
+ clampDisplay && "[&:not(:focus-within)]:tw-line-clamp-2 [&:not(:focus-within)]:[mask-image:linear-gradient(to_bottom,black_50%,transparent)]",
4363
+ className
4364
+ ),
4365
+ onBlur: handleBlur,
4366
+ children: [
4367
+ showToolbar && editable && /* @__PURE__ */ jsxRuntime.jsx(ToolbarPlugin, {}),
4368
+ /* @__PURE__ */ jsxRuntime.jsx(
4369
+ "div",
4274
4370
  {
4275
- contentEditable: /* @__PURE__ */ jsxRuntime.jsx(
4276
- LexicalContentEditable.ContentEditable,
4371
+ className: cn(
4372
+ "tw-relative tw-rounded-md tw-transition-colors",
4373
+ // In compact mode the padding lets the hover bg / focus ring extend past the text,
4374
+ // but a matching negative margin shifts the wrapper outward so the text itself stays
4375
+ // aligned with the parent's content edge (i.e. with where static text would render).
4376
+ compact ? "tw-px-1.5 tw-py-0.5 -tw-mx-1.5 -tw-my-0.5" : "tw-p-2",
4377
+ editable && "tw-cursor-text hover:tw-bg-neutral-50 focus-within:tw-ring-2 focus-within:tw-ring-secondary-500/40"
4378
+ ),
4379
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4380
+ LexicalRichTextPlugin.RichTextPlugin,
4277
4381
  {
4278
- className: "tw-min-h-[100px] tw-outline-none",
4279
- "aria-placeholder": placeholder ?? "",
4280
- placeholder: placeholder ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-pointer-events-none tw-absolute tw-left-2 tw-top-[calc(0.5rem+0.35em)] tw-select-none tw-text-neutral-400", children: placeholder }) : /* @__PURE__ */ jsxRuntime.jsx("div", {})
4382
+ contentEditable: /* @__PURE__ */ jsxRuntime.jsx(
4383
+ LexicalContentEditable.ContentEditable,
4384
+ {
4385
+ className: cn("tw-outline-none", !compact && "tw-min-h-[100px]"),
4386
+ "aria-placeholder": placeholder ?? "",
4387
+ placeholder: placeholder ? /* @__PURE__ */ jsxRuntime.jsx(
4388
+ "div",
4389
+ {
4390
+ className: cn(
4391
+ "tw-pointer-events-none tw-absolute tw-select-none tw-text-neutral-400",
4392
+ compact ? "tw-left-1.5 tw-top-0.5" : "tw-left-2 tw-top-[calc(0.5rem+0.35em)]"
4393
+ ),
4394
+ children: placeholder
4395
+ }
4396
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", {})
4397
+ }
4398
+ ),
4399
+ ErrorBoundary: LexicalErrorBoundary.LexicalErrorBoundary
4281
4400
  }
4282
- ),
4283
- ErrorBoundary: LexicalErrorBoundary.LexicalErrorBoundary
4401
+ )
4284
4402
  }
4285
- )
4286
- }
4287
- ),
4288
- /* @__PURE__ */ jsxRuntime.jsx(LexicalHistoryPlugin.HistoryPlugin, {}),
4289
- /* @__PURE__ */ jsxRuntime.jsx(LexicalLinkPlugin.LinkPlugin, {}),
4290
- /* @__PURE__ */ jsxRuntime.jsx(LexicalClickableLinkPlugin.ClickableLinkPlugin, { newTab: true }),
4291
- /* @__PURE__ */ jsxRuntime.jsx(LexicalListPlugin.ListPlugin, {}),
4292
- /* @__PURE__ */ jsxRuntime.jsx(LexicalCheckListPlugin.CheckListPlugin, {}),
4293
- /* @__PURE__ */ jsxRuntime.jsx(LexicalHorizontalRulePlugin.HorizontalRulePlugin, {}),
4294
- /* @__PURE__ */ jsxRuntime.jsx(LexicalTabIndentationPlugin.TabIndentationPlugin, {}),
4295
- /* @__PURE__ */ jsxRuntime.jsx(LexicalMarkdownShortcutPlugin.MarkdownShortcutPlugin, { transformers: CUSTOM_TRANSFORMERS }),
4296
- /* @__PURE__ */ jsxRuntime.jsx(MarkdownSyncPlugin, { value, editable, onChange }),
4297
- /* @__PURE__ */ jsxRuntime.jsx(ImagePastePlugin, { onImageUpload }),
4298
- /* @__PURE__ */ jsxRuntime.jsx(KeyboardPlugin, { onSave, onCancel }),
4299
- autoFocus && /* @__PURE__ */ jsxRuntime.jsx(LexicalAutoFocusPlugin.AutoFocusPlugin, {})
4300
- ] }) }) });
4403
+ ),
4404
+ /* @__PURE__ */ jsxRuntime.jsx(LexicalHistoryPlugin.HistoryPlugin, {}),
4405
+ /* @__PURE__ */ jsxRuntime.jsx(LexicalLinkPlugin.LinkPlugin, {}),
4406
+ /* @__PURE__ */ jsxRuntime.jsx(LexicalClickableLinkPlugin.ClickableLinkPlugin, { newTab: true }),
4407
+ !singleLine && /* @__PURE__ */ jsxRuntime.jsx(LexicalListPlugin.ListPlugin, {}),
4408
+ !singleLine && /* @__PURE__ */ jsxRuntime.jsx(LexicalCheckListPlugin.CheckListPlugin, {}),
4409
+ !singleLine && /* @__PURE__ */ jsxRuntime.jsx(LexicalHorizontalRulePlugin.HorizontalRulePlugin, {}),
4410
+ /* @__PURE__ */ jsxRuntime.jsx(LexicalTabIndentationPlugin.TabIndentationPlugin, {}),
4411
+ /* @__PURE__ */ jsxRuntime.jsx(LexicalMarkdownShortcutPlugin.MarkdownShortcutPlugin, { transformers }),
4412
+ /* @__PURE__ */ jsxRuntime.jsx(
4413
+ MarkdownSyncPlugin,
4414
+ {
4415
+ value,
4416
+ editable,
4417
+ onChange,
4418
+ transformers
4419
+ }
4420
+ ),
4421
+ /* @__PURE__ */ jsxRuntime.jsx(ImagePastePlugin, { onImageUpload }),
4422
+ /* @__PURE__ */ jsxRuntime.jsx(
4423
+ KeyboardPlugin,
4424
+ {
4425
+ onSave,
4426
+ onCancel,
4427
+ singleLine,
4428
+ blurOnEscape: singleLine || saveOnBlur,
4429
+ skipBlurSaveRef
4430
+ }
4431
+ ),
4432
+ autoFocus && /* @__PURE__ */ jsxRuntime.jsx(LexicalAutoFocusPlugin.AutoFocusPlugin, {})
4433
+ ]
4434
+ }
4435
+ ) }) });
4301
4436
  };
4302
4437
 
4303
4438
  exports.MarkdownEditor = MarkdownEditor;