@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
@@ -4,6 +4,7 @@ import { Portal, Content, Root, Trigger } from '@radix-ui/react-tooltip';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
6
  import { createContext, lazy, Suspense, use, useId, useState, useRef, useEffect, useCallback, useMemo } from 'react';
7
+ import { AlignLeft, AlignCenter, AlignRight, AlignJustify, SquareCode, Quote, ListOrdered, List, Heading3, Heading2, Heading1, Type, Bold, Italic, Underline, Strikethrough, Code, Minimize2, Maximize2, ChevronDown, Link, Copy, X, Loader2, AlertCircle, CircleCheck, Info, AlertTriangle, ChevronRight, ToggleRight, Circle, Check } from 'lucide-react';
7
8
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8
9
  import '@awesome.me/kit-be8bcf7e5e/icons';
9
10
  import { Root as Root$2, Slottable } from '@radix-ui/react-slot';
@@ -38,6 +39,7 @@ import * as DropdownMenuPrimitive3 from '@radix-ui/react-dropdown-menu';
38
39
  import { Root as Root$1, Group, Trigger as Trigger$1 } from '@radix-ui/react-dropdown-menu';
39
40
  import * as ScrollAreaPrimitive2 from '@radix-ui/react-scroll-area';
40
41
  import TextareaAutosize from 'react-textarea-autosize';
42
+ import { Pipette } from '@keboola/design/icons';
41
43
  import * as RLabel from '@radix-ui/react-label';
42
44
 
43
45
  var __defProp = Object.defineProperty;
@@ -432,10 +434,21 @@ var init_Skeleton = __esm({
432
434
  Skeleton = ({ height = "md", className, count = 1 }) => {
433
435
  const prefixId = useId();
434
436
  const keys = Array.from({ length: count }, (_, i) => `${prefixId}-${i}`);
435
- return /* @__PURE__ */ jsx(Fragment, { children: keys.map((key) => /* @__PURE__ */ jsx("div", { className: cn(HEIGHT_CLASS_NAME[height], ANIMATION_CLASS_NAME, className) }, key)) });
437
+ return /* @__PURE__ */ jsx(Fragment, { children: keys.map((key) => /* @__PURE__ */ jsx(
438
+ "div",
439
+ {
440
+ "data-skeleton": "true",
441
+ className: cn(HEIGHT_CLASS_NAME[height], ANIMATION_CLASS_NAME, className)
442
+ },
443
+ key
444
+ )) });
436
445
  };
437
446
  }
438
447
  });
448
+ var init_icons = __esm({
449
+ "src/icons/index.ts"() {
450
+ }
451
+ });
439
452
  var Icon;
440
453
  var init_Icon = __esm({
441
454
  "src/components/Icon/Icon.tsx"() {
@@ -641,12 +654,10 @@ var init_styles = __esm({
641
654
  "focus-visible:tw-ring-primary/50"
642
655
  ],
643
656
  secondary: [
644
- "tw-bg-secondary",
645
- "tw-text-secondary-foreground",
646
- "hover:tw-bg-secondary/80",
647
- "hover:tw-text-secondary-foreground",
648
- "focus:tw-text-secondary-foreground",
649
- "focus-visible:tw-border-secondary",
657
+ "tw-bg-primary/10",
658
+ "tw-text-primary",
659
+ "hover:not-disabled:tw-bg-primary/20",
660
+ "focus-visible:tw-border-primary",
650
661
  "focus-visible:tw-ring-primary/50"
651
662
  ],
652
663
  // should be called "destructive" by Figma
@@ -708,6 +719,7 @@ var init_styles = __esm({
708
719
  var Button;
709
720
  var init_Button = __esm({
710
721
  "src/components/Button/Button.tsx"() {
722
+ init_icons();
711
723
  init_utils();
712
724
  init_Icon2();
713
725
  init_styles();
@@ -717,7 +729,6 @@ var init_Button = __esm({
717
729
  disabled = false,
718
730
  className,
719
731
  type = "button",
720
- icon: iconProp,
721
732
  isLoading = false,
722
733
  asChild = false,
723
734
  onClick,
@@ -725,10 +736,10 @@ var init_Button = __esm({
725
736
  variant = "primary",
726
737
  size = "medium",
727
738
  block = false,
739
+ icon,
728
740
  ...buttonProps
729
741
  }) => {
730
742
  const Comp = asChild ? Root$2 : "button";
731
- const icon = isLoading ? "spinner" : iconProp;
732
743
  const classNames = argo ? argoVariants({ variant, size, block, className }) : variants({
733
744
  size,
734
745
  variant,
@@ -751,12 +762,13 @@ var init_Button = __esm({
751
762
  disabled,
752
763
  "aria-disabled": disabled,
753
764
  "data-variant": variant,
754
- "data-icon-only": !children,
765
+ "data-icon-only": String(size).startsWith("icon"),
755
766
  type,
756
767
  onClick: handleClick,
757
768
  className: cn(classNames),
758
769
  children: [
759
- icon && /* @__PURE__ */ jsx(Icon, { spin: isLoading, icon }),
770
+ isLoading && /* @__PURE__ */ jsx(Loader2, { className: "tw-size-4 tw-shrink-0 tw-animate-spin" }),
771
+ !isLoading && icon && /* @__PURE__ */ jsx(Icon, { icon }),
760
772
  /* @__PURE__ */ jsx(Slottable, { children })
761
773
  ]
762
774
  }
@@ -895,7 +907,8 @@ var init_ClipboardButton = __esm({
895
907
  "src/blocks/ClipboardButton/ClipboardButton.tsx"() {
896
908
  init_Button2();
897
909
  init_Clipboard2();
898
- DEFAULT_ICON = "copy";
910
+ init_icons();
911
+ DEFAULT_ICON = /* @__PURE__ */ jsx(Copy, {});
899
912
  ClipboardButton = ({
900
913
  // clipboard props
901
914
  text,
@@ -915,7 +928,10 @@ var init_ClipboardButton = __esm({
915
928
  tooltipPlacement,
916
929
  tooltipVariant,
917
930
  text,
918
- children: /* @__PURE__ */ jsx(Button, { ...rest, icon, variant, disabled: !text, children })
931
+ children: /* @__PURE__ */ jsxs(Button, { ...rest, variant, disabled: !text, children: [
932
+ icon,
933
+ children
934
+ ] })
919
935
  }
920
936
  );
921
937
  }
@@ -931,6 +947,7 @@ var MIN_SCALE, MAX_SCALE, ZOOM_STEP, ZoomableSvg;
931
947
  var init_ZoomableSvg = __esm({
932
948
  "src/components/ZoomableSvg/ZoomableSvg.tsx"() {
933
949
  init_ClipboardButton2();
950
+ init_icons();
934
951
  init_utils();
935
952
  init_Button2();
936
953
  init_Tooltip2();
@@ -1067,10 +1084,10 @@ var init_ZoomableSvg = __esm({
1067
1084
  {
1068
1085
  size: "icon-sm",
1069
1086
  variant: "outline",
1070
- icon: isFullscreen ? "down-left-and-up-right-to-center" : "up-right-and-down-left-from-center",
1071
1087
  "aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
1072
1088
  onClick: () => setIsFullscreen((f) => !f),
1073
- argo: true
1089
+ argo: true,
1090
+ children: isFullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "tw-size-4" }) : /* @__PURE__ */ jsx(Maximize2, { className: "tw-size-4" })
1074
1091
  }
1075
1092
  )
1076
1093
  }
@@ -1511,8 +1528,13 @@ var $isMermaidNode = (node) => {
1511
1528
  init_utils();
1512
1529
 
1513
1530
  // src/components/Toast/ToastRoot.tsx
1531
+ init_icons();
1514
1532
  init_utils();
1533
+
1534
+ // src/utils/legacyIcon.tsx
1515
1535
  init_Icon2();
1536
+ var isFAIconValue = (value) => typeof value === "string" || Array.isArray(value) && value.length === 2 && typeof value[0] === "string" && typeof value[1] === "string";
1537
+ var renderLegacyIcon = (value) => isFAIconValue(value) ? /* @__PURE__ */ jsx(Icon, { icon: value }) : value;
1516
1538
 
1517
1539
  // src/components/Toast/ToastAction.tsx
1518
1540
  init_utils();
@@ -1575,8 +1597,8 @@ var ToastDescription = ({
1575
1597
  );
1576
1598
 
1577
1599
  // src/components/Toast/ToastDismiss.tsx
1600
+ init_icons();
1578
1601
  init_utils();
1579
- init_Icon2();
1580
1602
  var ToastDismiss = ({
1581
1603
  ref,
1582
1604
  className,
@@ -1594,7 +1616,7 @@ var ToastDismiss = ({
1594
1616
  "tailwindcss-preflight",
1595
1617
  "[&_svg]:tw-aspect-square",
1596
1618
  "[&_svg]:tw-size-4",
1597
- "[&_svg]:tw-p-1",
1619
+ "[&_svg]:tw-m-1",
1598
1620
  "tw-text-white",
1599
1621
  "group-data-[variant=default]/toast:[&_svg]:tw-text-popover-foreground",
1600
1622
  className
@@ -1602,7 +1624,7 @@ var ToastDismiss = ({
1602
1624
  type: "button",
1603
1625
  ...rest,
1604
1626
  children: [
1605
- /* @__PURE__ */ jsx(Icon, { icon: "times" }),
1627
+ /* @__PURE__ */ jsx(X, {}),
1606
1628
  /* @__PURE__ */ jsx("span", { className: "tw-sr-only", children: "Dismiss" })
1607
1629
  ]
1608
1630
  }
@@ -1710,10 +1732,10 @@ var variants2 = cva(
1710
1732
  }
1711
1733
  );
1712
1734
  var DEFAULT_VARIANT_ICON = {
1713
- error: "exclamation-triangle",
1714
- info: "info-circle",
1715
- success: "check-circle",
1716
- warning: "exclamation-circle"
1735
+ error: /* @__PURE__ */ jsx(AlertTriangle, {}),
1736
+ info: /* @__PURE__ */ jsx(Info, {}),
1737
+ success: /* @__PURE__ */ jsx(CircleCheck, {}),
1738
+ warning: /* @__PURE__ */ jsx(AlertCircle, {})
1717
1739
  };
1718
1740
  var ToastRoot = ({
1719
1741
  id,
@@ -1726,8 +1748,8 @@ var ToastRoot = ({
1726
1748
  icon: iconProp
1727
1749
  }) => {
1728
1750
  const icon = (() => {
1729
- if (loading) return "spinner";
1730
- if (iconProp) return iconProp;
1751
+ if (loading) return /* @__PURE__ */ jsx(Loader2, { className: "tw-animate-spin" });
1752
+ if (iconProp) return renderLegacyIcon(iconProp);
1731
1753
  if (variant === "default" || variant === null) return null;
1732
1754
  return DEFAULT_VARIANT_ICON[variant];
1733
1755
  })();
@@ -1737,20 +1759,24 @@ var ToastRoot = ({
1737
1759
  };
1738
1760
  return /* @__PURE__ */ jsxs("div", { "data-variant": variant, className: cn(variants2({ variant })), children: [
1739
1761
  icon && /* @__PURE__ */ jsx(
1740
- Icon,
1762
+ "span",
1741
1763
  {
1742
1764
  "data-slot": "toast-icon",
1743
- spin: loading,
1744
1765
  className: cn(
1745
- // styles
1766
+ "tw-inline-flex",
1767
+ "tw-items-center",
1768
+ "tw-justify-center",
1769
+ // styles — container at 20px with no padding so the 20px Lucide
1770
+ // glyph fills the slot (previous tw-size-4 + tw-p-1 clipped a
1771
+ // 16px child into 8px of visible space)
1746
1772
  "tw-aspect-square",
1747
- "tw-size-4",
1773
+ "tw-size-5",
1748
1774
  "tw-shrink-0",
1749
- "tw-p-1",
1775
+ "[&_svg]:tw-size-5",
1750
1776
  "tw-text-white",
1751
1777
  "group-data-[variant=default]/toast:tw-text-popover-foreground"
1752
1778
  ),
1753
- icon
1779
+ children: icon
1754
1780
  }
1755
1781
  ),
1756
1782
  /* @__PURE__ */ jsx(ToastTitle, { children: title }),
@@ -1925,12 +1951,23 @@ var ImagePastePlugin = ({ onImageUpload }) => {
1925
1951
  }, [editor]);
1926
1952
  return null;
1927
1953
  };
1928
- var KeyboardPlugin = ({ onSave, onCancel }) => {
1954
+ var KeyboardPlugin = ({
1955
+ onSave,
1956
+ onCancel,
1957
+ singleLine,
1958
+ blurOnEscape,
1959
+ skipBlurSaveRef
1960
+ }) => {
1929
1961
  const [editor] = useLexicalComposerContext();
1930
1962
  const onSaveRef = useRef(onSave);
1931
1963
  onSaveRef.current = onSave;
1932
1964
  const onCancelRef = useRef(onCancel);
1933
1965
  onCancelRef.current = onCancel;
1966
+ const singleLineRef = useRef(singleLine);
1967
+ singleLineRef.current = singleLine;
1968
+ const blurOnEscapeRef = useRef(blurOnEscape);
1969
+ blurOnEscapeRef.current = blurOnEscape;
1970
+ const skipBlurSaveExternalRef = skipBlurSaveRef;
1934
1971
  useEffect(() => {
1935
1972
  return editor.registerCommand(
1936
1973
  KEY_DOWN_COMMAND,
@@ -1940,15 +1977,22 @@ var KeyboardPlugin = ({ onSave, onCancel }) => {
1940
1977
  onSaveRef.current?.();
1941
1978
  return true;
1942
1979
  }
1943
- if (event.key === "Escape") {
1980
+ if (event.key === "Enter" && !event.shiftKey && !event.altKey && singleLineRef.current) {
1981
+ event.preventDefault();
1982
+ editor.getRootElement()?.blur();
1983
+ return true;
1984
+ }
1985
+ if (event.key === "Escape" && blurOnEscapeRef.current) {
1986
+ if (skipBlurSaveExternalRef) skipBlurSaveExternalRef.current = true;
1944
1987
  onCancelRef.current?.();
1988
+ editor.getRootElement()?.blur();
1945
1989
  return true;
1946
1990
  }
1947
1991
  return false;
1948
1992
  },
1949
1993
  COMMAND_PRIORITY_HIGH
1950
1994
  );
1951
- }, [editor]);
1995
+ }, [editor, skipBlurSaveExternalRef]);
1952
1996
  return null;
1953
1997
  };
1954
1998
  var IMAGE = {
@@ -2031,6 +2075,9 @@ var CUSTOM_TRANSFORMERS = [
2031
2075
  MERMAID,
2032
2076
  ...TRANSFORMERS
2033
2077
  ];
2078
+ var SINGLE_LINE_TRANSFORMERS = CUSTOM_TRANSFORMERS.filter(
2079
+ (t) => t.type === "text-format" || t.type === "text-match"
2080
+ );
2034
2081
  var TABLE_FENCE_LANG = "__kbc_table__";
2035
2082
  var isTableLine = (line) => {
2036
2083
  const trimmed = line.trim();
@@ -2080,11 +2127,18 @@ var postprocessMarkdown = (markdown) => {
2080
2127
 
2081
2128
  // src/components/MarkdownEditor/plugins/MarkdownSyncPlugin.tsx
2082
2129
  var IMPORT_TAG = "markdown-import";
2083
- var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2130
+ var MarkdownSyncPlugin = ({
2131
+ value,
2132
+ editable,
2133
+ onChange,
2134
+ transformers = CUSTOM_TRANSFORMERS
2135
+ }) => {
2084
2136
  const [editor] = useLexicalComposerContext();
2085
2137
  const lastExportedRef = useRef(value);
2086
2138
  const onChangeRef = useRef(onChange);
2087
2139
  onChangeRef.current = onChange;
2140
+ const transformersRef = useRef(transformers);
2141
+ transformersRef.current = transformers;
2088
2142
  useEffect(() => {
2089
2143
  editor.setEditable(editable);
2090
2144
  }, [editor, editable]);
@@ -2093,7 +2147,7 @@ var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2093
2147
  lastExportedRef.current = value;
2094
2148
  editor.update(
2095
2149
  () => {
2096
- $convertFromMarkdownString(preprocessMarkdown(value), CUSTOM_TRANSFORMERS);
2150
+ $convertFromMarkdownString(preprocessMarkdown(value), transformersRef.current);
2097
2151
  },
2098
2152
  { tag: IMPORT_TAG }
2099
2153
  );
@@ -2102,7 +2156,7 @@ var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2102
2156
  return editor.registerUpdateListener(({ tags }) => {
2103
2157
  if (tags.has(IMPORT_TAG)) return;
2104
2158
  editor.getEditorState().read(() => {
2105
- const raw = $convertToMarkdownString(CUSTOM_TRANSFORMERS);
2159
+ const raw = $convertToMarkdownString(transformersRef.current);
2106
2160
  const markdown = postprocessMarkdown(raw);
2107
2161
  if (markdown !== lastExportedRef.current) {
2108
2162
  lastExportedRef.current = markdown;
@@ -2115,16 +2169,18 @@ var MarkdownSyncPlugin = ({ value, editable, onChange }) => {
2115
2169
  };
2116
2170
 
2117
2171
  // src/components/MarkdownEditor/plugins/ToolbarPlugin.tsx
2118
- init_Icon2();
2172
+ init_icons();
2119
2173
 
2120
2174
  // src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx
2175
+ init_icons();
2121
2176
  init_utils();
2122
2177
 
2123
2178
  // src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx
2179
+ init_icons();
2124
2180
  init_utils();
2125
2181
 
2126
2182
  // src/components/DropdownMenu/DropdownMenuItemIndicator.tsx
2127
- init_Icon2();
2183
+ init_icons();
2128
2184
  var variants3 = cva(
2129
2185
  [
2130
2186
  "tailwindcss-preflight",
@@ -2150,6 +2206,9 @@ var variants3 = cva(
2150
2206
  "tw-bg-white",
2151
2207
  "[&_svg]:tw-size-2",
2152
2208
  "[&_svg]:data-[state=unchecked]:tw-hidden",
2209
+ // Lucide Circle is stroke-only — force fill to match the stroke
2210
+ // (currentColor) so the indicator reads as a solid dot.
2211
+ "[&_svg]:tw-fill-current",
2153
2212
  "group-data-[variant=argo]/dropdown-menu-content:[&_svg]:tw-text-primary",
2154
2213
  "group-data-[variant=default]/dropdown-menu-content:[&_svg]:tw-text-secondary-500"
2155
2214
  ],
@@ -2169,6 +2228,9 @@ var variants3 = cva(
2169
2228
  ],
2170
2229
  switch: [
2171
2230
  "tw-size-5",
2231
+ // Lucide SVGs default to 24×24 — constrain the rendered ToggleRight
2232
+ // to the indicator slot so it doesn't overflow.
2233
+ "[&_svg]:tw-size-5",
2172
2234
  "tw-text-neutral-400",
2173
2235
  "data-[state=unchecked]:tw-rotate-180",
2174
2236
  "group-data-[variant=default]/dropdown-menu-content:data-[state=checked]:tw-text-secondary-500",
@@ -2184,10 +2246,10 @@ var DropdownMenuItemIndicator = ({
2184
2246
  forceMount: forceMountProp,
2185
2247
  ...rest
2186
2248
  }) => {
2187
- const icon = (() => {
2188
- if (variant === "switch") return "toggle-large-on";
2189
- if (variant === "radio") return "circle";
2190
- return "check";
2249
+ const IconComp = (() => {
2250
+ if (variant === "switch") return ToggleRight;
2251
+ if (variant === "radio") return Circle;
2252
+ return Check;
2191
2253
  })();
2192
2254
  const forceMount = (() => {
2193
2255
  if (forceMountProp) return true;
@@ -2200,28 +2262,33 @@ var DropdownMenuItemIndicator = ({
2200
2262
  ...rest,
2201
2263
  forceMount,
2202
2264
  className: variants3({ variant, className }),
2203
- children: /* @__PURE__ */ jsx(Icon, { icon })
2265
+ children: /* @__PURE__ */ jsx(IconComp, {})
2204
2266
  }
2205
2267
  );
2206
2268
  };
2207
2269
 
2208
2270
  // src/components/DropdownMenu/ItemIcon.tsx
2209
2271
  init_utils();
2210
- init_Icon2();
2211
- var ItemIcon = ({ className, ...props }) => /* @__PURE__ */ jsx(
2212
- Icon,
2272
+ var ItemIcon = ({ className, children, ...props }) => /* @__PURE__ */ jsx(
2273
+ "span",
2213
2274
  {
2214
2275
  ...props,
2215
2276
  className: cn(
2277
+ "tw-inline-flex",
2278
+ "tw-items-center",
2279
+ "tw-justify-center",
2216
2280
  "tw-aspect-square",
2217
- "tw-p-0.5",
2218
- "tw-size-4",
2281
+ // 20px container fits the 16px Lucide glyph plus 2px breathing room
2282
+ // each side — the previous tw-size-4 + tw-p-0.5 clipped the 16px child.
2283
+ "tw-size-5",
2284
+ "[&_svg]:tw-size-4",
2219
2285
  "group-data-[variant=default]/dropdown-menu-content:tw-text-neutral-400",
2220
2286
  "group-data-[variant=argo]/dropdown-menu-content:tw-text-primary",
2221
2287
  "group-data-[variant=argo]/dropdown-menu-content:group-aria-disabled:tw-text-muted-foreground",
2222
2288
  "group-data-[variant=default]/dropdown-menu-content:group-hover:tw-text-secondary-500",
2223
2289
  className
2224
- )
2290
+ ),
2291
+ children
2225
2292
  }
2226
2293
  );
2227
2294
 
@@ -2303,7 +2370,7 @@ var DropdownMenuCheckboxItem = ({
2303
2370
  ...props
2304
2371
  }) => {
2305
2372
  const isAtStart = indicatorAlign === "start";
2306
- const indicatorEle = isLoading ? /* @__PURE__ */ jsx(ItemIcon, { spin: true, icon: "spinner", className: isAtStart ? "" : "tw-ml-auto" }) : /* @__PURE__ */ jsx(DropdownMenuItemIndicator, { variant: indicator, className: isAtStart ? "" : "tw-ml-auto" });
2373
+ const indicatorEle = isLoading ? /* @__PURE__ */ jsx(ItemIcon, { className: isAtStart ? "" : "tw-ml-auto", children: /* @__PURE__ */ jsx(Loader2, { className: "tw-animate-spin" }) }) : /* @__PURE__ */ jsx(DropdownMenuItemIndicator, { variant: indicator, className: isAtStart ? "" : "tw-ml-auto" });
2307
2374
  const handleSelect = (event) => {
2308
2375
  if (!closeOnSelect) event.preventDefault();
2309
2376
  onSelect?.(event);
@@ -2436,6 +2503,7 @@ var DropdownMenuContent = ({
2436
2503
  };
2437
2504
 
2438
2505
  // src/components/DropdownMenu/DropdownMenuItem.tsx
2506
+ init_icons();
2439
2507
  init_utils();
2440
2508
  var DropdownMenuItem = ({
2441
2509
  ref,
@@ -2446,13 +2514,13 @@ var DropdownMenuItem = ({
2446
2514
  onPointerMove,
2447
2515
  children,
2448
2516
  asChild,
2449
- icon: iconProp,
2517
+ icon,
2450
2518
  iconClassName,
2451
2519
  isLoading = false,
2452
2520
  ...props
2453
2521
  }) => {
2454
2522
  const Comp = asChild ? Root$2 : "div";
2455
- const icon = isLoading ? "spinner" : iconProp;
2523
+ const adornment = isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "tw-animate-spin" }) : renderLegacyIcon(icon);
2456
2524
  const handleOnSelect = (event) => {
2457
2525
  if (asModalTrigger) event.preventDefault();
2458
2526
  onSelect?.(event);
@@ -2476,7 +2544,7 @@ var DropdownMenuItem = ({
2476
2544
  className: cn(itemVariants, className),
2477
2545
  asChild: true,
2478
2546
  children: /* @__PURE__ */ jsxs(Comp, { children: [
2479
- icon && /* @__PURE__ */ jsx(ItemIcon, { spin: isLoading, icon, className: iconClassName }),
2547
+ adornment && /* @__PURE__ */ jsx(ItemIcon, { className: iconClassName, children: adornment }),
2480
2548
  /* @__PURE__ */ jsx(Slottable, { children })
2481
2549
  ] })
2482
2550
  }
@@ -2552,6 +2620,7 @@ var DropdownMenuRadioGroup = ({
2552
2620
  };
2553
2621
 
2554
2622
  // src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx
2623
+ init_icons();
2555
2624
  init_utils();
2556
2625
  var DropdownMenuRadioItem = ({
2557
2626
  className,
@@ -2566,7 +2635,7 @@ var DropdownMenuRadioItem = ({
2566
2635
  ...props
2567
2636
  }) => {
2568
2637
  const isAtStart = indicatorAlign === "start";
2569
- const indicatorEle = isLoading ? /* @__PURE__ */ jsx(ItemIcon, { spin: true, icon: "spinner", className: iconClassName }) : /* @__PURE__ */ jsx(DropdownMenuItemIndicator, { variant: indicator });
2638
+ const indicatorEle = isLoading ? /* @__PURE__ */ jsx(ItemIcon, { className: iconClassName, children: /* @__PURE__ */ jsx(Loader2, { className: "tw-animate-spin" }) }) : /* @__PURE__ */ jsx(DropdownMenuItemIndicator, { variant: indicator });
2570
2639
  const handleSelect = (event) => {
2571
2640
  if (!closeOnSelect) event.preventDefault();
2572
2641
  onSelect?.(event);
@@ -2587,7 +2656,7 @@ var DropdownMenuRadioItem = ({
2587
2656
  ...props,
2588
2657
  children: [
2589
2658
  isAtStart && indicatorEle,
2590
- icon && /* @__PURE__ */ jsx(ItemIcon, { icon, className: iconClassName }),
2659
+ icon && /* @__PURE__ */ jsx(ItemIcon, { className: iconClassName, children: renderLegacyIcon(icon) }),
2591
2660
  /* @__PURE__ */ jsx("span", { className: "tw-flex tw-min-w-0 tw-flex-1 tw-items-center tw-gap-2", children }),
2592
2661
  !isAtStart && indicatorEle
2593
2662
  ]
@@ -2638,12 +2707,12 @@ var DropdownMenuSubContent = ({ className, ...props }) => {
2638
2707
  };
2639
2708
 
2640
2709
  // src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubTrigger.tsx
2710
+ init_icons();
2641
2711
  init_utils();
2642
- init_Icon2();
2643
2712
  var DropdownMenuSubTrigger = ({ className, children, ...props }) => {
2644
2713
  return /* @__PURE__ */ jsxs(DropdownMenuPrimitive3.SubTrigger, { className: cn(itemVariants, className), ...props, children: [
2645
2714
  children,
2646
- /* @__PURE__ */ jsx(Icon, { icon: "chevron-right", className: "tw-ml-auto" })
2715
+ /* @__PURE__ */ jsx(ChevronRight, { className: "tw-ml-auto tw-size-5" })
2647
2716
  ] });
2648
2717
  };
2649
2718
 
@@ -2686,13 +2755,12 @@ DropdownMenu.RadioItem = DropdownMenuRadioItem;
2686
2755
  DropdownMenu.ItemDescription = DropdownMenuItemDescription;
2687
2756
 
2688
2757
  // src/components/MarkdownEditor/plugins/toolbar/AlignmentDropdown.tsx
2689
- init_Icon2();
2690
2758
  init_Tooltip2();
2691
2759
  var ALIGNMENT_OPTIONS = [
2692
- { value: "left", label: "Left", icon: ["far", "align-left"] },
2693
- { value: "center", label: "Center", icon: ["far", "align-center"] },
2694
- { value: "right", label: "Right", icon: ["far", "align-right"] },
2695
- { value: "justify", label: "Justify", icon: ["far", "align-justify"] }
2760
+ { value: "left", label: "Left", icon: AlignLeft },
2761
+ { value: "center", label: "Center", icon: AlignCenter },
2762
+ { value: "right", label: "Right", icon: AlignRight },
2763
+ { value: "justify", label: "Justify", icon: AlignJustify }
2696
2764
  ];
2697
2765
  var ALIGNMENT_ICONS = Object.fromEntries(
2698
2766
  ALIGNMENT_OPTIONS.map(({ value, icon }) => [value, icon])
@@ -2718,6 +2786,7 @@ var AlignmentDropdown = ({
2718
2786
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, align);
2719
2787
  });
2720
2788
  };
2789
+ const CurrentAlignmentIcon = ALIGNMENT_ICONS[alignment] ?? AlignLeft;
2721
2790
  return /* @__PURE__ */ jsxs(DropdownMenu, { onOpenChange: handleOpenChange, children: [
2722
2791
  /* @__PURE__ */ jsx(Tooltip, { tooltip: "Text alignment", placement: "top", triggerAsChild: true, children: /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
2723
2792
  "button",
@@ -2728,12 +2797,12 @@ var AlignmentDropdown = ({
2728
2797
  "hover:tw-bg-neutral-100"
2729
2798
  ),
2730
2799
  children: [
2731
- /* @__PURE__ */ jsx(Icon, { icon: ALIGNMENT_ICONS[alignment] ?? ["far", "align-left"], fixedWidth: true }),
2732
- /* @__PURE__ */ jsx(Icon, { icon: ["fas", "caret-down"], className: "tw-text-[8px]" })
2800
+ /* @__PURE__ */ jsx(CurrentAlignmentIcon, { className: "tw-size-4" }),
2801
+ /* @__PURE__ */ jsx(ChevronDown, { className: "tw-size-3" })
2733
2802
  ]
2734
2803
  }
2735
2804
  ) }) }),
2736
- /* @__PURE__ */ jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-32", children: ALIGNMENT_OPTIONS.map(({ value, label, icon }) => /* @__PURE__ */ jsxs(
2805
+ /* @__PURE__ */ jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-32", children: ALIGNMENT_OPTIONS.map(({ value, label, icon: IconComp }) => /* @__PURE__ */ jsxs(
2737
2806
  DropdownMenu.Item,
2738
2807
  {
2739
2808
  onSelect: () => handleSelect(value),
@@ -2742,7 +2811,7 @@ var AlignmentDropdown = ({
2742
2811
  alignment === value && "tw-bg-secondary-50 tw-text-secondary-500"
2743
2812
  ),
2744
2813
  children: [
2745
- /* @__PURE__ */ jsx(Icon, { icon, fixedWidth: true }),
2814
+ /* @__PURE__ */ jsx(IconComp, { className: "tw-size-4" }),
2746
2815
  label
2747
2816
  ]
2748
2817
  },
@@ -2752,18 +2821,18 @@ var AlignmentDropdown = ({
2752
2821
  };
2753
2822
 
2754
2823
  // src/components/MarkdownEditor/plugins/toolbar/BlockTypeDropdown.tsx
2824
+ init_icons();
2755
2825
  init_utils();
2756
- init_Icon2();
2757
2826
  init_Tooltip2();
2758
2827
  var BLOCK_TYPE_META = {
2759
- paragraph: { label: "Normal", icon: ["far", "font"], selectable: true },
2760
- h1: { label: "Heading 1", icon: ["far", "h1"], selectable: true },
2761
- h2: { label: "Heading 2", icon: ["far", "h2"], selectable: true },
2762
- h3: { label: "Heading 3", icon: ["far", "h3"], selectable: true },
2763
- bullet: { label: "Bullet List", icon: ["far", "list-ul"], selectable: false },
2764
- number: { label: "Numbered List", icon: ["far", "list-ol"], selectable: false },
2765
- quote: { label: "Quote", icon: ["far", "block-quote"], selectable: false },
2766
- code: { label: "Code Block", icon: "square-code", selectable: false }
2828
+ paragraph: { label: "Normal", icon: Type, selectable: true },
2829
+ h1: { label: "Heading 1", icon: Heading1, selectable: true },
2830
+ h2: { label: "Heading 2", icon: Heading2, selectable: true },
2831
+ h3: { label: "Heading 3", icon: Heading3, selectable: true },
2832
+ bullet: { label: "Bullet List", icon: List, selectable: false },
2833
+ number: { label: "Numbered List", icon: ListOrdered, selectable: false },
2834
+ quote: { label: "Quote", icon: Quote, selectable: false },
2835
+ code: { label: "Code Block", icon: SquareCode, selectable: false }
2767
2836
  };
2768
2837
  var BLOCK_TYPE_OPTIONS = Object.entries(BLOCK_TYPE_META).filter(([, meta]) => meta.selectable).map(([value, { label, icon }]) => ({ value, label, icon }));
2769
2838
  var isBlockType = (value) => Object.prototype.hasOwnProperty.call(BLOCK_TYPE_META, value);
@@ -2773,6 +2842,7 @@ var BlockTypeDropdown = ({
2773
2842
  }) => {
2774
2843
  const savedSelectionRef = useRef(null);
2775
2844
  const currentMeta = isBlockType(blockType) ? BLOCK_TYPE_META[blockType] : null;
2845
+ const CurrentBlockIcon = currentMeta?.icon ?? Type;
2776
2846
  const handleOpenChange = (open) => {
2777
2847
  if (open) {
2778
2848
  editor.getEditorState().read(() => {
@@ -2813,13 +2883,13 @@ var BlockTypeDropdown = ({
2813
2883
  "hover:tw-bg-neutral-100"
2814
2884
  ),
2815
2885
  children: [
2816
- /* @__PURE__ */ jsx(Icon, { icon: currentMeta?.icon ?? ["far", "font"], fixedWidth: true }),
2886
+ /* @__PURE__ */ jsx(CurrentBlockIcon, { className: "tw-size-4" }),
2817
2887
  currentMeta?.label ?? "Normal",
2818
- /* @__PURE__ */ jsx(Icon, { icon: ["fas", "caret-down"], className: "tw-text-[8px]" })
2888
+ /* @__PURE__ */ jsx(ChevronDown, { className: "tw-size-3" })
2819
2889
  ]
2820
2890
  }
2821
2891
  ) }) }),
2822
- /* @__PURE__ */ jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-40", children: BLOCK_TYPE_OPTIONS.map(({ value, label, icon }) => /* @__PURE__ */ jsxs(
2892
+ /* @__PURE__ */ jsx(DropdownMenu.Content, { align: "start", className: "tw-min-w-40", children: BLOCK_TYPE_OPTIONS.map(({ value, label, icon: IconComp }) => /* @__PURE__ */ jsxs(
2823
2893
  DropdownMenu.Item,
2824
2894
  {
2825
2895
  onSelect: () => handleSelect(value),
@@ -2828,7 +2898,7 @@ var BlockTypeDropdown = ({
2828
2898
  blockType === value && "tw-bg-secondary-50 tw-text-secondary-500"
2829
2899
  ),
2830
2900
  children: [
2831
- /* @__PURE__ */ jsx(Icon, { icon, fixedWidth: true }),
2901
+ /* @__PURE__ */ jsx(IconComp, { className: "tw-size-4" }),
2832
2902
  label
2833
2903
  ]
2834
2904
  },
@@ -2838,6 +2908,7 @@ var BlockTypeDropdown = ({
2838
2908
  };
2839
2909
 
2840
2910
  // src/components/MarkdownEditor/plugins/toolbar/LinkPanel.tsx
2911
+ init_icons();
2841
2912
  init_Button2();
2842
2913
  var buttonGroupVariant = cva(
2843
2914
  ["tailwindcss-preflight", "tw-inline-flex", "tw-items-center", "tw-group/button-group"],
@@ -3274,6 +3345,7 @@ InputGroup.TextArea = InputGroupTextArea;
3274
3345
  InputGroup.Text = InputGroupText;
3275
3346
 
3276
3347
  // src/blocks/ColorInput/ColorInput.tsx
3348
+ init_icons();
3277
3349
  init_utils();
3278
3350
 
3279
3351
  // src/blocks/ColorInput/utils.ts
@@ -3337,9 +3409,9 @@ var ColorPicker = ({ value, disabled, readOnly, ...props }) => {
3337
3409
  {
3338
3410
  onMouseDown: (event) => event.preventDefault(),
3339
3411
  disabled: disabled || readOnly,
3340
- icon: "eye-dropper",
3341
3412
  onClick: handleOpenPicker,
3342
- "aria-label": "Pick color"
3413
+ "aria-label": "Pick color",
3414
+ children: /* @__PURE__ */ jsx(Pipette, { className: "tw-size-4" })
3343
3415
  }
3344
3416
  )
3345
3417
  ] });
@@ -3455,10 +3527,10 @@ var ColorInput = ({
3455
3527
  canClear && /* @__PURE__ */ jsx(
3456
3528
  InputGroup.Button,
3457
3529
  {
3458
- icon: "xmark",
3459
3530
  onMouseDown: (event) => event.preventDefault(),
3460
3531
  onClick: handleClear,
3461
- "aria-label": "Clear color"
3532
+ "aria-label": "Clear color",
3533
+ children: /* @__PURE__ */ jsx(X, { className: "tw-size-4" })
3462
3534
  }
3463
3535
  ),
3464
3536
  /* @__PURE__ */ jsx(
@@ -3591,6 +3663,7 @@ var FormGroupTextarea = (props) => {
3591
3663
  };
3592
3664
 
3593
3665
  // src/components/Input/Input.tsx
3666
+ init_icons();
3594
3667
  init_utils();
3595
3668
 
3596
3669
  // src/components/Input/utils.ts
@@ -3688,10 +3761,11 @@ var Input = ({
3688
3761
  allowClear && isClearButtonVisible && /* @__PURE__ */ jsx(
3689
3762
  InputGroup.Button,
3690
3763
  {
3691
- icon: "xmark",
3764
+ "aria-label": "Clear",
3692
3765
  onMouseDown: (e) => e.preventDefault(),
3693
3766
  onClick: handleClear,
3694
- "data-testid": testId.clearButton
3767
+ "data-testid": testId.clearButton,
3768
+ children: /* @__PURE__ */ jsx(X, { className: "tw-size-4" })
3695
3769
  }
3696
3770
  ),
3697
3771
  rightSuffix && /* @__PURE__ */ jsx(
@@ -3760,9 +3834,6 @@ FormGroup.NumberInput = FormGroupNumberInput;
3760
3834
  FormGroup.ColorInput = FormGroupColorInput;
3761
3835
  FormGroup.Textarea = FormGroupTextarea;
3762
3836
 
3763
- // src/components/MarkdownEditor/plugins/toolbar/LinkPanel.tsx
3764
- init_Icon2();
3765
-
3766
3837
  // src/components/Label/Label.tsx
3767
3838
  init_utils();
3768
3839
  var Optional = ({ className }) => /* @__PURE__ */ jsx("span", { className: cn("tw-text-neutral-400", className), children: "(optional)" });
@@ -3874,12 +3945,12 @@ var LinkPanel = ({ editor, isLink }) => {
3874
3945
  active: true,
3875
3946
  onClick: () => editor.dispatchCommand(TOGGLE_LINK_COMMAND, null),
3876
3947
  tooltip: "Remove Link",
3877
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "link"] })
3948
+ children: /* @__PURE__ */ jsx(Link, { className: "tw-size-4" })
3878
3949
  }
3879
3950
  );
3880
3951
  }
3881
3952
  return /* @__PURE__ */ jsxs("div", { className: "tw-relative", children: [
3882
- /* @__PURE__ */ jsx(ToolbarButton, { active: open, onClick: handleOpen, tooltip: "Insert Link", children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "link"] }) }),
3953
+ /* @__PURE__ */ jsx(ToolbarButton, { active: open, onClick: handleOpen, tooltip: "Insert Link", children: /* @__PURE__ */ jsx(Link, { className: "tw-size-4" }) }),
3883
3954
  open && /* @__PURE__ */ jsx(
3884
3955
  "div",
3885
3956
  {
@@ -4043,7 +4114,7 @@ var ToolbarPlugin = () => {
4043
4114
  active: isBold,
4044
4115
  onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold"),
4045
4116
  tooltip: "Bold (Ctrl+B)",
4046
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "bold"] })
4117
+ children: /* @__PURE__ */ jsx(Bold, { className: "tw-size-4" })
4047
4118
  }
4048
4119
  ),
4049
4120
  /* @__PURE__ */ jsx(
@@ -4052,7 +4123,7 @@ var ToolbarPlugin = () => {
4052
4123
  active: isItalic,
4053
4124
  onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic"),
4054
4125
  tooltip: "Italic (Ctrl+I)",
4055
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "italic"] })
4126
+ children: /* @__PURE__ */ jsx(Italic, { className: "tw-size-4" })
4056
4127
  }
4057
4128
  ),
4058
4129
  /* @__PURE__ */ jsx(
@@ -4061,7 +4132,7 @@ var ToolbarPlugin = () => {
4061
4132
  active: isUnderline,
4062
4133
  onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline"),
4063
4134
  tooltip: "Underline (Ctrl+U)",
4064
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "underline"] })
4135
+ children: /* @__PURE__ */ jsx(Underline, { className: "tw-size-4" })
4065
4136
  }
4066
4137
  ),
4067
4138
  /* @__PURE__ */ jsx(
@@ -4070,7 +4141,7 @@ var ToolbarPlugin = () => {
4070
4141
  active: isStrikethrough,
4071
4142
  onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough"),
4072
4143
  tooltip: "Strikethrough",
4073
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "strikethrough"] })
4144
+ children: /* @__PURE__ */ jsx(Strikethrough, { className: "tw-size-4" })
4074
4145
  }
4075
4146
  ),
4076
4147
  /* @__PURE__ */ jsx(
@@ -4079,7 +4150,7 @@ var ToolbarPlugin = () => {
4079
4150
  active: isCode,
4080
4151
  onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, "code"),
4081
4152
  tooltip: "Inline Code",
4082
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "code"] })
4153
+ children: /* @__PURE__ */ jsx(Code, { className: "tw-size-4" })
4083
4154
  }
4084
4155
  ),
4085
4156
  /* @__PURE__ */ jsx(ToolbarDivider, {}),
@@ -4097,7 +4168,7 @@ var ToolbarPlugin = () => {
4097
4168
  }
4098
4169
  },
4099
4170
  tooltip: "Bullet List",
4100
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "list-ul"] })
4171
+ children: /* @__PURE__ */ jsx(List, { className: "tw-size-4" })
4101
4172
  }
4102
4173
  ),
4103
4174
  /* @__PURE__ */ jsx(
@@ -4112,7 +4183,7 @@ var ToolbarPlugin = () => {
4112
4183
  }
4113
4184
  },
4114
4185
  tooltip: "Numbered List",
4115
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "list-ol"] })
4186
+ children: /* @__PURE__ */ jsx(ListOrdered, { className: "tw-size-4" })
4116
4187
  }
4117
4188
  ),
4118
4189
  /* @__PURE__ */ jsx(ToolbarDivider, {}),
@@ -4134,7 +4205,7 @@ var ToolbarPlugin = () => {
4134
4205
  });
4135
4206
  },
4136
4207
  tooltip: "Quote",
4137
- children: /* @__PURE__ */ jsx(Icon, { icon: ["far", "block-quote"] })
4208
+ children: /* @__PURE__ */ jsx(Quote, { className: "tw-size-4" })
4138
4209
  }
4139
4210
  ),
4140
4211
  /* @__PURE__ */ jsx(
@@ -4153,7 +4224,7 @@ var ToolbarPlugin = () => {
4153
4224
  });
4154
4225
  },
4155
4226
  tooltip: "Code Block",
4156
- children: /* @__PURE__ */ jsx(Icon, { icon: "square-code" })
4227
+ children: /* @__PURE__ */ jsx(SquareCode, { className: "tw-size-4" })
4157
4228
  }
4158
4229
  )
4159
4230
  ]
@@ -4218,9 +4289,14 @@ var MarkdownEditor = ({
4218
4289
  onImageUpload,
4219
4290
  className,
4220
4291
  imageRenderer,
4221
- showToolbar = false
4292
+ showToolbar = false,
4293
+ compact = false,
4294
+ saveOnBlur = false,
4295
+ singleLine = false,
4296
+ clampDisplay = false
4222
4297
  }) => {
4223
4298
  const editable = !readOnly && !disabled;
4299
+ const transformers = singleLine ? SINGLE_LINE_TRANSFORMERS : CUSTOM_TRANSFORMERS;
4224
4300
  const [initialConfig] = useState(() => ({
4225
4301
  namespace: "MarkdownEditor",
4226
4302
  theme: editorTheme,
@@ -4230,47 +4306,106 @@ var MarkdownEditor = ({
4230
4306
  },
4231
4307
  editable,
4232
4308
  editorState: () => {
4233
- $convertFromMarkdownString(preprocessMarkdown(value), CUSTOM_TRANSFORMERS);
4309
+ $convertFromMarkdownString(preprocessMarkdown(value), transformers);
4234
4310
  }
4235
4311
  }));
4236
- return /* @__PURE__ */ jsx(LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsx(ImageRendererProvider, { value: imageRenderer ?? null, children: /* @__PURE__ */ jsxs("div", { className: cn("tw-prose", className), children: [
4237
- showToolbar && editable && /* @__PURE__ */ jsx(ToolbarPlugin, {}),
4238
- /* @__PURE__ */ jsx(
4239
- "div",
4240
- {
4241
- className: cn(
4242
- "tw-relative tw-rounded-md tw-p-2 tw-transition-colors",
4243
- editable && "tw-cursor-text hover:tw-bg-neutral-50 focus-within:tw-ring-2 focus-within:tw-ring-secondary-500/40"
4244
- ),
4245
- children: /* @__PURE__ */ jsx(
4246
- RichTextPlugin,
4312
+ const skipBlurSaveRef = useRef(false);
4313
+ const handleBlur = saveOnBlur && onSave ? (event) => {
4314
+ if (skipBlurSaveRef.current) {
4315
+ skipBlurSaveRef.current = false;
4316
+ return;
4317
+ }
4318
+ if (!event.currentTarget.contains(event.relatedTarget)) {
4319
+ onSave();
4320
+ }
4321
+ } : void 0;
4322
+ return /* @__PURE__ */ jsx(LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsx(ImageRendererProvider, { value: imageRenderer ?? null, children: /* @__PURE__ */ jsxs(
4323
+ "div",
4324
+ {
4325
+ className: cn(
4326
+ !compact && "tw-prose",
4327
+ // Compact mode drops `tw-prose`, so Lexical's <p> wrappers fall back to the browser
4328
+ // default `margin: 1em 0` — visually huge at heading sizes. Zero them, and use the
4329
+ // adjacent-sibling selector for paragraph spacing so single-paragraph blocks (titles,
4330
+ // short descriptions) stay tight while multi-paragraph blocks still breathe.
4331
+ compact && "[&_p]:tw-m-0 [&_p+p]:tw-mt-2",
4332
+ // Display-state clamp: 2 lines + bottom fade. Drops in focus-within so editing
4333
+ // expands to full height. Fade replaces ellipsis per the pattern spec — the
4334
+ // mask gradient overlays line-clamp's default ellipsis so it's invisible.
4335
+ clampDisplay && "[&:not(:focus-within)]:tw-line-clamp-2 [&:not(:focus-within)]:[mask-image:linear-gradient(to_bottom,black_50%,transparent)]",
4336
+ className
4337
+ ),
4338
+ onBlur: handleBlur,
4339
+ children: [
4340
+ showToolbar && editable && /* @__PURE__ */ jsx(ToolbarPlugin, {}),
4341
+ /* @__PURE__ */ jsx(
4342
+ "div",
4247
4343
  {
4248
- contentEditable: /* @__PURE__ */ jsx(
4249
- ContentEditable,
4344
+ className: cn(
4345
+ "tw-relative tw-rounded-md tw-transition-colors",
4346
+ // In compact mode the padding lets the hover bg / focus ring extend past the text,
4347
+ // but a matching negative margin shifts the wrapper outward so the text itself stays
4348
+ // aligned with the parent's content edge (i.e. with where static text would render).
4349
+ compact ? "tw-px-1.5 tw-py-0.5 -tw-mx-1.5 -tw-my-0.5" : "tw-p-2",
4350
+ editable && "tw-cursor-text hover:tw-bg-neutral-50 focus-within:tw-ring-2 focus-within:tw-ring-secondary-500/40"
4351
+ ),
4352
+ children: /* @__PURE__ */ jsx(
4353
+ RichTextPlugin,
4250
4354
  {
4251
- className: "tw-min-h-[100px] tw-outline-none",
4252
- "aria-placeholder": placeholder ?? "",
4253
- placeholder: placeholder ? /* @__PURE__ */ 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__ */ jsx("div", {})
4355
+ contentEditable: /* @__PURE__ */ jsx(
4356
+ ContentEditable,
4357
+ {
4358
+ className: cn("tw-outline-none", !compact && "tw-min-h-[100px]"),
4359
+ "aria-placeholder": placeholder ?? "",
4360
+ placeholder: placeholder ? /* @__PURE__ */ jsx(
4361
+ "div",
4362
+ {
4363
+ className: cn(
4364
+ "tw-pointer-events-none tw-absolute tw-select-none tw-text-neutral-400",
4365
+ compact ? "tw-left-1.5 tw-top-0.5" : "tw-left-2 tw-top-[calc(0.5rem+0.35em)]"
4366
+ ),
4367
+ children: placeholder
4368
+ }
4369
+ ) : /* @__PURE__ */ jsx("div", {})
4370
+ }
4371
+ ),
4372
+ ErrorBoundary: LexicalErrorBoundary
4254
4373
  }
4255
- ),
4256
- ErrorBoundary: LexicalErrorBoundary
4374
+ )
4257
4375
  }
4258
- )
4259
- }
4260
- ),
4261
- /* @__PURE__ */ jsx(HistoryPlugin, {}),
4262
- /* @__PURE__ */ jsx(LinkPlugin, {}),
4263
- /* @__PURE__ */ jsx(ClickableLinkPlugin, { newTab: true }),
4264
- /* @__PURE__ */ jsx(ListPlugin, {}),
4265
- /* @__PURE__ */ jsx(CheckListPlugin, {}),
4266
- /* @__PURE__ */ jsx(HorizontalRulePlugin, {}),
4267
- /* @__PURE__ */ jsx(TabIndentationPlugin, {}),
4268
- /* @__PURE__ */ jsx(MarkdownShortcutPlugin, { transformers: CUSTOM_TRANSFORMERS }),
4269
- /* @__PURE__ */ jsx(MarkdownSyncPlugin, { value, editable, onChange }),
4270
- /* @__PURE__ */ jsx(ImagePastePlugin, { onImageUpload }),
4271
- /* @__PURE__ */ jsx(KeyboardPlugin, { onSave, onCancel }),
4272
- autoFocus && /* @__PURE__ */ jsx(AutoFocusPlugin, {})
4273
- ] }) }) });
4376
+ ),
4377
+ /* @__PURE__ */ jsx(HistoryPlugin, {}),
4378
+ /* @__PURE__ */ jsx(LinkPlugin, {}),
4379
+ /* @__PURE__ */ jsx(ClickableLinkPlugin, { newTab: true }),
4380
+ !singleLine && /* @__PURE__ */ jsx(ListPlugin, {}),
4381
+ !singleLine && /* @__PURE__ */ jsx(CheckListPlugin, {}),
4382
+ !singleLine && /* @__PURE__ */ jsx(HorizontalRulePlugin, {}),
4383
+ /* @__PURE__ */ jsx(TabIndentationPlugin, {}),
4384
+ /* @__PURE__ */ jsx(MarkdownShortcutPlugin, { transformers }),
4385
+ /* @__PURE__ */ jsx(
4386
+ MarkdownSyncPlugin,
4387
+ {
4388
+ value,
4389
+ editable,
4390
+ onChange,
4391
+ transformers
4392
+ }
4393
+ ),
4394
+ /* @__PURE__ */ jsx(ImagePastePlugin, { onImageUpload }),
4395
+ /* @__PURE__ */ jsx(
4396
+ KeyboardPlugin,
4397
+ {
4398
+ onSave,
4399
+ onCancel,
4400
+ singleLine,
4401
+ blurOnEscape: singleLine || saveOnBlur,
4402
+ skipBlurSaveRef
4403
+ }
4404
+ ),
4405
+ autoFocus && /* @__PURE__ */ jsx(AutoFocusPlugin, {})
4406
+ ]
4407
+ }
4408
+ ) }) });
4274
4409
  };
4275
4410
 
4276
4411
  export { MarkdownEditor };