@intlayer/design-system 8.4.8 → 8.4.10
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.
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +5 -1
- package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
- package/dist/esm/components/Table/Table.mjs +40 -3
- package/dist/esm/components/Table/Table.mjs.map +1 -1
- package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
- package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
- package/dist/esm/providers/ReactQueryProvider.mjs +8 -0
- package/dist/esm/providers/ReactQueryProvider.mjs.map +1 -1
- package/dist/types/components/Badge/index.d.ts +1 -1
- package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +2 -25
- package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
- package/dist/types/components/Browser/Browser.content.d.ts +9 -193
- package/dist/types/components/Browser/Browser.content.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts +2 -2
- package/dist/types/components/Carousel/index.content.d.ts +3 -73
- package/dist/types/components/Carousel/index.content.d.ts.map +1 -1
- package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
- package/dist/types/components/Command/index.d.ts +2 -2
- package/dist/types/components/Container/index.d.ts +2 -2
- package/dist/types/components/CopyButton/CopyButton.content.d.ts +2 -25
- package/dist/types/components/CopyButton/CopyButton.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +13 -289
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +5 -97
- package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +28 -649
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +17 -385
- package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +13 -289
- package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/NodeTypeSelector.d.ts +1 -1
- package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +17 -385
- package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +5 -97
- package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +4 -73
- package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +3 -49
- package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
- package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +16 -361
- package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +2 -26
- package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts.map +1 -1
- package/dist/types/components/IDE/code.content.d.ts +3 -49
- package/dist/types/components/IDE/code.content.d.ts.map +1 -1
- package/dist/types/components/IDE/copyCode.content.d.ts +3 -49
- package/dist/types/components/IDE/copyCode.content.d.ts.map +1 -1
- package/dist/types/components/IDE/selectors.content.d.ts +7 -145
- package/dist/types/components/IDE/selectors.content.d.ts.map +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +2 -2
- package/dist/types/components/Loader/index.content.d.ts +2 -25
- package/dist/types/components/Loader/index.content.d.ts.map +1 -1
- package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +9 -193
- package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +7 -145
- package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/types/components/Pagination/pagination.content.d.ts +5 -121
- package/dist/types/components/Pagination/pagination.content.d.ts.map +1 -1
- package/dist/types/components/RightDrawer/rightDrawer.content.d.ts +3 -49
- package/dist/types/components/RightDrawer/rightDrawer.content.d.ts.map +1 -1
- package/dist/types/components/Table/Table.d.ts.map +1 -1
- package/dist/types/components/Table/table.content.d.ts +2 -25
- package/dist/types/components/Table/table.content.d.ts.map +1 -1
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/dist/types/components/Terminal/terminal.content.d.ts +3 -49
- package/dist/types/components/Terminal/terminal.content.d.ts.map +1 -1
- package/dist/types/providers/ReactQueryProvider.d.ts.map +1 -1
- package/package.json +19 -19
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Button, ButtonColor, ButtonTextAlign, ButtonVariant } from "../../Button/Button.mjs";
|
|
2
2
|
import { Accordion } from "../../Accordion/Accordion.mjs";
|
|
3
3
|
import { getIsEditableSection } from "../getIsEditableSection.mjs";
|
|
4
|
+
import configuration from "@intlayer/config/built";
|
|
4
5
|
import { ChevronRight, Plus } from "lucide-react";
|
|
5
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import configuration from "@intlayer/config/built";
|
|
7
7
|
import { useIntlayer } from "react-intlayer";
|
|
8
8
|
import { useEditedContentActions, useEditorLocale, useFocusUnmergedDictionary } from "@intlayer/editor-react";
|
|
9
9
|
import { getContentNodeByKeyPath, getEmptyNode, getNodeType } from "@intlayer/core/dictionaryManipulator";
|
|
@@ -98,7 +98,11 @@ const createLinkRenderer = (locale) => {
|
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
100
|
const PreRenderer = (props) => /* @__PURE__ */ jsx(Fragment$1, { children: props.children });
|
|
101
|
-
const TableRenderer = (props) => /* @__PURE__ */ jsx(Table, {
|
|
101
|
+
const TableRenderer = (props) => /* @__PURE__ */ jsx(Table, {
|
|
102
|
+
isRollable: true,
|
|
103
|
+
displayModal: true,
|
|
104
|
+
...props
|
|
105
|
+
});
|
|
102
106
|
const ThRenderer = ({ className, ...props }) => /* @__PURE__ */ jsx("th", {
|
|
103
107
|
className: cn("border-neutral border-b bg-neutral/10 p-4", className),
|
|
104
108
|
...props
|
|
@@ -1 +1 @@
|
|
|
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 type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport { memo } 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// 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 MemoizedCodeBlock = memo(\n ({\n className,\n children,\n isDarkMode,\n ...rest\n }: ComponentProps<'code'> & { isDarkMode?: boolean }) => {\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n const decodedContent = content.replace(\n /&(?:amp;)?#(\\d+);/g,\n (_, code: string) => String.fromCharCode(parseInt(code, 10))\n );\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 {decodedContent}\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 (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.className === nextProps.className &&\n prevProps.isDarkMode === nextProps.isDarkMode\n);\n\nconst createCodeRenderer = (isDarkMode?: boolean) => {\n return function CodeWrapper(props: ComponentProps<'code'>) {\n return <MemoizedCodeBlock {...props} isDarkMode={isDarkMode} />;\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={\n src?.includes('github.com')\n ? src\n ?.replace('github.com', 'raw.githubusercontent.com')\n .replace('/blob/', '/') // GitHub raw URLs do not use /blob/\n : src\n }\n />\n);\n\nconst createLinkRenderer = (locale?: LocalesValues) => {\n return (props: ComponentProps<'a'>) => (\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 {...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 for static renderers\nconst staticMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\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\n// Factory function to create components with dynamic props\nconst createMarkdownComponents = (\n isDarkMode?: boolean,\n locale?: LocalesValues\n) => ({\n ...staticMarkdownComponents,\n code: createCodeRenderer(isDarkMode),\n a: createLinkRenderer(locale),\n});\n\n// Export static renderers for backward compatibility\nexport const baseMarkdownComponents = staticMarkdownComponents;\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 const markdownComponents = createMarkdownComponents(isDarkMode, locale);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAY,GAAI;CAAS;AAErD,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAkB,GAAI;CAAS;AAE3D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,kBAAkB,UACtB,oBAAC,UAAD;CAAQ,WAAU;CAAY,GAAI;CAAS;AAG7C,MAAM,oBAAoB,MACvB,EACC,WACA,UACA,YACA,GAAG,WACoD;CACvD,MAAM,UAAU,OAAO,YAAY,GAAG,CAAC,QAAQ,OAAO,GAAG;AAGzD,KAAI,CAFY,CAAC,CAAC,UAOhB,QACE,oBAAC,QAAD;EAAM,WAAU;YALK,QAAQ,QAC7B,uBACC,GAAG,SAAiB,OAAO,aAAa,SAAS,MAAM,GAAG,CAAC,CAC7D;EAIQ;CAIX,MAAM,WAAY,WAAW,QAAQ,kBAAkB,GAAG,IACxD;AAEF,QACE,oBAAC,MAAD;EAAM,GAAI;EAAgB;EAAU;EAAuB;YACxD;EACI;IAGV,WAAW,cACV,UAAU,aAAa,UAAU,YACjC,UAAU,cAAc,UAAU,aAClC,UAAU,eAAe,UAAU,WACtC;AAED,MAAM,sBAAsB,eAAyB;AACnD,QA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,oBAAC,MAAD;CAAI,WAAW,GAAG,2BAA2B,UAAU;CAAE,GAAI;CAAS;AAGxE,MAAM,gBAAgB,UACpB,oBAAC,KAAD;CACE,GAAI;CACJ,WAAU;CACV,iBAAgB;CAChB;AAEJ,MAAM,mBAAmB,EACvB,WACA,GAAG,YAEH,oBAAC,OAAD;CAAK,WAAW,GAAG,8BAA8B,UAAU;CAAE,GAAI;CAAS;AAE5E,MAAM,kBAAkB,EACtB,WACA,GAAG,YAEH,oBAAC,OAAD;CAAK,WAAW,GAAG,UAAU,UAAU;CAAE,GAAI;CAAS;AAIxD,MAAM,2BAA2B;CAC/B,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,QAAQ;CACR,YAAY;CACZ,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,OAAO;CACP,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;CACN,KAAK,IAAI;CACT,SAAS;CACT,QAAQ;CACT;AAGD,MAAM,4BACJ,YACA,YACI;CACJ,GAAG;CACH,MAAM,mBAAmB,WAAW;CACpC,GAAG,mBAAmB,OAAO;CAC9B;AAGD,MAAa,yBAAyB;AAatC,MAAa,8BAA8B,iBAA2B,EACpE,YAAY,wBACb;AAED,MAAa,oBAA+C,EAC1D,UACA,aAAa,OACb,QACA,YACA,qBACA,WACA,YAAY,gBACZ,cACI;AAcJ,QACE,oBAAC,cAAD,YACE,oBAAC,aAAD,YAboB,eAAe,UAAU;EAC/C,YAAY;GACV,GAJuB,yBAAyB,YAAY,OAAO;GAKnE,GAAG;GACJ;EACD;EACA;EACA;EACA;EACD,CAAC,EAI8C,GAC/B"}
|
|
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 type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport { memo } 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// 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 MemoizedCodeBlock = memo(\n ({\n className,\n children,\n isDarkMode,\n ...rest\n }: ComponentProps<'code'> & { isDarkMode?: boolean }) => {\n const content = String(children ?? '').replace(/\\n$/, '');\n const isBlock = !!className;\n\n if (!isBlock) {\n const decodedContent = content.replace(\n /&(?:amp;)?#(\\d+);/g,\n (_, code: string) => String.fromCharCode(parseInt(code, 10))\n );\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 {decodedContent}\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 (prevProps, nextProps) =>\n prevProps.children === nextProps.children &&\n prevProps.className === nextProps.className &&\n prevProps.isDarkMode === nextProps.isDarkMode\n);\n\nconst createCodeRenderer = (isDarkMode?: boolean) => {\n return function CodeWrapper(props: ComponentProps<'code'>) {\n return <MemoizedCodeBlock {...props} isDarkMode={isDarkMode} />;\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={\n src?.includes('github.com')\n ? src\n ?.replace('github.com', 'raw.githubusercontent.com')\n .replace('/blob/', '/') // GitHub raw URLs do not use /blob/\n : src\n }\n />\n);\n\nconst createLinkRenderer = (locale?: LocalesValues) => {\n return (props: ComponentProps<'a'>) => (\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 displayModal {...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 for static renderers\nconst staticMarkdownComponents = {\n h1: H1Renderer,\n h2: H2Renderer,\n h3: H3Renderer,\n h4: H4Renderer,\n h5: H5Renderer,\n h6: H6Renderer,\n strong: StrongRenderer,\n blockquote: BlockquoteRenderer,\n ul: UlRenderer,\n ol: OlRenderer,\n img: ImgRenderer,\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\n// Factory function to create components with dynamic props\nconst createMarkdownComponents = (\n isDarkMode?: boolean,\n locale?: LocalesValues\n) => ({\n ...staticMarkdownComponents,\n code: createCodeRenderer(isDarkMode),\n a: createLinkRenderer(locale),\n});\n\n// Export static renderers for backward compatibility\nexport const baseMarkdownComponents = staticMarkdownComponents;\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 const markdownComponents = createMarkdownComponents(isDarkMode, locale);\n\n const markdownContent = renderMarkdown(children, {\n components: {\n ...markdownComponents,\n ...componentsProp,\n },\n wrapper,\n forceBlock,\n preserveFrontmatter,\n tagfilter,\n });\n\n return (\n <CodeProvider>\n <TabProvider>{markdownContent}</TabProvider>\n </CodeProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAY,GAAI;CAAS;AAErD,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAkB,GAAI;CAAS;AAE3D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,cAAc,UAClB,oBAAC,IAAD;CAAI;CAAY,WAAU;CAAiB,GAAI;CAAS;AAE1D,MAAM,kBAAkB,UACtB,oBAAC,UAAD;CAAQ,WAAU;CAAY,GAAI;CAAS;AAG7C,MAAM,oBAAoB,MACvB,EACC,WACA,UACA,YACA,GAAG,WACoD;CACvD,MAAM,UAAU,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BAA8B,iBAA2B,EACpE,YAAY,wBACb;AAED,MAAa,oBAA+C,EAC1D,UACA,aAAa,OACb,QACA,YACA,qBACA,WACA,YAAY,gBACZ,cACI;AAcJ,QACE,oBAAC,cAAD,YACE,oBAAC,aAAD,YAboB,eAAe,UAAU;EAC/C,YAAY;GACV,GAJuB,yBAAyB,YAAY,OAAO;GAKnE,GAAG;GACJ;EACD;EACA;EACA;EACA;EACD,CAAC,EAI8C,GAC/B"}
|
|
@@ -4,11 +4,14 @@ import { cn } from "../../utils/cn.mjs";
|
|
|
4
4
|
import { Button } from "../Button/Button.mjs";
|
|
5
5
|
import { ExpandCollapse } from "../ExpandCollapse/ExpandCollapse.mjs";
|
|
6
6
|
import { Modal, ModalSize } from "../Modal/Modal.mjs";
|
|
7
|
-
import { useState } from "react";
|
|
7
|
+
import { useEffect, useRef, useState } from "react";
|
|
8
8
|
import { MoveDiagonal } from "lucide-react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
|
|
11
11
|
//#region src/components/Table/Table.tsx
|
|
12
|
+
const CHAR_WIDTH_REM = .55;
|
|
13
|
+
const MIN_WIDTH_REM = 5;
|
|
14
|
+
const MAX_WIDTH_REM = 30;
|
|
12
15
|
/**
|
|
13
16
|
* Table component that provides an enhanced table experience with modal expansion and collapsible content
|
|
14
17
|
*
|
|
@@ -148,8 +151,39 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
148
151
|
*/
|
|
149
152
|
const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
150
153
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
154
|
+
const tableRef = useRef(null);
|
|
155
|
+
const modalTableRef = useRef(null);
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (!tableRef.current) return;
|
|
158
|
+
const colLengths = [];
|
|
159
|
+
Array.from(tableRef.current.querySelectorAll("tr")).forEach((row) => {
|
|
160
|
+
Array.from(row.children).forEach((cell, index) => {
|
|
161
|
+
const len = cell.textContent?.trim().length ?? 0;
|
|
162
|
+
if (colLengths[index] === void 0 || len > colLengths[index]) colLengths[index] = len;
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
const applyToTable = (table) => {
|
|
166
|
+
const rows = Array.from(table.querySelectorAll("tr"));
|
|
167
|
+
if (rows.length === 0) return;
|
|
168
|
+
const applyColStyle = (el, index) => {
|
|
169
|
+
const minRem = Math.min(MAX_WIDTH_REM, Math.max(MIN_WIDTH_REM, (colLengths[index] ?? 0) * CHAR_WIDTH_REM));
|
|
170
|
+
el.style.minWidth = `${minRem}rem`;
|
|
171
|
+
el.style.maxWidth = `${MAX_WIDTH_REM}rem`;
|
|
172
|
+
};
|
|
173
|
+
table.querySelectorAll("th").forEach((th, index) => {
|
|
174
|
+
applyColStyle(th, index);
|
|
175
|
+
});
|
|
176
|
+
rows.forEach((row) => {
|
|
177
|
+
row.querySelectorAll("td").forEach((td, index) => {
|
|
178
|
+
applyColStyle(td, index);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
applyToTable(tableRef.current);
|
|
183
|
+
if (modalTableRef.current) applyToTable(modalTableRef.current);
|
|
184
|
+
}, [props.children, isModalOpen]);
|
|
151
185
|
return /* @__PURE__ */ jsxs("div", {
|
|
152
|
-
className: "relative",
|
|
186
|
+
className: "relative overflow-hidden rounded-2xl bg-background pr-4 [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
153
187
|
children: [
|
|
154
188
|
displayModal && /* @__PURE__ */ jsx("div", {
|
|
155
189
|
className: "sticky top-48 z-10",
|
|
@@ -170,7 +204,8 @@ const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
170
204
|
isRollable,
|
|
171
205
|
className: "max-w-full overflow-x-auto",
|
|
172
206
|
children: /* @__PURE__ */ jsx("table", {
|
|
173
|
-
|
|
207
|
+
ref: tableRef,
|
|
208
|
+
className: cn("w-full table-auto text-left", className),
|
|
174
209
|
...props
|
|
175
210
|
})
|
|
176
211
|
}),
|
|
@@ -179,9 +214,11 @@ const Table = ({ className, isRollable = false, displayModal, ...props }) => {
|
|
|
179
214
|
onClose: () => setIsModalOpen(false),
|
|
180
215
|
size: ModalSize.XL,
|
|
181
216
|
hasCloseButton: true,
|
|
217
|
+
isScrollable: true,
|
|
182
218
|
children: isModalOpen ? /* @__PURE__ */ jsx("div", {
|
|
183
219
|
className: "grid",
|
|
184
220
|
children: /* @__PURE__ */ jsx("table", {
|
|
221
|
+
ref: modalTableRef,
|
|
185
222
|
className: cn("min-w-full max-w-full table-auto text-left", className),
|
|
186
223
|
...props
|
|
187
224
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.mjs","names":[],"sources":["../../../../src/components/Table/Table.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { MoveDiagonal } from 'lucide-react';\nimport { type FC, type HTMLAttributes, useState } from 'react';\nimport { Button } from '../Button';\nimport { ExpandCollapse } from '../ExpandCollapse';\nimport { Modal, ModalSize } from '../Modal';\n\n/**\n * Properties for the Table component that extends standard HTML table attributes\n *\n * @interface TableProps\n * @extends {HTMLAttributes<HTMLTableElement>}\n *\n * @property {boolean} [isRollable] - Whether the table content can be collapsed/expanded using the ExpandCollapse wrapper\n * @property {string} [className] - Additional CSS classes for custom styling\n * @property {ReactNode} children - The table content including thead, tbody, tfoot elements\n *\n * @example\n * ```tsx\n * // Basic table usage\n * <Table>\n * <thead>\n * <tr>\n * <th>Name</th>\n * <th>Email</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>John Doe</td>\n * <td>john@example.com</td>\n * </tr>\n * </tbody>\n * </Table>\n *\n * // Collapsible table with custom styling\n * <Table isRollable className=\"border border-gray-300 rounded-lg\">\n * <thead>\n * <tr>\n * <th>Product</th>\n * <th>Price</th>\n * <th>Stock</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>Laptop</td>\n * <td>$999</td>\n * <td>15</td>\n * </tr>\n * </tbody>\n * </Table>\n * ```\n */\ntype TableProps = HTMLAttributes<HTMLTableElement> & {\n isRollable?: boolean;\n displayModal?: boolean;\n};\n\n/**\n * Table component that provides an enhanced table experience with modal expansion and collapsible content\n *\n * The Table component wraps a standard HTML table element with additional functionality:\n * - **Modal Expansion**: Click the diagonal arrow button to view the table in a full-screen modal\n * - **Collapsible Content**: Optionally wrap content in an ExpandCollapse component for space-saving\n * - **Responsive Design**: Handles large tables gracefully with modal overflow\n * - **Sticky Controls**: Table controls remain accessible even when scrolling\n *\n * ## Features\n * - **Modal View**: Full-screen modal for better viewing of large tables\n * - **Expand/Collapse**: Optional collapsible wrapper to save space\n * - **Responsive**: Handles overflow and responsive behavior automatically\n * - **Accessibility**: Maintains proper table semantics and keyboard navigation\n * - **Customizable**: Supports all standard HTML table attributes and styling\n *\n * ## Best Practices\n * - Use semantic HTML table structure (thead, tbody, tfoot)\n * - Provide proper column headers with scope attributes\n * - Use the isRollable prop for large tables that might need space management\n * - Apply consistent styling through the className prop\n * - Consider pagination for very large datasets\n *\n * @param {TableProps} props - The properties for the Table component\n * @returns {JSX.Element} The rendered table with enhanced functionality\n *\n * @example\n * ```tsx\n * // Simple data table\n * <Table>\n * <thead>\n * <tr>\n * <th scope=\"col\">Name</th>\n * <th scope=\"col\">Email</th>\n * <th scope=\"col\">Status</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>John Doe</td>\n * <td>john@example.com</td>\n * <td>\n * <span className=\"px-2 py-1 bg-green-100 text-green-800 rounded-full text-xs\">\n * Active\n * </span>\n * </td>\n * </tr>\n * <tr>\n * <td>Jane Smith</td>\n * <td>jane@example.com</td>\n * <td>\n * <span className=\"px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full text-xs\">\n * Pending\n * </span>\n * </td>\n * </tr>\n * </tbody>\n * </Table>\n *\n * // Large collapsible table with custom styling\n * <Table\n * isRollable\n * className=\"border border-gray-200 rounded-lg overflow-hidden\"\n * >\n * <thead className=\"bg-gray-50\">\n * <tr>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Product ID\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Name\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Category\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Price\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Stock\n * </th>\n * </tr>\n * </thead>\n * <tbody className=\"bg-white divide-y divide-gray-200\">\n * {products.map((product) => (\n * <tr key={product.id} className=\"hover:bg-gray-50\">\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n * #{product.id}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900\">\n * {product.name}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n * {product.category}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n * ${product.price.toFixed(2)}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n * {product.stock} units\n * </td>\n * </tr>\n * ))}\n * </tbody>\n * </Table>\n *\n * // Financial data table with formatted numbers\n * <Table className=\"w-full border-collapse\">\n * <thead>\n * <tr className=\"border-b-2 border-gray-300\">\n * <th scope=\"col\" className=\"text-left py-3 px-4\">Quarter</th>\n * <th scope=\"col\" className=\"text-right py-3 px-4\">Revenue</th>\n * <th scope=\"col\" className=\"text-right py-3 px-4\">Profit</th>\n * <th scope=\"col\" className=\"text-right py-3 px-4\">Growth</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr className=\"border-b border-gray-200\">\n * <td className=\"py-3 px-4 font-medium\">Q1 2024</td>\n * <td className=\"py-3 px-4 text-right\">$2,450,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">$345,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">+12.5%</td>\n * </tr>\n * <tr className=\"border-b border-gray-200\">\n * <td className=\"py-3 px-4 font-medium\">Q2 2024</td>\n * <td className=\"py-3 px-4 text-right\">$2,780,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">$398,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">+13.5%</td>\n * </tr>\n * </tbody>\n * </Table>\n * ```\n *\n * @see {@link ExpandCollapse} - Component used for collapsible table content\n * @see {@link Modal} - Component used for full-screen table view\n * @see {@link Button} - Component used for the modal trigger button\n */\nexport const Table: FC<TableProps> = ({\n className,\n isRollable = false,\n displayModal,\n ...props\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n return (\n <div className=\"relative\">\n {displayModal && (\n <div className=\"sticky top-48 z-10\">\n <div className=\"absolute top-4 right-2\">\n <Button\n variant=\"hoverable\"\n size=\"icon-md\"\n onClick={() => {\n setIsModalOpen(true);\n }}\n label=\"Move\"\n Icon={MoveDiagonal}\n />\n </div>\n </div>\n )}\n <ExpandCollapse\n isRollable={isRollable}\n className=\"max-w-full overflow-x-auto\"\n >\n <table\n className={cn(\n 'min-w-full max-w-full table-auto overflow-x-auto bg-background text-left',\n className\n )}\n {...props}\n />\n </ExpandCollapse>\n\n <Modal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n size={ModalSize.XL}\n hasCloseButton\n >\n {isModalOpen ? (\n <div className=\"grid\">\n <table\n className={cn(\n 'min-w-full max-w-full table-auto text-left',\n className\n )}\n {...props}\n />\n </div>\n ) : (\n <></>\n )}\n </Modal>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,MAAa,SAAyB,EACpC,WACA,aAAa,OACb,cACA,GAAG,YACC;CACJ,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;AAErD,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf;GACG,gBACC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,QAAD;MACE,SAAQ;MACR,MAAK;MACL,eAAe;AACb,sBAAe,KAAK;;MAEtB,OAAM;MACN,MAAM;MACN;KACE;IACF;GAER,oBAAC,gBAAD;IACc;IACZ,WAAU;cAEV,oBAAC,SAAD;KACE,WAAW,GACT,4EACA,UACD;KACD,GAAI;KACJ;IACa;GAEjB,oBAAC,OAAD;IACE,QAAQ;IACR,eAAe,eAAe,MAAM;IACpC,MAAM,UAAU;IAChB;cAEC,cACC,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,SAAD;MACE,WAAW,GACT,8CACA,UACD;MACD,GAAI;MACJ;KACE,IAEN,kCAAK;IAED;GACJ"}
|
|
1
|
+
{"version":3,"file":"Table.mjs","names":[],"sources":["../../../../src/components/Table/Table.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { MoveDiagonal } from 'lucide-react';\nimport {\n type FC,\n type HTMLAttributes,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button } from '../Button';\nimport { ExpandCollapse } from '../ExpandCollapse';\nimport { Modal, ModalSize } from '../Modal';\n\n/**\n * Properties for the Table component that extends standard HTML table attributes\n *\n * @interface TableProps\n * @extends {HTMLAttributes<HTMLTableElement>}\n *\n * @property {boolean} [isRollable] - Whether the table content can be collapsed/expanded using the ExpandCollapse wrapper\n * @property {string} [className] - Additional CSS classes for custom styling\n * @property {ReactNode} children - The table content including thead, tbody, tfoot elements\n *\n * @example\n * ```tsx\n * // Basic table usage\n * <Table>\n * <thead>\n * <tr>\n * <th>Name</th>\n * <th>Email</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>John Doe</td>\n * <td>john@example.com</td>\n * </tr>\n * </tbody>\n * </Table>\n *\n * // Collapsible table with custom styling\n * <Table isRollable className=\"border border-gray-300 rounded-lg\">\n * <thead>\n * <tr>\n * <th>Product</th>\n * <th>Price</th>\n * <th>Stock</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>Laptop</td>\n * <td>$999</td>\n * <td>15</td>\n * </tr>\n * </tbody>\n * </Table>\n * ```\n */\ntype TableProps = HTMLAttributes<HTMLTableElement> & {\n isRollable?: boolean;\n displayModal?: boolean;\n};\n\n// ~0.55rem per character (mid-point for proportional fonts)\nconst CHAR_WIDTH_REM = 0.55;\nconst MIN_WIDTH_REM = 5; // ~80px at 16px base\nconst MAX_WIDTH_REM = 30; // ~480px at 16px base\n\n/**\n * Table component that provides an enhanced table experience with modal expansion and collapsible content\n *\n * The Table component wraps a standard HTML table element with additional functionality:\n * - **Modal Expansion**: Click the diagonal arrow button to view the table in a full-screen modal\n * - **Collapsible Content**: Optionally wrap content in an ExpandCollapse component for space-saving\n * - **Responsive Design**: Handles large tables gracefully with modal overflow\n * - **Sticky Controls**: Table controls remain accessible even when scrolling\n *\n * ## Features\n * - **Modal View**: Full-screen modal for better viewing of large tables\n * - **Expand/Collapse**: Optional collapsible wrapper to save space\n * - **Responsive**: Handles overflow and responsive behavior automatically\n * - **Accessibility**: Maintains proper table semantics and keyboard navigation\n * - **Customizable**: Supports all standard HTML table attributes and styling\n *\n * ## Best Practices\n * - Use semantic HTML table structure (thead, tbody, tfoot)\n * - Provide proper column headers with scope attributes\n * - Use the isRollable prop for large tables that might need space management\n * - Apply consistent styling through the className prop\n * - Consider pagination for very large datasets\n *\n * @param {TableProps} props - The properties for the Table component\n * @returns {JSX.Element} The rendered table with enhanced functionality\n *\n * @example\n * ```tsx\n * // Simple data table\n * <Table>\n * <thead>\n * <tr>\n * <th scope=\"col\">Name</th>\n * <th scope=\"col\">Email</th>\n * <th scope=\"col\">Status</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>John Doe</td>\n * <td>john@example.com</td>\n * <td>\n * <span className=\"px-2 py-1 bg-green-100 text-green-800 rounded-full text-xs\">\n * Active\n * </span>\n * </td>\n * </tr>\n * <tr>\n * <td>Jane Smith</td>\n * <td>jane@example.com</td>\n * <td>\n * <span className=\"px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full text-xs\">\n * Pending\n * </span>\n * </td>\n * </tr>\n * </tbody>\n * </Table>\n *\n * // Large collapsible table with custom styling\n * <Table\n * isRollable\n * className=\"border border-gray-200 rounded-lg overflow-hidden\"\n * >\n * <thead className=\"bg-gray-50\">\n * <tr>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Product ID\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Name\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Category\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Price\n * </th>\n * <th scope=\"col\" className=\"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase\">\n * Stock\n * </th>\n * </tr>\n * </thead>\n * <tbody className=\"bg-white divide-y divide-gray-200\">\n * {products.map((product) => (\n * <tr key={product.id} className=\"hover:bg-gray-50\">\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n * #{product.id}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900\">\n * {product.name}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n * {product.category}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-900\">\n * ${product.price.toFixed(2)}\n * </td>\n * <td className=\"px-6 py-4 whitespace-nowrap text-sm text-gray-500\">\n * {product.stock} units\n * </td>\n * </tr>\n * ))}\n * </tbody>\n * </Table>\n *\n * // Financial data table with formatted numbers\n * <Table className=\"w-full border-collapse\">\n * <thead>\n * <tr className=\"border-b-2 border-gray-300\">\n * <th scope=\"col\" className=\"text-left py-3 px-4\">Quarter</th>\n * <th scope=\"col\" className=\"text-right py-3 px-4\">Revenue</th>\n * <th scope=\"col\" className=\"text-right py-3 px-4\">Profit</th>\n * <th scope=\"col\" className=\"text-right py-3 px-4\">Growth</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr className=\"border-b border-gray-200\">\n * <td className=\"py-3 px-4 font-medium\">Q1 2024</td>\n * <td className=\"py-3 px-4 text-right\">$2,450,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">$345,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">+12.5%</td>\n * </tr>\n * <tr className=\"border-b border-gray-200\">\n * <td className=\"py-3 px-4 font-medium\">Q2 2024</td>\n * <td className=\"py-3 px-4 text-right\">$2,780,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">$398,000</td>\n * <td className=\"py-3 px-4 text-right text-green-600\">+13.5%</td>\n * </tr>\n * </tbody>\n * </Table>\n * ```\n *\n * @see {@link ExpandCollapse} - Component used for collapsible table content\n * @see {@link Modal} - Component used for full-screen table view\n * @see {@link Button} - Component used for the modal trigger button\n */\nexport const Table: FC<TableProps> = ({\n className,\n isRollable = false,\n displayModal,\n ...props\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const tableRef = useRef<HTMLTableElement>(null);\n const modalTableRef = useRef<HTMLTableElement>(null);\n\n useEffect(() => {\n if (!tableRef.current) return;\n\n // Calculate the maximum character length per column from the main table\n const colLengths: number[] = [];\n Array.from(tableRef.current.querySelectorAll('tr')).forEach((row) => {\n Array.from(row.children).forEach((cell, index) => {\n const len = cell.textContent?.trim().length ?? 0;\n if (colLengths[index] === undefined || len > colLengths[index]) {\n colLengths[index] = len;\n }\n });\n });\n\n const applyToTable = (table: HTMLTableElement) => {\n const rows = Array.from(table.querySelectorAll('tr'));\n if (rows.length === 0) return;\n\n const applyColStyle = (el: HTMLElement, index: number) => {\n const minRem = Math.min(\n MAX_WIDTH_REM,\n Math.max(MIN_WIDTH_REM, (colLengths[index] ?? 0) * CHAR_WIDTH_REM)\n );\n el.style.minWidth = `${minRem}rem`;\n el.style.maxWidth = `${MAX_WIDTH_REM}rem`;\n };\n\n table.querySelectorAll('th').forEach((th, index) => {\n applyColStyle(th, index);\n });\n rows.forEach((row) => {\n row.querySelectorAll('td').forEach((td, index) => {\n applyColStyle(td, index);\n });\n });\n };\n\n applyToTable(tableRef.current);\n\n if (modalTableRef.current) applyToTable(modalTableRef.current);\n }, [props.children, isModalOpen]);\n\n return (\n <div className=\"relative overflow-hidden rounded-2xl bg-background pr-4 [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl\">\n {displayModal && (\n <div className=\"sticky top-48 z-10\">\n <div className=\"absolute top-4 right-2\">\n <Button\n variant=\"hoverable\"\n size=\"icon-md\"\n onClick={() => {\n setIsModalOpen(true);\n }}\n label=\"Move\"\n Icon={MoveDiagonal}\n />\n </div>\n </div>\n )}\n <ExpandCollapse\n isRollable={isRollable}\n className=\"max-w-full overflow-x-auto\"\n >\n <table\n ref={tableRef}\n className={cn('w-full table-auto text-left', className)}\n {...props}\n />\n </ExpandCollapse>\n\n <Modal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n size={ModalSize.XL}\n hasCloseButton\n isScrollable\n >\n {isModalOpen ? (\n <div className=\"grid\">\n <table\n ref={modalTableRef}\n className={cn(\n 'min-w-full max-w-full table-auto text-left',\n className\n )}\n {...props}\n />\n </div>\n ) : (\n <></>\n )}\n </Modal>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAoEA,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GACG,gBACC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,QAAD;MACE,SAAQ;MACR,MAAK;MACL,eAAe;AACb,sBAAe,KAAK;;MAEtB,OAAM;MACN,MAAM;MACN;KACE;IACF;GAER,oBAAC,gBAAD;IACc;IACZ,WAAU;cAEV,oBAAC,SAAD;KACE,KAAK;KACL,WAAW,GAAG,+BAA+B,UAAU;KACvD,GAAI;KACJ;IACa;GAEjB,oBAAC,OAAD;IACE,QAAQ;IACR,eAAe,eAAe,MAAM;IACpC,MAAM,UAAU;IAChB;IACA;cAEC,cACC,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,SAAD;MACE,KAAK;MACL,WAAW,GACT,8CACA,UACD;MACD,GAAI;MACJ;KACE,IAEN,kCAAK;IAED;GACJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useQuery } from "@tanstack/react-query";
|
|
4
3
|
import configuration from "@intlayer/config/built";
|
|
4
|
+
import { useQuery } from "@tanstack/react-query";
|
|
5
5
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
6
6
|
import { getOAuthAPI } from "@intlayer/api";
|
|
7
7
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { getAuthAPI } from "../../libs/auth.mjs";
|
|
4
4
|
import { useQueryClient } from "../reactQuery.mjs";
|
|
5
|
-
import { useQuery } from "@tanstack/react-query";
|
|
6
5
|
import configuration from "@intlayer/config/built";
|
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
|
7
7
|
import { useConfiguration } from "@intlayer/editor-react";
|
|
8
8
|
|
|
9
9
|
//#region src/hooks/useAuth/useSession.ts
|
|
@@ -27,10 +27,18 @@ const useToastEvents = () => {
|
|
|
27
27
|
[(() => {
|
|
28
28
|
try {
|
|
29
29
|
if (typeof error === "string") return JSON.parse(error);
|
|
30
|
+
if (error instanceof Error) return JSON.parse(error.message);
|
|
30
31
|
} catch (_) {}
|
|
31
32
|
return error;
|
|
32
33
|
})()].flat().forEach((err) => {
|
|
33
34
|
const apiError = err?.error ?? err;
|
|
35
|
+
if (apiError?.code === "RATE_LIMIT_EXCEEDED_UNAUTHENTICATED") {
|
|
36
|
+
toast({
|
|
37
|
+
title: apiError.message,
|
|
38
|
+
variant: "error"
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
34
42
|
toast({
|
|
35
43
|
title: formatErrorCode(apiError?.title ?? err?.title ?? "Error"),
|
|
36
44
|
description: apiError?.message ?? err?.message ?? String(apiError ?? "An error occurred"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactQueryProvider.mjs","names":[],"sources":["../../../src/providers/ReactQueryProvider.tsx"],"sourcesContent":["'use client';\n\nimport {\n type DefaultOptions,\n MutationCache,\n QueryClient,\n QueryClientProvider,\n type QueryKey,\n type UseMutationOptions,\n} from '@tanstack/react-query';\nimport { type FC, type PropsWithChildren, useRef } from 'react';\nimport { useToast } from '../components/Toaster';\n\nconst defaultQueryOptions: DefaultOptions = {\n queries: {\n retry: 1,\n // Keep data fresh for 30 seconds to avoid unnecessary refetches during navigation\n staleTime: 30 * 1000,\n // Give the cache a little breathing room across route transitions:\n gcTime: 5 * 60 * 1000, // e.g. 5 minutes\n // Only refetch on mount if data is stale (not every single mount)\n refetchOnMount: true,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n },\n mutations: {\n retry: 0,\n },\n};\n\nconst SHOW_ERROR_CODE = false;\n\ndeclare module '@tanstack/react-query' {\n interface Register {\n mutationMeta: {\n onSuccess?: UseMutationOptions['onSuccess'];\n onError?: UseMutationOptions['onError'];\n invalidateQueries?: QueryKey[];\n resetQueries?: QueryKey[];\n };\n }\n}\n\nconst formatErrorCode = (errorCode: string) => errorCode.split('_').join(' ');\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useToastEvents = () => {\n const { toast } = useToast();\n\n const onError: MutationCache['config']['onError'] = (error: any) => {\n const parsed = (() => {\n try {\n if (typeof error === 'string') return JSON.parse(error);\n } catch (_) {}\n return error;\n })();\n\n [parsed].flat().forEach((err: any) => {\n // Check for nested error object (standard in your API responses: { statusCode, error: { ... } })\n const apiError = err?.error ?? err;\n\n toast({\n title: formatErrorCode(\n SHOW_ERROR_CODE\n ? (apiError?.code ?? err?.code)\n : (apiError?.title ?? err?.title ?? 'Error')\n ),\n description:\n apiError?.message ??\n err?.message ??\n String(apiError ?? 'An error occurred'),\n variant: 'error',\n });\n });\n };\n\n const onSuccess: MutationCache['config']['onSuccess'] = (data: any) => {\n if (data?.error) {\n toast({\n title: formatErrorCode(data.error.title ?? data.error.code ?? 'Error'),\n description:\n data.error.message ?? data.error.code ?? 'An error occurred',\n variant: 'error',\n });\n }\n\n if (data?.message) {\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n }\n };\n\n return {\n onError,\n onSuccess,\n };\n};\n\nexport const ReactQueryProvider: FC<PropsWithChildren> = ({ children }) => {\n const { onError, onSuccess } = useToastEvents();\n const clientRef = useRef<QueryClient>(null);\n\n if (!clientRef.current) {\n const mutationCache = new MutationCache({\n onSuccess,\n onError,\n onSettled: (_data, _error, _variables, _context, mutation) => {\n if (mutation.meta?.invalidateQueries) {\n mutation.meta.invalidateQueries.forEach((queryKey) => {\n queryClient.invalidateQueries({\n queryKey,\n });\n });\n }\n\n if (mutation.meta?.resetQueries) {\n mutation.meta.resetQueries.forEach((queryKey) => {\n queryClient.resetQueries({\n queryKey,\n });\n });\n }\n },\n });\n\n const queryClient = new QueryClient({\n defaultOptions: defaultQueryOptions,\n mutationCache,\n });\n clientRef.current = queryClient;\n }\n\n return (\n <QueryClientProvider client={clientRef.current}>\n {children}\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,sBAAsC;CAC1C,SAAS;EACP,OAAO;EAEP,WAAW,KAAK;EAEhB,QAAQ,MAAS;EAEjB,gBAAgB;EAChB,sBAAsB;EACtB,oBAAoB;EACrB;CACD,WAAW,EACT,OAAO,GACR;CACF;AAeD,MAAM,mBAAmB,cAAsB,UAAU,MAAM,IAAI,CAAC,KAAK,IAAI;;;;AAK7E,MAAM,uBAAuB;CAC3B,MAAM,EAAE,UAAU,UAAU;CAE5B,MAAM,WAA+C,UAAe;
|
|
1
|
+
{"version":3,"file":"ReactQueryProvider.mjs","names":[],"sources":["../../../src/providers/ReactQueryProvider.tsx"],"sourcesContent":["'use client';\n\nimport {\n type DefaultOptions,\n MutationCache,\n QueryClient,\n QueryClientProvider,\n type QueryKey,\n type UseMutationOptions,\n} from '@tanstack/react-query';\nimport { type FC, type PropsWithChildren, useRef } from 'react';\nimport { useToast } from '../components/Toaster';\n\nconst defaultQueryOptions: DefaultOptions = {\n queries: {\n retry: 1,\n // Keep data fresh for 30 seconds to avoid unnecessary refetches during navigation\n staleTime: 30 * 1000,\n // Give the cache a little breathing room across route transitions:\n gcTime: 5 * 60 * 1000, // e.g. 5 minutes\n // Only refetch on mount if data is stale (not every single mount)\n refetchOnMount: true,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n },\n mutations: {\n retry: 0,\n },\n};\n\nconst SHOW_ERROR_CODE = false;\n\ndeclare module '@tanstack/react-query' {\n interface Register {\n mutationMeta: {\n onSuccess?: UseMutationOptions['onSuccess'];\n onError?: UseMutationOptions['onError'];\n invalidateQueries?: QueryKey[];\n resetQueries?: QueryKey[];\n };\n }\n}\n\nconst formatErrorCode = (errorCode: string) => errorCode.split('_').join(' ');\n\n/**\n * Hook to handle error logging and toast notifications\n */\nconst useToastEvents = () => {\n const { toast } = useToast();\n\n const onError: MutationCache['config']['onError'] = (error: any) => {\n const parsed = (() => {\n try {\n if (typeof error === 'string') return JSON.parse(error);\n if (error instanceof Error) return JSON.parse(error.message);\n } catch (_) {}\n return error;\n })();\n\n [parsed].flat().forEach((err: any) => {\n // Check for nested error object (standard in your API responses: { statusCode, error: { ... } })\n const apiError = err?.error ?? err;\n\n if (apiError?.code === 'RATE_LIMIT_EXCEEDED_UNAUTHENTICATED') {\n toast({\n title: apiError.message,\n variant: 'error',\n });\n return;\n }\n\n toast({\n title: formatErrorCode(\n SHOW_ERROR_CODE\n ? (apiError?.code ?? err?.code)\n : (apiError?.title ?? err?.title ?? 'Error')\n ),\n description:\n apiError?.message ??\n err?.message ??\n String(apiError ?? 'An error occurred'),\n variant: 'error',\n });\n });\n };\n\n const onSuccess: MutationCache['config']['onSuccess'] = (data: any) => {\n if (data?.error) {\n toast({\n title: formatErrorCode(data.error.title ?? data.error.code ?? 'Error'),\n description:\n data.error.message ?? data.error.code ?? 'An error occurred',\n variant: 'error',\n });\n }\n\n if (data?.message) {\n toast({\n title: data.message,\n description: data.description,\n variant: 'success',\n });\n }\n };\n\n return {\n onError,\n onSuccess,\n };\n};\n\nexport const ReactQueryProvider: FC<PropsWithChildren> = ({ children }) => {\n const { onError, onSuccess } = useToastEvents();\n const clientRef = useRef<QueryClient>(null);\n\n if (!clientRef.current) {\n const mutationCache = new MutationCache({\n onSuccess,\n onError,\n onSettled: (_data, _error, _variables, _context, mutation) => {\n if (mutation.meta?.invalidateQueries) {\n mutation.meta.invalidateQueries.forEach((queryKey) => {\n queryClient.invalidateQueries({\n queryKey,\n });\n });\n }\n\n if (mutation.meta?.resetQueries) {\n mutation.meta.resetQueries.forEach((queryKey) => {\n queryClient.resetQueries({\n queryKey,\n });\n });\n }\n },\n });\n\n const queryClient = new QueryClient({\n defaultOptions: defaultQueryOptions,\n mutationCache,\n });\n clientRef.current = queryClient;\n }\n\n return (\n <QueryClientProvider client={clientRef.current}>\n {children}\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,sBAAsC;CAC1C,SAAS;EACP,OAAO;EAEP,WAAW,KAAK;EAEhB,QAAQ,MAAS;EAEjB,gBAAgB;EAChB,sBAAsB;EACtB,oBAAoB;EACrB;CACD,WAAW,EACT,OAAO,GACR;CACF;AAeD,MAAM,mBAAmB,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pD,kBAAY,kBAAkB,EAC5B,UACD,CAAC;OACF;AAGJ,SAAI,SAAS,MAAM,aACjB,UAAS,KAAK,aAAa,SAAS,aAAa;AAC/C,kBAAY,aAAa,EACvB,UACD,CAAC;OACF;;IAGP,CAAC;GAKD,CAAC;AACF,YAAU,UAAU;;AAGtB,QACE,oBAAC,qBAAD;EAAqB,QAAQ,UAAU;EACpC;EACmB"}
|
|
@@ -43,7 +43,7 @@ declare enum BadgeSize {
|
|
|
43
43
|
* @description Defines the styling variants for different badge combinations
|
|
44
44
|
*/
|
|
45
45
|
declare const badgeVariants: (props?: {
|
|
46
|
-
color?: "text" | "primary" | "secondary" | "destructive" | "
|
|
46
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "success" | "error" | "neutral" | "light" | "dark" | "custom";
|
|
47
47
|
variant?: "none" | "default" | "outline" | "hoverable";
|
|
48
48
|
size?: "sm" | "md" | "lg";
|
|
49
49
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_core_transpiler0 from "@intlayer/core/transpiler";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Breadcrumb/breadcrumb.content.d.ts
|
|
4
4
|
declare const breadCrumbContent: {
|
|
5
5
|
key: string;
|
|
6
6
|
content: {
|
|
7
|
-
linkLabel:
|
|
7
|
+
linkLabel: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
8
8
|
en: string;
|
|
9
9
|
fr: string;
|
|
10
10
|
es: string;
|
|
@@ -23,29 +23,6 @@ declare const breadCrumbContent: {
|
|
|
23
23
|
id: string;
|
|
24
24
|
vi: string;
|
|
25
25
|
uk: string;
|
|
26
|
-
}, {
|
|
27
|
-
nodeType: "translation";
|
|
28
|
-
} & {
|
|
29
|
-
translation: {
|
|
30
|
-
en: string;
|
|
31
|
-
fr: string;
|
|
32
|
-
es: string;
|
|
33
|
-
'en-GB': string;
|
|
34
|
-
de: string;
|
|
35
|
-
ja: string;
|
|
36
|
-
ko: string;
|
|
37
|
-
zh: string;
|
|
38
|
-
it: string;
|
|
39
|
-
pt: string;
|
|
40
|
-
hi: string;
|
|
41
|
-
ar: string;
|
|
42
|
-
ru: string;
|
|
43
|
-
tr: string;
|
|
44
|
-
pl: string;
|
|
45
|
-
id: string;
|
|
46
|
-
vi: string;
|
|
47
|
-
uk: string;
|
|
48
|
-
};
|
|
49
26
|
}>;
|
|
50
27
|
};
|
|
51
28
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.content.d.ts","names":[],"sources":["../../../../src/components/Breadcrumb/breadcrumb.content.ts"],"mappings":";;;cAEa,iBAAA;;;eA4BS,
|
|
1
|
+
{"version":3,"file":"breadcrumb.content.d.ts","names":[],"sources":["../../../../src/components/Breadcrumb/breadcrumb.content.ts"],"mappings":";;;cAEa,iBAAA;;;eA4BS,0BAAA,CAAA,kBAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_core_transpiler0 from "@intlayer/core/transpiler";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Browser/Browser.content.d.ts
|
|
4
4
|
declare const browserContent: {
|
|
5
5
|
key: string;
|
|
6
6
|
content: {
|
|
7
|
-
ariaLabel:
|
|
7
|
+
ariaLabel: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
8
8
|
en: string;
|
|
9
9
|
'en-GB': string;
|
|
10
10
|
fr: string;
|
|
@@ -23,31 +23,8 @@ declare const browserContent: {
|
|
|
23
23
|
id: string;
|
|
24
24
|
vi: string;
|
|
25
25
|
uk: string;
|
|
26
|
-
}, {
|
|
27
|
-
nodeType: "translation";
|
|
28
|
-
} & {
|
|
29
|
-
translation: {
|
|
30
|
-
en: string;
|
|
31
|
-
'en-GB': string;
|
|
32
|
-
fr: string;
|
|
33
|
-
es: string;
|
|
34
|
-
de: string;
|
|
35
|
-
ja: string;
|
|
36
|
-
ko: string;
|
|
37
|
-
zh: string;
|
|
38
|
-
it: string;
|
|
39
|
-
pt: string;
|
|
40
|
-
hi: string;
|
|
41
|
-
ar: string;
|
|
42
|
-
ru: string;
|
|
43
|
-
tr: string;
|
|
44
|
-
pl: string;
|
|
45
|
-
id: string;
|
|
46
|
-
vi: string;
|
|
47
|
-
uk: string;
|
|
48
|
-
};
|
|
49
26
|
}>;
|
|
50
|
-
urlLabel:
|
|
27
|
+
urlLabel: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
51
28
|
en: string;
|
|
52
29
|
'en-GB': string;
|
|
53
30
|
fr: string;
|
|
@@ -66,32 +43,9 @@ declare const browserContent: {
|
|
|
66
43
|
id: string;
|
|
67
44
|
vi: string;
|
|
68
45
|
uk: string;
|
|
69
|
-
}, {
|
|
70
|
-
nodeType: "translation";
|
|
71
|
-
} & {
|
|
72
|
-
translation: {
|
|
73
|
-
en: string;
|
|
74
|
-
'en-GB': string;
|
|
75
|
-
fr: string;
|
|
76
|
-
es: string;
|
|
77
|
-
de: string;
|
|
78
|
-
ja: string;
|
|
79
|
-
ko: string;
|
|
80
|
-
zh: string;
|
|
81
|
-
it: string;
|
|
82
|
-
pt: string;
|
|
83
|
-
hi: string;
|
|
84
|
-
ar: string;
|
|
85
|
-
ru: string;
|
|
86
|
-
tr: string;
|
|
87
|
-
pl: string;
|
|
88
|
-
id: string;
|
|
89
|
-
vi: string;
|
|
90
|
-
uk: string;
|
|
91
|
-
};
|
|
92
46
|
}>;
|
|
93
47
|
urlPlaceholder: string;
|
|
94
|
-
errorMessage:
|
|
48
|
+
errorMessage: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
95
49
|
en: string;
|
|
96
50
|
'en-GB': string;
|
|
97
51
|
fr: string;
|
|
@@ -110,31 +64,8 @@ declare const browserContent: {
|
|
|
110
64
|
id: string;
|
|
111
65
|
vi: string;
|
|
112
66
|
uk: string;
|
|
113
|
-
}, {
|
|
114
|
-
nodeType: "translation";
|
|
115
|
-
} & {
|
|
116
|
-
translation: {
|
|
117
|
-
en: string;
|
|
118
|
-
'en-GB': string;
|
|
119
|
-
fr: string;
|
|
120
|
-
es: string;
|
|
121
|
-
de: string;
|
|
122
|
-
ja: string;
|
|
123
|
-
ko: string;
|
|
124
|
-
zh: string;
|
|
125
|
-
it: string;
|
|
126
|
-
pt: string;
|
|
127
|
-
hi: string;
|
|
128
|
-
ar: string;
|
|
129
|
-
ru: string;
|
|
130
|
-
tr: string;
|
|
131
|
-
pl: string;
|
|
132
|
-
id: string;
|
|
133
|
-
vi: string;
|
|
134
|
-
uk: string;
|
|
135
|
-
};
|
|
136
67
|
}>;
|
|
137
|
-
domainRestrictionError:
|
|
68
|
+
domainRestrictionError: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
138
69
|
en: string;
|
|
139
70
|
'en-GB': string;
|
|
140
71
|
fr: string;
|
|
@@ -153,31 +84,8 @@ declare const browserContent: {
|
|
|
153
84
|
id: string;
|
|
154
85
|
vi: string;
|
|
155
86
|
uk: string;
|
|
156
|
-
}, {
|
|
157
|
-
nodeType: "translation";
|
|
158
|
-
} & {
|
|
159
|
-
translation: {
|
|
160
|
-
en: string;
|
|
161
|
-
'en-GB': string;
|
|
162
|
-
fr: string;
|
|
163
|
-
es: string;
|
|
164
|
-
de: string;
|
|
165
|
-
ja: string;
|
|
166
|
-
ko: string;
|
|
167
|
-
zh: string;
|
|
168
|
-
it: string;
|
|
169
|
-
pt: string;
|
|
170
|
-
hi: string;
|
|
171
|
-
ar: string;
|
|
172
|
-
ru: string;
|
|
173
|
-
tr: string;
|
|
174
|
-
pl: string;
|
|
175
|
-
id: string;
|
|
176
|
-
vi: string;
|
|
177
|
-
uk: string;
|
|
178
|
-
};
|
|
179
87
|
}>;
|
|
180
|
-
backButtonLabel:
|
|
88
|
+
backButtonLabel: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
181
89
|
en: string;
|
|
182
90
|
'en-GB': string;
|
|
183
91
|
fr: string;
|
|
@@ -196,31 +104,8 @@ declare const browserContent: {
|
|
|
196
104
|
id: string;
|
|
197
105
|
vi: string;
|
|
198
106
|
uk: string;
|
|
199
|
-
}, {
|
|
200
|
-
nodeType: "translation";
|
|
201
|
-
} & {
|
|
202
|
-
translation: {
|
|
203
|
-
en: string;
|
|
204
|
-
'en-GB': string;
|
|
205
|
-
fr: string;
|
|
206
|
-
es: string;
|
|
207
|
-
de: string;
|
|
208
|
-
ja: string;
|
|
209
|
-
ko: string;
|
|
210
|
-
zh: string;
|
|
211
|
-
it: string;
|
|
212
|
-
pt: string;
|
|
213
|
-
hi: string;
|
|
214
|
-
ar: string;
|
|
215
|
-
ru: string;
|
|
216
|
-
tr: string;
|
|
217
|
-
pl: string;
|
|
218
|
-
id: string;
|
|
219
|
-
vi: string;
|
|
220
|
-
uk: string;
|
|
221
|
-
};
|
|
222
107
|
}>;
|
|
223
|
-
forwardButtonLabel:
|
|
108
|
+
forwardButtonLabel: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
224
109
|
en: string;
|
|
225
110
|
'en-GB': string;
|
|
226
111
|
fr: string;
|
|
@@ -239,31 +124,8 @@ declare const browserContent: {
|
|
|
239
124
|
id: string;
|
|
240
125
|
vi: string;
|
|
241
126
|
uk: string;
|
|
242
|
-
}, {
|
|
243
|
-
nodeType: "translation";
|
|
244
|
-
} & {
|
|
245
|
-
translation: {
|
|
246
|
-
en: string;
|
|
247
|
-
'en-GB': string;
|
|
248
|
-
fr: string;
|
|
249
|
-
es: string;
|
|
250
|
-
de: string;
|
|
251
|
-
ja: string;
|
|
252
|
-
ko: string;
|
|
253
|
-
zh: string;
|
|
254
|
-
it: string;
|
|
255
|
-
pt: string;
|
|
256
|
-
hi: string;
|
|
257
|
-
ar: string;
|
|
258
|
-
ru: string;
|
|
259
|
-
tr: string;
|
|
260
|
-
pl: string;
|
|
261
|
-
id: string;
|
|
262
|
-
vi: string;
|
|
263
|
-
uk: string;
|
|
264
|
-
};
|
|
265
127
|
}>;
|
|
266
|
-
reloadButtonTitle:
|
|
128
|
+
reloadButtonTitle: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
267
129
|
en: string;
|
|
268
130
|
'en-GB': string;
|
|
269
131
|
fr: string;
|
|
@@ -282,31 +144,8 @@ declare const browserContent: {
|
|
|
282
144
|
id: string;
|
|
283
145
|
vi: string;
|
|
284
146
|
uk: string;
|
|
285
|
-
}, {
|
|
286
|
-
nodeType: "translation";
|
|
287
|
-
} & {
|
|
288
|
-
translation: {
|
|
289
|
-
en: string;
|
|
290
|
-
'en-GB': string;
|
|
291
|
-
fr: string;
|
|
292
|
-
es: string;
|
|
293
|
-
de: string;
|
|
294
|
-
ja: string;
|
|
295
|
-
ko: string;
|
|
296
|
-
zh: string;
|
|
297
|
-
it: string;
|
|
298
|
-
pt: string;
|
|
299
|
-
hi: string;
|
|
300
|
-
ar: string;
|
|
301
|
-
ru: string;
|
|
302
|
-
tr: string;
|
|
303
|
-
pl: string;
|
|
304
|
-
id: string;
|
|
305
|
-
vi: string;
|
|
306
|
-
uk: string;
|
|
307
|
-
};
|
|
308
147
|
}>;
|
|
309
|
-
iframeTitle:
|
|
148
|
+
iframeTitle: _intlayer_core_transpiler0.TranslationContent<unknown, {
|
|
310
149
|
en: string;
|
|
311
150
|
'en-GB': string;
|
|
312
151
|
fr: string;
|
|
@@ -325,29 +164,6 @@ declare const browserContent: {
|
|
|
325
164
|
id: string;
|
|
326
165
|
vi: string;
|
|
327
166
|
uk: string;
|
|
328
|
-
}, {
|
|
329
|
-
nodeType: "translation";
|
|
330
|
-
} & {
|
|
331
|
-
translation: {
|
|
332
|
-
en: string;
|
|
333
|
-
'en-GB': string;
|
|
334
|
-
fr: string;
|
|
335
|
-
es: string;
|
|
336
|
-
de: string;
|
|
337
|
-
ja: string;
|
|
338
|
-
ko: string;
|
|
339
|
-
zh: string;
|
|
340
|
-
it: string;
|
|
341
|
-
pt: string;
|
|
342
|
-
hi: string;
|
|
343
|
-
ar: string;
|
|
344
|
-
ru: string;
|
|
345
|
-
tr: string;
|
|
346
|
-
pl: string;
|
|
347
|
-
id: string;
|
|
348
|
-
vi: string;
|
|
349
|
-
uk: string;
|
|
350
|
-
};
|
|
351
167
|
}>;
|
|
352
168
|
};
|
|
353
169
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.content.d.ts","names":[],"sources":["../../../../src/components/Browser/Browser.content.ts"],"mappings":";;;cAEa,cAAA;;;eAyKS,
|
|
1
|
+
{"version":3,"file":"Browser.content.d.ts","names":[],"sources":["../../../../src/components/Browser/Browser.content.ts"],"mappings":";;;cAEa,cAAA;;;eAyKS,0BAAA,CAAA,kBAAA"}
|
|
@@ -61,9 +61,9 @@ declare enum ButtonTextAlign {
|
|
|
61
61
|
*/
|
|
62
62
|
declare const buttonVariants: (props?: {
|
|
63
63
|
size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
|
|
64
|
-
color?: "text" | "primary" | "secondary" | "destructive" | "
|
|
64
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "success" | "error" | "neutral" | "light" | "dark" | "custom" | "card" | "current" | "text-inverse";
|
|
65
65
|
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "4xl" | "5xl" | "full";
|
|
66
|
-
variant?: "input" | "none" | "default" | "
|
|
66
|
+
variant?: "input" | "none" | "default" | "link" | "outline" | "hoverable" | "invisible-link" | "fade";
|
|
67
67
|
textAlign?: "left" | "center" | "right";
|
|
68
68
|
isFullWidth?: boolean;
|
|
69
69
|
} & class_variance_authority_types0.ClassProp) => string;
|