@sdata/web-vue 4.7.1 → 5.0.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/dist/sd.css +4004 -3955
- package/dist/sd.min.css +13 -13
- package/es/_components/input-label/style/index.css +47 -47
- package/es/_components/select-view/style/index.css +256 -256
- package/es/alert/style/index.css +48 -48
- package/es/alert/style/token.scss +257 -0
- package/es/anchor/style/index.css +18 -18
- package/es/anchor/style/token.scss +74 -0
- package/es/auto-complete/style/index.css +18 -18
- package/es/auto-complete/style/token.scss +94 -0
- package/es/avatar/style/index.css +31 -31
- package/es/avatar/style/token.scss +118 -0
- package/es/back-top/style/index.css +11 -11
- package/es/back-top/style/token.scss +60 -0
- package/es/badge/style/index.css +35 -35
- package/es/badge/style/token.scss +148 -0
- package/es/basic-crud-table/style/index.css +4 -4
- package/es/basic-crud-table/style/token.scss +20 -0
- package/es/bloom-menu/style/index.css +33 -34
- package/es/bloom-menu/style/index.scss +5 -5
- package/es/bloom-menu/style/token.scss +99 -0
- package/es/border-beam/style/token.scss +28 -0
- package/es/breadcrumb/style/index.css +17 -17
- package/es/breadcrumb/style/token.scss +97 -0
- package/es/button/style/index.css +379 -379
- package/es/button/style/index.scss +3 -3
- package/es/button/style/token.scss +1604 -0
- package/es/card/style/index.css +36 -36
- package/es/card/style/token.scss +162 -0
- package/es/carousel/style/index.css +41 -41
- package/es/carousel/style/token.scss +101 -0
- package/es/cascader/style/index.css +58 -58
- package/es/cascader/style/token.scss +89 -0
- package/es/checkbox/style/index.css +28 -28
- package/es/checkbox/style/token.scss +134 -0
- package/es/collapse/style/index.css +24 -24
- package/es/collapse/style/token.scss +136 -0
- package/es/color-picker/style/index.css +50 -50
- package/es/color-picker/style/token.scss +200 -0
- package/es/comment/style/index.css +15 -15
- package/es/comment/style/token.scss +83 -0
- package/es/config-provider/algorithms.d.ts +11 -0
- package/es/config-provider/algorithms.js +53 -0
- package/es/config-provider/global-theme.js +7 -4
- package/es/config-provider/theme-config.d.ts +11 -0
- package/es/config-provider/theme-config.js +114 -0
- package/es/config-provider/theme-provider.vue_vue_type_script_setup_true_lang.js +46 -11
- package/es/config-provider/theme.d.ts +4 -1
- package/es/config-provider/theme.js +6 -5
- package/es/config-provider/token-key.d.ts +1 -0
- package/es/config-provider/token-key.js +6 -0
- package/es/copy/style/index.css +1 -1
- package/es/copy/style/token.scss +9 -0
- package/es/cropper/style/index.css +7 -7
- package/es/cropper/style/token.scss +24 -0
- package/es/date-picker/style/index.css +73 -73
- package/es/date-picker/style/token.scss +229 -0
- package/es/descriptions/style/index.css +45 -45
- package/es/descriptions/style/token.scss +191 -0
- package/es/divider/style/index.css +11 -11
- package/es/divider/style/token.scss +60 -0
- package/es/drawer/style/index.css +13 -13
- package/es/drawer/style/token.scss +68 -0
- package/es/dropdown/style/index.css +24 -23
- package/es/dropdown/style/index.scss +4 -2
- package/es/dropdown/style/token.scss +123 -0
- package/es/ellipsis/ellipsis.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/ellipsis/interface.d.ts +1 -0
- package/es/ellipsis/style/index.css +2 -2
- package/es/ellipsis/style/token.scss +5 -0
- package/es/empty/style/index.css +7 -7
- package/es/empty/style/token.scss +35 -0
- package/es/file-previewer/style/index.css +44 -44
- package/es/file-previewer/style/token.scss +198 -0
- package/es/form/style/index.css +113 -113
- package/es/form/style/token.scss +340 -0
- package/es/image/style/index.css +83 -83
- package/es/image/style/token.scss +451 -0
- package/es/index.css +4004 -3955
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/input/style/index.css +104 -104
- package/es/input/style/input.scss +2 -8
- package/es/input/style/size.scss +4 -4
- package/es/input/style/token.scss +327 -0
- package/es/input-mask/style/index.css +1 -1
- package/es/input-mask/style/token.scss +8 -0
- package/es/input-number/style/index.css +19 -19
- package/es/input-number/style/token.scss +82 -0
- package/es/input-tag/style/index.css +209 -209
- package/es/input-tag/style/token.scss +226 -0
- package/es/json-form/style/index.css +2 -2
- package/es/json-form/style/token.scss +21 -0
- package/es/kv-list/style/index.css +13 -13
- package/es/kv-list/style/token.scss +29 -0
- package/es/layout/style/index.css +38 -38
- package/es/layout/style/token.scss +100 -0
- package/es/link/style/index.css +28 -28
- package/es/link/style/token.scss +117 -0
- package/es/list/style/index.css +27 -27
- package/es/list/style/token.scss +178 -0
- package/es/mention/style/token.scss +22 -0
- package/es/menu/style/index.css +153 -120
- package/es/menu/style/index.scss +12 -4
- package/es/menu/style/token.scss +390 -0
- package/es/message/style/index.css +33 -33
- package/es/message/style/token.scss +218 -0
- package/es/modal/style/index.css +21 -21
- package/es/modal/style/token.scss +115 -0
- package/es/model-selector/style/index.css +1 -1
- package/es/notification/style/index.css +44 -44
- package/es/notification/style/token.scss +241 -0
- package/es/number-flow/style/index.css +5 -5
- package/es/number-flow/style/token.scss +19 -0
- package/es/page-header/style/index.css +25 -25
- package/es/page-header/style/token.scss +139 -0
- package/es/pagination/style/index.css +85 -85
- package/es/pagination/style/token.scss +303 -0
- package/es/panel-group/style/index.css +7 -7
- package/es/panel-group/style/token.scss +28 -0
- package/es/popconfirm/style/index.css +18 -18
- package/es/popconfirm/style/token.scss +83 -0
- package/es/popover/style/index.css +12 -12
- package/es/popover/style/token.scss +58 -0
- package/es/progress/style/index.css +55 -55
- package/es/progress/style/token.scss +253 -0
- package/es/qr-code/style/index.css +18 -21
- package/es/qr-code/style/index.scss +4 -6
- package/es/qr-code/style/token.scss +59 -0
- package/es/radio/style/index.css +45 -44
- package/es/radio/style/index.scss +1 -0
- package/es/radio/style/token.scss +185 -0
- package/es/rate/style/index.css +8 -8
- package/es/rate/style/token.scss +19 -0
- package/es/regex-vis/style/index.css +51 -51
- package/es/regex-vis/style/token.scss +170 -0
- package/es/result/style/index.css +26 -26
- package/es/result/style/token.scss +139 -0
- package/es/rich-text-editor/style/index.css +31 -31
- package/es/rich-text-editor/style/token.scss +120 -0
- package/es/scrollbar/style/index.css +14 -14
- package/es/scrollbar/style/token.scss +33 -0
- package/es/secret/style/index.css +6 -6
- package/es/secret/style/token.scss +30 -0
- package/es/select/style/index.css +27 -27
- package/es/select/style/token.scss +151 -0
- package/es/selectable-card/style/index.css +53 -51
- package/es/selectable-card/style/index.scss +6 -2
- package/es/selectable-card/style/token.scss +60 -0
- package/es/sender/style/index.css +54 -54
- package/es/sender/style/token.scss +155 -0
- package/es/skeleton/style/index.css +12 -12
- package/es/skeleton/style/token.scss +60 -0
- package/es/slider/style/index.css +34 -34
- package/es/slider/style/token.scss +144 -0
- package/es/spin/style/index.css +11 -11
- package/es/spin/style/token.scss +60 -0
- package/es/split/style/index.css +2 -2
- package/es/split/style/token.scss +18 -0
- package/es/statistic/style/index.css +13 -13
- package/es/statistic/style/token.scss +73 -0
- package/es/steps/style/index.css +98 -98
- package/es/steps/style/token.scss +464 -0
- package/es/style/color/css-variables.scss +382 -381
- package/es/style/theme/css-variables.scss +329 -135
- package/es/style/theme/global.scss +5 -5
- package/es/style/theme/index.scss +1 -1
- package/es/style/theme/runtime.scss +29 -0
- package/es/switch/style/index.css +37 -37
- package/es/switch/style/token.scss +135 -0
- package/es/table/style/index.css +127 -127
- package/es/table/style/token.scss +425 -0
- package/es/tabs/style/index.css +196 -190
- package/es/tabs/style/index.scss +27 -17
- package/es/tabs/style/token.scss +534 -0
- package/es/tag/index.d.ts +13 -0
- package/es/tag/interface.d.ts +1 -0
- package/es/tag/style/index.css +159 -159
- package/es/tag/style/token.scss +513 -0
- package/es/tag/tag.vue.d.ts +13 -3
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +35 -8
- package/es/tag-group/style/index.css +3 -3
- package/es/tag-group/style/token.scss +9 -0
- package/es/textarea/style/index.css +40 -40
- package/es/time-picker/style/index.css +12 -12
- package/es/time-picker/style/token.scss +50 -0
- package/es/timeline/style/index.css +22 -22
- package/es/timeline/style/token.scss +75 -0
- package/es/toolbar/style/index.css +6 -6
- package/es/toolbar/style/token.scss +45 -0
- package/es/tooltip/style/index.css +8 -8
- package/es/tooltip/style/token.scss +46 -0
- package/es/tour/style/index.css +28 -28
- package/es/tour/style/token.scss +65 -0
- package/es/transfer/style/index.css +46 -45
- package/es/transfer/style/index.scss +4 -1
- package/es/transfer/style/token.scss +199 -0
- package/es/tree/style/index.css +43 -36
- package/es/tree/style/index.scss +10 -0
- package/es/tree/style/token.scss +163 -0
- package/es/tree-select/style/index.css +9 -9
- package/es/tree-select/style/token.scss +21 -0
- package/es/trigger/style/index.css +7 -7
- package/es/trigger/style/token.scss +19 -0
- package/es/typography/style/index.css +40 -40
- package/es/typography/style/token.scss +220 -0
- package/es/upload/index.d.ts +3 -0
- package/es/upload/style/index.css +95 -95
- package/es/upload/style/token.scss +470 -0
- package/es/upload/upload.vue.d.ts +2 -0
- package/es/upload/upload.vue_vue_type_script_setup_true_lang.js +109 -16
- package/json/vetur-attributes.json +7 -0
- package/json/vetur-tags.json +4 -1
- package/json/web-types.json +18 -2
- package/package.json +7 -2
- package/es/style/color/palette-dark.d.ts +0 -4
- package/es/style/color/palette-dark.js +0 -10
- package/es/style/color/palette.d.ts +0 -4
- package/es/style/color/palette.js +0 -10
|
@@ -26,20 +26,29 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
26
26
|
var _ref, _popupContainer$value;
|
|
27
27
|
return (_ref = (_popupContainer$value = popupContainer.value) !== null && _popupContainer$value !== void 0 ? _popupContainer$value : parentPopupContainer === null || parentPopupContainer === void 0 ? void 0 : parentPopupContainer.value) !== null && _ref !== void 0 ? _ref : null;
|
|
28
28
|
}));
|
|
29
|
-
const normalizedTheme = computed(() => normalizeTheme(props.theme));
|
|
30
29
|
const parentTheme = inject(inheritedThemeInjectionKey, void 0);
|
|
31
|
-
const
|
|
30
|
+
const inheritedMode = shallowRef();
|
|
31
|
+
const effectiveMode = computed(() => {
|
|
32
|
+
var _props$themeMode, _props$theme;
|
|
33
|
+
return (_props$themeMode = props.themeMode) !== null && _props$themeMode !== void 0 ? _props$themeMode : ((_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.algorithm) === null || _props$theme === void 0 ? void 0 : _props$theme.includes("dark")) ? "dark" : void 0;
|
|
34
|
+
});
|
|
32
35
|
const popupMode = computed(() => {
|
|
33
|
-
var
|
|
34
|
-
return (
|
|
36
|
+
var _ref2, _effectiveMode$value;
|
|
37
|
+
return (_ref2 = (_effectiveMode$value = effectiveMode.value) !== null && _effectiveMode$value !== void 0 ? _effectiveMode$value : parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.mode.value) !== null && _ref2 !== void 0 ? _ref2 : inheritedMode.value;
|
|
38
|
+
});
|
|
39
|
+
const normalizedTheme = computed(() => {
|
|
40
|
+
var _props$theme$algorith;
|
|
41
|
+
if (!props.theme) return normalizeTheme();
|
|
42
|
+
return normalizeTheme(_objectSpread2(_objectSpread2({}, props.theme), {}, { algorithm: [...((_props$theme$algorith = props.theme.algorithm) !== null && _props$theme$algorith !== void 0 ? _props$theme$algorith : []).filter((algorithm) => algorithm !== "dark"), ...popupMode.value === "dark" ? ["dark"] : []] }));
|
|
35
43
|
});
|
|
44
|
+
const popupVariables = computed(() => _objectSpread2(_objectSpread2({}, parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.variables.value), getThemeCSSVariables(normalizedTheme.value)));
|
|
36
45
|
provide(inheritedThemeInjectionKey, {
|
|
37
46
|
variables: popupVariables,
|
|
38
47
|
mode: popupMode
|
|
39
48
|
});
|
|
40
49
|
const usesLocalThemeContainer = computed(() => {
|
|
41
50
|
if (props.global) return false;
|
|
42
|
-
return Boolean(
|
|
51
|
+
return Boolean(effectiveMode.value) || Object.keys(normalizedTheme.value.tokens).length > 0 || Object.keys(normalizedTheme.value.components).length > 0;
|
|
43
52
|
});
|
|
44
53
|
const themePopupContainerPrefixCls = getPrefixCls("theme-popup-container");
|
|
45
54
|
const { zIndex, close: closePopupManager } = usePopupManager("popup", { visible: usesLocalThemeContainer });
|
|
@@ -54,6 +63,8 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
54
63
|
let activeTarget = null;
|
|
55
64
|
let activeTargetIsGlobal = false;
|
|
56
65
|
const globalOwner = Symbol("ThemeProvider");
|
|
66
|
+
let inheritedModeObserver;
|
|
67
|
+
let observedModeSource = null;
|
|
57
68
|
function cleanupPopupContainer() {
|
|
58
69
|
if (!popupContainer.value) return;
|
|
59
70
|
clearThemeCSSVariables(popupContainer.value, appliedPopupThemeKeys);
|
|
@@ -80,8 +91,9 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
80
91
|
popupContainer.value.style.zIndex = String(zIndex.value);
|
|
81
92
|
appliedPopupThemeKeys = applyThemeCSSVariableMap(popupContainer.value, popupVariables.value, appliedPopupThemeKeys);
|
|
82
93
|
const inheritedThemeMode = (_popupMode$value = popupMode.value) !== null && _popupMode$value !== void 0 ? _popupMode$value : (_target$closest = target.closest("[sd-theme]")) === null || _target$closest === void 0 ? void 0 : _target$closest.getAttribute("sd-theme");
|
|
83
|
-
if (inheritedThemeMode)
|
|
84
|
-
|
|
94
|
+
if (inheritedThemeMode) {
|
|
95
|
+
if (popupContainer.value.getAttribute("sd-theme") !== inheritedThemeMode) popupContainer.value.setAttribute("sd-theme", inheritedThemeMode);
|
|
96
|
+
} else if (popupContainer.value.hasAttribute("sd-theme")) popupContainer.value.removeAttribute("sd-theme");
|
|
85
97
|
}
|
|
86
98
|
function resolveThemeTarget() {
|
|
87
99
|
if (typeof document === "undefined") return null;
|
|
@@ -101,21 +113,43 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
101
113
|
clearThemeCSSVariables(target, appliedThemeKeys);
|
|
102
114
|
appliedThemeKeys = /* @__PURE__ */ new Set();
|
|
103
115
|
target.removeAttribute("sd-theme");
|
|
116
|
+
target.removeAttribute("data-sd-theme");
|
|
104
117
|
}
|
|
105
118
|
}
|
|
106
119
|
function syncThemeTarget() {
|
|
120
|
+
var _nextTarget$closest, _nextTarget$parentEle, _nextTarget$parentEle2, _source$getAttribute;
|
|
107
121
|
const nextTarget = resolveThemeTarget();
|
|
108
122
|
if (!nextTarget) {
|
|
123
|
+
inheritedModeObserver === null || inheritedModeObserver === void 0 || inheritedModeObserver.disconnect();
|
|
124
|
+
inheritedModeObserver = void 0;
|
|
125
|
+
observedModeSource = null;
|
|
126
|
+
inheritedMode.value = void 0;
|
|
109
127
|
resetActiveTarget();
|
|
110
128
|
cleanupPopupContainer();
|
|
111
129
|
return;
|
|
112
130
|
}
|
|
113
131
|
if (activeTarget && activeTarget !== nextTarget) cleanupTarget(activeTarget);
|
|
114
|
-
|
|
132
|
+
const source = props.global ? (_nextTarget$closest = nextTarget.closest("[sd-theme], [data-sd-theme]")) !== null && _nextTarget$closest !== void 0 ? _nextTarget$closest : nextTarget : (_nextTarget$parentEle = (_nextTarget$parentEle2 = nextTarget.parentElement) === null || _nextTarget$parentEle2 === void 0 ? void 0 : _nextTarget$parentEle2.closest("[sd-theme], [data-sd-theme]")) !== null && _nextTarget$parentEle !== void 0 ? _nextTarget$parentEle : document.body;
|
|
133
|
+
inheritedMode.value = ((_source$getAttribute = source.getAttribute("sd-theme")) !== null && _source$getAttribute !== void 0 ? _source$getAttribute : source.getAttribute("data-sd-theme")) === "dark" ? "dark" : "light";
|
|
134
|
+
if (props.global) applyGlobalTheme(nextTarget, globalOwner, normalizedTheme.value, effectiveMode.value);
|
|
115
135
|
else {
|
|
136
|
+
var _popupMode$value2;
|
|
116
137
|
appliedThemeKeys = applyThemeCSSVariables(nextTarget, normalizedTheme.value, appliedThemeKeys);
|
|
117
|
-
if (
|
|
118
|
-
|
|
138
|
+
if (effectiveMode.value) {
|
|
139
|
+
if (nextTarget.getAttribute("sd-theme") !== effectiveMode.value) nextTarget.setAttribute("sd-theme", effectiveMode.value);
|
|
140
|
+
} else if (nextTarget.hasAttribute("sd-theme")) nextTarget.removeAttribute("sd-theme");
|
|
141
|
+
const resolvedMode = (_popupMode$value2 = popupMode.value) !== null && _popupMode$value2 !== void 0 ? _popupMode$value2 : "light";
|
|
142
|
+
if (nextTarget.getAttribute("data-sd-theme") !== resolvedMode) nextTarget.setAttribute("data-sd-theme", resolvedMode);
|
|
143
|
+
}
|
|
144
|
+
if (observedModeSource !== source) {
|
|
145
|
+
inheritedModeObserver === null || inheritedModeObserver === void 0 || inheritedModeObserver.disconnect();
|
|
146
|
+
observedModeSource = source;
|
|
147
|
+
inheritedModeObserver = new MutationObserver(syncThemeTarget);
|
|
148
|
+
inheritedModeObserver.observe(source, {
|
|
149
|
+
attributes: true,
|
|
150
|
+
attributeFilter: ["sd-theme", "data-sd-theme"],
|
|
151
|
+
subtree: true
|
|
152
|
+
});
|
|
119
153
|
}
|
|
120
154
|
activeTarget = nextTarget;
|
|
121
155
|
activeTargetIsGlobal = props.global;
|
|
@@ -125,7 +159,7 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
125
159
|
normalizedTheme,
|
|
126
160
|
popupVariables,
|
|
127
161
|
popupMode,
|
|
128
|
-
|
|
162
|
+
effectiveMode,
|
|
129
163
|
() => props.global,
|
|
130
164
|
usesLocalThemeContainer,
|
|
131
165
|
rootElement
|
|
@@ -135,6 +169,7 @@ var theme_provider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
135
169
|
flush: "post"
|
|
136
170
|
});
|
|
137
171
|
onBeforeUnmount(() => {
|
|
172
|
+
inheritedModeObserver === null || inheritedModeObserver === void 0 || inheritedModeObserver.disconnect();
|
|
138
173
|
cleanupTarget(activeTarget);
|
|
139
174
|
cleanupPopupContainer();
|
|
140
175
|
activeTarget = null;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type SdThemeSeed } from './algorithms';
|
|
2
|
+
export { normalizeTokenKey } from './token-key';
|
|
1
3
|
export type ThemeTokenValue = string | number;
|
|
2
4
|
export type ThemeTokenMap = Record<string, ThemeTokenValue>;
|
|
3
5
|
export interface SdThemeMeta {
|
|
@@ -7,6 +9,8 @@ export interface SdThemeMeta {
|
|
|
7
9
|
}
|
|
8
10
|
export type SdThemeMode = 'light' | 'dark';
|
|
9
11
|
export interface SdThemeConfig {
|
|
12
|
+
seed?: SdThemeSeed;
|
|
13
|
+
algorithm?: Array<'dark' | 'compact'>;
|
|
10
14
|
tokens?: ThemeTokenMap;
|
|
11
15
|
components?: Record<string, ThemeTokenMap>;
|
|
12
16
|
meta?: SdThemeMeta;
|
|
@@ -19,7 +23,6 @@ export interface SDThemeNormalized {
|
|
|
19
23
|
components: Record<string, ThemeTokenMap>;
|
|
20
24
|
meta: Required<Pick<SdThemeMeta, 'schemaVersion' | 'cssVarPrefix'>> & Pick<SdThemeMeta, 'name'>;
|
|
21
25
|
}
|
|
22
|
-
export declare function normalizeTokenKey(key: string): string;
|
|
23
26
|
export declare function normalizeTheme(theme?: SdThemeConfig): SDThemeNormalized;
|
|
24
27
|
export declare function resolveThemeToken(theme: SDThemeNormalized, componentName: string, tokenKey: string): ThemeTokenValue | undefined;
|
|
25
28
|
export declare function getThemeCSSVariables(theme: SDThemeNormalized): Record<string, string>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { deriveThemeTokens } from "./algorithms.js";
|
|
3
|
+
import { normalizeTokenKey } from "./token-key.js";
|
|
2
4
|
//#region components/config-provider/theme.ts
|
|
3
5
|
var DEFAULT_THEME_META = {
|
|
4
6
|
schemaVersion: 1,
|
|
@@ -9,7 +11,9 @@ var RESERVED_THEME_KEYS = /* @__PURE__ */ new Set([
|
|
|
9
11
|
"components",
|
|
10
12
|
"meta",
|
|
11
13
|
"token",
|
|
12
|
-
"component"
|
|
14
|
+
"component",
|
|
15
|
+
"seed",
|
|
16
|
+
"algorithm"
|
|
13
17
|
]);
|
|
14
18
|
function normalizeCssVarPrefix(prefix) {
|
|
15
19
|
if (!prefix) return "--";
|
|
@@ -18,9 +22,6 @@ function normalizeCssVarPrefix(prefix) {
|
|
|
18
22
|
if (trimmed.startsWith("--")) return trimmed.endsWith("-") ? trimmed : `${trimmed}-`;
|
|
19
23
|
return `--${trimmed.replace(/^-+/, "")}${trimmed.endsWith("-") ? "" : "-"}`;
|
|
20
24
|
}
|
|
21
|
-
function normalizeTokenKey(key) {
|
|
22
|
-
return key.trim().replace(/([a-z\d])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])(\d+)/g, "$1-$2").replace(/(\d+)([a-zA-Z])/g, "$1-$2").replace(/[_\s]+/g, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "").toLowerCase();
|
|
23
|
-
}
|
|
24
25
|
function normalizeTokenMap(tokens) {
|
|
25
26
|
if (!tokens || typeof tokens !== "object") return {};
|
|
26
27
|
const normalized = {};
|
|
@@ -64,7 +65,7 @@ function normalizeTheme(theme) {
|
|
|
64
65
|
cssVarPrefix: normalizeCssVarPrefix((_theme$meta$cssVarPre = (_theme$meta3 = theme.meta) === null || _theme$meta3 === void 0 ? void 0 : _theme$meta3.cssVarPrefix) !== null && _theme$meta$cssVarPre !== void 0 ? _theme$meta$cssVarPre : DEFAULT_THEME_META.cssVarPrefix)
|
|
65
66
|
};
|
|
66
67
|
return {
|
|
67
|
-
tokens: _objectSpread2(_objectSpread2({}, legacyRootTokens), themeTokens),
|
|
68
|
+
tokens: _objectSpread2(_objectSpread2(_objectSpread2({}, deriveThemeTokens(theme)), legacyRootTokens), themeTokens),
|
|
68
69
|
components: normalizeComponentTokenMap((_theme$components = theme.components) !== null && _theme$components !== void 0 ? _theme$components : theme.component),
|
|
69
70
|
meta
|
|
70
71
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeTokenKey(key: string): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region components/config-provider/token-key.ts
|
|
2
|
+
function normalizeTokenKey(key) {
|
|
3
|
+
return key.trim().replace(/([a-z\d])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])(\d+)/g, "$1-$2").replace(/(\d+)([a-zA-Z])/g, "$1-$2").replace(/[_\s]+/g, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "").toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
export { normalizeTokenKey };
|
package/es/copy/style/index.css
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/******** radius *******/
|
|
17
17
|
/********* icon hover *********/
|
|
18
18
|
.sd-copy {
|
|
19
|
-
border-radius: 4px;
|
|
19
|
+
border-radius: var(--component-copy-copy-border-radius, var(--component-copy-border-radius, var(--border-radius-small, 4px)));
|
|
20
20
|
}
|
|
21
21
|
.sd-copy.sd-copy-inherit {
|
|
22
22
|
color: inherit;
|
package/es/copy/style/token.scss
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
@use '@style/theme/runtime.scss' as theme-runtime;
|
|
1
2
|
@use '@style/theme/index.scss' as global;
|
|
2
3
|
|
|
3
4
|
$copy-border-radius: global.$border-radius-small;
|
|
5
|
+
|
|
6
|
+
// @generated runtime tokens — pnpm theme:generate
|
|
7
|
+
$copy-border-radius: theme-runtime.token(
|
|
8
|
+
'copy',
|
|
9
|
+
'copy-border-radius',
|
|
10
|
+
$copy-border-radius,
|
|
11
|
+
'border-radius-small'
|
|
12
|
+
);
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
position: relative;
|
|
20
20
|
display: block;
|
|
21
21
|
width: var(--sd-cropper-width, 100%);
|
|
22
|
-
min-width: 200px;
|
|
22
|
+
min-width: var(--component-cropper-cropper-min-width, var(--component-cropper-min-width, 200px));
|
|
23
23
|
height: var(--sd-cropper-height, 100%);
|
|
24
|
-
min-height: 120px;
|
|
24
|
+
min-height: var(--component-cropper-cropper-min-height, var(--component-cropper-min-height, 120px));
|
|
25
25
|
overflow: hidden;
|
|
26
|
-
background-color: var(--sd-color-neutral-2);
|
|
27
|
-
border: 1px solid var(--sd-color-neutral-3);
|
|
28
|
-
border-radius: 6px;
|
|
26
|
+
background-color: var(--component-cropper-cropper-background-color, var(--component-cropper-background-color, var(--color-fill-2, var(--sd-color-fill-2, var(--sd-color-neutral-2)))));
|
|
27
|
+
border: 1px solid var(--component-cropper-cropper-border-color, var(--component-cropper-border-color, var(--color-border-2, var(--sd-color-border-2, var(--sd-color-neutral-3)))));
|
|
28
|
+
border-radius: var(--component-cropper-cropper-border-radius, var(--component-cropper-border-radius, var(--border-radius-medium, 6px)));
|
|
29
29
|
}
|
|
30
30
|
.sd-cropper-source-image {
|
|
31
31
|
display: block;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
.sd-cropper cropper-canvas {
|
|
39
39
|
width: var(--sd-cropper-width, 100%);
|
|
40
40
|
height: var(--sd-cropper-height, 100%);
|
|
41
|
-
background-color: var(--sd-color-neutral-2);
|
|
41
|
+
background-color: var(--component-cropper-cropper-background-color, var(--component-cropper-background-color, var(--color-fill-2, var(--sd-color-fill-2, var(--sd-color-neutral-2)))));
|
|
42
42
|
}
|
|
43
43
|
.sd-cropper cropper-image,
|
|
44
44
|
.sd-cropper cropper-selection,
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
.sd-cropper cropper-shade,
|
|
48
48
|
.sd-cropper cropper-viewer,
|
|
49
49
|
.sd-cropper cropper-crosshair {
|
|
50
|
-
color: rgb(var(--primary-6));
|
|
50
|
+
color: var(--component-cropper-cropper-theme-color, var(--component-cropper-theme-color, rgb(var(--primary-6))));
|
|
51
51
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use '@style/theme/runtime.scss' as theme-runtime;
|
|
1
2
|
@use '@style/theme/index.scss' as global;
|
|
2
3
|
|
|
3
4
|
$cropper-background-color: global.$color-fill-2;
|
|
@@ -6,3 +7,26 @@ $cropper-border-radius: global.$border-radius-medium;
|
|
|
6
7
|
$cropper-min-width: 200px;
|
|
7
8
|
$cropper-min-height: 120px;
|
|
8
9
|
$cropper-theme-color: rgb(var(--primary-6));
|
|
10
|
+
|
|
11
|
+
// @generated runtime tokens — pnpm theme:generate
|
|
12
|
+
$cropper-background-color: theme-runtime.token(
|
|
13
|
+
'cropper',
|
|
14
|
+
'cropper-background-color',
|
|
15
|
+
$cropper-background-color,
|
|
16
|
+
'color-fill-2'
|
|
17
|
+
);
|
|
18
|
+
$cropper-border-color: theme-runtime.token(
|
|
19
|
+
'cropper',
|
|
20
|
+
'cropper-border-color',
|
|
21
|
+
$cropper-border-color,
|
|
22
|
+
'color-border-2'
|
|
23
|
+
);
|
|
24
|
+
$cropper-border-radius: theme-runtime.token(
|
|
25
|
+
'cropper',
|
|
26
|
+
'cropper-border-radius',
|
|
27
|
+
$cropper-border-radius,
|
|
28
|
+
'border-radius-medium'
|
|
29
|
+
);
|
|
30
|
+
$cropper-min-width: theme-runtime.token('cropper', 'cropper-min-width', $cropper-min-width);
|
|
31
|
+
$cropper-min-height: theme-runtime.token('cropper', 'cropper-min-height', $cropper-min-height);
|
|
32
|
+
$cropper-theme-color: theme-runtime.token('cropper', 'cropper-theme-color', $cropper-theme-color);
|