@lobehub/ui 5.56.0 → 5.57.1
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.
|
@@ -17,6 +17,11 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
17
17
|
}
|
|
18
18
|
`,
|
|
19
19
|
solid: css`
|
|
20
|
+
/* solid halves share one color, so the outline-merging overlap only adds a dark seam once each half is translucent (disabled) */
|
|
21
|
+
& > :where(button, a):last-of-type {
|
|
22
|
+
margin-inline-start: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
& > :where(button, a):last-of-type::before {
|
|
21
26
|
pointer-events: none;
|
|
22
27
|
content: '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.mjs","names":[],"sources":["../../../src/base-ui/Button/SplitButton.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, cx } from 'antd-style';\nimport { ChevronDownIcon } from 'lucide-react';\nimport { createContext, type CSSProperties, type ReactNode, use, useMemo } from 'react';\n\nimport { DropdownMenu, type DropdownMenuProps } from '@/base-ui/DropdownMenu';\n\nimport Button from './Button';\nimport type { ButtonProps } from './type';\n\ninterface SharedVisualProps {\n danger?: boolean;\n disabled?: boolean;\n loading?: boolean;\n size?: ButtonProps['size'];\n type?: ButtonProps['type'];\n}\n\ninterface SplitButtonProps extends SharedVisualProps {\n children: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\nconst SplitButtonContext = createContext<SharedVisualProps>({});\n\nconst styles = createStaticStyles(({ css, cssVar }) => ({\n interactionDisabled: css`\n opacity: 0.5;\n\n & > :where(button, a):disabled,\n & > :where(button, a)[aria-disabled='true'] {\n opacity: 1;\n }\n `,\n solid: css`\n & > :where(button, a):last-of-type::before {\n pointer-events: none;\n content: '';\n\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n\n width: 1px;\n\n opacity: 0.2;\n background: currentcolor;\n }\n `,\n solidDanger: css`\n &:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorErrorHover};\n background: ${cssVar.colorErrorHover};\n }\n\n &:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorErrorActive};\n background: ${cssVar.colorErrorActive};\n }\n `,\n solidPrimary: css`\n &:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorPrimaryHover};\n background: ${cssVar.colorPrimaryHover};\n }\n\n &:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorPrimaryActive};\n background: ${cssVar.colorPrimaryActive};\n }\n `,\n splitButton: css`\n display: inline-flex;\n flex-direction: row;\n\n & > :where(button, a):first-of-type {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n & > :where(button, a):last-of-type {\n margin-inline-start: -1px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n `,\n}));\n\nconst SplitButton = ({\n children,\n className,\n style,\n danger,\n disabled,\n loading,\n size,\n type,\n}: SplitButtonProps) => {\n const shared = useMemo<SharedVisualProps>(\n () => ({ danger, disabled, loading, size, type }),\n [danger, disabled, loading, size, type],\n );\n return (\n <SplitButtonContext value={shared}>\n <div\n style={style}\n className={cx(\n styles.splitButton,\n type === 'primary' && styles.solid,\n type === 'primary' && (danger ? styles.solidDanger : styles.solidPrimary),\n (disabled || loading) && styles.interactionDisabled,\n className,\n )}\n >\n {children}\n </div>\n </SplitButtonContext>\n );\n};\n\nconst SplitButtonMain = (props: ButtonProps) => {\n const shared = use(SplitButtonContext);\n return <Button {...shared} {...props} />;\n};\n\ninterface SplitButtonMenuProps extends Omit<DropdownMenuProps, 'children'> {\n icon?: ReactNode;\n}\n\nconst SplitButtonMenu = ({\n icon = <ChevronDownIcon size={14} />,\n disabled,\n ...menuProps\n}: SplitButtonMenuProps) => {\n const shared = use(SplitButtonContext);\n const interactionDisabled = disabled || shared.disabled || shared.loading;\n\n return (\n <DropdownMenu {...menuProps} disabled={interactionDisabled}>\n <Button {...shared} disabled={interactionDisabled} icon={icon} />\n </DropdownMenu>\n );\n};\n\ntype SplitButtonComponent = typeof SplitButton & {\n Main: typeof SplitButtonMain;\n Menu: typeof SplitButtonMenu;\n};\n\n(SplitButton as SplitButtonComponent).Main = SplitButtonMain;\n(SplitButton as SplitButtonComponent).Menu = SplitButtonMenu;\n\nexport type { SplitButtonMenuProps, SplitButtonProps };\nexport default SplitButton as SplitButtonComponent;\n"],"mappings":";;;;;;;;AAyBA,MAAM,qBAAqB,cAAiC,CAAC,CAAC;AAE9D,MAAM,SAAS,oBAAoB,EAAE,KAAK,cAAc;CACtD,qBAAqB,GAAG;;;;;;;;CAQxB,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"SplitButton.mjs","names":[],"sources":["../../../src/base-ui/Button/SplitButton.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, cx } from 'antd-style';\nimport { ChevronDownIcon } from 'lucide-react';\nimport { createContext, type CSSProperties, type ReactNode, use, useMemo } from 'react';\n\nimport { DropdownMenu, type DropdownMenuProps } from '@/base-ui/DropdownMenu';\n\nimport Button from './Button';\nimport type { ButtonProps } from './type';\n\ninterface SharedVisualProps {\n danger?: boolean;\n disabled?: boolean;\n loading?: boolean;\n size?: ButtonProps['size'];\n type?: ButtonProps['type'];\n}\n\ninterface SplitButtonProps extends SharedVisualProps {\n children: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\nconst SplitButtonContext = createContext<SharedVisualProps>({});\n\nconst styles = createStaticStyles(({ css, cssVar }) => ({\n interactionDisabled: css`\n opacity: 0.5;\n\n & > :where(button, a):disabled,\n & > :where(button, a)[aria-disabled='true'] {\n opacity: 1;\n }\n `,\n solid: css`\n /* solid halves share one color, so the outline-merging overlap only adds a dark seam once each half is translucent (disabled) */\n & > :where(button, a):last-of-type {\n margin-inline-start: 0;\n }\n\n & > :where(button, a):last-of-type::before {\n pointer-events: none;\n content: '';\n\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n\n width: 1px;\n\n opacity: 0.2;\n background: currentcolor;\n }\n `,\n solidDanger: css`\n &:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorErrorHover};\n background: ${cssVar.colorErrorHover};\n }\n\n &:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorErrorActive};\n background: ${cssVar.colorErrorActive};\n }\n `,\n solidPrimary: css`\n &:has(> :where(button, a):hover:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorPrimaryHover};\n background: ${cssVar.colorPrimaryHover};\n }\n\n &:has(> :where(button, a):active:not(:disabled, [aria-disabled='true'])) > :where(button, a) {\n border-color: ${cssVar.colorPrimaryActive};\n background: ${cssVar.colorPrimaryActive};\n }\n `,\n splitButton: css`\n display: inline-flex;\n flex-direction: row;\n\n & > :where(button, a):first-of-type {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n & > :where(button, a):last-of-type {\n margin-inline-start: -1px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n `,\n}));\n\nconst SplitButton = ({\n children,\n className,\n style,\n danger,\n disabled,\n loading,\n size,\n type,\n}: SplitButtonProps) => {\n const shared = useMemo<SharedVisualProps>(\n () => ({ danger, disabled, loading, size, type }),\n [danger, disabled, loading, size, type],\n );\n return (\n <SplitButtonContext value={shared}>\n <div\n style={style}\n className={cx(\n styles.splitButton,\n type === 'primary' && styles.solid,\n type === 'primary' && (danger ? styles.solidDanger : styles.solidPrimary),\n (disabled || loading) && styles.interactionDisabled,\n className,\n )}\n >\n {children}\n </div>\n </SplitButtonContext>\n );\n};\n\nconst SplitButtonMain = (props: ButtonProps) => {\n const shared = use(SplitButtonContext);\n return <Button {...shared} {...props} />;\n};\n\ninterface SplitButtonMenuProps extends Omit<DropdownMenuProps, 'children'> {\n icon?: ReactNode;\n}\n\nconst SplitButtonMenu = ({\n icon = <ChevronDownIcon size={14} />,\n disabled,\n ...menuProps\n}: SplitButtonMenuProps) => {\n const shared = use(SplitButtonContext);\n const interactionDisabled = disabled || shared.disabled || shared.loading;\n\n return (\n <DropdownMenu {...menuProps} disabled={interactionDisabled}>\n <Button {...shared} disabled={interactionDisabled} icon={icon} />\n </DropdownMenu>\n );\n};\n\ntype SplitButtonComponent = typeof SplitButton & {\n Main: typeof SplitButtonMain;\n Menu: typeof SplitButtonMenu;\n};\n\n(SplitButton as SplitButtonComponent).Main = SplitButtonMain;\n(SplitButton as SplitButtonComponent).Menu = SplitButtonMenu;\n\nexport type { SplitButtonMenuProps, SplitButtonProps };\nexport default SplitButton as SplitButtonComponent;\n"],"mappings":";;;;;;;;AAyBA,MAAM,qBAAqB,cAAiC,CAAC,CAAC;AAE9D,MAAM,SAAS,oBAAoB,EAAE,KAAK,cAAc;CACtD,qBAAqB,GAAG;;;;;;;;CAQxB,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;CAoBV,aAAa,GAAG;;sBAEI,OAAO,gBAAgB;oBACzB,OAAO,gBAAgB;;;;sBAIrB,OAAO,iBAAiB;oBAC1B,OAAO,iBAAiB;;;CAG1C,cAAc,GAAG;;sBAEG,OAAO,kBAAkB;oBAC3B,OAAO,kBAAkB;;;;sBAIvB,OAAO,mBAAmB;oBAC5B,OAAO,mBAAmB;;;CAG5C,aAAa,GAAG;;;;;;;;;;;;;;;AAelB,EAAE;AAEF,MAAM,eAAe,EACnB,UACA,WACA,OACA,QACA,UACA,SACA,MACA,WACsB;CACtB,MAAM,SAAS,eACN;EAAE;EAAQ;EAAU;EAAS;EAAM;CAAK,IAC/C;EAAC;EAAQ;EAAU;EAAS;EAAM;CAAI,CACxC;CACA,OACE,oBAAC,oBAAD;EAAoB,OAAO;EACzB,UAAA,oBAAC,OAAD;GACS;GACP,WAAW,GACT,OAAO,aACP,SAAS,aAAa,OAAO,OAC7B,SAAS,cAAc,SAAS,OAAO,cAAc,OAAO,gBAC3D,YAAY,YAAY,OAAO,qBAChC,SACF;GAEC;EACE,CAAA;CACa,CAAA;AAExB;AAEA,MAAM,mBAAmB,UAAuB;CAC9C,MAAM,SAAS,IAAI,kBAAkB;CACrC,OAAO,oBAAC,QAAD;EAAQ,GAAI;EAAQ,GAAI;CAAQ,CAAA;AACzC;AAMA,MAAM,mBAAmB,EACvB,OAAO,oBAAC,iBAAD,EAAiB,MAAM,GAAK,CAAA,GACnC,UACA,GAAG,gBACuB;CAC1B,MAAM,SAAS,IAAI,kBAAkB;CACrC,MAAM,sBAAsB,YAAY,OAAO,YAAY,OAAO;CAElE,OACE,oBAAC,cAAD;EAAc,GAAI;EAAW,UAAU;EACrC,UAAA,oBAAC,QAAD;GAAQ,GAAI;GAAQ,UAAU;GAA2B;EAAO,CAAA;CACpD,CAAA;AAElB;AAOA,YAAsC,OAAO;AAC7C,YAAsC,OAAO"}
|
package/es/eslint/index.mjs
CHANGED
|
@@ -76,6 +76,21 @@ const DEPRECATED_ANTD_ONLY = [
|
|
|
76
76
|
"Typography",
|
|
77
77
|
"Upload"
|
|
78
78
|
];
|
|
79
|
+
const DEPRECATED_FORM_EXPORTS = [
|
|
80
|
+
"Form",
|
|
81
|
+
"FormDivider",
|
|
82
|
+
"FormFlatGroup",
|
|
83
|
+
"FormFooter",
|
|
84
|
+
"FormGroup",
|
|
85
|
+
"FormGroupItemType",
|
|
86
|
+
"FormInstance",
|
|
87
|
+
"FormItem",
|
|
88
|
+
"FormItemProps",
|
|
89
|
+
"FormModal",
|
|
90
|
+
"FormModalProps",
|
|
91
|
+
"FormProps"
|
|
92
|
+
];
|
|
93
|
+
const FORM_MIGRATION_MESSAGE = "Use `Form`, `useForm` and their types from \"@lobehub/ui/base-ui/form\" instead.";
|
|
79
94
|
const DEPRECATED_ANTD_COMPONENT_PATHS = [
|
|
80
95
|
"antd/es/alert",
|
|
81
96
|
"antd/es/alert/*",
|
|
@@ -241,6 +256,16 @@ const restrictedImports = { rules: { "no-restricted-imports": ["error", {
|
|
|
241
256
|
message: "The antd-based wrapper is deprecated. Import from \"@lobehub/ui/base-ui\" instead.",
|
|
242
257
|
name: "@lobehub/ui"
|
|
243
258
|
},
|
|
259
|
+
{
|
|
260
|
+
importNames: DEPRECATED_FORM_EXPORTS,
|
|
261
|
+
message: FORM_MIGRATION_MESSAGE,
|
|
262
|
+
name: "@lobehub/ui"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
importNames: DEPRECATED_FORM_EXPORTS,
|
|
266
|
+
message: FORM_MIGRATION_MESSAGE,
|
|
267
|
+
name: "antd"
|
|
268
|
+
},
|
|
244
269
|
{
|
|
245
270
|
importNames: ["createStyles"],
|
|
246
271
|
message: "`createStyles` is banned in this project. Use `createStaticStyles` from \"antd-style\" instead.",
|
|
@@ -271,6 +296,14 @@ const restrictedImports = { rules: { "no-restricted-imports": ["error", {
|
|
|
271
296
|
}
|
|
272
297
|
],
|
|
273
298
|
patterns: [{
|
|
299
|
+
group: [
|
|
300
|
+
"antd/es/form",
|
|
301
|
+
"antd/es/form/*",
|
|
302
|
+
"antd/lib/form",
|
|
303
|
+
"antd/lib/form/*"
|
|
304
|
+
],
|
|
305
|
+
message: FORM_MIGRATION_MESSAGE
|
|
306
|
+
}, {
|
|
274
307
|
group: DEPRECATED_ANTD_COMPONENT_PATHS,
|
|
275
308
|
message: "Direct antd component import is deprecated. Import from \"@lobehub/ui/base-ui\" instead."
|
|
276
309
|
}]
|
package/es/eslint/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/eslint/index.ts"],"sourcesContent":["import { noInlineFormSchema } from './noInlineFormSchema';\n\nconst DEPRECATED_UI_COMPONENTS = [\n 'Accordion',\n 'AccordionItem',\n 'ActionIcon',\n 'Alert',\n 'AutoComplete',\n 'Avatar',\n 'AvatarGroup',\n 'Burger',\n 'Button',\n 'Checkbox',\n 'CheckboxGroup',\n 'Collapse',\n 'DatePicker',\n 'DraggablePanel',\n 'DraggablePanelBody',\n 'DraggablePanelContainer',\n 'DraggablePanelFooter',\n 'DraggablePanelHeader',\n 'Drawer',\n 'Dropdown',\n 'FormSubmitFooter',\n 'FormTitle',\n 'Input',\n 'InputNumber',\n 'InputOPT',\n 'InputPassword',\n 'Modal',\n 'ModalHost',\n 'Radio',\n 'RadioGroup',\n 'Segmented',\n 'Select',\n 'Skeleton',\n 'SkeletonAvatar',\n 'SkeletonBlock',\n 'SkeletonButton',\n 'SkeletonParagraph',\n 'SkeletonTags',\n 'SkeletonTitle',\n 'Slider',\n 'SliderWithInput',\n 'Switch',\n 'Tabs',\n 'Tag',\n 'Text',\n 'TextArea',\n 'Tree',\n];\n\nconst DEPRECATED_ANTD_ONLY = [\n 'Anchor',\n 'Badge',\n 'Breadcrumb',\n 'Card',\n 'Carousel',\n 'ColorPicker',\n 'Descriptions',\n 'Divider',\n 'Empty',\n 'FloatButton',\n 'List',\n 'Menu',\n 'Pagination',\n 'Popover',\n 'Progress',\n 'QRCode',\n 'Rate',\n 'Result',\n 'Spin',\n 'Statistic',\n 'Steps',\n 'Table',\n 'Tooltip',\n 'Typography',\n 'Upload',\n];\n\nconst DEPRECATED_ANTD_COMPONENT_PATHS = [\n 'antd/es/alert',\n 'antd/es/alert/*',\n 'antd/es/anchor',\n 'antd/es/anchor/*',\n 'antd/es/auto-complete',\n 'antd/es/auto-complete/*',\n 'antd/es/badge',\n 'antd/es/badge/*',\n 'antd/es/breadcrumb',\n 'antd/es/breadcrumb/*',\n 'antd/es/card',\n 'antd/es/card/*',\n 'antd/es/carousel',\n 'antd/es/carousel/*',\n 'antd/es/checkbox',\n 'antd/es/checkbox/*',\n 'antd/es/collapse',\n 'antd/es/collapse/*',\n 'antd/es/color-picker',\n 'antd/es/color-picker/*',\n 'antd/es/date-picker',\n 'antd/es/date-picker/*',\n 'antd/es/descriptions',\n 'antd/es/descriptions/*',\n 'antd/es/divider',\n 'antd/es/divider/*',\n 'antd/es/dropdown',\n 'antd/es/dropdown/*',\n 'antd/es/empty',\n 'antd/es/empty/*',\n 'antd/es/float-button',\n 'antd/es/float-button/*',\n 'antd/es/input',\n 'antd/es/input-number',\n 'antd/es/input-number/*',\n 'antd/es/input/*',\n 'antd/es/list',\n 'antd/es/list/*',\n 'antd/es/message',\n 'antd/es/message/*',\n 'antd/es/notification',\n 'antd/es/notification/*',\n 'antd/es/pagination',\n 'antd/es/pagination/*',\n 'antd/es/popover',\n 'antd/es/popover/*',\n 'antd/es/progress',\n 'antd/es/progress/*',\n 'antd/es/qr-code',\n 'antd/es/qr-code/*',\n 'antd/es/radio',\n 'antd/es/radio/*',\n 'antd/es/rate',\n 'antd/es/rate/*',\n 'antd/es/result',\n 'antd/es/result/*',\n 'antd/es/skeleton',\n 'antd/es/skeleton/*',\n 'antd/es/slider',\n 'antd/es/slider/*',\n 'antd/es/spin',\n 'antd/es/spin/*',\n 'antd/es/statistic',\n 'antd/es/statistic/*',\n 'antd/es/steps',\n 'antd/es/steps/*',\n 'antd/es/switch',\n 'antd/es/switch/*',\n 'antd/es/table',\n 'antd/es/table/*',\n 'antd/es/tooltip',\n 'antd/es/tooltip/*',\n 'antd/es/tree',\n 'antd/es/tree/*',\n 'antd/es/typography',\n 'antd/es/typography/*',\n 'antd/es/upload',\n 'antd/es/upload/*',\n 'antd/lib/alert',\n 'antd/lib/alert/*',\n 'antd/lib/anchor',\n 'antd/lib/anchor/*',\n 'antd/lib/auto-complete',\n 'antd/lib/auto-complete/*',\n 'antd/lib/badge',\n 'antd/lib/badge/*',\n 'antd/lib/breadcrumb',\n 'antd/lib/breadcrumb/*',\n 'antd/lib/card',\n 'antd/lib/card/*',\n 'antd/lib/carousel',\n 'antd/lib/carousel/*',\n 'antd/lib/checkbox',\n 'antd/lib/checkbox/*',\n 'antd/lib/collapse',\n 'antd/lib/collapse/*',\n 'antd/lib/color-picker',\n 'antd/lib/color-picker/*',\n 'antd/lib/date-picker',\n 'antd/lib/date-picker/*',\n 'antd/lib/descriptions',\n 'antd/lib/descriptions/*',\n 'antd/lib/divider',\n 'antd/lib/divider/*',\n 'antd/lib/dropdown',\n 'antd/lib/dropdown/*',\n 'antd/lib/empty',\n 'antd/lib/empty/*',\n 'antd/lib/float-button',\n 'antd/lib/float-button/*',\n 'antd/lib/input',\n 'antd/lib/input-number',\n 'antd/lib/input-number/*',\n 'antd/lib/input/*',\n 'antd/lib/list',\n 'antd/lib/list/*',\n 'antd/lib/message',\n 'antd/lib/message/*',\n 'antd/lib/notification',\n 'antd/lib/notification/*',\n 'antd/lib/pagination',\n 'antd/lib/pagination/*',\n 'antd/lib/popover',\n 'antd/lib/popover/*',\n 'antd/lib/progress',\n 'antd/lib/progress/*',\n 'antd/lib/qr-code',\n 'antd/lib/qr-code/*',\n 'antd/lib/radio',\n 'antd/lib/radio/*',\n 'antd/lib/rate',\n 'antd/lib/rate/*',\n 'antd/lib/result',\n 'antd/lib/result/*',\n 'antd/lib/skeleton',\n 'antd/lib/skeleton/*',\n 'antd/lib/slider',\n 'antd/lib/slider/*',\n 'antd/lib/spin',\n 'antd/lib/spin/*',\n 'antd/lib/statistic',\n 'antd/lib/statistic/*',\n 'antd/lib/steps',\n 'antd/lib/steps/*',\n 'antd/lib/switch',\n 'antd/lib/switch/*',\n 'antd/lib/table',\n 'antd/lib/table/*',\n 'antd/lib/tooltip',\n 'antd/lib/tooltip/*',\n 'antd/lib/tree',\n 'antd/lib/tree/*',\n 'antd/lib/typography',\n 'antd/lib/typography/*',\n 'antd/lib/upload',\n 'antd/lib/upload/*',\n];\n\nexport const restrictedImports = {\n rules: {\n 'no-restricted-imports': [\n 'error',\n {\n paths: [\n {\n importNames: DEPRECATED_UI_COMPONENTS,\n message:\n 'The antd-based wrapper is deprecated. Import from \"@lobehub/ui/base-ui\" instead.',\n name: '@lobehub/ui',\n },\n {\n importNames: ['createStyles'],\n message:\n '`createStyles` is banned in this project. Use `createStaticStyles` from \"antd-style\" instead.',\n name: 'antd-style',\n },\n {\n importNames: [...DEPRECATED_UI_COMPONENTS, ...DEPRECATED_ANTD_ONLY],\n message: 'Direct antd import is deprecated. Import from \"@lobehub/ui/base-ui\" instead.',\n name: 'antd',\n },\n {\n importNames: ['message', 'notification'],\n message: 'antd feedback APIs are deprecated. Use `toast` from \"@lobehub/ui/base-ui\".',\n name: 'antd',\n },\n {\n importNames: ['LoadingOutlined'],\n message: 'Use `Spin` from \"@lobehub/ui/base-ui\" instead of a hand-rolled spinner.',\n name: '@ant-design/icons',\n },\n {\n message: 'Use `Spin variant=\"network\"` from \"@lobehub/ui/base-ui\" instead.',\n name: 'thinking-orbs',\n },\n {\n message:\n 'ProComponents are deprecated. Use `Table` from \"@lobehub/ui/base-ui\" instead.',\n name: '@ant-design/pro-components',\n },\n ],\n patterns: [\n {\n group: DEPRECATED_ANTD_COMPONENT_PATHS,\n message:\n 'Direct antd component import is deprecated. Import from \"@lobehub/ui/base-ui\" instead.',\n },\n ],\n },\n ],\n },\n};\n\nexport const formSchemaRules = {\n plugins: {\n '@lobehub/ui': { rules: { 'no-inline-form-schema': noInlineFormSchema } },\n },\n rules: {\n '@lobehub/ui/no-inline-form-schema': 'warn',\n },\n};\n\nexport default [restrictedImports, formSchemaRules];\n"],"mappings":";;AAEA,MAAM,2BAA2B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,kCAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,oBAAoB,EAC/B,OAAO,EACL,yBAAyB,CACvB,SACA;CACE,OAAO;EACL;GACE,aAAa;GACb,SACE;GACF,MAAM;EACR;EACA;GACE,aAAa,CAAC,cAAc;GAC5B,SACE;GACF,MAAM;EACR;EACA;GACE,aAAa,CAAC,GAAG,0BAA0B,GAAG,oBAAoB;GAClE,SAAS;GACT,MAAM;EACR;EACA;GACE,aAAa,CAAC,WAAW,cAAc;GACvC,SAAS;GACT,MAAM;EACR;EACA;GACE,aAAa,CAAC,iBAAiB;GAC/B,SAAS;GACT,MAAM;EACR;EACA;GACE,SAAS;GACT,MAAM;EACR;EACA;GACE,SACE;GACF,MAAM;EACR;CACF;CACA,UAAU,CACR;EACE,OAAO;EACP,SACE;CACJ,CACF;AACF,CACF,EACF,EACF;AAEA,MAAa,kBAAkB;CAC7B,SAAS,EACP,eAAe,EAAE,OAAO,EAAE,yBAAyB,mBAAmB,EAAE,EAC1E;CACA,OAAO,EACL,qCAAqC,OACvC;AACF;AAEA,IAAA,iBAAe,CAAC,mBAAmB,eAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/eslint/index.ts"],"sourcesContent":["import { noInlineFormSchema } from './noInlineFormSchema';\n\nconst DEPRECATED_UI_COMPONENTS = [\n 'Accordion',\n 'AccordionItem',\n 'ActionIcon',\n 'Alert',\n 'AutoComplete',\n 'Avatar',\n 'AvatarGroup',\n 'Burger',\n 'Button',\n 'Checkbox',\n 'CheckboxGroup',\n 'Collapse',\n 'DatePicker',\n 'DraggablePanel',\n 'DraggablePanelBody',\n 'DraggablePanelContainer',\n 'DraggablePanelFooter',\n 'DraggablePanelHeader',\n 'Drawer',\n 'Dropdown',\n 'FormSubmitFooter',\n 'FormTitle',\n 'Input',\n 'InputNumber',\n 'InputOPT',\n 'InputPassword',\n 'Modal',\n 'ModalHost',\n 'Radio',\n 'RadioGroup',\n 'Segmented',\n 'Select',\n 'Skeleton',\n 'SkeletonAvatar',\n 'SkeletonBlock',\n 'SkeletonButton',\n 'SkeletonParagraph',\n 'SkeletonTags',\n 'SkeletonTitle',\n 'Slider',\n 'SliderWithInput',\n 'Switch',\n 'Tabs',\n 'Tag',\n 'Text',\n 'TextArea',\n 'Tree',\n];\n\nconst DEPRECATED_ANTD_ONLY = [\n 'Anchor',\n 'Badge',\n 'Breadcrumb',\n 'Card',\n 'Carousel',\n 'ColorPicker',\n 'Descriptions',\n 'Divider',\n 'Empty',\n 'FloatButton',\n 'List',\n 'Menu',\n 'Pagination',\n 'Popover',\n 'Progress',\n 'QRCode',\n 'Rate',\n 'Result',\n 'Spin',\n 'Statistic',\n 'Steps',\n 'Table',\n 'Tooltip',\n 'Typography',\n 'Upload',\n];\n\nconst DEPRECATED_FORM_EXPORTS = [\n 'Form',\n 'FormDivider',\n 'FormFlatGroup',\n 'FormFooter',\n 'FormGroup',\n 'FormGroupItemType',\n 'FormInstance',\n 'FormItem',\n 'FormItemProps',\n 'FormModal',\n 'FormModalProps',\n 'FormProps',\n];\n\nconst FORM_MIGRATION_MESSAGE =\n 'Use `Form`, `useForm` and their types from \"@lobehub/ui/base-ui/form\" instead.';\n\nconst DEPRECATED_ANTD_COMPONENT_PATHS = [\n 'antd/es/alert',\n 'antd/es/alert/*',\n 'antd/es/anchor',\n 'antd/es/anchor/*',\n 'antd/es/auto-complete',\n 'antd/es/auto-complete/*',\n 'antd/es/badge',\n 'antd/es/badge/*',\n 'antd/es/breadcrumb',\n 'antd/es/breadcrumb/*',\n 'antd/es/card',\n 'antd/es/card/*',\n 'antd/es/carousel',\n 'antd/es/carousel/*',\n 'antd/es/checkbox',\n 'antd/es/checkbox/*',\n 'antd/es/collapse',\n 'antd/es/collapse/*',\n 'antd/es/color-picker',\n 'antd/es/color-picker/*',\n 'antd/es/date-picker',\n 'antd/es/date-picker/*',\n 'antd/es/descriptions',\n 'antd/es/descriptions/*',\n 'antd/es/divider',\n 'antd/es/divider/*',\n 'antd/es/dropdown',\n 'antd/es/dropdown/*',\n 'antd/es/empty',\n 'antd/es/empty/*',\n 'antd/es/float-button',\n 'antd/es/float-button/*',\n 'antd/es/input',\n 'antd/es/input-number',\n 'antd/es/input-number/*',\n 'antd/es/input/*',\n 'antd/es/list',\n 'antd/es/list/*',\n 'antd/es/message',\n 'antd/es/message/*',\n 'antd/es/notification',\n 'antd/es/notification/*',\n 'antd/es/pagination',\n 'antd/es/pagination/*',\n 'antd/es/popover',\n 'antd/es/popover/*',\n 'antd/es/progress',\n 'antd/es/progress/*',\n 'antd/es/qr-code',\n 'antd/es/qr-code/*',\n 'antd/es/radio',\n 'antd/es/radio/*',\n 'antd/es/rate',\n 'antd/es/rate/*',\n 'antd/es/result',\n 'antd/es/result/*',\n 'antd/es/skeleton',\n 'antd/es/skeleton/*',\n 'antd/es/slider',\n 'antd/es/slider/*',\n 'antd/es/spin',\n 'antd/es/spin/*',\n 'antd/es/statistic',\n 'antd/es/statistic/*',\n 'antd/es/steps',\n 'antd/es/steps/*',\n 'antd/es/switch',\n 'antd/es/switch/*',\n 'antd/es/table',\n 'antd/es/table/*',\n 'antd/es/tooltip',\n 'antd/es/tooltip/*',\n 'antd/es/tree',\n 'antd/es/tree/*',\n 'antd/es/typography',\n 'antd/es/typography/*',\n 'antd/es/upload',\n 'antd/es/upload/*',\n 'antd/lib/alert',\n 'antd/lib/alert/*',\n 'antd/lib/anchor',\n 'antd/lib/anchor/*',\n 'antd/lib/auto-complete',\n 'antd/lib/auto-complete/*',\n 'antd/lib/badge',\n 'antd/lib/badge/*',\n 'antd/lib/breadcrumb',\n 'antd/lib/breadcrumb/*',\n 'antd/lib/card',\n 'antd/lib/card/*',\n 'antd/lib/carousel',\n 'antd/lib/carousel/*',\n 'antd/lib/checkbox',\n 'antd/lib/checkbox/*',\n 'antd/lib/collapse',\n 'antd/lib/collapse/*',\n 'antd/lib/color-picker',\n 'antd/lib/color-picker/*',\n 'antd/lib/date-picker',\n 'antd/lib/date-picker/*',\n 'antd/lib/descriptions',\n 'antd/lib/descriptions/*',\n 'antd/lib/divider',\n 'antd/lib/divider/*',\n 'antd/lib/dropdown',\n 'antd/lib/dropdown/*',\n 'antd/lib/empty',\n 'antd/lib/empty/*',\n 'antd/lib/float-button',\n 'antd/lib/float-button/*',\n 'antd/lib/input',\n 'antd/lib/input-number',\n 'antd/lib/input-number/*',\n 'antd/lib/input/*',\n 'antd/lib/list',\n 'antd/lib/list/*',\n 'antd/lib/message',\n 'antd/lib/message/*',\n 'antd/lib/notification',\n 'antd/lib/notification/*',\n 'antd/lib/pagination',\n 'antd/lib/pagination/*',\n 'antd/lib/popover',\n 'antd/lib/popover/*',\n 'antd/lib/progress',\n 'antd/lib/progress/*',\n 'antd/lib/qr-code',\n 'antd/lib/qr-code/*',\n 'antd/lib/radio',\n 'antd/lib/radio/*',\n 'antd/lib/rate',\n 'antd/lib/rate/*',\n 'antd/lib/result',\n 'antd/lib/result/*',\n 'antd/lib/skeleton',\n 'antd/lib/skeleton/*',\n 'antd/lib/slider',\n 'antd/lib/slider/*',\n 'antd/lib/spin',\n 'antd/lib/spin/*',\n 'antd/lib/statistic',\n 'antd/lib/statistic/*',\n 'antd/lib/steps',\n 'antd/lib/steps/*',\n 'antd/lib/switch',\n 'antd/lib/switch/*',\n 'antd/lib/table',\n 'antd/lib/table/*',\n 'antd/lib/tooltip',\n 'antd/lib/tooltip/*',\n 'antd/lib/tree',\n 'antd/lib/tree/*',\n 'antd/lib/typography',\n 'antd/lib/typography/*',\n 'antd/lib/upload',\n 'antd/lib/upload/*',\n];\n\nexport const restrictedImports = {\n rules: {\n 'no-restricted-imports': [\n 'error',\n {\n paths: [\n {\n importNames: DEPRECATED_UI_COMPONENTS,\n message:\n 'The antd-based wrapper is deprecated. Import from \"@lobehub/ui/base-ui\" instead.',\n name: '@lobehub/ui',\n },\n {\n importNames: DEPRECATED_FORM_EXPORTS,\n message: FORM_MIGRATION_MESSAGE,\n name: '@lobehub/ui',\n },\n {\n importNames: DEPRECATED_FORM_EXPORTS,\n message: FORM_MIGRATION_MESSAGE,\n name: 'antd',\n },\n {\n importNames: ['createStyles'],\n message:\n '`createStyles` is banned in this project. Use `createStaticStyles` from \"antd-style\" instead.',\n name: 'antd-style',\n },\n {\n importNames: [...DEPRECATED_UI_COMPONENTS, ...DEPRECATED_ANTD_ONLY],\n message: 'Direct antd import is deprecated. Import from \"@lobehub/ui/base-ui\" instead.',\n name: 'antd',\n },\n {\n importNames: ['message', 'notification'],\n message: 'antd feedback APIs are deprecated. Use `toast` from \"@lobehub/ui/base-ui\".',\n name: 'antd',\n },\n {\n importNames: ['LoadingOutlined'],\n message: 'Use `Spin` from \"@lobehub/ui/base-ui\" instead of a hand-rolled spinner.',\n name: '@ant-design/icons',\n },\n {\n message: 'Use `Spin variant=\"network\"` from \"@lobehub/ui/base-ui\" instead.',\n name: 'thinking-orbs',\n },\n {\n message:\n 'ProComponents are deprecated. Use `Table` from \"@lobehub/ui/base-ui\" instead.',\n name: '@ant-design/pro-components',\n },\n ],\n patterns: [\n {\n group: ['antd/es/form', 'antd/es/form/*', 'antd/lib/form', 'antd/lib/form/*'],\n message: FORM_MIGRATION_MESSAGE,\n },\n {\n group: DEPRECATED_ANTD_COMPONENT_PATHS,\n message:\n 'Direct antd component import is deprecated. Import from \"@lobehub/ui/base-ui\" instead.',\n },\n ],\n },\n ],\n },\n};\n\nexport const formSchemaRules = {\n plugins: {\n '@lobehub/ui': { rules: { 'no-inline-form-schema': noInlineFormSchema } },\n },\n rules: {\n '@lobehub/ui/no-inline-form-schema': 'warn',\n },\n};\n\nexport default [restrictedImports, formSchemaRules];\n"],"mappings":";;AAEA,MAAM,2BAA2B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,0BAA0B;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,yBACJ;AAEF,MAAM,kCAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,oBAAoB,EAC/B,OAAO,EACL,yBAAyB,CACvB,SACA;CACE,OAAO;EACL;GACE,aAAa;GACb,SACE;GACF,MAAM;EACR;EACA;GACE,aAAa;GACb,SAAS;GACT,MAAM;EACR;EACA;GACE,aAAa;GACb,SAAS;GACT,MAAM;EACR;EACA;GACE,aAAa,CAAC,cAAc;GAC5B,SACE;GACF,MAAM;EACR;EACA;GACE,aAAa,CAAC,GAAG,0BAA0B,GAAG,oBAAoB;GAClE,SAAS;GACT,MAAM;EACR;EACA;GACE,aAAa,CAAC,WAAW,cAAc;GACvC,SAAS;GACT,MAAM;EACR;EACA;GACE,aAAa,CAAC,iBAAiB;GAC/B,SAAS;GACT,MAAM;EACR;EACA;GACE,SAAS;GACT,MAAM;EACR;EACA;GACE,SACE;GACF,MAAM;EACR;CACF;CACA,UAAU,CACR;EACE,OAAO;GAAC;GAAgB;GAAkB;GAAiB;EAAiB;EAC5E,SAAS;CACX,GACA;EACE,OAAO;EACP,SACE;CACJ,CACF;AACF,CACF,EACF,EACF;AAEA,MAAa,kBAAkB;CAC7B,SAAS,EACP,eAAe,EAAE,OAAO,EAAE,yBAAyB,mBAAmB,EAAE,EAC1E;CACA,OAAO,EACL,qCAAqC,OACvC;AACF;AAEA,IAAA,iBAAe,CAAC,mBAAmB,eAAe"}
|