@intlayer/design-system 8.11.3 → 8.12.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 (275) hide show
  1. package/dist/esm/api/hooks/project.mjs +110 -1
  2. package/dist/esm/api/hooks/project.mjs.map +1 -1
  3. package/dist/esm/api/hooks/utils.mjs +1 -1
  4. package/dist/esm/api/index.mjs +2 -2
  5. package/dist/esm/api/useAuth/useOAuth2.mjs +2 -2
  6. package/dist/esm/api/useAuth/useSession.mjs +1 -1
  7. package/dist/esm/api/useIntlayerAPI.mjs +1 -1
  8. package/dist/esm/components/Accordion/Accordion.mjs.map +1 -1
  9. package/dist/esm/components/Badge/index.mjs +18 -55
  10. package/dist/esm/components/Badge/index.mjs.map +1 -1
  11. package/dist/esm/components/Breadcrumb/index.mjs +12 -12
  12. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  13. package/dist/esm/components/Browser/Browser.mjs +1 -1
  14. package/dist/esm/components/Browser/Browser.mjs.map +1 -1
  15. package/dist/esm/components/Button/Button.mjs +60 -117
  16. package/dist/esm/components/Button/Button.mjs.map +1 -1
  17. package/dist/esm/components/Button/index.mjs +2 -2
  18. package/dist/esm/components/Carousel/index.mjs +3 -3
  19. package/dist/esm/components/Carousel/index.mjs.map +1 -1
  20. package/dist/esm/components/Container/index.mjs +1 -71
  21. package/dist/esm/components/Container/index.mjs.map +1 -1
  22. package/dist/esm/components/ContentEditor/ContentEditor.mjs +0 -1
  23. package/dist/esm/components/ContentEditor/ContentEditor.mjs.map +1 -1
  24. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +2 -2
  25. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
  26. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
  27. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  28. package/dist/esm/components/ContentEditor/index.mjs +1 -1
  29. package/dist/esm/components/CopyButton/index.mjs +4 -4
  30. package/dist/esm/components/CopyButton/index.mjs.map +1 -1
  31. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
  32. package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +1 -1
  33. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
  34. package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +1 -1
  35. package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
  36. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  37. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
  38. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +6 -7
  39. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  40. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +0 -1
  41. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +3 -4
  43. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  44. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +3 -3
  45. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  46. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
  47. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +3 -3
  48. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  49. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +3 -4
  50. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  51. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
  52. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -3
  53. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  54. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +1 -1
  55. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  56. package/dist/esm/components/DropDown/index.mjs +3 -23
  57. package/dist/esm/components/DropDown/index.mjs.map +1 -1
  58. package/dist/esm/components/EditableField/EditableFieldLayout.mjs +1 -1
  59. package/dist/esm/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  60. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs +1 -1
  61. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  62. package/dist/esm/components/IDE/CopyCode.mjs +0 -1
  63. package/dist/esm/components/IDE/CopyCode.mjs.map +1 -1
  64. package/dist/esm/components/Input/Checkbox.mjs +2 -22
  65. package/dist/esm/components/Input/Checkbox.mjs.map +1 -1
  66. package/dist/esm/components/Input/Input.mjs +1 -11
  67. package/dist/esm/components/Input/Input.mjs.map +1 -1
  68. package/dist/esm/components/Input/Radio.mjs +82 -0
  69. package/dist/esm/components/Input/Radio.mjs.map +1 -0
  70. package/dist/esm/components/Input/index.mjs +4 -3
  71. package/dist/esm/components/KeyboardScreenAdapter/index.mjs +1 -1
  72. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs +2 -53
  73. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs.map +1 -1
  74. package/dist/esm/components/KeyboardShortcut/index.mjs +2 -2
  75. package/dist/esm/components/Link/Link.mjs +33 -85
  76. package/dist/esm/components/Link/Link.mjs.map +1 -1
  77. package/dist/esm/components/Link/index.mjs +2 -2
  78. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +3 -3
  79. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  80. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  81. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  82. package/dist/esm/components/MarkDownRender/MarkDownIframe.mjs +3 -3
  83. package/dist/esm/components/MarkDownRender/MarkDownIframe.mjs.map +1 -1
  84. package/dist/esm/components/Modal/Modal.mjs +5 -16
  85. package/dist/esm/components/Modal/Modal.mjs.map +1 -1
  86. package/dist/esm/components/Modal/index.mjs +2 -2
  87. package/dist/esm/components/Navbar/DesktopNavbar.mjs +1 -1
  88. package/dist/esm/components/Navbar/DesktopNavbar.mjs.map +1 -1
  89. package/dist/esm/components/Navbar/MobileNavbar.mjs +2 -2
  90. package/dist/esm/components/Pagination/Pagination.mjs +3 -15
  91. package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
  92. package/dist/esm/components/Pagination/index.mjs +2 -2
  93. package/dist/esm/components/Pattern/DotPattern.mjs +1 -1
  94. package/dist/esm/components/Pattern/DotPattern.mjs.map +1 -1
  95. package/dist/esm/components/Popover/dynamic.mjs +4 -4
  96. package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
  97. package/dist/esm/components/Popover/index.mjs +2 -2
  98. package/dist/esm/components/Popover/static.mjs +6 -28
  99. package/dist/esm/components/Popover/static.mjs.map +1 -1
  100. package/dist/esm/components/RightDrawer/RightDrawer.mjs +4 -4
  101. package/dist/esm/components/RightDrawer/RightDrawer.mjs.map +1 -1
  102. package/dist/esm/components/Select/Multiselect.mjs +4 -4
  103. package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
  104. package/dist/esm/components/Select/Select.mjs +3 -15
  105. package/dist/esm/components/Select/Select.mjs.map +1 -1
  106. package/dist/esm/components/Select/index.mjs +2 -2
  107. package/dist/esm/components/Steps/index.mjs +37 -27
  108. package/dist/esm/components/Steps/index.mjs.map +1 -1
  109. package/dist/esm/components/Steps/steps.content.mjs +55 -0
  110. package/dist/esm/components/Steps/steps.content.mjs.map +1 -0
  111. package/dist/esm/components/SwitchSelector/SwitchSelector.mjs +19 -35
  112. package/dist/esm/components/SwitchSelector/SwitchSelector.mjs.map +1 -1
  113. package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs +20 -20
  114. package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs.map +1 -1
  115. package/dist/esm/components/SwitchSelector/index.mjs +2 -2
  116. package/dist/esm/components/Tab/Tab.mjs +3 -3
  117. package/dist/esm/components/Tab/Tab.mjs.map +1 -1
  118. package/dist/esm/components/TabSelector/TabSelector.mjs +2 -12
  119. package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
  120. package/dist/esm/components/TabSelector/index.mjs +2 -2
  121. package/dist/esm/components/Table/ExpandButton.mjs +0 -1
  122. package/dist/esm/components/Table/ExpandButton.mjs.map +1 -1
  123. package/dist/esm/components/Table/SmartTable.mjs +1 -1
  124. package/dist/esm/components/Table/SmartTable.mjs.map +1 -1
  125. package/dist/esm/components/Tag/index.mjs +51 -205
  126. package/dist/esm/components/Tag/index.mjs.map +1 -1
  127. package/dist/esm/components/TechLogo/TechLogo.mjs +36 -37
  128. package/dist/esm/components/TechLogo/TechLogo.mjs.map +1 -1
  129. package/dist/esm/components/TechLogo/index.mjs +1 -2
  130. package/dist/esm/components/TechLogo/types.mjs +0 -44
  131. package/dist/esm/components/TextArea/AutoSizeTextArea.mjs +1 -1
  132. package/dist/esm/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  133. package/dist/esm/components/TextArea/ContentEditableTextArea.mjs.map +1 -1
  134. package/dist/esm/components/TextArea/TextArea.mjs +2 -2
  135. package/dist/esm/components/TextArea/TextArea.mjs.map +1 -1
  136. package/dist/esm/components/TextArea/index.mjs +2 -2
  137. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -2
  138. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  139. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +0 -1
  140. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
  141. package/dist/esm/components/ThemeSwitcherDropDown/index.mjs +1 -2
  142. package/dist/esm/components/ThemeSwitcherDropDown/types.mjs +0 -11
  143. package/dist/esm/components/index.mjs +24 -23
  144. package/dist/esm/hooks/index.mjs +8 -8
  145. package/dist/esm/providers/ReactQueryProvider.mjs +2 -2
  146. package/dist/types/api/hooks/project.d.ts +8 -1
  147. package/dist/types/api/hooks/project.d.ts.map +1 -1
  148. package/dist/types/api/index.d.ts +2 -2
  149. package/dist/types/api/useIntlayerAPI.d.ts +9 -2
  150. package/dist/types/api/useIntlayerAPI.d.ts.map +1 -1
  151. package/dist/types/components/Accordion/Accordion.d.ts.map +1 -1
  152. package/dist/types/components/Badge/index.d.ts +6 -25
  153. package/dist/types/components/Badge/index.d.ts.map +1 -1
  154. package/dist/types/components/Breadcrumb/index.d.ts +1 -1
  155. package/dist/types/components/Browser/Browser.d.ts +1 -1
  156. package/dist/types/components/Browser/Browser.d.ts.map +1 -1
  157. package/dist/types/components/Button/Button.d.ts +9 -45
  158. package/dist/types/components/Button/Button.d.ts.map +1 -1
  159. package/dist/types/components/Carousel/index.d.ts.map +1 -1
  160. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +2 -2
  161. package/dist/types/components/Command/index.d.ts +2 -2
  162. package/dist/types/components/Command/index.d.ts.map +1 -1
  163. package/dist/types/components/Container/index.d.ts +11 -60
  164. package/dist/types/components/Container/index.d.ts.map +1 -1
  165. package/dist/types/components/ContentEditor/ContentEditor.d.ts.map +1 -1
  166. package/dist/types/components/CopyButton/index.d.ts +3 -3
  167. package/dist/types/components/CopyButton/index.d.ts.map +1 -1
  168. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.d.ts +1 -1
  169. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.d.ts.map +1 -1
  170. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  171. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  172. package/dist/types/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  173. package/dist/types/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  174. package/dist/types/components/DictionaryFieldEditor/StructureView/StructureView.d.ts.map +1 -1
  175. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
  176. package/dist/types/components/DropDown/index.d.ts +4 -14
  177. package/dist/types/components/DropDown/index.d.ts.map +1 -1
  178. package/dist/types/components/Form/FormBase.d.ts +1 -1
  179. package/dist/types/components/Form/FormBase.d.ts.map +1 -1
  180. package/dist/types/components/Form/FormField.d.ts +1 -1
  181. package/dist/types/components/Form/FormField.d.ts.map +1 -1
  182. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +1 -1
  183. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  184. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -1
  185. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
  186. package/dist/types/components/Form/elements/FormElement.d.ts +1 -1
  187. package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
  188. package/dist/types/components/Form/elements/MultiselectElement.d.ts +1 -1
  189. package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  190. package/dist/types/components/Form/elements/OTPElement.d.ts +1 -1
  191. package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
  192. package/dist/types/components/Form/elements/SelectElement.d.ts +1 -1
  193. package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
  194. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +1 -1
  195. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  196. package/dist/types/components/IDE/CodeBlockHighlight.d.ts +1 -1
  197. package/dist/types/components/IDE/CodeBlockHighlight.d.ts.map +1 -1
  198. package/dist/types/components/Input/Checkbox.d.ts +4 -20
  199. package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
  200. package/dist/types/components/Input/Input.d.ts +3 -9
  201. package/dist/types/components/Input/Input.d.ts.map +1 -1
  202. package/dist/types/components/Input/OTPInput.d.ts +1 -1
  203. package/dist/types/components/Input/OTPInput.d.ts.map +1 -1
  204. package/dist/types/components/Input/Radio.d.ts +25 -0
  205. package/dist/types/components/Input/Radio.d.ts.map +1 -0
  206. package/dist/types/components/Input/SearchInput.d.ts +1 -1
  207. package/dist/types/components/Input/SearchInput.d.ts.map +1 -1
  208. package/dist/types/components/Input/index.d.ts +2 -1
  209. package/dist/types/components/KeyboardShortcut/KeyboardShortcut.d.ts +1 -47
  210. package/dist/types/components/KeyboardShortcut/KeyboardShortcut.d.ts.map +1 -1
  211. package/dist/types/components/Link/Link.d.ts +8 -47
  212. package/dist/types/components/Link/Link.d.ts.map +1 -1
  213. package/dist/types/components/Loader/spinner.d.ts +1 -1
  214. package/dist/types/components/Loader/spinner.d.ts.map +1 -1
  215. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
  216. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts +44 -44
  217. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  218. package/dist/types/components/MaxWidthSmoother/index.d.ts +1 -1
  219. package/dist/types/components/MaxWidthSmoother/index.d.ts.map +1 -1
  220. package/dist/types/components/Modal/Modal.d.ts +2 -8
  221. package/dist/types/components/Modal/Modal.d.ts.map +1 -1
  222. package/dist/types/components/Navbar/Burger.d.ts +1 -1
  223. package/dist/types/components/Navbar/Burger.d.ts.map +1 -1
  224. package/dist/types/components/Navbar/DesktopNavbar.d.ts +1 -1
  225. package/dist/types/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  226. package/dist/types/components/Navbar/MobileNavbar.d.ts +1 -1
  227. package/dist/types/components/Navbar/MobileNavbar.d.ts.map +1 -1
  228. package/dist/types/components/Navbar/index.d.ts +1 -1
  229. package/dist/types/components/Navbar/index.d.ts.map +1 -1
  230. package/dist/types/components/Pagination/Pagination.d.ts +2 -10
  231. package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
  232. package/dist/types/components/Popover/dynamic.d.ts.map +1 -1
  233. package/dist/types/components/Popover/static.d.ts +5 -17
  234. package/dist/types/components/Popover/static.d.ts.map +1 -1
  235. package/dist/types/components/Select/Multiselect.d.ts +3 -3
  236. package/dist/types/components/Select/Select.d.ts +3 -8
  237. package/dist/types/components/Select/Select.d.ts.map +1 -1
  238. package/dist/types/components/SocialNetworks/index.d.ts +1 -1
  239. package/dist/types/components/Steps/index.d.ts +4 -4
  240. package/dist/types/components/Steps/index.d.ts.map +1 -1
  241. package/dist/types/components/Steps/steps.content.d.ts +52 -0
  242. package/dist/types/components/Steps/steps.content.d.ts.map +1 -0
  243. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +4 -16
  244. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts.map +1 -1
  245. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +2 -2
  246. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts.map +1 -1
  247. package/dist/types/components/Tab/Tab.d.ts +2 -2
  248. package/dist/types/components/Tab/Tab.d.ts.map +1 -1
  249. package/dist/types/components/TabSelector/TabSelector.d.ts +2 -10
  250. package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
  251. package/dist/types/components/Table/TableElements.d.ts +4 -4
  252. package/dist/types/components/Table/TableElements.d.ts.map +1 -1
  253. package/dist/types/components/Tag/index.d.ts +44 -83
  254. package/dist/types/components/Tag/index.d.ts.map +1 -1
  255. package/dist/types/components/TechLogo/TechLogo.d.ts.map +1 -1
  256. package/dist/types/components/TechLogo/index.d.ts +1 -1
  257. package/dist/types/components/TechLogo/logos/Lit.d.ts +1 -1
  258. package/dist/types/components/TechLogo/logos/Lit.d.ts.map +1 -1
  259. package/dist/types/components/TechLogo/logos/Vanilla.d.ts +1 -1
  260. package/dist/types/components/TechLogo/logos/Vanilla.d.ts.map +1 -1
  261. package/dist/types/components/TechLogo/types.d.ts +1 -38
  262. package/dist/types/components/TechLogo/types.d.ts.map +1 -1
  263. package/dist/types/components/TextArea/AutoSizeTextArea.d.ts +1 -1
  264. package/dist/types/components/TextArea/ContentEditableTextArea.d.ts +3 -3
  265. package/dist/types/components/TextArea/TextArea.d.ts +6 -6
  266. package/dist/types/components/TextArea/TextArea.d.ts.map +1 -1
  267. package/dist/types/components/ThemeSwitcherDropDown/types.d.ts +1 -5
  268. package/dist/types/components/ThemeSwitcherDropDown/types.d.ts.map +1 -1
  269. package/dist/types/components/Toaster/Toast.d.ts +1 -1
  270. package/dist/types/components/Toaster/Toaster.d.ts +1 -1
  271. package/dist/types/components/Toaster/Toaster.d.ts.map +1 -1
  272. package/dist/types/components/index.d.ts +5 -2
  273. package/package.json +23 -24
  274. package/dist/esm/components/TechLogo/types.mjs.map +0 -1
  275. package/dist/esm/components/ThemeSwitcherDropDown/types.mjs.map +0 -1
@@ -85,76 +85,6 @@ const containerVariants = cva("flex flex-col text-text backdrop-blur", {
85
85
  class: "bg-transparent"
86
86
  }]
87
87
  });
88
- /** Available rounded corner sizes for the container */
89
- let ContainerRoundedSize = /* @__PURE__ */ function(ContainerRoundedSize) {
90
- ContainerRoundedSize["NONE"] = "none";
91
- ContainerRoundedSize["SM"] = "sm";
92
- ContainerRoundedSize["MD"] = "md";
93
- ContainerRoundedSize["LG"] = "lg";
94
- ContainerRoundedSize["XL"] = "xl";
95
- ContainerRoundedSize["2xl"] = "2xl";
96
- ContainerRoundedSize["3xl"] = "3xl";
97
- ContainerRoundedSize["4xl"] = "4xl";
98
- ContainerRoundedSize["5xl"] = "5xl";
99
- ContainerRoundedSize["FULL"] = "full";
100
- return ContainerRoundedSize;
101
- }({});
102
- /** Background transparency levels for the container */
103
- let ContainerTransparency = /* @__PURE__ */ function(ContainerTransparency) {
104
- ContainerTransparency["NONE"] = "none";
105
- ContainerTransparency["SM"] = "sm";
106
- ContainerTransparency["MD"] = "md";
107
- ContainerTransparency["LG"] = "lg";
108
- ContainerTransparency["XL"] = "xl";
109
- ContainerTransparency["FULL"] = "full";
110
- return ContainerTransparency;
111
- }({});
112
- /** Padding sizes for container content */
113
- let ContainerPadding = /* @__PURE__ */ function(ContainerPadding) {
114
- ContainerPadding["NONE"] = "none";
115
- ContainerPadding["SM"] = "sm";
116
- ContainerPadding["MD"] = "md";
117
- ContainerPadding["LG"] = "lg";
118
- ContainerPadding["XL"] = "xl";
119
- return ContainerPadding;
120
- }({});
121
- /** Separator options for dividing container children */
122
- let ContainerSeparator = /* @__PURE__ */ function(ContainerSeparator) {
123
- ContainerSeparator["WITHOUT"] = "without";
124
- ContainerSeparator["X"] = "x";
125
- ContainerSeparator["Y"] = "y";
126
- ContainerSeparator["BOTH"] = "both";
127
- return ContainerSeparator;
128
- }({});
129
- /** Border color options for the container */
130
- let ContainerBorderColor = /* @__PURE__ */ function(ContainerBorderColor) {
131
- ContainerBorderColor["PRIMARY"] = "primary";
132
- ContainerBorderColor["SECONDARY"] = "secondary";
133
- ContainerBorderColor["NEUTRAL"] = "neutral";
134
- ContainerBorderColor["CARD"] = "card";
135
- ContainerBorderColor["TEXT"] = "text";
136
- ContainerBorderColor["ERROR"] = "error";
137
- ContainerBorderColor["WARNING"] = "warning";
138
- ContainerBorderColor["SUCCESS"] = "success";
139
- return ContainerBorderColor;
140
- }({});
141
- /** Background interaction states for the container */
142
- let ContainerBackground = /* @__PURE__ */ function(ContainerBackground) {
143
- ContainerBackground["NONE"] = "none";
144
- ContainerBackground["HOVERABLE"] = "hoverable";
145
- ContainerBackground["WITH"] = "with";
146
- return ContainerBackground;
147
- }({});
148
- /** Gap sizes between container children */
149
- let ContainerGap = /* @__PURE__ */ function(ContainerGap) {
150
- ContainerGap["NONE"] = "none";
151
- ContainerGap["SM"] = "sm";
152
- ContainerGap["MD"] = "md";
153
- ContainerGap["LG"] = "lg";
154
- ContainerGap["XL"] = "xl";
155
- ContainerGap["2xl"] = "2xl";
156
- return ContainerGap;
157
- }({});
158
88
  /**
159
89
  * Container Component
160
90
  *
@@ -200,5 +130,5 @@ const Container = ({ children, roundedSize, padding, transparency, separator, cl
200
130
  });
201
131
 
202
132
  //#endregion
203
- export { Container, ContainerBackground, ContainerBorderColor, ContainerGap, ContainerPadding, ContainerRoundedSize, ContainerSeparator, ContainerTransparency, containerVariants };
133
+ export { Container, containerVariants };
204
134
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/Container/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type {\n DetailedHTMLProps,\n FC,\n HTMLAttributes,\n PropsWithChildren,\n} from 'react';\n\n/**\n * Container component variants using class-variance-authority\n * Provides flexible styling options for background, padding, borders, and layout\n */\nexport const containerVariants = cva('flex flex-col text-text backdrop-blur', {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-md',\n md: 'rounded-md [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-lg',\n lg: 'rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl',\n xl: 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n '2xl':\n 'rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl',\n '3xl':\n 'rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl',\n '4xl':\n 'rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card',\n xs: 'bg-card/95',\n sm: 'bg-card/90',\n md: 'bg-card/70',\n lg: 'bg-card/40',\n xl: 'bg-card/20',\n full: '',\n },\n padding: {\n none: 'p-0',\n sm: 'px-3 py-2',\n md: 'px-4 py-3',\n lg: 'px-6 py-4',\n xl: 'px-8 py-6',\n '2xl': 'px-10 py-8',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20',\n y: 'divide-y divide-dashed divide-text/20',\n both: 'divide-x divide-y divide-dashed divide-text/20',\n },\n border: {\n none: '',\n with: 'border-[1.3px]',\n },\n borderColor: {\n primary: 'border-primary',\n secondary: 'border-secondary',\n neutral: 'border-neutral/20',\n card: 'border-card',\n text: 'border-text',\n error: 'border-error',\n warning: 'border-warning',\n success: 'border-success',\n },\n background: {\n none: 'backdrop-blur-none',\n hoverable:\n 'bg-opacity-5! backdrop-blur-0 hover:bg-opacity-10! hover:backdrop-blur focus:bg-opacity-10! focus:backdrop-blur aria-selected:bg-opacity-15! aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n defaultVariants: {\n roundedSize: 'lg',\n border: 'none',\n borderColor: 'text',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n compoundVariants: [\n {\n background: 'none',\n class: 'bg-transparent',\n },\n ],\n});\n\n/** Available rounded corner sizes for the container */\nexport enum ContainerRoundedSize {\n NONE = 'none',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n '2xl' = '2xl',\n '3xl' = '3xl',\n '4xl' = '4xl',\n '5xl' = '5xl',\n FULL = 'full',\n}\n\n/** Background transparency levels for the container */\nexport enum ContainerTransparency {\n NONE = 'none',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n FULL = 'full',\n}\n\n/** Padding sizes for container content */\nexport enum ContainerPadding {\n NONE = 'none',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n}\n\n/** Separator options for dividing container children */\nexport enum ContainerSeparator {\n WITHOUT = 'without',\n X = 'x',\n Y = 'y',\n BOTH = 'both',\n}\n\n/** Border color options for the container */\nexport enum ContainerBorderColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n NEUTRAL = 'neutral',\n CARD = 'card',\n TEXT = 'text',\n ERROR = 'error',\n WARNING = 'warning',\n SUCCESS = 'success',\n}\n\n/** Background interaction states for the container */\nexport enum ContainerBackground {\n NONE = 'none',\n HOVERABLE = 'hoverable',\n WITH = 'with',\n}\n\n/** Gap sizes between container children */\nexport enum ContainerGap {\n NONE = 'none',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n '2xl' = '2xl',\n}\n\n/** Container component props extending HTML div attributes */\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n /** Whether to show a border around the container */\n border?: boolean;\n };\n\n/**\n * Container Component\n *\n * A flexible container component for organizing content with customizable styling options.\n * Supports various visual states, layouts, and accessibility features.\n *\n * ## Features\n * - **Flexible Layout**: Supports different padding, gap, and separator options\n * - **Visual Variants**: Multiple background transparency levels and border styles\n * - **Responsive Design**: Configurable rounded corners and spacing\n * - **Semantic HTML**: Proper div element with extensible attributes\n *\n * ## Accessibility\n * - Inherits all standard div accessibility features\n * - Supports ARIA attributes through spread props\n * - Maintains proper semantic structure for screen readers\n *\n * @param children - The content to display inside the container\n * @param roundedSize - Border radius size (default: 'md')\n * @param transparency - Background transparency level (default: 'md')\n * @param padding - Internal padding size (default: 'none')\n * @param separator - Divider lines between children (default: 'without')\n * @param border - Whether to show border (default: false)\n * @param borderColor - Color of the border (default: 'text')\n * @param background - Background interaction behavior (default: 'none')\n * @param gap - Space between child elements (default: 'none')\n * @param className - Additional CSS classes\n * @param props - Additional HTML div attributes including ARIA attributes\n */\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n background,\n gap,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n borderColor,\n gap,\n }),\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n"],"mappings":";;;;;;;;;AAaA,MAAa,oBAAoB,IAAI,yCAAyC;CAC5E,UAAU;EACR,aAAa;GACX,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OACE;GACF,OACE;GACF,OACE;GACF,MAAM;EACR;EACA,cAAc;GACZ,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;EACT;EACA,WAAW;GACT,SAAS;GACT,GAAG;GACH,GAAG;GACH,MAAM;EACR;EACA,QAAQ;GACN,MAAM;GACN,MAAM;EACR;EACA,aAAa;GACX,SAAS;GACT,WAAW;GACX,SAAS;GACT,MAAM;GACN,MAAM;GACN,OAAO;GACP,SAAS;GACT,SAAS;EACX;EACA,YAAY;GACV,MAAM;GACN,WACE;GACF,MAAM;EACR;EACA,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;EACT;CACF;CACA,iBAAiB;EACf,aAAa;EACb,QAAQ;EACR,aAAa;EACb,cAAc;EACd,SAAS;EACT,WAAW;EACX,KAAK;CACP;CACA,kBAAkB,CAChB;EACE,YAAY;EACZ,OAAO;CACT,CACF;AACF,CAAC;;AAGD,IAAY,uBAAL;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AACF;;AAGA,IAAY,wBAAL;CACL;CACA;CACA;CACA;CACA;CACA;;AACF;;AAGA,IAAY,mBAAL;CACL;CACA;CACA;CACA;CACA;;AACF;;AAGA,IAAY,qBAAL;CACL;CACA;CACA;CACA;;AACF;;AAGA,IAAY,uBAAL;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AACF;;AAGA,IAAY,sBAAL;CACL;CACA;CACA;;AACF;;AAGA,IAAY,eAAL;CACL;CACA;CACA;CACA;CACA;CACA;;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,aAAiC,EAC5C,UACA,aACA,SACA,cACA,WACA,WACA,QACA,aACA,YACA,KACA,GAAG,YAEH,oBAAC,OAAD;CACE,WAAW,GACT,kBAAkB;EAChB;EACA;EACA;EACA;EACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;EAC7D;EACA;EACA;CACF,CAAC,GACD,SACF;CACA,GAAI;CAEH;AACE"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/Container/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type {\n DetailedHTMLProps,\n FC,\n HTMLAttributes,\n PropsWithChildren,\n} from 'react';\n\n/**\n * Container component variants using class-variance-authority\n * Provides flexible styling options for background, padding, borders, and layout\n */\nexport const containerVariants = cva('flex flex-col text-text backdrop-blur', {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-md',\n md: 'rounded-md [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-lg',\n lg: 'rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl',\n xl: 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n '2xl':\n 'rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl',\n '3xl':\n 'rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl',\n '4xl':\n 'rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card',\n xs: 'bg-card/95',\n sm: 'bg-card/90',\n md: 'bg-card/70',\n lg: 'bg-card/40',\n xl: 'bg-card/20',\n full: '',\n },\n padding: {\n none: 'p-0',\n sm: 'px-3 py-2',\n md: 'px-4 py-3',\n lg: 'px-6 py-4',\n xl: 'px-8 py-6',\n '2xl': 'px-10 py-8',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20',\n y: 'divide-y divide-dashed divide-text/20',\n both: 'divide-x divide-y divide-dashed divide-text/20',\n },\n border: {\n none: '',\n with: 'border-[1.3px]',\n },\n borderColor: {\n primary: 'border-primary',\n secondary: 'border-secondary',\n neutral: 'border-neutral/20',\n card: 'border-card',\n text: 'border-text',\n error: 'border-error',\n warning: 'border-warning',\n success: 'border-success',\n },\n background: {\n none: 'backdrop-blur-none',\n hoverable:\n 'bg-opacity-5! backdrop-blur-0 hover:bg-opacity-10! hover:backdrop-blur focus:bg-opacity-10! focus:backdrop-blur aria-selected:bg-opacity-15! aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n defaultVariants: {\n roundedSize: 'lg',\n border: 'none',\n borderColor: 'text',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n compoundVariants: [\n {\n background: 'none',\n class: 'bg-transparent',\n },\n ],\n});\n\n/** Available rounded corner sizes for the container */\nexport type ContainerRoundedSize = \n | 'none' |\n 'sm' |\n 'md' |\n 'lg' |\n 'xl' |\n 'full';\n\n/** Background transparency levels for the container */\nexport type ContainerTransparency = \n | 'none' |\n 'sm' |\n 'md' |\n 'lg' |\n 'xl' |\n 'full';\n\n/** Padding sizes for container content */\nexport type ContainerPadding = \n | 'none' |\n 'sm' |\n 'md' |\n 'lg' |\n 'xl';\n\n/** Separator options for dividing container children */\nexport type ContainerSeparator = \n | 'without' |\n 'x' |\n 'y' |\n 'both';\n\n/** Border color options for the container */\nexport type ContainerBorderColor = \n | 'primary' |\n 'secondary' |\n 'neutral' |\n 'card' |\n 'text' |\n 'error' |\n 'warning' |\n 'success';\n\n/** Background interaction states for the container */\nexport type ContainerBackground = \n | 'none' |\n 'hoverable' |\n 'with';\n\n/** Gap sizes between container children */\nexport type ContainerGap = \n | 'none' |\n 'sm' |\n 'md' |\n 'lg' |\n 'xl';\n\n/** Container component props extending HTML div attributes */\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n /** Whether to show a border around the container */\n border?: boolean;\n };\n\n/**\n * Container Component\n *\n * A flexible container component for organizing content with customizable styling options.\n * Supports various visual states, layouts, and accessibility features.\n *\n * ## Features\n * - **Flexible Layout**: Supports different padding, gap, and separator options\n * - **Visual Variants**: Multiple background transparency levels and border styles\n * - **Responsive Design**: Configurable rounded corners and spacing\n * - **Semantic HTML**: Proper div element with extensible attributes\n *\n * ## Accessibility\n * - Inherits all standard div accessibility features\n * - Supports ARIA attributes through spread props\n * - Maintains proper semantic structure for screen readers\n *\n * @param children - The content to display inside the container\n * @param roundedSize - Border radius size (default: 'md')\n * @param transparency - Background transparency level (default: 'md')\n * @param padding - Internal padding size (default: 'none')\n * @param separator - Divider lines between children (default: 'without')\n * @param border - Whether to show border (default: false)\n * @param borderColor - Color of the border (default: 'text')\n * @param background - Background interaction behavior (default: 'none')\n * @param gap - Space between child elements (default: 'none')\n * @param className - Additional CSS classes\n * @param props - Additional HTML div attributes including ARIA attributes\n */\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n background,\n gap,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n borderColor,\n gap,\n }),\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n"],"mappings":";;;;;;;;;AAaA,MAAa,oBAAoB,IAAI,yCAAyC;CAC5E,UAAU;EACR,aAAa;GACX,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OACE;GACF,OACE;GACF,OACE;GACF,MAAM;EACR;EACA,cAAc;GACZ,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;EACR;EACA,SAAS;GACP,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;EACT;EACA,WAAW;GACT,SAAS;GACT,GAAG;GACH,GAAG;GACH,MAAM;EACR;EACA,QAAQ;GACN,MAAM;GACN,MAAM;EACR;EACA,aAAa;GACX,SAAS;GACT,WAAW;GACX,SAAS;GACT,MAAM;GACN,MAAM;GACN,OAAO;GACP,SAAS;GACT,SAAS;EACX;EACA,YAAY;GACV,MAAM;GACN,WACE;GACF,MAAM;EACR;EACA,KAAK;GACH,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;EACT;CACF;CACA,iBAAiB;EACf,aAAa;EACb,QAAQ;EACR,aAAa;EACb,cAAc;EACd,SAAS;EACT,WAAW;EACX,KAAK;CACP;CACA,kBAAkB,CAChB;EACE,YAAY;EACZ,OAAO;CACT,CACF;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGD,MAAa,aAAiC,EAC5C,UACA,aACA,SACA,cACA,WACA,WACA,QACA,aACA,YACA,KACA,GAAG,YAEH,oBAAC,OAAD;CACE,WAAW,GACT,kBAAkB;EAChB;EACA;EACA;EACA;EACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;EAC7D;EACA;EACA;CACF,CAAC,GACD,SACF;CACA,GAAI;CAEH;AACE"}
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
- import { InputVariant } from "../Input/Input.mjs";
5
4
  import { AutoSizedTextArea } from "../TextArea/AutoSizeTextArea.mjs";
6
5
  import { useState } from "react";
7
6
  import { Check, X } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditor.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { Check, X } from 'lucide-react';\nimport { type ChangeEventHandler, type FC, useState } from 'react';\nimport { InputVariant } from '../Input';\nimport {\n AutoSizedTextArea,\n type AutoSizedTextAreaProps,\n} from '../TextArea/AutoSizeTextArea';\n\n/** Props for the ContentEditor component */\nexport type ContentEditorProps = {\n /** The current content to display and edit */\n children: string;\n /** Callback function called when content is saved/validated */\n onContentChange: (content: string) => void;\n /** Whether the editor is currently in editing mode */\n isEditing?: boolean;\n} & AutoSizedTextAreaProps;\n\n/**\n * ContentEditor Component\n *\n * An inline editing component that allows users to edit text content with\n * validation and cancellation options. Built on top of AutoSizedTextArea\n * for flexible text editing experiences.\n *\n * ## Features\n * - **Inline Editing**: Edit content directly in place with visual feedback\n * - **Auto-sizing**: Textarea automatically adjusts to content size\n * - **Validation Controls**: Check and X buttons appear when content is modified\n * - **Keyboard Support**: Full keyboard navigation and accessibility\n * - **State Management**: Handles editing states and content validation\n *\n * ## Accessibility\n * - Proper ARIA labels for all interactive elements\n * - Keyboard navigation support (Tab, Enter, Escape)\n * - Screen reader announcements for state changes\n * - Focus management between edit and display modes\n *\n * @param children - The current content to display and edit\n * @param onContentChange - Callback when content is saved\n * @param isEditing - Whether editor is in editing mode\n * @param props - Additional AutoSizedTextArea props\n */\nexport const ContentEditor: FC<ContentEditorProps> = ({\n children,\n onContentChange,\n isEditing,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.target.value ?? '');\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n return (\n <div\n className=\"flex flex-row items-center justify-between gap-2\"\n role=\"group\"\n aria-label=\"Content editor\"\n >\n <AutoSizedTextArea\n className={cn(\n 'break-word m-3 inline w-full bg-transparent outline-hidden',\n isEditing ? 'cursor-text' : 'cursor-pointer'\n )}\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n variant={InputVariant.INVISIBLE}\n defaultValue={children}\n aria-label=\"Editable content\"\n aria-describedby={isEdited ? 'content-editor-actions' : undefined}\n {...props}\n />\n {isEdited && (\n <div\n id=\"content-editor-actions\"\n className=\"flex flex-row items-center justify-between gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n <Check\n className=\"cursor-pointer text-green-600 hover:scale-110\"\n size={16}\n onClick={handleValid}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Save changes (Ctrl+Enter)\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleValid();\n }\n }}\n />\n <X\n className=\"cursor-pointer text-red-600 hover:scale-110\"\n size={16}\n onClick={handleCancel}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Cancel changes (Escape)\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleCancel();\n }\n }}\n />\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,iBAAyC,EACpD,UACA,iBACA,WACA,GAAG,YACC;CACJ,MAAM,CAAC,UAAU,eAAe,SAAiB,QAAQ;CACzD,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,CAAC;CAClE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;EACzB,YAAY,QAAQ;EACpB,qBAAqB,SAAS,OAAO,CAAC;CACxC;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,QAAQ;CAC1B;CAEA,MAAM,yBAAkE,MACtE,YAAY,EAAE,OAAO,SAAS,EAAE;CAElC,MAAM,iBAAiB,MAAgD;EACrE,IAAI,EAAE,QAAQ,YAAY,EAAE,WAAW,EAAE,UAAU;GACjD,EAAE,eAAe;GACjB,YAAY;EACd,OAAO,IAAI,EAAE,QAAQ,UAAU;GAC7B,EAAE,eAAe;GACjB,aAAa;EACf;CACF;CAEA,OACE,qBAAC,OAAD;EACE,WAAU;EACV,MAAK;EACL,cAAW;YAHb,CAKE,oBAAC,mBAAD;GACE,WAAW,GACT,8DACA,YAAY,gBAAgB,gBAC9B;GACA,UAAU;GACV,WAAW;GAEX;GACA,cAAc;GACd,cAAW;GACX,oBAAkB,WAAW,2BAA2B;GACxD,GAAI;EACL,GANM,gBAMN,GACA,YACC,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAME,oBAAC,OAAD;IACE,WAAU;IACV,MAAM;IACN,SAAS;IACT,MAAK;IACL,UAAU;IACV,cAAW;IACX,YAAY,MAAM;KAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;MACtC,EAAE,eAAe;MACjB,YAAY;KACd;IACF;GACD,IACD,oBAAC,GAAD;IACE,WAAU;IACV,MAAM;IACN,SAAS;IACT,MAAK;IACL,UAAU;IACV,cAAW;IACX,YAAY,MAAM;KAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;MACtC,EAAE,eAAe;MACjB,aAAa;KACf;IACF;GACD,EACE;IAEJ;;AAET"}
1
+ {"version":3,"file":"ContentEditor.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditor.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { Check, X } from 'lucide-react';\nimport { type ChangeEventHandler, type FC, useState } from 'react';\nimport {\n AutoSizedTextArea,\n type AutoSizedTextAreaProps,\n} from '../TextArea/AutoSizeTextArea';\n\n/** Props for the ContentEditor component */\nexport type ContentEditorProps = {\n /** The current content to display and edit */\n children: string;\n /** Callback function called when content is saved/validated */\n onContentChange: (content: string) => void;\n /** Whether the editor is currently in editing mode */\n isEditing?: boolean;\n} & AutoSizedTextAreaProps;\n\n/**\n * ContentEditor Component\n *\n * An inline editing component that allows users to edit text content with\n * validation and cancellation options. Built on top of AutoSizedTextArea\n * for flexible text editing experiences.\n *\n * ## Features\n * - **Inline Editing**: Edit content directly in place with visual feedback\n * - **Auto-sizing**: Textarea automatically adjusts to content size\n * - **Validation Controls**: Check and X buttons appear when content is modified\n * - **Keyboard Support**: Full keyboard navigation and accessibility\n * - **State Management**: Handles editing states and content validation\n *\n * ## Accessibility\n * - Proper ARIA labels for all interactive elements\n * - Keyboard navigation support (Tab, Enter, Escape)\n * - Screen reader announcements for state changes\n * - Focus management between edit and display modes\n *\n * @param children - The current content to display and edit\n * @param onContentChange - Callback when content is saved\n * @param isEditing - Whether editor is in editing mode\n * @param props - Additional AutoSizedTextArea props\n */\nexport const ContentEditor: FC<ContentEditorProps> = ({\n children,\n onContentChange,\n isEditing,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.target.value ?? '');\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n return (\n <div\n className=\"flex flex-row items-center justify-between gap-2\"\n role=\"group\"\n aria-label=\"Content editor\"\n >\n <AutoSizedTextArea\n className={cn(\n 'break-word m-3 inline w-full bg-transparent outline-hidden',\n isEditing ? 'cursor-text' : 'cursor-pointer'\n )}\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n variant=\"invisible\"\n defaultValue={children}\n aria-label=\"Editable content\"\n aria-describedby={isEdited ? 'content-editor-actions' : undefined}\n {...props}\n />\n {isEdited && (\n <div\n id=\"content-editor-actions\"\n className=\"flex flex-row items-center justify-between gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n <Check\n className=\"cursor-pointer text-green-600 hover:scale-110\"\n size={16}\n onClick={handleValid}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Save changes (Ctrl+Enter)\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleValid();\n }\n }}\n />\n <X\n className=\"cursor-pointer text-red-600 hover:scale-110\"\n size={16}\n onClick={handleCancel}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Cancel changes (Escape)\"\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleCancel();\n }\n }}\n />\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,iBAAyC,EACpD,UACA,iBACA,WACA,GAAG,YACC;CACJ,MAAM,CAAC,UAAU,eAAe,SAAiB,QAAQ;CACzD,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,CAAC;CAClE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;EACzB,YAAY,QAAQ;EACpB,qBAAqB,SAAS,OAAO,CAAC;CACxC;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,QAAQ;CAC1B;CAEA,MAAM,yBAAkE,MACtE,YAAY,EAAE,OAAO,SAAS,EAAE;CAElC,MAAM,iBAAiB,MAAgD;EACrE,IAAI,EAAE,QAAQ,YAAY,EAAE,WAAW,EAAE,UAAU;GACjD,EAAE,eAAe;GACjB,YAAY;EACd,OAAO,IAAI,EAAE,QAAQ,UAAU;GAC7B,EAAE,eAAe;GACjB,aAAa;EACf;CACF;CAEA,OACE,qBAAC,OAAD;EACE,WAAU;EACV,MAAK;EACL,cAAW;YAHb,CAKE,oBAAC,mBAAD;GACE,WAAW,GACT,8DACA,YAAY,gBAAgB,gBAC9B;GACA,UAAU;GACV,WAAW;GAEX,SAAQ;GACR,cAAc;GACd,cAAW;GACX,oBAAkB,WAAW,2BAA2B;GACxD,GAAI;EACL,GANM,gBAMN,GACA,YACC,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAME,oBAAC,OAAD;IACE,WAAU;IACV,MAAM;IACN,SAAS;IACT,MAAK;IACL,UAAU;IACV,cAAW;IACX,YAAY,MAAM;KAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;MACtC,EAAE,eAAe;MACjB,YAAY;KACd;IACF;GACD,IACD,oBAAC,GAAD;IACE,WAAU;IACV,MAAM;IACN,SAAS;IACT,MAAK;IACL,UAAU;IACV,cAAW;IACX,YAAY,MAAM;KAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;MACtC,EAAE,eAAe;MACjB,aAAa;KACf;IACF;GACD,EACE;IAEJ;;AAET"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
- import { Input, InputVariant } from "../Input/Input.mjs";
3
+ import { Button } from "../Button/Button.mjs";
4
+ import { Input } from "../Input/Input.mjs";
5
5
  import { useEffect, useState } from "react";
6
6
  import { Check, X } from "lucide-react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditorInput.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditorInput.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport {\n type ChangeEventHandler,\n type FC,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\nimport { Input, type InputProps, InputVariant } from '../Input';\n\n/** Props for the ContentEditorInput component */\nexport type ContentEditorInputProps = {\n /** The current content to display and edit */\n children: InputProps['value'];\n /** Callback function called when content is saved/validated */\n onContentChange: (content: InputProps['value']) => void;\n /** Whether the editor is disabled */\n disabled?: boolean;\n /** Optional validation function to check content validity */\n validate?: (content: InputProps['value']) => boolean;\n /** Additional buttons to display alongside edit actions */\n additionalButtons?: ReactNode;\n} & Omit<InputProps, 'children'>;\n\n/**\n * ContentEditorInput Component\n *\n * An inline editing component for single-line text input with validation,\n * cancel/save functionality, and support for additional action buttons.\n *\n * ## Features\n * - **Inline Input Editing**: Edit single-line content with immediate feedback\n * - **Validation Support**: Optional content validation with visual feedback\n * - **Action Buttons**: Built-in save/cancel with support for additional buttons\n * - **Keyboard Shortcuts**: Enter to save, Escape to cancel\n * - **Accessibility**: Full ARIA support and keyboard navigation\n * - **State Management**: Handles editing states and validation\n *\n * ## Accessibility\n * - Proper ARIA labels and descriptions for all controls\n * - Keyboard navigation (Tab, Enter, Escape)\n * - Screen reader support for validation states\n * - Focus management and visual indicators\n *\n * @param children - Current input value\n * @param onContentChange - Callback when content is saved\n * @param disabled - Whether the editor is disabled\n * @param validate - Optional validation function\n * @param additionalButtons - Extra buttons to display\n * @param props - Additional Input component props\n */\nexport const ContentEditorInput: FC<ContentEditorInputProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<InputProps['value']>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n setNewValue(e.currentTarget.value);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !disabled && isValid) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n useEffect(() => {\n setNewValue(children);\n // Force input to reset when children changes externally\n setResetIncrementor((prev) => prev + 1);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={String(children)}\n role=\"group\"\n aria-label=\"Content editor input\"\n >\n <Input\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n aria-label=\"Editable input value\"\n aria-describedby={\n isEdited || additionalButtons\n ? 'content-editor-input-actions'\n : undefined\n }\n aria-invalid={!isValid}\n variant={InputVariant.INVISIBLE}\n className=\"size-full\"\n defaultValue={children}\n disabled={disabled}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div\n id=\"content-editor-input-actions\"\n className=\"flex w-full items-center justify-end gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label={`Save changes${!isValid ? ' (invalid content)' : ''}`}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n aria-describedby={!isValid ? 'validation-error' : undefined}\n />\n <Button\n Icon={X}\n label=\"Cancel changes\"\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n disabled={disabled}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,sBAAmD,EAC9D,UACA,iBACA,UACA,UACA,mBACA,GAAG,YACC;CACJ,MAAM,CAAC,UAAU,eAAe,SAA8B,QAAQ;CACtE,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,CAAC;CAClE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;EACzB,YAAY,QAAQ;EACpB,qBAAqB,SAAS,OAAO,CAAC;CACxC;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,QAAQ;CAC1B;CAEA,MAAM,yBAA+D,MAAM;EACzE,YAAY,EAAE,cAAc,KAAK;CACnC;CAEA,MAAM,iBAAiB,MAA6C;EAClE,IAAI,EAAE,QAAQ,WAAW,CAAC,YAAY,SAAS;GAC7C,EAAE,eAAe;GACjB,YAAY;EACd,OAAO,IAAI,EAAE,QAAQ,UAAU;GAC7B,EAAE,eAAe;GACjB,aAAa;EACf;CACF;CAEA,gBAAgB;EACd,YAAY,QAAQ;EAEpB,qBAAqB,SAAS,OAAO,CAAC;CACxC,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,UAAU,WAAW,QAAQ,KAAK;CAExC,OACE,qBAAC,OAAD;EACE,WAAU;EAEV,MAAK;EACL,cAAW;YAJb,CAME,oBAAC,OAAD;GACE,UAAU;GACV,WAAW;GAEX,cAAW;GACX,oBACE,YAAY,oBACR,iCACA;GAEN,gBAAc,CAAC;GACf;GACA,WAAU;GACV,cAAc;GACJ;GACV,GAAI;EACL,GAbM,gBAaN,IACC,YAAY,sBACZ,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAMG,YACC,8CACE,oBAAC,QAAD;IACE,MAAM;IACN,OAAO,eAAe,CAAC,UAAU,uBAAuB;IACxD;IACA;IACA;IACA,WAAU;IACV,UAAU,YAAY,CAAC;IACvB,SAAS;IACT,oBAAkB,CAAC,UAAU,qBAAqB;GACnD,IACD,oBAAC,QAAD;IACE,MAAM;IACN,OAAM;IACN;IACA;IACA;IACA,WAAU;IACV,SAAS;IACC;GACX,EACD,MAEH,iBACE;IAEJ;IAxDE,OAAO,QAAQ,CAwDjB;AAET"}
1
+ {"version":3,"file":"ContentEditorInput.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditorInput.tsx"],"sourcesContent":["'use client';\n\nimport { Check, X } from 'lucide-react';\nimport {\n type ChangeEventHandler,\n type FC,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { Button } from '../Button';\nimport { Input, type InputProps } from '../Input';\n\n/** Props for the ContentEditorInput component */\nexport type ContentEditorInputProps = {\n /** The current content to display and edit */\n children: InputProps['value'];\n /** Callback function called when content is saved/validated */\n onContentChange: (content: InputProps['value']) => void;\n /** Whether the editor is disabled */\n disabled?: boolean;\n /** Optional validation function to check content validity */\n validate?: (content: InputProps['value']) => boolean;\n /** Additional buttons to display alongside edit actions */\n additionalButtons?: ReactNode;\n} & Omit<InputProps, 'children'>;\n\n/**\n * ContentEditorInput Component\n *\n * An inline editing component for single-line text input with validation,\n * cancel/save functionality, and support for additional action buttons.\n *\n * ## Features\n * - **Inline Input Editing**: Edit single-line content with immediate feedback\n * - **Validation Support**: Optional content validation with visual feedback\n * - **Action Buttons**: Built-in save/cancel with support for additional buttons\n * - **Keyboard Shortcuts**: Enter to save, Escape to cancel\n * - **Accessibility**: Full ARIA support and keyboard navigation\n * - **State Management**: Handles editing states and validation\n *\n * ## Accessibility\n * - Proper ARIA labels and descriptions for all controls\n * - Keyboard navigation (Tab, Enter, Escape)\n * - Screen reader support for validation states\n * - Focus management and visual indicators\n *\n * @param children - Current input value\n * @param onContentChange - Callback when content is saved\n * @param disabled - Whether the editor is disabled\n * @param validate - Optional validation function\n * @param additionalButtons - Extra buttons to display\n * @param props - Additional Input component props\n */\nexport const ContentEditorInput: FC<ContentEditorInputProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const [newValue, setNewValue] = useState<InputProps['value']>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the div on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n setNewValue(e.currentTarget.value);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !disabled && isValid) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n useEffect(() => {\n setNewValue(children);\n // Force input to reset when children changes externally\n setResetIncrementor((prev) => prev + 1);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={String(children)}\n role=\"group\"\n aria-label=\"Content editor input\"\n >\n <Input\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n aria-label=\"Editable input value\"\n aria-describedby={\n isEdited || additionalButtons\n ? 'content-editor-input-actions'\n : undefined\n }\n aria-invalid={!isValid}\n variant=\"invisible\"\n className=\"size-full\"\n defaultValue={children}\n disabled={disabled}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div\n id=\"content-editor-input-actions\"\n className=\"flex w-full items-center justify-end gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label={`Save changes${!isValid ? ' (invalid content)' : ''}`}\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n aria-describedby={!isValid ? 'validation-error' : undefined}\n />\n <Button\n Icon={X}\n label=\"Cancel changes\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n disabled={disabled}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,sBAAmD,EAC9D,UACA,iBACA,UACA,UACA,mBACA,GAAG,YACC;CACJ,MAAM,CAAC,UAAU,eAAe,SAA8B,QAAQ;CACtE,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,CAAC;CAClE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;EACzB,YAAY,QAAQ;EACpB,qBAAqB,SAAS,OAAO,CAAC;CACxC;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,QAAQ;CAC1B;CAEA,MAAM,yBAA+D,MAAM;EACzE,YAAY,EAAE,cAAc,KAAK;CACnC;CAEA,MAAM,iBAAiB,MAA6C;EAClE,IAAI,EAAE,QAAQ,WAAW,CAAC,YAAY,SAAS;GAC7C,EAAE,eAAe;GACjB,YAAY;EACd,OAAO,IAAI,EAAE,QAAQ,UAAU;GAC7B,EAAE,eAAe;GACjB,aAAa;EACf;CACF;CAEA,gBAAgB;EACd,YAAY,QAAQ;EAEpB,qBAAqB,SAAS,OAAO,CAAC;CACxC,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,UAAU,WAAW,QAAQ,KAAK;CAExC,OACE,qBAAC,OAAD;EACE,WAAU;EAEV,MAAK;EACL,cAAW;YAJb,CAME,oBAAC,OAAD;GACE,UAAU;GACV,WAAW;GAEX,cAAW;GACX,oBACE,YAAY,oBACR,iCACA;GAEN,gBAAc,CAAC;GACf,SAAQ;GACR,WAAU;GACV,cAAc;GACJ;GACV,GAAI;EACL,GAbM,gBAaN,IACC,YAAY,sBACZ,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAMG,YACC,8CACE,oBAAC,QAAD;IACE,MAAM;IACN,OAAO,eAAe,CAAC,UAAU,uBAAuB;IACxD,SAAQ;IACR,OAAM;IACN,MAAK;IACL,WAAU;IACV,UAAU,YAAY,CAAC;IACvB,SAAS;IACT,oBAAkB,CAAC,UAAU,qBAAqB;GACnD,IACD,oBAAC,QAAD;IACE,MAAM;IACN,OAAM;IACN,SAAQ;IACR,MAAK;IACL,OAAM;IACN,WAAU;IACV,SAAS;IACC;GACX,EACD,MAEH,iBACE;IAEJ;IAxDE,OAAO,QAAQ,CAwDjB;AAET"}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
- import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
- import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
5
3
  import { useUser } from "../../api/useUser/index.mjs";
4
+ import { Button } from "../Button/Button.mjs";
5
+ import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
6
6
  import { useEffect, useState } from "react";
7
7
  import { Check, X } from "lucide-react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditorTextArea.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useUser } from '@api/useUser';\nimport { Check, X } from 'lucide-react';\nimport {\n type ChangeEventHandler,\n type FC,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\nimport { AutoCompleteTextarea, type AutoSizedTextAreaProps } from '../TextArea';\n\n/** Props for the ContentEditorTextArea component */\nexport type ContentEditorTextAreaProps = {\n /** The current content to display and edit */\n children: string;\n /** Callback function called when content is saved/validated */\n onContentChange: (content: string) => void;\n /** Whether the editor is disabled */\n disabled?: boolean;\n /** Optional validation function to check content validity */\n validate?: (content: string) => boolean;\n /** Additional buttons to display alongside edit actions */\n additionalButtons?: ReactNode;\n} & Omit<AutoSizedTextAreaProps, 'children'>;\n\n/**\n * ContentEditorTextArea Component\n *\n * An inline editing component for multi-line text with autocomplete functionality,\n * user authentication integration, and validation support. This component combines\n * the auto-sizing textarea with smart autocomplete features.\n *\n * ## Features\n * - **Auto-sizing Textarea**: Automatically adjusts height to content\n * - **Autocomplete Integration**: Smart text completion when user is authenticated\n * - **Validation Support**: Optional content validation with visual feedback\n * - **Action Buttons**: Built-in save/cancel with support for additional buttons\n * - **Keyboard Shortcuts**: Enter to save, Escape to cancel\n * - **User Authentication**: Autocomplete features activate based on auth status\n * - **Accessibility**: Full ARIA support and keyboard navigation\n *\n * ## Accessibility\n * - Proper ARIA labels and descriptions for all controls\n * - Keyboard navigation (Tab, Enter, Escape)\n * - Screen reader support for validation states and user auth status\n * - Focus management and visual indicators\n *\n * @param children - Current textarea content\n * @param onContentChange - Callback when content is saved\n * @param disabled - Whether the editor is disabled\n * @param validate - Optional validation function\n * @param additionalButtons - Extra buttons to display\n * @param props - Additional AutoSizedTextArea component props\n */\nexport const ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const { isAuthenticated } = useUser();\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the textarea on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.currentTarget.value ?? '');\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !disabled && isValid) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n useEffect(() => {\n setNewValue(children);\n // Force textarea to reset when children changes externally\n setResetIncrementor((prev) => prev + 1);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={children}\n role=\"group\"\n aria-label=\"Content editor textarea\"\n >\n <AutoCompleteTextarea\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n variant=\"invisible\"\n className=\"size-full\"\n value={children}\n isActive={isAuthenticated}\n disabled={disabled}\n aria-label=\"Editable textarea content\"\n aria-describedby={\n isEdited || additionalButtons\n ? 'content-editor-textarea-actions'\n : undefined\n }\n aria-invalid={!isValid}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div\n id=\"content-editor-textarea-actions\"\n className=\"flex w-full items-center justify-end gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label={`Save changes${!isValid ? ' (invalid content)' : ''}`}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n aria-describedby={\n !isValid ? 'textarea-validation-error' : undefined\n }\n />\n <Button\n Icon={X}\n label=\"Cancel changes\"\n variant={ButtonVariant.HOVERABLE}\n size={ButtonSize.ICON_SM}\n color={ButtonColor.TEXT}\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n disabled={disabled}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,yBAAyD,EACpE,UACA,iBACA,UACA,UACA,mBACA,GAAG,YACC;CACJ,MAAM,EAAE,oBAAoB,QAAQ;CACpC,MAAM,CAAC,UAAU,eAAe,SAAiB,QAAQ;CACzD,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,CAAC;CAClE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;EACzB,YAAY,QAAQ;EACpB,qBAAqB,SAAS,OAAO,CAAC;CACxC;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,QAAQ;CAC1B;CAEA,MAAM,yBAAkE,MACtE,YAAY,EAAE,cAAc,SAAS,EAAE;CAEzC,MAAM,iBAAiB,MAAgD;EACrE,IAAI,EAAE,QAAQ,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,YAAY,SAAS;GACzE,EAAE,eAAe;GACjB,YAAY;EACd,OAAO,IAAI,EAAE,QAAQ,UAAU;GAC7B,EAAE,eAAe;GACjB,aAAa;EACf;CACF;CAEA,gBAAgB;EACd,YAAY,QAAQ;EAEpB,qBAAqB,SAAS,OAAO,CAAC;CACxC,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,UAAU,WAAW,QAAQ,KAAK;CAExC,OACE,qBAAC,OAAD;EACE,WAAU;EAEV,MAAK;EACL,cAAW;YAJb,CAME,oBAAC,sBAAD;GACE,UAAU;GACV,WAAW;GAEX,SAAQ;GACR,WAAU;GACV,OAAO;GACP,UAAU;GACA;GACV,cAAW;GACX,oBACE,YAAY,oBACR,oCACA;GAEN,gBAAc,CAAC;GACf,GAAI;EACL,GAdM,gBAcN,IACC,YAAY,sBACZ,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAMG,YACC,8CACE,oBAAC,QAAD;IACE,MAAM;IACN,OAAO,eAAe,CAAC,UAAU,uBAAuB;IACxD;IACA;IACA;IACA,WAAU;IACV,UAAU,YAAY,CAAC;IACvB,SAAS;IACT,oBACE,CAAC,UAAU,8BAA8B;GAE5C,IACD,oBAAC,QAAD;IACE,MAAM;IACN,OAAM;IACN;IACA;IACA;IACA,WAAU;IACV,SAAS;IACC;GACX,EACD,MAEH,iBACE;IAEJ;IA3DE,QA2DF;AAET"}
1
+ {"version":3,"file":"ContentEditorTextArea.mjs","names":[],"sources":["../../../../src/components/ContentEditor/ContentEditorTextArea.tsx"],"sourcesContent":["'use client';\n\nimport { useUser } from '@api/useUser';\nimport { Check, X } from 'lucide-react';\nimport {\n type ChangeEventHandler,\n type FC,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\nimport { Button } from '../Button';\nimport { AutoCompleteTextarea, type AutoSizedTextAreaProps } from '../TextArea';\n\n/** Props for the ContentEditorTextArea component */\nexport type ContentEditorTextAreaProps = {\n /** The current content to display and edit */\n children: string;\n /** Callback function called when content is saved/validated */\n onContentChange: (content: string) => void;\n /** Whether the editor is disabled */\n disabled?: boolean;\n /** Optional validation function to check content validity */\n validate?: (content: string) => boolean;\n /** Additional buttons to display alongside edit actions */\n additionalButtons?: ReactNode;\n} & Omit<AutoSizedTextAreaProps, 'children'>;\n\n/**\n * ContentEditorTextArea Component\n *\n * An inline editing component for multi-line text with autocomplete functionality,\n * user authentication integration, and validation support. This component combines\n * the auto-sizing textarea with smart autocomplete features.\n *\n * ## Features\n * - **Auto-sizing Textarea**: Automatically adjusts height to content\n * - **Autocomplete Integration**: Smart text completion when user is authenticated\n * - **Validation Support**: Optional content validation with visual feedback\n * - **Action Buttons**: Built-in save/cancel with support for additional buttons\n * - **Keyboard Shortcuts**: Enter to save, Escape to cancel\n * - **User Authentication**: Autocomplete features activate based on auth status\n * - **Accessibility**: Full ARIA support and keyboard navigation\n *\n * ## Accessibility\n * - Proper ARIA labels and descriptions for all controls\n * - Keyboard navigation (Tab, Enter, Escape)\n * - Screen reader support for validation states and user auth status\n * - Focus management and visual indicators\n *\n * @param children - Current textarea content\n * @param onContentChange - Callback when content is saved\n * @param disabled - Whether the editor is disabled\n * @param validate - Optional validation function\n * @param additionalButtons - Extra buttons to display\n * @param props - Additional AutoSizedTextArea component props\n */\nexport const ContentEditorTextArea: FC<ContentEditorTextAreaProps> = ({\n children,\n onContentChange,\n disabled,\n validate,\n additionalButtons,\n ...props\n}) => {\n const { isAuthenticated } = useUser();\n const [newValue, setNewValue] = useState<string>(children);\n const [resetIncrementor, setResetIncrementor] = useState<number>(0); // To reset the textarea on cancel\n const isEdited: boolean = newValue !== children;\n\n const handleCancel = () => {\n setNewValue(children);\n setResetIncrementor((prev) => prev + 1);\n };\n\n const handleValid = () => {\n onContentChange(newValue);\n };\n\n const handleOnContentChange: ChangeEventHandler<HTMLTextAreaElement> = (e) =>\n setNewValue(e.currentTarget.value ?? '');\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !disabled && isValid) {\n e.preventDefault();\n handleValid();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n handleCancel();\n }\n };\n\n useEffect(() => {\n setNewValue(children);\n // Force textarea to reset when children changes externally\n setResetIncrementor((prev) => prev + 1);\n }, [children]);\n\n const isValid = validate?.(newValue) ?? true;\n\n return (\n <div\n className=\"flex size-full flex-col items-center justify-between gap-2\"\n key={children}\n role=\"group\"\n aria-label=\"Content editor textarea\"\n >\n <AutoCompleteTextarea\n onChange={handleOnContentChange}\n onKeyDown={handleKeyDown}\n key={resetIncrementor}\n variant=\"invisible\"\n className=\"size-full\"\n value={children}\n isActive={isAuthenticated}\n disabled={disabled}\n aria-label=\"Editable textarea content\"\n aria-describedby={\n isEdited || additionalButtons\n ? 'content-editor-textarea-actions'\n : undefined\n }\n aria-invalid={!isValid}\n {...props}\n />\n {(isEdited || additionalButtons) && (\n <div\n id=\"content-editor-textarea-actions\"\n className=\"flex w-full items-center justify-end gap-2\"\n role=\"group\"\n aria-label=\"Edit actions\"\n >\n {isEdited && (\n <>\n <Button\n Icon={Check}\n label={`Save changes${!isValid ? ' (invalid content)' : ''}`}\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n className=\"cursor-pointer hover:scale-110\"\n disabled={disabled || !isValid}\n onClick={handleValid}\n aria-describedby={\n !isValid ? 'textarea-validation-error' : undefined\n }\n />\n <Button\n Icon={X}\n label=\"Cancel changes\"\n variant=\"hoverable\"\n size=\"icon-sm\"\n color=\"text\"\n className=\"cursor-pointer hover:scale-110\"\n onClick={handleCancel}\n disabled={disabled}\n />\n </>\n )}\n {additionalButtons}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAa,yBAAyD,EACpE,UACA,iBACA,UACA,UACA,mBACA,GAAG,YACC;CACJ,MAAM,EAAE,oBAAoB,QAAQ;CACpC,MAAM,CAAC,UAAU,eAAe,SAAiB,QAAQ;CACzD,MAAM,CAAC,kBAAkB,uBAAuB,SAAiB,CAAC;CAClE,MAAM,WAAoB,aAAa;CAEvC,MAAM,qBAAqB;EACzB,YAAY,QAAQ;EACpB,qBAAqB,SAAS,OAAO,CAAC;CACxC;CAEA,MAAM,oBAAoB;EACxB,gBAAgB,QAAQ;CAC1B;CAEA,MAAM,yBAAkE,MACtE,YAAY,EAAE,cAAc,SAAS,EAAE;CAEzC,MAAM,iBAAiB,MAAgD;EACrE,IAAI,EAAE,QAAQ,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,YAAY,SAAS;GACzE,EAAE,eAAe;GACjB,YAAY;EACd,OAAO,IAAI,EAAE,QAAQ,UAAU;GAC7B,EAAE,eAAe;GACjB,aAAa;EACf;CACF;CAEA,gBAAgB;EACd,YAAY,QAAQ;EAEpB,qBAAqB,SAAS,OAAO,CAAC;CACxC,GAAG,CAAC,QAAQ,CAAC;CAEb,MAAM,UAAU,WAAW,QAAQ,KAAK;CAExC,OACE,qBAAC,OAAD;EACE,WAAU;EAEV,MAAK;EACL,cAAW;YAJb,CAME,oBAAC,sBAAD;GACE,UAAU;GACV,WAAW;GAEX,SAAQ;GACR,WAAU;GACV,OAAO;GACP,UAAU;GACA;GACV,cAAW;GACX,oBACE,YAAY,oBACR,oCACA;GAEN,gBAAc,CAAC;GACf,GAAI;EACL,GAdM,gBAcN,IACC,YAAY,sBACZ,qBAAC,OAAD;GACE,IAAG;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAJb,CAMG,YACC,8CACE,oBAAC,QAAD;IACE,MAAM;IACN,OAAO,eAAe,CAAC,UAAU,uBAAuB;IACxD,SAAQ;IACR,OAAM;IACN,MAAK;IACL,WAAU;IACV,UAAU,YAAY,CAAC;IACvB,SAAS;IACT,oBACE,CAAC,UAAU,8BAA8B;GAE5C,IACD,oBAAC,QAAD;IACE,MAAM;IACN,OAAM;IACN,SAAQ;IACR,MAAK;IACL,OAAM;IACN,WAAU;IACV,SAAS;IACC;GACX,EACD,MAEH,iBACE;IAEJ;IA3DE,QA2DF;AAET"}
@@ -1,5 +1,5 @@
1
+ import { ContentEditor } from "./ContentEditor.mjs";
1
2
  import { ContentEditorInput } from "./ContentEditorInput.mjs";
2
3
  import { ContentEditorTextArea } from "./ContentEditorTextArea.mjs";
3
- import { ContentEditor } from "./ContentEditor.mjs";
4
4
 
5
5
  export { ContentEditor, ContentEditorInput, ContentEditorTextArea };
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
3
+ import { Button } from "../Button/Button.mjs";
4
4
  import { useEffect, useState } from "react";
5
5
  import { CopyCheckIcon, CopyIcon } from "lucide-react";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -54,9 +54,9 @@ import { useIntlayer } from "react-intlayer";
54
54
  * <CopyButton
55
55
  * content="https://example.com/api/endpoint"
56
56
  * label="Copy API endpoint"
57
- * variant={ButtonVariant.OUTLINE}
58
- * color={ButtonColor.PRIMARY}
59
- * size={ButtonSize.ICON_MD}
57
+ * variant="outline"
58
+ * color="primary"
59
+ * size="icon-md"
60
60
  * />
61
61
  * ```
62
62
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/CopyButton/index.tsx"],"sourcesContent":["'use client';\n\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { type FC, useEffect, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n type ButtonProps,\n ButtonSize,\n ButtonVariant,\n} from '../Button';\n\n/**\n * Props for the CopyButton component\n */\ntype CopyButtonProps = {\n /**\n * The text content to copy to the clipboard\n * @example\n * ```tsx\n * <CopyButton content=\"Hello World!\" />\n * ```\n */\n content: string;\n} & Partial<ButtonProps>;\n\n/**\n * CopyButton - A specialized button component for copying text to the clipboard\n *\n * This component provides a user-friendly way to copy text content to the system clipboard\n * with visual feedback and accessibility features. It uses the modern Clipboard API with\n * fallback error handling, and provides clear visual indication of successful copy operations.\n *\n * ## Key Features\n * - **Clipboard Integration**: Uses modern Clipboard API for reliable text copying\n * - **Visual Feedback**: Icon changes from copy to check mark on successful copy\n * - **Auto-Reset**: Automatically reverts to copy icon after 1 second\n * - **Error Handling**: Graceful error handling with console logging\n * - **Accessibility**: Full keyboard navigation and screen reader support\n * - **Internationalization**: Multi-language support via Intlayer\n *\n * ## Use Cases\n * - Code snippet copying in documentation\n * - Sharing URLs or links\n * - Copying configuration values\n * - Form data duplication\n * - API key or token copying\n * - Text content sharing in interfaces\n *\n * ## Accessibility\n * - Uses semantic button element with proper ARIA labeling\n * - Keyboard accessible (Tab, Enter, Space)\n * - Screen reader announces copy actions\n * - Focus management with visible indicators\n * - Proper error state handling for assistive technologies\n *\n * ## Browser Compatibility\n * - Requires modern browsers with Clipboard API support\n * - Falls back gracefully with error logging for unsupported browsers\n * - Works in secure contexts (HTTPS) as required by Clipboard API\n *\n * @example\n * Basic usage:\n * ```tsx\n * <CopyButton content=\"Text to copy\" />\n * ```\n *\n * @example\n * With custom styling and label:\n * ```tsx\n * <CopyButton\n * content=\"https://example.com/api/endpoint\"\n * label=\"Copy API endpoint\"\n * variant={ButtonVariant.OUTLINE}\n * color={ButtonColor.PRIMARY}\n * size={ButtonSize.ICON_MD}\n * />\n * ```\n *\n * @example\n * In a code block context:\n * ```tsx\n * <div className=\"relative\">\n * <pre className=\"bg-gray-100 p-4 rounded\">\n * <code>npm install @intlayer/design-system</code>\n * </pre>\n * <CopyButton\n * content=\"npm install @intlayer/design-system\"\n * className=\"absolute top-2 right-2\"\n * label=\"Copy installation command\"\n * />\n * </div>\n * ```\n */\n\nexport const CopyButton: FC<CopyButtonProps> = ({ content, ...props }) => {\n const [copied, setCopied] = useState(false);\n const [error, setError] = useState(false);\n const { label } = useIntlayer('copy-button');\n\n const handleCopy = async () => {\n try {\n setError(false);\n await navigator.clipboard.writeText(content);\n setCopied(true);\n } catch (error) {\n console.error('Failed to copy text: ', error);\n setError(true);\n }\n };\n\n useEffect(() => {\n if (copied || error) {\n const timer = setTimeout(() => {\n setCopied(false);\n setError(false);\n }, 1000);\n return () => clearTimeout(timer);\n }\n }, [copied, error]);\n\n // Determine the current state for accessibility\n const getAriaLabel = () => {\n if (copied) return 'Content copied to clipboard';\n if (error) return 'Failed to copy content';\n return props.label ?? label.value;\n };\n\n return (\n <Button\n Icon={copied ? CopyCheckIcon : CopyIcon}\n onClick={handleCopy}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n size={ButtonSize.ICON_SM}\n tabIndex={0}\n title={getAriaLabel()}\n {...props}\n label={getAriaLabel()}\n aria-describedby={\n copied ? 'copy-success' : error ? 'copy-error' : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAa,cAAmC,EAAE,SAAS,GAAG,YAAY;CACxE,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,CAAC,OAAO,YAAY,SAAS,KAAK;CACxC,MAAM,EAAE,UAAU,YAAY,aAAa;CAE3C,MAAM,aAAa,YAAY;EAC7B,IAAI;GACF,SAAS,KAAK;GACd,MAAM,UAAU,UAAU,UAAU,OAAO;GAC3C,UAAU,IAAI;EAChB,SAAS,OAAO;GACd,QAAQ,MAAM,yBAAyB,KAAK;GAC5C,SAAS,IAAI;EACf;CACF;CAEA,gBAAgB;EACd,IAAI,UAAU,OAAO;GACnB,MAAM,QAAQ,iBAAiB;IAC7B,UAAU,KAAK;IACf,SAAS,KAAK;GAChB,GAAG,GAAI;GACP,aAAa,aAAa,KAAK;EACjC;CACF,GAAG,CAAC,QAAQ,KAAK,CAAC;CAGlB,MAAM,qBAAqB;EACzB,IAAI,QAAQ,OAAO;EACnB,IAAI,OAAO,OAAO;EAClB,OAAO,MAAM,SAAS,MAAM;CAC9B;CAEA,OACE,oBAAC,QAAD;EACE,MAAM,SAAS,gBAAgB;EAC/B,SAAS;EACT;EACA;EACA;EACA,UAAU;EACV,OAAO,aAAa;EACpB,GAAI;EACJ,OAAO,aAAa;EACpB,oBACE,SAAS,iBAAiB,QAAQ,eAAe;CAEpD;AAEL"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/CopyButton/index.tsx"],"sourcesContent":["'use client';\n\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { type FC, useEffect, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Button, type ButtonProps } from '../Button';\n\n/**\n * Props for the CopyButton component\n */\ntype CopyButtonProps = {\n /**\n * The text content to copy to the clipboard\n * @example\n * ```tsx\n * <CopyButton content=\"Hello World!\" />\n * ```\n */\n content: string;\n} & Partial<ButtonProps>;\n\n/**\n * CopyButton - A specialized button component for copying text to the clipboard\n *\n * This component provides a user-friendly way to copy text content to the system clipboard\n * with visual feedback and accessibility features. It uses the modern Clipboard API with\n * fallback error handling, and provides clear visual indication of successful copy operations.\n *\n * ## Key Features\n * - **Clipboard Integration**: Uses modern Clipboard API for reliable text copying\n * - **Visual Feedback**: Icon changes from copy to check mark on successful copy\n * - **Auto-Reset**: Automatically reverts to copy icon after 1 second\n * - **Error Handling**: Graceful error handling with console logging\n * - **Accessibility**: Full keyboard navigation and screen reader support\n * - **Internationalization**: Multi-language support via Intlayer\n *\n * ## Use Cases\n * - Code snippet copying in documentation\n * - Sharing URLs or links\n * - Copying configuration values\n * - Form data duplication\n * - API key or token copying\n * - Text content sharing in interfaces\n *\n * ## Accessibility\n * - Uses semantic button element with proper ARIA labeling\n * - Keyboard accessible (Tab, Enter, Space)\n * - Screen reader announces copy actions\n * - Focus management with visible indicators\n * - Proper error state handling for assistive technologies\n *\n * ## Browser Compatibility\n * - Requires modern browsers with Clipboard API support\n * - Falls back gracefully with error logging for unsupported browsers\n * - Works in secure contexts (HTTPS) as required by Clipboard API\n *\n * @example\n * Basic usage:\n * ```tsx\n * <CopyButton content=\"Text to copy\" />\n * ```\n *\n * @example\n * With custom styling and label:\n * ```tsx\n * <CopyButton\n * content=\"https://example.com/api/endpoint\"\n * label=\"Copy API endpoint\"\n * variant=\"outline\"\n * color=\"primary\"\n * size=\"icon-md\"\n * />\n * ```\n *\n * @example\n * In a code block context:\n * ```tsx\n * <div className=\"relative\">\n * <pre className=\"bg-gray-100 p-4 rounded\">\n * <code>npm install @intlayer/design-system</code>\n * </pre>\n * <CopyButton\n * content=\"npm install @intlayer/design-system\"\n * className=\"absolute top-2 right-2\"\n * label=\"Copy installation command\"\n * />\n * </div>\n * ```\n */\n\nexport const CopyButton: FC<CopyButtonProps> = ({ content, ...props }) => {\n const [copied, setCopied] = useState(false);\n const [error, setError] = useState(false);\n const { label } = useIntlayer('copy-button');\n\n const handleCopy = async () => {\n try {\n setError(false);\n await navigator.clipboard.writeText(content);\n setCopied(true);\n } catch (error) {\n console.error('Failed to copy text: ', error);\n setError(true);\n }\n };\n\n useEffect(() => {\n if (copied || error) {\n const timer = setTimeout(() => {\n setCopied(false);\n setError(false);\n }, 1000);\n return () => clearTimeout(timer);\n }\n }, [copied, error]);\n\n // Determine the current state for accessibility\n const getAriaLabel = () => {\n if (copied) return 'Content copied to clipboard';\n if (error) return 'Failed to copy content';\n return props.label ?? label.value;\n };\n\n return (\n <Button\n Icon={copied ? CopyCheckIcon : CopyIcon}\n onClick={handleCopy}\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n tabIndex={0}\n title={getAriaLabel()}\n {...props}\n label={getAriaLabel()}\n aria-describedby={\n copied ? 'copy-success' : error ? 'copy-error' : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,MAAa,cAAmC,EAAE,SAAS,GAAG,YAAY;CACxE,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,CAAC,OAAO,YAAY,SAAS,KAAK;CACxC,MAAM,EAAE,UAAU,YAAY,aAAa;CAE3C,MAAM,aAAa,YAAY;EAC7B,IAAI;GACF,SAAS,KAAK;GACd,MAAM,UAAU,UAAU,UAAU,OAAO;GAC3C,UAAU,IAAI;EAChB,SAAS,OAAO;GACd,QAAQ,MAAM,yBAAyB,KAAK;GAC5C,SAAS,IAAI;EACf;CACF;CAEA,gBAAgB;EACd,IAAI,UAAU,OAAO;GACnB,MAAM,QAAQ,iBAAiB;IAC7B,UAAU,KAAK;IACf,SAAS,KAAK;GAChB,GAAG,GAAI;GACP,aAAa,aAAa,KAAK;EACjC;CACF,GAAG,CAAC,QAAQ,KAAK,CAAC;CAGlB,MAAM,qBAAqB;EACzB,IAAI,QAAQ,OAAO;EACnB,IAAI,OAAO,OAAO;EAClB,OAAO,MAAM,SAAS,MAAM;CAC9B;CAEA,OACE,oBAAC,QAAD;EACE,MAAM,SAAS,gBAAgB;EAC/B,SAAS;EACT,SAAQ;EACR,OAAM;EACN,MAAK;EACL,UAAU;EACV,OAAO,aAAa;EACpB,GAAI;EACJ,OAAO,aAAa;EACpB,oBACE,SAAS,iBAAiB,QAAQ,eAAe;CAEpD;AAEL"}
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { NodeWrapper } from "./NodeWrapper/index.mjs";
4
4
  import { createElement } from "react";
5
- import { jsx } from "react/jsx-runtime";
6
5
  import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
6
+ import { jsx } from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/DictionaryEditor/DictionaryEditor.tsx
9
9
  const DictionaryEditor = ({ dictionary, ...props }) => {
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { cn } from "../../../utils/cn.mjs";
4
4
  import { SwitchSelector } from "../../SwitchSelector/SwitchSelector.mjs";
5
- import { Fragment, jsx } from "react/jsx-runtime";
6
5
  import { useEditorLocale } from "@intlayer/editor-react";
6
+ import { Fragment, jsx } from "react/jsx-runtime";
7
7
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
8
8
 
9
9
  //#region src/components/DictionaryEditor/NodeWrapper/BooleanWrapper.tsx
@@ -1,6 +1,6 @@
1
1
  import { StringWrapper } from "./StringWrapper.mjs";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { useEditedContent } from "@intlayer/editor-react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
5
5
  import * as NodeTypes from "@intlayer/types/nodeType";
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../../utils/cn.mjs";
2
2
  import { EditableFieldInput } from "../../EditableField/EditableFieldInput.mjs";
3
- import { Fragment, jsx } from "react/jsx-runtime";
4
3
  import { useEditorLocale } from "@intlayer/editor-react";
4
+ import { Fragment, jsx } from "react/jsx-runtime";
5
5
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
6
6
 
7
7
  //#region src/components/DictionaryEditor/NodeWrapper/NumberWrapper.tsx
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../../../utils/cn.mjs";
2
2
  import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
3
- import { Fragment, jsx } from "react/jsx-runtime";
4
3
  import { useEditorLocale } from "@intlayer/editor-react";
4
+ import { Fragment, jsx } from "react/jsx-runtime";
5
5
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
6
6
 
7
7
  //#region src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx
@@ -14,8 +14,8 @@ import { NumberWrapper } from "./NumberWrapper.mjs";
14
14
  import { PluralWrapper } from "./PluralWrapper.mjs";
15
15
  import { TranslationWrapper } from "./TranslationWrapper.mjs";
16
16
  import { memo, useMemo } from "react";
17
- import { jsx } from "react/jsx-runtime";
18
17
  import { useEditorLocale } from "@intlayer/editor-react";
18
+ import { jsx } from "react/jsx-runtime";
19
19
  import { getContentNodeByKeyPath, getNodeType } from "@intlayer/core/dictionaryManipulator";
20
20
  import * as NodeTypes from "@intlayer/types/nodeType";
21
21
 
@@ -7,8 +7,8 @@ import { getIsEditableSection } from "./getIsEditableSection.mjs";
7
7
  import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
8
8
  import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
9
9
  import { useDeferredValue, useEffect, useTransition } from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
10
  import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
12
  import { getContentNodeByKeyPath } from "@intlayer/core/dictionaryManipulator";
13
13
 
14
14
  //#region src/components/DictionaryFieldEditor/ContentEditor.tsx
@@ -1,25 +1,24 @@
1
1
  'use client';
2
2
 
3
- import { Container } from "../../Container/index.mjs";
3
+ import { useAuditContentDeclarationField } from "../../../api/hooks/ai.mjs";
4
4
  import { Loader } from "../../Loader/index.mjs";
5
- import { Button, ButtonColor, ButtonSize, ButtonTextAlign, ButtonVariant } from "../../Button/Button.mjs";
5
+ import { Button } from "../../Button/Button.mjs";
6
6
  import { Accordion } from "../../Accordion/Accordion.mjs";
7
- import { InputVariant } from "../../Input/Input.mjs";
8
- import { SwitchSelector, SwitchSelectorColor, SwitchSelectorSize } from "../../SwitchSelector/SwitchSelector.mjs";
9
- import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
10
- import { useAuditContentDeclarationField } from "../../../api/hooks/ai.mjs";
7
+ import { Container } from "../../Container/index.mjs";
11
8
  import { ContentEditorInput as ContentEditorInput$1 } from "../../ContentEditor/ContentEditorInput.mjs";
12
9
  import { ContentEditorTextArea as ContentEditorTextArea$1 } from "../../ContentEditor/ContentEditorTextArea.mjs";
10
+ import { SwitchSelector } from "../../SwitchSelector/SwitchSelector.mjs";
11
+ import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
13
12
  import { renameKey } from "./object.mjs";
14
13
  import { Label } from "../../Label/index.mjs";
15
14
  import { EnumKeyInput } from "../EnumKeyInput.mjs";
16
15
  import { SafeHtmlRenderer } from "./SafeHtmlRenderer.mjs";
17
16
  import { Fragment, Suspense, lazy, memo, useState } from "react";
17
+ import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
18
18
  import { Plus, Trash, WandSparkles } from "lucide-react";
19
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
20
  import { useIntlayer, useLocale } from "react-intlayer";
21
21
  import { getLocaleName } from "@intlayer/core/localization";
22
- import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
23
22
  import { getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
24
23
  import * as NodeTypes from "@intlayer/types/nodeType";
25
24
  import { camelCaseToSentence } from "@intlayer/config/client";