@intlayer/design-system 8.2.3 → 8.3.0-canary.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 (209) 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 +1 -1
  4. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  5. package/dist/esm/components/Browser/Browser.mjs +1 -1
  6. package/dist/esm/components/Carousel/index.mjs +4 -4
  7. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
  8. package/dist/esm/components/ContentEditor/ContentEditor.mjs +1 -1
  9. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +1 -1
  10. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
  11. package/dist/esm/components/CopyButton/index.mjs +1 -1
  12. package/dist/esm/components/CopyToClipboard/index.mjs +1 -1
  13. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  14. package/dist/esm/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs +1 -1
  15. package/dist/esm/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs.map +1 -1
  16. package/dist/esm/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs +1 -1
  17. package/dist/esm/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs.map +1 -1
  18. package/dist/esm/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs +1 -1
  19. package/dist/esm/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs.map +1 -1
  20. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs +1 -1
  21. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs.map +1 -1
  22. package/dist/esm/components/DictionaryEditor/NodeWrapper/HtmlWrapper.mjs +1 -1
  23. package/dist/esm/components/DictionaryEditor/NodeWrapper/HtmlWrapper.mjs.map +1 -1
  24. package/dist/esm/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs +1 -1
  25. package/dist/esm/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs.map +1 -1
  26. package/dist/esm/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs +1 -1
  27. package/dist/esm/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs.map +1 -1
  28. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
  29. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
  30. package/dist/esm/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs +1 -1
  31. package/dist/esm/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs.map +1 -1
  32. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
  33. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs.map +1 -1
  34. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  35. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
  36. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  37. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
  38. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  39. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
  40. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  41. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  43. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
  44. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  45. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs +1 -1
  46. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  47. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +1 -1
  48. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  49. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  50. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  51. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  52. package/dist/esm/components/DictionaryFieldEditor/getIsEditableSection.mjs +1 -1
  53. package/dist/esm/components/DictionaryFieldEditor/getIsEditableSection.mjs.map +1 -1
  54. package/dist/esm/components/EditableField/EditableFieldLayout.mjs +1 -1
  55. package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs +1 -1
  56. package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  57. package/dist/esm/components/Flags/Flag.mjs +1 -1
  58. package/dist/esm/components/Flags/Flag.mjs.map +1 -1
  59. package/dist/esm/components/HTMLRender/HTMLRender.mjs.map +1 -1
  60. package/dist/esm/components/HideShow/index.mjs +1 -1
  61. package/dist/esm/components/IDE/CodeBlockClient.mjs.map +1 -1
  62. package/dist/esm/components/IDE/CodeBlockShiki.mjs +1 -1
  63. package/dist/esm/components/IDE/CodeBlockShiki.mjs.map +1 -1
  64. package/dist/esm/components/IDE/FileTree.mjs +1 -1
  65. package/dist/esm/components/Input/Input.mjs +1 -1
  66. package/dist/esm/components/Input/Input.mjs.map +1 -1
  67. package/dist/esm/components/Input/InputPassword.mjs +1 -1
  68. package/dist/esm/components/Input/OTPInput.mjs +2 -2
  69. package/dist/esm/components/Label/index.mjs +1 -1
  70. package/dist/esm/components/Label/index.mjs.map +1 -1
  71. package/dist/esm/components/LanguageBackground/index.mjs +1 -1
  72. package/dist/esm/components/LanguageBackground/index.mjs.map +1 -1
  73. package/dist/esm/components/Link/Link.mjs +1 -1
  74. package/dist/esm/components/Link/Link.mjs.map +1 -1
  75. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  76. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  77. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  78. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  79. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
  80. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  81. package/dist/esm/components/MarkDownRender/index.mjs +1 -1
  82. package/dist/esm/components/MaxHeightSmoother/index.mjs +1 -1
  83. package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
  84. package/dist/esm/components/Modal/Modal.mjs +1 -1
  85. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  86. package/dist/esm/components/RightDrawer/RightDrawer.mjs +1 -1
  87. package/dist/esm/components/Select/Multiselect.mjs +1 -1
  88. package/dist/esm/components/Select/Select.mjs +1 -1
  89. package/dist/esm/components/Select/Select.mjs.map +1 -1
  90. package/dist/esm/components/Table/Table.mjs +1 -1
  91. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  92. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +1 -1
  93. package/dist/esm/components/Toaster/Toast.mjs +1 -1
  94. package/dist/esm/components/index.mjs +1 -1
  95. package/dist/esm/hooks/index.mjs +1 -1
  96. package/dist/esm/hooks/reactQuery.mjs +1 -1
  97. package/dist/esm/hooks/reactQuery.mjs.map +1 -1
  98. package/dist/esm/hooks/useAuth/useAuth.mjs.map +1 -1
  99. package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
  100. package/dist/esm/hooks/useAuth/useOAuth2.mjs.map +1 -1
  101. package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
  102. package/dist/esm/hooks/useAuth/useSession.mjs.map +1 -1
  103. package/dist/esm/hooks/useIntlayerAPI.mjs.map +1 -1
  104. package/dist/esm/libs/auth.mjs +1 -1
  105. package/dist/esm/libs/auth.mjs.map +1 -1
  106. package/dist/esm/providers/ReactQueryProvider.mjs +1 -1
  107. package/dist/types/components/Badge/index.d.ts +1 -1
  108. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +3 -3
  109. package/dist/types/components/Breadcrumb/index.d.ts +1 -1
  110. package/dist/types/components/Browser/Browser.content.d.ts +17 -17
  111. package/dist/types/components/Button/Button.d.ts +3 -3
  112. package/dist/types/components/Carousel/index.content.d.ts +7 -7
  113. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +2 -2
  114. package/dist/types/components/Command/index.d.ts +1 -1
  115. package/dist/types/components/Container/index.d.ts +5 -5
  116. package/dist/types/components/CopyButton/CopyButton.content.d.ts +3 -3
  117. package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts +2 -1
  118. package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  119. package/dist/types/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts +1 -1
  120. package/dist/types/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts.map +1 -1
  121. package/dist/types/components/DictionaryEditor/NodeWrapper/ConditionWrapper.d.ts +1 -1
  122. package/dist/types/components/DictionaryEditor/NodeWrapper/ConditionWrapper.d.ts.map +1 -1
  123. package/dist/types/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts +1 -1
  124. package/dist/types/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts.map +1 -1
  125. package/dist/types/components/DictionaryEditor/NodeWrapper/FileWrapper.d.ts.map +1 -1
  126. package/dist/types/components/DictionaryEditor/NodeWrapper/HtmlWrapper.d.ts +1 -1
  127. package/dist/types/components/DictionaryEditor/NodeWrapper/HtmlWrapper.d.ts.map +1 -1
  128. package/dist/types/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts +1 -1
  129. package/dist/types/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts.map +1 -1
  130. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts +1 -1
  131. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts.map +1 -1
  132. package/dist/types/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts +1 -1
  133. package/dist/types/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
  134. package/dist/types/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts +1 -1
  135. package/dist/types/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts.map +1 -1
  136. package/dist/types/components/DictionaryEditor/NodeWrapper/index.d.ts +3 -1
  137. package/dist/types/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
  138. package/dist/types/components/DictionaryFieldEditor/ContentEditor.d.ts +1 -1
  139. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +2 -1
  140. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  141. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +25 -25
  142. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -9
  143. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +1 -1
  144. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +55 -55
  145. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +33 -33
  146. package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -1
  147. package/dist/types/components/DictionaryFieldEditor/JSONEditor.d.ts +1 -1
  148. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts +2 -1
  149. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts.map +1 -1
  150. package/dist/types/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts +4 -4
  151. package/dist/types/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  152. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -25
  153. package/dist/types/components/DictionaryFieldEditor/NodeTypeSelector.d.ts +2 -1
  154. package/dist/types/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  155. package/dist/types/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +1 -1
  156. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +33 -33
  157. package/dist/types/components/DictionaryFieldEditor/StructureEditor.d.ts +1 -1
  158. package/dist/types/components/DictionaryFieldEditor/StructureView/StructureView.d.ts +2 -1
  159. package/dist/types/components/DictionaryFieldEditor/StructureView/StructureView.d.ts.map +1 -1
  160. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -9
  161. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -7
  162. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +5 -5
  163. package/dist/types/components/DictionaryFieldEditor/getIsEditableSection.d.ts +1 -1
  164. package/dist/types/components/DictionaryFieldEditor/getIsEditableSection.d.ts.map +1 -1
  165. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +31 -31
  166. package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +3 -3
  167. package/dist/types/components/Flags/Flag.d.ts +1 -1
  168. package/dist/types/components/Flags/Flag.d.ts.map +1 -1
  169. package/dist/types/components/HTMLRender/HTMLRender.d.ts +1 -1
  170. package/dist/types/components/IDE/CodeBlockClient.d.ts +2 -2
  171. package/dist/types/components/IDE/CodeBlockClient.d.ts.map +1 -1
  172. package/dist/types/components/IDE/CodeBlockShiki.d.ts.map +1 -1
  173. package/dist/types/components/IDE/code.content.d.ts +5 -5
  174. package/dist/types/components/IDE/copyCode.content.d.ts +5 -5
  175. package/dist/types/components/IDE/index.d.ts +2 -2
  176. package/dist/types/components/IDE/selectors.content.d.ts +13 -13
  177. package/dist/types/components/Input/Checkbox.d.ts +1 -1
  178. package/dist/types/components/LanguageBackground/index.d.ts.map +1 -1
  179. package/dist/types/components/Link/Link.d.ts +4 -4
  180. package/dist/types/components/Loader/index.content.d.ts +3 -3
  181. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
  182. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -17
  183. package/dist/types/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts +1 -1
  184. package/dist/types/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
  185. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -13
  186. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts +143 -15
  187. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  188. package/dist/types/components/MarkDownRender/index.d.ts +2 -2
  189. package/dist/types/components/Pagination/Pagination.d.ts +2 -2
  190. package/dist/types/components/Pagination/pagination.content.d.ts +11 -11
  191. package/dist/types/components/RightDrawer/rightDrawer.content.d.ts +5 -5
  192. package/dist/types/components/Select/Select.d.ts.map +1 -1
  193. package/dist/types/components/SwitchSelector/index.d.ts +1 -1
  194. package/dist/types/components/Tab/Tab.d.ts +2 -2
  195. package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
  196. package/dist/types/components/Table/table.content.d.ts +3 -3
  197. package/dist/types/components/Tag/index.d.ts +2 -2
  198. package/dist/types/components/Terminal/terminal.content.d.ts +5 -5
  199. package/dist/types/components/index.d.ts +3 -3
  200. package/dist/types/hooks/index.d.ts +3 -3
  201. package/dist/types/hooks/reactQuery.d.ts +11 -3
  202. package/dist/types/hooks/reactQuery.d.ts.map +1 -1
  203. package/dist/types/hooks/useAuth/useAuth.d.ts +1 -1
  204. package/dist/types/hooks/useAuth/useOAuth2.d.ts +1 -1
  205. package/dist/types/hooks/useAuth/useSession.d.ts +1 -1
  206. package/dist/types/hooks/useIntlayerAPI.d.ts +2 -2
  207. package/dist/types/hooks/useIntlayerAPI.d.ts.map +1 -1
  208. package/dist/types/libs/auth.d.ts +1 -1
  209. package/package.json +31 -29
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types';\nimport { cn } from '@utils/cn';\nimport type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n type RenderMarkdownProps,\n renderMarkdown,\n} from 'react-intlayer';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Table } from '../Table';\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions: (\n isDarkMode: boolean\n) => RenderMarkdownProps = (isDarkMode) => ({\n components: {\n h1: (props) => <H1 isClickable={true} className=\"text-text\" {...props} />,\n h2: (props) => (\n <H2 isClickable={true} className=\"mt-16 text-text\" {...props} />\n ),\n h3: (props) => (\n <H3 isClickable={true} className=\"mt-5 text-text\" {...props} />\n ),\n h4: (props) => (\n <H4 isClickable={true} className=\"mt-3 text-text\" {...props} />\n ),\n h5: (props) => (\n <H5 isClickable={true} className=\"mt-3 text-text\" {...props} />\n ),\n h6: (props) => (\n <H6 isClickable={true} className=\"mt-3 text-text\" {...props} />\n ),\n strong: (props) => <strong className=\"text-text\" {...props} />,\n\n code: ({ className, children, ...rest }: ComponentProps<'code'>) => {\n // Ensure children is a string (Markdown renderer might pass ReactNodes)\n const content = String(children ?? '').replace(/\\n$/, '');\n\n // Determine if it is inline code or a code block\n // Code blocks usually have a className like 'language-ts'\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <code className=\"rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm\">\n {content}\n </code>\n );\n }\n\n // Extract language from className (e.g., \"language-typescript\" -> \"typescript\")\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code\n {...rest}\n language={language}\n showHeader={true}\n isDarkMode={isDarkMode} // Ensure this variable is available in scope\n >\n {content}\n </Code>\n );\n },\n blockquote: ({ className, ...props }) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral',\n '[&_strong]:text-neutral',\n className\n )}\n {...props}\n />\n ),\n ul: ({ className, ...props }) => (\n <ul\n className={cn(\n 'mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n ),\n ol: ({ className, ...props }) => (\n <ol\n className={cn(\n 'mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n ),\n img: ({ className, ...props }) => (\n <img\n {...props}\n alt={props.alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={`${props.src}?raw=true`}\n />\n ),\n a: (props) => (\n // @ts-expect-error - label is not required in LinkProps\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n // locale={locale}\n {...props}\n />\n ),\n pre: (props) => props.children,\n\n table: (props: ComponentProps<typeof Table>) => (\n <Table isRollable={true} {...props} />\n ),\n th: ({ className, ...props }) => (\n <th\n className={cn('border-neutral border-b bg-neutral/10 p-4', className)}\n {...props}\n />\n ),\n tr: ({ className, ...props }) => (\n <tr\n className={cn('hover:/10 hover:bg-neutral/10', className)}\n {...props}\n />\n ),\n td: ({ className, ...props }) => (\n <td\n className={cn('border-neutral-500/50 border-b p-4', className)}\n {...props}\n />\n ),\n hr: ({ className, ...props }) => (\n <hr className={cn('mx-6 mt-16 text-neutral', className)} {...props} />\n ),\n Tabs: (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n ),\n Tab: Tab.Item,\n Columns: ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n ),\n Column: ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n ),\n },\n});\n\n/**\n * MarkdownRenderer Component\n *\n * A comprehensive markdown renderer that transforms markdown text into rich,\n * interactive HTML with custom styling and Intlayer integration. Supports\n * code syntax highlighting, responsive tables, internationalized links,\n * and automatic frontmatter stripping.\n *\n * @component\n */\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n const markdownOptions = getIntlayerMarkdownOptions(isDarkMode ?? false);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownOptions.components,\n // Pass dynamic props to components\n code: ({ className, children, ...rest }: ComponentProps<'code'>) => {\n // Ensure children is a string (Markdown renderer might pass ReactNodes)\n const content = String(children ?? '').replace(/\\n$/, '');\n\n // Determine if it is inline code or a code block\n // Code blocks usually have a className like 'language-ts'\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <code className=\"rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm\">\n {content}\n </code>\n );\n }\n\n // Extract language from className (e.g., \"language-typescript\" -> \"typescript\")\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code\n {...rest}\n language={language}\n showHeader={true}\n isDarkMode={isDarkMode} // Ensure this variable is available in scope\n >\n {content}\n </Code>\n );\n },\n\n a: (props) => (\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined={true}\n locale={locale}\n label=\"\"\n {...props}\n color=\"text\"\n />\n ),\n ...componentsProp,\n },\n wrapper: wrapper ?? markdownOptions.wrapper,\n forceBlock: forceBlock ?? markdownOptions.forceBlock,\n preserveFrontmatter:\n preserveFrontmatter ?? markdownOptions.preserveFrontmatter,\n tagfilter: tagfilter ?? markdownOptions.tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":"2dA4BA,MAAa,EAEe,IAAgB,CAC1C,WAAY,CACV,GAAK,GAAU,EAAC,EAAD,CAAI,YAAa,GAAM,UAAU,YAAY,GAAI,EAAS,CAAA,CACzE,GAAK,GACH,EAAC,EAAD,CAAI,YAAa,GAAM,UAAU,kBAAkB,GAAI,EAAS,CAAA,CAElE,GAAK,GACH,EAAC,EAAD,CAAI,YAAa,GAAM,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAEjE,GAAK,GACH,EAAC,EAAD,CAAI,YAAa,GAAM,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAEjE,GAAK,GACH,EAAC,EAAD,CAAI,YAAa,GAAM,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAEjE,GAAK,GACH,EAAC,EAAD,CAAI,YAAa,GAAM,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAEjE,OAAS,GAAU,EAAC,SAAD,CAAQ,UAAU,YAAY,GAAI,EAAS,CAAA,CAE9D,MAAO,CAAE,YAAW,WAAU,GAAG,KAAmC,CAElE,IAAM,EAAU,OAAO,GAAY,GAAG,CAAC,QAAQ,MAAO,GAAG,CAMzD,GAAI,CAFc,EAGhB,OACE,EAAC,OAAD,CAAM,UAAU,+GACb,EACI,CAAA,CAKX,IAAM,EAAY,GAAW,QAAQ,iBAAkB,GAAG,EACxD,YAEF,OACE,EAAC,EAAD,CACE,GAAI,EACM,WACV,WAAY,GACA,sBAEX,EACI,CAAA,EAGX,YAAa,CAAE,YAAW,GAAG,KAC3B,EAAC,aAAD,CACE,UAAW,EACT,sDACA,0BACA,EACD,CACD,GAAI,EACJ,CAAA,CAEJ,IAAK,CAAE,YAAW,GAAG,KACnB,EAAC,KAAD,CACE,UAAW,EACT,iEACA,EACD,CACD,GAAI,EACJ,CAAA,CAEJ,IAAK,CAAE,YAAW,GAAG,KACnB,EAAC,KAAD,CACE,UAAW,EACT,oEACA,EACD,CACD,GAAI,EACJ,CAAA,CAEJ,KAAM,CAAE,YAAW,GAAG,KACpB,EAAC,MAAD,CACE,GAAI,EACJ,IAAK,EAAM,KAAO,GAClB,QAAQ,OACR,UAAW,EAAG,qCAAsC,EAAU,CAC9D,IAAK,GAAG,EAAM,IAAI,WAClB,CAAA,CAEJ,EAAI,GAEF,EAAC,EAAD,CACE,eAAgB,EAAM,MAAM,WAAW,OAAO,CAC9C,WAAY,GAEZ,GAAI,EACJ,CAAA,CAEJ,IAAM,GAAU,EAAM,SAEtB,MAAQ,GACN,EAAC,EAAD,CAAO,WAAY,GAAM,GAAI,EAAS,CAAA,CAExC,IAAK,CAAE,YAAW,GAAG,KACnB,EAAC,KAAD,CACE,UAAW,EAAG,4CAA6C,EAAU,CACrE,GAAI,EACJ,CAAA,CAEJ,IAAK,CAAE,YAAW,GAAG,KACnB,EAAC,KAAD,CACE,UAAW,EAAG,gCAAiC,EAAU,CACzD,GAAI,EACJ,CAAA,CAEJ,IAAK,CAAE,YAAW,GAAG,KACnB,EAAC,KAAD,CACE,UAAW,EAAG,qCAAsC,EAAU,CAC9D,GAAI,EACJ,CAAA,CAEJ,IAAK,CAAE,YAAW,GAAG,KACnB,EAAC,KAAD,CAAI,UAAW,EAAG,0BAA2B,EAAU,CAAE,GAAI,EAAS,CAAA,CAExE,KAAO,GACL,EAAC,EAAD,CACE,GAAI,EACJ,UAAU,gCACV,gBAAgB,8EAChB,CAAA,CAEJ,IAAK,EAAI,KACT,SAAU,CAAE,YAAW,GAAG,KACxB,EAAC,MAAD,CAAK,UAAW,EAAG,6BAA8B,EAAU,CAAE,GAAI,EAAS,CAAA,CAE5E,QAAS,CAAE,YAAW,GAAG,KACvB,EAAC,MAAD,CAAK,UAAW,EAAG,SAAU,EAAU,CAAE,GAAI,EAAS,CAAA,CAEzD,CACF,EAYY,GAA+C,CAC1D,WACA,aACA,SACA,aACA,sBACA,YACA,WAAY,EACZ,aACI,CACJ,IAAM,EAAkB,EAA2B,GAAc,GAAM,CAyDvE,OACE,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAA,SAzDoB,EAAe,EAAU,CAC/C,WAAY,CACV,GAAG,EAAgB,WAEnB,MAAO,CAAE,YAAW,WAAU,GAAG,KAAmC,CAElE,IAAM,EAAU,OAAO,GAAY,GAAG,CAAC,QAAQ,MAAO,GAAG,CAMzD,GAAI,CAFc,EAGhB,OACE,EAAC,OAAD,CAAM,UAAU,+GACb,EACI,CAAA,CAKX,IAAM,EAAY,GAAW,QAAQ,iBAAkB,GAAG,EACxD,YAEF,OACE,EAAC,EAAD,CACE,GAAI,EACM,WACV,WAAY,GACA,sBAEX,EACI,CAAA,EAIX,EAAI,GACF,EAAC,EAAD,CACE,eAAgB,EAAM,MAAM,WAAW,OAAO,CAC9C,WAAY,GACJ,SACR,MAAM,GACN,GAAI,EACJ,MAAM,OACN,CAAA,CAEJ,GAAG,EACJ,CACD,QAAS,GAAW,EAAgB,QACpC,WAAY,GAAc,EAAgB,WAC1C,oBACE,GAAuB,EAAgB,oBACzC,UAAW,GAAa,EAAgB,UACzC,CAAC,CAI8C,CAAA,CAC/B,CAAA"}
1
+ {"version":3,"file":"MarkDownRender.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { cn } from '@utils/cn';\nimport {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n createContext,\n type FC,\n useContext,\n} from 'react';\nimport {\n type MarkdownRenderer as MarkdownRendererIntlayer,\n renderMarkdown,\n} from 'react-intlayer';\nimport type { BundledLanguage } from 'shiki/bundle/web';\nimport { H1, H2, H3, H4, H5, H6 } from '../Headers';\nimport { Code } from '../IDE/Code';\nimport { CodeProvider } from '../IDE/CodeContext';\nimport { Link } from '../Link';\nimport { Tab } from '../Tab';\nimport { TabProvider } from '../Tab/TabContext';\nimport { Table } from '../Table';\n\n// Context to pass dynamic variables to static components without re-creating them\ninterface MarkdownContextType {\n isDarkMode?: boolean;\n locale?: LocalesValues;\n}\nconst MarkdownContext = createContext<MarkdownContextType>({});\n\n// Extracted, stable component renderers\nconst H1Renderer = (props: ComponentProps<'h1'>) => (\n <H1 isClickable className=\"text-text\" {...props} />\n);\nconst H2Renderer = (props: ComponentProps<'h2'>) => (\n <H2 isClickable className=\"mt-16 text-text\" {...props} />\n);\nconst H3Renderer = (props: ComponentProps<'h3'>) => (\n <H3 isClickable className=\"mt-5 text-text\" {...props} />\n);\nconst H4Renderer = (props: ComponentProps<'h4'>) => (\n <H4 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H5Renderer = (props: ComponentProps<'h5'>) => (\n <H5 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst H6Renderer = (props: ComponentProps<'h6'>) => (\n <H6 isClickable className=\"mt-3 text-text\" {...props} />\n);\nconst StrongRenderer = (props: ComponentProps<'strong'>) => (\n <strong className=\"text-text\" {...props} />\n);\n\nconst CodeRenderer = ({\n className,\n children,\n ...rest\n}: ComponentProps<'code'>) => {\n const { isDarkMode } = useContext(MarkdownContext);\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n return (\n <code className=\"rounded-md border border-neutral/30 bg-card/60 box-decoration-clone px-1.5 py-0.5 font-mono text-sm\">\n {content}\n </code>\n );\n }\n\n const language = (className?.replace(/lang(?:uage)?-/, '') ||\n 'plaintext') as BundledLanguage;\n\n return (\n <Code {...rest} language={language} showHeader isDarkMode={isDarkMode}>\n {content}\n </Code>\n );\n};\n\nconst BlockquoteRenderer = ({\n className,\n ...props\n}: ComponentProps<'blockquote'>) => (\n <blockquote\n className={cn(\n 'mt-5 gap-3 border-card border-l-4 pl-5 text-neutral [&_strong]:text-neutral',\n className\n )}\n {...props}\n />\n);\n\nconst UlRenderer = ({ className, ...props }: ComponentProps<'ul'>) => (\n <ul\n className={cn(\n 'mt-5 flex list-disc flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst OlRenderer = ({ className, ...props }: ComponentProps<'ol'>) => (\n <ol\n className={cn(\n 'mt-5 flex list-decimal flex-col gap-3 pl-5 marker:text-neutral/80',\n className\n )}\n {...props}\n />\n);\n\nconst ImgRenderer = ({\n className,\n alt,\n src,\n ...props\n}: ComponentProps<'img'>) => (\n <img\n {...props}\n alt={alt ?? ''}\n loading=\"lazy\"\n className={cn('max-h-[80vh] max-w-full rounded-md', className)}\n src={`${src}?raw=true`}\n />\n);\n\nconst LinkRenderer = (props: ComponentProps<'a'>) => {\n const { locale } = useContext(MarkdownContext);\n return (\n <Link\n isExternalLink={props.href?.startsWith('http')}\n underlined\n locale={locale}\n label=\"\"\n color=\"text\"\n {...(props as any)}\n />\n );\n};\n\nconst PreRenderer = (props: ComponentProps<'pre'>) => <>{props.children}</>;\nconst TableRenderer = (props: ComponentProps<typeof Table>) => (\n <Table isRollable {...props} />\n);\nconst ThRenderer = ({ className, ...props }: ComponentProps<'th'>) => (\n <th\n className={cn('border-neutral border-b bg-neutral/10 p-4', className)}\n {...props}\n />\n);\nconst TrRenderer = ({ className, ...props }: ComponentProps<'tr'>) => (\n <tr className={cn('hover:/10 hover:bg-neutral/10', className)} {...props} />\n);\nconst TdRenderer = ({ className, ...props }: ComponentProps<'td'>) => (\n <td\n className={cn('border-neutral-500/50 border-b p-4', className)}\n {...props}\n />\n);\nconst HrRenderer = ({ className, ...props }: ComponentProps<'hr'>) => (\n <hr className={cn('mx-6 mt-16 text-neutral', className)} {...props} />\n);\n\nconst TabsRenderer = (props: ComponentProps<typeof Tab>) => (\n <Tab\n {...props}\n className=\"rounded-xl border border-card\"\n headerClassName=\"sticky rounded-xl top-24 z-5 bg-background/70 backdrop-blur overflow-x-auto\"\n />\n);\nconst ColumnsRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex gap-4 max-md:flex-col', className)} {...props} />\n);\nconst ColumnRenderer = ({\n className,\n ...props\n}: ComponentPropsWithoutRef<'div'>) => (\n <div className={cn('flex-1', className)} {...props} />\n);\n\n// Static configuration object\nexport const baseMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n code: CodeRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\n a: LinkRenderer,\n pre: PreRenderer,\n table: TableRenderer,\n th: ThRenderer,\n tr: TrRenderer,\n td: TdRenderer,\n hr: HrRenderer,\n Tabs: TabsRenderer,\n Tab: Tab.Item,\n Columns: ColumnsRenderer,\n Column: ColumnRenderer,\n};\n\ntype MarkdownRendererProps = {\n children: string;\n isDarkMode?: boolean;\n locale?: LocalesValues;\n forceBlock?: boolean;\n preserveFrontmatter?: boolean;\n tagfilter?: boolean;\n components?: ComponentProps<typeof MarkdownRendererIntlayer>['components'];\n wrapper?: ComponentProps<typeof MarkdownRendererIntlayer>['wrapper'];\n};\n\nexport const getIntlayerMarkdownOptions = (_isDarkMode?: boolean) => ({\n components: baseMarkdownComponents,\n});\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode = false,\n locale,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n components: componentsProp,\n wrapper,\n}) => {\n // `renderMarkdown` now receives stable object references.\n const markdownContent = renderMarkdown(children, {\n components: {\n ...baseMarkdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <MarkdownContext.Provider value={{ isDarkMode, locale }}>\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n </MarkdownContext.Provider>\n );\n};\n"],"mappings":"+hBA2BA,MAAM,EAAkB,EAAmC,EAAE,CAAC,CA8JjD,EAAyB,CACpC,GA5JkB,GAClB,EAAC,EAAD,CAAI,YAAA,GAAY,UAAU,YAAY,GAAI,EAAS,CAAA,CA4JnD,GA1JkB,GAClB,EAAC,EAAD,CAAI,YAAA,GAAY,UAAU,kBAAkB,GAAI,EAAS,CAAA,CA0JzD,GAxJkB,GAClB,EAAC,EAAD,CAAI,YAAA,GAAY,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAwJxD,GAtJkB,GAClB,EAAC,EAAD,CAAI,YAAA,GAAY,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAsJxD,GApJkB,GAClB,EAAC,EAAD,CAAI,YAAA,GAAY,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAoJxD,GAlJkB,GAClB,EAAC,EAAD,CAAI,YAAA,GAAY,UAAU,iBAAiB,GAAI,EAAS,CAAA,CAkJxD,OAhJsB,GACtB,EAAC,SAAD,CAAQ,UAAU,YAAY,GAAI,EAAS,CAAA,CAgJ3C,MA7IoB,CACpB,YACA,WACA,GAAG,KACyB,CAC5B,GAAM,CAAE,cAAe,EAAW,EAAgB,CAC5C,EAAU,OAAO,GAAY,GAAG,CAAC,QAAQ,MAAO,GAAG,CAGzD,GAAI,CAFc,EAGhB,OACE,EAAC,OAAD,CAAM,UAAU,+GACb,EACI,CAAA,CAIX,IAAM,EAAY,GAAW,QAAQ,iBAAkB,GAAG,EACxD,YAEF,OACE,EAAC,EAAD,CAAM,GAAI,EAAgB,WAAU,WAAA,GAAuB,sBACxD,EACI,CAAA,EAuHT,YAnH0B,CAC1B,YACA,GAAG,KAEH,EAAC,aAAD,CACE,UAAW,EACT,8EACA,EACD,CACD,GAAI,EACJ,CAAA,CA0GF,IAvGkB,CAAE,YAAW,GAAG,KAClC,EAAC,KAAD,CACE,UAAW,EACT,iEACA,EACD,CACD,GAAI,EACJ,CAAA,CAiGF,IA9FkB,CAAE,YAAW,GAAG,KAClC,EAAC,KAAD,CACE,UAAW,EACT,oEACA,EACD,CACD,GAAI,EACJ,CAAA,CAwFF,KArFmB,CACnB,YACA,MACA,MACA,GAAG,KAEH,EAAC,MAAD,CACE,GAAI,EACJ,IAAK,GAAO,GACZ,QAAQ,OACR,UAAW,EAAG,qCAAsC,EAAU,CAC9D,IAAK,GAAG,EAAI,WACZ,CAAA,CA0EF,EAvEoB,GAA+B,CACnD,GAAM,CAAE,UAAW,EAAW,EAAgB,CAC9C,OACE,EAAC,EAAD,CACE,eAAgB,EAAM,MAAM,WAAW,OAAO,CAC9C,WAAA,GACQ,SACR,MAAM,GACN,MAAM,OACN,GAAK,EACL,CAAA,EA8DJ,IA1DmB,GAAiC,EAAA,EAAA,CAAA,SAAG,EAAM,SAAY,CAAA,CA2DzE,MA1DqB,GACrB,EAAC,EAAD,CAAO,WAAA,GAAW,GAAI,EAAS,CAAA,CA0D/B,IAxDkB,CAAE,YAAW,GAAG,KAClC,EAAC,KAAD,CACE,UAAW,EAAG,4CAA6C,EAAU,CACrE,GAAI,EACJ,CAAA,CAqDF,IAnDkB,CAAE,YAAW,GAAG,KAClC,EAAC,KAAD,CAAI,UAAW,EAAG,gCAAiC,EAAU,CAAE,GAAI,EAAS,CAAA,CAmD5E,IAjDkB,CAAE,YAAW,GAAG,KAClC,EAAC,KAAD,CACE,UAAW,EAAG,qCAAsC,EAAU,CAC9D,GAAI,EACJ,CAAA,CA8CF,IA5CkB,CAAE,YAAW,GAAG,KAClC,EAAC,KAAD,CAAI,UAAW,EAAG,0BAA2B,EAAU,CAAE,GAAI,EAAS,CAAA,CA4CtE,KAzCoB,GACpB,EAAC,EAAD,CACE,GAAI,EACJ,UAAU,gCACV,gBAAgB,8EAChB,CAAA,CAqCF,IAAK,EAAI,KACT,SApCuB,CACvB,YACA,GAAG,KAEH,EAAC,MAAD,CAAK,UAAW,EAAG,6BAA8B,EAAU,CAAE,GAAI,EAAS,CAAA,CAiC1E,QA/BsB,CACtB,YACA,GAAG,KAEH,EAAC,MAAD,CAAK,UAAW,EAAG,SAAU,EAAU,CAAE,GAAI,EAAS,CAAA,CA4BvD,CAaY,EAA8B,IAA2B,CACpE,WAAY,EACb,EAEY,GAA+C,CAC1D,WACA,aAAa,GACb,SACA,aACA,sBACA,YACA,WAAY,EACZ,aACI,CAEJ,IAAM,EAAkB,EAAe,EAAU,CAC/C,WAAY,CACV,GAAG,EACH,GAAG,EACJ,CACD,UACA,aACA,sBACA,YACD,CAAC,CAEF,OACE,EAAC,EAAgB,SAAjB,CAA0B,MAAO,CAAE,aAAY,SAAQ,UACrD,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAA,SAAc,EAA8B,CAAA,CAC/B,CAAA,CACU,CAAA"}
@@ -1 +1 @@
1
- import{MarkdownRenderer as e,getIntlayerMarkdownOptions as t}from"./MarkDownRender.mjs";export{e as MarkdownRenderer,t as getIntlayerMarkdownOptions};
1
+ import{MarkdownRenderer as e,baseMarkdownComponents as t,getIntlayerMarkdownOptions as n}from"./MarkDownRender.mjs";export{e as MarkdownRenderer,t as baseMarkdownComponents,n as getIntlayerMarkdownOptions};
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";const n=({children:n,isHidden:r,className:i=``,isOverable:a=!1,isFocusable:o=!1,minHeight:s=0,...c})=>t(`div`,{"aria-hidden":o?r:void 0,tabIndex:o?0:void 0,role:o?`button`:`none`,className:e(`group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out`,r!==void 0&&!r&&`grid-rows-[1fr] overflow-x-auto`,a&&`hover:grid-rows-[1fr] hover:overflow-x-auto`,o&&`focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto`,i),...c,children:t(`div`,{style:{minHeight:`${s}px`},className:e(a&&`group-hover/height-smoother:visible`,o&&`group-focus/height-smoother:visible`,i),children:n})});export{n as MaxHeightSmoother};
1
+ import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";const n=({children:n,isHidden:r,className:i=``,isOverable:a=!1,isFocusable:o=!1,minHeight:s=0,...c})=>t(`div`,{"aria-hidden":o?r:void 0,tabIndex:o?0:void 0,role:o?`button`:`none`,className:e(`group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-[grid-template-rows] duration-500 ease-in-out`,r!==void 0&&!r&&`grid-rows-[1fr] overflow-x-auto`,a&&`hover:grid-rows-[1fr] hover:overflow-x-auto`,o&&`focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto`,i),...c,children:t(`div`,{style:{minHeight:`${s}px`},className:`min-h-0 overflow-hidden`,children:n})});export{n as MaxHeightSmoother};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes, ReactNode } from 'react';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Uses CSS Grid's fractional rows to create fluid\n * animations without JavaScript height calculations, making it performant\n * and smooth across all devices and screen sizes.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable={true}>\n * <div>\n * <p>This content expands when you hover over the container.</p>\n * <p>Perfect for preview cards or tooltips.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Accessible focus-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isFocusable={true}>\n * <div>\n * <h3>Expandable Section</h3>\n * <p>Tab to focus this container to expand the content.</p>\n * <p>Great for accessible progressive disclosure.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * minHeight={100}\n * className=\"border rounded-lg p-4\"\n * >\n * <div>\n * <h3>Article Preview</h3>\n * <p>This article preview shows the first few lines...</p>\n * <p>Hover to see the full content with smooth expansion.</p>\n * <p>The minHeight ensures some content is always visible.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus behavior:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * isFocusable={true}\n * minHeight={80}\n * >\n * <div>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * <p>Accessible to both mouse and keyboard users.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * Features:\n * - Smooth CSS Grid-based height transitions (700ms duration)\n * - Three interaction modes: controlled, hover, and focus\n * - Configurable minimum height for collapsed state\n * - Accessible keyboard navigation support\n * - Overflow handling with smooth scrolling\n * - ARIA attributes for screen reader compatibility\n * - Performance-optimized with CSS-only animations\n * - Responsive design that works on all screen sizes\n *\n * Animation Technique:\n * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions\n * instead of height animations, which provides:\n * - Smooth animations without knowing content height\n * - Better performance (no layout recalculations)\n * - More reliable across different content types\n * - Automatic adaptation to dynamic content changes\n *\n * Interaction Modes:\n * 1. **Controlled**: Use `isHidden` prop for external state control\n * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion\n * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion\n * 4. **Combined**: Use both `isOverable` and `isFocusable` together\n *\n * Accessibility Features:\n * - `role=\"button\"` when focusable for proper screen reader context\n * - `tabIndex={0}` for keyboard navigation when focusable\n * - `aria-hidden` attribute for screen reader control\n * - Semantic focus management with focus-within pseudo-class\n * - High contrast focus indicators\n * - Respects prefers-reduced-motion settings\n *\n * Use Cases:\n * - FAQ accordions and expandable sections\n * - Article previews and read-more functionality\n * - Card hover effects and content previews\n * - Progressive disclosure for complex forms\n * - Tooltip and popover content containers\n * - Mobile-friendly collapsible navigation\n * - Dashboard widget expansion\n * - Email preview in mail clients\n *\n * Performance Considerations:\n * - Pure CSS animations (no JavaScript timer overhead)\n * - GPU acceleration through transform-based animations\n * - Minimal repaints and layout shifts\n * - Efficient event handling with CSS pseudo-classes\n * - No DOM measurements or calculations required\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)\n * @param props.isOverable - Enable hover-to-expand behavior\n * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)\n * @param props.className - Additional CSS classes for styling\n * @param props.style - Inline styles (note: minHeight style will be applied)\n * @param props.role - ARIA role (automatically set to \"button\" when focusable)\n * @param props.tabIndex - Tab index (automatically set to 0 when focusable)\n * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.onFocus - Focus event handler\n * @param props.onBlur - Blur event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className={cn(\n isOverable && 'group-hover/height-smoother:visible',\n isFocusable && 'group-focus/height-smoother:visible',\n className\n )}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":"gFAmKA,MAAa,GAAiD,CAC5D,WACA,WACA,YAAY,GACZ,aAAa,GACb,cAAc,GACd,YAAY,EACZ,GAAG,KAEH,EAAC,MAAD,CACE,cAAa,EAAc,EAAW,IAAA,GACtC,SAAU,EAAc,EAAI,IAAA,GAC5B,KAAM,EAAc,SAAW,OAC/B,UAAW,EACT,qHACO,IAAa,QAClB,CAAC,GACD,kCACF,GAAc,8CACd,GACE,wGACF,EACD,CACD,GAAI,WAEJ,EAAC,MAAD,CACE,MAAO,CACL,UAAW,GAAG,EAAU,IACzB,CACD,UAAW,EACT,GAAc,sCACd,GAAe,sCACf,EACD,CAEA,WACG,CAAA,CACF,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes, ReactNode } from 'react';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Uses CSS Grid's fractional rows to create fluid\n * animations without JavaScript height calculations, making it performant\n * and smooth across all devices and screen sizes.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable={true}>\n * <div>\n * <p>This content expands when you hover over the container.</p>\n * <p>Perfect for preview cards or tooltips.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Accessible focus-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isFocusable={true}>\n * <div>\n * <h3>Expandable Section</h3>\n * <p>Tab to focus this container to expand the content.</p>\n * <p>Great for accessible progressive disclosure.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * minHeight={100}\n * className=\"border rounded-lg p-4\"\n * >\n * <div>\n * <h3>Article Preview</h3>\n * <p>This article preview shows the first few lines...</p>\n * <p>Hover to see the full content with smooth expansion.</p>\n * <p>The minHeight ensures some content is always visible.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus behavior:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * isFocusable={true}\n * minHeight={80}\n * >\n * <div>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * <p>Accessible to both mouse and keyboard users.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * Features:\n * - Smooth CSS Grid-based height transitions (700ms duration)\n * - Three interaction modes: controlled, hover, and focus\n * - Configurable minimum height for collapsed state\n * - Accessible keyboard navigation support\n * - Overflow handling with smooth scrolling\n * - ARIA attributes for screen reader compatibility\n * - Performance-optimized with CSS-only animations\n * - Responsive design that works on all screen sizes\n *\n * Animation Technique:\n * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions\n * instead of height animations, which provides:\n * - Smooth animations without knowing content height\n * - Better performance (no layout recalculations)\n * - More reliable across different content types\n * - Automatic adaptation to dynamic content changes\n *\n * Interaction Modes:\n * 1. **Controlled**: Use `isHidden` prop for external state control\n * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion\n * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion\n * 4. **Combined**: Use both `isOverable` and `isFocusable` together\n *\n * Accessibility Features:\n * - `role=\"button\"` when focusable for proper screen reader context\n * - `tabIndex={0}` for keyboard navigation when focusable\n * - `aria-hidden` attribute for screen reader control\n * - Semantic focus management with focus-within pseudo-class\n * - High contrast focus indicators\n * - Respects prefers-reduced-motion settings\n *\n * Use Cases:\n * - FAQ accordions and expandable sections\n * - Article previews and read-more functionality\n * - Card hover effects and content previews\n * - Progressive disclosure for complex forms\n * - Tooltip and popover content containers\n * - Mobile-friendly collapsible navigation\n * - Dashboard widget expansion\n * - Email preview in mail clients\n *\n * Performance Considerations:\n * - Pure CSS animations (no JavaScript timer overhead)\n * - GPU acceleration through transform-based animations\n * - Minimal repaints and layout shifts\n * - Efficient event handling with CSS pseudo-classes\n * - No DOM measurements or calculations required\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)\n * @param props.isOverable - Enable hover-to-expand behavior\n * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)\n * @param props.className - Additional CSS classes for styling\n * @param props.style - Inline styles (note: minHeight style will be applied)\n * @param props.role - ARIA role (automatically set to \"button\" when focusable)\n * @param props.tabIndex - Tab index (automatically set to 0 when focusable)\n * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.onFocus - Focus event handler\n * @param props.onBlur - Blur event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-[grid-template-rows] duration-500 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className=\"min-h-0 overflow-hidden\"\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":"gFAmKA,MAAa,GAAiD,CAC5D,WACA,WACA,YAAY,GACZ,aAAa,GACb,cAAc,GACd,YAAY,EACZ,GAAG,KAEH,EAAC,MAAD,CACE,cAAa,EAAc,EAAW,IAAA,GACtC,SAAU,EAAc,EAAI,IAAA,GAC5B,KAAM,EAAc,SAAW,OAC/B,UAAW,EACT,sIACO,IAAa,QAClB,CAAC,GACD,kCACF,GAAc,8CACd,GACE,wGACF,EACD,CACD,GAAI,WAEJ,EAAC,MAAD,CACE,MAAO,CACL,UAAW,GAAG,EAAU,IACzB,CACD,UAAU,0BAET,WACG,CAAA,CACF,CAAA"}
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Container as t}from"../Container/index.mjs";import{Button as n,ButtonColor as r,ButtonSize as i,ButtonVariant as a}from"../Button/Button.mjs";import{H3 as o}from"../Headers/index.mjs";import{useGetElementOrWindow as s}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as c}from"../../hooks/useScrollBlockage/index.mjs";import{X as l}from"lucide-react";import{useEffect as u}from"react";import{cva as d}from"class-variance-authority";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{motion as h}from"framer-motion";import{createPortal as g}from"react-dom";let _=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e.XL=`xl`,e.UNSET=`unset`,e}({});const v=d(`flex cursor-default flex-col overflow-hidden shadow-sm`,{variants:{size:{sm:`h-auto max-h-[30vh] w-[95vw] max-w-xl`,md:`h-auto max-h-[50vh] w-[95vw] max-w-xl`,lg:`h-auto max-h-[70vh] w-[95vw] max-w-4xl`,xl:`h-auto max-h-[95vh] w-[95vw] max-w-6xl`,unset:`h-auto max-h-[95vh] w-[95vw]`}},defaultVariants:{size:`unset`}}),y={none:`p-0`,sm:`px-2 py-4`,md:`px-4 py-6`,lg:`px-6 py-8`,xl:`px-8 py-10`,"2xl":`px-10 py-12`},b=h.create(t),x=({children:t,isOpen:d,container:x,onClose:S,hasCloseButton:C=!1,title:w,size:T=_.MD,className:E,isScrollable:D=!1,disableScroll:O=!0,padding:k=`none`,...A})=>{let j=s(x);if(c({key:`modal`,disableScroll:d&&O}),u(()=>{let e=e=>{e.key===`Escape`&&d&&S&&S()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[d,S]),!j)return p(f,{});let M=!!w,N=y[k||`none`];return g(p(h.div,{className:`invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-hidden bg-background/40 backdrop-blur`,animate:d?`visible`:`invisible`,variants:{visible:{opacity:1,visibility:`visible`,transition:{duration:.1,when:`beforeChildren`}},invisible:{opacity:0,visibility:`hidden`,transition:{duration:.1,when:`afterChildren`}}},onClick:e=>{e.stopPropagation(),S?.()},"aria-hidden":!d,children:m(b,{onClick:e=>e.stopPropagation(),initial:{scale:d?.5:1},animate:{scale:d?1:.5},transition:{duration:.3},className:v({size:T,className:E}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...A,children:[m(`div`,{className:e(`relative flex-none px-4 pt-4`,C&&M?`flex items-start`:C?`flex justify-end`:M?`items-center`:`hidden`),children:[M&&p(o,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:w}),C&&p(n,{variant:a.HOVERABLE,color:r.TEXT,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),S?.()},Icon:l,size:i.ICON_MD})]}),p(`div`,{className:e(`flex min-h-0 w-full flex-1 flex-col`,D===!0&&`overflow-auto`,D===`y`&&`overflow-y-auto overflow-x-hidden`,D===`x`&&`overflow-x-auto overflow-y-hidden`,!D&&`overflow-visible`),children:p(`div`,{className:e(`flex h-full w-full flex-1 flex-col`,N),children:t})})]})}),j)};export{x as Modal,_ as ModalSize};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{Container as t}from"../Container/index.mjs";import{Button as n,ButtonColor as r,ButtonSize as i,ButtonVariant as a}from"../Button/Button.mjs";import{H3 as o}from"../Headers/index.mjs";import{useGetElementOrWindow as s}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as c}from"../../hooks/useScrollBlockage/index.mjs";import{useEffect as l}from"react";import{cva as u}from"class-variance-authority";import{X as d}from"lucide-react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{motion as h}from"framer-motion";import{createPortal as g}from"react-dom";let _=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e.XL=`xl`,e.UNSET=`unset`,e}({});const v=u(`flex cursor-default flex-col overflow-hidden shadow-sm`,{variants:{size:{sm:`h-auto max-h-[30vh] w-[95vw] max-w-xl`,md:`h-auto max-h-[50vh] w-[95vw] max-w-xl`,lg:`h-auto max-h-[70vh] w-[95vw] max-w-4xl`,xl:`h-auto max-h-[95vh] w-[95vw] max-w-6xl`,unset:`h-auto max-h-[95vh] w-[95vw]`}},defaultVariants:{size:`unset`}}),y={none:`p-0`,sm:`px-2 py-4`,md:`px-4 py-6`,lg:`px-6 py-8`,xl:`px-8 py-10`,"2xl":`px-10 py-12`},b=h.create(t),x=({children:t,isOpen:u,container:x,onClose:S,hasCloseButton:C=!1,title:w,size:T=_.MD,className:E,isScrollable:D=!1,disableScroll:O=!0,padding:k=`none`,...A})=>{let j=s(x);if(c({key:`modal`,disableScroll:u&&O}),l(()=>{let e=e=>{e.key===`Escape`&&u&&S&&S()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,S]),!j)return p(f,{});let M=!!w,N=y[k||`none`];return g(p(h.div,{className:`invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-hidden bg-background/40 backdrop-blur`,animate:u?`visible`:`invisible`,variants:{visible:{opacity:1,visibility:`visible`,transition:{duration:.1,when:`beforeChildren`}},invisible:{opacity:0,visibility:`hidden`,transition:{duration:.1,when:`afterChildren`}}},onClick:e=>{e.stopPropagation(),S?.()},"aria-hidden":!u,children:m(b,{onClick:e=>e.stopPropagation(),initial:{scale:u?.5:1},animate:{scale:u?1:.5},transition:{duration:.3},className:v({size:T,className:E}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...A,children:[m(`div`,{className:e(`relative flex-none px-4 pt-4`,C&&M?`flex items-start`:C?`flex justify-end`:M?`items-center`:`hidden`),children:[M&&p(o,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:w}),C&&p(n,{variant:a.HOVERABLE,color:r.TEXT,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),S?.()},Icon:d,size:i.ICON_MD})]}),p(`div`,{className:e(`flex min-h-0 w-full flex-1 flex-col`,D===!0&&`overflow-auto`,D===`y`&&`overflow-y-auto overflow-x-hidden`,D===`x`&&`overflow-x-auto overflow-y-hidden`,!D&&`overflow-visible`),children:p(`div`,{className:e(`flex h-full w-full flex-1 flex-col`,N),children:t})})]})}),j)};export{x as Modal,_ as ModalSize};
2
2
  //# sourceMappingURL=Modal.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{useItemSelector as a}from"../../hooks/useItemSelector.mjs";import{ChevronLeft as o,ChevronRight as s,MoreHorizontal as c}from"lucide-react";import{useEffect as l,useRef as u}from"react";import{cva as d}from"class-variance-authority";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=d(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,primary:`background-primary`,secondary:`background-secondary`,neutral:`background-neutral`,destructive:`background-destructive`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}});let h=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e}({}),g=function(e){return e.DEFAULT=`default`,e.BORDERED=`bordered`,e.GHOST=`ghost`,e}({});const _=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},v=e=>e?.getAttribute(`aria-current`)===`true`,y=e=>e===h.SM?r.ICON_SM:e===h.LG?r.ICON_LG:r.ICON_MD,b=e=>f(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),x=({currentPage:r,totalPages:d,onPageChange:x,showFirstLast:S=!1,showPrevNext:C=!0,maxVisiblePages:w=5,disabled:T=!1,size:E=h.MD,variant:D=g.DEFAULT,color:O=n.TEXT,className:k,...A})=>{let j=_(r,d,w),M=y(E),N=r===1,P=r===d,F=u([]),I=u(null),{choiceIndicatorPosition:L,calculatePosition:R}=a(F,{selector:v,isHoverable:!0});if(l(()=>{let e=setTimeout(()=>{R()},300);return()=>clearTimeout(e)},[r,R]),d<=1)return null;let z=e=>{!T&&e>=1&&e<=d&&e!==r&&x(e)};return f(`div`,{className:e(m({size:E,variant:D}),k),...A,children:p(`div`,{className:`relative flex items-center gap-1`,children:[L&&f(b,{style:L,ref:I}),C&&f(t,{variant:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(r-1),disabled:T||N,label:`Go to previous page`,Icon:o,ref:e=>{e&&(F.current[0]=e)},className:`min-w-0 px-2`}),f(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:j.map((a,o)=>{if(a===`ellipsis`)return f(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:f(c,{className:`h-4 w-4 text-muted-foreground`})},`ellipsis-${a}-${o}`);let s=a===r,l=(C?1:0)+j.slice(0,o).filter(e=>e!==`ellipsis`).length;return f(t,{variant:s?i.DEFAULT:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(a),disabled:T,label:`Go to page ${a}`,"aria-current":s?`true`:`false`,ref:e=>{e&&(F.current[l]=e)},className:e(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,E===`sm`&&`h-6 w-6 text-xs`,E===`lg`&&`h-10 w-10 text-base`,s&&`font-semibold`),children:a},a)})}),C&&f(t,{variant:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(r+1),disabled:T||P,label:`Go to next page`,Icon:s,ref:e=>{let t=(C?1:0)+j.filter(e=>e!==`ellipsis`).length;e&&(F.current[t]=e)},className:`min-w-0 px-2`})]})})};export{x as Pagination,h as PaginationSize,g as PaginationVariant,m as paginationVariants};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{useItemSelector as a}from"../../hooks/useItemSelector.mjs";import{useEffect as o,useRef as s}from"react";import{cva as c}from"class-variance-authority";import{ChevronLeft as l,ChevronRight as u,MoreHorizontal as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=c(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,primary:`background-primary`,secondary:`background-secondary`,neutral:`background-neutral`,destructive:`background-destructive`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}});let h=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e}({}),g=function(e){return e.DEFAULT=`default`,e.BORDERED=`bordered`,e.GHOST=`ghost`,e}({});const _=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},v=e=>e?.getAttribute(`aria-current`)===`true`,y=e=>e===h.SM?r.ICON_SM:e===h.LG?r.ICON_LG:r.ICON_MD,b=e=>f(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),x=({currentPage:r,totalPages:c,onPageChange:x,showFirstLast:S=!1,showPrevNext:C=!0,maxVisiblePages:w=5,disabled:T=!1,size:E=h.MD,variant:D=g.DEFAULT,color:O=n.TEXT,className:k,...A})=>{let j=_(r,c,w),M=y(E),N=r===1,P=r===c,F=s([]),I=s(null),{choiceIndicatorPosition:L,calculatePosition:R}=a(F,{selector:v,isHoverable:!0});if(o(()=>{let e=setTimeout(()=>{R()},300);return()=>clearTimeout(e)},[r,R]),c<=1)return null;let z=e=>{!T&&e>=1&&e<=c&&e!==r&&x(e)};return f(`div`,{className:e(m({size:E,variant:D}),k),...A,children:p(`div`,{className:`relative flex items-center gap-1`,children:[L&&f(b,{style:L,ref:I}),C&&f(t,{variant:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(r-1),disabled:T||N,label:`Go to previous page`,Icon:l,ref:e=>{e&&(F.current[0]=e)},className:`min-w-0 px-2`}),f(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:j.map((a,o)=>{if(a===`ellipsis`)return f(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:f(d,{className:`h-4 w-4 text-muted-foreground`})},`ellipsis-${a}-${o}`);let s=a===r,c=(C?1:0)+j.slice(0,o).filter(e=>e!==`ellipsis`).length;return f(t,{variant:s?i.DEFAULT:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(a),disabled:T,label:`Go to page ${a}`,"aria-current":s?`true`:`false`,ref:e=>{e&&(F.current[c]=e)},className:e(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,E===`sm`&&`h-6 w-6 text-xs`,E===`lg`&&`h-10 w-10 text-base`,s&&`font-semibold`),children:a},a)})}),C&&f(t,{variant:i.OUTLINE,size:M,color:n.TEXT,onClick:()=>z(r+1),disabled:T||P,label:`Go to next page`,Icon:u,ref:e=>{let t=(C?1:0)+j.filter(e=>e!==`ellipsis`).length;e&&(F.current[t]=e)},className:`min-w-0 px-2`})]})})};export{x as Pagination,h as PaginationSize,g as PaginationVariant,m as paginationVariants};
2
2
  //# sourceMappingURL=Pagination.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{useDevice as a}from"../../hooks/useDevice.mjs";import{KeyboardShortcut as o}from"../KeyboardShortcut/KeyboardShortcut.mjs";import{Popover as s}from"../Popover/dynamic.mjs";import{useGetElementOrWindow as c}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as l}from"../../hooks/useScrollBlockage/index.mjs";import{MaxWidthSmoother as u}from"../MaxWidthSmoother/index.mjs";import{isElementAtTopAndNotCovered as d}from"./isElementAtTopAndNotCovered.mjs";import{useRightDrawer as f}from"./useRightDrawer.mjs";import{ChevronLeft as p,X as m}from"lucide-react";import{useEffect as h,useRef as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useIntlayer as b}from"react-intlayer";import{createPortal as x}from"react-dom";const S=({title:S,identifier:C,children:w,header:T,footer:E,closeOnOutsideClick:D=!0,backButton:O,isOpen:k,onClose:A,container:j})=>{let M=b(`right-drawer`),{isMobile:N}=a(`md`),P=g(null),F=g(null),I=c(j),{open:L,close:R,isOpen:z}=f(),B=z(C),V=B;l({disableScroll:V,key:C?`right_drawer_${C}`:`right_drawer`}),h(()=>{let e=e=>{try{if(!P.current)return;let t=V&&D,n=e.target&&!P.current.contains(e.target),r=d(P.current);(t&&n&&r||!e.target)&&(R(C),A?.())}catch{R(C),A?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[V,R,A,D,C]);let H=g(A);return h(()=>{H.current=A},[A]),h(()=>{k!==void 0&&k!==B&&(k?L(C):(R(C),H.current?.()))},[k,B,C,L,R]),I?x(v(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:v(u,{isHidden:!V,align:`right`,children:y(e,{className:`relative flex h-screen w-screen flex-col text-text md:w-[400px]`,ref:P,roundedSize:`none`,children:[y(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[y(`div`,{className:`flex justify-between gap-3`,children:[v(`div`,{children:O&&v(t,{variant:i.HOVERABLE,color:n.TEXT,label:O.text??M.goBack.value,onClick:O.onBack,Icon:p,children:O?.text})}),v(`div`,{children:y(s,{identifier:`close-drawer`,children:[v(t,{variant:i.HOVERABLE,color:n.TEXT,label:`Close`,className:`ml-auto`,onClick:()=>{R(C),A?.()},Icon:m,size:r.ICON_MD}),v(s.Detail,{identifier:`close-drawer`,children:y(`div`,{className:`flex items-center gap-2 p-2`,children:[v(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:M.closeDrawer}),v(o,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{R(C),A?.()}})]})})]})})]}),S&&v(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:S}),T]}),v(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:v(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&N&&(R(C),A?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N&&(R(C),A?.()))},ref:F,role:`button`,tabIndex:0,children:w})}),E&&v(`div`,{className:`shrink-0`,children:E})]})})}),I):v(_,{})};export{S as RightDrawer};
1
+ "use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonSize as r,ButtonVariant as i}from"../Button/Button.mjs";import{useDevice as a}from"../../hooks/useDevice.mjs";import{KeyboardShortcut as o}from"../KeyboardShortcut/KeyboardShortcut.mjs";import{Popover as s}from"../Popover/dynamic.mjs";import{useGetElementOrWindow as c}from"../../hooks/useGetElementOrWindow.mjs";import{useScrollBlockage as l}from"../../hooks/useScrollBlockage/index.mjs";import{MaxWidthSmoother as u}from"../MaxWidthSmoother/index.mjs";import{isElementAtTopAndNotCovered as d}from"./isElementAtTopAndNotCovered.mjs";import{useRightDrawer as f}from"./useRightDrawer.mjs";import{useEffect as p,useRef as m}from"react";import{ChevronLeft as h,X as g}from"lucide-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useIntlayer as b}from"react-intlayer";import{createPortal as x}from"react-dom";const S=({title:S,identifier:C,children:w,header:T,footer:E,closeOnOutsideClick:D=!0,backButton:O,isOpen:k,onClose:A,container:j})=>{let M=b(`right-drawer`),{isMobile:N}=a(`md`),P=m(null),F=m(null),I=c(j),{open:L,close:R,isOpen:z}=f(),B=z(C),V=B;l({disableScroll:V,key:C?`right_drawer_${C}`:`right_drawer`}),p(()=>{let e=e=>{try{if(!P.current)return;let t=V&&D,n=e.target&&!P.current.contains(e.target),r=d(P.current);(t&&n&&r||!e.target)&&(R(C),A?.())}catch{R(C),A?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[V,R,A,D,C]);let H=m(A);return p(()=>{H.current=A},[A]),p(()=>{k!==void 0&&k!==B&&(k?L(C):(R(C),H.current?.()))},[k,B,C,L,R]),I?x(v(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:v(u,{isHidden:!V,align:`right`,children:y(e,{className:`relative flex h-screen w-screen flex-col text-text md:w-[400px]`,ref:P,roundedSize:`none`,children:[y(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[y(`div`,{className:`flex justify-between gap-3`,children:[v(`div`,{children:O&&v(t,{variant:i.HOVERABLE,color:n.TEXT,label:O.text??M.goBack.value,onClick:O.onBack,Icon:h,children:O?.text})}),v(`div`,{children:y(s,{identifier:`close-drawer`,children:[v(t,{variant:i.HOVERABLE,color:n.TEXT,label:`Close`,className:`ml-auto`,onClick:()=>{R(C),A?.()},Icon:g,size:r.ICON_MD}),v(s.Detail,{identifier:`close-drawer`,children:y(`div`,{className:`flex items-center gap-2 p-2`,children:[v(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:M.closeDrawer}),v(o,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{R(C),A?.()}})]})})]})})]}),S&&v(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:S}),T]}),v(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:v(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&N&&(R(C),A?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N&&(R(C),A?.()))},ref:F,role:`button`,tabIndex:0,children:w})}),E&&v(`div`,{className:`shrink-0`,children:E})]})})}),I):v(_,{})};export{S as RightDrawer};
2
2
  //# sourceMappingURL=RightDrawer.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Badge as t,BadgeColor as n}from"../Badge/index.mjs";import{Command as r,CommandRoot as i}from"../Command/index.mjs";import{Check as a,X as o}from"lucide-react";import{createContext as s,useCallback as c,useContext as l,useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";const g=s(null),_=()=>{let e=l(g);if(!e)throw Error(`useMultiSelect must be used within MultiSelectProvider`);return e},v=({values:t,defaultValues:n,onValueChange:r,loop:a=!1,className:o,children:s,dir:l,...h})=>{let[_,v]=p(n??[]),[y,b]=p(``),[x,S]=p(!1),[C,w]=p(-1),T=f(null),[E,D]=p(!1),[O,k]=p(``);u(()=>{t&&v(t)},[t]);let A=c(e=>{if(_.includes(e)){let t=_.filter(t=>t!==e);v(t),r?.(t)}else{let t=[..._,e];v(t),r?.(t)}},[_]),j=c(e=>{e.preventDefault();let t=e.currentTarget,n=t.value.substring(t.selectionStart??0,t.selectionEnd??0);k(n),D(n===y)},[y]),M=c(e=>{e.stopPropagation();let t=T.current;if(!t)return;let n=()=>{let e=C+1;w(e>_.length-1?a?0:-1:e)},r=()=>{let e=C-1;w(e<0?_.length-1:e)},i=()=>{w(C-1<=0?_.length-1==0?-1:0:C-1)};switch(e.key){case`ArrowLeft`:l===`rtl`?_.length>0&&(C!==-1||a)&&n():_.length>0&&t.selectionStart===0&&r();break;case`ArrowRight`:l===`rtl`?_.length>0&&t.selectionStart===0&&r():_.length>0&&(C!==-1||a)&&n();break;case`Backspace`:case`Delete`:_.length>0&&(C!==-1&&C<_.length?(A(_[C]),i()):(t.selectionStart===0&&O===y||E)&&A(_[_.length-1]));break;case`Enter`:S(!0);break;case`Escape`:C===-1?x&&S(!1):w(-1);break}},[_,y,C,a]);return m(g,{value:d(()=>({value:_,onValueChange:A,open:x,setOpen:S,inputValue:y,setInputValue:b,activeIndex:C,setActiveIndex:w,ref:T,handleSelect:j}),[_,A,x,S,y,b,C,w,T,j]),children:m(i,{onKeyDown:M,className:e(`flex w-full flex-col gap-2 overflow-visible bg-transparent`,o),dir:l,...h,children:s})})},y=({className:r,getBadgeValue:i=e=>e,validationStyleEnabled:a=!1,children:s,...l})=>{let{value:u,onValueChange:d,activeIndex:f}=_(),p=c(e=>{e.preventDefault(),e.stopPropagation()},[]);return h(`div`,{className:e(`flex w-full flex-col gap-3`,`cursor-pointer select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-text`,`ring-0`,`focus-within:outline-none`,`focus-within:ring-3`,`focus-within:ring-neutral-200`,`dark:focus-within:ring-neutral-500`,`focus-within:ring-offset-white`,`dark:focus-within:ring-offset-neutral-500`,`[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,a&&`valid:border-success invalid:border-error`,r),...l,children:[u.length>0&&m(`div`,{className:`flex w-full flex-wrap gap-1`,children:u.map((r,a)=>h(t,{className:e(`flex items-center gap-1 rounded-xl px-1`,f===a&&`ring-2 ring-muted-foreground`),color:n.TEXT,children:[m(`span`,{className:`text-xs`,children:i(r)}),h(`button`,{"aria-label":`Remove ${r} option`,"aria-roledescription":`button to remove option`,onMouseDown:p,onClick:()=>d(r),children:[h(`span`,{className:`sr-only`,children:[`Remove `,r,` option`]}),m(o,{className:`size-4 cursor-pointer`})]})]},r))}),s]})},b=({className:t,...n})=>{let{setOpen:i,inputValue:a,setInputValue:o,activeIndex:s,setActiveIndex:c,handleSelect:l,ref:u}=_();return m(r.Input,{...n,tabIndex:0,ref:u,value:a,onValueChange:s===-1?o:void 0,onSelect:l,onBlur:()=>i(!1),onFocus:()=>i(!0),onClick:()=>c(-1),className:e(`ml-2 flex-1 cursor-pointer outline-hidden`,t,s!==-1&&`caret-transparent`)})},x=({children:e})=>{let{open:t}=_();return m(`div`,{className:`relative`,children:t&&e})},S=({className:t,children:n})=>h(r.List,{className:e(`absolute top-0 z-10 flex w-full flex-col gap-2`,`rounded-xl p-2 shadow-md`,`bg-white dark:bg-neutral-950`,`text-text`,`border border-neutral-200 dark:border-neutral-800`,`transition-colors`,t),children:[n,m(r.Empty,{children:m(`span`,{className:`text-muted-foreground`,children:`No results found`})})]}),C=({className:t,value:n,children:i,...o})=>{let{value:s,onValueChange:l,setInputValue:u}=_(),d=c(e=>{e.preventDefault(),e.stopPropagation()},[]),f=s.includes(n);return h(r.Item,{...o,onSelect:()=>{l(n),u(``)},className:e(`flex cursor-pointer justify-between`,`rounded-lg px-2 py-1`,`transition-colors`,`hover:bg-neutral/10`,f&&`opacity-50`,o.disabled&&`cursor-not-allowed opacity-50`,t),onMouseDown:d,children:[i,f&&m(a,{className:`size-4`})]})},w=v;w.Trigger=y,w.Input=b,w.Content=x,w.List=S,w.Item=C;export{w as MultiSelect};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{Badge as t,BadgeColor as n}from"../Badge/index.mjs";import{Command as r,CommandRoot as i}from"../Command/index.mjs";import{createContext as a,useCallback as o,useContext as s,useEffect as c,useMemo as l,useRef as u,useState as d}from"react";import{Check as f,X as p}from"lucide-react";import{jsx as m,jsxs as h}from"react/jsx-runtime";const g=a(null),_=()=>{let e=s(g);if(!e)throw Error(`useMultiSelect must be used within MultiSelectProvider`);return e},v=({values:t,defaultValues:n,onValueChange:r,loop:a=!1,className:s,children:f,dir:p,...h})=>{let[_,v]=d(n??[]),[y,b]=d(``),[x,S]=d(!1),[C,w]=d(-1),T=u(null),[E,D]=d(!1),[O,k]=d(``);c(()=>{t&&v(t)},[t]);let A=o(e=>{if(_.includes(e)){let t=_.filter(t=>t!==e);v(t),r?.(t)}else{let t=[..._,e];v(t),r?.(t)}},[_]),j=o(e=>{e.preventDefault();let t=e.currentTarget,n=t.value.substring(t.selectionStart??0,t.selectionEnd??0);k(n),D(n===y)},[y]),M=o(e=>{e.stopPropagation();let t=T.current;if(!t)return;let n=()=>{let e=C+1;w(e>_.length-1?a?0:-1:e)},r=()=>{let e=C-1;w(e<0?_.length-1:e)},i=()=>{w(C-1<=0?_.length-1==0?-1:0:C-1)};switch(e.key){case`ArrowLeft`:p===`rtl`?_.length>0&&(C!==-1||a)&&n():_.length>0&&t.selectionStart===0&&r();break;case`ArrowRight`:p===`rtl`?_.length>0&&t.selectionStart===0&&r():_.length>0&&(C!==-1||a)&&n();break;case`Backspace`:case`Delete`:_.length>0&&(C!==-1&&C<_.length?(A(_[C]),i()):(t.selectionStart===0&&O===y||E)&&A(_[_.length-1]));break;case`Enter`:S(!0);break;case`Escape`:C===-1?x&&S(!1):w(-1);break}},[_,y,C,a]);return m(g,{value:l(()=>({value:_,onValueChange:A,open:x,setOpen:S,inputValue:y,setInputValue:b,activeIndex:C,setActiveIndex:w,ref:T,handleSelect:j}),[_,A,x,S,y,b,C,w,T,j]),children:m(i,{onKeyDown:M,className:e(`flex w-full flex-col gap-2 overflow-visible bg-transparent`,s),dir:p,...h,children:f})})},y=({className:r,getBadgeValue:i=e=>e,validationStyleEnabled:a=!1,children:s,...c})=>{let{value:l,onValueChange:u,activeIndex:d}=_(),f=o(e=>{e.preventDefault(),e.stopPropagation()},[]);return h(`div`,{className:e(`flex w-full flex-col gap-3`,`cursor-pointer select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-text`,`ring-0`,`focus-within:outline-none`,`focus-within:ring-3`,`focus-within:ring-neutral-200`,`dark:focus-within:ring-neutral-500`,`focus-within:ring-offset-white`,`dark:focus-within:ring-offset-neutral-500`,`[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,a&&`valid:border-success invalid:border-error`,r),...c,children:[l.length>0&&m(`div`,{className:`flex w-full flex-wrap gap-1`,children:l.map((r,a)=>h(t,{className:e(`flex items-center gap-1 rounded-xl px-1`,d===a&&`ring-2 ring-muted-foreground`),color:n.TEXT,children:[m(`span`,{className:`text-xs`,children:i(r)}),h(`button`,{"aria-label":`Remove ${r} option`,"aria-roledescription":`button to remove option`,onMouseDown:f,onClick:()=>u(r),children:[h(`span`,{className:`sr-only`,children:[`Remove `,r,` option`]}),m(p,{className:`size-4 cursor-pointer`})]})]},r))}),s]})},b=({className:t,...n})=>{let{setOpen:i,inputValue:a,setInputValue:o,activeIndex:s,setActiveIndex:c,handleSelect:l,ref:u}=_();return m(r.Input,{...n,tabIndex:0,ref:u,value:a,onValueChange:s===-1?o:void 0,onSelect:l,onBlur:()=>i(!1),onFocus:()=>i(!0),onClick:()=>c(-1),className:e(`ml-2 flex-1 cursor-pointer outline-hidden`,t,s!==-1&&`caret-transparent`)})},x=({children:e})=>{let{open:t}=_();return m(`div`,{className:`relative`,children:t&&e})},S=({className:t,children:n})=>h(r.List,{className:e(`absolute top-0 z-10 flex w-full flex-col gap-2`,`rounded-xl p-2 shadow-md`,`bg-white dark:bg-neutral-950`,`text-text`,`border border-neutral-200 dark:border-neutral-800`,`transition-colors`,t),children:[n,m(r.Empty,{children:m(`span`,{className:`text-muted-foreground`,children:`No results found`})})]}),C=({className:t,value:n,children:i,...a})=>{let{value:s,onValueChange:c,setInputValue:l}=_(),u=o(e=>{e.preventDefault(),e.stopPropagation()},[]),d=s.includes(n);return h(r.Item,{...a,onSelect:()=>{c(n),l(``)},className:e(`flex cursor-pointer justify-between`,`rounded-lg px-2 py-1`,`transition-colors`,`hover:bg-neutral/10`,d&&`opacity-50`,a.disabled&&`cursor-not-allowed opacity-50`,t),onMouseDown:u,children:[i,d&&m(f,{className:`size-4`})]})},w=v;w.Trigger=y,w.Input=b,w.Content=x,w.List=S,w.Item=C;export{w as MultiSelect};
2
2
  //# sourceMappingURL=Multiselect.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{CheckIcon as t,ChevronDownIcon as n,ChevronUpIcon as r,ChevronsUpDown as i}from"lucide-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as s from"@radix-ui/react-select";let c=function(e){return e.POPPER=`popper`,e.ITEM_ALIGNED=`item-aligned`,e}({});const l=s.Root,u=s.Group,d=s.Value,f=({validationStyleEnabled:t=!1,className:n,children:r,...c})=>o(s.Trigger,{className:e(`flex w-full cursor-pointer items-center justify-between whitespace-nowrap`,`select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-text`,`ring-0`,`focus-visible:outline-none`,`focus-visible:ring-3`,`focus-visible:ring-neutral-200`,`dark:focus-visible:ring-neutral-500`,`focus-visible:ring-offset-white`,`dark:focus-visible:ring-offset-neutral-500`,`[box-shadow:none] focus:[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,`[&>span]:line-clamp-1`,t&&`valid:border-success invalid:border-error`,n),...c,children:[r,a(s.Icon,{asChild:!0,children:a(i,{className:`size-4 opacity-50`})})]}),p=({className:t,...n})=>a(s.ScrollUpButton,{className:e(`flex cursor-default items-center justify-center py-1`,t),...n,children:a(r,{})}),m=({className:t,...r})=>a(s.ScrollDownButton,{className:e(`flex cursor-default items-center justify-center py-1`,t),...r,children:a(n,{})}),h=({className:t,children:n,position:r=c.POPPER,...i})=>a(s.Portal,{children:o(s.Content,{className:e(`relative z-50 max-h-96 min-w-32 overflow-hidden`,`rounded-xl shadow-md`,`bg-white dark:bg-neutral-950`,`text-text`,`border border-neutral-200 dark:border-neutral-800`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2`,`data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,t),position:r,...i,children:[a(p,{}),a(s.Viewport,{className:e(`p-1`,r===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:n}),a(m,{})]})}),g=({className:t,...n})=>a(s.Label,{className:e(`px-1 py-0.5 font-semibold text-sm`,t),...n}),_=({className:n,children:r,...i})=>o(s.Item,{className:e(`relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50`,n),...i,children:[a(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:a(s.ItemIndicator,{children:a(t,{className:`size-4`})})}),a(s.ItemText,{children:r})]}),v=({className:t,...n})=>a(s.Separator,{className:e(`-mx-1 my-1 h-px`,`bg-neutral-200 dark:bg-neutral-800`,t),...n}),y=l;y.Group=u,y.Value=d,y.Trigger=f,y.ScrollUpButton=p,y.ScrollDownButton=m,y.Content=h,y.Label=g,y.Item=_,y.Separator=v;export{y as Select,h as SelectContent,c as SelectContentPosition,g as SelectLabel,v as SelectSeparator};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{CheckIcon as t,ChevronDownIcon as n,ChevronUpIcon as r,ChevronsUpDown as i}from"lucide-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as s from"@radix-ui/react-select";let c=function(e){return e.POPPER=`popper`,e.ITEM_ALIGNED=`item-aligned`,e}({});const l=s.Root,u=s.Group,d=s.Value,f=({validationStyleEnabled:t=!1,className:n,children:r,...c})=>o(s.Trigger,{suppressHydrationWarning:!0,className:e(`flex w-full cursor-pointer items-center justify-between whitespace-nowrap`,`select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-text`,`ring-0`,`focus-visible:outline-none`,`focus-visible:ring-3`,`focus-visible:ring-neutral-200`,`dark:focus-visible:ring-neutral-500`,`focus-visible:ring-offset-white`,`dark:focus-visible:ring-offset-neutral-500`,`[box-shadow:none] focus:[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,`[&>span]:line-clamp-1`,t&&`valid:border-success invalid:border-error`,n),...c,children:[r,a(s.Icon,{asChild:!0,children:a(i,{className:`size-4 opacity-50`})})]}),p=({className:t,...n})=>a(s.ScrollUpButton,{className:e(`flex cursor-default items-center justify-center py-1`,t),...n,children:a(r,{})}),m=({className:t,...r})=>a(s.ScrollDownButton,{className:e(`flex cursor-default items-center justify-center py-1`,t),...r,children:a(n,{})}),h=({className:t,children:n,position:r=c.POPPER,...i})=>a(s.Portal,{children:o(s.Content,{className:e(`relative z-50 max-h-96 min-w-32 overflow-hidden`,`rounded-xl shadow-md`,`bg-white dark:bg-neutral-950`,`text-text`,`border border-neutral-200 dark:border-neutral-800`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2`,`data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,t),position:r,...i,children:[a(p,{}),a(s.Viewport,{className:e(`p-1`,r===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:n}),a(m,{})]})}),g=({className:t,...n})=>a(s.Label,{className:e(`px-1 py-0.5 font-semibold text-sm`,t),...n}),_=({className:n,children:r,...i})=>o(s.Item,{className:e(`relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50`,n),...i,children:[a(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:a(s.ItemIndicator,{children:a(t,{className:`size-4`})})}),a(s.ItemText,{children:r})]}),v=({className:t,...n})=>a(s.Separator,{className:e(`-mx-1 my-1 h-px`,`bg-neutral-200 dark:bg-neutral-800`,t),...n}),y=l;y.Group=u,y.Value=d,y.Trigger=f,y.ScrollUpButton=p,y.ScrollDownButton=m,y.Content=h,y.Label=g,y.Item=_,y.Separator=v;export{y as Select,h as SelectContent,c as SelectContentPosition,g as SelectLabel,v as SelectSeparator};
2
2
  //# sourceMappingURL=Select.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.mjs","names":[],"sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '@utils/cn';\nimport {\n CheckIcon,\n ChevronDownIcon,\n ChevronsUpDown,\n ChevronUpIcon,\n} from 'lucide-react';\nimport type { ComponentProps, FC } from 'react';\n\n/**\n * Enum for Select content positioning strategies\n *\n * @enum SelectContentPosition\n */\nexport enum SelectContentPosition {\n /** Position relative to the trigger with automatic placement */\n POPPER = 'popper',\n /** Align content with the selected item */\n ITEM_ALIGNED = 'item-aligned',\n}\n\nconst SelectRoot = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\n/**\n * Select trigger button component that displays the current selection and opens the dropdown\n *\n * Features comprehensive styling with validation states, focus management, and accessibility support.\n * Uses design tokens for consistent theming across the application.\n *\n * @param validationStyleEnabled - Enables automatic success/error styling based on form validation state\n * @param className - Additional CSS classes for custom styling\n * @param children - Content to display inside the trigger (typically SelectValue)\n *\n * @example\n * ```tsx\n * <Select.Trigger validationStyleEnabled>\n * <Select.Value placeholder=\"Choose option...\" />\n * </Select.Trigger>\n * ```\n */\nconst SelectTrigger: FC<\n ComponentProps<typeof SelectPrimitive.Trigger> & {\n /**\n * Enables success/error border styling based on HTML5 validation state\n * @default false\n * @example\n * ```tsx\n * <Select.Trigger validationStyleEnabled>\n * <Select.Value placeholder=\"Required field\" />\n * </Select.Trigger>\n * ```\n */\n validationStyleEnabled?: boolean;\n }\n> = ({ validationStyleEnabled = false, className, children, ...props }) => (\n <SelectPrimitive.Trigger\n className={cn(\n // Base layout and typography\n 'flex w-full cursor-pointer items-center justify-between whitespace-nowrap',\n 'select-text text-base shadow-none outline-none md:text-sm',\n\n // Corner shape\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n\n // Spacing\n 'px-2 py-3 md:py-2',\n\n // Background and text\n 'bg-neutral-50 dark:bg-neutral-950',\n 'text-text',\n\n // Focus ring\n 'ring-0',\n 'focus-visible:outline-none',\n 'focus-visible:ring-3',\n 'focus-visible:ring-neutral-200',\n 'dark:focus-visible:ring-neutral-500',\n\n 'focus-visible:ring-offset-white',\n 'dark:focus-visible:ring-offset-neutral-500',\n\n // Remove box-shadow\n '[box-shadow:none] focus:[box-shadow:none]',\n\n // States\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-error',\n '[&>span]:line-clamp-1',\n\n // Validation styles\n validationStyleEnabled && 'valid:border-success invalid:border-error',\n\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronsUpDown className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n);\n\n/**\n * Scroll up button for select content with long lists\n *\n * Automatically appears when content is scrollable upward, providing intuitive navigation\n * for users with large option lists.\n *\n * @param className - Additional CSS classes for custom styling\n */\nconst SelectScrollUpButton: FC<\n ComponentProps<typeof SelectPrimitive.ScrollUpButton>\n> = ({ className, ...props }) => (\n <SelectPrimitive.ScrollUpButton\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n);\n\n/**\n * Scroll down button for select content with long lists\n *\n * Automatically appears when content is scrollable downward, providing clear visual\n * indication of additional options below the current view.\n *\n * @param className - Additional CSS classes for custom styling\n */\nconst SelectScrollDownButton: FC<\n ComponentProps<typeof SelectPrimitive.ScrollDownButton>\n> = ({ className, ...props }) => (\n <SelectPrimitive.ScrollDownButton\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n);\n\n/**\n * Select dropdown content container with positioning and animation\n *\n * Provides the dropdown interface containing all selectable options. Features smooth\n * animations, flexible positioning strategies, and responsive design for optimal UX.\n *\n * @param position - Positioning strategy for the dropdown content\n * @param className - Additional CSS classes for custom styling\n * @param children - Select items, labels, and separators\n *\n * @example\n * ```tsx\n * <Select.Content position={SelectContentPosition.POPPER}>\n * <Select.Item value=\"option1\">Option 1</Select.Item>\n * <Select.Item value=\"option2\">Option 2</Select.Item>\n * </Select.Content>\n * ```\n */\nexport const SelectContent: FC<\n ComponentProps<typeof SelectPrimitive.Content>\n> = ({\n className,\n children,\n position = SelectContentPosition.POPPER,\n ...props\n}) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n className={cn(\n // Base styles\n 'relative z-50 max-h-96 min-w-32 overflow-hidden',\n 'rounded-xl shadow-md',\n\n // Background and text\n 'bg-white dark:bg-neutral-950',\n 'text-text',\n\n // Border\n 'border border-neutral-200 dark:border-neutral-800',\n\n // Animations\n 'data-[state=closed]:animate-out data-[state=open]:animate-in',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2',\n 'data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2',\n 'data-[side=top]:slide-in-from-bottom-2',\n\n // Positioning adjustments\n position === 'popper' &&\n 'data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1',\n\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n);\n\n/**\n * Label component for grouping select options\n *\n * Provides semantic grouping and visual organization of related options within\n * the select dropdown. Enhances accessibility and user experience.\n *\n * @param className - Additional CSS classes for custom styling\n *\n * @example\n * ```tsx\n * <Select.Content>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Separator />\n * <Select.Label>Vegetables</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * </Select.Content>\n * ```\n */\nexport const SelectLabel: FC<ComponentProps<typeof SelectPrimitive.Label>> = ({\n className,\n ...props\n}) => (\n <SelectPrimitive.Label\n className={cn('px-1 py-0.5 font-semibold text-sm', className)}\n {...props}\n />\n);\n\n/**\n * Individual selectable item within the dropdown\n *\n * Represents a single option that users can select. Features hover states,\n * selection indicators, and keyboard navigation support for accessible interaction.\n *\n * @param className - Additional CSS classes for custom styling\n * @param children - The display text/content for the option\n *\n * @example\n * ```tsx\n * <Select.Item value=\"dark-mode\">\n * 🌙 Dark Mode\n * </Select.Item>\n * ```\n */\nconst SelectItem: FC<ComponentProps<typeof SelectPrimitive.Item>> = ({\n className,\n children,\n ...props\n}) => (\n <SelectPrimitive.Item\n className={cn(\n 'relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n);\n\n/**\n * Visual separator for grouping options in the dropdown\n *\n * Creates clear visual division between groups of related options,\n * improving readability and organization in complex select menus.\n *\n * @param className - Additional CSS classes for custom styling\n *\n * @example\n * ```tsx\n * <Select.Content>\n * <Select.Item value=\"recent\">Recent Files</Select.Item>\n * <Select.Separator />\n * <Select.Item value=\"all\">All Files</Select.Item>\n * </Select.Content>\n * ```\n */\nexport const SelectSeparator: FC<\n ComponentProps<typeof SelectPrimitive.Separator>\n> = ({ className, ...props }) => (\n <SelectPrimitive.Separator\n className={cn(\n '-mx-1 my-1 h-px',\n 'bg-neutral-200 dark:bg-neutral-800',\n className\n )}\n {...props}\n />\n);\n\n/**\n * Type definition for the compound Select component with all subcomponents\n */\ntype SelectType = typeof SelectRoot & {\n /** Group container for organizing related options */\n Group: typeof SelectGroup;\n /** Value display component for the trigger */\n Value: typeof SelectValue;\n /** Trigger button that opens the dropdown */\n Trigger: typeof SelectTrigger;\n /** Scroll up button for long lists */\n ScrollUpButton: typeof SelectScrollUpButton;\n /** Scroll down button for long lists */\n ScrollDownButton: typeof SelectScrollDownButton;\n /** Dropdown content container */\n Content: typeof SelectContent;\n /** Label component for option groups */\n Label: typeof SelectLabel;\n /** Individual selectable item */\n Item: typeof SelectItem;\n /** Visual separator between option groups */\n Separator: typeof SelectSeparator;\n};\n\n/**\n * Select - A comprehensive dropdown selection component\n *\n * A fully-featured select component built on Radix UI primitives with extensive customization,\n * accessibility features, and design system integration. Supports single selection with\n * keyboard navigation, validation states, and flexible content positioning.\n *\n * ## Key Features\n * - **Accessibility First**: Full keyboard navigation, screen reader support, and ARIA attributes\n * - **Flexible Positioning**: Multiple positioning strategies for optimal dropdown placement\n * - **Validation Integration**: Built-in support for form validation with visual feedback\n * - **Design System**: Consistent theming with design tokens and style variants\n * - **Responsive Design**: Works seamlessly across desktop and mobile devices\n * - **Rich Content**: Support for icons, separators, labels, and complex option layouts\n *\n * ## Use Cases\n * - Form field selections (theme, language, category)\n * - Settings and configuration options\n * - Filter and sort controls\n * - User preference selections\n * - Any single-choice dropdown interface\n *\n * ## Accessibility\n * - **Keyboard Navigation**: Arrow keys, Enter, Escape, and Home/End support\n * - **Screen Readers**: Proper ARIA labels and state announcements\n * - **Focus Management**: Intuitive focus flow and visual indicators\n * - **High Contrast**: Supports system high contrast modes\n *\n * ## Architecture\n * The Select component follows a compound component pattern with the following structure:\n * - `Select` (root): Manages state and provides context\n * - `Select.Trigger`: Button that displays current value and opens dropdown\n * - `Select.Value`: Displays the selected value with placeholder support\n * - `Select.Content`: Container for the dropdown options\n * - `Select.Item`: Individual selectable options\n * - `Select.Label`: Group labels for organizing options\n * - `Select.Separator`: Visual dividers between option groups\n *\n * @example\n * Basic usage with simple options:\n * ```tsx\n * <Select defaultValue=\"system\">\n * <Select.Trigger>\n * <Select.Value placeholder=\"Choose theme...\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Item value=\"light\">☀️ Light</Select.Item>\n * <Select.Item value=\"dark\">🌙 Dark</Select.Item>\n * <Select.Item value=\"system\">⚙️ System</Select.Item>\n * </Select.Content>\n * </Select>\n * ```\n *\n * @example\n * Advanced usage with groups and labels:\n * ```tsx\n * <Select>\n * <Select.Trigger validationStyleEnabled>\n * <Select.Value placeholder=\"Select category...\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Label>Web Technologies</Select.Label>\n * <Select.Item value=\"react\">React</Select.Item>\n * <Select.Item value=\"vue\">Vue</Select.Item>\n * <Select.Separator />\n * <Select.Label>Mobile</Select.Label>\n * <Select.Item value=\"react-native\">React Native</Select.Item>\n * <Select.Item value=\"flutter\">Flutter</Select.Item>\n * </Select.Content>\n * </Select>\n * ```\n *\n * @example\n * Form integration with validation:\n * ```tsx\n * <form>\n * <Select required name=\"country\">\n * <Select.Trigger validationStyleEnabled aria-invalid={hasError}>\n * <Select.Value placeholder=\"Select country...\" />\n * </Select.Trigger>\n * <Select.Content position={SelectContentPosition.ITEM_ALIGNED}>\n * <Select.Item value=\"us\">United States</Select.Item>\n * <Select.Item value=\"ca\">Canada</Select.Item>\n * <Select.Item value=\"uk\">United Kingdom</Select.Item>\n * </Select.Content>\n * </Select>\n * </form>\n * ```\n */\nexport const Select = SelectRoot as SelectType;\nSelect.Group = SelectGroup;\nSelect.Value = SelectValue;\nSelect.Trigger = SelectTrigger;\nSelect.ScrollUpButton = SelectScrollUpButton;\nSelect.ScrollDownButton = SelectScrollDownButton;\nSelect.Content = SelectContent;\nSelect.Label = SelectLabel;\nSelect.Item = SelectItem;\nSelect.Separator = SelectSeparator;\n"],"mappings":"qPAiBA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,OAAA,SAEA,EAAA,aAAA,qBACD,CAED,MAAM,EAAa,EAAgB,KAC7B,EAAc,EAAgB,MAC9B,EAAc,EAAgB,MAmB9B,GAcD,CAAE,yBAAyB,GAAO,YAAW,WAAU,GAAG,KAC7D,EAAC,EAAgB,QAAjB,CACE,UAAW,EAET,4EACA,4DAGA,kFAGA,oBAGA,oCACA,YAGA,SACA,6BACA,uBACA,iCACA,sCAEA,kCACA,6CAGA,4CAGA,kDACA,4BACA,wBAGA,GAA0B,4CAE1B,EACD,CACD,GAAI,WAvCN,CAyCG,EACD,EAAC,EAAgB,KAAjB,CAAsB,QAAA,YACpB,EAAC,EAAD,CAAgB,UAAU,oBAAsB,CAAA,CAC3B,CAAA,CACC,GAWtB,GAED,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,eAAjB,CACE,UAAW,EACT,uDACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAiB,CAAA,CACc,CAAA,CAW7B,GAED,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,iBAAjB,CACE,UAAW,EACT,uDACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAmB,CAAA,CACc,CAAA,CAqBxB,GAER,CACH,YACA,WACA,WAAW,EAAsB,OACjC,GAAG,KAEH,EAAC,EAAgB,OAAjB,CAAA,SACE,EAAC,EAAgB,QAAjB,CACE,UAAW,EAET,kDACA,uBAGA,+BACA,YAGA,oDAGA,+DACA,6DACA,+DACA,yCACA,yCACA,yCACA,yCAGA,IAAa,UACX,kIAEF,EACD,CACS,WACV,GAAI,WA7BN,CA+BE,EAAC,EAAD,EAAwB,CAAA,CACxB,EAAC,EAAgB,SAAjB,CACE,UAAW,EACT,MACA,IAAa,UACX,gFACH,CAEA,WACwB,CAAA,CAC3B,EAAC,EAAD,EAA0B,CAAA,CACF,GACH,CAAA,CAuBd,GAAiE,CAC5E,YACA,GAAG,KAEH,EAAC,EAAgB,MAAjB,CACE,UAAW,EAAG,oCAAqC,EAAU,CAC7D,GAAI,EACJ,CAAA,CAmBE,GAA+D,CACnE,YACA,WACA,GAAG,KAEH,EAAC,EAAgB,KAAjB,CACE,UAAW,EACT,iMACA,EACD,CACD,GAAI,WALN,CAOE,EAAC,OAAD,CAAM,UAAU,sEACd,EAAC,EAAgB,cAAjB,CAAA,SACE,EAAC,EAAD,CAAW,UAAU,SAAW,CAAA,CACF,CAAA,CAC3B,CAAA,CACP,EAAC,EAAgB,SAAjB,CAA2B,WAAoC,CAAA,CAC1C,GAoBZ,GAER,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,UAAjB,CACE,UAAW,EACT,kBACA,qCACA,EACD,CACD,GAAI,EACJ,CAAA,CAoHS,EAAS,EACtB,EAAO,MAAQ,EACf,EAAO,MAAQ,EACf,EAAO,QAAU,EACjB,EAAO,eAAiB,EACxB,EAAO,iBAAmB,EAC1B,EAAO,QAAU,EACjB,EAAO,MAAQ,EACf,EAAO,KAAO,EACd,EAAO,UAAY"}
1
+ {"version":3,"file":"Select.mjs","names":[],"sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["'use client';\n\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { cn } from '@utils/cn';\nimport {\n CheckIcon,\n ChevronDownIcon,\n ChevronsUpDown,\n ChevronUpIcon,\n} from 'lucide-react';\nimport type { ComponentProps, FC } from 'react';\n\n/**\n * Enum for Select content positioning strategies\n *\n * @enum SelectContentPosition\n */\nexport enum SelectContentPosition {\n /** Position relative to the trigger with automatic placement */\n POPPER = 'popper',\n /** Align content with the selected item */\n ITEM_ALIGNED = 'item-aligned',\n}\n\nconst SelectRoot = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\n/**\n * Select trigger button component that displays the current selection and opens the dropdown\n *\n * Features comprehensive styling with validation states, focus management, and accessibility support.\n * Uses design tokens for consistent theming across the application.\n *\n * @param validationStyleEnabled - Enables automatic success/error styling based on form validation state\n * @param className - Additional CSS classes for custom styling\n * @param children - Content to display inside the trigger (typically SelectValue)\n *\n * @example\n * ```tsx\n * <Select.Trigger validationStyleEnabled>\n * <Select.Value placeholder=\"Choose option...\" />\n * </Select.Trigger>\n * ```\n */\nconst SelectTrigger: FC<\n ComponentProps<typeof SelectPrimitive.Trigger> & {\n /**\n * Enables success/error border styling based on HTML5 validation state\n * @default false\n * @example\n * ```tsx\n * <Select.Trigger validationStyleEnabled>\n * <Select.Value placeholder=\"Required field\" />\n * </Select.Trigger>\n * ```\n */\n validationStyleEnabled?: boolean;\n }\n> = ({ validationStyleEnabled = false, className, children, ...props }) => (\n <SelectPrimitive.Trigger\n suppressHydrationWarning\n className={cn(\n // Base layout and typography\n 'flex w-full cursor-pointer items-center justify-between whitespace-nowrap',\n 'select-text text-base shadow-none outline-none md:text-sm',\n\n // Corner shape\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n\n // Spacing\n 'px-2 py-3 md:py-2',\n\n // Background and text\n 'bg-neutral-50 dark:bg-neutral-950',\n 'text-text',\n\n // Focus ring\n 'ring-0',\n 'focus-visible:outline-none',\n 'focus-visible:ring-3',\n 'focus-visible:ring-neutral-200',\n 'dark:focus-visible:ring-neutral-500',\n\n 'focus-visible:ring-offset-white',\n 'dark:focus-visible:ring-offset-neutral-500',\n\n // Remove box-shadow\n '[box-shadow:none] focus:[box-shadow:none]',\n\n // States\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-error',\n '[&>span]:line-clamp-1',\n\n // Validation styles\n validationStyleEnabled && 'valid:border-success invalid:border-error',\n\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronsUpDown className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n);\n\n/**\n * Scroll up button for select content with long lists\n *\n * Automatically appears when content is scrollable upward, providing intuitive navigation\n * for users with large option lists.\n *\n * @param className - Additional CSS classes for custom styling\n */\nconst SelectScrollUpButton: FC<\n ComponentProps<typeof SelectPrimitive.ScrollUpButton>\n> = ({ className, ...props }) => (\n <SelectPrimitive.ScrollUpButton\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n);\n\n/**\n * Scroll down button for select content with long lists\n *\n * Automatically appears when content is scrollable downward, providing clear visual\n * indication of additional options below the current view.\n *\n * @param className - Additional CSS classes for custom styling\n */\nconst SelectScrollDownButton: FC<\n ComponentProps<typeof SelectPrimitive.ScrollDownButton>\n> = ({ className, ...props }) => (\n <SelectPrimitive.ScrollDownButton\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n);\n\n/**\n * Select dropdown content container with positioning and animation\n *\n * Provides the dropdown interface containing all selectable options. Features smooth\n * animations, flexible positioning strategies, and responsive design for optimal UX.\n *\n * @param position - Positioning strategy for the dropdown content\n * @param className - Additional CSS classes for custom styling\n * @param children - Select items, labels, and separators\n *\n * @example\n * ```tsx\n * <Select.Content position={SelectContentPosition.POPPER}>\n * <Select.Item value=\"option1\">Option 1</Select.Item>\n * <Select.Item value=\"option2\">Option 2</Select.Item>\n * </Select.Content>\n * ```\n */\nexport const SelectContent: FC<\n ComponentProps<typeof SelectPrimitive.Content>\n> = ({\n className,\n children,\n position = SelectContentPosition.POPPER,\n ...props\n}) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n className={cn(\n // Base styles\n 'relative z-50 max-h-96 min-w-32 overflow-hidden',\n 'rounded-xl shadow-md',\n\n // Background and text\n 'bg-white dark:bg-neutral-950',\n 'text-text',\n\n // Border\n 'border border-neutral-200 dark:border-neutral-800',\n\n // Animations\n 'data-[state=closed]:animate-out data-[state=open]:animate-in',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2',\n 'data-[side=left]:slide-in-from-right-2',\n 'data-[side=right]:slide-in-from-left-2',\n 'data-[side=top]:slide-in-from-bottom-2',\n\n // Positioning adjustments\n position === 'popper' &&\n 'data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1',\n\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n);\n\n/**\n * Label component for grouping select options\n *\n * Provides semantic grouping and visual organization of related options within\n * the select dropdown. Enhances accessibility and user experience.\n *\n * @param className - Additional CSS classes for custom styling\n *\n * @example\n * ```tsx\n * <Select.Content>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Separator />\n * <Select.Label>Vegetables</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * </Select.Content>\n * ```\n */\nexport const SelectLabel: FC<ComponentProps<typeof SelectPrimitive.Label>> = ({\n className,\n ...props\n}) => (\n <SelectPrimitive.Label\n className={cn('px-1 py-0.5 font-semibold text-sm', className)}\n {...props}\n />\n);\n\n/**\n * Individual selectable item within the dropdown\n *\n * Represents a single option that users can select. Features hover states,\n * selection indicators, and keyboard navigation support for accessible interaction.\n *\n * @param className - Additional CSS classes for custom styling\n * @param children - The display text/content for the option\n *\n * @example\n * ```tsx\n * <Select.Item value=\"dark-mode\">\n * 🌙 Dark Mode\n * </Select.Item>\n * ```\n */\nconst SelectItem: FC<ComponentProps<typeof SelectPrimitive.Item>> = ({\n className,\n children,\n ...props\n}) => (\n <SelectPrimitive.Item\n className={cn(\n 'relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n);\n\n/**\n * Visual separator for grouping options in the dropdown\n *\n * Creates clear visual division between groups of related options,\n * improving readability and organization in complex select menus.\n *\n * @param className - Additional CSS classes for custom styling\n *\n * @example\n * ```tsx\n * <Select.Content>\n * <Select.Item value=\"recent\">Recent Files</Select.Item>\n * <Select.Separator />\n * <Select.Item value=\"all\">All Files</Select.Item>\n * </Select.Content>\n * ```\n */\nexport const SelectSeparator: FC<\n ComponentProps<typeof SelectPrimitive.Separator>\n> = ({ className, ...props }) => (\n <SelectPrimitive.Separator\n className={cn(\n '-mx-1 my-1 h-px',\n 'bg-neutral-200 dark:bg-neutral-800',\n className\n )}\n {...props}\n />\n);\n\n/**\n * Type definition for the compound Select component with all subcomponents\n */\ntype SelectType = typeof SelectRoot & {\n /** Group container for organizing related options */\n Group: typeof SelectGroup;\n /** Value display component for the trigger */\n Value: typeof SelectValue;\n /** Trigger button that opens the dropdown */\n Trigger: typeof SelectTrigger;\n /** Scroll up button for long lists */\n ScrollUpButton: typeof SelectScrollUpButton;\n /** Scroll down button for long lists */\n ScrollDownButton: typeof SelectScrollDownButton;\n /** Dropdown content container */\n Content: typeof SelectContent;\n /** Label component for option groups */\n Label: typeof SelectLabel;\n /** Individual selectable item */\n Item: typeof SelectItem;\n /** Visual separator between option groups */\n Separator: typeof SelectSeparator;\n};\n\n/**\n * Select - A comprehensive dropdown selection component\n *\n * A fully-featured select component built on Radix UI primitives with extensive customization,\n * accessibility features, and design system integration. Supports single selection with\n * keyboard navigation, validation states, and flexible content positioning.\n *\n * ## Key Features\n * - **Accessibility First**: Full keyboard navigation, screen reader support, and ARIA attributes\n * - **Flexible Positioning**: Multiple positioning strategies for optimal dropdown placement\n * - **Validation Integration**: Built-in support for form validation with visual feedback\n * - **Design System**: Consistent theming with design tokens and style variants\n * - **Responsive Design**: Works seamlessly across desktop and mobile devices\n * - **Rich Content**: Support for icons, separators, labels, and complex option layouts\n *\n * ## Use Cases\n * - Form field selections (theme, language, category)\n * - Settings and configuration options\n * - Filter and sort controls\n * - User preference selections\n * - Any single-choice dropdown interface\n *\n * ## Accessibility\n * - **Keyboard Navigation**: Arrow keys, Enter, Escape, and Home/End support\n * - **Screen Readers**: Proper ARIA labels and state announcements\n * - **Focus Management**: Intuitive focus flow and visual indicators\n * - **High Contrast**: Supports system high contrast modes\n *\n * ## Architecture\n * The Select component follows a compound component pattern with the following structure:\n * - `Select` (root): Manages state and provides context\n * - `Select.Trigger`: Button that displays current value and opens dropdown\n * - `Select.Value`: Displays the selected value with placeholder support\n * - `Select.Content`: Container for the dropdown options\n * - `Select.Item`: Individual selectable options\n * - `Select.Label`: Group labels for organizing options\n * - `Select.Separator`: Visual dividers between option groups\n *\n * @example\n * Basic usage with simple options:\n * ```tsx\n * <Select defaultValue=\"system\">\n * <Select.Trigger>\n * <Select.Value placeholder=\"Choose theme...\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Item value=\"light\">☀️ Light</Select.Item>\n * <Select.Item value=\"dark\">🌙 Dark</Select.Item>\n * <Select.Item value=\"system\">⚙️ System</Select.Item>\n * </Select.Content>\n * </Select>\n * ```\n *\n * @example\n * Advanced usage with groups and labels:\n * ```tsx\n * <Select>\n * <Select.Trigger validationStyleEnabled>\n * <Select.Value placeholder=\"Select category...\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Label>Web Technologies</Select.Label>\n * <Select.Item value=\"react\">React</Select.Item>\n * <Select.Item value=\"vue\">Vue</Select.Item>\n * <Select.Separator />\n * <Select.Label>Mobile</Select.Label>\n * <Select.Item value=\"react-native\">React Native</Select.Item>\n * <Select.Item value=\"flutter\">Flutter</Select.Item>\n * </Select.Content>\n * </Select>\n * ```\n *\n * @example\n * Form integration with validation:\n * ```tsx\n * <form>\n * <Select required name=\"country\">\n * <Select.Trigger validationStyleEnabled aria-invalid={hasError}>\n * <Select.Value placeholder=\"Select country...\" />\n * </Select.Trigger>\n * <Select.Content position={SelectContentPosition.ITEM_ALIGNED}>\n * <Select.Item value=\"us\">United States</Select.Item>\n * <Select.Item value=\"ca\">Canada</Select.Item>\n * <Select.Item value=\"uk\">United Kingdom</Select.Item>\n * </Select.Content>\n * </Select>\n * </form>\n * ```\n */\nexport const Select = SelectRoot as SelectType;\nSelect.Group = SelectGroup;\nSelect.Value = SelectValue;\nSelect.Trigger = SelectTrigger;\nSelect.ScrollUpButton = SelectScrollUpButton;\nSelect.ScrollDownButton = SelectScrollDownButton;\nSelect.Content = SelectContent;\nSelect.Label = SelectLabel;\nSelect.Item = SelectItem;\nSelect.Separator = SelectSeparator;\n"],"mappings":"qPAiBA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,OAAA,SAEA,EAAA,aAAA,qBACD,CAED,MAAM,EAAa,EAAgB,KAC7B,EAAc,EAAgB,MAC9B,EAAc,EAAgB,MAmB9B,GAcD,CAAE,yBAAyB,GAAO,YAAW,WAAU,GAAG,KAC7D,EAAC,EAAgB,QAAjB,CACE,yBAAA,GACA,UAAW,EAET,4EACA,4DAGA,kFAGA,oBAGA,oCACA,YAGA,SACA,6BACA,uBACA,iCACA,sCAEA,kCACA,6CAGA,4CAGA,kDACA,4BACA,wBAGA,GAA0B,4CAE1B,EACD,CACD,GAAI,WAxCN,CA0CG,EACD,EAAC,EAAgB,KAAjB,CAAsB,QAAA,YACpB,EAAC,EAAD,CAAgB,UAAU,oBAAsB,CAAA,CAC3B,CAAA,CACC,GAWtB,GAED,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,eAAjB,CACE,UAAW,EACT,uDACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAiB,CAAA,CACc,CAAA,CAW7B,GAED,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,iBAAjB,CACE,UAAW,EACT,uDACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAmB,CAAA,CACc,CAAA,CAqBxB,GAER,CACH,YACA,WACA,WAAW,EAAsB,OACjC,GAAG,KAEH,EAAC,EAAgB,OAAjB,CAAA,SACE,EAAC,EAAgB,QAAjB,CACE,UAAW,EAET,kDACA,uBAGA,+BACA,YAGA,oDAGA,+DACA,6DACA,+DACA,yCACA,yCACA,yCACA,yCAGA,IAAa,UACX,kIAEF,EACD,CACS,WACV,GAAI,WA7BN,CA+BE,EAAC,EAAD,EAAwB,CAAA,CACxB,EAAC,EAAgB,SAAjB,CACE,UAAW,EACT,MACA,IAAa,UACX,gFACH,CAEA,WACwB,CAAA,CAC3B,EAAC,EAAD,EAA0B,CAAA,CACF,GACH,CAAA,CAuBd,GAAiE,CAC5E,YACA,GAAG,KAEH,EAAC,EAAgB,MAAjB,CACE,UAAW,EAAG,oCAAqC,EAAU,CAC7D,GAAI,EACJ,CAAA,CAmBE,GAA+D,CACnE,YACA,WACA,GAAG,KAEH,EAAC,EAAgB,KAAjB,CACE,UAAW,EACT,iMACA,EACD,CACD,GAAI,WALN,CAOE,EAAC,OAAD,CAAM,UAAU,sEACd,EAAC,EAAgB,cAAjB,CAAA,SACE,EAAC,EAAD,CAAW,UAAU,SAAW,CAAA,CACF,CAAA,CAC3B,CAAA,CACP,EAAC,EAAgB,SAAjB,CAA2B,WAAoC,CAAA,CAC1C,GAoBZ,GAER,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,UAAjB,CACE,UAAW,EACT,kBACA,qCACA,EACD,CACD,GAAI,EACJ,CAAA,CAoHS,EAAS,EACtB,EAAO,MAAQ,EACf,EAAO,MAAQ,EACf,EAAO,QAAU,EACjB,EAAO,eAAiB,EACxB,EAAO,iBAAmB,EAC1B,EAAO,QAAU,EACjB,EAAO,MAAQ,EACf,EAAO,KAAO,EACd,EAAO,UAAY"}
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Button as t}from"../Button/Button.mjs";import{ExpandCollapse as n}from"../ExpandCollapse/ExpandCollapse.mjs";import{Modal as r,ModalSize as i}from"../Modal/Modal.mjs";import{MoveDiagonal as a}from"lucide-react";import{useState as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=({className:u,isRollable:d=!1,displayModal:f,...p})=>{let[m,h]=o(!1);return l(`div`,{className:`relative`,children:[f&&c(`div`,{className:`sticky top-48 z-10`,children:c(`div`,{className:`absolute top-4 right-2`,children:c(t,{variant:`hoverable`,size:`icon-md`,onClick:()=>{h(!0)},label:`Move`,Icon:a})})}),c(n,{isRollable:d,className:`max-w-full overflow-x-auto`,children:c(`table`,{className:e(`min-w-full max-w-full table-auto overflow-x-auto bg-background text-left`,u),...p})}),c(r,{isOpen:m,onClose:()=>h(!1),size:i.XL,hasCloseButton:!0,children:m?c(`div`,{className:`grid`,children:c(`table`,{className:e(`min-w-full max-w-full table-auto text-left`,u),...p})}):c(s,{})})]})};export{u as Table};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{Button as t}from"../Button/Button.mjs";import{ExpandCollapse as n}from"../ExpandCollapse/ExpandCollapse.mjs";import{Modal as r,ModalSize as i}from"../Modal/Modal.mjs";import{useState as a}from"react";import{MoveDiagonal as o}from"lucide-react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=({className:u,isRollable:d=!1,displayModal:f,...p})=>{let[m,h]=a(!1);return l(`div`,{className:`relative`,children:[f&&c(`div`,{className:`sticky top-48 z-10`,children:c(`div`,{className:`absolute top-4 right-2`,children:c(t,{variant:`hoverable`,size:`icon-md`,onClick:()=>{h(!0)},label:`Move`,Icon:o})})}),c(n,{isRollable:d,className:`max-w-full overflow-x-auto`,children:c(`table`,{className:e(`min-w-full max-w-full table-auto overflow-x-auto bg-background text-left`,u),...p})}),c(r,{isOpen:m,onClose:()=>h(!1),size:i.XL,hasCloseButton:!0,children:m?c(`div`,{className:`grid`,children:c(`table`,{className:e(`min-w-full max-w-full table-auto text-left`,u),...p})}):c(s,{})})]})};export{u as Table};
2
2
  //# sourceMappingURL=Table.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonVariant as n}from"../Button/Button.mjs";import{DropDown as r}from"../DropDown/index.mjs";import{Modes as i}from"./types.mjs";import{CircleDashed as a,Moon as o,Sun as s}from"lucide-react";import{useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=({Icon:e,children:r,...i})=>l(`div`,{className:`relative w-full p-0.5`,children:l(t,{className:`w-full cursor-pointer rounded-lg p-1 text-left hover:bg-text/10 focus:bg-text-opposite/20 focus:outline-hidden disabled:text-white/25`,Icon:e,"data-mode":`system`,role:`option`,variant:n.NONE,...i,children:r})}),f=({theme:t,setTheme:n,systemTheme:f})=>{let[p,m]=c(f===t?i.system:t),h=e=>{e===i.system?n(f??i.light):n(e),m(e)},g=`theme-switcher`;return u(r,{identifier:g,children:[u(r.Trigger,{className:`p-2`,identifier:g,"aria-label":`Theme selector`,children:[p===i.system&&l(a,{"data-mode":`system`}),p===i.light&&l(s,{"data-mode":`light`}),p===i.dark&&l(o,{"data-mode":`dark`})]}),l(r.Panel,{identifier:g,isFocusable:!0,isOverable:!0,children:u(e,{className:`min-w-[100px] items-start p-1`,separator:`y`,children:[l(d,{Icon:a,onClick:()=>h(i.system),isActive:p===i.system,label:`Restore to system mode`,children:`System`}),l(d,{Icon:s,onClick:()=>h(i.light),isActive:p===i.light,label:`Switch to light mode`,children:`Light`}),l(d,{Icon:o,onClick:()=>h(i.dark),isActive:p===i.dark,label:`Switch to dark mode`,children:`Dark`})]})})]})};export{f as DesktopThemeSwitcher};
1
+ "use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonVariant as n}from"../Button/Button.mjs";import{DropDown as r}from"../DropDown/index.mjs";import{Modes as i}from"./types.mjs";import{useState as a}from"react";import{CircleDashed as o,Moon as s,Sun as c}from"lucide-react";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=({Icon:e,children:r,...i})=>l(`div`,{className:`relative w-full p-0.5`,children:l(t,{className:`w-full cursor-pointer rounded-lg p-1 text-left hover:bg-text/10 focus:bg-text-opposite/20 focus:outline-hidden disabled:text-white/25`,Icon:e,"data-mode":`system`,role:`option`,variant:n.NONE,...i,children:r})}),f=({theme:t,setTheme:n,systemTheme:f})=>{let[p,m]=a(f===t?i.system:t),h=e=>{e===i.system?n(f??i.light):n(e),m(e)},g=`theme-switcher`;return u(r,{identifier:g,children:[u(r.Trigger,{className:`p-2`,identifier:g,"aria-label":`Theme selector`,children:[p===i.system&&l(o,{"data-mode":`system`}),p===i.light&&l(c,{"data-mode":`light`}),p===i.dark&&l(s,{"data-mode":`dark`})]}),l(r.Panel,{identifier:g,isFocusable:!0,isOverable:!0,children:u(e,{className:`min-w-[100px] items-start p-1`,separator:`y`,children:[l(d,{Icon:o,onClick:()=>h(i.system),isActive:p===i.system,label:`Restore to system mode`,children:`System`}),l(d,{Icon:c,onClick:()=>h(i.light),isActive:p===i.light,label:`Switch to light mode`,children:`Light`}),l(d,{Icon:s,onClick:()=>h(i.dark),isActive:p===i.dark,label:`Switch to dark mode`,children:`Dark`})]})})]})};export{f as DesktopThemeSwitcher};
2
2
  //# sourceMappingURL=DesktopThemeSwitcher.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{Modes as t}from"./types.mjs";import{CircleDashed as n,Moon as r,Sun as i}from"lucide-react";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=({isCurrentMode:t,isNextMode:n})=>e(`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,`opacity-0 transition-opacity duration-300 ease-in-out`,t&&`opacity-100 group-hover:opacity-0`,n&&`group-hover:opacity-100`),l=({theme:e,systemTheme:l,setTheme:u})=>{let d=l===e,[f,p]=a(d?t.system:e),m=f===t.system?e===t.dark?t.light:t.dark:d?t.system:f===t.light?t.dark:t.light,h=()=>{m===t.system?u(l??t.light):u(m),p(m)};return s(`button`,{className:`group relative size-10`,"aria-label":`Theme selector`,children:[o(n,{className:c({isCurrentMode:f===t.system,isNextMode:m===t.system}),onClick:h,"data-mode":`system`}),o(r,{className:c({isCurrentMode:f===t.light,isNextMode:m===t.light}),onClick:h,"data-mode":`light`}),o(i,{className:c({isCurrentMode:f===t.dark,isNextMode:m===t.dark}),onClick:h,"data-mode":`dark`})]})};export{l as MobileThemeSwitcher};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{Modes as t}from"./types.mjs";import{useState as n}from"react";import{CircleDashed as r,Moon as i,Sun as a}from"lucide-react";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=({isCurrentMode:t,isNextMode:n})=>e(`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,`opacity-0 transition-opacity duration-300 ease-in-out`,t&&`opacity-100 group-hover:opacity-0`,n&&`group-hover:opacity-100`),l=({theme:e,systemTheme:l,setTheme:u})=>{let d=l===e,[f,p]=n(d?t.system:e),m=f===t.system?e===t.dark?t.light:t.dark:d?t.system:f===t.light?t.dark:t.light,h=()=>{m===t.system?u(l??t.light):u(m),p(m)};return s(`button`,{className:`group relative size-10`,"aria-label":`Theme selector`,children:[o(r,{className:c({isCurrentMode:f===t.system,isNextMode:m===t.system}),onClick:h,"data-mode":`system`}),o(i,{className:c({isCurrentMode:f===t.light,isNextMode:m===t.light}),onClick:h,"data-mode":`light`}),o(a,{className:c({isCurrentMode:f===t.dark,isNextMode:m===t.dark}),onClick:h,"data-mode":`dark`})]})};export{l as MobileThemeSwitcher};
2
2
  //# sourceMappingURL=MobileThemeSwitcher.mjs.map
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{X as t}from"lucide-react";import{cva as n}from"class-variance-authority";import{jsx as r}from"react/jsx-runtime";import*as i from"@radix-ui/react-toast";const a=i,o=({className:t,...n})=>r(i.Viewport,{className:e(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]`,t),...n}),s=n(`group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none`,{variants:{variant:{error:`bg-error/40 text-text`,success:`bg-success/30 text-text`,default:`bg-card/80 text-text`}},defaultVariants:{variant:`default`}}),c=({className:t,variant:n,...a})=>r(i.Root,{className:e(s({variant:n}),t),...a}),l=({className:t,...n})=>r(i.Action,{className:e(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 font-medium text-sm transition-colors hover:bg-text focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:focus:ring-destructive group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground`,t),...n}),u=({className:n,...a})=>r(i.Close,{className:e(`absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.destructive]:hover:text-red-50`,n),"toast-close":``,...a,children:r(t,{className:`size-5`})}),d=({className:t,...n})=>r(i.Title,{className:e(`font-semibold text-sm [&+div]:text-xs`,t),...n}),f=({className:t,...n})=>r(i.Description,{className:e(`text-sm opacity-90`,t),...n});export{c as Toast,l as ToastAction,u as ToastClose,f as ToastDescription,a as ToastProvider,d as ToastTitle,o as ToastViewport};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import*as t from"@radix-ui/react-toast";import{cva as n}from"class-variance-authority";import{X as r}from"lucide-react";import{jsx as i}from"react/jsx-runtime";const a=t,o=({className:n,...r})=>i(t.Viewport,{className:e(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]`,n),...r}),s=n(`group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none`,{variants:{variant:{error:`bg-error/40 text-text`,success:`bg-success/30 text-text`,default:`bg-card/80 text-text`}},defaultVariants:{variant:`default`}}),c=({className:n,variant:r,...a})=>i(t.Root,{className:e(s({variant:r}),n),...a}),l=({className:n,...r})=>i(t.Action,{className:e(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 font-medium text-sm transition-colors hover:bg-text focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:focus:ring-destructive group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground`,n),...r}),u=({className:n,...a})=>i(t.Close,{className:e(`absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.destructive]:hover:text-red-50`,n),"toast-close":``,...a,children:i(r,{className:`size-5`})}),d=({className:n,...r})=>i(t.Title,{className:e(`font-semibold text-sm [&+div]:text-xs`,n),...r}),f=({className:n,...r})=>i(t.Description,{className:e(`text-sm opacity-90`,n),...r});export{c as Toast,l as ToastAction,u as ToastClose,f as ToastDescription,a as ToastProvider,d as ToastTitle,o as ToastViewport};
2
2
  //# sourceMappingURL=Toast.mjs.map
@@ -1 +1 @@
1
- import{Container as e,ContainerBackground as t,ContainerBorderColor as n,ContainerGap as r,ContainerPadding as i,ContainerRoundedSize as a,ContainerSeparator as o,ContainerTransparency as s,containerVariants as c}from"./Container/index.mjs";import{Loader as l}from"./Loader/index.mjs";import{Button as u,ButtonColor as d,ButtonSize as f,ButtonTextAlign as p,ButtonVariant as m,buttonVariants as h}from"./Button/Button.mjs";import{MaxHeightSmoother as g}from"./MaxHeightSmoother/index.mjs";import{Accordion as _}from"./Accordion/Accordion.mjs";import{Avatar as v,getCapitals as y}from"./Avatar/index.mjs";import{Badge as b,BadgeColor as x,BadgeSize as S,BadgeVariant as C,badgeVariants as w}from"./Badge/index.mjs";import{Link as T,LinkColor as E,LinkRoundedSize as D,LinkSize as O,LinkUnderlined as k,LinkVariant as A,checkIsExternalLink as j,isTextChildren as M,linkVariants as N}from"./Link/Link.mjs";import{Breadcrumb as P}from"./Breadcrumb/index.mjs";import{Checkbox as F,CheckboxColor as I,CheckboxSize as L,checkboxVariants as R}from"./Input/Checkbox.mjs";import{Input as z,InputSize as B,InputVariant as V,inputVariants as H}from"./Input/Input.mjs";import{InputPassword as U}from"./Input/InputPassword.mjs";import{InputIndicator as W,InputOTP as G,InputOTPGroup as K,InputOTPSeparator as q,InputOTPSlot as J,OTPInput as Y,OTPInputContext as X,inputSlotVariants as Z,usePasswordManagerBadge as Q,usePrevious as $}from"./Input/OTPInput.mjs";import{SearchInput as ee}from"./Input/SearchInput.mjs";import{Browser as te}from"./Browser/Browser.mjs";import{KeyList as ne,KeyboardShortcut as re}from"./KeyboardShortcut/KeyboardShortcut.mjs";import{Detail as ie,PopoverStatic as ae,PopoverXAlign as oe,PopoverYAlign as se}from"./Popover/static.mjs";import{Popover as ce}from"./Popover/dynamic.mjs";import{Carousel as le}from"./Carousel/index.mjs";import{ClickOutsideDiv as ue}from"./ClickOutsideDiv/index.mjs";import{CollapsibleTable as de}from"./CollapsibleTable/CollapsibleTable.mjs";import{Command as fe,CommandRoot as pe}from"./Command/index.mjs";import{PressableSpan as me}from"./PressableSpan/PressableSpan.mjs";import{ContentSelector as he}from"./ContentSelector/ContentSelector.mjs";import{CopyButton as ge}from"./CopyButton/index.mjs";import{CopyToClipboard as _e,useCopyToClipboard as ve}from"./CopyToClipboard/index.mjs";import{EditableFieldInput as ye}from"./EditableField/EditableFieldInput.mjs";import{TextArea as be}from"./TextArea/TextArea.mjs";import{AutoSizedTextArea as xe}from"./TextArea/AutoSizeTextArea.mjs";import{AutoCompleteTextarea as Se,useDebounce as Ce}from"./TextArea/AutocompleteTextArea.mjs";import{EditableFieldTextArea as we}from"./EditableField/EditableFieldTextArea.mjs";import{DictionaryEditor as Te}from"./DictionaryEditor/DictionaryEditor.mjs";import{DropDown as Ee,DropDownAlign as De,DropDownYAlign as Oe}from"./DropDown/index.mjs";import{SwitchSelector as ke,SwitchSelectorColor as Ae,SwitchSelectorSize as je}from"./SwitchSelector/index.mjs";import{LocaleSwitcherContentProvider as Me,useLocaleSwitcherContent as Ne}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{LocaleSwitcherContent as Pe}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";import{Label as Fe}from"./Label/index.mjs";import{H1 as Ie,H2 as Le,H3 as Re,H4 as ze,H5 as Be,H6 as Ve}from"./Headers/index.mjs";import{ExpandCollapse as He}from"./ExpandCollapse/ExpandCollapse.mjs";import{CodeBlock as Ue,CodeDefault as We}from"./IDE/CodeBlockClient.mjs";import{MultiSelect as Ge}from"./Select/Multiselect.mjs";import{Select as Ke,SelectContent as qe,SelectContentPosition as Je,SelectLabel as Ye,SelectSeparator as Xe}from"./Select/Select.mjs";import{Code as Ze}from"./IDE/Code.mjs";import{TabSelector as Qe,TabSelectorColor as $e}from"./TabSelector/TabSelector.mjs";import{Tab as et}from"./Tab/Tab.mjs";import{Modal as tt,ModalSize as nt}from"./Modal/Modal.mjs";import{Table as rt}from"./Table/Table.mjs";import{MarkdownRenderer as it,getIntlayerMarkdownOptions as at}from"./MarkDownRender/MarkDownRender.mjs";import{TextEditor as ot,TextEditorContainer as st,traceKeys as ct}from"./DictionaryFieldEditor/ContentEditorView/TextEditor.mjs";import{KeyPathBreadcrumb as lt}from"./DictionaryFieldEditor/KeyPathBreadcrumb.mjs";import{ContentEditor as ut}from"./DictionaryFieldEditor/ContentEditor.mjs";import{useFormField as dt}from"./Form/FormField.mjs";import{InformationTag as ft}from"./InformationTag/index.mjs";import{useForm as pt}from"./Form/FormBase.mjs";import{Form as mt}from"./Form/Form.mjs";import{DictionaryCreationForm as ht}from"./DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs";import{SaveForm as gt}from"./DictionaryFieldEditor/SaveForm/SaveForm.mjs";import{DictionaryFieldEditor as _t}from"./DictionaryFieldEditor/DictionaryFieldEditor.mjs";import{VersionSwitcherProvider as vt,useVersionSwitcher as yt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs";import{VersionSwitcher as bt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs";import{Flag as xt}from"./Flags/Flag.mjs";import{flags_exports as St}from"./Flags/flags.mjs";import{Logo as Ct}from"./Logo/Logo.mjs";import{LogoTextOnly as wt}from"./Logo/LogoTextOnly.mjs";import{LogoWithText as Tt}from"./Logo/LogoWithText.mjs";import{LogoWithTextBelow as Et}from"./Logo/LogoWithTextBelow.mjs";import{DiscordLogo as Dt}from"./SocialNetworks/DiscordLogo.mjs";import{InstagramLogo as Ot}from"./SocialNetworks/InstagramLogo.mjs";import{LinkedInLogo as kt}from"./SocialNetworks/LinkedInLogo.mjs";import{ProductHuntLogo as At}from"./SocialNetworks/ProductHuntLogo.mjs";import{TiktokLogo as jt}from"./SocialNetworks/TiktokLogo.mjs";import{XLogo as Mt}from"./SocialNetworks/XLogo.mjs";import{YoutubeLogo as Nt}from"./SocialNetworks/YoutubeLogo.mjs";import{FacebookLogo as Pt}from"./SocialNetworks/FacebookLogo.mjs";import{SocialNetworks as Ft}from"./SocialNetworks/index.mjs";import{Footer as It}from"./Footer/index.mjs";import{HeightResizer as Lt}from"./HeightResizer/index.mjs";import{HideShow as Rt}from"./HideShow/index.mjs";import{HTMLRenderer as zt,getIntlayerHTMLOptions as Bt}from"./HTMLRender/HTMLRender.mjs";import{FileList as Vt}from"./IDE/FileList.mjs";import{WithResizer as Ht}from"./WithResizer/index.mjs";import{IDE as Ut}from"./IDE/IDE.mjs";import{KeyboardScreenAdapter as Wt}from"./KeyboardScreenAdapter/index.mjs";import{LanguageBackground as Gt,LanguageSection as Kt}from"./LanguageBackground/index.mjs";import{LocaleSwitcher as qt}from"./LocaleSwitcherDropDown/LocaleSwitcher.mjs";import{MaxWidthSmoother as Jt}from"./MaxWidthSmoother/index.mjs";import{Navbar as Yt}from"./Navbar/index.mjs";import{NumberItemsSelector as Xt}from"./Pagination/NumberItemsSelector.mjs";import{Pagination as Zt,PaginationSize as Qt,PaginationVariant as $t,paginationVariants as en}from"./Pagination/Pagination.mjs";import{ShowingResultsNumberItems as tn}from"./Pagination/ShowingResultsNumberItems.mjs";import{DotPattern as nn}from"./Pattern/DotPattern.mjs";import{GridPattern as rn}from"./Pattern/GridPattern.mjs";import{Spotlight as an}from"./Pattern/SpotLight.mjs";import{drawerManager as on,useRightDrawer as sn}from"./RightDrawer/useRightDrawer.mjs";import{RightDrawer as cn}from"./RightDrawer/RightDrawer.mjs";import{Tag as ln,TagBackground as un,TagBorder as dn,TagColor as fn,TagRoundedSize as pn,TagSize as mn}from"./Tag/index.mjs";import{Terminal as hn}from"./Terminal/Terminal.mjs";import{Modes as gn}from"./ThemeSwitcherDropDown/types.mjs";import{DesktopThemeSwitcher as _n}from"./ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs";import{MobileThemeSwitcher as vn}from"./ThemeSwitcherDropDown/MobileThemeSwitcher.mjs";import{Toast as yn,ToastAction as bn,ToastClose as xn,ToastDescription as Sn,ToastProvider as Cn,ToastTitle as wn,ToastViewport as Tn}from"./Toaster/Toast.mjs";import{reducer as En,toast as Dn,useToast as On}from"./Toaster/useToast.mjs";import{Toaster as kn}from"./Toaster/Toaster.mjs";export{_ as Accordion,Se as AutoCompleteTextarea,xe as AutoSizedTextArea,v as Avatar,b as Badge,x as BadgeColor,S as BadgeSize,C as BadgeVariant,P as Breadcrumb,te as Browser,u as Button,d as ButtonColor,f as ButtonSize,p as ButtonTextAlign,m as ButtonVariant,le as Carousel,F as Checkbox,I as CheckboxColor,L as CheckboxSize,ue as ClickOutsideDiv,Ze as Code,Ue as CodeBlock,We as CodeDefault,de as CollapsibleTable,fe as Command,pe as CommandRoot,e as Container,t as ContainerBackground,n as ContainerBorderColor,r as ContainerGap,i as ContainerPadding,a as ContainerRoundedSize,o as ContainerSeparator,s as ContainerTransparency,ut as ContentEditor,he as ContentSelector,ge as CopyButton,_e as CopyToClipboard,_n as DesktopThemeSwitcher,ie as Detail,ht as DictionaryCreationForm,Te as DictionaryEditor,_t as DictionaryFieldEditor,Dt as DiscordLogo,nn as DotPattern,Ee as DropDown,De as DropDownAlign,Oe as DropDownYAlign,ye as EditableFieldInput,we as EditableFieldTextArea,He as ExpandCollapse,Pt as FacebookLogo,Vt as FileList,xt as Flag,St as Flags,It as Footer,mt as Form,rn as GridPattern,Ie as H1,Le as H2,Re as H3,ze as H4,Be as H5,Ve as H6,zt as HTMLRenderer,Lt as HeightResizer,Rt as HideShow,Ut as IDE,ft as InformationTag,z as Input,W as InputIndicator,G as InputOTP,K as InputOTPGroup,q as InputOTPSeparator,J as InputOTPSlot,U as InputPassword,B as InputSize,V as InputVariant,Ot as InstagramLogo,ne as KeyList,lt as KeyPathBreadcrumb,Wt as KeyboardScreenAdapter,re as KeyboardShortcut,Fe as Label,Gt as LanguageBackground,Kt as LanguageSection,T as Link,E as LinkColor,D as LinkRoundedSize,O as LinkSize,k as LinkUnderlined,A as LinkVariant,kt as LinkedInLogo,l as Loader,qt as LocaleSwitcher,Pe as LocaleSwitcherContent,Me as LocaleSwitcherContentProvider,Ct as Logo,wt as LogoTextOnly,Tt as LogoWithText,Et as LogoWithTextBelow,it as MarkdownRenderer,g as MaxHeightSmoother,Jt as MaxWidthSmoother,vn as MobileThemeSwitcher,tt as Modal,nt as ModalSize,gn as Modes,Ge as MultiSelect,Yt as Navbar,Xt as NumberItemsSelector,Y as OTPInput,X as OTPInputContext,Zt as Pagination,Qt as PaginationSize,$t as PaginationVariant,ce as Popover,ae as PopoverStatic,oe as PopoverXAlign,se as PopoverYAlign,me as PressableSpan,At as ProductHuntLogo,cn as RightDrawer,gt as SaveForm,ee as SearchInput,Ke as Select,qe as SelectContent,Je as SelectContentPosition,Ye as SelectLabel,Xe as SelectSeparator,tn as ShowingResultsNumberItems,Ft as SocialNetworks,an as Spotlight,ke as SwitchSelector,Ae as SwitchSelectorColor,je as SwitchSelectorSize,et as Tab,Qe as TabSelector,$e as TabSelectorColor,rt as Table,ln as Tag,un as TagBackground,dn as TagBorder,fn as TagColor,pn as TagRoundedSize,mn as TagSize,hn as Terminal,be as TextArea,ot as TextEditor,st as TextEditorContainer,jt as TiktokLogo,yn as Toast,bn as ToastAction,xn as ToastClose,Sn as ToastDescription,Cn as ToastProvider,wn as ToastTitle,Tn as ToastViewport,kn as Toaster,bt as VersionSwitcher,vt as VersionSwitcherProvider,Ht as WithResizer,Mt as XLogo,Nt as YoutubeLogo,w as badgeVariants,h as buttonVariants,j as checkIsExternalLink,R as checkboxVariants,c as containerVariants,on as drawerManager,y as getCapitals,Bt as getIntlayerHTMLOptions,at as getIntlayerMarkdownOptions,Z as inputSlotVariants,H as inputVariants,M as isTextChildren,N as linkVariants,en as paginationVariants,En as reducer,Dn as toast,ct as traceKeys,ve as useCopyToClipboard,Ce as useDebounce,pt as useForm,dt as useFormField,Ne as useLocaleSwitcherContent,Q as usePasswordManagerBadge,$ as usePrevious,sn as useRightDrawer,On as useToast,yt as useVersionSwitcher};
1
+ import{Toast as e,ToastAction as t,ToastClose as n,ToastDescription as r,ToastProvider as i,ToastTitle as a,ToastViewport as o}from"./Toaster/Toast.mjs";import{reducer as s,toast as c,useToast as l}from"./Toaster/useToast.mjs";import{Toaster as u}from"./Toaster/Toaster.mjs";import{Container as d,ContainerBackground as f,ContainerBorderColor as p,ContainerGap as m,ContainerPadding as h,ContainerRoundedSize as g,ContainerSeparator as _,ContainerTransparency as v,containerVariants as y}from"./Container/index.mjs";import{Loader as b}from"./Loader/index.mjs";import{Button as x,ButtonColor as S,ButtonSize as C,ButtonTextAlign as w,ButtonVariant as T,buttonVariants as E}from"./Button/Button.mjs";import{MaxHeightSmoother as D}from"./MaxHeightSmoother/index.mjs";import{Accordion as O}from"./Accordion/Accordion.mjs";import{Avatar as k,getCapitals as A}from"./Avatar/index.mjs";import{Badge as j,BadgeColor as M,BadgeSize as N,BadgeVariant as P,badgeVariants as F}from"./Badge/index.mjs";import{Link as I,LinkColor as L,LinkRoundedSize as R,LinkSize as z,LinkUnderlined as B,LinkVariant as V,checkIsExternalLink as H,isTextChildren as U,linkVariants as W}from"./Link/Link.mjs";import{Breadcrumb as G}from"./Breadcrumb/index.mjs";import{Checkbox as K,CheckboxColor as q,CheckboxSize as J,checkboxVariants as Y}from"./Input/Checkbox.mjs";import{Input as X,InputSize as Z,InputVariant as Q,inputVariants as $}from"./Input/Input.mjs";import{InputPassword as ee}from"./Input/InputPassword.mjs";import{InputIndicator as te,InputOTP as ne,InputOTPGroup as re,InputOTPSeparator as ie,InputOTPSlot as ae,OTPInput as oe,OTPInputContext as se,inputSlotVariants as ce,usePasswordManagerBadge as le,usePrevious as ue}from"./Input/OTPInput.mjs";import{SearchInput as de}from"./Input/SearchInput.mjs";import{Browser as fe}from"./Browser/Browser.mjs";import{KeyList as pe,KeyboardShortcut as me}from"./KeyboardShortcut/KeyboardShortcut.mjs";import{Detail as he,PopoverStatic as ge,PopoverXAlign as _e,PopoverYAlign as ve}from"./Popover/static.mjs";import{Popover as ye}from"./Popover/dynamic.mjs";import{Carousel as be}from"./Carousel/index.mjs";import{ClickOutsideDiv as xe}from"./ClickOutsideDiv/index.mjs";import{CollapsibleTable as Se}from"./CollapsibleTable/CollapsibleTable.mjs";import{Command as Ce,CommandRoot as we}from"./Command/index.mjs";import{PressableSpan as Te}from"./PressableSpan/PressableSpan.mjs";import{ContentSelector as Ee}from"./ContentSelector/ContentSelector.mjs";import{CopyButton as De}from"./CopyButton/index.mjs";import{CopyToClipboard as Oe,useCopyToClipboard as ke}from"./CopyToClipboard/index.mjs";import{EditableFieldInput as Ae}from"./EditableField/EditableFieldInput.mjs";import{TextArea as je}from"./TextArea/TextArea.mjs";import{AutoSizedTextArea as Me}from"./TextArea/AutoSizeTextArea.mjs";import{AutoCompleteTextarea as Ne,useDebounce as Pe}from"./TextArea/AutocompleteTextArea.mjs";import{EditableFieldTextArea as Fe}from"./EditableField/EditableFieldTextArea.mjs";import{DictionaryEditor as Ie}from"./DictionaryEditor/DictionaryEditor.mjs";import{DropDown as Le,DropDownAlign as Re,DropDownYAlign as ze}from"./DropDown/index.mjs";import{SwitchSelector as Be,SwitchSelectorColor as Ve,SwitchSelectorSize as He}from"./SwitchSelector/index.mjs";import{LocaleSwitcherContentProvider as Ue,useLocaleSwitcherContent as We}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{LocaleSwitcherContent as Ge}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";import{Label as Ke}from"./Label/index.mjs";import{H1 as qe,H2 as Je,H3 as Ye,H4 as Xe,H5 as Ze,H6 as Qe}from"./Headers/index.mjs";import{ExpandCollapse as $e}from"./ExpandCollapse/ExpandCollapse.mjs";import{CodeBlock as et,CodeDefault as tt}from"./IDE/CodeBlockClient.mjs";import{MultiSelect as nt}from"./Select/Multiselect.mjs";import{Select as rt,SelectContent as it,SelectContentPosition as at,SelectLabel as ot,SelectSeparator as st}from"./Select/Select.mjs";import{Code as ct}from"./IDE/Code.mjs";import{TabSelector as lt,TabSelectorColor as ut}from"./TabSelector/TabSelector.mjs";import{Tab as dt}from"./Tab/Tab.mjs";import{Modal as ft,ModalSize as pt}from"./Modal/Modal.mjs";import{Table as mt}from"./Table/Table.mjs";import{MarkdownRenderer as ht,baseMarkdownComponents as gt,getIntlayerMarkdownOptions as _t}from"./MarkDownRender/MarkDownRender.mjs";import{TextEditor as vt,TextEditorContainer as yt,traceKeys as bt}from"./DictionaryFieldEditor/ContentEditorView/TextEditor.mjs";import{KeyPathBreadcrumb as xt}from"./DictionaryFieldEditor/KeyPathBreadcrumb.mjs";import{ContentEditor as St}from"./DictionaryFieldEditor/ContentEditor.mjs";import{useFormField as Ct}from"./Form/FormField.mjs";import{InformationTag as wt}from"./InformationTag/index.mjs";import{useForm as Tt}from"./Form/FormBase.mjs";import{Form as Et}from"./Form/Form.mjs";import{DictionaryCreationForm as Dt}from"./DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs";import{SaveForm as Ot}from"./DictionaryFieldEditor/SaveForm/SaveForm.mjs";import{DictionaryFieldEditor as kt}from"./DictionaryFieldEditor/DictionaryFieldEditor.mjs";import{VersionSwitcherProvider as At,useVersionSwitcher as jt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs";import{VersionSwitcher as Mt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs";import{Flag as Nt}from"./Flags/Flag.mjs";import{flags_exports as Pt}from"./Flags/flags.mjs";import{Logo as Ft}from"./Logo/Logo.mjs";import{LogoTextOnly as It}from"./Logo/LogoTextOnly.mjs";import{LogoWithText as Lt}from"./Logo/LogoWithText.mjs";import{LogoWithTextBelow as Rt}from"./Logo/LogoWithTextBelow.mjs";import{DiscordLogo as zt}from"./SocialNetworks/DiscordLogo.mjs";import{InstagramLogo as Bt}from"./SocialNetworks/InstagramLogo.mjs";import{LinkedInLogo as Vt}from"./SocialNetworks/LinkedInLogo.mjs";import{ProductHuntLogo as Ht}from"./SocialNetworks/ProductHuntLogo.mjs";import{TiktokLogo as Ut}from"./SocialNetworks/TiktokLogo.mjs";import{XLogo as Wt}from"./SocialNetworks/XLogo.mjs";import{YoutubeLogo as Gt}from"./SocialNetworks/YoutubeLogo.mjs";import{FacebookLogo as Kt}from"./SocialNetworks/FacebookLogo.mjs";import{SocialNetworks as qt}from"./SocialNetworks/index.mjs";import{Footer as Jt}from"./Footer/index.mjs";import{HeightResizer as Yt}from"./HeightResizer/index.mjs";import{HideShow as Xt}from"./HideShow/index.mjs";import{HTMLRenderer as Zt,getIntlayerHTMLOptions as Qt}from"./HTMLRender/HTMLRender.mjs";import{FileList as $t}from"./IDE/FileList.mjs";import{WithResizer as en}from"./WithResizer/index.mjs";import{IDE as tn}from"./IDE/IDE.mjs";import{KeyboardScreenAdapter as nn}from"./KeyboardScreenAdapter/index.mjs";import{LanguageBackground as rn,LanguageSection as an}from"./LanguageBackground/index.mjs";import{LocaleSwitcher as on}from"./LocaleSwitcherDropDown/LocaleSwitcher.mjs";import{MaxWidthSmoother as sn}from"./MaxWidthSmoother/index.mjs";import{Navbar as cn}from"./Navbar/index.mjs";import{NumberItemsSelector as ln}from"./Pagination/NumberItemsSelector.mjs";import{Pagination as un,PaginationSize as dn,PaginationVariant as fn,paginationVariants as pn}from"./Pagination/Pagination.mjs";import{ShowingResultsNumberItems as mn}from"./Pagination/ShowingResultsNumberItems.mjs";import{DotPattern as hn}from"./Pattern/DotPattern.mjs";import{GridPattern as gn}from"./Pattern/GridPattern.mjs";import{Spotlight as _n}from"./Pattern/SpotLight.mjs";import{drawerManager as vn,useRightDrawer as yn}from"./RightDrawer/useRightDrawer.mjs";import{RightDrawer as bn}from"./RightDrawer/RightDrawer.mjs";import{Tag as xn,TagBackground as Sn,TagBorder as Cn,TagColor as wn,TagRoundedSize as Tn,TagSize as En}from"./Tag/index.mjs";import{Terminal as Dn}from"./Terminal/Terminal.mjs";import{Modes as On}from"./ThemeSwitcherDropDown/types.mjs";import{DesktopThemeSwitcher as kn}from"./ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs";import{MobileThemeSwitcher as An}from"./ThemeSwitcherDropDown/MobileThemeSwitcher.mjs";export{O as Accordion,Ne as AutoCompleteTextarea,Me as AutoSizedTextArea,k as Avatar,j as Badge,M as BadgeColor,N as BadgeSize,P as BadgeVariant,G as Breadcrumb,fe as Browser,x as Button,S as ButtonColor,C as ButtonSize,w as ButtonTextAlign,T as ButtonVariant,be as Carousel,K as Checkbox,q as CheckboxColor,J as CheckboxSize,xe as ClickOutsideDiv,ct as Code,et as CodeBlock,tt as CodeDefault,Se as CollapsibleTable,Ce as Command,we as CommandRoot,d as Container,f as ContainerBackground,p as ContainerBorderColor,m as ContainerGap,h as ContainerPadding,g as ContainerRoundedSize,_ as ContainerSeparator,v as ContainerTransparency,St as ContentEditor,Ee as ContentSelector,De as CopyButton,Oe as CopyToClipboard,kn as DesktopThemeSwitcher,he as Detail,Dt as DictionaryCreationForm,Ie as DictionaryEditor,kt as DictionaryFieldEditor,zt as DiscordLogo,hn as DotPattern,Le as DropDown,Re as DropDownAlign,ze as DropDownYAlign,Ae as EditableFieldInput,Fe as EditableFieldTextArea,$e as ExpandCollapse,Kt as FacebookLogo,$t as FileList,Nt as Flag,Pt as Flags,Jt as Footer,Et as Form,gn as GridPattern,qe as H1,Je as H2,Ye as H3,Xe as H4,Ze as H5,Qe as H6,Zt as HTMLRenderer,Yt as HeightResizer,Xt as HideShow,tn as IDE,wt as InformationTag,X as Input,te as InputIndicator,ne as InputOTP,re as InputOTPGroup,ie as InputOTPSeparator,ae as InputOTPSlot,ee as InputPassword,Z as InputSize,Q as InputVariant,Bt as InstagramLogo,pe as KeyList,xt as KeyPathBreadcrumb,nn as KeyboardScreenAdapter,me as KeyboardShortcut,Ke as Label,rn as LanguageBackground,an as LanguageSection,I as Link,L as LinkColor,R as LinkRoundedSize,z as LinkSize,B as LinkUnderlined,V as LinkVariant,Vt as LinkedInLogo,b as Loader,on as LocaleSwitcher,Ge as LocaleSwitcherContent,Ue as LocaleSwitcherContentProvider,Ft as Logo,It as LogoTextOnly,Lt as LogoWithText,Rt as LogoWithTextBelow,ht as MarkdownRenderer,D as MaxHeightSmoother,sn as MaxWidthSmoother,An as MobileThemeSwitcher,ft as Modal,pt as ModalSize,On as Modes,nt as MultiSelect,cn as Navbar,ln as NumberItemsSelector,oe as OTPInput,se as OTPInputContext,un as Pagination,dn as PaginationSize,fn as PaginationVariant,ye as Popover,ge as PopoverStatic,_e as PopoverXAlign,ve as PopoverYAlign,Te as PressableSpan,Ht as ProductHuntLogo,bn as RightDrawer,Ot as SaveForm,de as SearchInput,rt as Select,it as SelectContent,at as SelectContentPosition,ot as SelectLabel,st as SelectSeparator,mn as ShowingResultsNumberItems,qt as SocialNetworks,_n as Spotlight,Be as SwitchSelector,Ve as SwitchSelectorColor,He as SwitchSelectorSize,dt as Tab,lt as TabSelector,ut as TabSelectorColor,mt as Table,xn as Tag,Sn as TagBackground,Cn as TagBorder,wn as TagColor,Tn as TagRoundedSize,En as TagSize,Dn as Terminal,je as TextArea,vt as TextEditor,yt as TextEditorContainer,Ut as TiktokLogo,e as Toast,t as ToastAction,n as ToastClose,r as ToastDescription,i as ToastProvider,a as ToastTitle,o as ToastViewport,u as Toaster,Mt as VersionSwitcher,At as VersionSwitcherProvider,en as WithResizer,Wt as XLogo,Gt as YoutubeLogo,F as badgeVariants,gt as baseMarkdownComponents,E as buttonVariants,H as checkIsExternalLink,Y as checkboxVariants,y as containerVariants,vn as drawerManager,A as getCapitals,Qt as getIntlayerHTMLOptions,_t as getIntlayerMarkdownOptions,ce as inputSlotVariants,$ as inputVariants,U as isTextChildren,W as linkVariants,pn as paginationVariants,s as reducer,c as toast,bt as traceKeys,ke as useCopyToClipboard,Pe as useDebounce,Tt as useForm,Ct as useFormField,We as useLocaleSwitcherContent,le as usePasswordManagerBadge,ue as usePrevious,yn as useRightDrawer,l as useToast,jt as useVersionSwitcher};
@@ -1 +1 @@
1
- import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useOAuth2 as c}from"./useAuth/useOAuth2.mjs";import{useSession as l}from"./useAuth/useSession.mjs";import{useAuth as u}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as d,useIntlayerOAuth as f}from"./useIntlayerAPI.mjs";import{useAddDictionary as p,useAddNewAccessKey as m,useAddOrganization as h,useAddOrganizationMember as g,useAddPasskey as _,useAddProject as v,useAddTag as y,useAppQuery as b,useAskDocQuestion as x,useAskResetPassword as S,useAuditContentDeclaration as C,useAuditContentDeclarationField as w,useAuditContentDeclarationMetadata as T,useAuditScan as E,useAuditTag as D,useAutocomplete as O,useBitbucketAuth as k,useBitbucketCheckConfig as A,useBitbucketGetConfigFile as j,useBitbucketRepos as M,useCancelSubscription as N,useChangePassword as P,useCreateUser as F,useDeleteAccessKey as I,useDeleteDictionary as L,useDeleteOrganization as R,useDeletePasskey as z,useDeleteProject as B,useDeleteSSOProvider as V,useDeleteTag as H,useDeleteUser as U,useDisableTwoFactor as W,useEnableTwoFactor as G,useGetCIConfig as K,useGetDictionaries as q,useGetDictionariesKeys as J,useGetDictionary as Y,useGetDiscussions as X,useGetDiscussionsData as Z,useGetEditorDictionaries as Q,useGetNewsletterStatus as $,useGetOrganizations as ee,useGetPricing as te,useGetProjects as ne,useGetRecursiveAuditStatus as re,useGetSubscription as ie,useGetTags as ae,useGetUserByAccount as oe,useGetUserById as se,useGetUsers as ce,useGetVerifyEmailStatus as le,useGithubAuth as ue,useGithubCheckConfig as de,useGithubGetAuthUrl as fe,useGithubGetConfigFile as pe,useGithubRepos as me,useGitlabAuth as he,useGitlabCheckConfig as ge,useGitlabGetConfigFile as _e,useGitlabProjects as ve,useInfiniteGetDictionaries as ye,useListPasskeys as be,useListSSOProviders as xe,useLogin as Se,useLogout as Ce,usePushCIConfig as we,usePushDictionaries as Te,useQueryClient as Ee,useRefreshAccessKey as De,useRegister as Oe,useRegisterSSO as ke,useResetPassword as Ae,useSearchDoc as je,useSelectOrganization as Me,useSelectProject as Ne,useSignInMagicLink as Pe,useSignInPasskey as Fe,useSignInSSO as Ie,useStartRecursiveAudit as Le,useSubscribeToNewsletter as Re,useToggleShowcaseLike as ze,useTranslateJSONDeclaration as Be,useTriggerBuild as Ve,useTriggerWebhook as He,useUnselectOrganization as Ue,useUnselectProject as We,useUnsubscribeFromNewsletter as Ge,useUpdateDictionary as Ke,useUpdateOrganization as qe,useUpdateOrganizationMembers as Je,useUpdateOrganizationMembersById as Ye,useUpdateProject as Xe,useUpdateProjectMembers as Ze,useUpdateTag as Qe,useUpdateUser as $e,useVerifyBackupCode as et,useVerifyEmail as tt,useVerifyTotp as nt,useWriteDictionary as rt}from"./reactQuery.mjs";import{usePersistedStore as it}from"./usePersistedStore.mjs";import{useItemSelector as at}from"./useItemSelector.mjs";import{useUser as ot}from"./useUser/index.mjs";import{useHorizontalSwipe as st}from"./useHorizontalSwipe.mjs";import{useGetElementById as ct}from"./useGetElementById.mjs";import{useGetElementOrWindow as lt}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as ut}from"./useIsDarkMode.mjs";import{useIsMounted as dt}from"./useIsMounted.mjs";import{useKeyboardDetector as ft}from"./useKeyboardDetector.mjs";import{useScreenWidth as pt}from"./useScreenWidth.mjs";import{useScrollBlockage as mt}from"./useScrollBlockage/index.mjs";import{useScrollDetection as ht}from"./useScrollDetection.mjs";import{useScrollY as gt}from"./useScrollY.mjs";import{useSearch as _t}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,p as useAddDictionary,m as useAddNewAccessKey,h as useAddOrganization,g as useAddOrganizationMember,_ as useAddPasskey,v as useAddProject,y as useAddTag,b as useAppQuery,x as useAskDocQuestion,S as useAskResetPassword,C as useAuditContentDeclaration,w as useAuditContentDeclarationField,T as useAuditContentDeclarationMetadata,E as useAuditScan,D as useAuditTag,u as useAuth,O as useAutocomplete,k as useBitbucketAuth,A as useBitbucketCheckConfig,j as useBitbucketGetConfigFile,M as useBitbucketRepos,N as useCancelSubscription,P as useChangePassword,F as useCreateUser,I as useDeleteAccessKey,L as useDeleteDictionary,R as useDeleteOrganization,z as useDeletePasskey,B as useDeleteProject,V as useDeleteSSOProvider,H as useDeleteTag,U as useDeleteUser,s as useDevice,W as useDisableTwoFactor,G as useEnableTwoFactor,K as useGetCIConfig,q as useGetDictionaries,J as useGetDictionariesKeys,Y as useGetDictionary,X as useGetDiscussions,Z as useGetDiscussionsData,Q as useGetEditorDictionaries,ct as useGetElementById,lt as useGetElementOrWindow,$ as useGetNewsletterStatus,ee as useGetOrganizations,te as useGetPricing,ne as useGetProjects,re as useGetRecursiveAuditStatus,ie as useGetSubscription,ae as useGetTags,oe as useGetUserByAccount,se as useGetUserById,ce as useGetUsers,le as useGetVerifyEmailStatus,ue as useGithubAuth,de as useGithubCheckConfig,fe as useGithubGetAuthUrl,pe as useGithubGetConfigFile,me as useGithubRepos,he as useGitlabAuth,ge as useGitlabCheckConfig,_e as useGitlabGetConfigFile,ve as useGitlabProjects,st as useHorizontalSwipe,ye as useInfiniteGetDictionaries,d as useIntlayerAuth,f as useIntlayerOAuth,ut as useIsDarkMode,dt as useIsMounted,at as useItemSelector,ft as useKeyboardDetector,be as useListPasskeys,xe as useListSSOProviders,Se as useLogin,Ce as useLogout,c as useOAuth2,it as usePersistedStore,we as usePushCIConfig,Te as usePushDictionaries,Ee as useQueryClient,De as useRefreshAccessKey,Oe as useRegister,ke as useRegisterSSO,Ae as useResetPassword,pt as useScreenWidth,mt as useScrollBlockage,ht as useScrollDetection,gt as useScrollY,_t as useSearch,je as useSearchDoc,Me as useSelectOrganization,Ne as useSelectProject,l as useSession,Pe as useSignInMagicLink,Fe as useSignInPasskey,Ie as useSignInSSO,Le as useStartRecursiveAudit,Re as useSubscribeToNewsletter,ze as useToggleShowcaseLike,Be as useTranslateJSONDeclaration,Ve as useTriggerBuild,He as useTriggerWebhook,Ue as useUnselectOrganization,We as useUnselectProject,Ge as useUnsubscribeFromNewsletter,Ke as useUpdateDictionary,qe as useUpdateOrganization,Je as useUpdateOrganizationMembers,Ye as useUpdateOrganizationMembersById,Xe as useUpdateProject,Ze as useUpdateProjectMembers,Qe as useUpdateTag,$e as useUpdateUser,ot as useUser,et as useVerifyBackupCode,tt as useVerifyEmail,nt as useVerifyTotp,rt as useWriteDictionary};
1
+ import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useOAuth2 as c}from"./useAuth/useOAuth2.mjs";import{useSession as l}from"./useAuth/useSession.mjs";import{useAuth as u}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as d,useIntlayerOAuth as f}from"./useIntlayerAPI.mjs";import{useAddDictionary as p,useAddNewAccessKey as m,useAddOrganization as h,useAddOrganizationMember as g,useAddPasskey as _,useAddProject as v,useAddTag as y,useAppQuery as b,useAskDocQuestion as x,useAskResetPassword as S,useAuditContentDeclaration as C,useAuditContentDeclarationField as w,useAuditContentDeclarationMetadata as T,useAuditScan as E,useAuditTag as D,useAutocomplete as O,useBitbucketAuth as k,useBitbucketCheckConfig as A,useBitbucketGetConfigFile as j,useBitbucketRepos as M,useCancelSubscription as N,useChangePassword as P,useCreateUser as F,useDeleteAccessKey as I,useDeleteDictionary as L,useDeleteOrganization as R,useDeletePasskey as z,useDeleteProject as B,useDeleteSSOProvider as V,useDeleteShowcaseProject as H,useDeleteTag as U,useDeleteUser as W,useDisableTwoFactor as G,useEnableTwoFactor as K,useGetCIConfig as q,useGetDictionaries as J,useGetDictionariesKeys as Y,useGetDictionary as X,useGetDiscussions as Z,useGetDiscussionsData as Q,useGetEditorDictionaries as $,useGetNewsletterStatus as ee,useGetOrganizations as te,useGetOtherShowcaseProjects as ne,useGetPricing as re,useGetProjects as ie,useGetRecursiveAuditStatus as ae,useGetShowcaseProjectById as oe,useGetShowcaseProjects as se,useGetSubscription as ce,useGetTags as le,useGetUserByAccount as ue,useGetUserById as de,useGetUsers as fe,useGetVerifyEmailStatus as pe,useGithubAuth as me,useGithubCheckConfig as he,useGithubGetAuthUrl as ge,useGithubGetConfigFile as _e,useGithubRepos as ve,useGitlabAuth as ye,useGitlabCheckConfig as be,useGitlabGetConfigFile as xe,useGitlabProjects as Se,useInfiniteGetDictionaries as Ce,useListPasskeys as we,useListSSOProviders as Te,useLogin as Ee,useLogout as De,usePushCIConfig as Oe,usePushDictionaries as ke,useQueryClient as Ae,useRefreshAccessKey as je,useRegister as Me,useRegisterSSO as Ne,useResetPassword as Pe,useSearchDoc as Fe,useSelectOrganization as Ie,useSelectProject as Le,useSignInMagicLink as Re,useSignInPasskey as ze,useSignInSSO as Be,useStartRecursiveAudit as Ve,useSubmitShowcaseProject as He,useSubscribeToNewsletter as Ue,useToggleShowcaseDownvote as We,useToggleShowcaseUpvote as Ge,useTranslateJSONDeclaration as Ke,useTriggerBuild as qe,useTriggerWebhook as Je,useUnselectOrganization as Ye,useUnselectProject as Xe,useUnsubscribeFromNewsletter as Ze,useUpdateDictionary as Qe,useUpdateOrganization as $e,useUpdateOrganizationMembers as et,useUpdateOrganizationMembersById as tt,useUpdateProject as nt,useUpdateProjectMembers as rt,useUpdateShowcaseProject as it,useUpdateTag as at,useUpdateUser as ot,useVerifyBackupCode as st,useVerifyEmail as ct,useVerifyTotp as lt,useWriteDictionary as ut}from"./reactQuery.mjs";import{usePersistedStore as dt}from"./usePersistedStore.mjs";import{useItemSelector as ft}from"./useItemSelector.mjs";import{useUser as pt}from"./useUser/index.mjs";import{useHorizontalSwipe as mt}from"./useHorizontalSwipe.mjs";import{useGetElementById as ht}from"./useGetElementById.mjs";import{useGetElementOrWindow as gt}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as _t}from"./useIsDarkMode.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useKeyboardDetector as yt}from"./useKeyboardDetector.mjs";import{useScreenWidth as bt}from"./useScreenWidth.mjs";import{useScrollBlockage as xt}from"./useScrollBlockage/index.mjs";import{useScrollDetection as St}from"./useScrollDetection.mjs";import{useScrollY as Ct}from"./useScrollY.mjs";import{useSearch as wt}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,p as useAddDictionary,m as useAddNewAccessKey,h as useAddOrganization,g as useAddOrganizationMember,_ as useAddPasskey,v as useAddProject,y as useAddTag,b as useAppQuery,x as useAskDocQuestion,S as useAskResetPassword,C as useAuditContentDeclaration,w as useAuditContentDeclarationField,T as useAuditContentDeclarationMetadata,E as useAuditScan,D as useAuditTag,u as useAuth,O as useAutocomplete,k as useBitbucketAuth,A as useBitbucketCheckConfig,j as useBitbucketGetConfigFile,M as useBitbucketRepos,N as useCancelSubscription,P as useChangePassword,F as useCreateUser,I as useDeleteAccessKey,L as useDeleteDictionary,R as useDeleteOrganization,z as useDeletePasskey,B as useDeleteProject,V as useDeleteSSOProvider,H as useDeleteShowcaseProject,U as useDeleteTag,W as useDeleteUser,s as useDevice,G as useDisableTwoFactor,K as useEnableTwoFactor,q as useGetCIConfig,J as useGetDictionaries,Y as useGetDictionariesKeys,X as useGetDictionary,Z as useGetDiscussions,Q as useGetDiscussionsData,$ as useGetEditorDictionaries,ht as useGetElementById,gt as useGetElementOrWindow,ee as useGetNewsletterStatus,te as useGetOrganizations,ne as useGetOtherShowcaseProjects,re as useGetPricing,ie as useGetProjects,ae as useGetRecursiveAuditStatus,oe as useGetShowcaseProjectById,se as useGetShowcaseProjects,ce as useGetSubscription,le as useGetTags,ue as useGetUserByAccount,de as useGetUserById,fe as useGetUsers,pe as useGetVerifyEmailStatus,me as useGithubAuth,he as useGithubCheckConfig,ge as useGithubGetAuthUrl,_e as useGithubGetConfigFile,ve as useGithubRepos,ye as useGitlabAuth,be as useGitlabCheckConfig,xe as useGitlabGetConfigFile,Se as useGitlabProjects,mt as useHorizontalSwipe,Ce as useInfiniteGetDictionaries,d as useIntlayerAuth,f as useIntlayerOAuth,_t as useIsDarkMode,vt as useIsMounted,ft as useItemSelector,yt as useKeyboardDetector,we as useListPasskeys,Te as useListSSOProviders,Ee as useLogin,De as useLogout,c as useOAuth2,dt as usePersistedStore,Oe as usePushCIConfig,ke as usePushDictionaries,Ae as useQueryClient,je as useRefreshAccessKey,Me as useRegister,Ne as useRegisterSSO,Pe as useResetPassword,bt as useScreenWidth,xt as useScrollBlockage,St as useScrollDetection,Ct as useScrollY,wt as useSearch,Fe as useSearchDoc,Ie as useSelectOrganization,Le as useSelectProject,l as useSession,Re as useSignInMagicLink,ze as useSignInPasskey,Be as useSignInSSO,Ve as useStartRecursiveAudit,He as useSubmitShowcaseProject,Ue as useSubscribeToNewsletter,We as useToggleShowcaseDownvote,Ge as useToggleShowcaseUpvote,Ke as useTranslateJSONDeclaration,qe as useTriggerBuild,Je as useTriggerWebhook,Ye as useUnselectOrganization,Xe as useUnselectProject,Ze as useUnsubscribeFromNewsletter,Qe as useUpdateDictionary,$e as useUpdateOrganization,et as useUpdateOrganizationMembers,tt as useUpdateOrganizationMembersById,nt as useUpdateProject,rt as useUpdateProjectMembers,it as useUpdateShowcaseProject,at as useUpdateTag,ot as useUpdateUser,pt as useUser,st as useVerifyBackupCode,ct as useVerifyEmail,lt as useVerifyTotp,ut as useWriteDictionary};
@@ -1,2 +1,2 @@
1
- "use client";import{useAuth as e}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as t,useIntlayerOAuth as n}from"./useIntlayerAPI.mjs";import{useConfiguration as r}from"@intlayer/editor-react";import{useInfiniteQuery as i,useMutation as a,useQuery as o,useQueryClient as s}from"@tanstack/react-query";const c=({requireUser:t,requireProject:n,requireOrganization:i})=>{let{oAuth2AccessToken:a,session:o}=e({intlayerConfiguration:r()}),s=o?o.user:a?.user,c=o?o.organization:a?.organization,l=o?o.project:a?.project;return{enable:(t?!!s:!0)&&(n?!!l:!0)&&(i?!!c:!0)}},l=e=>{let{requireUser:t,requireProject:n,requireOrganization:r,...i}=e,{enable:a}=c({requireUser:t,requireProject:n,requireOrganization:r});return o({enabled:i?.enabled===!1?!1:a,...i})},ee=()=>{let e=t(),n=s();return a({mutationKey:[`login`],mutationFn:t=>e.signInEmail(t),onSuccess:e=>{let t=n.getQueryData([`session`]);t&&e.data?.user&&n.setQueryData([`session`],{...t,user:e.data.user})}})},te=()=>{let e=t();return a({mutationKey:[`getVerifyEmailStatus`],mutationFn:t=>e.verifyEmailSession(...t)})},u=()=>{let e=t();return a({mutationKey:[`register`],mutationFn:t=>e.signUpEmail(t),meta:{resetQueries:[[`session`]]}})},d=()=>{let e=t();return a({mutationKey:[`logout`],mutationFn:()=>e.signOut(),meta:{resetQueries:[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]]}})},f=()=>{let e=t();return a({mutationKey:[`changePassword`],mutationFn:t=>e.changePasswordSession(...t)})},p=()=>{let e=t();return a({mutationKey:[`askResetPassword`],mutationFn:t=>e.requestPasswordResetSession(t)})},m=()=>{let e=t();return a({mutationKey:[`resetPassword`],mutationFn:t=>e.resetPassword(t)})},h=()=>{let e=t();return a({mutationKey:[`verifyEmail`],mutationFn:t=>e.verifyEmailSession(t)})},g=()=>{let e=t();return a({mutationKey:[`user`],mutationFn:t=>e.accountInfo(t)})},_=()=>{let e=t();return a({mutationKey:[`enableTwoFactor`],mutationFn:t=>e.enableTwoFactor(t)})},v=()=>{let e=t();return a({mutationKey:[`disableTwoFactor`],mutationFn:t=>e.disableTwoFactor(t)})},y=()=>{let e=t();return a({mutationKey:[`verifyTotp`],mutationFn:t=>e.verifyTotp(t)})},b=()=>{let e=t();return a({mutationKey:[`verifyBackupCode`],mutationFn:t=>e.verifyBackupCode(t)})},x=()=>{let e=t();return a({mutationKey:[`addPasskey`],mutationFn:t=>e.addPasskey(t)})},S=()=>{let e=t();return a({mutationKey:[`signInPasskey`],mutationFn:t=>e.signInPasskey(t)})},C=()=>{let e=t();return a({mutationKey:[`deletePasskey`],mutationFn:t=>e.deletePasskey(t)})},w=()=>{let e=t();return o({queryKey:[`listPasskeys`],queryFn:()=>e.listPasskeys()})},T=()=>{let e=t();return a({mutationKey:[`signInMagicLink`],mutationFn:t=>e.signInMagicLink(t)})},E=()=>{let e=t(),n=s();return a({mutationKey:[`registerSSO`],mutationFn:t=>e.registerSSO(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},D=()=>{let e=t();return a({mutationKey:[`signInSSO`],mutationFn:t=>e.signInSSO(t)})},O=()=>{let e=t();return o({queryKey:[`ssoProviders`],queryFn:()=>e.listSSOProviders()})},k=()=>{let e=t(),n=s();return a({mutationKey:[`deleteSSOProvider`],mutationFn:t=>e.deleteSSOProvider(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},A=(e,t)=>{let r=n();return l({queryKey:[`users`,e],queryFn:()=>r.user.getUsers(e),requireUser:!0,...t})},j=e=>{let t=n();return l({queryKey:[`users`,e],queryFn:()=>t.user.getUserById(e),requireUser:!0})},M=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.createUser(t)})},N=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.updateUser(t)})},P=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.deleteUser(t),meta:{invalidateQueries:[[`users`]]}})},F=e=>{let t=n();return l({queryKey:[`organizations`,e],queryFn:({signal:n})=>t.organization.getOrganizations(e,{signal:n}),requireUser:!0})},I=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganization(t),meta:{invalidateQueries:[[`organizations`]]}})},L=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganization(t)})},R=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganizationMembers(t),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},z=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:({organizationId:t,...n})=>e.organization.updateOrganizationMembersById(t,n),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},B=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganizationMember(t),meta:{invalidateQueries:[[`organizations`]]}})},V=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:()=>e.organization.deleteOrganization(),meta:{invalidateQueries:[[`organizations`],[`session`]]}})},H=()=>{let e=n(),t=s();return a({mutationKey:[`session-organizations`],mutationFn:t=>e.organization.selectOrganization(t),meta:{invalidateQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,organization:e.data})}})},U=()=>{let e=n(),t=s();return a({mutationKey:[`session-organizations`],mutationFn:()=>e.organization.unselectOrganization(),meta:{resetQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,organization:null,project:null})}})},W=(e,t)=>{let r=n();return l({queryKey:[`projects`,e],queryFn:({signal:t})=>r.project.getProjects(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},G=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.addProject(t),meta:{invalidateQueries:[[`projects`]]}})},K=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.updateProject(t),meta:{invalidateQueries:[[`projects`],[`session`]]}})},q=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.updateProjectMembers(t),meta:{invalidateQueries:[[`projects`]]}})},J=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:()=>e.project.deleteProject(),meta:{invalidateQueries:[[`projects`]]}})},Y=()=>{let e=n(),t=s();return a({mutationKey:[`session-projects`],mutationFn:t=>e.project.selectProject(t),meta:{invalidateQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,project:e.data})}})},X=()=>{let e=n(),t=s();return a({mutationKey:[`session-projects`],mutationFn:()=>e.project.unselectProject(),meta:{resetQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,project:null})}})},Z=e=>{let t=n();return l({queryKey:[`ci-config`],queryFn:({signal:e})=>t.project.getCIConfig({signal:e}),requireProject:!0,...e})},Q=()=>{let e=n();return a({mutationKey:[`ci-config`],mutationFn:()=>e.project.pushCIConfig(),meta:{invalidateQueries:[[`ci-config`]]}})},ne=()=>{let e=n();return a({mutationKey:[`projects`,`build`],mutationFn:()=>e.project.triggerBuild(),meta:{invalidateQueries:[[`projects`]]}})},re=()=>{let e=n();return a({mutationKey:[`projects`,`webhook`],mutationFn:t=>e.project.triggerWebhook(t),meta:{invalidateQueries:[[`projects`]]}})},ie=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.addNewAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},ae=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.deleteAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},oe=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.refreshAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},se=(e,t)=>{let r=n();return l({queryKey:[`dictionaries`,e],queryFn:({signal:t})=>r.dictionary.getDictionaries(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ce=(e,t)=>{let r=n(),{enable:a}=c({requireUser:!0,requireOrganization:!0,requireProject:!0});return i({queryKey:[`dictionaries`,`infinite`,e],queryFn:async({pageParam:t=1,signal:n})=>await r.dictionary.getDictionaries({...e,page:t},{signal:n}),getNextPageParam:e=>{if(e.data.length===0)return;let t=e.page??1;return t<(e.total_pages??1)?t+1:void 0},initialPageParam:1,enabled:t?.enabled===!1?!1:a,...t})},le=e=>{let t=n();return l({queryKey:[`dictionariesKeys`],queryFn:()=>t.dictionary.getDictionariesKeys(),requireUser:!0,requireOrganization:!0,requireProject:!0,...e})},ue=(e,t,r)=>{let i=n();return l({queryKey:[`dictionary`,e],queryFn:({signal:n})=>i.dictionary.getDictionary(e,t,{signal:n}),requireUser:!0,requireOrganization:!0,requireProject:!0,...r})},de=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.addDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},fe=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.pushDictionaries(t.dictionaries),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},pe=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.updateDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},me=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.deleteDictionary(t.dictionaryId),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},he=(e,t)=>{let r=n();return l({queryKey:[`tags`,e],queryFn:({signal:t})=>r.tag.getTags(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ge=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.addTag(t),meta:{invalidateQueries:[[`tags`]]}})},_e=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.updateTag(t.tagId,t.tag),meta:{invalidateQueries:[[`tags`]]}})},ve=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.deleteTag(t),meta:{invalidateQueries:[[`tags`]]}})},ye=(e,t)=>{let r=n();return o({queryKey:[`pricing`,e],queryFn:({signal:t})=>r.stripe.getPricing(e,{signal:t}),...t})},be=(e,t)=>{let r=n();return l({queryKey:[`subscription`,e],queryFn:({signal:t})=>r.stripe.getSubscription(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},xe=()=>{let e=n();return a({mutationKey:[`subscription`],mutationFn:()=>e.stripe.cancelSubscription(),meta:{invalidateQueries:[[`session`],[`subscription`]]}})},Se=()=>{let e=n();return a({mutationKey:[`ai-translateJSON`],mutationFn:t=>e.ai.translateJSON(t)})},Ce=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclaration`],mutationFn:t=>e.ai.auditContentDeclaration(t)})},we=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclarationMetadata`],mutationFn:t=>e.ai.auditContentDeclarationMetadata(t)})},Te=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclarationField`],mutationFn:t=>e.ai.auditContentDeclarationField(t)})},Ee=()=>{let e=n();return a({mutationKey:[`ai-auditTag`],mutationFn:t=>e.ai.auditTag(t)})},De=()=>{let e=n();return a({mutationKey:[],mutationFn:t=>e.ai.askDocQuestion(t)})},Oe=()=>{let e=n();return a({mutationKey:[`ai-autocomplete`],mutationFn:t=>e.ai.autocomplete(t)})},ke=()=>{let e=n();return a({mutationKey:[`audit-scan`],mutationFn:t=>e.audit.scanUrl(t)})},Ae=()=>{let e=n();return a({mutationKey:[`audit-recursive-start`],mutationFn:t=>e.audit.startRecursiveAudit(t)})},je=(e,t)=>{let r=n();return l({queryKey:[`audit-recursive-status`,e?.jobId],queryFn:({signal:t})=>r.audit.getRecursiveAuditStatus(e,{signal:t}),enabled:!!e?.jobId,...t})},Me=(e,t)=>{let r=n();return l({queryKey:[`discussions`,e],queryFn:({signal:t})=>r.ai.getDiscussions(e,{signal:t,cache:`no-store`}),requireUser:!0,...t})},Ne=(e,t)=>{let r=n();return l({queryKey:[`discussions-data`,e],queryFn:({signal:t})=>r.ai.getDiscussions({includeMessages:`false`,...e??{}},{signal:t,cache:`no-store`}),requireUser:!0,...t})},Pe=e=>{let t=n();return o({queryKey:[`search`,e],queryFn:()=>t.search.searchDoc(e),enabled:(e?.input?.length??0)>3})},Fe=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.subscribeToNewsletter(t)})},Ie=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.unsubscribeFromNewsletter(t)})},Le=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:()=>e.newsletter.getNewsletterStatus()})},Re=()=>{let e=n();return a({mutationKey:[`github`,`auth-url`],mutationFn:t=>e.github.getAuthUrl(t)})},ze=()=>{let e=n();return a({mutationKey:[`github`,`auth`],mutationFn:t=>e.github.authenticate(t)})},Be=(e=!0)=>{let t=n();return o({queryKey:[`github`,`repos`],queryFn:()=>t.github.getRepositories(),enabled:e})},Ve=()=>{let e=n();return a({mutationKey:[`github`,`check-config`],mutationFn:t=>e.github.checkIntlayerConfig(void 0,t.owner,t.repository,t.branch)})},$=()=>{let e=n();return a({mutationKey:[`github`,`get-config-file`],mutationFn:t=>e.github.getConfigFile(void 0,t.owner,t.repository,t.branch,t.path)})},He=()=>{let e=n();return a({mutationKey:[`gitlab`,`auth`],mutationFn:t=>e.gitlab.authenticate(t.code,t.redirectUri,t.instanceUrl)})},Ue=(e=!0,t)=>{let r=n();return o({queryKey:[`gitlab`,`projects`,t],queryFn:()=>r.gitlab.getProjects(void 0,t),enabled:e})},We=()=>{let e=n();return a({mutationKey:[`gitlab`,`check-config`],mutationFn:t=>e.gitlab.checkIntlayerConfig(void 0,t.projectId,t.branch,t.instanceUrl)})},Ge=()=>{let e=n();return a({mutationKey:[`gitlab`,`get-config-file`],mutationFn:t=>e.gitlab.getConfigFile(void 0,t.projectId,t.branch,t.path,t.instanceUrl)})},Ke=()=>{let e=n();return a({mutationKey:[`bitbucket`,`auth`],mutationFn:t=>e.bitbucket.authenticate(t)})},qe=(e=!0)=>{let t=n();return o({queryKey:[`bitbucket`,`repos`],queryFn:()=>t.bitbucket.getRepositories(),enabled:e})},Je=()=>{let e=n();return a({mutationKey:[`bitbucket`,`check-config`],mutationFn:t=>e.bitbucket.checkIntlayerConfig(void 0,t.workspace,t.repoSlug,t.branch)})},Ye=()=>{let e=n();return a({mutationKey:[`bitbucket`,`get-config-file`],mutationFn:t=>e.bitbucket.getConfigFile(void 0,t.workspace,t.repoSlug,t.branch,t.path)})},Xe=()=>{let e=n();return o({queryKey:[`editor`,`dictionaries`],queryFn:()=>e.editor.getDictionaries()})},Ze=()=>{let e=n();return a({mutationKey:[`editor`,`dictionaries`],mutationFn:t=>e.editor.writeDictionary(t)})},Qe=()=>{let e=n();return a({mutationKey:[`showcase`,`like`],mutationFn:t=>e.showcaseProject.toggleShowcaseLike({projectId:t})})};export{de as useAddDictionary,ie as useAddNewAccessKey,I as useAddOrganization,B as useAddOrganizationMember,x as useAddPasskey,G as useAddProject,ge as useAddTag,l as useAppQuery,De as useAskDocQuestion,p as useAskResetPassword,Ce as useAuditContentDeclaration,Te as useAuditContentDeclarationField,we as useAuditContentDeclarationMetadata,ke as useAuditScan,Ee as useAuditTag,Oe as useAutocomplete,Ke as useBitbucketAuth,Je as useBitbucketCheckConfig,Ye as useBitbucketGetConfigFile,qe as useBitbucketRepos,xe as useCancelSubscription,f as useChangePassword,M as useCreateUser,ae as useDeleteAccessKey,me as useDeleteDictionary,V as useDeleteOrganization,C as useDeletePasskey,J as useDeleteProject,k as useDeleteSSOProvider,ve as useDeleteTag,P as useDeleteUser,v as useDisableTwoFactor,_ as useEnableTwoFactor,Z as useGetCIConfig,se as useGetDictionaries,le as useGetDictionariesKeys,ue as useGetDictionary,Me as useGetDiscussions,Ne as useGetDiscussionsData,Xe as useGetEditorDictionaries,Le as useGetNewsletterStatus,F as useGetOrganizations,ye as useGetPricing,W as useGetProjects,je as useGetRecursiveAuditStatus,be as useGetSubscription,he as useGetTags,g as useGetUserByAccount,j as useGetUserById,A as useGetUsers,te as useGetVerifyEmailStatus,ze as useGithubAuth,Ve as useGithubCheckConfig,Re as useGithubGetAuthUrl,$ as useGithubGetConfigFile,Be as useGithubRepos,He as useGitlabAuth,We as useGitlabCheckConfig,Ge as useGitlabGetConfigFile,Ue as useGitlabProjects,ce as useInfiniteGetDictionaries,w as useListPasskeys,O as useListSSOProviders,ee as useLogin,d as useLogout,Q as usePushCIConfig,fe as usePushDictionaries,s as useQueryClient,oe as useRefreshAccessKey,u as useRegister,E as useRegisterSSO,m as useResetPassword,Pe as useSearchDoc,H as useSelectOrganization,Y as useSelectProject,T as useSignInMagicLink,S as useSignInPasskey,D as useSignInSSO,Ae as useStartRecursiveAudit,Fe as useSubscribeToNewsletter,Qe as useToggleShowcaseLike,Se as useTranslateJSONDeclaration,ne as useTriggerBuild,re as useTriggerWebhook,U as useUnselectOrganization,X as useUnselectProject,Ie as useUnsubscribeFromNewsletter,pe as useUpdateDictionary,L as useUpdateOrganization,R as useUpdateOrganizationMembers,z as useUpdateOrganizationMembersById,K as useUpdateProject,q as useUpdateProjectMembers,_e as useUpdateTag,N as useUpdateUser,b as useVerifyBackupCode,h as useVerifyEmail,y as useVerifyTotp,Ze as useWriteDictionary};
1
+ "use client";import{useAuth as e}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as t,useIntlayerOAuth as n}from"./useIntlayerAPI.mjs";import{useInfiniteQuery as r,useMutation as i,useQuery as a,useQueryClient as o}from"@tanstack/react-query";import{useConfiguration as ee}from"@intlayer/editor-react";const s=({requireUser:t,requireProject:n,requireOrganization:r})=>{let{oAuth2AccessToken:i,session:a}=e({intlayerConfiguration:ee()}),o=a?a.user:i?.user,s=a?a.organization:i?.organization,c=a?a.project:i?.project;return{enable:(t?!!o:!0)&&(n?!!c:!0)&&(r?!!s:!0)}},c=e=>{let{requireUser:t,requireProject:n,requireOrganization:r,...i}=e,{enable:o}=s({requireUser:t,requireProject:n,requireOrganization:r});return a({enabled:i?.enabled===!1?!1:o,...i})},te=()=>{let e=t(),n=o();return i({mutationKey:[`login`],mutationFn:t=>e.signInEmail(t),onSuccess:e=>{let t=n.getQueryData([`session`]);t&&e.data?.user&&n.setQueryData([`session`],{...t,user:e.data.user})}})},l=()=>{let e=t();return i({mutationKey:[`getVerifyEmailStatus`],mutationFn:t=>e.verifyEmailSession(...t)})},u=()=>{let e=t();return i({mutationKey:[`register`],mutationFn:t=>e.signUpEmail(t),meta:{resetQueries:[[`session`]]}})},d=()=>{let e=t();return i({mutationKey:[`logout`],mutationFn:()=>e.signOut(),meta:{resetQueries:[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]]}})},f=()=>{let e=t();return i({mutationKey:[`changePassword`],mutationFn:t=>e.changePasswordSession(...t)})},p=()=>{let e=t();return i({mutationKey:[`askResetPassword`],mutationFn:t=>e.requestPasswordResetSession(t)})},m=()=>{let e=t();return i({mutationKey:[`resetPassword`],mutationFn:t=>e.resetPassword(t)})},h=()=>{let e=t();return i({mutationKey:[`verifyEmail`],mutationFn:t=>e.verifyEmailSession(t)})},g=()=>{let e=t();return i({mutationKey:[`user`],mutationFn:t=>e.accountInfo(t)})},_=()=>{let e=t();return i({mutationKey:[`enableTwoFactor`],mutationFn:t=>e.enableTwoFactor(t)})},v=()=>{let e=t();return i({mutationKey:[`disableTwoFactor`],mutationFn:t=>e.disableTwoFactor(t)})},y=()=>{let e=t();return i({mutationKey:[`verifyTotp`],mutationFn:t=>e.verifyTotp(t)})},b=()=>{let e=t();return i({mutationKey:[`verifyBackupCode`],mutationFn:t=>e.verifyBackupCode(t)})},x=()=>{let e=t();return i({mutationKey:[`addPasskey`],mutationFn:t=>e.addPasskey(t)})},S=()=>{let e=t();return i({mutationKey:[`signInPasskey`],mutationFn:t=>e.signInPasskey(t)})},C=()=>{let e=t();return i({mutationKey:[`deletePasskey`],mutationFn:t=>e.deletePasskey(t)})},w=()=>{let e=t();return a({queryKey:[`listPasskeys`],queryFn:()=>e.listPasskeys()})},T=()=>{let e=t();return i({mutationKey:[`signInMagicLink`],mutationFn:t=>e.signInMagicLink(t)})},E=()=>{let e=t(),n=o();return i({mutationKey:[`registerSSO`],mutationFn:t=>e.registerSSO(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},D=()=>{let e=t();return i({mutationKey:[`signInSSO`],mutationFn:t=>e.signInSSO(t)})},O=()=>{let e=t();return a({queryKey:[`ssoProviders`],queryFn:()=>e.listSSOProviders()})},k=()=>{let e=t(),n=o();return i({mutationKey:[`deleteSSOProvider`],mutationFn:t=>e.deleteSSOProvider(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},A=(e,t)=>{let r=n();return c({queryKey:[`users`,e],queryFn:()=>r.user.getUsers(e),requireUser:!0,...t})},j=e=>{let t=n();return c({queryKey:[`users`,e],queryFn:()=>t.user.getUserById(e),requireUser:!0})},M=()=>{let e=n();return i({mutationKey:[`users`],mutationFn:t=>e.user.createUser(t)})},N=()=>{let e=n();return i({mutationKey:[`users`],mutationFn:t=>e.user.updateUser(t)})},P=()=>{let e=n();return i({mutationKey:[`users`],mutationFn:t=>e.user.deleteUser(t),meta:{invalidateQueries:[[`users`]]}})},F=e=>{let t=n();return c({queryKey:[`organizations`,e],queryFn:({signal:n})=>t.organization.getOrganizations(e,{signal:n}),requireUser:!0})},I=()=>{let e=n();return i({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganization(t),meta:{invalidateQueries:[[`organizations`]]}})},L=()=>{let e=n();return i({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganization(t)})},R=()=>{let e=n();return i({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganizationMembers(t),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},z=()=>{let e=n();return i({mutationKey:[`organizations`],mutationFn:({organizationId:t,...n})=>e.organization.updateOrganizationMembersById(t,n),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},B=()=>{let e=n();return i({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganizationMember(t),meta:{invalidateQueries:[[`organizations`]]}})},V=()=>{let e=n();return i({mutationKey:[`organizations`],mutationFn:()=>e.organization.deleteOrganization(),meta:{invalidateQueries:[[`organizations`],[`session`]]}})},H=()=>{let e=n(),t=o();return i({mutationKey:[`session-organizations`],mutationFn:t=>e.organization.selectOrganization(t),meta:{invalidateQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,organization:e.data})}})},U=()=>{let e=n(),t=o();return i({mutationKey:[`session-organizations`],mutationFn:()=>e.organization.unselectOrganization(),meta:{resetQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,organization:null,project:null})}})},W=(e,t)=>{let r=n();return c({queryKey:[`projects`,e],queryFn:({signal:t})=>r.project.getProjects(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},G=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:t=>e.project.addProject(t),meta:{invalidateQueries:[[`projects`]]}})},K=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:t=>e.project.updateProject(t),meta:{invalidateQueries:[[`projects`],[`session`]]}})},q=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:t=>e.project.updateProjectMembers(t),meta:{invalidateQueries:[[`projects`]]}})},J=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:()=>e.project.deleteProject(),meta:{invalidateQueries:[[`projects`]]}})},Y=()=>{let e=n(),t=o();return i({mutationKey:[`session-projects`],mutationFn:t=>e.project.selectProject(t),meta:{invalidateQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,project:e.data})}})},X=()=>{let e=n(),t=o();return i({mutationKey:[`session-projects`],mutationFn:()=>e.project.unselectProject(),meta:{resetQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,project:null})}})},Z=e=>{let t=n();return c({queryKey:[`ci-config`],queryFn:({signal:e})=>t.project.getCIConfig({signal:e}),requireProject:!0,...e})},Q=()=>{let e=n();return i({mutationKey:[`ci-config`],mutationFn:()=>e.project.pushCIConfig(),meta:{invalidateQueries:[[`ci-config`]]}})},ne=()=>{let e=n();return i({mutationKey:[`projects`,`build`],mutationFn:()=>e.project.triggerBuild(),meta:{invalidateQueries:[[`projects`]]}})},re=()=>{let e=n();return i({mutationKey:[`projects`,`webhook`],mutationFn:t=>e.project.triggerWebhook(t),meta:{invalidateQueries:[[`projects`]]}})},ie=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:t=>e.project.addNewAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},ae=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:t=>e.project.deleteAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},oe=()=>{let e=n();return i({mutationKey:[`projects`],mutationFn:t=>e.project.refreshAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},se=(e,t)=>{let r=n();return c({queryKey:[`dictionaries`,e],queryFn:({signal:t})=>r.dictionary.getDictionaries(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ce=(e,t)=>{let i=n(),{enable:a}=s({requireUser:!0,requireOrganization:!0,requireProject:!0});return r({queryKey:[`dictionaries`,`infinite`,e],queryFn:async({pageParam:t=1,signal:n})=>await i.dictionary.getDictionaries({...e,page:t},{signal:n}),getNextPageParam:e=>{if(e.data.length===0)return;let t=e.page??1;return t<(e.total_pages??1)?t+1:void 0},initialPageParam:1,enabled:t?.enabled===!1?!1:a,...t})},le=e=>{let t=n();return c({queryKey:[`dictionariesKeys`],queryFn:()=>t.dictionary.getDictionariesKeys(),requireUser:!0,requireOrganization:!0,requireProject:!0,...e})},ue=(e,t,r)=>{let i=n();return c({queryKey:[`dictionary`,e],queryFn:({signal:n})=>i.dictionary.getDictionary(e,t,{signal:n}),requireUser:!0,requireOrganization:!0,requireProject:!0,...r})},de=()=>{let e=n();return i({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.addDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},fe=()=>{let e=n();return i({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.pushDictionaries(t.dictionaries),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},pe=()=>{let e=n();return i({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.updateDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},me=()=>{let e=n();return i({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.deleteDictionary(t.dictionaryId),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},he=(e,t)=>{let r=n();return c({queryKey:[`tags`,e],queryFn:({signal:t})=>r.tag.getTags(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ge=()=>{let e=n();return i({mutationKey:[`tags`],mutationFn:t=>e.tag.addTag(t),meta:{invalidateQueries:[[`tags`]]}})},_e=()=>{let e=n();return i({mutationKey:[`tags`],mutationFn:t=>e.tag.updateTag(t.tagId,t.tag),meta:{invalidateQueries:[[`tags`]]}})},ve=()=>{let e=n();return i({mutationKey:[`tags`],mutationFn:t=>e.tag.deleteTag(t),meta:{invalidateQueries:[[`tags`]]}})},ye=(e,t)=>{let r=n();return a({queryKey:[`pricing`,e],queryFn:({signal:t})=>r.stripe.getPricing(e,{signal:t}),...t})},be=(e,t)=>{let r=n();return c({queryKey:[`subscription`,e],queryFn:({signal:t})=>r.stripe.getSubscription(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},xe=()=>{let e=n();return i({mutationKey:[`subscription`],mutationFn:()=>e.stripe.cancelSubscription(),meta:{invalidateQueries:[[`session`],[`subscription`]]}})},Se=()=>{let e=n();return i({mutationKey:[`ai-translateJSON`],mutationFn:t=>e.ai.translateJSON(t)})},Ce=()=>{let e=n();return i({mutationKey:[`ai-auditContentDeclaration`],mutationFn:t=>e.ai.auditContentDeclaration(t)})},we=()=>{let e=n();return i({mutationKey:[`ai-auditContentDeclarationMetadata`],mutationFn:t=>e.ai.auditContentDeclarationMetadata(t)})},Te=()=>{let e=n();return i({mutationKey:[`ai-auditContentDeclarationField`],mutationFn:t=>e.ai.auditContentDeclarationField(t)})},Ee=()=>{let e=n();return i({mutationKey:[`ai-auditTag`],mutationFn:t=>e.ai.auditTag(t)})},De=()=>{let e=n();return i({mutationKey:[],mutationFn:t=>e.ai.askDocQuestion(t)})},Oe=()=>{let e=n();return i({mutationKey:[`ai-autocomplete`],mutationFn:t=>e.ai.autocomplete(t)})},ke=()=>{let e=n();return i({mutationKey:[`audit-scan`],mutationFn:t=>e.audit.scanUrl(t)})},Ae=()=>{let e=n();return i({mutationKey:[`audit-recursive-start`],mutationFn:t=>e.audit.startRecursiveAudit(t)})},je=(e,t)=>{let r=n();return c({queryKey:[`audit-recursive-status`,e?.jobId],queryFn:({signal:t})=>r.audit.getRecursiveAuditStatus(e,{signal:t}),enabled:!!e?.jobId,...t})},Me=(e,t)=>{let r=n();return c({queryKey:[`discussions`,e],queryFn:({signal:t})=>r.ai.getDiscussions(e,{signal:t,cache:`no-store`}),requireUser:!0,...t})},Ne=(e,t)=>{let r=n();return c({queryKey:[`discussions-data`,e],queryFn:({signal:t})=>r.ai.getDiscussions({includeMessages:`false`,...e??{}},{signal:t,cache:`no-store`}),requireUser:!0,...t})},Pe=e=>{let t=n();return a({queryKey:[`search`,e],queryFn:()=>t.search.searchDoc(e),enabled:(e?.input?.length??0)>3})},Fe=()=>{let e=n();return i({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.subscribeToNewsletter(t)})},Ie=()=>{let e=n();return i({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.unsubscribeFromNewsletter(t)})},Le=()=>{let e=n();return i({mutationKey:[`newsletter`],mutationFn:()=>e.newsletter.getNewsletterStatus()})},Re=()=>{let e=n();return i({mutationKey:[`github`,`auth-url`],mutationFn:t=>e.github.getAuthUrl(t)})},ze=()=>{let e=n();return i({mutationKey:[`github`,`auth`],mutationFn:t=>e.github.authenticate(t)})},Be=(e=!0)=>{let t=n();return a({queryKey:[`github`,`repos`],queryFn:()=>t.github.getRepositories(),enabled:e})},Ve=()=>{let e=n();return i({mutationKey:[`github`,`check-config`],mutationFn:t=>e.github.checkIntlayerConfig(void 0,t.owner,t.repository,t.branch)})},He=()=>{let e=n();return i({mutationKey:[`github`,`get-config-file`],mutationFn:t=>e.github.getConfigFile(void 0,t.owner,t.repository,t.branch,t.path)})},Ue=()=>{let e=n();return i({mutationKey:[`gitlab`,`auth`],mutationFn:t=>e.gitlab.authenticate(t.code,t.redirectUri,t.instanceUrl)})},We=(e=!0,t)=>{let r=n();return a({queryKey:[`gitlab`,`projects`,t],queryFn:()=>r.gitlab.getProjects(void 0,t),enabled:e})},Ge=()=>{let e=n();return i({mutationKey:[`gitlab`,`check-config`],mutationFn:t=>e.gitlab.checkIntlayerConfig(void 0,t.projectId,t.branch,t.instanceUrl)})},Ke=()=>{let e=n();return i({mutationKey:[`gitlab`,`get-config-file`],mutationFn:t=>e.gitlab.getConfigFile(void 0,t.projectId,t.branch,t.path,t.instanceUrl)})},qe=()=>{let e=n();return i({mutationKey:[`bitbucket`,`auth`],mutationFn:t=>e.bitbucket.authenticate(t)})},Je=(e=!0)=>{let t=n();return a({queryKey:[`bitbucket`,`repos`],queryFn:()=>t.bitbucket.getRepositories(),enabled:e})},$=()=>{let e=n();return i({mutationKey:[`bitbucket`,`check-config`],mutationFn:t=>e.bitbucket.checkIntlayerConfig(void 0,t.workspace,t.repoSlug,t.branch)})},Ye=()=>{let e=n();return i({mutationKey:[`bitbucket`,`get-config-file`],mutationFn:t=>e.bitbucket.getConfigFile(void 0,t.workspace,t.repoSlug,t.branch,t.path)})},Xe=()=>{let e=n();return a({queryKey:[`editor`,`dictionaries`],queryFn:()=>e.editor.getDictionaries()})},Ze=()=>{let e=n();return i({mutationKey:[`editor`,`dictionaries`],mutationFn:t=>e.editor.writeDictionary(t)})},Qe=(e,t)=>{let r=n();return a({queryKey:[`showcase`,`projects`,e],queryFn:({signal:t})=>r.showcaseProject.getShowcaseProjects(e,{signal:t}),...t})},$e=(e,t)=>{let r=n();return a({queryKey:[`showcase`,`project`,e],queryFn:({signal:t})=>r.showcaseProject.getShowcaseProjectById(e,{signal:t}),enabled:!!e,...t})},et=(e,t)=>{let r=n();return a({queryKey:[`showcase`,`other-projects`,e],queryFn:({signal:t})=>r.showcaseProject.getOtherShowcaseProjects(e,{signal:t}),enabled:!!e.excludeId,...t})},tt=e=>{let t=n(e),r=o();return i({mutationKey:[`showcase`,`submit`],mutationFn:e=>t.showcaseProject.submitShowcaseProject(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`showcase`]})}})},nt=e=>{let t=n(e),r=o();return i({mutationKey:[`showcase`,`delete`],mutationFn:e=>t.showcaseProject.deleteShowcaseProject(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`showcase`]})}})},rt=e=>{let t=n(e);return i({mutationKey:[`showcase`,`upvote`],mutationFn:e=>t.showcaseProject.toggleShowcaseUpvote({projectId:e})})},it=e=>{let t=n(e);return i({mutationKey:[`showcase`,`downvote`],mutationFn:e=>t.showcaseProject.toggleShowcaseDownvote({projectId:e})})},at=e=>{let t=n(e),r=o();return i({mutationKey:[`showcase`,`update`],mutationFn:({projectId:e,...n})=>t.showcaseProject.updateShowcaseProject(e,n),onSuccess:()=>{r.invalidateQueries({queryKey:[`showcase`]})}})};export{de as useAddDictionary,ie as useAddNewAccessKey,I as useAddOrganization,B as useAddOrganizationMember,x as useAddPasskey,G as useAddProject,ge as useAddTag,c as useAppQuery,De as useAskDocQuestion,p as useAskResetPassword,Ce as useAuditContentDeclaration,Te as useAuditContentDeclarationField,we as useAuditContentDeclarationMetadata,ke as useAuditScan,Ee as useAuditTag,Oe as useAutocomplete,qe as useBitbucketAuth,$ as useBitbucketCheckConfig,Ye as useBitbucketGetConfigFile,Je as useBitbucketRepos,xe as useCancelSubscription,f as useChangePassword,M as useCreateUser,ae as useDeleteAccessKey,me as useDeleteDictionary,V as useDeleteOrganization,C as useDeletePasskey,J as useDeleteProject,k as useDeleteSSOProvider,nt as useDeleteShowcaseProject,ve as useDeleteTag,P as useDeleteUser,v as useDisableTwoFactor,_ as useEnableTwoFactor,Z as useGetCIConfig,se as useGetDictionaries,le as useGetDictionariesKeys,ue as useGetDictionary,Me as useGetDiscussions,Ne as useGetDiscussionsData,Xe as useGetEditorDictionaries,Le as useGetNewsletterStatus,F as useGetOrganizations,et as useGetOtherShowcaseProjects,ye as useGetPricing,W as useGetProjects,je as useGetRecursiveAuditStatus,$e as useGetShowcaseProjectById,Qe as useGetShowcaseProjects,be as useGetSubscription,he as useGetTags,g as useGetUserByAccount,j as useGetUserById,A as useGetUsers,l as useGetVerifyEmailStatus,ze as useGithubAuth,Ve as useGithubCheckConfig,Re as useGithubGetAuthUrl,He as useGithubGetConfigFile,Be as useGithubRepos,Ue as useGitlabAuth,Ge as useGitlabCheckConfig,Ke as useGitlabGetConfigFile,We as useGitlabProjects,ce as useInfiniteGetDictionaries,w as useListPasskeys,O as useListSSOProviders,te as useLogin,d as useLogout,Q as usePushCIConfig,fe as usePushDictionaries,o as useQueryClient,oe as useRefreshAccessKey,u as useRegister,E as useRegisterSSO,m as useResetPassword,Pe as useSearchDoc,H as useSelectOrganization,Y as useSelectProject,T as useSignInMagicLink,S as useSignInPasskey,D as useSignInSSO,Ae as useStartRecursiveAudit,tt as useSubmitShowcaseProject,Fe as useSubscribeToNewsletter,it as useToggleShowcaseDownvote,rt as useToggleShowcaseUpvote,Se as useTranslateJSONDeclaration,ne as useTriggerBuild,re as useTriggerWebhook,U as useUnselectOrganization,X as useUnselectProject,Ie as useUnsubscribeFromNewsletter,pe as useUpdateDictionary,L as useUpdateOrganization,R as useUpdateOrganizationMembers,z as useUpdateOrganizationMembersById,K as useUpdateProject,q as useUpdateProjectMembers,at as useUpdateShowcaseProject,_e as useUpdateTag,N as useUpdateUser,b as useVerifyBackupCode,h as useVerifyEmail,y as useVerifyTotp,Ze as useWriteDictionary};
2
2
  //# sourceMappingURL=reactQuery.mjs.map