@intlayer/design-system 7.5.5 → 7.5.7

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 (226) hide show
  1. package/dist/esm/components/Accordion/Accordion.mjs +1 -1
  2. package/dist/esm/components/Avatar/index.mjs +1 -1
  3. package/dist/esm/components/Breadcrumb/index.mjs +29 -3
  4. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  5. package/dist/esm/components/Browser/Browser.mjs +30 -41
  6. package/dist/esm/components/Browser/Browser.mjs.map +1 -1
  7. package/dist/esm/components/Browser/{Browser.content.mjs → browser.content.mjs} +42 -4
  8. package/dist/esm/components/Browser/{Browser.content.mjs.map → browser.content.mjs.map} +1 -1
  9. package/dist/esm/components/Button/Button.mjs +6 -2
  10. package/dist/esm/components/Button/Button.mjs.map +1 -1
  11. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
  12. package/dist/esm/components/ContentEditor/ContentEditor.mjs +1 -1
  13. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +1 -1
  14. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
  15. package/dist/esm/components/CopyButton/index.mjs +1 -1
  16. package/dist/esm/components/CopyToClipboard/index.mjs +1 -1
  17. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
  18. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
  19. package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs +1 -1
  20. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  21. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
  22. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +113 -83
  23. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  24. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  25. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +4 -4
  26. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
  27. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs +1 -1
  28. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +7 -6
  29. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  30. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
  31. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +4 -4
  32. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +1 -1
  33. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  34. package/dist/esm/components/DictionaryFieldEditor/index.mjs +4 -1
  35. package/dist/esm/components/DropDown/index.mjs +19 -4
  36. package/dist/esm/components/DropDown/index.mjs.map +1 -1
  37. package/dist/esm/components/EditableField/EditableFieldLayout.mjs +1 -1
  38. package/dist/esm/components/Flags/Flag.mjs +55 -2
  39. package/dist/esm/components/Flags/Flag.mjs.map +1 -1
  40. package/dist/esm/components/Flags/bw.mjs +35 -0
  41. package/dist/esm/components/Flags/bw.mjs.map +1 -0
  42. package/dist/esm/components/Flags/cu.mjs +45 -0
  43. package/dist/esm/components/Flags/cu.mjs.map +1 -0
  44. package/dist/esm/components/Flags/cv.mjs +45 -0
  45. package/dist/esm/components/Flags/cv.mjs.map +1 -0
  46. package/dist/esm/components/Flags/dj.mjs +45 -0
  47. package/dist/esm/components/Flags/dj.mjs.map +1 -0
  48. package/dist/esm/components/Flags/flags.mjs +242 -7
  49. package/dist/esm/components/Flags/flags.mjs.map +1 -1
  50. package/dist/esm/components/Flags/gh.mjs +38 -0
  51. package/dist/esm/components/Flags/gh.mjs.map +1 -0
  52. package/dist/esm/components/Flags/gw.mjs +69 -0
  53. package/dist/esm/components/Flags/gw.mjs.map +1 -0
  54. package/dist/esm/components/Flags/km.mjs +54 -0
  55. package/dist/esm/components/Flags/km.mjs.map +1 -0
  56. package/dist/esm/components/Flags/lk.mjs +75 -0
  57. package/dist/esm/components/Flags/lk.mjs.map +1 -0
  58. package/dist/esm/components/Flags/md.mjs +319 -0
  59. package/dist/esm/components/Flags/md.mjs.map +1 -0
  60. package/dist/esm/components/Flags/mr.mjs +39 -0
  61. package/dist/esm/components/Flags/mr.mjs.map +1 -0
  62. package/dist/esm/components/Flags/mz.mjs +94 -0
  63. package/dist/esm/components/Flags/mz.mjs.map +1 -0
  64. package/dist/esm/components/Flags/ps.mjs +47 -0
  65. package/dist/esm/components/Flags/ps.mjs.map +1 -0
  66. package/dist/esm/components/Flags/sd.mjs +46 -0
  67. package/dist/esm/components/Flags/sd.mjs.map +1 -0
  68. package/dist/esm/components/Flags/so.mjs +39 -0
  69. package/dist/esm/components/Flags/so.mjs.map +1 -0
  70. package/dist/esm/components/Flags/st.mjs +75 -0
  71. package/dist/esm/components/Flags/st.mjs.map +1 -0
  72. package/dist/esm/components/Flags/td.mjs +35 -0
  73. package/dist/esm/components/Flags/td.mjs.map +1 -0
  74. package/dist/esm/components/Flags/tl.mjs +45 -0
  75. package/dist/esm/components/Flags/tl.mjs.map +1 -0
  76. package/dist/esm/components/Flags/tz.mjs +46 -0
  77. package/dist/esm/components/Flags/tz.mjs.map +1 -0
  78. package/dist/esm/components/Flags/ug.mjs +147 -0
  79. package/dist/esm/components/Flags/ug.mjs.map +1 -0
  80. package/dist/esm/components/Form/elements/OTPElement.mjs +2 -2
  81. package/dist/esm/components/Form/elements/OTPElement.mjs.map +1 -1
  82. package/dist/esm/components/HideShow/index.mjs +1 -1
  83. package/dist/esm/components/IDE/FileTree.mjs +1 -1
  84. package/dist/esm/components/Input/Input.mjs +3 -1
  85. package/dist/esm/components/Input/Input.mjs.map +1 -1
  86. package/dist/esm/components/Input/InputPassword.mjs +1 -1
  87. package/dist/esm/components/Input/OTPInput.mjs +3 -3
  88. package/dist/esm/components/Input/OTPInput.mjs.map +1 -1
  89. package/dist/esm/components/Input/SearchInput.mjs +1 -1
  90. package/dist/esm/components/Input/SearchInput.mjs.map +1 -1
  91. package/dist/esm/components/KeyboardScreenAdapter/index.mjs +1 -1
  92. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs +1 -1
  93. package/dist/esm/components/Link/Link.mjs +11 -3
  94. package/dist/esm/components/Link/Link.mjs.map +1 -1
  95. package/dist/esm/components/Link/index.mjs +2 -2
  96. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +19 -13
  97. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  98. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  99. package/dist/esm/components/Modal/Modal.mjs +3 -3
  100. package/dist/esm/components/Navbar/MobileNavbar.mjs +2 -2
  101. package/dist/esm/components/Pagination/Pagination.mjs +2 -2
  102. package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
  103. package/dist/esm/components/Select/Multiselect.mjs +1 -1
  104. package/dist/esm/components/SwitchSelector/index.mjs +1 -1
  105. package/dist/esm/components/Tab/Tab.mjs +1 -1
  106. package/dist/esm/components/TabSelector/TabSelector.mjs +1 -1
  107. package/dist/esm/components/Table/Table.mjs +1 -1
  108. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs +3 -30
  109. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  110. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  111. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +1 -1
  112. package/dist/esm/components/index.mjs +12 -9
  113. package/dist/esm/hooks/index.mjs +2 -2
  114. package/dist/esm/hooks/reactQuery.mjs +32 -3
  115. package/dist/esm/hooks/reactQuery.mjs.map +1 -1
  116. package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
  117. package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
  118. package/dist/esm/hooks/usePersistedStore.mjs +1 -1
  119. package/dist/esm/hooks/usePersistedStore.mjs.map +1 -1
  120. package/dist/esm/libs/auth.mjs +1 -1
  121. package/dist/esm/providers/ReactQueryProvider.mjs +1 -1
  122. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +3 -3
  123. package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
  124. package/dist/types/components/Browser/Browser.d.ts +2 -2
  125. package/dist/types/components/Browser/Browser.d.ts.map +1 -1
  126. package/dist/types/components/Browser/{Browser.content.d.ts → browser.content.d.ts} +97 -15
  127. package/dist/types/components/Browser/browser.content.d.ts.map +1 -0
  128. package/dist/types/components/Button/Button.d.ts +6 -6
  129. package/dist/types/components/Button/Button.d.ts.map +1 -1
  130. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +3 -3
  131. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts.map +1 -1
  132. package/dist/types/components/Command/index.d.ts +17 -17
  133. package/dist/types/components/Command/index.d.ts.map +1 -1
  134. package/dist/types/components/Container/index.d.ts +7 -7
  135. package/dist/types/components/Container/index.d.ts.map +1 -1
  136. package/dist/types/components/CopyButton/CopyButton.content.d.ts +3 -3
  137. package/dist/types/components/CopyButton/CopyButton.content.d.ts.map +1 -1
  138. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  139. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +25 -25
  140. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -9
  141. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +33 -33
  142. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -25
  143. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts +5 -1
  144. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts.map +1 -1
  145. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -25
  146. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +33 -33
  147. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -9
  148. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -7
  149. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +5 -5
  150. package/dist/types/components/DictionaryFieldEditor/index.d.ts +4 -1
  151. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +31 -31
  152. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
  153. package/dist/types/components/DropDown/index.d.ts +16 -2
  154. package/dist/types/components/DropDown/index.d.ts.map +1 -1
  155. package/dist/types/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  156. package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +3 -3
  157. package/dist/types/components/Flags/Flag.d.ts.map +1 -1
  158. package/dist/types/components/Flags/flags.d.ts +169 -7
  159. package/dist/types/components/Flags/flags.d.ts.map +1 -1
  160. package/dist/types/components/Form/FormBase.d.ts +2 -2
  161. package/dist/types/components/Form/FormField.d.ts +2 -2
  162. package/dist/types/components/Form/FormItem.d.ts +2 -2
  163. package/dist/types/components/Form/FormItem.d.ts.map +1 -1
  164. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +2 -2
  165. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +2 -2
  166. package/dist/types/components/Form/elements/FormElement.d.ts +2 -2
  167. package/dist/types/components/Form/elements/MultiselectElement.d.ts +2 -2
  168. package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  169. package/dist/types/components/Form/elements/OTPElement.d.ts +2 -2
  170. package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
  171. package/dist/types/components/Form/elements/SelectElement.d.ts +2 -2
  172. package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
  173. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +2 -2
  174. package/dist/types/components/IDE/CodeContext.d.ts +2 -2
  175. package/dist/types/components/IDE/CodeContext.d.ts.map +1 -1
  176. package/dist/types/components/IDE/copyCode.content.d.ts +5 -5
  177. package/dist/types/components/IDE/selectors.content.d.ts +7 -7
  178. package/dist/types/components/Input/Checkbox.d.ts +3 -3
  179. package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
  180. package/dist/types/components/Input/Input.d.ts +5 -8
  181. package/dist/types/components/Input/Input.d.ts.map +1 -1
  182. package/dist/types/components/Input/OTPInput.d.ts +6 -6
  183. package/dist/types/components/Input/OTPInput.d.ts.map +1 -1
  184. package/dist/types/components/Input/SearchInput.d.ts +2 -2
  185. package/dist/types/components/Input/SearchInput.d.ts.map +1 -1
  186. package/dist/types/components/Link/Link.d.ts +8 -7
  187. package/dist/types/components/Link/Link.d.ts.map +1 -1
  188. package/dist/types/components/Link/index.d.ts +2 -2
  189. package/dist/types/components/Loader/index.content.d.ts +3 -3
  190. package/dist/types/components/Loader/index.content.d.ts.map +1 -1
  191. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -17
  192. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
  193. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -13
  194. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
  195. package/dist/types/components/MaxWidthSmoother/index.d.ts +2 -2
  196. package/dist/types/components/Navbar/Burger.d.ts +2 -2
  197. package/dist/types/components/Navbar/Burger.d.ts.map +1 -1
  198. package/dist/types/components/Navbar/DesktopNavbar.d.ts +2 -2
  199. package/dist/types/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  200. package/dist/types/components/Navbar/MobileNavbar.d.ts +2 -2
  201. package/dist/types/components/Navbar/MobileNavbar.d.ts.map +1 -1
  202. package/dist/types/components/Navbar/index.d.ts +2 -2
  203. package/dist/types/components/Pagination/Pagination.d.ts +4 -4
  204. package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
  205. package/dist/types/components/Pagination/pagination.content.d.ts +11 -11
  206. package/dist/types/components/Select/Select.d.ts +3 -3
  207. package/dist/types/components/Select/Select.d.ts.map +1 -1
  208. package/dist/types/components/SocialNetworks/index.d.ts +2 -2
  209. package/dist/types/components/SwitchSelector/index.d.ts +6 -6
  210. package/dist/types/components/Tab/Tab.d.ts +6 -6
  211. package/dist/types/components/Tab/Tab.d.ts.map +1 -1
  212. package/dist/types/components/Tab/TabContext.d.ts +2 -2
  213. package/dist/types/components/Tab/TabContext.d.ts.map +1 -1
  214. package/dist/types/components/TabSelector/TabSelector.d.ts +5 -5
  215. package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
  216. package/dist/types/components/Table/table.content.d.ts +3 -3
  217. package/dist/types/components/Tag/index.d.ts +3 -3
  218. package/dist/types/components/Terminal/terminal.content.d.ts +5 -5
  219. package/dist/types/components/Toaster/Toast.d.ts +1 -1
  220. package/dist/types/components/Toaster/Toast.d.ts.map +1 -1
  221. package/dist/types/components/index.d.ts +6 -3
  222. package/dist/types/hooks/index.d.ts +2 -2
  223. package/dist/types/hooks/reactQuery.d.ts +2 -1
  224. package/dist/types/hooks/reactQuery.d.ts.map +1 -1
  225. package/package.json +14 -14
  226. package/dist/types/components/Browser/Browser.content.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","names":["ButtonRoundedSize","Button: FC<ButtonProps>"],"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport type { ButtonHTMLAttributes, DetailedHTMLProps, FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { ContainerRoundedSize as ButtonRoundedSize } from '../Container';\nimport { Loader } from '../Loader';\n\n/**\n * Button size variants for different use cases\n */\nexport enum ButtonSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n ICON_SM = 'icon-sm',\n ICON_MD = 'icon-md',\n ICON_LG = 'icon-lg',\n ICON_XL = 'icon-xl',\n}\n\nconst buttonIconVariants = cva('flex-none shrink-0', {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'size-3',\n [`${ButtonSize.MD}`]: 'size-4',\n [`${ButtonSize.LG}`]: 'size-5',\n [`${ButtonSize.XL}`]: 'size-6',\n [`${ButtonSize.ICON_SM}`]: 'size-3',\n [`${ButtonSize.ICON_MD}`]: 'size-4',\n [`${ButtonSize.ICON_LG}`]: 'size-4',\n [`${ButtonSize.ICON_XL}`]: 'size-5',\n },\n },\n defaultVariants: {\n size: ButtonSize.MD,\n },\n});\n\n/**\n * Button visual style variants\n */\nexport enum ButtonVariant {\n DEFAULT = 'default',\n NONE = 'none',\n OUTLINE = 'outline',\n LINK = 'link',\n INVISIBLE_LINK = 'invisible-link',\n HOVERABLE = 'hoverable',\n FADE = 'fade',\n INPUT = 'input',\n}\n\n/**\n * Button color themes that work with the design system\n */\nexport enum ButtonColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n CARD = 'card',\n TEXT_INVERSE = 'text-inverse',\n CURRENT = 'current',\n ERROR = 'error',\n SUCCESS = 'success',\n CUSTOM = 'custom',\n}\n\n/**\n * Text alignment options for button content\n */\nexport enum ButtonTextAlign {\n LEFT = 'left',\n CENTER = 'center',\n RIGHT = 'right',\n}\n\n/**\n * Enhanced button variants with improved accessibility and focus states\n */\nexport const buttonVariants = cva(\n 'relative inline-flex cursor-pointer items-center justify-center font-medium ring-0 transition-all duration-300 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'min-h-7 px-3 text-xs max-md:py-1',\n [`${ButtonSize.MD}`]: 'min-h-8 px-6 text-sm max-md:py-2',\n [`${ButtonSize.LG}`]: 'min-h-10 px-8 text-lg max-md:py-3',\n [`${ButtonSize.XL}`]: 'min-h-11 px-10 text-xl max-md:py-4',\n [`${ButtonSize.ICON_SM}`]: 'p-1.5',\n [`${ButtonSize.ICON_MD}`]: 'p-1.5',\n [`${ButtonSize.ICON_LG}`]: 'p-2',\n [`${ButtonSize.ICON_XL}`]: 'p-3',\n },\n color: {\n [`${ButtonColor.PRIMARY}`]:\n 'hover-primary-500/20 text-primary ring-primary-500/20 *:text-text-light',\n [`${ButtonColor.SECONDARY}`]:\n 'hover-secondary-500/20 text-secondary ring-secondary-500/20 *:text-text-light',\n [`${ButtonColor.DESTRUCTIVE}`]:\n 'hover-destructive-500/20 text-destructive ring-destructive-500/20 *:text-text-light',\n [`${ButtonColor.NEUTRAL}`]:\n 'text-neutral ring-neutral-500/20 *:text-text-light',\n [`${ButtonColor.CARD}`]:\n 'hover-card-500/20 text-card ring-card-500/20 *:text-text-light',\n [`${ButtonColor.LIGHT}`]:\n 'hover-white-500/20 text-white ring-white/20 *:text-text-light',\n [`${ButtonColor.DARK}`]:\n 'text-neutral-800 ring-text-light/50 *:text-text-light',\n [`${ButtonColor.TEXT}`]: 'text-text ring-text/20 *:text-text-opposite',\n [`${ButtonColor.CURRENT}`]:\n 'hover-current-500/10 text-current ring-current/10 *:text-text-light',\n [`${ButtonColor.TEXT_INVERSE}`]:\n 'text-text-opposite ring-text-opposite/20 *:text-text',\n [`${ButtonColor.ERROR}`]:\n 'hover-error-500/20 text-error ring-error/20 *:text-text-light',\n [`${ButtonColor.SUCCESS}`]:\n 'hover-success-500/20 text-success ring-success/20 *:text-text-light',\n [`${ButtonColor.CUSTOM}`]: '',\n },\n roundedSize: {\n [`${ButtonRoundedSize.NONE}`]: 'rounded-none',\n [`${ButtonRoundedSize.SM}`]:\n 'rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl',\n [`${ButtonRoundedSize.MD}`]:\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n [`${ButtonRoundedSize.LG}`]:\n 'rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl',\n [`${ButtonRoundedSize.XL}`]:\n 'rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl',\n [`${ButtonRoundedSize['2xl']}`]:\n 'rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]',\n [`${ButtonRoundedSize['3xl']}`]:\n 'rounded-[2.5rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[3rem]',\n [`${ButtonRoundedSize['4xl']}`]:\n 'rounded-[3rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[4rem]',\n [`${ButtonRoundedSize['5xl']}`]:\n 'rounded-[4rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[5rem]',\n [`${ButtonRoundedSize.FULL}`]: 'rounded-full',\n },\n variant: {\n [`${ButtonVariant.DEFAULT}`]: [\n 'bg-current',\n 'hover:bg-current/90',\n 'hover:ring-5',\n 'aria-selected:ring-5',\n ],\n\n [`${ButtonVariant.OUTLINE}`]: [\n 'rounded-2xl border-[1.3px] border-current bg-current/0 *:text-current!',\n 'hover:bg-current/20 focus-visible:bg-current/20',\n 'hover:ring-5 focus-visible:ring-5',\n 'aria-selected:ring-5',\n ],\n\n [`${ButtonVariant.NONE}`]:\n 'border-none bg-current/0 text-inherit hover:bg-current/0',\n\n [`${ButtonVariant.LINK}`]:\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent hover:underline',\n\n [`${ButtonVariant.INVISIBLE_LINK}`]:\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent',\n\n [`${ButtonVariant.HOVERABLE}`]:\n 'rounded-lg border-none bg-current/0 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5',\n\n [`${ButtonVariant.FADE}`]:\n 'rounded-lg border-none bg-current/20 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5',\n\n [`${ButtonVariant.INPUT}`]: [\n // base styles\n 'text-text',\n 'w-full select-text resize-none rounded-2xl text-base shadow-none outline-none supports-[corner-shape:squircle]:rounded-4xl',\n 'transition-shadow duration-100 md:text-sm',\n 'ring-0', // base ring\n 'disabled:opacity-50',\n\n 'text-text',\n 'bg-neutral-50 dark:bg-neutral-950',\n 'ring-neutral-100 dark:ring-neutral-700',\n\n // Hover ring (similar spirit to your input)\n 'hover:ring-3', // width\n 'aria-selected:ring-4',\n 'focus-visible:ring-3',\n 'disabled:ring-0',\n\n // Focus ring + animation\n 'focus-visible:outline-none',\n\n // Remove any weird box-shadow\n '[box-shadow:none] focus:[box-shadow:none]',\n\n // aria-invalid border color\n 'aria-invalid:border-error',\n ],\n },\n\n textAlign: {\n [`${ButtonTextAlign.LEFT}`]: 'justify-start text-left',\n [`${ButtonTextAlign.CENTER}`]: 'justify-center text-center',\n [`${ButtonTextAlign.RIGHT}`]: 'justify-end text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n variant: `${ButtonVariant.DEFAULT}`,\n size: `${ButtonSize.MD}`,\n color: `${ButtonColor.CUSTOM}`,\n roundedSize: `${ButtonRoundedSize.MD}`,\n textAlign: `${ButtonTextAlign.CENTER}`,\n isFullWidth: false,\n },\n }\n);\n\n/**\n * Enhanced Button component props with comprehensive type safety and accessibility features\n */\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Accessible label for screen readers and assistive technologies.\n * This is required for accessibility compliance.\n */\n label: string | null;\n\n /**\n * Optional icon to display on the left side of the button\n */\n Icon?: FC | LucideIcon;\n\n /**\n * Optional icon to display on the right side of the button\n */\n IconRight?: FC | LucideIcon;\n\n /**\n * Additional CSS classes for icon styling\n */\n iconClassName?: string;\n\n /**\n * Shows loading spinner and disables button interaction when true\n */\n isLoading?: boolean;\n\n /**\n * Marks the button as active (useful for navigation or toggle states)\n */\n isActive?: boolean;\n\n /**\n * Marks the button as selected\n */\n isSelected?: boolean;\n\n /**\n * Makes the button span the full width of its container\n */\n isFullWidth?: boolean;\n\n /**\n * Additional description for complex buttons (optional)\n */\n 'aria-describedby'?: string;\n\n /**\n * Expanded state for collapsible sections (optional)\n */\n 'aria-expanded'?: boolean;\n\n /**\n * Controls whether the button has popup/menu (optional)\n */\n 'aria-haspopup'?:\n | boolean\n | 'true'\n | 'false'\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog';\n\n /**\n * Indicates if button controls are currently pressed (for toggle buttons)\n */\n 'aria-pressed'?: boolean;\n };\n\n/**\n * Button Component - A comprehensive, accessible button component\n *\n * Features:\n * - Full accessibility compliance with ARIA attributes\n * - Multiple variants and sizes for different use cases\n * - Icon support (left and right positioning)\n * - Loading states with spinner\n * - Keyboard navigation support\n * - Focus management with visible indicators\n * - Responsive design adaptations\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button label=\"Click me\">Click me</Button>\n *\n * // Button with icon and loading state\n * <Button\n * label=\"Save document\"\n * Icon={SaveIcon}\n * isLoading={saving}\n * disabled={!hasChanges}\n * >\n * Save\n * </Button>\n *\n * // Destructive action button\n * <Button\n * variant={`${ButtonVariant.OUTLINE}`}\n * color={ButtonColor.DESTRUCTIVE}\n * label=\"Delete item permanently\"\n * aria-describedby=\"delete-warning\"\n * >\n * Delete\n * </Button>\n * ```\n */\nexport const Button: FC<ButtonProps> = ({\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading = false,\n isActive,\n isSelected,\n isFullWidth,\n roundedSize,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-pressed': ariaPressed,\n ...props\n}) => {\n const isLink =\n variant === `${ButtonVariant.LINK}` ||\n variant === `${ButtonVariant.INVISIBLE_LINK}`;\n const isIconOnly = !children && (Icon || IconRight);\n\n const accessibilityProps = {\n 'aria-label': isIconOnly ? (label ?? undefined) : undefined,\n 'aria-labelledby': !isIconOnly ? undefined : undefined,\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-pressed': isActive !== undefined ? isActive : ariaPressed,\n 'aria-busy': isLoading,\n 'aria-current': (isActive ? 'page' : undefined) as 'page' | undefined,\n 'aria-disabled': disabled || isLoading,\n 'aria-selected': isSelected,\n };\n\n const isSquareButton =\n size === ButtonSize.ICON_SM ||\n size === ButtonSize.ICON_MD ||\n size === ButtonSize.ICON_LG ||\n size === ButtonSize.ICON_XL;\n\n return (\n <button\n disabled={isLoading || disabled}\n role={isLink ? 'link' : 'button'}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n roundedSize,\n textAlign:\n textAlign ??\n (IconRight ? ButtonTextAlign.LEFT : ButtonTextAlign.CENTER),\n className,\n })}\n {...accessibilityProps}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: cn(!isSquareButton && 'mr-3', iconClassName),\n })}\n aria-hidden=\"true\"\n />\n )}\n\n <div\n className={cn(\n 'flex w-0 items-center justify-center transition-[width] duration-300',\n isLoading && size === ButtonSize.SM && 'w-3',\n isLoading && size === ButtonSize.MD && 'w-4',\n isLoading && size === ButtonSize.LG && 'w-5',\n isLoading && size === ButtonSize.XL && 'w-6'\n )}\n >\n <Loader\n className={buttonIconVariants({\n size,\n className: cn(!isSquareButton && 'mr-3', iconClassName),\n })}\n isLoading={isLoading}\n aria-hidden=\"true\"\n data-testid=\"loader\"\n />\n </div>\n\n {children && (\n <span className=\"flex-1 truncate whitespace-nowrap\">{children}</span>\n )}\n\n {!children && isIconOnly && <span className=\"sr-only\">{label}</span>}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: cn(!isSquareButton && 'ml-3', iconClassName),\n })}\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n};\n"],"mappings":";;;;;;;;;;AAUA,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,MAAM,qBAAqB,IAAI,sBAAsB;CACnD,UAAU,EACR,MAAM;GACH,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,YAAY;GAC1B,GAAG,WAAW,YAAY;GAC1B,GAAG,WAAW,YAAY;GAC1B,GAAG,WAAW,YAAY;EAC5B,EACF;CACD,iBAAiB,EACf,MAAM,WAAW,IAClB;CACF,CAAC;;;;AAKF,IAAY,0DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMF,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMF,IAAY,8DAAL;AACL;AACA;AACA;;;;;;AAMF,MAAa,iBAAiB,IAC5B,8LACA;CACE,UAAU;EACR,MAAM;IACH,GAAG,WAAW,OAAO;IACrB,GAAG,WAAW,OAAO;IACrB,GAAG,WAAW,OAAO;IACrB,GAAG,WAAW,OAAO;IACrB,GAAG,WAAW,YAAY;IAC1B,GAAG,WAAW,YAAY;IAC1B,GAAG,WAAW,YAAY;IAC1B,GAAG,WAAW,YAAY;GAC5B;EACD,OAAO;IACJ,GAAG,YAAY,YACd;IACD,GAAG,YAAY,cACd;IACD,GAAG,YAAY,gBACd;IACD,GAAG,YAAY,YACd;IACD,GAAG,YAAY,SACd;IACD,GAAG,YAAY,UACd;IACD,GAAG,YAAY,SACd;IACD,GAA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ACC,WAAW,mBAAmB;KAC5B;KACA,WAAW,GAAG,CAAC,kBAAkB,QAAQ,cAAc;KACxD,CAAC;IACF,eAAY;KACZ;;GAEG"}
1
+ {"version":3,"file":"Button.mjs","names":["ButtonRoundedSize","Button: FC<ButtonProps>"],"sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport type { ButtonHTMLAttributes, DetailedHTMLProps, FC } from 'react';\nimport { cn } from '../../utils/cn';\nimport { ContainerRoundedSize as ButtonRoundedSize } from '../Container';\nimport { Loader } from '../Loader';\n\n/**\n * Button size variants for different use cases\n */\nexport enum ButtonSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n ICON_SM = 'icon-sm',\n ICON_MD = 'icon-md',\n ICON_LG = 'icon-lg',\n ICON_XL = 'icon-xl',\n}\n\nconst buttonIconVariants = cva('flex-none shrink-0', {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'size-3',\n [`${ButtonSize.MD}`]: 'size-4',\n [`${ButtonSize.LG}`]: 'size-5',\n [`${ButtonSize.XL}`]: 'size-6',\n [`${ButtonSize.ICON_SM}`]: 'size-3',\n [`${ButtonSize.ICON_MD}`]: 'size-4',\n [`${ButtonSize.ICON_LG}`]: 'size-4',\n [`${ButtonSize.ICON_XL}`]: 'size-5',\n },\n },\n defaultVariants: {\n size: ButtonSize.MD,\n },\n});\n\n/**\n * Button visual style variants\n */\nexport enum ButtonVariant {\n DEFAULT = 'default',\n NONE = 'none',\n OUTLINE = 'outline',\n LINK = 'link',\n INVISIBLE_LINK = 'invisible-link',\n HOVERABLE = 'hoverable',\n FADE = 'fade',\n INPUT = 'input',\n}\n\n/**\n * Button color themes that work with the design system\n */\nexport enum ButtonColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n CARD = 'card',\n TEXT_INVERSE = 'text-inverse',\n CURRENT = 'current',\n ERROR = 'error',\n SUCCESS = 'success',\n CUSTOM = 'custom',\n}\n\n/**\n * Text alignment options for button content\n */\nexport enum ButtonTextAlign {\n LEFT = 'left',\n CENTER = 'center',\n RIGHT = 'right',\n}\n\n/**\n * Enhanced button variants with improved accessibility and focus states\n */\nexport const buttonVariants = cva(\n 'relative inline-flex cursor-pointer items-center justify-center font-medium ring-0 transition-all duration-300 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'min-h-7 px-3 text-xs max-md:py-1',\n [`${ButtonSize.MD}`]: 'min-h-8 px-6 text-sm max-md:py-2',\n [`${ButtonSize.LG}`]: 'min-h-10 px-8 text-lg max-md:py-3',\n [`${ButtonSize.XL}`]: 'min-h-11 px-10 text-xl max-md:py-4',\n [`${ButtonSize.ICON_SM}`]: 'p-1.5',\n [`${ButtonSize.ICON_MD}`]: 'p-1.5',\n [`${ButtonSize.ICON_LG}`]: 'p-2',\n [`${ButtonSize.ICON_XL}`]: 'p-3',\n },\n color: {\n [`${ButtonColor.PRIMARY}`]:\n 'hover-primary-500/20 text-primary ring-primary-500/20 *:text-text-light',\n [`${ButtonColor.SECONDARY}`]:\n 'hover-secondary-500/20 text-secondary ring-secondary-500/20 *:text-text-light',\n [`${ButtonColor.DESTRUCTIVE}`]:\n 'hover-destructive-500/20 text-destructive ring-destructive-500/20 *:text-text-light',\n [`${ButtonColor.NEUTRAL}`]:\n 'text-neutral ring-neutral-500/5 *:text-text-light',\n [`${ButtonColor.CARD}`]:\n 'hover-card-500/20 text-card ring-card-500/20 *:text-text-light',\n [`${ButtonColor.LIGHT}`]:\n 'hover-white-500/20 text-white ring-white/20 *:text-text-light',\n [`${ButtonColor.DARK}`]:\n 'text-neutral-800 ring-text-light/50 *:text-text-light',\n [`${ButtonColor.TEXT}`]: 'text-text ring-text/20 *:text-text-opposite',\n [`${ButtonColor.CURRENT}`]:\n 'hover-current-500/10 text-current ring-current/10 *:text-text-light',\n [`${ButtonColor.TEXT_INVERSE}`]:\n 'text-text-opposite ring-text-opposite/20 *:text-text',\n [`${ButtonColor.ERROR}`]:\n 'hover-error-500/20 text-error ring-error/20 *:text-text-light',\n [`${ButtonColor.SUCCESS}`]:\n 'hover-success-500/20 text-success ring-success/20 *:text-text-light',\n [`${ButtonColor.CUSTOM}`]: '',\n },\n roundedSize: {\n [`${ButtonRoundedSize.NONE}`]: 'rounded-none',\n [`${ButtonRoundedSize.SM}`]:\n 'rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl',\n [`${ButtonRoundedSize.MD}`]:\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n [`${ButtonRoundedSize.LG}`]:\n 'rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl',\n [`${ButtonRoundedSize.XL}`]:\n 'rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl',\n [`${ButtonRoundedSize['2xl']}`]:\n 'rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]',\n [`${ButtonRoundedSize['3xl']}`]:\n 'rounded-[2.5rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[3rem]',\n [`${ButtonRoundedSize['4xl']}`]:\n 'rounded-[3rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[4rem]',\n [`${ButtonRoundedSize['5xl']}`]:\n 'rounded-[4rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[5rem]',\n [`${ButtonRoundedSize.FULL}`]: 'rounded-full',\n },\n variant: {\n [`${ButtonVariant.DEFAULT}`]: [\n 'bg-current',\n 'hover:bg-current/90',\n 'hover:ring-5',\n 'aria-selected:ring-5',\n ],\n\n [`${ButtonVariant.OUTLINE}`]: [\n 'rounded-2xl border-[1.3px] border-current bg-current/0 *:text-current!',\n 'hover:bg-current/20 focus-visible:bg-current/20',\n 'hover:ring-5 focus-visible:ring-5',\n 'aria-selected:ring-5',\n ],\n\n [`${ButtonVariant.NONE}`]:\n 'border-none bg-current/0 text-inherit hover:bg-current/0',\n\n [`${ButtonVariant.LINK}`]:\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent hover:underline',\n\n [`${ButtonVariant.INVISIBLE_LINK}`]:\n 'h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent',\n\n [`${ButtonVariant.HOVERABLE}`]:\n 'rounded-lg border-none bg-current/0 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5',\n\n [`${ButtonVariant.FADE}`]: [\n 'rounded-lg border-none bg-current/10 ring-current/5 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5',\n 'hover:ring-5 focus-visible:ring-5',\n 'aria-selected:ring-5',\n ],\n [`${ButtonVariant.INPUT}`]: [\n // base styles\n 'text-text',\n 'w-full select-text resize-none rounded-2xl text-base shadow-none outline-none supports-[corner-shape:squircle]:rounded-4xl',\n 'transition-shadow duration-100 md:text-sm',\n 'ring-0', // base ring\n 'disabled:opacity-50',\n\n 'text-text',\n 'bg-neutral-50 dark:bg-neutral-950',\n 'ring-neutral-100 dark:ring-neutral-700',\n\n // Hover ring (similar spirit to your input)\n 'hover:ring-3', // width\n 'aria-selected:ring-4',\n 'focus-visible:ring-3',\n 'disabled:ring-0',\n\n // Focus ring + animation\n 'focus-visible:outline-none',\n\n // Remove any weird box-shadow\n '[box-shadow:none] focus:[box-shadow:none]',\n\n // aria-invalid border color\n 'aria-invalid:border-error',\n ],\n },\n\n textAlign: {\n [`${ButtonTextAlign.LEFT}`]: 'justify-start text-left',\n [`${ButtonTextAlign.CENTER}`]: 'justify-center text-center',\n [`${ButtonTextAlign.RIGHT}`]: 'justify-end text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n },\n defaultVariants: {\n variant: `${ButtonVariant.DEFAULT}`,\n size: `${ButtonSize.MD}`,\n color: `${ButtonColor.CUSTOM}`,\n roundedSize: `${ButtonRoundedSize.MD}`,\n textAlign: `${ButtonTextAlign.CENTER}`,\n isFullWidth: false,\n },\n }\n);\n\n/**\n * Enhanced Button component props with comprehensive type safety and accessibility features\n */\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Accessible label for screen readers and assistive technologies.\n * This is required for accessibility compliance.\n */\n label: string | null;\n\n /**\n * Optional icon to display on the left side of the button\n */\n Icon?: FC | LucideIcon;\n\n /**\n * Optional icon to display on the right side of the button\n */\n IconRight?: FC | LucideIcon;\n\n /**\n * Additional CSS classes for icon styling\n */\n iconClassName?: string;\n\n /**\n * Shows loading spinner and disables button interaction when true\n */\n isLoading?: boolean;\n\n /**\n * Marks the button as active (useful for navigation or toggle states)\n */\n isActive?: boolean;\n\n /**\n * Marks the button as selected\n */\n isSelected?: boolean;\n\n /**\n * Makes the button span the full width of its container\n */\n isFullWidth?: boolean;\n\n /**\n * Additional description for complex buttons (optional)\n */\n 'aria-describedby'?: string;\n\n /**\n * Expanded state for collapsible sections (optional)\n */\n 'aria-expanded'?: boolean;\n\n /**\n * Controls whether the button has popup/menu (optional)\n */\n 'aria-haspopup'?:\n | boolean\n | 'true'\n | 'false'\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog';\n\n /**\n * Indicates if button controls are currently pressed (for toggle buttons)\n */\n 'aria-pressed'?: boolean;\n };\n\n/**\n * Button Component - A comprehensive, accessible button component\n *\n * Features:\n * - Full accessibility compliance with ARIA attributes\n * - Multiple variants and sizes for different use cases\n * - Icon support (left and right positioning)\n * - Loading states with spinner\n * - Keyboard navigation support\n * - Focus management with visible indicators\n * - Responsive design adaptations\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button label=\"Click me\">Click me</Button>\n *\n * // Button with icon and loading state\n * <Button\n * label=\"Save document\"\n * Icon={SaveIcon}\n * isLoading={saving}\n * disabled={!hasChanges}\n * >\n * Save\n * </Button>\n *\n * // Destructive action button\n * <Button\n * variant={`${ButtonVariant.OUTLINE}`}\n * color={ButtonColor.DESTRUCTIVE}\n * label=\"Delete item permanently\"\n * aria-describedby=\"delete-warning\"\n * >\n * Delete\n * </Button>\n * ```\n */\nexport const Button: FC<ButtonProps> = ({\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading = false,\n isActive,\n isSelected,\n isFullWidth,\n roundedSize,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-pressed': ariaPressed,\n ...props\n}) => {\n const isLink =\n variant === `${ButtonVariant.LINK}` ||\n variant === `${ButtonVariant.INVISIBLE_LINK}`;\n const isIconOnly = !children && (Icon || IconRight);\n\n const accessibilityProps = {\n 'aria-label': isIconOnly ? (label ?? undefined) : undefined,\n 'aria-labelledby': !isIconOnly ? undefined : undefined,\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-pressed': isActive !== undefined ? isActive : ariaPressed,\n 'aria-busy': isLoading,\n 'aria-current': (isActive ? 'page' : undefined) as 'page' | undefined,\n 'aria-disabled': disabled || isLoading,\n 'aria-selected': isSelected,\n };\n\n const isSquareButton =\n size === ButtonSize.ICON_SM ||\n size === ButtonSize.ICON_MD ||\n size === ButtonSize.ICON_LG ||\n size === ButtonSize.ICON_XL;\n\n return (\n <button\n disabled={isLoading || disabled}\n role={isLink ? 'link' : 'button'}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n roundedSize,\n textAlign:\n textAlign ??\n (IconRight ? ButtonTextAlign.LEFT : ButtonTextAlign.CENTER),\n className,\n })}\n {...accessibilityProps}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: cn(!isSquareButton && 'mr-3', iconClassName),\n })}\n aria-hidden=\"true\"\n />\n )}\n\n <div\n className={cn(\n 'flex w-0 items-center justify-center transition-[width] duration-300',\n isLoading && size === ButtonSize.SM && 'w-3',\n isLoading && size === ButtonSize.MD && 'w-4',\n isLoading && size === ButtonSize.LG && 'w-5',\n isLoading && size === ButtonSize.XL && 'w-6'\n )}\n >\n <Loader\n className={buttonIconVariants({\n size,\n className: cn(!isSquareButton && 'mr-3', iconClassName),\n })}\n isLoading={isLoading}\n aria-hidden=\"true\"\n data-testid=\"loader\"\n />\n </div>\n\n {children && (\n <span className=\"flex-1 truncate whitespace-nowrap\">{children}</span>\n )}\n\n {!children && isIconOnly && <span className=\"sr-only\">{label}</span>}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: cn(!isSquareButton && 'ml-3', iconClassName),\n })}\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n};\n"],"mappings":";;;;;;;;;;AAUA,IAAY,oDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGF,MAAM,qBAAqB,IAAI,sBAAsB;CACnD,UAAU,EACR,MAAM;GACH,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,OAAO;GACrB,GAAG,WAAW,YAAY;GAC1B,GAAG,WAAW,YAAY;GAC1B,GAAG,WAAW,YAAY;GAC1B,GAAG,WAAW,YAAY;EAC5B,EACF;CACD,iBAAiB,EACf,MAAM,WAAW,IAClB;CACF,CAAC;;;;AAKF,IAAY,0DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMF,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMF,IAAY,8DAAL;AACL;AACA;AACA;;;;;;AAMF,MAAa,iBAAiB,IAC5B,8LACA;CACE,UA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AGJ,oBAAC;IACC,WAAW,GACT,wEACA,aAAa,SAAS,WAAW,MAAM,OACvC,aAAa,SAAS,WAAW,MAAM,OACvC,aAAa,SAAS,WAAW,MAAM,OACvC,aAAa,SAAS,WAAW,MAAM,MACxC;cAED,oBAAC;KACC,WAAW,mBAAmB;MAC5B;MACA,WAAW,GAAG,CAAC,kBAAkB,QAAQ,cAAc;MACxD,CAAC;KACS;KACX,eAAY;KACZ,eAAY;MACZ;KACE;GAEL,YACC,oBAAC;IAAK,WAAU;IAAqC;KAAgB;GAGtE,CAAC,YAAY,cAAc,oBAAC;IAAK,WAAU;cAAW;KAAa;GAEnE,aACC,oBAAC;IACC,WAAW,mBAAmB;KAC5B;KACA,WAAW,GAAG,CAAC,kBAAkB,QAAQ,cAAc;KACxD,CAAC;IACF,eAAY;KACZ;;GAEG"}
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { MaxHeightSmoother } from "../MaxHeightSmoother/index.mjs";
5
- import { useState } from "react";
6
5
  import { ChevronRight } from "lucide-react";
6
+ import { useState } from "react";
7
7
  import { cva } from "class-variance-authority";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
 
@@ -3,8 +3,8 @@
3
3
  import { cn } from "../../utils/cn.mjs";
4
4
  import { InputVariant } from "../Input/Input.mjs";
5
5
  import { AutoSizedTextArea } from "../TextArea/AutoSizeTextArea.mjs";
6
- import { useState } from "react";
7
6
  import { Check, X } from "lucide-react";
7
+ import { useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/ContentEditor/ContentEditor.tsx
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
4
  import { Input, InputVariant } from "../Input/Input.mjs";
5
- import { useEffect, useState } from "react";
6
5
  import { Check, X } from "lucide-react";
6
+ import { useEffect, useState } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/components/ContentEditor/ContentEditorInput.tsx
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
 
3
- import { useUser } from "../../hooks/useUser/index.mjs";
4
3
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
+ import { useUser } from "../../hooks/useUser/index.mjs";
5
5
  import { AutoCompleteTextarea } from "../TextArea/AutocompleteTextArea.mjs";
6
- import { useEffect, useState } from "react";
7
6
  import { Check, X } from "lucide-react";
7
+ import { useEffect, useState } from "react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/ContentEditor/ContentEditorTextArea.tsx
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
4
- import { useEffect, useState } from "react";
5
4
  import { CopyCheckIcon, CopyIcon } from "lucide-react";
5
+ import { useEffect, useState } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useIntlayer } from "react-intlayer";
8
8
 
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { cn } from "../../utils/cn.mjs";
4
- import { useState } from "react";
5
4
  import { CopyCheck, CopyIcon } from "lucide-react";
5
+ import { useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/CopyToClipboard/index.tsx
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { SaveForm } from "../DictionaryFieldEditor/SaveForm/SaveForm.mjs";
4
4
  import { NodeWrapper } from "./NodeWrapper/index.mjs";
5
- import { useEditedContent, useFocusUnmergedDictionary } from "@intlayer/editor-react";
6
5
  import { createElement, useMemo } from "react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { useEditedContent, useFocusUnmergedDictionary } from "@intlayer/editor-react";
8
8
 
9
9
  //#region src/components/DictionaryEditor/DictionaryEditor.tsx
10
10
  const DictionaryEditor = ({ dictionary, mode, onDelete, ...props }) => {
@@ -1,7 +1,7 @@
1
1
  import { StringWrapper } from "./StringWrapper.mjs";
2
- import { useEditedContent } from "@intlayer/editor-react";
3
2
  import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { getContentNodeByKeyPath } from "@intlayer/core";
4
+ import { useEditedContent } from "@intlayer/editor-react";
5
5
  import { NodeType } from "@intlayer/types";
6
6
 
7
7
  //#region src/components/DictionaryEditor/NodeWrapper/FileWrapper.tsx
@@ -1,8 +1,8 @@
1
1
  import { cn } from "../../../utils/cn.mjs";
2
2
  import { EditableFieldTextArea } from "../../EditableField/EditableFieldTextArea.mjs";
3
- import { useEditorLocale } from "@intlayer/editor-react";
4
3
  import { Fragment, jsx } from "react/jsx-runtime";
5
4
  import { getContentNodeByKeyPath } from "@intlayer/core";
5
+ import { useEditorLocale } from "@intlayer/editor-react";
6
6
 
7
7
  //#region src/components/DictionaryEditor/NodeWrapper/StringWrapper.tsx
8
8
  const StringWrapper = ({ keyPath, section, editedContent, editedContentValue: editedContentValueProp, onContentChange, onFocusKeyPath, renderSection }) => {
@@ -9,10 +9,10 @@ import { InsertionWrapper } from "./InsertionWrapper.mjs";
9
9
  import { MarkdownWrapper } from "./MarkdownWrapper.mjs";
10
10
  import { NestedObjectWrapper } from "./NestedObjectWrapper.mjs";
11
11
  import { TranslationWrapper } from "./TranslationWrapper.mjs";
12
- import { useEditorLocale } from "@intlayer/editor-react";
13
12
  import { memo, useMemo } from "react";
14
13
  import { jsx } from "react/jsx-runtime";
15
14
  import { getContentNodeByKeyPath, getNodeType } from "@intlayer/core";
15
+ import { useEditorLocale } from "@intlayer/editor-react";
16
16
  import { NodeType } from "@intlayer/types";
17
17
 
18
18
  //#region src/components/DictionaryEditor/NodeWrapper/index.tsx
@@ -6,10 +6,10 @@ import { TextEditorContainer } from "./ContentEditorView/TextEditor.mjs";
6
6
  import { getIsEditableSection } from "./getIsEditableSection.mjs";
7
7
  import { KeyPathBreadcrumb } from "./KeyPathBreadcrumb.mjs";
8
8
  import { NavigationViewNode } from "./NavigationView/NavigationViewNode.mjs";
9
- import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
10
9
  import { useEffect } from "react";
11
10
  import { jsx, jsxs } from "react/jsx-runtime";
12
11
  import { getContentNodeByKeyPath } from "@intlayer/core";
12
+ import { useEditedContent, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
13
13
 
14
14
  //#region src/components/DictionaryFieldEditor/ContentEditor.tsx
15
15
  const ContentEditor = ({ dictionary, isDarkMode }) => {
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
 
3
- import { useAuditContentDeclarationField } from "../../../hooks/reactQuery.mjs";
4
3
  import { Container } from "../../Container/index.mjs";
5
4
  import { Button, ButtonColor, ButtonSize, ButtonTextAlign, ButtonVariant } from "../../Button/Button.mjs";
6
5
  import { InputVariant } from "../../Input/Input.mjs";
6
+ import { useAuditContentDeclarationField } from "../../../hooks/reactQuery.mjs";
7
7
  import { Label } from "../../Label/index.mjs";
8
8
  import { SwitchSelector, SwitchSelectorColor, SwitchSelectorSize } from "../../SwitchSelector/index.mjs";
9
9
  import { useLocaleSwitcherContent } from "../../LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";
@@ -12,12 +12,12 @@ import { ContentEditorInput as ContentEditorInput$1 } from "../../ContentEditor/
12
12
  import { ContentEditorTextArea as ContentEditorTextArea$1 } from "../../ContentEditor/ContentEditorTextArea.mjs";
13
13
  import { MarkdownRenderer } from "../../MarkDownRender/MarkDownRender.mjs";
14
14
  import { EnumKeyInput } from "../EnumKeyInput.mjs";
15
- import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
16
- import { Fragment, useState } from "react";
17
15
  import { Plus, Trash, WandSparkles } from "lucide-react";
16
+ import { Fragment, useState } from "react";
18
17
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
19
18
  import { getEmptyNode, getLocaleName, getNodeType } from "@intlayer/core";
20
19
  import { useIntlayer, useLocale } from "react-intlayer";
20
+ import { useConfiguration, useEditedContent } from "@intlayer/editor-react";
21
21
  import { NodeType } from "@intlayer/types";
22
22
 
23
23
  //#region src/components/DictionaryFieldEditor/ContentEditorView/TextEditor.tsx
@@ -145,41 +145,50 @@ const EnumerationTextEditor = ({ section, keyPath, dictionary, renderSection })
145
145
  return /* @__PURE__ */ jsxs(Fragment, { children: [
146
146
  /* @__PURE__ */ jsx("tr", {
147
147
  className: "mt-2 w-full",
148
- children: /* @__PURE__ */ jsx("div", {
149
- className: "flex flex-1",
150
- children: /* @__PURE__ */ jsx(Button, {
151
- label: removeEnumeration.label.value,
152
- variant: ButtonVariant.HOVERABLE,
153
- color: ButtonColor.TEXT,
154
- Icon: Trash,
155
- className: "ml-auto",
156
- onClick: () => addEditedContent(dictionary.localId, void 0, childrenKeyPath),
157
- children: removeEnumeration.text
148
+ children: /* @__PURE__ */ jsx("td", {
149
+ className: "w-full",
150
+ children: /* @__PURE__ */ jsx("div", {
151
+ className: "flex flex-1",
152
+ children: /* @__PURE__ */ jsx(Button, {
153
+ label: removeEnumeration.label.value,
154
+ variant: ButtonVariant.HOVERABLE,
155
+ color: ButtonColor.TEXT,
156
+ Icon: Trash,
157
+ className: "ml-auto",
158
+ onClick: () => addEditedContent(dictionary.localId, void 0, childrenKeyPath),
159
+ children: removeEnumeration.text
160
+ })
158
161
  })
159
162
  })
160
163
  }),
161
164
  /* @__PURE__ */ jsx("tr", {
162
165
  className: "w-full p-2",
163
- children: /* @__PURE__ */ jsx(EnumKeyInput, {
164
- value: enumKey,
165
- onChange: (value) => {
166
- const preValueContent = section[NodeType.Enumeration];
167
- const newValueContent = renameKey(preValueContent, enumKey, value);
168
- const newValue = {
169
- ...section,
170
- [NodeType.Enumeration]: newValueContent
171
- };
172
- addEditedContent(dictionary.localId, newValue, keyPath);
173
- }
166
+ children: /* @__PURE__ */ jsx("td", {
167
+ className: "w-full",
168
+ children: /* @__PURE__ */ jsx(EnumKeyInput, {
169
+ value: enumKey,
170
+ onChange: (value) => {
171
+ const preValueContent = section[NodeType.Enumeration];
172
+ const newValueContent = renameKey(preValueContent, enumKey, value);
173
+ const newValue = {
174
+ ...section,
175
+ [NodeType.Enumeration]: newValueContent
176
+ };
177
+ addEditedContent(dictionary.localId, newValue, keyPath);
178
+ }
179
+ })
174
180
  })
175
181
  }),
176
182
  /* @__PURE__ */ jsx("tr", {
177
183
  className: "block w-full",
178
- children: /* @__PURE__ */ jsx(TextEditor, {
179
- section: content[enumKey] ?? getEmptyNode(content[firstKey]),
180
- keyPath: childrenKeyPath,
181
- dictionary,
182
- renderSection
184
+ children: /* @__PURE__ */ jsx("td", {
185
+ className: "w-full",
186
+ children: /* @__PURE__ */ jsx(TextEditor, {
187
+ section: content[enumKey] ?? getEmptyNode(content[firstKey]),
188
+ keyPath: childrenKeyPath,
189
+ dictionary,
190
+ renderSection
191
+ })
183
192
  })
184
193
  })
185
194
  ] }, enumKey);
@@ -219,14 +228,17 @@ const ConditionTextEditor = ({ section, keyPath, dictionary, renderSection }) =>
219
228
  })
220
229
  }, condKey), /* @__PURE__ */ jsx("tr", {
221
230
  className: "block w-full",
222
- children: /* @__PURE__ */ jsx(TextEditorContainer, {
223
- section: content[condKey] ?? getEmptyNode(content.true),
224
- keyPath: [...keyPath, {
225
- type: NodeType.Condition,
226
- key: condKey
227
- }],
228
- dictionary,
229
- renderSection
231
+ children: /* @__PURE__ */ jsx("td", {
232
+ className: "w-full",
233
+ children: /* @__PURE__ */ jsx(TextEditorContainer, {
234
+ section: content[condKey] ?? getEmptyNode(content.true),
235
+ keyPath: [...keyPath, {
236
+ type: NodeType.Condition,
237
+ key: condKey
238
+ }],
239
+ dictionary,
240
+ renderSection
241
+ })
230
242
  })
231
243
  }, condKey)] }, condKey))
232
244
  })
@@ -250,14 +262,17 @@ const GenderTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
250
262
  })
251
263
  }, condKey), /* @__PURE__ */ jsx("tr", {
252
264
  className: "block w-full",
253
- children: /* @__PURE__ */ jsx(TextEditorContainer, {
254
- section: content[condKey] ?? getEmptyNode(content.male),
255
- keyPath: [...keyPath, {
256
- type: NodeType.Gender,
257
- key: condKey
258
- }],
259
- dictionary,
260
- renderSection
265
+ children: /* @__PURE__ */ jsx("td", {
266
+ className: "w-full",
267
+ children: /* @__PURE__ */ jsx(TextEditorContainer, {
268
+ section: content[condKey] ?? getEmptyNode(content.male),
269
+ keyPath: [...keyPath, {
270
+ type: NodeType.Gender,
271
+ key: condKey
272
+ }],
273
+ dictionary,
274
+ renderSection
275
+ })
261
276
  })
262
277
  }, condKey)] }, condKey))
263
278
  })
@@ -272,37 +287,46 @@ const ArrayTextEditor = ({ section, keyPath, dictionary, renderSection }) => {
272
287
  className: "w-full",
273
288
  children: /* @__PURE__ */ jsx("tbody", {
274
289
  className: "flex w-full flex-col gap-2",
275
- children: section.map((subSection, index) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("tr", {
276
- className: "mt-2 flex w-full items-center justify-between gap-2 p-2",
277
- children: [/* @__PURE__ */ jsx("span", {
278
- className: "text-xs",
279
- children: String(index)
280
- }), /* @__PURE__ */ jsx(Button, {
281
- label: removeElement.label.value,
282
- variant: ButtonVariant.HOVERABLE,
283
- color: ButtonColor.NEUTRAL,
284
- className: "ml-auto",
285
- textAlign: ButtonTextAlign.LEFT,
286
- onClick: () => {
287
- const newKeyPath = [...keyPath, {
288
- type: NodeType.Array,
289
- key: section.length
290
- }];
291
- addEditedContent(dictionary.localId, void 0, newKeyPath);
292
- },
293
- Icon: Trash,
294
- children: removeElement.text
295
- })]
290
+ children: section.map((subSection, index) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("tr", {
291
+ className: "mt-2 w-full p-2",
292
+ children: /* @__PURE__ */ jsx("td", {
293
+ className: "w-full",
294
+ children: /* @__PURE__ */ jsxs("div", {
295
+ className: "flex w-full items-center justify-between gap-2",
296
+ children: [/* @__PURE__ */ jsx("span", {
297
+ className: "text-xs",
298
+ children: String(index)
299
+ }), /* @__PURE__ */ jsx(Button, {
300
+ label: removeElement.label.value,
301
+ variant: ButtonVariant.HOVERABLE,
302
+ color: ButtonColor.NEUTRAL,
303
+ className: "ml-auto",
304
+ textAlign: ButtonTextAlign.LEFT,
305
+ onClick: () => {
306
+ const newKeyPath = [...keyPath, {
307
+ type: NodeType.Array,
308
+ key: section.length
309
+ }];
310
+ addEditedContent(dictionary.localId, void 0, newKeyPath);
311
+ },
312
+ Icon: Trash,
313
+ children: removeElement.text
314
+ })]
315
+ })
316
+ })
296
317
  }), /* @__PURE__ */ jsx("tr", {
297
318
  className: "block w-full",
298
- children: /* @__PURE__ */ jsx(TextEditorContainer, {
299
- section: subSection ?? getEmptyNode(section[0]),
300
- keyPath: [...keyPath, {
301
- type: NodeType.Array,
302
- key: index
303
- }],
304
- dictionary,
305
- renderSection
319
+ children: /* @__PURE__ */ jsx("td", {
320
+ className: "w-full",
321
+ children: /* @__PURE__ */ jsx(TextEditorContainer, {
322
+ section: subSection ?? getEmptyNode(section[0]),
323
+ keyPath: [...keyPath, {
324
+ type: NodeType.Array,
325
+ key: index
326
+ }],
327
+ dictionary,
328
+ renderSection
329
+ })
306
330
  })
307
331
  })] }, JSON.stringify(subSection)))
308
332
  })
@@ -344,11 +368,14 @@ const ObjectTextEditor = ({ section, keyPath, dictionary, renderSection }) => /*
344
368
  })
345
369
  }, JSON.stringify(subSection)), /* @__PURE__ */ jsx("tr", {
346
370
  className: "block w-full",
347
- children: /* @__PURE__ */ jsx(TextEditor, {
348
- section: subSection,
349
- keyPath: childKeyPath,
350
- dictionary,
351
- renderSection
371
+ children: /* @__PURE__ */ jsx("td", {
372
+ className: "w-full",
373
+ children: /* @__PURE__ */ jsx(TextEditor, {
374
+ section: subSection,
375
+ keyPath: childKeyPath,
376
+ dictionary,
377
+ renderSection
378
+ })
352
379
  })
353
380
  }, JSON.stringify(subSection))] }, key);
354
381
  })
@@ -459,10 +486,13 @@ const NestedTextEditor = ({ keyPath, dictionary, renderSection, section, ...prop
459
486
  const TextEditor = ({ section, keyPath, dictionary, renderSection, isDarkMode }) => {
460
487
  const { tsxNotEditable } = useIntlayer("navigation-view");
461
488
  const nodeType = getNodeType(section);
462
- if (nodeType === NodeType.ReactNode) return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", { children: "[React Node]" }), /* @__PURE__ */ jsx("span", {
463
- className: "text-neutral text-xs",
464
- children: tsxNotEditable
465
- })] });
489
+ if (nodeType === NodeType.ReactNode) return /* @__PURE__ */ jsxs("div", {
490
+ className: "flex w-full flex-col gap-2",
491
+ children: [/* @__PURE__ */ jsx("span", { children: "(React Node)" }), /* @__PURE__ */ jsx("span", {
492
+ className: "flex text-neutral text-xs",
493
+ children: tsxNotEditable
494
+ })]
495
+ });
466
496
  if (nodeType === NodeType.Nested) return /* @__PURE__ */ jsx(NestedTextEditor, {
467
497
  dictionary,
468
498
  renderSection,