@lobehub/ui 5.34.2 → 5.35.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.
- package/es/ActionIconGroup/ActionIconGroup.mjs +1 -1
- package/es/ActionIconGroup/ActionIconGroup.mjs.map +1 -1
- package/es/ActionIconGroup/type.d.mts +2 -2
- package/es/Alert/Alert.mjs +1 -1
- package/es/Alert/Alert.mjs.map +1 -1
- package/es/Burger/Burger.mjs +1 -1
- package/es/Burger/Burger.mjs.map +1 -1
- package/es/Burger/type.d.mts +2 -2
- package/es/CodeDiff/DiffPanel.mjs +1 -1
- package/es/CodeDiff/DiffPanel.mjs.map +1 -1
- package/es/CopyButton/CopyButton.mjs +1 -1
- package/es/CopyButton/CopyButton.mjs.map +1 -1
- package/es/CopyButton/type.d.mts +2 -2
- package/es/DownloadButton/DownloadButton.mjs +1 -1
- package/es/DownloadButton/DownloadButton.mjs.map +1 -1
- package/es/DownloadButton/type.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.mjs +1 -1
- package/es/DraggablePanel/components/DraggablePanelHeader.mjs.map +1 -1
- package/es/Drawer/Drawer.mjs +1 -1
- package/es/Drawer/Drawer.mjs.map +1 -1
- package/es/Drawer/type.d.mts +2 -2
- package/es/EditableText/ControlInput.d.mts +2 -2
- package/es/EditableText/ControlInput.mjs +1 -1
- package/es/EditableText/ControlInput.mjs.map +1 -1
- package/es/EditableText/EditableText.mjs +1 -1
- package/es/EditableText/EditableText.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.mjs +1 -1
- package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
- package/es/GuideCard/GuideCard.mjs +1 -1
- package/es/GuideCard/GuideCard.mjs.map +1 -1
- package/es/GuideCard/type.d.mts +2 -2
- package/es/Highlighter/FullFeatured.mjs +1 -1
- package/es/Highlighter/FullFeatured.mjs.map +1 -1
- package/es/Highlighter/type.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.mjs +1 -1
- package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
- package/es/HtmlPreview/HtmlPreview.mjs +1 -1
- package/es/HtmlPreview/HtmlPreview.mjs.map +1 -1
- package/es/HtmlPreview/type.d.mts +2 -2
- package/es/Image/type.d.mts +1 -0
- package/es/Image/viewer/GalleryNav.mjs +1 -1
- package/es/Image/viewer/GalleryNav.mjs.map +1 -1
- package/es/Image/viewer/ImageViewer.mjs +75 -70
- package/es/Image/viewer/ImageViewer.mjs.map +1 -1
- package/es/Image/viewer/Toolbar.mjs +19 -7
- package/es/Image/viewer/Toolbar.mjs.map +1 -1
- package/es/Image/viewer/ViewerChrome.mjs +1 -1
- package/es/Image/viewer/ViewerChrome.mjs.map +1 -1
- package/es/Markdown/plugins/rehypeKatex.mjs +73 -0
- package/es/Markdown/plugins/rehypeKatex.mjs.map +1 -0
- package/es/Markdown/plugins/remarkCustomFootnotes.mjs +1 -2
- package/es/Markdown/plugins/remarkCustomFootnotes.mjs.map +1 -1
- package/es/Mermaid/FullFeatured.mjs +1 -1
- package/es/Mermaid/FullFeatured.mjs.map +1 -1
- package/es/Mermaid/type.d.mts +2 -2
- package/es/Modal/Modal.mjs +1 -1
- package/es/Modal/Modal.mjs.map +1 -1
- package/es/SortableList/components/DragHandle.d.mts +2 -2
- package/es/SortableList/components/DragHandle.mjs +1 -1
- package/es/SortableList/components/DragHandle.mjs.map +1 -1
- package/es/Tabs/Tabs.mjs +1 -1
- package/es/Tabs/Tabs.mjs.map +1 -1
- package/es/ThemeSwitch/ThemeSwitch.mjs +1 -1
- package/es/ThemeSwitch/ThemeSwitch.mjs.map +1 -1
- package/es/ThemeSwitch/type.d.mts +2 -2
- package/es/Toc/TocMobile.mjs +1 -1
- package/es/Toc/TocMobile.mjs.map +1 -1
- package/es/Video/index.mjs +1 -1
- package/es/Video/index.mjs.map +1 -1
- package/es/base-ui/Button/SplitButton.mjs +1 -1
- package/es/base-ui/Form/components/FormSubmitFooter.mjs +1 -1
- package/es/base-ui/Input/style.d.mts +1 -1
- package/es/base-ui/Modal/imperative.mjs +1 -1
- package/es/base-ui/Tag/Tag.mjs +1 -1
- package/es/base-ui/Tag/Tag.mjs.map +1 -1
- package/es/base-ui/Tag/style.mjs +8 -3
- package/es/base-ui/Tag/style.mjs.map +1 -1
- package/es/base-ui/Text/style.d.mts +1 -1
- package/es/base-ui/index.d.mts +4 -4
- package/es/base-ui/index.mjs +6 -6
- package/es/chat/ChatHeader/ChatHeader.mjs +1 -1
- package/es/chat/ChatHeader/ChatHeader.mjs.map +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.mjs +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.mjs.map +1 -1
- package/es/chat/TokenTag/TokenTag.mjs +1 -1
- package/es/chat/TokenTag/TokenTag.mjs.map +1 -1
- package/es/chat/TokenTag/type.d.mts +2 -2
- package/es/hooks/useMarkdown/useMarkdownRehypePlugins.mjs +1 -1
- package/es/hooks/useMarkdown/useMarkdownRehypePlugins.mjs.map +1 -1
- package/es/mdx/Mdx/index.mjs +1 -1
- package/es/mdx/Mdx/index.mjs.map +1 -1
- package/es/mobile/ChatHeader/ChatHeader.mjs +1 -1
- package/es/mobile/ChatHeader/ChatHeader.mjs.map +1 -1
- package/es/mobile/ChatInputArea/ChatInputArea.mjs +1 -1
- package/es/mobile/ChatInputArea/ChatInputArea.mjs.map +1 -1
- package/es/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs +2 -2
- package/package.json +4 -2
- package/es/node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.mjs +0 -117
- package/es/node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.mjs.map +0 -1
- package/es/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.node.mjs +0 -12
- package/es/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.node.mjs.map +0 -1
- package/es/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.mjs +0 -330
- package/es/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import ActionIcon from "../../ActionIcon/ActionIcon.mjs";
|
|
2
|
+
import ActionIcon from "../../base-ui/ActionIcon/ActionIcon.mjs";
|
|
3
3
|
import { useTranslation } from "../../i18n/useTranslation.mjs";
|
|
4
4
|
import { styles } from "../style.mjs";
|
|
5
5
|
import image_default from "../../i18n/resources/en/image.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewerChrome.mjs","names":["imageMessages"],"sources":["../../../src/Image/viewer/ViewerChrome.tsx"],"sourcesContent":["'use client';\n\nimport { X } from 'lucide-react';\nimport type { MotionValue } from 'motion/react';\nimport { memo, type MouseEvent, type ReactNode, useCallback } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport imageMessages from '@/i18n/resources/en/image';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { styles } from '../style';\nimport GalleryNav from './GalleryNav';\nimport type { Rect, Rotation, Size } from './geometry';\nimport Toolbar from './Toolbar';\nimport { useChromeIdle } from './useChromeIdle';\n\nexport interface ViewerChromeProps {\n canZoomIn: boolean;\n canZoomOut: boolean;\n chromeRef: (node: HTMLElement | null) => void;\n current: number;\n fitRect: Rect;\n flipHorizontal: () => void;\n flipVertical: () => void;\n hasNext: boolean;\n hasPrev: boolean;\n natural: Size;\n next: () => void;\n onClose: () => void;\n prev: () => void;\n rotateLeft: () => void;\n rotateRight: () => void;\n rotation: Rotation;\n scale: MotionValue<number>;\n source: string;\n toggleActualSize: () => void;\n toolbarAddon?: ReactNode;\n total: number;\n zoomIn: () => void;\n zoomOut: () => void;\n}\n\nconst ViewerChrome = memo<ViewerChromeProps>(\n ({ chromeRef, current, hasNext, hasPrev, next, onClose, prev, total, ...toolbarProps }) => {\n const { t } = useTranslation(imageMessages);\n const idle = useChromeIdle();\n\n const handleChromeClick = useCallback((event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n }, []);\n\n return (\n <div className={styles.viewerChrome} ref={chromeRef} onClick={handleChromeClick}>\n <div\n className={styles.viewerChromeIdle}\n data-idle-hidden={idle.hidden ? '' : undefined}\n ref={idle.ref}\n >\n <ActionIcon\n className={styles.viewerClose}\n icon={X}\n title={t('image.close')}\n onClick={onClose}\n />\n {total > 1 && (\n <GalleryNav\n current={current}\n hasNext={hasNext}\n hasPrev={hasPrev}\n next={next}\n prev={prev}\n total={total}\n />\n )}\n <Toolbar {...toolbarProps} onMoreOpenChange={idle.setHeld} />\n </div>\n </div>\n );\n },\n);\n\nViewerChrome.displayName = 'ViewerChrome';\n\nexport default ViewerChrome;\n"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ViewerChrome.mjs","names":["imageMessages"],"sources":["../../../src/Image/viewer/ViewerChrome.tsx"],"sourcesContent":["'use client';\n\nimport { X } from 'lucide-react';\nimport type { MotionValue } from 'motion/react';\nimport { memo, type MouseEvent, type ReactNode, useCallback } from 'react';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport imageMessages from '@/i18n/resources/en/image';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { styles } from '../style';\nimport GalleryNav from './GalleryNav';\nimport type { Rect, Rotation, Size } from './geometry';\nimport Toolbar from './Toolbar';\nimport { useChromeIdle } from './useChromeIdle';\n\nexport interface ViewerChromeProps {\n canZoomIn: boolean;\n canZoomOut: boolean;\n chromeRef: (node: HTMLElement | null) => void;\n current: number;\n fitRect: Rect;\n flipHorizontal: () => void;\n flipVertical: () => void;\n hasNext: boolean;\n hasPrev: boolean;\n natural: Size;\n next: () => void;\n onClose: () => void;\n onDownload?: (source: string) => void | Promise<void>;\n prev: () => void;\n rotateLeft: () => void;\n rotateRight: () => void;\n rotation: Rotation;\n scale: MotionValue<number>;\n source: string;\n toggleActualSize: () => void;\n toolbarAddon?: ReactNode;\n total: number;\n zoomIn: () => void;\n zoomOut: () => void;\n}\n\nconst ViewerChrome = memo<ViewerChromeProps>(\n ({ chromeRef, current, hasNext, hasPrev, next, onClose, prev, total, ...toolbarProps }) => {\n const { t } = useTranslation(imageMessages);\n const idle = useChromeIdle();\n\n const handleChromeClick = useCallback((event: MouseEvent<HTMLDivElement>) => {\n event.stopPropagation();\n }, []);\n\n return (\n <div className={styles.viewerChrome} ref={chromeRef} onClick={handleChromeClick}>\n <div\n className={styles.viewerChromeIdle}\n data-idle-hidden={idle.hidden ? '' : undefined}\n ref={idle.ref}\n >\n <ActionIcon\n className={styles.viewerClose}\n icon={X}\n title={t('image.close')}\n onClick={onClose}\n />\n {total > 1 && (\n <GalleryNav\n current={current}\n hasNext={hasNext}\n hasPrev={hasPrev}\n next={next}\n prev={prev}\n total={total}\n />\n )}\n <Toolbar {...toolbarProps} onMoreOpenChange={idle.setHeld} />\n </div>\n </div>\n );\n },\n);\n\nViewerChrome.displayName = 'ViewerChrome';\n\nexport default ViewerChrome;\n"],"mappings":";;;;;;;;;;;;AA2CA,MAAM,eAAe,MAClB,EAAE,WAAW,SAAS,SAAS,SAAS,MAAM,SAAS,MAAM,OAAO,GAAG,mBAAmB;CACzF,MAAM,EAAE,MAAM,eAAeA,aAAa;CAC1C,MAAM,OAAO,cAAc;CAE3B,MAAM,oBAAoB,aAAa,UAAsC;EAC3E,MAAM,gBAAgB;CACxB,GAAG,CAAC,CAAC;CAEL,OACE,oBAAC,OAAD;EAAK,WAAW,OAAO;EAAc,KAAK;EAAW,SAAS;EAC5D,UAAA,qBAAC,OAAD;GACE,WAAW,OAAO;GAClB,oBAAkB,KAAK,SAAS,KAAK,KAAA;GACrC,KAAK,KAAK;GAHZ,UAAA;IAKE,oBAAC,YAAD;KACE,WAAW,OAAO;KAClB,MAAM;KACN,OAAO,EAAE,aAAa;KACtB,SAAS;IACV,CAAA;IACA,QAAQ,KACP,oBAAC,YAAD;KACW;KACA;KACA;KACH;KACA;KACC;IACR,CAAA;IAEH,oBAAC,SAAD;KAAS,GAAI;KAAc,kBAAkB,KAAK;IAAU,CAAA;GACzD;;CACF,CAAA;AAET,CACF;AAEA,aAAa,cAAc"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SKIP, visitParents } from "unist-util-visit-parents";
|
|
2
|
+
import { fromHtmlIsomorphic } from "hast-util-from-html-isomorphic";
|
|
3
|
+
import { toText } from "hast-util-to-text";
|
|
4
|
+
import katex from "katex";
|
|
5
|
+
//#region src/Markdown/plugins/rehypeKatex.ts
|
|
6
|
+
const emptyClasses = [];
|
|
7
|
+
const rehypeKatex = (options) => (tree, file) => {
|
|
8
|
+
const settings = options || {};
|
|
9
|
+
visitParents(tree, "element", (element, parents) => {
|
|
10
|
+
const classes = Array.isArray(element.properties.className) ? element.properties.className : emptyClasses;
|
|
11
|
+
const languageMath = classes.includes("language-math");
|
|
12
|
+
const mathDisplay = classes.includes("math-display");
|
|
13
|
+
const mathInline = classes.includes("math-inline");
|
|
14
|
+
let displayMode = mathDisplay;
|
|
15
|
+
if (!languageMath && !mathDisplay && !mathInline) return;
|
|
16
|
+
let parent = parents.at(-1);
|
|
17
|
+
let scope = element;
|
|
18
|
+
if (element.tagName === "code" && languageMath && parent && parent.type === "element" && parent.tagName === "pre") {
|
|
19
|
+
scope = parent;
|
|
20
|
+
parent = parents.at(-2);
|
|
21
|
+
displayMode = true;
|
|
22
|
+
}
|
|
23
|
+
if (!parent) return;
|
|
24
|
+
const value = toText(scope, { whitespace: "pre" });
|
|
25
|
+
let result;
|
|
26
|
+
try {
|
|
27
|
+
result = katex.renderToString(value, {
|
|
28
|
+
...settings,
|
|
29
|
+
displayMode,
|
|
30
|
+
throwOnError: true
|
|
31
|
+
});
|
|
32
|
+
} catch (error) {
|
|
33
|
+
const cause = error;
|
|
34
|
+
file.message("Could not render math with KaTeX", {
|
|
35
|
+
ancestors: [...parents, element],
|
|
36
|
+
cause,
|
|
37
|
+
place: element.position,
|
|
38
|
+
ruleId: cause.name.toLowerCase(),
|
|
39
|
+
source: "rehype-katex"
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
result = katex.renderToString(value, {
|
|
43
|
+
...settings,
|
|
44
|
+
displayMode,
|
|
45
|
+
strict: "ignore",
|
|
46
|
+
throwOnError: false
|
|
47
|
+
});
|
|
48
|
+
} catch {
|
|
49
|
+
result = [{
|
|
50
|
+
children: [{
|
|
51
|
+
type: "text",
|
|
52
|
+
value
|
|
53
|
+
}],
|
|
54
|
+
properties: {
|
|
55
|
+
className: ["katex-error"],
|
|
56
|
+
style: "color:" + (settings.errorColor || "#cc0000"),
|
|
57
|
+
title: String(error)
|
|
58
|
+
},
|
|
59
|
+
tagName: "span",
|
|
60
|
+
type: "element"
|
|
61
|
+
}];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (typeof result === "string") result = fromHtmlIsomorphic(result, { fragment: true }).children;
|
|
65
|
+
const index = parent.children.indexOf(scope);
|
|
66
|
+
parent.children.splice(index, 1, ...result);
|
|
67
|
+
return SKIP;
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { rehypeKatex };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=rehypeKatex.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rehypeKatex.mjs","names":[],"sources":["../../../src/Markdown/plugins/rehypeKatex.ts"],"sourcesContent":["import type { ElementContent, Root } from 'hast';\nimport { fromHtmlIsomorphic } from 'hast-util-from-html-isomorphic';\nimport { toText } from 'hast-util-to-text';\nimport katex, { type KatexOptions } from 'katex';\nimport { SKIP, visitParents } from 'unist-util-visit-parents';\nimport type { VFile } from 'vfile';\n\n// 内联自 rehype-katex@7,因为它硬依赖 katex ^0.16,下游安装时会得到一份嵌套的\n// 0.16 渲染出 v0.18 之前的 class 名,与我们注入的 v0.18 样式表对不上。\n// 升级 rehype-katex 到支持 katex ^0.18 的版本后可以删掉本文件。\n\nexport type RehypeKatexOptions = Omit<KatexOptions, 'displayMode' | 'throwOnError'>;\n\nconst emptyClasses: unknown[] = [];\n\nexport const rehypeKatex =\n (options?: RehypeKatexOptions) =>\n (tree: Root, file: VFile): undefined => {\n const settings = options || {};\n\n visitParents(tree, 'element', (element, parents) => {\n const classes = Array.isArray(element.properties.className)\n ? element.properties.className\n : emptyClasses;\n const languageMath = classes.includes('language-math');\n const mathDisplay = classes.includes('math-display');\n const mathInline = classes.includes('math-inline');\n let displayMode = mathDisplay;\n\n if (!languageMath && !mathDisplay && !mathInline) return;\n\n let parent: any = parents.at(-1);\n let scope: any = element;\n\n if (\n element.tagName === 'code' &&\n languageMath &&\n parent &&\n parent.type === 'element' &&\n parent.tagName === 'pre'\n ) {\n scope = parent;\n parent = parents.at(-2);\n displayMode = true;\n }\n\n if (!parent) return;\n\n const value = toText(scope, { whitespace: 'pre' });\n\n let result: ElementContent[] | string | undefined;\n\n try {\n result = katex.renderToString(value, { ...settings, displayMode, throwOnError: true });\n } catch (error) {\n const cause = error as Error;\n\n file.message('Could not render math with KaTeX', {\n ancestors: [...parents, element],\n cause,\n place: element.position,\n ruleId: cause.name.toLowerCase(),\n source: 'rehype-katex',\n });\n\n try {\n result = katex.renderToString(value, {\n ...settings,\n displayMode,\n strict: 'ignore',\n throwOnError: false,\n });\n } catch {\n result = [\n {\n children: [{ type: 'text', value }],\n properties: {\n className: ['katex-error'],\n style: 'color:' + (settings.errorColor || '#cc0000'),\n title: String(error),\n },\n tagName: 'span',\n type: 'element',\n },\n ];\n }\n }\n\n if (typeof result === 'string') {\n result = fromHtmlIsomorphic(result, { fragment: true }).children as ElementContent[];\n }\n\n const index = parent.children.indexOf(scope);\n parent.children.splice(index, 1, ...result);\n return SKIP;\n });\n };\n"],"mappings":";;;;;AAaA,MAAM,eAA0B,CAAC;AAEjC,MAAa,eACV,aACA,MAAY,SAA2B;CACtC,MAAM,WAAW,WAAW,CAAC;CAE7B,aAAa,MAAM,YAAY,SAAS,YAAY;EAClD,MAAM,UAAU,MAAM,QAAQ,QAAQ,WAAW,SAAS,IACtD,QAAQ,WAAW,YACnB;EACJ,MAAM,eAAe,QAAQ,SAAS,eAAe;EACrD,MAAM,cAAc,QAAQ,SAAS,cAAc;EACnD,MAAM,aAAa,QAAQ,SAAS,aAAa;EACjD,IAAI,cAAc;EAElB,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,YAAY;EAElD,IAAI,SAAc,QAAQ,GAAG,EAAE;EAC/B,IAAI,QAAa;EAEjB,IACE,QAAQ,YAAY,UACpB,gBACA,UACA,OAAO,SAAS,aAChB,OAAO,YAAY,OACnB;GACA,QAAQ;GACR,SAAS,QAAQ,GAAG,EAAE;GACtB,cAAc;EAChB;EAEA,IAAI,CAAC,QAAQ;EAEb,MAAM,QAAQ,OAAO,OAAO,EAAE,YAAY,MAAM,CAAC;EAEjD,IAAI;EAEJ,IAAI;GACF,SAAS,MAAM,eAAe,OAAO;IAAE,GAAG;IAAU;IAAa,cAAc;GAAK,CAAC;EACvF,SAAS,OAAO;GACd,MAAM,QAAQ;GAEd,KAAK,QAAQ,oCAAoC;IAC/C,WAAW,CAAC,GAAG,SAAS,OAAO;IAC/B;IACA,OAAO,QAAQ;IACf,QAAQ,MAAM,KAAK,YAAY;IAC/B,QAAQ;GACV,CAAC;GAED,IAAI;IACF,SAAS,MAAM,eAAe,OAAO;KACnC,GAAG;KACH;KACA,QAAQ;KACR,cAAc;IAChB,CAAC;GACH,QAAQ;IACN,SAAS,CACP;KACE,UAAU,CAAC;MAAE,MAAM;MAAQ;KAAM,CAAC;KAClC,YAAY;MACV,WAAW,CAAC,aAAa;MACzB,OAAO,YAAY,SAAS,cAAc;MAC1C,OAAO,OAAO,KAAK;KACrB;KACA,SAAS;KACT,MAAM;IACR,CACF;GACF;EACF;EAEA,IAAI,OAAO,WAAW,UACpB,SAAS,mBAAmB,QAAQ,EAAE,UAAU,KAAK,CAAC,CAAC,CAAC;EAG1D,MAAM,QAAQ,OAAO,SAAS,QAAQ,KAAK;EAC3C,OAAO,SAAS,OAAO,OAAO,GAAG,GAAG,MAAM;EAC1C,OAAO;CACT,CAAC;AACH"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SKIP } from "../../node_modules/.pnpm/unist-util-visit
|
|
2
|
-
import { visit } from "../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
1
|
+
import { SKIP, visit } from "../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs";
|
|
3
2
|
//#region src/Markdown/plugins/remarkCustomFootnotes.ts
|
|
4
3
|
const remarkCustomFootnotes = () => (tree, file) => {
|
|
5
4
|
const footnoteLinks = /* @__PURE__ */ new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remarkCustomFootnotes.mjs","names":[],"sources":["../../../src/Markdown/plugins/remarkCustomFootnotes.ts"],"sourcesContent":["import type { Node } from 'unist';\nimport { SKIP, visit } from 'unist-util-visit';\n\nexport interface FootnoteLink {\n alt?: string;\n title?: string;\n url: string;\n}\n\nexport const remarkCustomFootnotes = () => (tree: any, file: any) => {\n const footnoteLinks = new Map();\n\n visit(tree, 'footnoteDefinition', (node) => {\n let linkData: FootnoteLink | null = null;\n\n // 查找第一个link类型的子节点\n visit(node, 'link', (linkNode) => {\n if (linkData) return SKIP; // 只取第一个链接\n\n // 提取链接文本\n const textNode = linkNode.children.find((n: Node) => n.type === 'text');\n\n linkData = {\n alt: textNode?.value || '',\n title: textNode?.value || '',\n url: linkNode.url, // 或者根据需求处理\n };\n\n return SKIP; // 找到后停止遍历\n });\n\n if (linkData) {\n footnoteLinks.set(node.identifier, linkData);\n }\n });\n\n // 将数据存入文件上下文\n file.data.footnoteLinks = Object.fromEntries(footnoteLinks);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"remarkCustomFootnotes.mjs","names":[],"sources":["../../../src/Markdown/plugins/remarkCustomFootnotes.ts"],"sourcesContent":["import type { Node } from 'unist';\nimport { SKIP, visit } from 'unist-util-visit';\n\nexport interface FootnoteLink {\n alt?: string;\n title?: string;\n url: string;\n}\n\nexport const remarkCustomFootnotes = () => (tree: any, file: any) => {\n const footnoteLinks = new Map();\n\n visit(tree, 'footnoteDefinition', (node) => {\n let linkData: FootnoteLink | null = null;\n\n // 查找第一个link类型的子节点\n visit(node, 'link', (linkNode) => {\n if (linkData) return SKIP; // 只取第一个链接\n\n // 提取链接文本\n const textNode = linkNode.children.find((n: Node) => n.type === 'text');\n\n linkData = {\n alt: textNode?.value || '',\n title: textNode?.value || '',\n url: linkNode.url, // 或者根据需求处理\n };\n\n return SKIP; // 找到后停止遍历\n });\n\n if (linkData) {\n footnoteLinks.set(node.identifier, linkData);\n }\n });\n\n // 将数据存入文件上下文\n file.data.footnoteLinks = Object.fromEntries(footnoteLinks);\n};\n"],"mappings":";;AASA,MAAa,+BAA+B,MAAW,SAAc;CACnE,MAAM,gCAAgB,IAAI,IAAI;CAE9B,MAAM,MAAM,uBAAuB,SAAS;EAC1C,IAAI,WAAgC;EAGpC,MAAM,MAAM,SAAS,aAAa;GAChC,IAAI,UAAU,OAAO;GAGrB,MAAM,WAAW,SAAS,SAAS,MAAM,MAAY,EAAE,SAAS,MAAM;GAEtE,WAAW;IACT,KAAK,UAAU,SAAS;IACxB,OAAO,UAAU,SAAS;IAC1B,KAAK,SAAS;GAChB;GAEA,OAAO;EACT,CAAC;EAED,IAAI,UACF,cAAc,IAAI,KAAK,YAAY,QAAQ;CAE/C,CAAC;CAGD,KAAK,KAAK,gBAAgB,OAAO,YAAY,aAAa;AAC5D"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import FlexBasic_default from "../Flex/FlexBasic.mjs";
|
|
3
3
|
import Text from "../Text/Text.mjs";
|
|
4
4
|
import { stopPropagation } from "../utils/dom.mjs";
|
|
5
|
-
import ActionIcon from "../ActionIcon/ActionIcon.mjs";
|
|
5
|
+
import ActionIcon from "../base-ui/ActionIcon/ActionIcon.mjs";
|
|
6
6
|
import MaterialFileTypeIcon from "../MaterialFileTypeIcon/MaterialFileTypeIcon.mjs";
|
|
7
7
|
import CopyButton from "../CopyButton/CopyButton.mjs";
|
|
8
8
|
import { bodyVariants, headerVariants, variants } from "../Highlighter/style.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullFeatured.mjs","names":["Flexbox"],"sources":["../../src/Mermaid/FullFeatured.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { ChevronDown, ChevronRight } from 'lucide-react';\nimport { memo, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport CopyButton from '@/CopyButton';\nimport { Flexbox } from '@/Flex';\nimport { bodyVariants, headerVariants, variants } from '@/Highlighter/style';\nimport MaterialFileTypeIcon from '@/MaterialFileTypeIcon';\nimport Text from '@/Text';\nimport { stopPropagation } from '@/utils/dom';\n\nimport { type MermaidProps } from './type';\n\nconst MermaidHeaderLanguage = memo(\n ({\n fileName,\n language,\n showLanguage,\n }: {\n fileName?: string;\n language: string;\n showLanguage?: boolean;\n }) => {\n if (!showLanguage) return null;\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={'languageTitle'}\n flex={1}\n gap={4}\n justify={'flex-start'}\n paddingInline={8}\n >\n <MaterialFileTypeIcon\n fallbackUnknownType={false}\n filename={fileName || language}\n size={18}\n type={'file'}\n variant={'raw'}\n />\n\n <Text ellipsis fontSize={13}>\n {fileName || 'Mermaid'}\n </Text>\n </Flexbox>\n );\n },\n (prev, next) =>\n prev.fileName === next.fileName &&\n prev.language === next.language &&\n prev.showLanguage === next.showLanguage,\n);\n\nexport interface MermaidFullFeaturedProps extends Omit<MermaidProps, 'children'> {\n children: ReactNode;\n content: string;\n}\n\nexport const MermaidFullFeatured = memo<MermaidFullFeaturedProps>(\n ({\n showLanguage,\n styles: customStyles,\n classNames,\n content,\n children,\n className,\n copyable,\n actionsRender,\n style,\n variant,\n shadow,\n language = 'mermaid',\n fileName,\n defaultExpand = true,\n ...rest\n }) => {\n const [expand, setExpand] = useState(defaultExpand);\n const contentRef = useRef(content);\n\n useEffect(() => {\n contentRef.current = content;\n }, [content]);\n\n const getContent = useCallback(() => contentRef.current, []);\n\n const originalActions = useMemo(() => {\n if (!copyable) return null;\n return <CopyButton content={getContent} size={'small'} />;\n }, [copyable, getContent]);\n\n const actions = useMemo(() => {\n if (!actionsRender) return originalActions;\n return actionsRender({\n actionIconSize: 'small',\n content,\n getContent,\n originalNode: originalActions,\n });\n }, [actionsRender, content, getContent, originalActions]);\n\n const handleToggleExpand = useCallback(() => {\n setExpand((prev) => !prev);\n }, []);\n\n return (\n <Flexbox\n className={cx(variants({ shadow, variant }), className)}\n data-code-type=\"mermaid\"\n style={style}\n {...rest}\n >\n <Flexbox\n horizontal\n align={'center'}\n className={cx(headerVariants({ variant }), classNames?.header)}\n justify={'space-between'}\n style={customStyles?.header}\n onClick={handleToggleExpand}\n >\n <MermaidHeaderLanguage\n fileName={fileName}\n language={language}\n showLanguage={showLanguage}\n />\n <Flexbox horizontal align={'center'} flex={'none'} gap={4} onClick={stopPropagation}>\n <Flexbox horizontal align={'center'} className={'panel-actions'} flex={'none'} gap={4}>\n {actions}\n </Flexbox>\n <ActionIcon\n icon={expand ? ChevronDown : ChevronRight}\n size={'small'}\n onClick={handleToggleExpand}\n />\n </Flexbox>\n </Flexbox>\n <Flexbox\n className={cx(bodyVariants({ expand }), classNames?.body)}\n style={customStyles?.body}\n >\n {children}\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nexport default MermaidFullFeatured;\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,wBAAwB,MAC3B,EACC,UACA,UACA,mBAKI;CACJ,IAAI,CAAC,cAAc,OAAO;CAE1B,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACP,WAAW;EACX,MAAM;EACN,KAAK;EACL,SAAS;EACT,eAAe;EAPjB,UAAA,CASE,oBAAC,sBAAD;GACE,qBAAqB;GACrB,UAAU,YAAY;GACtB,MAAM;GACN,MAAM;GACN,SAAS;EACV,CAAA,GAED,oBAAC,MAAD;GAAM,UAAA;GAAS,UAAU;GACtB,UAAA,YAAY;EACT,CAAA,CACC;;AAEb,IACC,MAAM,SACL,KAAK,aAAa,KAAK,YACvB,KAAK,aAAa,KAAK,YACvB,KAAK,iBAAiB,KAAK,YAC/B;AAOA,MAAa,sBAAsB,MAChC,EACC,cACA,QAAQ,cACR,YACA,SACA,UACA,WACA,UACA,eACA,OACA,SACA,QACA,WAAW,WACX,UACA,gBAAgB,MAChB,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,SAAS,aAAa;CAClD,MAAM,aAAa,OAAO,OAAO;CAEjC,gBAAgB;EACd,WAAW,UAAU;CACvB,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,aAAa,kBAAkB,WAAW,SAAS,CAAC,CAAC;CAE3D,MAAM,kBAAkB,cAAc;EACpC,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,oBAAC,YAAD;GAAY,SAAS;GAAY,MAAM;EAAU,CAAA;CAC1D,GAAG,CAAC,UAAU,UAAU,CAAC;CAEzB,MAAM,UAAU,cAAc;EAC5B,IAAI,CAAC,eAAe,OAAO;EAC3B,OAAO,cAAc;GACnB,gBAAgB;GAChB;GACA;GACA,cAAc;EAChB,CAAC;CACH,GAAG;EAAC;EAAe;EAAS;EAAY;CAAe,CAAC;CAExD,MAAM,qBAAqB,kBAAkB;EAC3C,WAAW,SAAS,CAAC,IAAI;CAC3B,GAAG,CAAC,CAAC;CAEL,OACE,qBAACA,mBAAD;EACE,WAAW,GAAG,SAAS;GAAE;GAAQ;EAAQ,CAAC,GAAG,SAAS;EACtD,kBAAe;EACR;EACP,GAAI;EAJN,UAAA,CAME,qBAACA,mBAAD;GACE,YAAA;GACA,OAAO;GACP,WAAW,GAAG,eAAe,EAAE,QAAQ,CAAC,GAAG,YAAY,MAAM;GAC7D,SAAS;GACT,OAAO,cAAc;GACrB,SAAS;GANX,UAAA,CAQE,oBAAC,uBAAD;IACY;IACA;IACI;GACf,CAAA,GACD,qBAACA,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG,SAAS;IAApE,UAAA,CACE,oBAACA,mBAAD;KAAS,YAAA;KAAW,OAAO;KAAU,WAAW;KAAiB,MAAM;KAAQ,KAAK;KACjF,UAAA;IACM,CAAA,GACT,oBAAC,YAAD;KACE,MAAM,SAAS,cAAc;KAC7B,MAAM;KACN,SAAS;IACV,CAAA,CACM;GACF,CAAA,CAAA;EACT,CAAA,GAAA,oBAACA,mBAAD;GACE,WAAW,GAAG,aAAa,EAAE,OAAO,CAAC,GAAG,YAAY,IAAI;GACxD,OAAO,cAAc;GAEpB;EACM,CAAA,CACF;;AAEb,CACF"}
|
|
1
|
+
{"version":3,"file":"FullFeatured.mjs","names":["Flexbox"],"sources":["../../src/Mermaid/FullFeatured.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { ChevronDown, ChevronRight } from 'lucide-react';\nimport { memo, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport CopyButton from '@/CopyButton';\nimport { Flexbox } from '@/Flex';\nimport { bodyVariants, headerVariants, variants } from '@/Highlighter/style';\nimport MaterialFileTypeIcon from '@/MaterialFileTypeIcon';\nimport Text from '@/Text';\nimport { stopPropagation } from '@/utils/dom';\n\nimport { type MermaidProps } from './type';\n\nconst MermaidHeaderLanguage = memo(\n ({\n fileName,\n language,\n showLanguage,\n }: {\n fileName?: string;\n language: string;\n showLanguage?: boolean;\n }) => {\n if (!showLanguage) return null;\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={'languageTitle'}\n flex={1}\n gap={4}\n justify={'flex-start'}\n paddingInline={8}\n >\n <MaterialFileTypeIcon\n fallbackUnknownType={false}\n filename={fileName || language}\n size={18}\n type={'file'}\n variant={'raw'}\n />\n\n <Text ellipsis fontSize={13}>\n {fileName || 'Mermaid'}\n </Text>\n </Flexbox>\n );\n },\n (prev, next) =>\n prev.fileName === next.fileName &&\n prev.language === next.language &&\n prev.showLanguage === next.showLanguage,\n);\n\nexport interface MermaidFullFeaturedProps extends Omit<MermaidProps, 'children'> {\n children: ReactNode;\n content: string;\n}\n\nexport const MermaidFullFeatured = memo<MermaidFullFeaturedProps>(\n ({\n showLanguage,\n styles: customStyles,\n classNames,\n content,\n children,\n className,\n copyable,\n actionsRender,\n style,\n variant,\n shadow,\n language = 'mermaid',\n fileName,\n defaultExpand = true,\n ...rest\n }) => {\n const [expand, setExpand] = useState(defaultExpand);\n const contentRef = useRef(content);\n\n useEffect(() => {\n contentRef.current = content;\n }, [content]);\n\n const getContent = useCallback(() => contentRef.current, []);\n\n const originalActions = useMemo(() => {\n if (!copyable) return null;\n return <CopyButton content={getContent} size={'small'} />;\n }, [copyable, getContent]);\n\n const actions = useMemo(() => {\n if (!actionsRender) return originalActions;\n return actionsRender({\n actionIconSize: 'small',\n content,\n getContent,\n originalNode: originalActions,\n });\n }, [actionsRender, content, getContent, originalActions]);\n\n const handleToggleExpand = useCallback(() => {\n setExpand((prev) => !prev);\n }, []);\n\n return (\n <Flexbox\n className={cx(variants({ shadow, variant }), className)}\n data-code-type=\"mermaid\"\n style={style}\n {...rest}\n >\n <Flexbox\n horizontal\n align={'center'}\n className={cx(headerVariants({ variant }), classNames?.header)}\n justify={'space-between'}\n style={customStyles?.header}\n onClick={handleToggleExpand}\n >\n <MermaidHeaderLanguage\n fileName={fileName}\n language={language}\n showLanguage={showLanguage}\n />\n <Flexbox horizontal align={'center'} flex={'none'} gap={4} onClick={stopPropagation}>\n <Flexbox horizontal align={'center'} className={'panel-actions'} flex={'none'} gap={4}>\n {actions}\n </Flexbox>\n <ActionIcon\n icon={expand ? ChevronDown : ChevronRight}\n size={'small'}\n onClick={handleToggleExpand}\n />\n </Flexbox>\n </Flexbox>\n <Flexbox\n className={cx(bodyVariants({ expand }), classNames?.body)}\n style={customStyles?.body}\n >\n {children}\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nexport default MermaidFullFeatured;\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,wBAAwB,MAC3B,EACC,UACA,UACA,mBAKI;CACJ,IAAI,CAAC,cAAc,OAAO;CAE1B,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACP,WAAW;EACX,MAAM;EACN,KAAK;EACL,SAAS;EACT,eAAe;EAPjB,UAAA,CASE,oBAAC,sBAAD;GACE,qBAAqB;GACrB,UAAU,YAAY;GACtB,MAAM;GACN,MAAM;GACN,SAAS;EACV,CAAA,GAED,oBAAC,MAAD;GAAM,UAAA;GAAS,UAAU;GACtB,UAAA,YAAY;EACT,CAAA,CACC;;AAEb,IACC,MAAM,SACL,KAAK,aAAa,KAAK,YACvB,KAAK,aAAa,KAAK,YACvB,KAAK,iBAAiB,KAAK,YAC/B;AAOA,MAAa,sBAAsB,MAChC,EACC,cACA,QAAQ,cACR,YACA,SACA,UACA,WACA,UACA,eACA,OACA,SACA,QACA,WAAW,WACX,UACA,gBAAgB,MAChB,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,SAAS,aAAa;CAClD,MAAM,aAAa,OAAO,OAAO;CAEjC,gBAAgB;EACd,WAAW,UAAU;CACvB,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,aAAa,kBAAkB,WAAW,SAAS,CAAC,CAAC;CAE3D,MAAM,kBAAkB,cAAc;EACpC,IAAI,CAAC,UAAU,OAAO;EACtB,OAAO,oBAAC,YAAD;GAAY,SAAS;GAAY,MAAM;EAAU,CAAA;CAC1D,GAAG,CAAC,UAAU,UAAU,CAAC;CAEzB,MAAM,UAAU,cAAc;EAC5B,IAAI,CAAC,eAAe,OAAO;EAC3B,OAAO,cAAc;GACnB,gBAAgB;GAChB;GACA;GACA,cAAc;EAChB,CAAC;CACH,GAAG;EAAC;EAAe;EAAS;EAAY;CAAe,CAAC;CAExD,MAAM,qBAAqB,kBAAkB;EAC3C,WAAW,SAAS,CAAC,IAAI;CAC3B,GAAG,CAAC,CAAC;CAEL,OACE,qBAACA,mBAAD;EACE,WAAW,GAAG,SAAS;GAAE;GAAQ;EAAQ,CAAC,GAAG,SAAS;EACtD,kBAAe;EACR;EACP,GAAI;EAJN,UAAA,CAME,qBAACA,mBAAD;GACE,YAAA;GACA,OAAO;GACP,WAAW,GAAG,eAAe,EAAE,QAAQ,CAAC,GAAG,YAAY,MAAM;GAC7D,SAAS;GACT,OAAO,cAAc;GACrB,SAAS;GANX,UAAA,CAQE,oBAAC,uBAAD;IACY;IACA;IACI;GACf,CAAA,GACD,qBAACA,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAU,MAAM;IAAQ,KAAK;IAAG,SAAS;IAApE,UAAA,CACE,oBAACA,mBAAD;KAAS,YAAA;KAAW,OAAO;KAAU,WAAW;KAAiB,MAAM;KAAQ,KAAK;KACjF,UAAA;IACM,CAAA,GACT,oBAAC,YAAD;KACE,MAAM,SAAS,cAAc;KAC7B,MAAM;KACN,SAAS;IACV,CAAA,CACM;GACF,CAAA,CAAA;EACT,CAAA,GAAA,oBAACA,mBAAD;GACE,WAAW,GAAG,aAAa,EAAE,OAAO,CAAC,GAAG,YAAY,IAAI;GACxD,OAAO,cAAc;GAEpB;EACM,CAAA,CACF;;AAEb,CACF"}
|
package/es/Mermaid/type.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DivProps } from "../types/index.mjs";
|
|
2
|
-
import { ActionIconProps } from "../ActionIcon/type.mjs";
|
|
3
|
-
import "../ActionIcon/index.mjs";
|
|
2
|
+
import { ActionIconProps } from "../base-ui/ActionIcon/type.mjs";
|
|
3
|
+
import "../base-ui/ActionIcon/index.mjs";
|
|
4
4
|
import { CSSProperties, ReactNode, Ref } from "react";
|
|
5
5
|
import { ThemeName } from "beautiful-mermaid";
|
|
6
6
|
//#region src/Mermaid/type.d.ts
|
package/es/Modal/Modal.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import Icon from "../Icon/Icon.mjs";
|
|
3
|
-
import ActionIcon from "../ActionIcon/ActionIcon.mjs";
|
|
3
|
+
import ActionIcon from "../base-ui/ActionIcon/ActionIcon.mjs";
|
|
4
4
|
import { styles } from "./style.mjs";
|
|
5
5
|
import { memo, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
package/es/Modal/Modal.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","names":["Modal","AntModal"],"sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { Button, ConfigProvider, Drawer, type DrawerProps, Modal as AntModal } from 'antd';\nimport { cssVar, cx, useResponsive } from 'antd-style';\nimport { Maximize2, Minimize2, X } from 'lucide-react';\nimport { memo, type ReactNode, useState } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport Icon from '@/Icon';\n\nimport { styles } from './style';\nimport { type ModalProps } from './type';\n\n/**\n * @deprecated Use `Modal` from `@lobehub/ui/base-ui` instead.\n */\nconst Modal = memo<ModalProps>(\n ({\n panelRef,\n allowFullscreen,\n children,\n title = ' ',\n className,\n classNames,\n width = 700,\n onCancel,\n open,\n destroyOnHidden,\n paddings,\n height = '75dvh',\n enableResponsive = true,\n footer,\n styles: customStyles,\n okText,\n onOk,\n cancelText,\n okButtonProps,\n cancelButtonProps,\n confirmLoading,\n ...rest\n }) => {\n const [fullscreen, setFullscreen] = useState(false);\n const { mobile } = useResponsive();\n const hideFooter = footer === false || footer === null;\n if (enableResponsive && mobile)\n return (\n <ConfigProvider\n theme={{\n token: {\n colorBgElevated: cssVar.colorBgContainer,\n },\n }}\n >\n <Drawer\n className={cx(styles.drawerContent, className)}\n closeIcon={<ActionIcon icon={X} />}\n destroyOnHidden={destroyOnHidden}\n height={fullscreen ? 'calc(100% - env(safe-area-inset-top))' : height}\n open={open}\n panelRef={panelRef}\n placement={'bottom'}\n title={title}\n classNames={\n (typeof classNames === 'function'\n ? classNames\n : {\n ...classNames,\n wrapper: cx(styles.wrap, classNames?.wrapper),\n }) as DrawerProps['classNames']\n }\n extra={\n allowFullscreen && (\n <ActionIcon\n icon={fullscreen ? Minimize2 : Maximize2}\n onClick={() => setFullscreen(!fullscreen)}\n />\n )\n }\n footer={\n hideFooter\n ? null\n : (footer as ReactNode) || (\n <>\n <Button\n color={'default'}\n variant={'filled'}\n onClick={onCancel as any}\n {...cancelButtonProps}\n >\n {cancelText || 'Cancel'}\n </Button>\n <Button\n loading={confirmLoading}\n type=\"primary\"\n onClick={onOk as any}\n {...okButtonProps}\n style={{\n marginInlineStart: 8,\n ...okButtonProps?.style,\n }}\n >\n {okText || 'OK'}\n </Button>\n </>\n )\n }\n styles={\n (typeof customStyles === 'function'\n ? customStyles\n : {\n ...customStyles,\n body: {\n paddingBlock: `16px ${footer ? 0 : '16px'}`,\n paddingInline: paddings?.desktop ?? 16,\n ...customStyles?.body,\n },\n }) as DrawerProps['styles']\n }\n onClose={onCancel as any}\n {...rest}\n >\n {children}\n </Drawer>\n </ConfigProvider>\n );\n\n return (\n <ConfigProvider\n theme={{\n token: {\n colorBgElevated: cssVar.colorBgContainer,\n },\n }}\n >\n <AntModal\n closable\n cancelText={cancelText}\n className={cx(styles.content, className)}\n closeIcon={<Icon icon={X} size={20} />}\n confirmLoading={confirmLoading}\n destroyOnHidden={destroyOnHidden}\n footer={hideFooter ? null : footer}\n mask={{ closable: true }}\n okButtonProps={okButtonProps}\n okText={okText}\n open={open}\n panelRef={panelRef}\n title={title}\n width={width}\n cancelButtonProps={{\n color: 'default',\n variant: 'filled',\n ...cancelButtonProps,\n }}\n classNames={\n typeof classNames === 'function'\n ? classNames\n : {\n ...classNames,\n wrapper: cx(styles.wrap, classNames?.wrapper),\n }\n }\n styles={\n typeof customStyles === 'function'\n ? customStyles\n : {\n ...customStyles,\n body: {\n maxHeight: height,\n overflow: 'hidden auto',\n paddingBlock: `0 ${footer === null ? '16px' : 0}`,\n paddingInline: paddings?.desktop ?? 16,\n ...customStyles?.body,\n },\n }\n }\n onCancel={onCancel}\n onOk={onOk}\n {...rest}\n >\n {children}\n </AntModal>\n </ConfigProvider>\n );\n },\n);\n\nModal.displayName = 'Modal';\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,UAAQ,MACX,EACC,UACA,iBACA,UACA,QAAQ,KACR,WACA,YACA,QAAQ,KACR,UACA,MACA,iBACA,UACA,SAAS,SACT,mBAAmB,MACnB,QACA,QAAQ,cACR,QACA,MACA,YACA,eACA,mBACA,gBACA,GAAG,WACC;CACJ,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,MAAM,EAAE,WAAW,cAAc;CACjC,MAAM,aAAa,WAAW,SAAS,WAAW;CAClD,IAAI,oBAAoB,QACtB,OACE,oBAAC,gBAAD;EACE,OAAO,EACL,OAAO,EACL,iBAAiB,OAAO,iBAC1B,EACF;EAEA,UAAA,oBAAC,QAAD;GACE,WAAW,GAAG,OAAO,eAAe,SAAS;GAC7C,WAAW,oBAAC,YAAD,EAAY,MAAM,EAAI,CAAA;GAChB;GACjB,QAAQ,aAAa,0CAA0C;GACzD;GACI;GACV,WAAW;GACJ;GACP,YACG,OAAO,eAAe,aACnB,aACA;IACE,GAAG;IACH,SAAS,GAAG,OAAO,MAAM,YAAY,OAAO;GAC9C;GAEN,OACE,mBACE,oBAAC,YAAD;IACE,MAAM,aAAa,YAAY;IAC/B,eAAe,cAAc,CAAC,UAAU;GACzC,CAAA;GAGL,QACE,aACI,OACC,UACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IACE,OAAO;IACP,SAAS;IACT,SAAS;IACT,GAAI;IAEH,UAAA,cAAc;GACT,CAAA,GACR,oBAAC,QAAD;IACE,SAAS;IACT,MAAK;IACL,SAAS;IACT,GAAI;IACJ,OAAO;KACL,mBAAmB;KACnB,GAAG,eAAe;IACpB;IAEC,UAAA,UAAU;GACL,CAAA,CACR,EAAA,CAAA;GAGV,QACG,OAAO,iBAAiB,aACrB,eACA;IACE,GAAG;IACH,MAAM;KACJ,cAAc,QAAQ,SAAS,IAAI;KACnC,eAAe,UAAU,WAAW;KACpC,GAAG,cAAc;IACnB;GACF;GAEN,SAAS;GACT,GAAI;GAEH;EACK,CAAA;CACM,CAAA;CAGpB,OACE,oBAAC,gBAAD;EACE,OAAO,EACL,OAAO,EACL,iBAAiB,OAAO,iBAC1B,EACF;EAEA,UAAA,oBAACC,OAAD;GACE,UAAA;GACY;GACZ,WAAW,GAAG,OAAO,SAAS,SAAS;GACvC,WAAW,oBAAC,MAAD;IAAM,MAAM;IAAG,MAAM;GAAK,CAAA;GACrB;GACC;GACjB,QAAQ,aAAa,OAAO;GAC5B,MAAM,EAAE,UAAU,KAAK;GACR;GACP;GACF;GACI;GACH;GACA;GACP,mBAAmB;IACjB,OAAO;IACP,SAAS;IACT,GAAG;GACL;GACA,YACE,OAAO,eAAe,aAClB,aACA;IACE,GAAG;IACH,SAAS,GAAG,OAAO,MAAM,YAAY,OAAO;GAC9C;GAEN,QACE,OAAO,iBAAiB,aACpB,eACA;IACE,GAAG;IACH,MAAM;KACJ,WAAW;KACX,UAAU;KACV,cAAc,KAAK,WAAW,OAAO,SAAS;KAC9C,eAAe,UAAU,WAAW;KACpC,GAAG,cAAc;IACnB;GACF;GAEI;GACJ;GACN,GAAI;GAEH;EACO,CAAA;CACI,CAAA;AAEpB,CACF;AAEA,QAAM,cAAc"}
|
|
1
|
+
{"version":3,"file":"Modal.mjs","names":["Modal","AntModal"],"sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { Button, ConfigProvider, Drawer, type DrawerProps, Modal as AntModal } from 'antd';\nimport { cssVar, cx, useResponsive } from 'antd-style';\nimport { Maximize2, Minimize2, X } from 'lucide-react';\nimport { memo, type ReactNode, useState } from 'react';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport Icon from '@/Icon';\n\nimport { styles } from './style';\nimport { type ModalProps } from './type';\n\n/**\n * @deprecated Use `Modal` from `@lobehub/ui/base-ui` instead.\n */\nconst Modal = memo<ModalProps>(\n ({\n panelRef,\n allowFullscreen,\n children,\n title = ' ',\n className,\n classNames,\n width = 700,\n onCancel,\n open,\n destroyOnHidden,\n paddings,\n height = '75dvh',\n enableResponsive = true,\n footer,\n styles: customStyles,\n okText,\n onOk,\n cancelText,\n okButtonProps,\n cancelButtonProps,\n confirmLoading,\n ...rest\n }) => {\n const [fullscreen, setFullscreen] = useState(false);\n const { mobile } = useResponsive();\n const hideFooter = footer === false || footer === null;\n if (enableResponsive && mobile)\n return (\n <ConfigProvider\n theme={{\n token: {\n colorBgElevated: cssVar.colorBgContainer,\n },\n }}\n >\n <Drawer\n className={cx(styles.drawerContent, className)}\n closeIcon={<ActionIcon icon={X} />}\n destroyOnHidden={destroyOnHidden}\n height={fullscreen ? 'calc(100% - env(safe-area-inset-top))' : height}\n open={open}\n panelRef={panelRef}\n placement={'bottom'}\n title={title}\n classNames={\n (typeof classNames === 'function'\n ? classNames\n : {\n ...classNames,\n wrapper: cx(styles.wrap, classNames?.wrapper),\n }) as DrawerProps['classNames']\n }\n extra={\n allowFullscreen && (\n <ActionIcon\n icon={fullscreen ? Minimize2 : Maximize2}\n onClick={() => setFullscreen(!fullscreen)}\n />\n )\n }\n footer={\n hideFooter\n ? null\n : (footer as ReactNode) || (\n <>\n <Button\n color={'default'}\n variant={'filled'}\n onClick={onCancel as any}\n {...cancelButtonProps}\n >\n {cancelText || 'Cancel'}\n </Button>\n <Button\n loading={confirmLoading}\n type=\"primary\"\n onClick={onOk as any}\n {...okButtonProps}\n style={{\n marginInlineStart: 8,\n ...okButtonProps?.style,\n }}\n >\n {okText || 'OK'}\n </Button>\n </>\n )\n }\n styles={\n (typeof customStyles === 'function'\n ? customStyles\n : {\n ...customStyles,\n body: {\n paddingBlock: `16px ${footer ? 0 : '16px'}`,\n paddingInline: paddings?.desktop ?? 16,\n ...customStyles?.body,\n },\n }) as DrawerProps['styles']\n }\n onClose={onCancel as any}\n {...rest}\n >\n {children}\n </Drawer>\n </ConfigProvider>\n );\n\n return (\n <ConfigProvider\n theme={{\n token: {\n colorBgElevated: cssVar.colorBgContainer,\n },\n }}\n >\n <AntModal\n closable\n cancelText={cancelText}\n className={cx(styles.content, className)}\n closeIcon={<Icon icon={X} size={20} />}\n confirmLoading={confirmLoading}\n destroyOnHidden={destroyOnHidden}\n footer={hideFooter ? null : footer}\n mask={{ closable: true }}\n okButtonProps={okButtonProps}\n okText={okText}\n open={open}\n panelRef={panelRef}\n title={title}\n width={width}\n cancelButtonProps={{\n color: 'default',\n variant: 'filled',\n ...cancelButtonProps,\n }}\n classNames={\n typeof classNames === 'function'\n ? classNames\n : {\n ...classNames,\n wrapper: cx(styles.wrap, classNames?.wrapper),\n }\n }\n styles={\n typeof customStyles === 'function'\n ? customStyles\n : {\n ...customStyles,\n body: {\n maxHeight: height,\n overflow: 'hidden auto',\n paddingBlock: `0 ${footer === null ? '16px' : 0}`,\n paddingInline: paddings?.desktop ?? 16,\n ...customStyles?.body,\n },\n }\n }\n onCancel={onCancel}\n onOk={onOk}\n {...rest}\n >\n {children}\n </AntModal>\n </ConfigProvider>\n );\n },\n);\n\nModal.displayName = 'Modal';\n\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,UAAQ,MACX,EACC,UACA,iBACA,UACA,QAAQ,KACR,WACA,YACA,QAAQ,KACR,UACA,MACA,iBACA,UACA,SAAS,SACT,mBAAmB,MACnB,QACA,QAAQ,cACR,QACA,MACA,YACA,eACA,mBACA,gBACA,GAAG,WACC;CACJ,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAClD,MAAM,EAAE,WAAW,cAAc;CACjC,MAAM,aAAa,WAAW,SAAS,WAAW;CAClD,IAAI,oBAAoB,QACtB,OACE,oBAAC,gBAAD;EACE,OAAO,EACL,OAAO,EACL,iBAAiB,OAAO,iBAC1B,EACF;EAEA,UAAA,oBAAC,QAAD;GACE,WAAW,GAAG,OAAO,eAAe,SAAS;GAC7C,WAAW,oBAAC,YAAD,EAAY,MAAM,EAAI,CAAA;GAChB;GACjB,QAAQ,aAAa,0CAA0C;GACzD;GACI;GACV,WAAW;GACJ;GACP,YACG,OAAO,eAAe,aACnB,aACA;IACE,GAAG;IACH,SAAS,GAAG,OAAO,MAAM,YAAY,OAAO;GAC9C;GAEN,OACE,mBACE,oBAAC,YAAD;IACE,MAAM,aAAa,YAAY;IAC/B,eAAe,cAAc,CAAC,UAAU;GACzC,CAAA;GAGL,QACE,aACI,OACC,UACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IACE,OAAO;IACP,SAAS;IACT,SAAS;IACT,GAAI;IAEH,UAAA,cAAc;GACT,CAAA,GACR,oBAAC,QAAD;IACE,SAAS;IACT,MAAK;IACL,SAAS;IACT,GAAI;IACJ,OAAO;KACL,mBAAmB;KACnB,GAAG,eAAe;IACpB;IAEC,UAAA,UAAU;GACL,CAAA,CACR,EAAA,CAAA;GAGV,QACG,OAAO,iBAAiB,aACrB,eACA;IACE,GAAG;IACH,MAAM;KACJ,cAAc,QAAQ,SAAS,IAAI;KACnC,eAAe,UAAU,WAAW;KACpC,GAAG,cAAc;IACnB;GACF;GAEN,SAAS;GACT,GAAI;GAEH;EACK,CAAA;CACM,CAAA;CAGpB,OACE,oBAAC,gBAAD;EACE,OAAO,EACL,OAAO,EACL,iBAAiB,OAAO,iBAC1B,EACF;EAEA,UAAA,oBAACC,OAAD;GACE,UAAA;GACY;GACZ,WAAW,GAAG,OAAO,SAAS,SAAS;GACvC,WAAW,oBAAC,MAAD;IAAM,MAAM;IAAG,MAAM;GAAK,CAAA;GACrB;GACC;GACjB,QAAQ,aAAa,OAAO;GAC5B,MAAM,EAAE,UAAU,KAAK;GACR;GACP;GACF;GACI;GACH;GACA;GACP,mBAAmB;IACjB,OAAO;IACP,SAAS;IACT,GAAG;GACL;GACA,YACE,OAAO,eAAe,aAClB,aACA;IACE,GAAG;IACH,SAAS,GAAG,OAAO,MAAM,YAAY,OAAO;GAC9C;GAEN,QACE,OAAO,iBAAiB,aACpB,eACA;IACE,GAAG;IACH,MAAM;KACJ,WAAW;KACX,UAAU;KACV,cAAc,KAAK,WAAW,OAAO,SAAS;KAC9C,eAAe,UAAU,WAAW;KACpC,GAAG,cAAc;IACnB;GACF;GAEI;GACJ;GACN,GAAI;GAEH;EACO,CAAA;CACI,CAAA;AAEpB,CACF;AAEA,QAAM,cAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionIconProps } from "../../ActionIcon/type.mjs";
|
|
2
|
-
import "../../ActionIcon/index.mjs";
|
|
1
|
+
import { ActionIconProps } from "../../base-ui/ActionIcon/type.mjs";
|
|
2
|
+
import "../../base-ui/ActionIcon/index.mjs";
|
|
3
3
|
//#region src/SortableList/components/DragHandle.d.ts
|
|
4
4
|
declare const DragHandle: import("react").NamedExoticComponent<ActionIconProps>;
|
|
5
5
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import ActionIcon from "../../ActionIcon/ActionIcon.mjs";
|
|
2
|
+
import ActionIcon from "../../base-ui/ActionIcon/ActionIcon.mjs";
|
|
3
3
|
import { SortableItemContext } from "./SortableItem.mjs";
|
|
4
4
|
import { memo, use, useState } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragHandle.mjs","names":[],"sources":["../../../src/SortableList/components/DragHandle.tsx"],"sourcesContent":["'use client';\n\nimport { GripVertical } from 'lucide-react';\nimport { memo, use, useState } from 'react';\n\nimport ActionIcon, { type ActionIconProps } from '@/ActionIcon';\n\nimport { SortableItemContext } from './SortableItem';\n\nconst DragHandle = memo<ActionIconProps>(({ style, ...rest }) => {\n const [grab, setGrab] = useState(false);\n const { attributes, listeners, ref } = use(SortableItemContext);\n return (\n <ActionIcon\n glass\n data-cypress=\"draggable-handle\"\n icon={GripVertical}\n size={'small'}\n style={{ cursor: grab ? 'grab' : 'grabbing', ...style }}\n onMouseDown={() => setGrab(true)}\n onMouseUp={() => setGrab(false)}\n {...rest}\n {...attributes}\n {...listeners}\n ref={ref}\n />\n );\n});\n\nDragHandle.displayName = 'DragHandle';\n\nexport default DragHandle;\n"],"mappings":";;;;;;;AASA,MAAM,aAAa,MAAuB,EAAE,OAAO,GAAG,WAAW;CAC/D,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,EAAE,YAAY,WAAW,QAAQ,IAAI,mBAAmB;CAC9D,OACE,oBAAC,YAAD;EACE,OAAA;EACA,gBAAa;EACb,MAAM;EACN,MAAM;EACN,OAAO;GAAE,QAAQ,OAAO,SAAS;GAAY,GAAG;EAAM;EACtD,mBAAmB,QAAQ,IAAI;EAC/B,iBAAiB,QAAQ,KAAK;EAC9B,GAAI;EACJ,GAAI;EACJ,GAAI;EACC;CACN,CAAA;AAEL,CAAC;AAED,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"DragHandle.mjs","names":[],"sources":["../../../src/SortableList/components/DragHandle.tsx"],"sourcesContent":["'use client';\n\nimport { GripVertical } from 'lucide-react';\nimport { memo, use, useState } from 'react';\n\nimport ActionIcon, { type ActionIconProps } from '@/base-ui/ActionIcon';\n\nimport { SortableItemContext } from './SortableItem';\n\nconst DragHandle = memo<ActionIconProps>(({ style, ...rest }) => {\n const [grab, setGrab] = useState(false);\n const { attributes, listeners, ref } = use(SortableItemContext);\n return (\n <ActionIcon\n glass\n data-cypress=\"draggable-handle\"\n icon={GripVertical}\n size={'small'}\n style={{ cursor: grab ? 'grab' : 'grabbing', ...style }}\n onMouseDown={() => setGrab(true)}\n onMouseUp={() => setGrab(false)}\n {...rest}\n {...attributes}\n {...listeners}\n ref={ref}\n />\n );\n});\n\nDragHandle.displayName = 'DragHandle';\n\nexport default DragHandle;\n"],"mappings":";;;;;;;AASA,MAAM,aAAa,MAAuB,EAAE,OAAO,GAAG,WAAW;CAC/D,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,MAAM,EAAE,YAAY,WAAW,QAAQ,IAAI,mBAAmB;CAC9D,OACE,oBAAC,YAAD;EACE,OAAA;EACA,gBAAa;EACb,MAAM;EACN,MAAM;EACN,OAAO;GAAE,QAAQ,OAAO,SAAS;GAAY,GAAG;EAAM;EACtD,mBAAmB,QAAQ,IAAI;EAC/B,iBAAiB,QAAQ,KAAK;EAC9B,GAAI;EACJ,GAAI;EACJ,GAAI;EACC;CACN,CAAA;AAEL,CAAC;AAED,WAAW,cAAc"}
|
package/es/Tabs/Tabs.mjs
CHANGED
package/es/Tabs/Tabs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.mjs","names":["Tabs","AntdTabs"],"sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["'use client';\n\nimport { Tabs as AntdTabs } from 'antd';\nimport { cx } from 'antd-style';\nimport { MoreHorizontalIcon } from 'lucide-react';\nimport { type FC } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\n\nimport { styles, variants } from './style';\nimport type { TabsProps } from './type';\n\n/**\n * @deprecated Use `Tabs` from `@lobehub/ui/base-ui` instead.\n */\nconst Tabs: FC<TabsProps> = ({\n className,\n compact,\n variant = 'rounded',\n items,\n classNames,\n ...rest\n}) => {\n const hasContent = items?.some((item) => !!item.children);\n const popupClassNames = {\n root: styles.dropdown,\n ...(typeof classNames === 'function' ? undefined : classNames?.popup),\n };\n const mergedClassNames: TabsProps['classNames'] =\n typeof classNames === 'function'\n ? Object.assign((info: Parameters<typeof classNames>[0]) => classNames(info), {\n popup: popupClassNames,\n })\n : {\n ...classNames,\n popup: popupClassNames,\n };\n\n return (\n <AntdTabs\n className={cx(variants({ compact, underlined: hasContent, variant }), className)}\n items={items}\n {...rest}\n classNames={mergedClassNames}\n more={{\n icon: <ActionIcon icon={MoreHorizontalIcon} />,\n ...rest?.more,\n }}\n />\n );\n};\n\nTabs.displayName = 'Tabs';\n\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;AAeA,MAAMA,UAAuB,EAC3B,WACA,SACA,UAAU,WACV,OACA,YACA,GAAG,WACC;CACJ,MAAM,aAAa,OAAO,MAAM,SAAS,CAAC,CAAC,KAAK,QAAQ;CACxD,MAAM,kBAAkB;EACtB,MAAM,OAAO;EACb,GAAI,OAAO,eAAe,aAAa,KAAA,IAAY,YAAY;CACjE;CACA,MAAM,mBACJ,OAAO,eAAe,aAClB,OAAO,QAAQ,SAA2C,WAAW,IAAI,GAAG,EAC1E,OAAO,gBACT,CAAC,IACD;EACE,GAAG;EACH,OAAO;CACT;CAEN,OACE,oBAACC,MAAD;EACE,WAAW,GAAG,SAAS;GAAE;GAAS,YAAY;GAAY;EAAQ,CAAC,GAAG,SAAS;EACxE;EACP,GAAI;EACJ,YAAY;EACZ,MAAM;GACJ,MAAM,oBAAC,YAAD,EAAY,MAAM,mBAAqB,CAAA;GAC7C,GAAG,MAAM;EACX;CACD,CAAA;AAEL;AAEA,OAAK,cAAc"}
|
|
1
|
+
{"version":3,"file":"Tabs.mjs","names":["Tabs","AntdTabs"],"sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["'use client';\n\nimport { Tabs as AntdTabs } from 'antd';\nimport { cx } from 'antd-style';\nimport { MoreHorizontalIcon } from 'lucide-react';\nimport { type FC } from 'react';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\n\nimport { styles, variants } from './style';\nimport type { TabsProps } from './type';\n\n/**\n * @deprecated Use `Tabs` from `@lobehub/ui/base-ui` instead.\n */\nconst Tabs: FC<TabsProps> = ({\n className,\n compact,\n variant = 'rounded',\n items,\n classNames,\n ...rest\n}) => {\n const hasContent = items?.some((item) => !!item.children);\n const popupClassNames = {\n root: styles.dropdown,\n ...(typeof classNames === 'function' ? undefined : classNames?.popup),\n };\n const mergedClassNames: TabsProps['classNames'] =\n typeof classNames === 'function'\n ? Object.assign((info: Parameters<typeof classNames>[0]) => classNames(info), {\n popup: popupClassNames,\n })\n : {\n ...classNames,\n popup: popupClassNames,\n };\n\n return (\n <AntdTabs\n className={cx(variants({ compact, underlined: hasContent, variant }), className)}\n items={items}\n {...rest}\n classNames={mergedClassNames}\n more={{\n icon: <ActionIcon icon={MoreHorizontalIcon} />,\n ...rest?.more,\n }}\n />\n );\n};\n\nTabs.displayName = 'Tabs';\n\nexport default Tabs;\n"],"mappings":";;;;;;;;;;;AAeA,MAAMA,UAAuB,EAC3B,WACA,SACA,UAAU,WACV,OACA,YACA,GAAG,WACC;CACJ,MAAM,aAAa,OAAO,MAAM,SAAS,CAAC,CAAC,KAAK,QAAQ;CACxD,MAAM,kBAAkB;EACtB,MAAM,OAAO;EACb,GAAI,OAAO,eAAe,aAAa,KAAA,IAAY,YAAY;CACjE;CACA,MAAM,mBACJ,OAAO,eAAe,aAClB,OAAO,QAAQ,SAA2C,WAAW,IAAI,GAAG,EAC1E,OAAO,gBACT,CAAC,IACD;EACE,GAAG;EACH,OAAO;CACT;CAEN,OACE,oBAACC,MAAD;EACE,WAAW,GAAG,SAAS;GAAE;GAAS,YAAY;GAAY;EAAQ,CAAC,GAAG,SAAS;EACxE;EACP,GAAI;EACJ,YAAY;EACZ,MAAM;GACJ,MAAM,oBAAC,YAAD,EAAY,MAAM,mBAAqB,CAAA;GAC7C,GAAG,MAAM;EACX;CACD,CAAA;AAEL;AAEA,OAAK,cAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import FlexBasic_default from "../Flex/FlexBasic.mjs";
|
|
3
3
|
import Icon from "../Icon/Icon.mjs";
|
|
4
|
-
import ActionIcon from "../ActionIcon/ActionIcon.mjs";
|
|
5
4
|
import DropdownMenu from "../base-ui/DropdownMenu/DropdownMenu.mjs";
|
|
5
|
+
import ActionIcon from "../base-ui/ActionIcon/ActionIcon.mjs";
|
|
6
6
|
import { useMemo } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Select } from "antd";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSwitch.mjs","names":["Flexbox"],"sources":["../../src/ThemeSwitch/ThemeSwitch.tsx"],"sourcesContent":["'use client';\n\nimport { Select } from 'antd';\nimport { Monitor, Moon, Sun } from 'lucide-react';\nimport { type FC, useMemo } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport { type DropdownItem } from '@/DropdownMenu';\nimport DropdownMenu from '@/DropdownMenu';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { type ThemeSwitchProps } from './type';\n\nconst DEFAULT_ICON_SET = {\n auto: Monitor,\n dark: Moon,\n light: Sun,\n};\n\nconst ThemeSwitch: FC<ThemeSwitchProps> = ({\n size = 'middle',\n themeMode,\n onThemeSwitch,\n type = 'icon',\n labels = {\n auto: 'System',\n dark: 'Dark',\n light: 'Light',\n },\n className,\n variant,\n style,\n}) => {\n const items: DropdownItem[] = useMemo(\n () => [\n {\n icon: DEFAULT_ICON_SET.auto,\n key: 'auto',\n label: labels.auto,\n onClick: () => onThemeSwitch('auto'),\n },\n {\n icon: DEFAULT_ICON_SET.light,\n key: 'light',\n label: labels.light,\n onClick: () => onThemeSwitch('light'),\n },\n {\n icon: DEFAULT_ICON_SET.dark,\n key: 'dark',\n label: labels.dark,\n onClick: () => onThemeSwitch('dark'),\n },\n ],\n [labels, onThemeSwitch],\n );\n\n return type === 'select' ? (\n <Select\n className={className}\n defaultValue={themeMode}\n style={style}\n variant={variant}\n options={items.map((item: any) => ({\n label: (\n <Flexbox horizontal align={'center'} gap={8}>\n <Icon icon={item.icon} />\n {item.label}\n </Flexbox>\n ),\n value: item.key,\n }))}\n onChange={onThemeSwitch}\n />\n ) : (\n <DropdownMenu items={items} nativeButton={false}>\n <ActionIcon\n className={className}\n icon={DEFAULT_ICON_SET[themeMode]}\n size={size}\n style={style}\n variant={variant}\n />\n </DropdownMenu>\n );\n};\n\nThemeSwitch.displayName = 'ThemeSwitch';\n\nexport default ThemeSwitch;\n"],"mappings":";;;;;;;;;;AAcA,MAAM,mBAAmB;CACvB,MAAM;CACN,MAAM;CACN,OAAO;AACT;AAEA,MAAM,eAAqC,EACzC,OAAO,UACP,WACA,eACA,OAAO,QACP,SAAS;CACP,MAAM;CACN,MAAM;CACN,OAAO;AACT,GACA,WACA,SACA,YACI;CACJ,MAAM,QAAwB,cACtB;EACJ;GACE,MAAM,iBAAiB;GACvB,KAAK;GACL,OAAO,OAAO;GACd,eAAe,cAAc,MAAM;EACrC;EACA;GACE,MAAM,iBAAiB;GACvB,KAAK;GACL,OAAO,OAAO;GACd,eAAe,cAAc,OAAO;EACtC;EACA;GACE,MAAM,iBAAiB;GACvB,KAAK;GACL,OAAO,OAAO;GACd,eAAe,cAAc,MAAM;EACrC;CACF,GACA,CAAC,QAAQ,aAAa,CACxB;CAEA,OAAO,SAAS,WACd,oBAAC,QAAD;EACa;EACX,cAAc;EACP;EACE;EACT,SAAS,MAAM,KAAK,UAAe;GACjC,OACE,qBAACA,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAU,KAAK;IAA1C,UAAA,CACE,oBAAC,MAAD,EAAM,MAAM,KAAK,KAAO,CAAA,GACvB,KAAK,KACC;;GAEX,OAAO,KAAK;EACd,EAAE;EACF,UAAU;CACX,CAAA,IAED,oBAAC,cAAD;EAAqB;EAAO,cAAc;EACxC,UAAA,oBAAC,YAAD;GACa;GACX,MAAM,iBAAiB;GACjB;GACC;GACE;EACV,CAAA;CACW,CAAA;AAElB;AAEA,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"ThemeSwitch.mjs","names":["Flexbox"],"sources":["../../src/ThemeSwitch/ThemeSwitch.tsx"],"sourcesContent":["'use client';\n\nimport { Select } from 'antd';\nimport { Monitor, Moon, Sun } from 'lucide-react';\nimport { type FC, useMemo } from 'react';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport { type DropdownItem } from '@/DropdownMenu';\nimport DropdownMenu from '@/DropdownMenu';\nimport { Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\n\nimport { type ThemeSwitchProps } from './type';\n\nconst DEFAULT_ICON_SET = {\n auto: Monitor,\n dark: Moon,\n light: Sun,\n};\n\nconst ThemeSwitch: FC<ThemeSwitchProps> = ({\n size = 'middle',\n themeMode,\n onThemeSwitch,\n type = 'icon',\n labels = {\n auto: 'System',\n dark: 'Dark',\n light: 'Light',\n },\n className,\n variant,\n style,\n}) => {\n const items: DropdownItem[] = useMemo(\n () => [\n {\n icon: DEFAULT_ICON_SET.auto,\n key: 'auto',\n label: labels.auto,\n onClick: () => onThemeSwitch('auto'),\n },\n {\n icon: DEFAULT_ICON_SET.light,\n key: 'light',\n label: labels.light,\n onClick: () => onThemeSwitch('light'),\n },\n {\n icon: DEFAULT_ICON_SET.dark,\n key: 'dark',\n label: labels.dark,\n onClick: () => onThemeSwitch('dark'),\n },\n ],\n [labels, onThemeSwitch],\n );\n\n return type === 'select' ? (\n <Select\n className={className}\n defaultValue={themeMode}\n style={style}\n variant={variant}\n options={items.map((item: any) => ({\n label: (\n <Flexbox horizontal align={'center'} gap={8}>\n <Icon icon={item.icon} />\n {item.label}\n </Flexbox>\n ),\n value: item.key,\n }))}\n onChange={onThemeSwitch}\n />\n ) : (\n <DropdownMenu items={items} nativeButton={false}>\n <ActionIcon\n className={className}\n icon={DEFAULT_ICON_SET[themeMode]}\n size={size}\n style={style}\n variant={variant}\n />\n </DropdownMenu>\n );\n};\n\nThemeSwitch.displayName = 'ThemeSwitch';\n\nexport default ThemeSwitch;\n"],"mappings":";;;;;;;;;;AAcA,MAAM,mBAAmB;CACvB,MAAM;CACN,MAAM;CACN,OAAO;AACT;AAEA,MAAM,eAAqC,EACzC,OAAO,UACP,WACA,eACA,OAAO,QACP,SAAS;CACP,MAAM;CACN,MAAM;CACN,OAAO;AACT,GACA,WACA,SACA,YACI;CACJ,MAAM,QAAwB,cACtB;EACJ;GACE,MAAM,iBAAiB;GACvB,KAAK;GACL,OAAO,OAAO;GACd,eAAe,cAAc,MAAM;EACrC;EACA;GACE,MAAM,iBAAiB;GACvB,KAAK;GACL,OAAO,OAAO;GACd,eAAe,cAAc,OAAO;EACtC;EACA;GACE,MAAM,iBAAiB;GACvB,KAAK;GACL,OAAO,OAAO;GACd,eAAe,cAAc,MAAM;EACrC;CACF,GACA,CAAC,QAAQ,aAAa,CACxB;CAEA,OAAO,SAAS,WACd,oBAAC,QAAD;EACa;EACX,cAAc;EACP;EACE;EACT,SAAS,MAAM,KAAK,UAAe;GACjC,OACE,qBAACA,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAU,KAAK;IAA1C,UAAA,CACE,oBAAC,MAAD,EAAM,MAAM,KAAK,KAAO,CAAA,GACvB,KAAK,KACC;;GAEX,OAAO,KAAK;EACd,EAAE;EACF,UAAU;CACX,CAAA,IAED,oBAAC,cAAD;EAAqB;EAAO,cAAc;EACxC,UAAA,oBAAC,YAAD;GACa;GACX,MAAM,iBAAiB;GACjB;GACC;GACE;EACV,CAAA;CACW,CAAA;AAElB;AAEA,YAAY,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DivProps } from "../types/index.mjs";
|
|
2
|
-
import { ActionIconProps } from "../ActionIcon/type.mjs";
|
|
3
|
-
import "../ActionIcon/index.mjs";
|
|
2
|
+
import { ActionIconProps } from "../base-ui/ActionIcon/type.mjs";
|
|
3
|
+
import "../base-ui/ActionIcon/index.mjs";
|
|
4
4
|
import { ThemeMode } from "antd-style";
|
|
5
5
|
//#region src/ThemeSwitch/type.d.ts
|
|
6
6
|
interface ThemeSwitchProps extends DivProps {
|
package/es/Toc/TocMobile.mjs
CHANGED
package/es/Toc/TocMobile.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TocMobile.mjs","names":["useControlledState"],"sources":["../../src/Toc/TocMobile.tsx"],"sourcesContent":["'use client';\n\nimport { Anchor, Collapse, ConfigProvider } from 'antd';\nimport { PanelTopClose, PanelTopOpen } from 'lucide-react';\nimport { memo, useMemo } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport ActionIcon from '@/ActionIcon';\n\nimport { styles } from './style';\nimport type { TocMobileProps } from './type';\nimport { mapItems } from './utils';\n\nconst TocMobile = memo<TocMobileProps>(\n ({ items, activeKey, onChange, getContainer, headerHeight = 64, tocWidth = 176 }) => {\n // tocWidth is part of the interface but not used in this component\n void tocWidth;\n const [activeLink, setActiveLink] = useControlledState<string>('', {\n onChange,\n value: activeKey,\n });\n\n const activeAnchor = items.find((item) => item.id === activeLink);\n\n const tocItems = useMemo(() => mapItems(items), [items]);\n\n return (\n <ConfigProvider theme={{ token: { fontSize: 12, sizeStep: 3 } }}>\n <section className={styles.mobileCtn}>\n <Collapse\n ghost\n className={styles.expand}\n expandIconPlacement={'end'}\n expandIcon={({ isActive }) => (\n <ActionIcon icon={isActive ? PanelTopClose : PanelTopOpen} size={'small'} />\n )}\n >\n <Collapse.Panel\n forceRender\n header={activeAnchor ? activeAnchor.title : 'TOC'}\n key={'toc'}\n >\n <ConfigProvider theme={{ token: { fontSize: 14, sizeStep: 4 } }}>\n <Anchor\n getContainer={getContainer}\n items={tocItems}\n targetOffset={headerHeight + 48}\n onChange={(currentLink) => {\n setActiveLink(currentLink.replace('#', ''));\n }}\n />\n </ConfigProvider>\n </Collapse.Panel>\n </Collapse>\n </section>\n </ConfigProvider>\n );\n },\n);\n\nTocMobile.displayName = 'TocMobile';\n\nexport default TocMobile;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,MACf,EAAE,OAAO,WAAW,UAAU,cAAc,eAAe,IAAI,WAAW,UAAU;CAGnF,MAAM,CAAC,YAAY,iBAAiBA,cAA2B,IAAI;EACjE;EACA,OAAO;CACT,CAAC;CAED,MAAM,eAAe,MAAM,MAAM,SAAS,KAAK,OAAO,UAAU;CAEhE,MAAM,WAAW,cAAc,SAAS,KAAK,GAAG,CAAC,KAAK,CAAC;CAEvD,OACE,oBAAC,gBAAD;EAAgB,OAAO,EAAE,OAAO;GAAE,UAAU;GAAI,UAAU;EAAE,EAAE;EAC5D,UAAA,oBAAC,WAAD;GAAS,WAAW,OAAO;GACzB,UAAA,oBAAC,UAAD;IACE,OAAA;IACA,WAAW,OAAO;IAClB,qBAAqB;IACrB,aAAa,EAAE,eACb,oBAAC,YAAD;KAAY,MAAM,WAAW,gBAAgB;KAAc,MAAM;IAAU,CAAA;IAG7E,UAAA,oBAAC,SAAS,OAAV;KACE,aAAA;KACA,QAAQ,eAAe,aAAa,QAAQ;KAG5C,UAAA,oBAAC,gBAAD;MAAgB,OAAO,EAAE,OAAO;OAAE,UAAU;OAAI,UAAU;MAAE,EAAE;MAC5D,UAAA,oBAAC,QAAD;OACgB;OACd,OAAO;OACP,cAAc,eAAe;OAC7B,WAAW,gBAAgB;QACzB,cAAc,YAAY,QAAQ,KAAK,EAAE,CAAC;OAC5C;MACD,CAAA;KACa,CAAA;IACF,GAZT,KAYS;GACR,CAAA;EACH,CAAA;CACK,CAAA;AAEpB,CACF;AAEA,UAAU,cAAc"}
|
|
1
|
+
{"version":3,"file":"TocMobile.mjs","names":["useControlledState"],"sources":["../../src/Toc/TocMobile.tsx"],"sourcesContent":["'use client';\n\nimport { Anchor, Collapse, ConfigProvider } from 'antd';\nimport { PanelTopClose, PanelTopOpen } from 'lucide-react';\nimport { memo, useMemo } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\n\nimport { styles } from './style';\nimport type { TocMobileProps } from './type';\nimport { mapItems } from './utils';\n\nconst TocMobile = memo<TocMobileProps>(\n ({ items, activeKey, onChange, getContainer, headerHeight = 64, tocWidth = 176 }) => {\n // tocWidth is part of the interface but not used in this component\n void tocWidth;\n const [activeLink, setActiveLink] = useControlledState<string>('', {\n onChange,\n value: activeKey,\n });\n\n const activeAnchor = items.find((item) => item.id === activeLink);\n\n const tocItems = useMemo(() => mapItems(items), [items]);\n\n return (\n <ConfigProvider theme={{ token: { fontSize: 12, sizeStep: 3 } }}>\n <section className={styles.mobileCtn}>\n <Collapse\n ghost\n className={styles.expand}\n expandIconPlacement={'end'}\n expandIcon={({ isActive }) => (\n <ActionIcon icon={isActive ? PanelTopClose : PanelTopOpen} size={'small'} />\n )}\n >\n <Collapse.Panel\n forceRender\n header={activeAnchor ? activeAnchor.title : 'TOC'}\n key={'toc'}\n >\n <ConfigProvider theme={{ token: { fontSize: 14, sizeStep: 4 } }}>\n <Anchor\n getContainer={getContainer}\n items={tocItems}\n targetOffset={headerHeight + 48}\n onChange={(currentLink) => {\n setActiveLink(currentLink.replace('#', ''));\n }}\n />\n </ConfigProvider>\n </Collapse.Panel>\n </Collapse>\n </section>\n </ConfigProvider>\n );\n },\n);\n\nTocMobile.displayName = 'TocMobile';\n\nexport default TocMobile;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,MACf,EAAE,OAAO,WAAW,UAAU,cAAc,eAAe,IAAI,WAAW,UAAU;CAGnF,MAAM,CAAC,YAAY,iBAAiBA,cAA2B,IAAI;EACjE;EACA,OAAO;CACT,CAAC;CAED,MAAM,eAAe,MAAM,MAAM,SAAS,KAAK,OAAO,UAAU;CAEhE,MAAM,WAAW,cAAc,SAAS,KAAK,GAAG,CAAC,KAAK,CAAC;CAEvD,OACE,oBAAC,gBAAD;EAAgB,OAAO,EAAE,OAAO;GAAE,UAAU;GAAI,UAAU;EAAE,EAAE;EAC5D,UAAA,oBAAC,WAAD;GAAS,WAAW,OAAO;GACzB,UAAA,oBAAC,UAAD;IACE,OAAA;IACA,WAAW,OAAO;IAClB,qBAAqB;IACrB,aAAa,EAAE,eACb,oBAAC,YAAD;KAAY,MAAM,WAAW,gBAAgB;KAAc,MAAM;IAAU,CAAA;IAG7E,UAAA,oBAAC,SAAS,OAAV;KACE,aAAA;KACA,QAAQ,eAAe,aAAa,QAAQ;KAG5C,UAAA,oBAAC,gBAAD;MAAgB,OAAO,EAAE,OAAO;OAAE,UAAU;OAAI,UAAU;MAAE,EAAE;MAC5D,UAAA,oBAAC,QAAD;OACgB;OACd,OAAO;OACP,cAAc,eAAe;OAC7B,WAAW,gBAAgB;QACzB,cAAc,YAAY,QAAQ,KAAK,EAAE,CAAC;OAC5C;MACD,CAAA;KACa,CAAA;IACF,GAZT,KAYS;GACR,CAAA;EACH,CAAA;CACK,CAAA;AAEpB,CACF;AAEA,UAAU,cAAc"}
|
package/es/Video/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import FlexBasic_default from "../Flex/FlexBasic.mjs";
|
|
3
|
-
import ActionIcon from "../ActionIcon/ActionIcon.mjs";
|
|
3
|
+
import ActionIcon from "../base-ui/ActionIcon/ActionIcon.mjs";
|
|
4
4
|
import { styles, variants } from "./style.mjs";
|
|
5
5
|
import { memo, useMemo, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/es/Video/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Flexbox"],"sources":["../../src/Video/index.tsx"],"sourcesContent":["'use client';\n\nimport { Skeleton } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport { PlayIcon } from 'lucide-react';\nimport { type CSSProperties, memo, type Ref, useMemo, useState } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport { Flexbox, type FlexboxProps } from '@/Flex';\nimport { type VideoProps as VProps } from '@/types';\n\nimport { styles, variants } from './style';\n\nexport interface VideoProps extends VProps, Pick<FlexboxProps, 'width' | 'height'> {\n autoPlay?: boolean;\n classNames?: {\n mask?: string;\n video?: string;\n wrapper?: string;\n };\n isLoading?: boolean;\n loop?: boolean;\n maxHeight?: number | string;\n maxWidth?: number | string;\n minHeight?: number | string;\n minWidth?: number | string;\n muted?: HTMLVideoElement['muted'];\n onEnded?: VProps['onEnded'];\n onMouseEnter?: VProps['onMouseEnter'];\n onMouseLeave?: VProps['onMouseLeave'];\n onPause?: VProps['onPause'];\n onPlay?: VProps['onPlay'];\n onPlaying?: VProps['onPlaying'];\n onProgress?: VProps['onProgress'];\n poster?: string;\n preload?: HTMLVideoElement['preload'];\n preview?: boolean;\n ref?: Ref<HTMLDivElement>;\n size?: number | string;\n src: string;\n styles?: {\n mask?: CSSProperties;\n video?: CSSProperties;\n wrapper?: CSSProperties;\n };\n variant?: 'borderless' | 'filled' | 'outlined';\n}\n\nconst Video = memo<VideoProps>(\n ({\n ref,\n preload = 'auto',\n src,\n style,\n classNames,\n className,\n maxHeight = '100%',\n maxWidth = '100%',\n minHeight,\n minWidth,\n onEnded,\n onPause,\n onPlay,\n onPlaying,\n width,\n height,\n onMouseEnter,\n styles: customStyles,\n onMouseLeave,\n preview = true,\n isLoading,\n variant = 'filled',\n autoPlay,\n ...rest\n }) => {\n const [isPlaying, setIsPlaying] = useState(false);\n const [showControls, setShowControls] = useState(false);\n\n // Convert props to CSS variables\n const cssVariables = useMemo<Record<string, string>>(() => {\n const vars: Record<string, string> = {};\n if (maxHeight !== undefined) {\n vars['--video-max-height'] = typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;\n }\n if (maxWidth !== undefined) {\n vars['--video-max-width'] = typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth;\n }\n if (minHeight !== undefined) {\n vars['--video-min-height'] = typeof minHeight === 'number' ? `${minHeight}px` : minHeight;\n }\n if (minWidth !== undefined) {\n vars['--video-min-width'] = typeof minWidth === 'number' ? `${minWidth}px` : minWidth;\n }\n return vars;\n }, [maxHeight, maxWidth, minHeight, minWidth]);\n\n if (isLoading)\n return (\n <Skeleton.Avatar\n active\n style={{\n borderRadius: cssVar.borderRadiusLG,\n height,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n width,\n }}\n />\n );\n\n return (\n <Flexbox\n className={cx(variants({ variant }), className, classNames?.wrapper)}\n height={height}\n ref={ref}\n width={width}\n style={{\n ...cssVariables,\n ...style,\n ...customStyles?.wrapper,\n }}\n >\n {preview && !isPlaying && (\n <Flexbox\n align={'center'}\n className={cx(styles.mask, classNames?.mask)}\n justify={'center'}\n style={customStyles?.mask}\n >\n <ActionIcon color={'#fff'} icon={PlayIcon} variant={'filled'} />\n </Flexbox>\n )}\n <video\n autoPlay={autoPlay}\n className={cx(styles.video, classNames?.video)}\n controls={showControls}\n height={height}\n preload={preload}\n width={width}\n style={{\n height: 'auto',\n maxWidth: '100%',\n ...customStyles?.video,\n }}\n onEnded={(e) => {\n setIsPlaying(false);\n onEnded?.(e);\n }}\n onMouseEnter={(e) => {\n setShowControls(true);\n onMouseEnter?.(e);\n }}\n onMouseLeave={(e) => {\n setShowControls(false);\n onMouseLeave?.(e);\n }}\n onPause={(e) => {\n setIsPlaying(false);\n onPause?.(e);\n }}\n onPlay={(e) => {\n setIsPlaying(true);\n onPlay?.(e);\n }}\n onPlaying={(e) => {\n setIsPlaying(true);\n onPlaying?.(e);\n }}\n {...rest}\n >\n <source src={src} />\n </video>\n </Flexbox>\n );\n },\n);\n\nVideo.displayName = 'Video';\n\nexport default Video;\n"],"mappings":";;;;;;;;;;AAgDA,MAAM,QAAQ,MACX,EACC,KACA,UAAU,QACV,KACA,OACA,YACA,WACA,YAAY,QACZ,WAAW,QACX,WACA,UACA,SACA,SACA,QACA,WACA,OACA,QACA,cACA,QAAQ,cACR,cACA,UAAU,MACV,WACA,UAAU,UACV,UACA,GAAG,WACC;CACJ,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CAGtD,MAAM,eAAe,cAAsC;EACzD,MAAM,OAA+B,CAAC;EACtC,IAAI,cAAc,KAAA,GAChB,KAAK,wBAAwB,OAAO,cAAc,WAAW,GAAG,UAAU,MAAM;EAElF,IAAI,aAAa,KAAA,GACf,KAAK,uBAAuB,OAAO,aAAa,WAAW,GAAG,SAAS,MAAM;EAE/E,IAAI,cAAc,KAAA,GAChB,KAAK,wBAAwB,OAAO,cAAc,WAAW,GAAG,UAAU,MAAM;EAElF,IAAI,aAAa,KAAA,GACf,KAAK,uBAAuB,OAAO,aAAa,WAAW,GAAG,SAAS,MAAM;EAE/E,OAAO;CACT,GAAG;EAAC;EAAW;EAAU;EAAW;CAAQ,CAAC;CAE7C,IAAI,WACF,OACE,oBAAC,SAAS,QAAV;EACE,QAAA;EACA,OAAO;GACL,cAAc,OAAO;GACrB;GACA;GACA;GACA;GACA;GACA;EACF;CACD,CAAA;CAGL,OACE,qBAACA,mBAAD;EACE,WAAW,GAAG,SAAS,EAAE,QAAQ,CAAC,GAAG,WAAW,YAAY,OAAO;EAC3D;EACH;EACE;EACP,OAAO;GACL,GAAG;GACH,GAAG;GACH,GAAG,cAAc;EACnB;EATF,UAAA,CAWG,WAAW,CAAC,aACX,oBAACA,mBAAD;GACE,OAAO;GACP,WAAW,GAAG,OAAO,MAAM,YAAY,IAAI;GAC3C,SAAS;GACT,OAAO,cAAc;GAErB,UAAA,oBAAC,YAAD;IAAY,OAAO;IAAQ,MAAM;IAAU,SAAS;GAAW,CAAA;EACxD,CAAA,GAEX,oBAAC,SAAD;GACY;GACV,WAAW,GAAG,OAAO,OAAO,YAAY,KAAK;GAC7C,UAAU;GACF;GACC;GACF;GACP,OAAO;IACL,QAAQ;IACR,UAAU;IACV,GAAG,cAAc;GACnB;GACA,UAAU,MAAM;IACd,aAAa,KAAK;IAClB,UAAU,CAAC;GACb;GACA,eAAe,MAAM;IACnB,gBAAgB,IAAI;IACpB,eAAe,CAAC;GAClB;GACA,eAAe,MAAM;IACnB,gBAAgB,KAAK;IACrB,eAAe,CAAC;GAClB;GACA,UAAU,MAAM;IACd,aAAa,KAAK;IAClB,UAAU,CAAC;GACb;GACA,SAAS,MAAM;IACb,aAAa,IAAI;IACjB,SAAS,CAAC;GACZ;GACA,YAAY,MAAM;IAChB,aAAa,IAAI;IACjB,YAAY,CAAC;GACf;GACA,GAAI;GAEJ,UAAA,oBAAC,UAAD,EAAa,IAAM,CAAA;EACd,CAAA,CACA;;AAEb,CACF;AAEA,MAAM,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Flexbox"],"sources":["../../src/Video/index.tsx"],"sourcesContent":["'use client';\n\nimport { Skeleton } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport { PlayIcon } from 'lucide-react';\nimport { type CSSProperties, memo, type Ref, useMemo, useState } from 'react';\n\nimport ActionIcon from '@/base-ui/ActionIcon';\nimport { Flexbox, type FlexboxProps } from '@/Flex';\nimport { type VideoProps as VProps } from '@/types';\n\nimport { styles, variants } from './style';\n\nexport interface VideoProps extends VProps, Pick<FlexboxProps, 'width' | 'height'> {\n autoPlay?: boolean;\n classNames?: {\n mask?: string;\n video?: string;\n wrapper?: string;\n };\n isLoading?: boolean;\n loop?: boolean;\n maxHeight?: number | string;\n maxWidth?: number | string;\n minHeight?: number | string;\n minWidth?: number | string;\n muted?: HTMLVideoElement['muted'];\n onEnded?: VProps['onEnded'];\n onMouseEnter?: VProps['onMouseEnter'];\n onMouseLeave?: VProps['onMouseLeave'];\n onPause?: VProps['onPause'];\n onPlay?: VProps['onPlay'];\n onPlaying?: VProps['onPlaying'];\n onProgress?: VProps['onProgress'];\n poster?: string;\n preload?: HTMLVideoElement['preload'];\n preview?: boolean;\n ref?: Ref<HTMLDivElement>;\n size?: number | string;\n src: string;\n styles?: {\n mask?: CSSProperties;\n video?: CSSProperties;\n wrapper?: CSSProperties;\n };\n variant?: 'borderless' | 'filled' | 'outlined';\n}\n\nconst Video = memo<VideoProps>(\n ({\n ref,\n preload = 'auto',\n src,\n style,\n classNames,\n className,\n maxHeight = '100%',\n maxWidth = '100%',\n minHeight,\n minWidth,\n onEnded,\n onPause,\n onPlay,\n onPlaying,\n width,\n height,\n onMouseEnter,\n styles: customStyles,\n onMouseLeave,\n preview = true,\n isLoading,\n variant = 'filled',\n autoPlay,\n ...rest\n }) => {\n const [isPlaying, setIsPlaying] = useState(false);\n const [showControls, setShowControls] = useState(false);\n\n // Convert props to CSS variables\n const cssVariables = useMemo<Record<string, string>>(() => {\n const vars: Record<string, string> = {};\n if (maxHeight !== undefined) {\n vars['--video-max-height'] = typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;\n }\n if (maxWidth !== undefined) {\n vars['--video-max-width'] = typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth;\n }\n if (minHeight !== undefined) {\n vars['--video-min-height'] = typeof minHeight === 'number' ? `${minHeight}px` : minHeight;\n }\n if (minWidth !== undefined) {\n vars['--video-min-width'] = typeof minWidth === 'number' ? `${minWidth}px` : minWidth;\n }\n return vars;\n }, [maxHeight, maxWidth, minHeight, minWidth]);\n\n if (isLoading)\n return (\n <Skeleton.Avatar\n active\n style={{\n borderRadius: cssVar.borderRadiusLG,\n height,\n maxHeight,\n maxWidth,\n minHeight,\n minWidth,\n width,\n }}\n />\n );\n\n return (\n <Flexbox\n className={cx(variants({ variant }), className, classNames?.wrapper)}\n height={height}\n ref={ref}\n width={width}\n style={{\n ...cssVariables,\n ...style,\n ...customStyles?.wrapper,\n }}\n >\n {preview && !isPlaying && (\n <Flexbox\n align={'center'}\n className={cx(styles.mask, classNames?.mask)}\n justify={'center'}\n style={customStyles?.mask}\n >\n <ActionIcon color={'#fff'} icon={PlayIcon} variant={'filled'} />\n </Flexbox>\n )}\n <video\n autoPlay={autoPlay}\n className={cx(styles.video, classNames?.video)}\n controls={showControls}\n height={height}\n preload={preload}\n width={width}\n style={{\n height: 'auto',\n maxWidth: '100%',\n ...customStyles?.video,\n }}\n onEnded={(e) => {\n setIsPlaying(false);\n onEnded?.(e);\n }}\n onMouseEnter={(e) => {\n setShowControls(true);\n onMouseEnter?.(e);\n }}\n onMouseLeave={(e) => {\n setShowControls(false);\n onMouseLeave?.(e);\n }}\n onPause={(e) => {\n setIsPlaying(false);\n onPause?.(e);\n }}\n onPlay={(e) => {\n setIsPlaying(true);\n onPlay?.(e);\n }}\n onPlaying={(e) => {\n setIsPlaying(true);\n onPlaying?.(e);\n }}\n {...rest}\n >\n <source src={src} />\n </video>\n </Flexbox>\n );\n },\n);\n\nVideo.displayName = 'Video';\n\nexport default Video;\n"],"mappings":";;;;;;;;;;AAgDA,MAAM,QAAQ,MACX,EACC,KACA,UAAU,QACV,KACA,OACA,YACA,WACA,YAAY,QACZ,WAAW,QACX,WACA,UACA,SACA,SACA,QACA,WACA,OACA,QACA,cACA,QAAQ,cACR,cACA,UAAU,MACV,WACA,UAAU,UACV,UACA,GAAG,WACC;CACJ,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CAGtD,MAAM,eAAe,cAAsC;EACzD,MAAM,OAA+B,CAAC;EACtC,IAAI,cAAc,KAAA,GAChB,KAAK,wBAAwB,OAAO,cAAc,WAAW,GAAG,UAAU,MAAM;EAElF,IAAI,aAAa,KAAA,GACf,KAAK,uBAAuB,OAAO,aAAa,WAAW,GAAG,SAAS,MAAM;EAE/E,IAAI,cAAc,KAAA,GAChB,KAAK,wBAAwB,OAAO,cAAc,WAAW,GAAG,UAAU,MAAM;EAElF,IAAI,aAAa,KAAA,GACf,KAAK,uBAAuB,OAAO,aAAa,WAAW,GAAG,SAAS,MAAM;EAE/E,OAAO;CACT,GAAG;EAAC;EAAW;EAAU;EAAW;CAAQ,CAAC;CAE7C,IAAI,WACF,OACE,oBAAC,SAAS,QAAV;EACE,QAAA;EACA,OAAO;GACL,cAAc,OAAO;GACrB;GACA;GACA;GACA;GACA;GACA;EACF;CACD,CAAA;CAGL,OACE,qBAACA,mBAAD;EACE,WAAW,GAAG,SAAS,EAAE,QAAQ,CAAC,GAAG,WAAW,YAAY,OAAO;EAC3D;EACH;EACE;EACP,OAAO;GACL,GAAG;GACH,GAAG;GACH,GAAG,cAAc;EACnB;EATF,UAAA,CAWG,WAAW,CAAC,aACX,oBAACA,mBAAD;GACE,OAAO;GACP,WAAW,GAAG,OAAO,MAAM,YAAY,IAAI;GAC3C,SAAS;GACT,OAAO,cAAc;GAErB,UAAA,oBAAC,YAAD;IAAY,OAAO;IAAQ,MAAM;IAAU,SAAS;GAAW,CAAA;EACxD,CAAA,GAEX,oBAAC,SAAD;GACY;GACV,WAAW,GAAG,OAAO,OAAO,YAAY,KAAK;GAC7C,UAAU;GACF;GACC;GACF;GACP,OAAO;IACL,QAAQ;IACR,UAAU;IACV,GAAG,cAAc;GACnB;GACA,UAAU,MAAM;IACd,aAAa,KAAK;IAClB,UAAU,CAAC;GACb;GACA,eAAe,MAAM;IACnB,gBAAgB,IAAI;IACpB,eAAe,CAAC;GAClB;GACA,eAAe,MAAM;IACnB,gBAAgB,KAAK;IACrB,eAAe,CAAC;GAClB;GACA,UAAU,MAAM;IACd,aAAa,KAAK;IAClB,UAAU,CAAC;GACb;GACA,SAAS,MAAM;IACb,aAAa,IAAI;IACjB,SAAS,CAAC;GACZ;GACA,YAAY,MAAM;IAChB,aAAa,IAAI;IACjB,YAAY,CAAC;GACf;GACA,GAAI;GAEJ,UAAA,oBAAC,UAAD,EAAa,IAAM,CAAA;EACd,CAAA,CACA;;AAEb,CACF;AAEA,MAAM,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import DropdownMenu from "../DropdownMenu/DropdownMenu.mjs";
|
|
3
2
|
import Button from "./Button.mjs";
|
|
3
|
+
import DropdownMenu from "../DropdownMenu/DropdownMenu.mjs";
|
|
4
4
|
import { createContext, use, useMemo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { createStaticStyles, cx } from "antd-style";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { useMotionComponent } from "../../../MotionProvider/index.mjs";
|
|
3
3
|
import FlexBasic_default from "../../../Flex/FlexBasic.mjs";
|
|
4
4
|
import Icon from "../../../Icon/Icon.mjs";
|
|
5
|
+
import Button from "../../Button/Button.mjs";
|
|
5
6
|
import { useTranslation } from "../../../i18n/useTranslation.mjs";
|
|
6
7
|
import form_default from "../../../i18n/resources/en/form.mjs";
|
|
7
|
-
import Button from "../../Button/Button.mjs";
|
|
8
8
|
import { submitFooterStyles } from "../style.mjs";
|
|
9
9
|
import { useFormContext } from "../context.mjs";
|
|
10
10
|
import { memo, useEffect } from "react";
|
|
@@ -23,7 +23,7 @@ declare const styles: {
|
|
|
23
23
|
};
|
|
24
24
|
declare const rootVariants: (props?: ({
|
|
25
25
|
shadow?: boolean | null | undefined;
|
|
26
|
-
size?: "
|
|
26
|
+
size?: "large" | "middle" | "small" | null | undefined;
|
|
27
27
|
variant?: "filled" | "borderless" | "outlined" | null | undefined;
|
|
28
28
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
29
29
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useIsClient } from "../../hooks/useIsClient.mjs";
|
|
3
3
|
import { useAppElement } from "../../ThemeProvider/AppElementContext.mjs";
|
|
4
|
-
import { registerDevSingleton } from "../../utils/devSingleton.mjs";
|
|
5
4
|
import Button from "../Button/Button.mjs";
|
|
5
|
+
import { registerDevSingleton } from "../../utils/devSingleton.mjs";
|
|
6
6
|
import { ModalBackdrop, ModalClose, ModalContent, ModalFooter, ModalHeader, ModalPopup, ModalPortal, ModalRoot, ModalTitle } from "./atoms.mjs";
|
|
7
7
|
import { ModalContext, useModalContext } from "./context.mjs";
|
|
8
8
|
import { memo, useCallback, useEffect, useState, useSyncExternalStore } from "react";
|
package/es/base-ui/Tag/Tag.mjs
CHANGED
|
@@ -73,7 +73,7 @@ const Tag = memo(({ children, className, classNames, closable, closeIcon, color,
|
|
|
73
73
|
onClose?.(e);
|
|
74
74
|
setVisible(false);
|
|
75
75
|
},
|
|
76
|
-
children: closeIcon ?? /* @__PURE__ */ jsx(X, { size:
|
|
76
|
+
children: closeIcon ?? /* @__PURE__ */ jsx(X, { size: 10 })
|
|
77
77
|
})
|
|
78
78
|
]
|
|
79
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.mjs","names":[],"sources":["../../../src/base-ui/Tag/Tag.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar, cx } from 'antd-style';\nimport { X } from 'lucide-react';\nimport { memo, useMemo, useState } from 'react';\n\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nimport { styles, variants } from './style';\nimport type { TagProps } from './type';\nimport { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from './utils';\n\nconst Tag = memo<TagProps>(\n ({\n children,\n className,\n classNames,\n closable,\n closeIcon,\n color,\n icon,\n onClick,\n onClose,\n ref,\n shape = 'normal',\n size = 'middle',\n style,\n styles: customStyles,\n variant = 'filled',\n ...rest\n }) => {\n const [visible, setVisible] = useState(true);\n\n const colors = useMemo(() => {\n let textColor = cssVar.colorTextSecondary;\n let backgroundColor;\n let borderColor;\n const isBorderless = variant === 'borderless';\n const isFilled = variant === 'filled';\n const isSolid = variant === 'solid';\n const isPresetColor = color && presetColors.includes(color);\n const isPresetSystemColors = color && presetSystemColors.has(color);\n const isHexColor = color && color.startsWith('#');\n\n if (isPresetColor) {\n const solidBgColor = colorsPreset(color);\n textColor = isSolid ? safeReadableColor(solidBgColor) : colorsPreset(color, 'active');\n backgroundColor = isSolid\n ? solidBgColor\n : isBorderless\n ? 'transparent'\n : colorsPreset(color, 'fillTertiary');\n borderColor = isSolid\n ? solidBgColor\n : colorsPreset(color, isFilled ? 'fillQuaternary' : 'fillTertiary');\n }\n if (isPresetSystemColors) {\n const solidBgColor = colorsPresetSystem(color);\n textColor = isSolid ? safeReadableColor(solidBgColor) : colorsPresetSystem(color);\n backgroundColor = isSolid\n ? solidBgColor\n : isBorderless\n ? 'transparent'\n : colorsPresetSystem(color, 'fillTertiary');\n borderColor = isSolid\n ? solidBgColor\n : colorsPresetSystem(color, isFilled ? 'fillQuaternary' : 'fillTertiary');\n }\n if (isHexColor) {\n textColor = isSolid\n ? safeReadableColor(color)\n : isBorderless\n ? color\n : cssVar.colorBgLayout;\n backgroundColor = isSolid ? color : isBorderless ? 'transparent' : color;\n borderColor = isSolid ? color : borderColor;\n }\n\n return {\n backgroundColor,\n borderColor,\n textColor,\n };\n }, [color, variant]);\n\n if (!visible) return null;\n\n return (\n <span\n className={cx(variants({ shape, size, variant }), className, classNames?.root)}\n ref={ref}\n style={{\n background: colors.backgroundColor,\n borderColor: colors.borderColor,\n color: colors.textColor,\n cursor: onClick ? 'pointer' : undefined,\n ...style,\n ...customStyles?.root,\n }}\n onClick={onClick}\n {...rest}\n >\n {icon}\n {children}\n {closable && (\n <button\n aria-label=\"Close\"\n className={cx(styles.close, classNames?.closeIcon)}\n style={customStyles?.closeIcon}\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onClose?.(e);\n setVisible(false);\n }}\n >\n {closeIcon ?? <X size={
|
|
1
|
+
{"version":3,"file":"Tag.mjs","names":[],"sources":["../../../src/base-ui/Tag/Tag.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar, cx } from 'antd-style';\nimport { X } from 'lucide-react';\nimport { memo, useMemo, useState } from 'react';\n\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nimport { styles, variants } from './style';\nimport type { TagProps } from './type';\nimport { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from './utils';\n\nconst Tag = memo<TagProps>(\n ({\n children,\n className,\n classNames,\n closable,\n closeIcon,\n color,\n icon,\n onClick,\n onClose,\n ref,\n shape = 'normal',\n size = 'middle',\n style,\n styles: customStyles,\n variant = 'filled',\n ...rest\n }) => {\n const [visible, setVisible] = useState(true);\n\n const colors = useMemo(() => {\n let textColor = cssVar.colorTextSecondary;\n let backgroundColor;\n let borderColor;\n const isBorderless = variant === 'borderless';\n const isFilled = variant === 'filled';\n const isSolid = variant === 'solid';\n const isPresetColor = color && presetColors.includes(color);\n const isPresetSystemColors = color && presetSystemColors.has(color);\n const isHexColor = color && color.startsWith('#');\n\n if (isPresetColor) {\n const solidBgColor = colorsPreset(color);\n textColor = isSolid ? safeReadableColor(solidBgColor) : colorsPreset(color, 'active');\n backgroundColor = isSolid\n ? solidBgColor\n : isBorderless\n ? 'transparent'\n : colorsPreset(color, 'fillTertiary');\n borderColor = isSolid\n ? solidBgColor\n : colorsPreset(color, isFilled ? 'fillQuaternary' : 'fillTertiary');\n }\n if (isPresetSystemColors) {\n const solidBgColor = colorsPresetSystem(color);\n textColor = isSolid ? safeReadableColor(solidBgColor) : colorsPresetSystem(color);\n backgroundColor = isSolid\n ? solidBgColor\n : isBorderless\n ? 'transparent'\n : colorsPresetSystem(color, 'fillTertiary');\n borderColor = isSolid\n ? solidBgColor\n : colorsPresetSystem(color, isFilled ? 'fillQuaternary' : 'fillTertiary');\n }\n if (isHexColor) {\n textColor = isSolid\n ? safeReadableColor(color)\n : isBorderless\n ? color\n : cssVar.colorBgLayout;\n backgroundColor = isSolid ? color : isBorderless ? 'transparent' : color;\n borderColor = isSolid ? color : borderColor;\n }\n\n return {\n backgroundColor,\n borderColor,\n textColor,\n };\n }, [color, variant]);\n\n if (!visible) return null;\n\n return (\n <span\n className={cx(variants({ shape, size, variant }), className, classNames?.root)}\n ref={ref}\n style={{\n background: colors.backgroundColor,\n borderColor: colors.borderColor,\n color: colors.textColor,\n cursor: onClick ? 'pointer' : undefined,\n ...style,\n ...customStyles?.root,\n }}\n onClick={onClick}\n {...rest}\n >\n {icon}\n {children}\n {closable && (\n <button\n aria-label=\"Close\"\n className={cx(styles.close, classNames?.closeIcon)}\n style={customStyles?.closeIcon}\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onClose?.(e);\n setVisible(false);\n }}\n >\n {closeIcon ?? <X size={10} />}\n </button>\n )}\n </span>\n );\n },\n);\n\nTag.displayName = 'Tag';\n\nexport default Tag;\n"],"mappings":";;;;;;;;;AAYA,MAAM,MAAM,MACT,EACC,UACA,WACA,YACA,UACA,WACA,OACA,MACA,SACA,SACA,KACA,QAAQ,UACR,OAAO,UACP,OACA,QAAQ,cACR,UAAU,UACV,GAAG,WACC;CACJ,MAAM,CAAC,SAAS,cAAc,SAAS,IAAI;CAE3C,MAAM,SAAS,cAAc;EAC3B,IAAI,YAAY,OAAO;EACvB,IAAI;EACJ,IAAI;EACJ,MAAM,eAAe,YAAY;EACjC,MAAM,WAAW,YAAY;EAC7B,MAAM,UAAU,YAAY;EAC5B,MAAM,gBAAgB,SAAS,aAAa,SAAS,KAAK;EAC1D,MAAM,uBAAuB,SAAS,mBAAmB,IAAI,KAAK;EAClE,MAAM,aAAa,SAAS,MAAM,WAAW,GAAG;EAEhD,IAAI,eAAe;GACjB,MAAM,eAAe,aAAa,KAAK;GACvC,YAAY,UAAU,kBAAkB,YAAY,IAAI,aAAa,OAAO,QAAQ;GACpF,kBAAkB,UACd,eACA,eACE,gBACA,aAAa,OAAO,cAAc;GACxC,cAAc,UACV,eACA,aAAa,OAAO,WAAW,mBAAmB,cAAc;EACtE;EACA,IAAI,sBAAsB;GACxB,MAAM,eAAe,mBAAmB,KAAK;GAC7C,YAAY,UAAU,kBAAkB,YAAY,IAAI,mBAAmB,KAAK;GAChF,kBAAkB,UACd,eACA,eACE,gBACA,mBAAmB,OAAO,cAAc;GAC9C,cAAc,UACV,eACA,mBAAmB,OAAO,WAAW,mBAAmB,cAAc;EAC5E;EACA,IAAI,YAAY;GACd,YAAY,UACR,kBAAkB,KAAK,IACvB,eACE,QACA,OAAO;GACb,kBAAkB,UAAU,QAAQ,eAAe,gBAAgB;GACnE,cAAc,UAAU,QAAQ;EAClC;EAEA,OAAO;GACL;GACA;GACA;EACF;CACF,GAAG,CAAC,OAAO,OAAO,CAAC;CAEnB,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,qBAAC,QAAD;EACE,WAAW,GAAG,SAAS;GAAE;GAAO;GAAM;EAAQ,CAAC,GAAG,WAAW,YAAY,IAAI;EACxE;EACL,OAAO;GACL,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,OAAO,OAAO;GACd,QAAQ,UAAU,YAAY,KAAA;GAC9B,GAAG;GACH,GAAG,cAAc;EACnB;EACS;EACT,GAAI;EAZN,UAAA;GAcG;GACA;GACA,YACC,oBAAC,UAAD;IACE,cAAW;IACX,WAAW,GAAG,OAAO,OAAO,YAAY,SAAS;IACjD,OAAO,cAAc;IACrB,MAAK;IACL,UAAU,MAAM;KACd,EAAE,gBAAgB;KAClB,UAAU,CAAC;KACX,WAAW,KAAK;IAClB;IAEC,UAAA,aAAa,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;GACtB,CAAA;EAEN;;AAEV,CACF;AAEA,IAAI,cAAc"}
|
package/es/base-ui/Tag/style.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { staticStylish } from "../../styles/theme/customStylishStatic.mjs";
|
|
|
2
2
|
import { createStaticStyles } from "antd-style";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
//#region src/base-ui/Tag/style.ts
|
|
5
|
-
const styles = createStaticStyles(({ css }) => ({
|
|
5
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
6
6
|
borderless: staticStylish.variantBorderlessWithoutHover,
|
|
7
7
|
close: css`
|
|
8
8
|
cursor: pointer;
|
|
@@ -16,9 +16,13 @@ const styles = createStaticStyles(({ css }) => ({
|
|
|
16
16
|
padding: 0;
|
|
17
17
|
border: none;
|
|
18
18
|
|
|
19
|
-
color:
|
|
19
|
+
color: ${cssVar.colorIcon};
|
|
20
20
|
|
|
21
21
|
background: none;
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
color: ${cssVar.colorTextHeading};
|
|
25
|
+
}
|
|
22
26
|
`,
|
|
23
27
|
filled: staticStylish.variantFilledWithoutHover,
|
|
24
28
|
large: css`
|
|
@@ -57,8 +61,9 @@ const styles = createStaticStyles(({ css }) => ({
|
|
|
57
61
|
width: fit-content;
|
|
58
62
|
margin: 0;
|
|
59
63
|
|
|
60
|
-
font-size:
|
|
64
|
+
font-size: ${cssVar.fontSizeSM};
|
|
61
65
|
line-height: 1.2;
|
|
66
|
+
white-space: nowrap;
|
|
62
67
|
|
|
63
68
|
span {
|
|
64
69
|
margin: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Tag/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css }) => ({\n borderless: lobeStaticStylish.variantBorderlessWithoutHover,\n close: css`\n cursor: pointer;\n\n display: inline-flex;\n gap: 0;\n align-items: center;\n justify-content: center;\n\n margin: 0;\n padding: 0;\n border: none;\n\n color:
|
|
1
|
+
{"version":3,"file":"style.mjs","names":["lobeStaticStylish"],"sources":["../../../src/base-ui/Tag/style.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\nimport { cva } from 'class-variance-authority';\n\nimport { lobeStaticStylish } from '@/styles';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n borderless: lobeStaticStylish.variantBorderlessWithoutHover,\n close: css`\n cursor: pointer;\n\n display: inline-flex;\n gap: 0;\n align-items: center;\n justify-content: center;\n\n margin: 0;\n padding: 0;\n border: none;\n\n color: ${cssVar.colorIcon};\n\n background: none;\n\n &:hover {\n color: ${cssVar.colorTextHeading};\n }\n `,\n filled: lobeStaticStylish.variantFilledWithoutHover,\n large: css`\n height: 28px;\n padding-inline: 12px;\n border-radius: 6px;\n `,\n middle: css`\n height: 22px;\n padding-inline: 8px;\n border-radius: 3px;\n `,\n outlined: lobeStaticStylish.variantOutlinedWithoutHover,\n round: css`\n && {\n border-radius: 999px;\n }\n `,\n roundLarge: css`\n padding-inline: 14px;\n `,\n roundMiddle: css`\n padding-inline: 10px;\n `,\n roundSmall: css`\n padding-inline: 8px;\n `,\n root: css`\n user-select: none;\n\n display: inline-flex;\n gap: 0.4em;\n align-items: center;\n justify-content: center;\n\n width: fit-content;\n margin: 0;\n\n font-size: ${cssVar.fontSizeSM};\n line-height: 1.2;\n white-space: nowrap;\n\n span {\n margin: 0;\n line-height: inherit;\n }\n `,\n small: css`\n height: 20px;\n padding-inline: 4px;\n border-radius: 3px;\n `,\n}));\n\nexport const variants = cva(styles.root, {\n compoundVariants: [\n {\n className: styles.roundSmall,\n shape: 'round',\n size: 'small',\n },\n {\n className: styles.roundMiddle,\n shape: 'round',\n size: 'middle',\n },\n {\n className: styles.roundLarge,\n shape: 'round',\n size: 'large',\n },\n ],\n defaultVariants: {\n shape: 'normal',\n size: 'middle',\n variant: 'filled',\n },\n variants: {\n shape: {\n normal: null,\n round: styles.round,\n },\n size: {\n large: styles.large,\n middle: styles.middle,\n small: styles.small,\n },\n variant: {\n borderless: styles.borderless,\n filled: styles.filled,\n outlined: styles.outlined,\n solid: styles.filled,\n },\n },\n});\n"],"mappings":";;;;AAKA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,YAAYA,cAAkB;CAC9B,OAAO,GAAG;;;;;;;;;;;;aAYC,OAAO,UAAU;;;;;eAKf,OAAO,iBAAiB;;;CAGrC,QAAQA,cAAkB;CAC1B,OAAO,GAAG;;;;;CAKV,QAAQ,GAAG;;;;;CAKX,UAAUA,cAAkB;CAC5B,OAAO,GAAG;;;;;CAKV,YAAY,GAAG;;;CAGf,aAAa,GAAG;;;CAGhB,YAAY,GAAG;;;CAGf,MAAM,GAAG;;;;;;;;;;;iBAWM,OAAO,WAAW;;;;;;;;;CASjC,OAAO,GAAG;;;;;AAKZ,EAAE;AAEF,MAAa,WAAW,IAAI,OAAO,MAAM;CACvC,kBAAkB;EAChB;GACE,WAAW,OAAO;GAClB,OAAO;GACP,MAAM;EACR;EACA;GACE,WAAW,OAAO;GAClB,OAAO;GACP,MAAM;EACR;EACA;GACE,WAAW,OAAO;GAClB,OAAO;GACP,MAAM;EACR;CACF;CACA,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,SAAS;CACX;CACA,UAAU;EACR,OAAO;GACL,QAAQ;GACR,OAAO,OAAO;EAChB;EACA,MAAM;GACJ,OAAO,OAAO;GACd,QAAQ,OAAO;GACf,OAAO,OAAO;EAChB;EACA,SAAS;GACP,YAAY,OAAO;GACnB,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,OAAO,OAAO;EAChB;CACF;AACF,CAAC"}
|
|
@@ -31,7 +31,7 @@ declare const variants: (props?: ({
|
|
|
31
31
|
italic?: boolean | null | undefined;
|
|
32
32
|
mark?: boolean | null | undefined;
|
|
33
33
|
strong?: boolean | null | undefined;
|
|
34
|
-
type?: "danger" | "
|
|
34
|
+
type?: "danger" | "warning" | "success" | "info" | "secondary" | null | undefined;
|
|
35
35
|
underline?: boolean | null | undefined;
|
|
36
36
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
37
37
|
//#endregion
|
package/es/base-ui/index.d.mts
CHANGED
|
@@ -2,6 +2,10 @@ import { TooltipGroupProps, TooltipPlacement, TooltipPopupComponentProps, Toolti
|
|
|
2
2
|
import { Tooltip } from "./Tooltip/Tooltip.mjs";
|
|
3
3
|
import TooltipGroup from "./Tooltip/TooltipGroup.mjs";
|
|
4
4
|
import "./Tooltip/index.mjs";
|
|
5
|
+
import { ActionIconClassNames, ActionIconProps, ActionIconSize, ActionIconStyles } from "./ActionIcon/type.mjs";
|
|
6
|
+
import ActionIcon from "./ActionIcon/ActionIcon.mjs";
|
|
7
|
+
import { styles as styles$1 } from "./ActionIcon/style.mjs";
|
|
8
|
+
import "./ActionIcon/index.mjs";
|
|
5
9
|
import { IconSpaceMode } from "../Menu/renderUtils.mjs";
|
|
6
10
|
import { renderDropdownMenuItems } from "./DropdownMenu/renderItems.mjs";
|
|
7
11
|
import { DropdownItem, DropdownMenuCheckboxItem, DropdownMenuPlacement, DropdownMenuProps, DropdownMenuSwitchItem as DropdownMenuSwitchItem$1 } from "./DropdownMenu/type.mjs";
|
|
@@ -35,10 +39,6 @@ import Accordion from "./Accordion/Accordion.mjs";
|
|
|
35
39
|
import { styles } from "./Accordion/style.mjs";
|
|
36
40
|
import { AccordionHeader, AccordionItem, AccordionPanel, AccordionRoot, AccordionTrigger, useAccordionContext } from "./Accordion/atoms.mjs";
|
|
37
41
|
import "./Accordion/index.mjs";
|
|
38
|
-
import { ActionIconClassNames, ActionIconProps, ActionIconSize, ActionIconStyles } from "./ActionIcon/type.mjs";
|
|
39
|
-
import ActionIcon from "./ActionIcon/ActionIcon.mjs";
|
|
40
|
-
import { styles as styles$1 } from "./ActionIcon/style.mjs";
|
|
41
|
-
import "./ActionIcon/index.mjs";
|
|
42
42
|
import { AlertClassNames, AlertCloseConfig, AlertProps, AlertRef, AlertStyles, AlertType, AlertVariant } from "./Alert/type.mjs";
|
|
43
43
|
import Alert from "./Alert/Alert.mjs";
|
|
44
44
|
import { styles as styles$2 } from "./Alert/style.mjs";
|