@superad/ui 0.1.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.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/es/Button/Button.d.mts +7 -0
- package/es/Button/Button.mjs +29 -0
- package/es/Button/Button.mjs.map +1 -0
- package/es/Button/index.d.mts +3 -0
- package/es/Button/index.d.ts +1 -0
- package/es/Button/index.js +1 -0
- package/es/Button/index.mjs +2 -0
- package/es/Button/style.mjs +33 -0
- package/es/Button/style.mjs.map +1 -0
- package/es/Button/type.d.mts +21 -0
- package/es/ConfigProvider/index.d.mts +9 -0
- package/es/ConfigProvider/index.d.ts +1 -0
- package/es/ConfigProvider/index.js +1 -0
- package/es/ConfigProvider/index.mjs +82 -0
- package/es/ConfigProvider/index.mjs.map +1 -0
- package/es/ConfigProvider/type.d.mts +24 -0
- package/es/DraggablePanel/DraggablePanel.d.mts +6 -0
- package/es/DraggablePanel/DraggablePanel.mjs +104 -0
- package/es/DraggablePanel/DraggablePanel.mjs.map +1 -0
- package/es/DraggablePanel/index.d.mts +3 -0
- package/es/DraggablePanel/index.d.ts +1 -0
- package/es/DraggablePanel/index.js +1 -0
- package/es/DraggablePanel/index.mjs +3 -0
- package/es/DraggablePanel/style.mjs +86 -0
- package/es/DraggablePanel/style.mjs.map +1 -0
- package/es/DraggablePanel/type.d.mts +27 -0
- package/es/Flex/Center.d.mts +7 -0
- package/es/Flex/Center.mjs +14 -0
- package/es/Flex/Center.mjs.map +1 -0
- package/es/Flex/FlexBasic.d.mts +6 -0
- package/es/Flex/FlexBasic.mjs +46 -0
- package/es/Flex/FlexBasic.mjs.map +1 -0
- package/es/Flex/Flexbox.d.mts +2 -0
- package/es/Flex/index.d.mts +5 -0
- package/es/Flex/index.d.ts +1 -0
- package/es/Flex/index.js +1 -0
- package/es/Flex/index.mjs +3 -0
- package/es/Flex/type.d.mts +35 -0
- package/es/Flex/utils.mjs +24 -0
- package/es/Flex/utils.mjs.map +1 -0
- package/es/FontLoader/index.d.mts +9 -0
- package/es/FontLoader/index.d.ts +1 -0
- package/es/FontLoader/index.js +1 -0
- package/es/FontLoader/index.mjs +23 -0
- package/es/FontLoader/index.mjs.map +1 -0
- package/es/GlobalFocusRing/index.d.mts +6 -0
- package/es/GlobalFocusRing/index.d.ts +1 -0
- package/es/GlobalFocusRing/index.js +1 -0
- package/es/GlobalFocusRing/index.mjs +204 -0
- package/es/GlobalFocusRing/index.mjs.map +1 -0
- package/es/GlobalFocusRing/style.mjs +35 -0
- package/es/GlobalFocusRing/style.mjs.map +1 -0
- package/es/Provider.d.mts +5 -0
- package/es/Table/canvas/canvasPalette.mjs +11 -0
- package/es/Table/canvas/canvasPalette.mjs.map +1 -0
- package/es/Table/canvas/chipPainters.mjs +408 -0
- package/es/Table/canvas/chipPainters.mjs.map +1 -0
- package/es/Table/canvas/controlPainters.mjs +193 -0
- package/es/Table/canvas/controlPainters.mjs.map +1 -0
- package/es/Table/canvas/groupTitle.mjs +181 -0
- package/es/Table/canvas/groupTitle.mjs.map +1 -0
- package/es/Table/canvas/paintUtils.mjs +70 -0
- package/es/Table/canvas/paintUtils.mjs.map +1 -0
- package/es/Table/canvas/rowSeries.mjs +130 -0
- package/es/Table/canvas/rowSeries.mjs.map +1 -0
- package/es/Table/canvas/textPainters.mjs +97 -0
- package/es/Table/canvas/textPainters.mjs.map +1 -0
- package/es/Table/canvas/theme.d.mts +14 -0
- package/es/Table/canvas/theme.mjs +276 -0
- package/es/Table/canvas/theme.mjs.map +1 -0
- package/es/Table/core/cellValue.d.mts +1 -0
- package/es/Table/core/cellValue.mjs +240 -0
- package/es/Table/core/cellValue.mjs.map +1 -0
- package/es/Table/core/rowSelection.mjs +138 -0
- package/es/Table/core/rowSelection.mjs.map +1 -0
- package/es/Table/core/size.mjs +60 -0
- package/es/Table/core/size.mjs.map +1 -0
- package/es/Table/core/tableI18n.d.mts +11 -0
- package/es/Table/core/tableI18n.mjs +123 -0
- package/es/Table/core/tableI18n.mjs.map +1 -0
- package/es/Table/core/tagTone.mjs +245 -0
- package/es/Table/core/tagTone.mjs.map +1 -0
- package/es/Table/core/zIndex.mjs +7 -0
- package/es/Table/core/zIndex.mjs.map +1 -0
- package/es/Table/index.d.mts +6 -0
- package/es/Table/index.d.ts +1 -0
- package/es/Table/index.js +1 -0
- package/es/Table/index.mjs +6 -0
- package/es/Table/react/Table.d.mts +9 -0
- package/es/Table/react/Table.mjs +407 -0
- package/es/Table/react/Table.mjs.map +1 -0
- package/es/Table/react/TableColumnSettings.mjs +65 -0
- package/es/Table/react/TableColumnSettings.mjs.map +1 -0
- package/es/Table/react/a11y.mjs +72 -0
- package/es/Table/react/a11y.mjs.map +1 -0
- package/es/Table/react/editors/base.mjs +427 -0
- package/es/Table/react/editors/base.mjs.map +1 -0
- package/es/Table/react/editors/inline.mjs +225 -0
- package/es/Table/react/editors/inline.mjs.map +1 -0
- package/es/Table/react/editors/picker.mjs +368 -0
- package/es/Table/react/editors/picker.mjs.map +1 -0
- package/es/Table/react/overlayChips.mjs +50 -0
- package/es/Table/react/overlayChips.mjs.map +1 -0
- package/es/Table/react/sameRenderInputs.mjs +50 -0
- package/es/Table/react/sameRenderInputs.mjs.map +1 -0
- package/es/Table/react/style.mjs +650 -0
- package/es/Table/react/style.mjs.map +1 -0
- package/es/Table/react/useTableCellEvents.mjs +32 -0
- package/es/Table/react/useTableCellEvents.mjs.map +1 -0
- package/es/Table/react/useTableColumnSettings.mjs +107 -0
- package/es/Table/react/useTableColumnSettings.mjs.map +1 -0
- package/es/Table/react/useTableEditorSync.mjs +41 -0
- package/es/Table/react/useTableEditorSync.mjs.map +1 -0
- package/es/Table/react/useTableHoverHint.mjs +62 -0
- package/es/Table/react/useTableHoverHint.mjs.map +1 -0
- package/es/Table/react/useTableKeyboard.mjs +41 -0
- package/es/Table/react/useTableKeyboard.mjs.map +1 -0
- package/es/Table/react/useTableRenderState.mjs +194 -0
- package/es/Table/react/useTableRenderState.mjs.map +1 -0
- package/es/Table/react/useTableScroll.mjs +33 -0
- package/es/Table/react/useTableScroll.mjs.map +1 -0
- package/es/Table/react/useTableSelectionInfo.mjs +48 -0
- package/es/Table/react/useTableSelectionInfo.mjs.map +1 -0
- package/es/Table/react/useTableVTableEvents.mjs +132 -0
- package/es/Table/react/useTableVTableEvents.mjs.map +1 -0
- package/es/Table/type.d.mts +279 -0
- package/es/Table/type.mjs +34 -0
- package/es/Table/type.mjs.map +1 -0
- package/es/Table/vtable/columns.d.mts +17 -0
- package/es/Table/vtable/columns.mjs +381 -0
- package/es/Table/vtable/columns.mjs.map +1 -0
- package/es/Table/vtable/frozenShadow.mjs +27 -0
- package/es/Table/vtable/frozenShadow.mjs.map +1 -0
- package/es/Table/vtable/interaction.mjs +175 -0
- package/es/Table/vtable/interaction.mjs.map +1 -0
- package/es/Table/vtable/option.d.mts +39 -0
- package/es/Table/vtable/option.mjs +232 -0
- package/es/Table/vtable/option.mjs.map +1 -0
- package/es/Table/vtable/seriesSelection.mjs +374 -0
- package/es/Table/vtable/seriesSelection.mjs.map +1 -0
- package/es/Table/vtable/vtableAdapter.mjs +96 -0
- package/es/Table/vtable/vtableAdapter.mjs.map +1 -0
- package/es/ThemeProvider/AppElementContext.d.mts +5 -0
- package/es/ThemeProvider/AppElementContext.mjs +10 -0
- package/es/ThemeProvider/AppElementContext.mjs.map +1 -0
- package/es/ThemeProvider/ConfigProvider.mjs +29 -0
- package/es/ThemeProvider/ConfigProvider.mjs.map +1 -0
- package/es/ThemeProvider/GlobalStyle/antdOverride.mjs +73 -0
- package/es/ThemeProvider/GlobalStyle/antdOverride.mjs.map +1 -0
- package/es/ThemeProvider/GlobalStyle/essential.mjs +50 -0
- package/es/ThemeProvider/GlobalStyle/essential.mjs.map +1 -0
- package/es/ThemeProvider/GlobalStyle/global.mjs +90 -0
- package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -0
- package/es/ThemeProvider/GlobalStyle/index.mjs +14 -0
- package/es/ThemeProvider/GlobalStyle/index.mjs.map +1 -0
- package/es/ThemeProvider/Meta.d.mts +7 -0
- package/es/ThemeProvider/Meta.mjs +48 -0
- package/es/ThemeProvider/Meta.mjs.map +1 -0
- package/es/ThemeProvider/ThemeProvider.d.mts +6 -0
- package/es/ThemeProvider/ThemeProvider.mjs +89 -0
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -0
- package/es/ThemeProvider/constants.d.mts +5 -0
- package/es/ThemeProvider/constants.mjs +6 -0
- package/es/ThemeProvider/constants.mjs.map +1 -0
- package/es/ThemeProvider/index.d.mts +6 -0
- package/es/ThemeProvider/index.d.ts +1 -0
- package/es/ThemeProvider/index.js +1 -0
- package/es/ThemeProvider/index.mjs +5 -0
- package/es/ThemeProvider/type.d.mts +48 -0
- package/es/_virtual/_rolldown/runtime.mjs +13 -0
- package/es/color/colors/blue.d.mts +6 -0
- package/es/color/colors/blue.mjs +67 -0
- package/es/color/colors/blue.mjs.map +1 -0
- package/es/color/colors/cyan.d.mts +6 -0
- package/es/color/colors/cyan.mjs +67 -0
- package/es/color/colors/cyan.mjs.map +1 -0
- package/es/color/colors/geekblue.d.mts +6 -0
- package/es/color/colors/geekblue.mjs +67 -0
- package/es/color/colors/geekblue.mjs.map +1 -0
- package/es/color/colors/gold.d.mts +6 -0
- package/es/color/colors/gold.mjs +67 -0
- package/es/color/colors/gold.mjs.map +1 -0
- package/es/color/colors/gray.d.mts +6 -0
- package/es/color/colors/gray.mjs +67 -0
- package/es/color/colors/gray.mjs.map +1 -0
- package/es/color/colors/green.d.mts +6 -0
- package/es/color/colors/green.mjs +67 -0
- package/es/color/colors/green.mjs.map +1 -0
- package/es/color/colors/index.d.mts +22 -0
- package/es/color/colors/index.mjs +35 -0
- package/es/color/colors/index.mjs.map +1 -0
- package/es/color/colors/lime.d.mts +6 -0
- package/es/color/colors/lime.mjs +67 -0
- package/es/color/colors/lime.mjs.map +1 -0
- package/es/color/colors/magenta.d.mts +6 -0
- package/es/color/colors/magenta.mjs +67 -0
- package/es/color/colors/magenta.mjs.map +1 -0
- package/es/color/colors/orange.d.mts +6 -0
- package/es/color/colors/orange.mjs +67 -0
- package/es/color/colors/orange.mjs.map +1 -0
- package/es/color/colors/primary.d.mts +6 -0
- package/es/color/colors/primary.mjs +67 -0
- package/es/color/colors/primary.mjs.map +1 -0
- package/es/color/colors/purple.d.mts +6 -0
- package/es/color/colors/purple.mjs +67 -0
- package/es/color/colors/purple.mjs.map +1 -0
- package/es/color/colors/red.d.mts +6 -0
- package/es/color/colors/red.mjs +67 -0
- package/es/color/colors/red.mjs.map +1 -0
- package/es/color/colors/volcano.d.mts +6 -0
- package/es/color/colors/volcano.mjs +67 -0
- package/es/color/colors/volcano.mjs.map +1 -0
- package/es/color/colors/yellow.d.mts +6 -0
- package/es/color/colors/yellow.mjs +67 -0
- package/es/color/colors/yellow.mjs.map +1 -0
- package/es/color/index.d.mts +23 -0
- package/es/color/index.d.ts +1 -0
- package/es/color/index.js +1 -0
- package/es/color/index.mjs +22 -0
- package/es/color/neutrals/index.d.mts +13 -0
- package/es/color/neutrals/index.mjs +17 -0
- package/es/color/neutrals/index.mjs.map +1 -0
- package/es/color/neutrals/mauve.d.mts +6 -0
- package/es/color/neutrals/mauve.mjs +67 -0
- package/es/color/neutrals/mauve.mjs.map +1 -0
- package/es/color/neutrals/olive.d.mts +6 -0
- package/es/color/neutrals/olive.mjs +67 -0
- package/es/color/neutrals/olive.mjs.map +1 -0
- package/es/color/neutrals/sage.d.mts +6 -0
- package/es/color/neutrals/sage.mjs +67 -0
- package/es/color/neutrals/sage.mjs.map +1 -0
- package/es/color/neutrals/sand.d.mts +6 -0
- package/es/color/neutrals/sand.mjs +67 -0
- package/es/color/neutrals/sand.mjs.map +1 -0
- package/es/color/neutrals/slate.d.mts +6 -0
- package/es/color/neutrals/slate.mjs +67 -0
- package/es/color/neutrals/slate.mjs.map +1 -0
- package/es/color/types.d.mts +16 -0
- package/es/eslint/index.d.mts +26 -0
- package/es/eslint/index.d.ts +1 -0
- package/es/eslint/index.js +1 -0
- package/es/eslint/index.mjs +11 -0
- package/es/eslint/index.mjs.map +1 -0
- package/es/hooks/useIsClient.d.mts +8 -0
- package/es/hooks/useIsClient.mjs +13 -0
- package/es/hooks/useIsClient.mjs.map +1 -0
- package/es/i18n/context.d.mts +7 -0
- package/es/i18n/context.mjs +16 -0
- package/es/i18n/context.mjs.map +1 -0
- package/es/i18n/index.d.mts +6 -0
- package/es/i18n/index.d.ts +1 -0
- package/es/i18n/index.js +1 -0
- package/es/i18n/index.mjs +5 -0
- package/es/i18n/resources/en/common.d.mts +35 -0
- package/es/i18n/resources/en/common.mjs +36 -0
- package/es/i18n/resources/en/common.mjs.map +1 -0
- package/es/i18n/resources/en/index.d.mts +7 -0
- package/es/i18n/resources/en/index.mjs +8 -0
- package/es/i18n/resources/en/index.mjs.map +1 -0
- package/es/i18n/resources/zhCn/common.d.mts +35 -0
- package/es/i18n/resources/zhCn/common.mjs +36 -0
- package/es/i18n/resources/zhCn/common.mjs.map +1 -0
- package/es/i18n/resources/zhCn/index.d.mts +7 -0
- package/es/i18n/resources/zhCn/index.mjs +8 -0
- package/es/i18n/resources/zhCn/index.mjs.map +1 -0
- package/es/i18n/types.d.mts +22 -0
- package/es/i18n/useTranslation.d.mts +12 -0
- package/es/i18n/useTranslation.mjs +22 -0
- package/es/i18n/useTranslation.mjs.map +1 -0
- package/es/index.d.mts +43 -0
- package/es/index.mjs +26 -0
- package/es/storybook/StoryBook/StoryBook.d.mts +7 -0
- package/es/storybook/StoryBook/StoryBook.mjs +52 -0
- package/es/storybook/StoryBook/StoryBook.mjs.map +1 -0
- package/es/storybook/StoryBook/index.d.mts +3 -0
- package/es/storybook/StoryBook/style.mjs +97 -0
- package/es/storybook/StoryBook/style.mjs.map +1 -0
- package/es/storybook/StoryBook/type.d.mts +13 -0
- package/es/storybook/index.d.mts +4 -0
- package/es/storybook/index.d.ts +1 -0
- package/es/storybook/index.js +1 -0
- package/es/storybook/index.mjs +2 -0
- package/es/styles/classNames.d.mts +11 -0
- package/es/styles/classNames.mjs +12 -0
- package/es/styles/classNames.mjs.map +1 -0
- package/es/styles/customTheme.d.mts +36 -0
- package/es/styles/customTheme.mjs +71 -0
- package/es/styles/customTheme.mjs.map +1 -0
- package/es/styles/index.d.mts +6 -0
- package/es/styles/index.d.ts +1 -0
- package/es/styles/index.js +1 -0
- package/es/styles/index.mjs +6 -0
- package/es/styles/theme/algorithms/darkAlgorithm.mjs +18 -0
- package/es/styles/theme/algorithms/darkAlgorithm.mjs.map +1 -0
- package/es/styles/theme/algorithms/lightAlgorithm.mjs +18 -0
- package/es/styles/theme/algorithms/lightAlgorithm.mjs.map +1 -0
- package/es/styles/theme/algorithms/resolveScales.mjs +25 -0
- package/es/styles/theme/algorithms/resolveScales.mjs.map +1 -0
- package/es/styles/theme/antdTheme.mjs +31 -0
- package/es/styles/theme/antdTheme.mjs.map +1 -0
- package/es/styles/theme/customStylish.d.mts +7 -0
- package/es/styles/theme/customStylish.mjs +158 -0
- package/es/styles/theme/customStylish.mjs.map +1 -0
- package/es/styles/theme/customStylishStatic.d.mts +6 -0
- package/es/styles/theme/customStylishStatic.mjs +156 -0
- package/es/styles/theme/customStylishStatic.mjs.map +1 -0
- package/es/styles/theme/customToken.d.mts +7 -0
- package/es/styles/theme/customToken.mjs +127 -0
- package/es/styles/theme/customToken.mjs.map +1 -0
- package/es/styles/theme/generateColorPalette.d.mts +16 -0
- package/es/styles/theme/generateColorPalette.mjs +170 -0
- package/es/styles/theme/generateColorPalette.mjs.map +1 -0
- package/es/styles/theme/token/base.mjs +64 -0
- package/es/styles/theme/token/base.mjs.map +1 -0
- package/es/styles/theme/token/dark.mjs +37 -0
- package/es/styles/theme/token/dark.mjs.map +1 -0
- package/es/styles/theme/token/light.mjs +37 -0
- package/es/styles/theme/token/light.mjs.map +1 -0
- package/es/types/customStylish.d.mts +28 -0
- package/es/types/customToken.d.mts +34 -0
- package/es/types/customToken.mjs +32 -0
- package/es/types/customToken.mjs.map +1 -0
- package/es/types/index.d.mts +15 -0
- package/es/types/index.d.ts +1 -0
- package/es/types/index.js +1 -0
- package/es/types/index.mjs +2 -0
- package/es/utils/composeEventHandlers.d.mts +5 -0
- package/es/utils/composeEventHandlers.mjs +10 -0
- package/es/utils/composeEventHandlers.mjs.map +1 -0
- package/es/utils/copyToClipboard.d.mts +5 -0
- package/es/utils/copyToClipboard.mjs +28 -0
- package/es/utils/copyToClipboard.mjs.map +1 -0
- package/es/utils/dom.d.mts +15 -0
- package/es/utils/dom.mjs +16 -0
- package/es/utils/dom.mjs.map +1 -0
- package/es/utils/genCdnUrl.d.mts +12 -0
- package/es/utils/genCdnUrl.mjs +17 -0
- package/es/utils/genCdnUrl.mjs.map +1 -0
- package/es/utils/safeReadableColor.mjs +6 -0
- package/es/utils/safeReadableColor.mjs.map +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightAlgorithm.mjs","names":[],"sources":["../../../../src/styles/theme/algorithms/lightAlgorithm.ts"],"sourcesContent":["import type { MappingAlgorithm } from 'antd/es/theme/interface';\n\nimport type { NeutralColors, PrimaryColors } from '../../customTheme';\nimport { generateCustomColorToken } from '../customToken';\nimport lightBaseToken from '../token/light';\nimport { resolveNeutralTokens, resolvePrimaryTokens } from './resolveScales';\n\nexport const lightAlgorithm: MappingAlgorithm = (seedToken, mapToken) => {\n const { neutralColor, primaryColor } = seedToken as typeof seedToken & {\n neutralColor?: NeutralColors;\n primaryColor?: PrimaryColors;\n };\n\n return {\n ...mapToken!,\n ...lightBaseToken,\n ...resolvePrimaryTokens('light', primaryColor),\n ...resolveNeutralTokens('light', neutralColor),\n ...generateCustomColorToken(false),\n };\n};\n"],"mappings":";;;;AAOA,MAAa,kBAAoC,WAAW,aAAa;CACvE,MAAM,EAAE,cAAc,iBAAiB;CAKvC,OAAO;EACL,GAAG;EACH,GAAG;EACH,GAAG,qBAAqB,SAAS,YAAY;EAC7C,GAAG,qBAAqB,SAAS,YAAY;EAC7C,GAAG,yBAAyB,KAAK;CACnC;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { colorScales } from "../../../color/colors/index.mjs";
|
|
2
|
+
import { neutralColorScales } from "../../../color/neutrals/index.mjs";
|
|
3
|
+
import { generateColorNeutralPalette, generateColorPalette } from "../generateColorPalette.mjs";
|
|
4
|
+
//#region src/styles/theme/algorithms/resolveScales.ts
|
|
5
|
+
/** 种子令牌里的自定义色系名 → 对应色板生成的主色 token。色板缺失时回退到 token 文件里的默认值。 */
|
|
6
|
+
const resolvePrimaryTokens = (appearance, primaryColor) => {
|
|
7
|
+
const scale = primaryColor ? colorScales[primaryColor] : void 0;
|
|
8
|
+
return scale ? generateColorPalette({
|
|
9
|
+
appearance,
|
|
10
|
+
scale,
|
|
11
|
+
type: "Primary"
|
|
12
|
+
}) : {};
|
|
13
|
+
};
|
|
14
|
+
/** 种子令牌里的自定义中性色名 → 对应色板生成的中性 token。 */
|
|
15
|
+
const resolveNeutralTokens = (appearance, neutralColor) => {
|
|
16
|
+
const scale = neutralColor ? neutralColorScales[neutralColor] : void 0;
|
|
17
|
+
return scale ? generateColorNeutralPalette({
|
|
18
|
+
appearance,
|
|
19
|
+
scale
|
|
20
|
+
}) : {};
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { resolveNeutralTokens, resolvePrimaryTokens };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=resolveScales.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveScales.mjs","names":[],"sources":["../../../../src/styles/theme/algorithms/resolveScales.ts"],"sourcesContent":["import { colorScales } from '@/color/colors';\nimport { neutralColorScales } from '@/color/neutrals';\n\nimport type { NeutralColors, PrimaryColors } from '../../customTheme';\nimport { generateColorNeutralPalette, generateColorPalette } from '../generateColorPalette';\n\ntype Appearance = 'light' | 'dark';\n\n/** 种子令牌里的自定义色系名 → 对应色板生成的主色 token。色板缺失时回退到 token 文件里的默认值。 */\nexport const resolvePrimaryTokens = (appearance: Appearance, primaryColor?: PrimaryColors) => {\n const scale = primaryColor ? colorScales[primaryColor] : undefined;\n return scale ? generateColorPalette({ appearance, scale, type: 'Primary' }) : {};\n};\n\n/** 种子令牌里的自定义中性色名 → 对应色板生成的中性 token。 */\nexport const resolveNeutralTokens = (appearance: Appearance, neutralColor?: NeutralColors) => {\n const scale = neutralColor ? neutralColorScales[neutralColor] : undefined;\n return scale ? generateColorNeutralPalette({ appearance, scale }) : {};\n};\n"],"mappings":";;;;;AASA,MAAa,wBAAwB,YAAwB,iBAAiC;CAC5F,MAAM,QAAQ,eAAe,YAAY,gBAAgB,KAAA;CACzD,OAAO,QAAQ,qBAAqB;EAAE;EAAY;EAAO,MAAM;CAAU,CAAC,IAAI,CAAC;AACjF;;AAGA,MAAa,wBAAwB,YAAwB,iBAAiC;CAC5F,MAAM,QAAQ,eAAe,mBAAmB,gBAAgB,KAAA;CAChE,OAAO,QAAQ,4BAA4B;EAAE;EAAY;CAAM,CAAC,IAAI,CAAC;AACvE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { darkAlgorithm } from "./algorithms/darkAlgorithm.mjs";
|
|
2
|
+
import { lightAlgorithm } from "./algorithms/lightAlgorithm.mjs";
|
|
3
|
+
import { baseToken } from "./token/base.mjs";
|
|
4
|
+
//#region src/styles/theme/antdTheme.ts
|
|
5
|
+
/** 这些录入类组件统一关掉聚焦/hover 时的边框变色,保持发丝边框稳定。 */
|
|
6
|
+
const STEADY_BORDER_COMPONENTS = [
|
|
7
|
+
"DatePicker",
|
|
8
|
+
"Input",
|
|
9
|
+
"InputNumber",
|
|
10
|
+
"Mentions",
|
|
11
|
+
"Select"
|
|
12
|
+
];
|
|
13
|
+
const createSuperadAntdTheme = ({ neutralColor, appearance, primaryColor }) => ({
|
|
14
|
+
algorithm: appearance === "dark" ? darkAlgorithm : lightAlgorithm,
|
|
15
|
+
components: {
|
|
16
|
+
...Object.fromEntries(STEADY_BORDER_COMPONENTS.map((name) => [name, {
|
|
17
|
+
activeBorderColor: baseToken.colorBorder,
|
|
18
|
+
hoverBorderColor: baseToken.colorBorder
|
|
19
|
+
}])),
|
|
20
|
+
Button: { contentFontSizeSM: 12 }
|
|
21
|
+
},
|
|
22
|
+
token: {
|
|
23
|
+
...baseToken,
|
|
24
|
+
neutralColor,
|
|
25
|
+
primaryColor
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { createSuperadAntdTheme };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=antdTheme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antdTheme.mjs","names":[],"sources":["../../../src/styles/theme/antdTheme.ts"],"sourcesContent":["import type { ThemeConfig } from 'antd';\nimport type { ThemeAppearance } from 'antd-style';\n\nimport type { NeutralColors, PrimaryColors } from '../customTheme';\nimport { darkAlgorithm } from './algorithms/darkAlgorithm';\nimport { lightAlgorithm } from './algorithms/lightAlgorithm';\nimport { baseToken } from './token/base';\n\nexport interface SuperadAntdThemeParams {\n appearance: ThemeAppearance;\n neutralColor?: NeutralColors;\n primaryColor?: PrimaryColors;\n}\n\n/** 这些录入类组件统一关掉聚焦/hover 时的边框变色,保持发丝边框稳定。 */\nconst STEADY_BORDER_COMPONENTS = [\n 'DatePicker',\n 'Input',\n 'InputNumber',\n 'Mentions',\n 'Select',\n] as const;\n\nexport const createSuperadAntdTheme = ({\n neutralColor,\n appearance,\n primaryColor,\n}: SuperadAntdThemeParams): ThemeConfig => ({\n algorithm: appearance === 'dark' ? darkAlgorithm : lightAlgorithm,\n components: {\n ...Object.fromEntries(\n STEADY_BORDER_COMPONENTS.map((name) => [\n name,\n {\n activeBorderColor: baseToken.colorBorder,\n hoverBorderColor: baseToken.colorBorder,\n },\n ]),\n ),\n Button: {\n contentFontSizeSM: 12,\n },\n },\n token: {\n ...baseToken,\n // @ts-expect-error custom seed fields consumed by mapping algorithms\n neutralColor,\n primaryColor,\n },\n});\n"],"mappings":";;;;;AAeA,MAAM,2BAA2B;CAC/B;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,0BAA0B,EACrC,cACA,YACA,oBAC0C;CAC1C,WAAW,eAAe,SAAS,gBAAgB;CACnD,YAAY;EACV,GAAG,OAAO,YACR,yBAAyB,KAAK,SAAS,CACrC,MACA;GACE,mBAAmB,UAAU;GAC7B,kBAAkB,UAAU;EAC9B,CACF,CAAC,CACH;EACA,QAAQ,EACN,mBAAmB,GACrB;CACF;CACA,OAAO;EACL,GAAG;EAEH;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SuperadCustomStylish } from "../../types/customStylish.mjs";
|
|
2
|
+
import { GetCustomStylish } from "antd-style";
|
|
3
|
+
//#region src/styles/theme/customStylish.d.ts
|
|
4
|
+
declare const generateCustomStylish: GetCustomStylish<SuperadCustomStylish>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { generateCustomStylish };
|
|
7
|
+
//# sourceMappingURL=customStylish.d.mts.map
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { keyframes } from "antd-style";
|
|
2
|
+
//#region src/styles/theme/customStylish.ts
|
|
3
|
+
const generateCustomStylish = ({ css, token, isDarkMode }) => {
|
|
4
|
+
/**
|
|
5
|
+
* 往返一整趟,**不能折叠成 from / to**:它配的是 `infinite`,单向位移在每轮结束时会从
|
|
6
|
+
* 100% 瞬跳回 0%,5s 一次可见闪跳。三个关键帧让终点回到起点,循环才是连续流动的。
|
|
7
|
+
*/
|
|
8
|
+
const gradientShift = keyframes`
|
|
9
|
+
0% {
|
|
10
|
+
background-position: 0% 50%;
|
|
11
|
+
}
|
|
12
|
+
50% {
|
|
13
|
+
background-position: 100% 50%;
|
|
14
|
+
}
|
|
15
|
+
100% {
|
|
16
|
+
background-position: 0% 50%;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
/** 无边框变体的公共底盘 */
|
|
20
|
+
const ghost = css`
|
|
21
|
+
border: none;
|
|
22
|
+
background: none;
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
`;
|
|
25
|
+
const shadowColor = isDarkMode ? token.colorBgLayout : token.colorBorder;
|
|
26
|
+
const shadowColorSecondary = isDarkMode ? token.colorBgLayout : token.colorBorderSecondary;
|
|
27
|
+
return {
|
|
28
|
+
active: css`
|
|
29
|
+
color: ${token.colorText};
|
|
30
|
+
background: ${token.colorFillSecondary};
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
color: ${token.colorText};
|
|
34
|
+
background: ${token.colorFill};
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
blur: css`
|
|
38
|
+
backdrop-filter: saturate(150%) blur(10px);
|
|
39
|
+
`,
|
|
40
|
+
blurStrong: css`
|
|
41
|
+
backdrop-filter: saturate(150%) blur(36px);
|
|
42
|
+
`,
|
|
43
|
+
bottomScrollbar: css`
|
|
44
|
+
::-webkit-scrollbar {
|
|
45
|
+
width: 0;
|
|
46
|
+
height: 4px;
|
|
47
|
+
background-color: transparent;
|
|
48
|
+
|
|
49
|
+
&-thumb {
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
background-color: ${token.colorFill};
|
|
52
|
+
transition: background-color 500ms ${token.motionEaseOut};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-corner {
|
|
56
|
+
display: none;
|
|
57
|
+
width: 0;
|
|
58
|
+
height: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
disabled: css`
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
opacity: 0.5;
|
|
65
|
+
`,
|
|
66
|
+
gradientAnimation: css`
|
|
67
|
+
border-radius: inherit;
|
|
68
|
+
background-image: linear-gradient(
|
|
69
|
+
-45deg,
|
|
70
|
+
${token.gold},
|
|
71
|
+
${token.magenta},
|
|
72
|
+
${token.geekblue},
|
|
73
|
+
${token.cyan}
|
|
74
|
+
);
|
|
75
|
+
background-size: 400% 400%;
|
|
76
|
+
animation: 5s ${gradientShift} 5s ease infinite;
|
|
77
|
+
`,
|
|
78
|
+
noScrollbar: css`
|
|
79
|
+
::-webkit-scrollbar {
|
|
80
|
+
display: none;
|
|
81
|
+
width: 0;
|
|
82
|
+
height: 0;
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
}
|
|
85
|
+
`,
|
|
86
|
+
resetLinkColor: css`
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
color: ${token.colorTextSecondary};
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
color: ${token.colorText};
|
|
92
|
+
}
|
|
93
|
+
`,
|
|
94
|
+
shadow: css`
|
|
95
|
+
box-shadow:
|
|
96
|
+
0 1px 0 -1px ${shadowColor},
|
|
97
|
+
0 1px 2px -0.5px ${shadowColor},
|
|
98
|
+
0 2px 2px -1px ${shadowColorSecondary},
|
|
99
|
+
0 3px 6px -4px ${shadowColorSecondary};
|
|
100
|
+
`,
|
|
101
|
+
variantBorderless: css`
|
|
102
|
+
${ghost};
|
|
103
|
+
|
|
104
|
+
&:hover {
|
|
105
|
+
background: ${token.colorFillTertiary};
|
|
106
|
+
}
|
|
107
|
+
`,
|
|
108
|
+
variantBorderlessDanger: css`
|
|
109
|
+
${ghost};
|
|
110
|
+
|
|
111
|
+
&:hover {
|
|
112
|
+
background: ${token.colorErrorFillTertiary};
|
|
113
|
+
box-shadow: inset 0 0 0 1px ${token.colorErrorFillTertiary};
|
|
114
|
+
}
|
|
115
|
+
`,
|
|
116
|
+
variantBorderlessWithoutHover: ghost,
|
|
117
|
+
variantFilled: css`
|
|
118
|
+
background: ${token.colorFillTertiary};
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
background: ${token.colorFillSecondary};
|
|
122
|
+
}
|
|
123
|
+
`,
|
|
124
|
+
variantFilledDanger: css`
|
|
125
|
+
background: ${token.colorErrorFillTertiary};
|
|
126
|
+
|
|
127
|
+
&:hover {
|
|
128
|
+
background: ${token.colorErrorFillSecondary};
|
|
129
|
+
}
|
|
130
|
+
`,
|
|
131
|
+
variantFilledWithoutHover: css`
|
|
132
|
+
background: ${token.colorFillTertiary};
|
|
133
|
+
`,
|
|
134
|
+
variantOutlined: css`
|
|
135
|
+
border: 1px solid ${token.colorBorderSecondary};
|
|
136
|
+
background: ${token.colorBgContainer};
|
|
137
|
+
|
|
138
|
+
&:hover {
|
|
139
|
+
border-color: ${token.colorBorder};
|
|
140
|
+
}
|
|
141
|
+
`,
|
|
142
|
+
variantOutlinedDanger: css`
|
|
143
|
+
border: 1px solid ${token.colorErrorBorder};
|
|
144
|
+
|
|
145
|
+
&:hover {
|
|
146
|
+
border-color: ${token.colorErrorBorder};
|
|
147
|
+
}
|
|
148
|
+
`,
|
|
149
|
+
variantOutlinedWithoutHover: css`
|
|
150
|
+
border: 1px solid ${token.colorBorderSecondary};
|
|
151
|
+
background: ${token.colorBgContainer};
|
|
152
|
+
`
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
export { generateCustomStylish };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=customStylish.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customStylish.mjs","names":[],"sources":["../../../src/styles/theme/customStylish.ts"],"sourcesContent":["import { type GetCustomStylish, keyframes } from 'antd-style';\n\nimport type { SuperadCustomStylish } from '@/types/customStylish';\n\nexport const generateCustomStylish: GetCustomStylish<SuperadCustomStylish> = ({\n css,\n token,\n isDarkMode,\n}) => {\n /**\n * 往返一整趟,**不能折叠成 from / to**:它配的是 `infinite`,单向位移在每轮结束时会从\n * 100% 瞬跳回 0%,5s 一次可见闪跳。三个关键帧让终点回到起点,循环才是连续流动的。\n */\n const gradientShift = keyframes`\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n `;\n\n /** 无边框变体的公共底盘 */\n const ghost = css`\n border: none;\n background: none;\n box-shadow: none;\n `;\n\n const shadowColor = isDarkMode ? token.colorBgLayout : token.colorBorder;\n const shadowColorSecondary = isDarkMode ? token.colorBgLayout : token.colorBorderSecondary;\n\n return {\n active: css`\n color: ${token.colorText};\n background: ${token.colorFillSecondary};\n\n &:hover {\n color: ${token.colorText};\n background: ${token.colorFill};\n }\n `,\n blur: css`\n backdrop-filter: saturate(150%) blur(10px);\n `,\n blurStrong: css`\n backdrop-filter: saturate(150%) blur(36px);\n `,\n bottomScrollbar: css`\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n border-radius: 4px;\n background-color: ${token.colorFill};\n transition: background-color 500ms ${token.motionEaseOut};\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n `,\n disabled: css`\n cursor: not-allowed;\n opacity: 0.5;\n `,\n gradientAnimation: css`\n border-radius: inherit;\n background-image: linear-gradient(\n -45deg,\n ${token.gold},\n ${token.magenta},\n ${token.geekblue},\n ${token.cyan}\n );\n background-size: 400% 400%;\n animation: 5s ${gradientShift} 5s ease infinite;\n `,\n noScrollbar: css`\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n `,\n resetLinkColor: css`\n cursor: pointer;\n color: ${token.colorTextSecondary};\n\n &:hover {\n color: ${token.colorText};\n }\n `,\n shadow: css`\n box-shadow:\n 0 1px 0 -1px ${shadowColor},\n 0 1px 2px -0.5px ${shadowColor},\n 0 2px 2px -1px ${shadowColorSecondary},\n 0 3px 6px -4px ${shadowColorSecondary};\n `,\n variantBorderless: css`\n ${ghost};\n\n &:hover {\n background: ${token.colorFillTertiary};\n }\n `,\n variantBorderlessDanger: css`\n ${ghost};\n\n &:hover {\n background: ${token.colorErrorFillTertiary};\n box-shadow: inset 0 0 0 1px ${token.colorErrorFillTertiary};\n }\n `,\n variantBorderlessWithoutHover: ghost,\n variantFilled: css`\n background: ${token.colorFillTertiary};\n\n &:hover {\n background: ${token.colorFillSecondary};\n }\n `,\n variantFilledDanger: css`\n background: ${token.colorErrorFillTertiary};\n\n &:hover {\n background: ${token.colorErrorFillSecondary};\n }\n `,\n variantFilledWithoutHover: css`\n background: ${token.colorFillTertiary};\n `,\n variantOutlined: css`\n border: 1px solid ${token.colorBorderSecondary};\n background: ${token.colorBgContainer};\n\n &:hover {\n border-color: ${token.colorBorder};\n }\n `,\n variantOutlinedDanger: css`\n border: 1px solid ${token.colorErrorBorder};\n\n &:hover {\n border-color: ${token.colorErrorBorder};\n }\n `,\n variantOutlinedWithoutHover: css`\n border: 1px solid ${token.colorBorderSecondary};\n background: ${token.colorBgContainer};\n `,\n };\n};\n"],"mappings":";;AAIA,MAAa,yBAAiE,EAC5E,KACA,OACA,iBACI;;;;;CAKJ,MAAM,gBAAgB,SAAS;;;;;;;;;;;;CAa/B,MAAM,QAAQ,GAAG;;;;;CAMjB,MAAM,cAAc,aAAa,MAAM,gBAAgB,MAAM;CAC7D,MAAM,uBAAuB,aAAa,MAAM,gBAAgB,MAAM;CAEtE,OAAO;EACL,QAAQ,GAAG;eACA,MAAM,UAAU;oBACX,MAAM,mBAAmB;;;iBAG5B,MAAM,UAAU;sBACX,MAAM,UAAU;;;EAGlC,MAAM,GAAG;;;EAGT,YAAY,GAAG;;;EAGf,iBAAiB,GAAG;;;;;;;;8BAQM,MAAM,UAAU;+CACC,MAAM,cAAc;;;;;;;;;;EAU/D,UAAU,GAAG;;;;EAIb,mBAAmB,GAAG;;;;UAIhB,MAAM,KAAK;UACX,MAAM,QAAQ;UACd,MAAM,SAAS;UACf,MAAM,KAAK;;;sBAGC,cAAc;;EAEhC,aAAa,GAAG;;;;;;;;EAQhB,gBAAgB,GAAG;;eAER,MAAM,mBAAmB;;;iBAGvB,MAAM,UAAU;;;EAG7B,QAAQ,GAAG;;uBAEQ,YAAY;2BACR,YAAY;yBACd,qBAAqB;yBACrB,qBAAqB;;EAE1C,mBAAmB,GAAG;QAClB,MAAM;;;sBAGQ,MAAM,kBAAkB;;;EAG1C,yBAAyB,GAAG;QACxB,MAAM;;;sBAGQ,MAAM,uBAAuB;sCACb,MAAM,uBAAuB;;;EAG/D,+BAA+B;EAC/B,eAAe,GAAG;oBACF,MAAM,kBAAkB;;;sBAGtB,MAAM,mBAAmB;;;EAG3C,qBAAqB,GAAG;oBACR,MAAM,uBAAuB;;;sBAG3B,MAAM,wBAAwB;;;EAGhD,2BAA2B,GAAG;oBACd,MAAM,kBAAkB;;EAExC,iBAAiB,GAAG;0BACE,MAAM,qBAAqB;oBACjC,MAAM,iBAAiB;;;wBAGnB,MAAM,YAAY;;;EAGtC,uBAAuB,GAAG;0BACJ,MAAM,iBAAiB;;;wBAGzB,MAAM,iBAAiB;;;EAG3C,6BAA6B,GAAG;0BACV,MAAM,qBAAqB;oBACjC,MAAM,iBAAiB;;CAEzC;AACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SuperadCustomStylish } from "../../types/customStylish.mjs";
|
|
2
|
+
//#region src/styles/theme/customStylishStatic.d.ts
|
|
3
|
+
declare const staticStylish: SuperadCustomStylish;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { staticStylish };
|
|
6
|
+
//# sourceMappingURL=customStylishStatic.d.mts.map
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { createStaticStyles, keyframes } from "antd-style";
|
|
2
|
+
//#region src/styles/theme/customStylishStatic.ts
|
|
3
|
+
/**
|
|
4
|
+
* 往返一整趟,**不能折叠成 from / to**:它配的是 `infinite`,单向位移在每轮结束时会从
|
|
5
|
+
* 100% 瞬跳回 0%,5s 一次可见闪跳。三个关键帧让终点回到起点,循环才是连续流动的。
|
|
6
|
+
*/
|
|
7
|
+
const gradientShift = keyframes`
|
|
8
|
+
0% {
|
|
9
|
+
background-position: 0% 50%;
|
|
10
|
+
}
|
|
11
|
+
50% {
|
|
12
|
+
background-position: 100% 50%;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
background-position: 0% 50%;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const staticStylish = createStaticStyles(({ css, cssVar }) => {
|
|
19
|
+
/** 无边框变体的公共底盘 */
|
|
20
|
+
const ghost = css`
|
|
21
|
+
border: none;
|
|
22
|
+
background: none;
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
`;
|
|
25
|
+
return {
|
|
26
|
+
active: css`
|
|
27
|
+
color: ${cssVar.colorText};
|
|
28
|
+
background: ${cssVar.colorFillSecondary};
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
color: ${cssVar.colorText};
|
|
32
|
+
background: ${cssVar.colorFill};
|
|
33
|
+
}
|
|
34
|
+
`,
|
|
35
|
+
blur: css`
|
|
36
|
+
backdrop-filter: saturate(150%) blur(10px);
|
|
37
|
+
`,
|
|
38
|
+
blurStrong: css`
|
|
39
|
+
backdrop-filter: saturate(150%) blur(36px);
|
|
40
|
+
`,
|
|
41
|
+
bottomScrollbar: css`
|
|
42
|
+
::-webkit-scrollbar {
|
|
43
|
+
width: 0;
|
|
44
|
+
height: 4px;
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
|
|
47
|
+
&-thumb {
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
background-color: ${cssVar.colorFill};
|
|
50
|
+
transition: background-color 500ms ${cssVar.motionEaseOut};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-corner {
|
|
54
|
+
display: none;
|
|
55
|
+
width: 0;
|
|
56
|
+
height: 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
disabled: css`
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
opacity: 0.5;
|
|
63
|
+
`,
|
|
64
|
+
gradientAnimation: css`
|
|
65
|
+
border-radius: inherit;
|
|
66
|
+
background-image: linear-gradient(
|
|
67
|
+
-45deg,
|
|
68
|
+
${cssVar.gold},
|
|
69
|
+
${cssVar.magenta},
|
|
70
|
+
${cssVar.geekblue},
|
|
71
|
+
${cssVar.cyan}
|
|
72
|
+
);
|
|
73
|
+
background-size: 400% 400%;
|
|
74
|
+
animation: 5s ${gradientShift} 5s ease infinite;
|
|
75
|
+
`,
|
|
76
|
+
noScrollbar: css`
|
|
77
|
+
::-webkit-scrollbar {
|
|
78
|
+
display: none;
|
|
79
|
+
width: 0;
|
|
80
|
+
height: 0;
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
`,
|
|
84
|
+
resetLinkColor: css`
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
color: ${cssVar.colorTextSecondary};
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
color: ${cssVar.colorText};
|
|
90
|
+
}
|
|
91
|
+
`,
|
|
92
|
+
shadow: css`
|
|
93
|
+
box-shadow:
|
|
94
|
+
0 1px 0 -1px ${cssVar.colorBorder},
|
|
95
|
+
0 1px 2px -0.5px ${cssVar.colorBorder},
|
|
96
|
+
0 2px 2px -1px ${cssVar.colorBorderSecondary},
|
|
97
|
+
0 3px 6px -4px ${cssVar.colorBorderSecondary};
|
|
98
|
+
`,
|
|
99
|
+
variantBorderless: css`
|
|
100
|
+
${ghost};
|
|
101
|
+
|
|
102
|
+
&:hover {
|
|
103
|
+
background: ${cssVar.colorFillTertiary};
|
|
104
|
+
}
|
|
105
|
+
`,
|
|
106
|
+
variantBorderlessDanger: css`
|
|
107
|
+
${ghost};
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
background: ${cssVar.colorErrorBg};
|
|
111
|
+
box-shadow: inset 0 0 0 1px ${cssVar.colorErrorBg};
|
|
112
|
+
}
|
|
113
|
+
`,
|
|
114
|
+
variantBorderlessWithoutHover: ghost,
|
|
115
|
+
variantFilled: css`
|
|
116
|
+
background: ${cssVar.colorFillTertiary};
|
|
117
|
+
|
|
118
|
+
&:hover {
|
|
119
|
+
background: ${cssVar.colorFillSecondary};
|
|
120
|
+
}
|
|
121
|
+
`,
|
|
122
|
+
variantFilledDanger: css`
|
|
123
|
+
background: ${cssVar.colorErrorBg};
|
|
124
|
+
|
|
125
|
+
&:hover {
|
|
126
|
+
background: ${cssVar.colorErrorBgHover};
|
|
127
|
+
}
|
|
128
|
+
`,
|
|
129
|
+
variantFilledWithoutHover: css`
|
|
130
|
+
background: ${cssVar.colorFillTertiary};
|
|
131
|
+
`,
|
|
132
|
+
variantOutlined: css`
|
|
133
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
134
|
+
background: ${cssVar.colorBgContainer};
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
border-color: ${cssVar.colorBorder};
|
|
138
|
+
}
|
|
139
|
+
`,
|
|
140
|
+
variantOutlinedDanger: css`
|
|
141
|
+
border: 1px solid ${cssVar.colorErrorBorder};
|
|
142
|
+
|
|
143
|
+
&:hover {
|
|
144
|
+
border-color: ${cssVar.colorErrorBorder};
|
|
145
|
+
}
|
|
146
|
+
`,
|
|
147
|
+
variantOutlinedWithoutHover: css`
|
|
148
|
+
border: 1px solid ${cssVar.colorBorderSecondary};
|
|
149
|
+
background: ${cssVar.colorBgContainer};
|
|
150
|
+
`
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
//#endregion
|
|
154
|
+
export { staticStylish };
|
|
155
|
+
|
|
156
|
+
//# sourceMappingURL=customStylishStatic.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customStylishStatic.mjs","names":[],"sources":["../../../src/styles/theme/customStylishStatic.ts"],"sourcesContent":["import { createStaticStyles, keyframes } from 'antd-style';\n\nimport type { SuperadCustomStylish } from '@/types/customStylish';\n\n/**\n * 往返一整趟,**不能折叠成 from / to**:它配的是 `infinite`,单向位移在每轮结束时会从\n * 100% 瞬跳回 0%,5s 一次可见闪跳。三个关键帧让终点回到起点,循环才是连续流动的。\n */\nconst gradientShift = keyframes`\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n`;\n\nexport const staticStylish = createStaticStyles(({ css, cssVar }) => {\n /** 无边框变体的公共底盘 */\n const ghost = css`\n border: none;\n background: none;\n box-shadow: none;\n `;\n\n return {\n active: css`\n color: ${cssVar.colorText};\n background: ${cssVar.colorFillSecondary};\n\n &:hover {\n color: ${cssVar.colorText};\n background: ${cssVar.colorFill};\n }\n `,\n blur: css`\n backdrop-filter: saturate(150%) blur(10px);\n `,\n blurStrong: css`\n backdrop-filter: saturate(150%) blur(36px);\n `,\n bottomScrollbar: css`\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n border-radius: 4px;\n background-color: ${cssVar.colorFill};\n transition: background-color 500ms ${cssVar.motionEaseOut};\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n `,\n disabled: css`\n cursor: not-allowed;\n opacity: 0.5;\n `,\n gradientAnimation: css`\n border-radius: inherit;\n background-image: linear-gradient(\n -45deg,\n ${cssVar.gold},\n ${cssVar.magenta},\n ${cssVar.geekblue},\n ${cssVar.cyan}\n );\n background-size: 400% 400%;\n animation: 5s ${gradientShift} 5s ease infinite;\n `,\n noScrollbar: css`\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n `,\n resetLinkColor: css`\n cursor: pointer;\n color: ${cssVar.colorTextSecondary};\n\n &:hover {\n color: ${cssVar.colorText};\n }\n `,\n shadow: css`\n box-shadow:\n 0 1px 0 -1px ${cssVar.colorBorder},\n 0 1px 2px -0.5px ${cssVar.colorBorder},\n 0 2px 2px -1px ${cssVar.colorBorderSecondary},\n 0 3px 6px -4px ${cssVar.colorBorderSecondary};\n `,\n variantBorderless: css`\n ${ghost};\n\n &:hover {\n background: ${cssVar.colorFillTertiary};\n }\n `,\n variantBorderlessDanger: css`\n ${ghost};\n\n &:hover {\n background: ${cssVar.colorErrorBg};\n box-shadow: inset 0 0 0 1px ${cssVar.colorErrorBg};\n }\n `,\n variantBorderlessWithoutHover: ghost,\n variantFilled: css`\n background: ${cssVar.colorFillTertiary};\n\n &:hover {\n background: ${cssVar.colorFillSecondary};\n }\n `,\n variantFilledDanger: css`\n background: ${cssVar.colorErrorBg};\n\n &:hover {\n background: ${cssVar.colorErrorBgHover};\n }\n `,\n variantFilledWithoutHover: css`\n background: ${cssVar.colorFillTertiary};\n `,\n variantOutlined: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n background: ${cssVar.colorBgContainer};\n\n &:hover {\n border-color: ${cssVar.colorBorder};\n }\n `,\n variantOutlinedDanger: css`\n border: 1px solid ${cssVar.colorErrorBorder};\n\n &:hover {\n border-color: ${cssVar.colorErrorBorder};\n }\n `,\n variantOutlinedWithoutHover: css`\n border: 1px solid ${cssVar.colorBorderSecondary};\n background: ${cssVar.colorBgContainer};\n `,\n };\n}) as SuperadCustomStylish;\n"],"mappings":";;;;;;AAQA,MAAM,gBAAgB,SAAS;;;;;;;;;;;AAY/B,MAAa,gBAAgB,oBAAoB,EAAE,KAAK,aAAa;;CAEnE,MAAM,QAAQ,GAAG;;;;;CAMjB,OAAO;EACL,QAAQ,GAAG;eACA,OAAO,UAAU;oBACZ,OAAO,mBAAmB;;;iBAG7B,OAAO,UAAU;sBACZ,OAAO,UAAU;;;EAGnC,MAAM,GAAG;;;EAGT,YAAY,GAAG;;;EAGf,iBAAiB,GAAG;;;;;;;;8BAQM,OAAO,UAAU;+CACA,OAAO,cAAc;;;;;;;;;;EAUhE,UAAU,GAAG;;;;EAIb,mBAAmB,GAAG;;;;UAIhB,OAAO,KAAK;UACZ,OAAO,QAAQ;UACf,OAAO,SAAS;UAChB,OAAO,KAAK;;;sBAGA,cAAc;;EAEhC,aAAa,GAAG;;;;;;;;EAQhB,gBAAgB,GAAG;;eAER,OAAO,mBAAmB;;;iBAGxB,OAAO,UAAU;;;EAG9B,QAAQ,GAAG;;uBAEQ,OAAO,YAAY;2BACf,OAAO,YAAY;yBACrB,OAAO,qBAAqB;yBAC5B,OAAO,qBAAqB;;EAEjD,mBAAmB,GAAG;QAClB,MAAM;;;sBAGQ,OAAO,kBAAkB;;;EAG3C,yBAAyB,GAAG;QACxB,MAAM;;;sBAGQ,OAAO,aAAa;sCACJ,OAAO,aAAa;;;EAGtD,+BAA+B;EAC/B,eAAe,GAAG;oBACF,OAAO,kBAAkB;;;sBAGvB,OAAO,mBAAmB;;;EAG5C,qBAAqB,GAAG;oBACR,OAAO,aAAa;;;sBAGlB,OAAO,kBAAkB;;;EAG3C,2BAA2B,GAAG;oBACd,OAAO,kBAAkB;;EAEzC,iBAAiB,GAAG;0BACE,OAAO,qBAAqB;oBAClC,OAAO,iBAAiB;;;wBAGpB,OAAO,YAAY;;;EAGvC,uBAAuB,GAAG;0BACJ,OAAO,iBAAiB;;;wBAG1B,OAAO,iBAAiB;;;EAG5C,6BAA6B,GAAG;0BACV,OAAO,qBAAqB;oBAClC,OAAO,iBAAiB;;CAE1C;AACF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SuperadCustomToken } from "../../types/customToken.mjs";
|
|
2
|
+
import { GetCustomToken } from "antd-style";
|
|
3
|
+
//#region src/styles/theme/customToken.d.ts
|
|
4
|
+
declare const generateCustomToken: GetCustomToken<SuperadCustomToken>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { generateCustomToken };
|
|
7
|
+
//# sourceMappingURL=customToken.d.mts.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { colorScales } from "../../color/colors/index.mjs";
|
|
2
|
+
import { camelCase } from "es-toolkit/compat";
|
|
3
|
+
import { mix } from "polished";
|
|
4
|
+
//#region src/styles/theme/customToken.ts
|
|
5
|
+
const HUE_SLOT_RULES = [
|
|
6
|
+
[
|
|
7
|
+
"Fill",
|
|
8
|
+
3,
|
|
9
|
+
4,
|
|
10
|
+
true
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"FillSecondary",
|
|
14
|
+
2,
|
|
15
|
+
3,
|
|
16
|
+
true
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"FillTertiary",
|
|
20
|
+
1,
|
|
21
|
+
2,
|
|
22
|
+
true
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"FillQuaternary",
|
|
26
|
+
0,
|
|
27
|
+
1,
|
|
28
|
+
true
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"Bg",
|
|
32
|
+
1,
|
|
33
|
+
1,
|
|
34
|
+
true
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"BgHover",
|
|
38
|
+
2,
|
|
39
|
+
2,
|
|
40
|
+
true
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"Border",
|
|
44
|
+
4,
|
|
45
|
+
4
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"BorderSecondary",
|
|
49
|
+
3,
|
|
50
|
+
3
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"BorderHover",
|
|
54
|
+
5,
|
|
55
|
+
3
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
"Hover",
|
|
59
|
+
10,
|
|
60
|
+
8
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"",
|
|
64
|
+
9,
|
|
65
|
+
9
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"Active",
|
|
69
|
+
7,
|
|
70
|
+
10
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"TextHover",
|
|
74
|
+
10,
|
|
75
|
+
8,
|
|
76
|
+
true
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
"Text",
|
|
80
|
+
9,
|
|
81
|
+
9,
|
|
82
|
+
true
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
"TextActive",
|
|
86
|
+
7,
|
|
87
|
+
10,
|
|
88
|
+
true
|
|
89
|
+
]
|
|
90
|
+
];
|
|
91
|
+
/** 色阶首尾两步(0 与 12)不进逐步入参,只进语义槽位。 */
|
|
92
|
+
const buildStepTokens = (name, scale, appearance) => {
|
|
93
|
+
const tokens = {};
|
|
94
|
+
for (const series of [appearance, `${appearance}A`]) {
|
|
95
|
+
const suffix = series.endsWith("A") ? "A" : "";
|
|
96
|
+
scale[series].forEach((color, step) => {
|
|
97
|
+
if (step > 0 && step < 12) tokens[`${name}${step}${suffix}`] = color;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return tokens;
|
|
101
|
+
};
|
|
102
|
+
const buildHueTokens = (name, scale, appearance) => {
|
|
103
|
+
const isDark = appearance === "dark";
|
|
104
|
+
const semantic = HUE_SLOT_RULES.map(([suffix, darkStep, lightStep, alpha]) => {
|
|
105
|
+
const series = alpha ? `${appearance}A` : appearance;
|
|
106
|
+
return [`${name}${suffix}`, scale[series][isDark ? darkStep : lightStep]];
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
...buildStepTokens(name, scale, appearance),
|
|
110
|
+
...Object.fromEntries(semantic)
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
const generateCustomColorToken = (isDarkMode) => {
|
|
114
|
+
const appearance = isDarkMode ? "dark" : "light";
|
|
115
|
+
return Object.entries(colorScales).reduce((tokens, [type, scale]) => ({
|
|
116
|
+
...tokens,
|
|
117
|
+
...buildHueTokens(camelCase(type), scale, appearance)
|
|
118
|
+
}), {});
|
|
119
|
+
};
|
|
120
|
+
const generateCustomToken = ({ isDarkMode, token }) => ({
|
|
121
|
+
...generateCustomColorToken(isDarkMode),
|
|
122
|
+
colorBgContainerSecondary: mix(.5, token.colorBgLayout, token.colorBgContainer)
|
|
123
|
+
});
|
|
124
|
+
//#endregion
|
|
125
|
+
export { generateCustomColorToken, generateCustomToken };
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=customToken.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customToken.mjs","names":[],"sources":["../../../src/styles/theme/customToken.ts"],"sourcesContent":["import { type GetCustomToken } from 'antd-style';\nimport { camelCase } from 'es-toolkit/compat';\nimport { mix } from 'polished';\n\nimport { colorScales } from '@/color/colors';\nimport { type ColorScaleItem } from '@/color/types';\nimport { type SuperadCustomToken } from '@/types/customToken';\n\ntype Appearance = 'light' | 'dark';\n\n/** 与 generateColorPalette 的语义槽位一致,但 Bg/Text 系列取透明色板,并多出 BorderSecondary。 */\ntype SlotRule = readonly [suffix: string, darkStep: number, lightStep: number, alpha?: boolean];\n\nconst HUE_SLOT_RULES: readonly SlotRule[] = [\n ['Fill', 3, 4, true],\n ['FillSecondary', 2, 3, true],\n ['FillTertiary', 1, 2, true],\n ['FillQuaternary', 0, 1, true],\n ['Bg', 1, 1, true],\n ['BgHover', 2, 2, true],\n ['Border', 4, 4],\n ['BorderSecondary', 3, 3],\n ['BorderHover', 5, 3],\n ['Hover', 10, 8],\n ['', 9, 9],\n ['Active', 7, 10],\n ['TextHover', 10, 8, true],\n ['Text', 9, 9, true],\n ['TextActive', 7, 10, true],\n];\n\n/** 色阶首尾两步(0 与 12)不进逐步入参,只进语义槽位。 */\nconst buildStepTokens = (name: string, scale: ColorScaleItem, appearance: Appearance) => {\n const tokens: Record<string, string> = {};\n for (const series of [appearance, `${appearance}A` as const]) {\n const suffix = series.endsWith('A') ? 'A' : '';\n scale[series].forEach((color, step) => {\n if (step > 0 && step < 12) tokens[`${name}${step}${suffix}`] = color;\n });\n }\n return tokens;\n};\n\nconst buildHueTokens = (name: string, scale: ColorScaleItem, appearance: Appearance) => {\n const isDark = appearance === 'dark';\n const semantic = HUE_SLOT_RULES.map(([suffix, darkStep, lightStep, alpha]) => {\n const series: keyof ColorScaleItem = alpha ? `${appearance}A` : appearance;\n return [`${name}${suffix}`, scale[series][isDark ? darkStep : lightStep]] as const;\n });\n return {\n ...buildStepTokens(name, scale, appearance),\n ...Object.fromEntries(semantic),\n };\n};\n\nexport const generateCustomColorToken = (isDarkMode: boolean): Record<string, string> => {\n const appearance: Appearance = isDarkMode ? 'dark' : 'light';\n return Object.entries(colorScales).reduce(\n (tokens, [type, scale]) => ({\n ...tokens,\n ...buildHueTokens(camelCase(type), scale, appearance),\n }),\n {} as Record<string, string>,\n );\n};\n\nexport const generateCustomToken: GetCustomToken<SuperadCustomToken> = ({ isDarkMode, token }) =>\n ({\n ...generateCustomColorToken(isDarkMode),\n colorBgContainerSecondary: mix(0.5, token.colorBgLayout, token.colorBgContainer),\n }) as SuperadCustomToken;\n"],"mappings":";;;;AAaA,MAAM,iBAAsC;CAC1C;EAAC;EAAQ;EAAG;EAAG;CAAI;CACnB;EAAC;EAAiB;EAAG;EAAG;CAAI;CAC5B;EAAC;EAAgB;EAAG;EAAG;CAAI;CAC3B;EAAC;EAAkB;EAAG;EAAG;CAAI;CAC7B;EAAC;EAAM;EAAG;EAAG;CAAI;CACjB;EAAC;EAAW;EAAG;EAAG;CAAI;CACtB;EAAC;EAAU;EAAG;CAAC;CACf;EAAC;EAAmB;EAAG;CAAC;CACxB;EAAC;EAAe;EAAG;CAAC;CACpB;EAAC;EAAS;EAAI;CAAC;CACf;EAAC;EAAI;EAAG;CAAC;CACT;EAAC;EAAU;EAAG;CAAE;CAChB;EAAC;EAAa;EAAI;EAAG;CAAI;CACzB;EAAC;EAAQ;EAAG;EAAG;CAAI;CACnB;EAAC;EAAc;EAAG;EAAI;CAAI;AAC5B;;AAGA,MAAM,mBAAmB,MAAc,OAAuB,eAA2B;CACvF,MAAM,SAAiC,CAAC;CACxC,KAAK,MAAM,UAAU,CAAC,YAAY,GAAG,WAAW,EAAW,GAAG;EAC5D,MAAM,SAAS,OAAO,SAAS,GAAG,IAAI,MAAM;EAC5C,MAAM,OAAO,CAAC,SAAS,OAAO,SAAS;GACrC,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,GAAG,OAAO,OAAO,YAAY;EACjE,CAAC;CACH;CACA,OAAO;AACT;AAEA,MAAM,kBAAkB,MAAc,OAAuB,eAA2B;CACtF,MAAM,SAAS,eAAe;CAC9B,MAAM,WAAW,eAAe,KAAK,CAAC,QAAQ,UAAU,WAAW,WAAW;EAC5E,MAAM,SAA+B,QAAQ,GAAG,WAAW,KAAK;EAChE,OAAO,CAAC,GAAG,OAAO,UAAU,MAAM,OAAO,CAAC,SAAS,WAAW,UAAU;CAC1E,CAAC;CACD,OAAO;EACL,GAAG,gBAAgB,MAAM,OAAO,UAAU;EAC1C,GAAG,OAAO,YAAY,QAAQ;CAChC;AACF;AAEA,MAAa,4BAA4B,eAAgD;CACvF,MAAM,aAAyB,aAAa,SAAS;CACrD,OAAO,OAAO,QAAQ,WAAW,CAAC,CAAC,QAChC,QAAQ,CAAC,MAAM,YAAY;EAC1B,GAAG;EACH,GAAG,eAAe,UAAU,IAAI,GAAG,OAAO,UAAU;CACtD,IACA,CAAC,CACH;AACF;AAEA,MAAa,uBAA2D,EAAE,YAAY,aACnF;CACC,GAAG,yBAAyB,UAAU;CACtC,2BAA2B,IAAI,IAAK,MAAM,eAAe,MAAM,gBAAgB;AACjF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ColorScaleItem } from "../../color/types.mjs";
|
|
2
|
+
import { AliasToken } from "antd/es/theme/interface/index.js";
|
|
3
|
+
//#region src/styles/theme/generateColorPalette.d.ts
|
|
4
|
+
type Appearance = 'light' | 'dark';
|
|
5
|
+
declare const generateColorPalette: ({ type, scale, appearance }: {
|
|
6
|
+
appearance: Appearance;
|
|
7
|
+
scale: ColorScaleItem;
|
|
8
|
+
type: "Primary" | "Success" | "Warning" | "Error" | "Info" | string;
|
|
9
|
+
}) => Partial<AliasToken>;
|
|
10
|
+
declare const generateColorNeutralPalette: ({ scale, appearance }: {
|
|
11
|
+
appearance: Appearance;
|
|
12
|
+
scale: ColorScaleItem;
|
|
13
|
+
}) => Partial<AliasToken>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { generateColorNeutralPalette, generateColorPalette };
|
|
16
|
+
//# sourceMappingURL=generateColorPalette.d.mts.map
|