@snowui-design-system/components 0.3.0-alpha.12 → 0.3.0-alpha.14
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/AGENTS.md +9 -1
- package/README.md +6 -4
- package/THIRD_PARTY_NOTICES.md +85 -0
- package/component-catalog.json +65 -0
- package/dist/client/components/Accordion.js +1 -1
- package/dist/client/components/AccordionItem.js +1 -1
- package/dist/client/components/Avatar.js +122 -63
- package/dist/client/components/Button.js +1 -1
- package/dist/client/components/Card.js +10 -0
- package/dist/client/components/CodeBlock.js +38 -10
- package/dist/client/components/Dialog.js +3 -13
- package/dist/client/components/Icon.js +92 -24
- package/dist/client/components/Image.js +21 -10
- package/dist/client/components/Indicator.js +77 -6
- package/dist/client/components/Input.js +192 -94
- package/dist/client/components/MetricCard.d.ts +13 -0
- package/dist/client/components/MetricCard.js +179 -0
- package/dist/client/components/OTPInput.d.ts +2 -1
- package/dist/client/components/OTPInput.js +117 -63
- package/dist/client/components/PasswordStrength.d.ts +20 -0
- package/dist/client/components/PasswordStrength.js +145 -0
- package/dist/client/components/SnowUILogo.d.ts +1 -0
- package/dist/client/components/SnowUILogo.js +11 -7
- package/dist/client/components/StyleButton.js +2 -0
- package/dist/client/i18n/messages.d.ts +2 -2
- package/dist/client/i18n/messages.js +17 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -0
- package/dist/client/internal/component-icon/builtin-icon-data.js +14 -0
- package/dist/client/styles/auto-layout.css +1 -1
- package/dist/client/styles/components.css +9 -5
- package/dist/client/styles/layout.css +2 -2
- package/dist/client/styles/scale.css +16 -16
- package/dist/client/styles/scrollbar.css +1 -1
- package/dist/client/styles/themes.css +1 -1
- package/dist/server/components/Accordion.js +1 -1
- package/dist/server/components/AccordionItem.js +1 -1
- package/dist/server/components/Avatar.js +42 -7
- package/dist/server/components/Button.js +1 -1
- package/dist/server/components/Card.js +2 -0
- package/dist/server/components/CodeBlock.js +29 -6
- package/dist/server/components/Dialog.js +3 -10
- package/dist/server/components/Icon.js +37 -2
- package/dist/server/components/Image.js +3 -1
- package/dist/server/components/Indicator.js +6 -3
- package/dist/server/components/Input.js +63 -5
- package/dist/server/components/MetricCard.d.ts +13 -0
- package/dist/server/components/MetricCard.js +104 -0
- package/dist/server/components/OTPInput.d.ts +2 -1
- package/dist/server/components/OTPInput.js +66 -35
- package/dist/server/components/PasswordStrength.d.ts +20 -0
- package/dist/server/components/PasswordStrength.js +105 -0
- package/dist/server/components/SnowUILogo.d.ts +1 -0
- package/dist/server/components/SnowUILogo.js +5 -3
- package/dist/server/components/StyleButton.js +2 -0
- package/dist/server/i18n/messages.d.ts +2 -2
- package/dist/server/i18n/messages.js +17 -1
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +2 -0
- package/dist/server/internal/component-icon/builtin-icon-data.js +14 -0
- package/dist/server/styles/auto-layout.css +1 -1
- package/dist/server/styles/components.css +9 -5
- package/dist/server/styles/layout.css +2 -2
- package/dist/server/styles/scale.css +16 -16
- package/dist/server/styles/scrollbar.css +1 -1
- package/dist/server/styles/themes.css +1 -1
- package/package.json +4 -3
|
@@ -21,6 +21,7 @@ export default function SnowUILogo($$renderer, $$props) {
|
|
|
21
21
|
scale = 1,
|
|
22
22
|
compactProgress = 0,
|
|
23
23
|
idleMotion = false,
|
|
24
|
+
hoverMotion = false,
|
|
24
25
|
textMotion = "greetings",
|
|
25
26
|
decorative = false,
|
|
26
27
|
role = undefined,
|
|
@@ -177,6 +178,9 @@ export default function SnowUILogo($$renderer, $$props) {
|
|
|
177
178
|
const run = ++generation;
|
|
178
179
|
|
|
179
180
|
nodeStartedAt = performance.now();
|
|
181
|
+
|
|
182
|
+
if (index >= 0) emojiMetrics[index] = measureLogoEmoji(greetings[index][0]);
|
|
183
|
+
|
|
180
184
|
greetingIndex = index;
|
|
181
185
|
|
|
182
186
|
// 等 Svelte 提交所有字母和图标后,再由实际 transition end 判断完成。
|
|
@@ -222,7 +226,7 @@ export default function SnowUILogo($$renderer, $$props) {
|
|
|
222
226
|
}
|
|
223
227
|
|
|
224
228
|
function handleMouseEnter(event) {
|
|
225
|
-
if (!prefersReducedMotion()) {
|
|
229
|
+
if (hoverMotion && !prefersReducedMotion()) {
|
|
226
230
|
hovered = true;
|
|
227
231
|
resumeRequested = performance.now() <= resumeUntil;
|
|
228
232
|
reconcileHover();
|
|
@@ -240,8 +244,6 @@ export default function SnowUILogo($$renderer, $$props) {
|
|
|
240
244
|
}
|
|
241
245
|
|
|
242
246
|
onMount(() => {
|
|
243
|
-
emojiMetrics = greetings.map(([emoji]) => measureLogoEmoji(emoji));
|
|
244
|
-
|
|
245
247
|
const preference = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
246
248
|
|
|
247
249
|
reducedMotion = preference.matches;
|
|
@@ -49,8 +49,10 @@ export default function StyleButton($$renderer, $$props) {
|
|
|
49
49
|
|
|
50
50
|
if (nextMode === "apple") {
|
|
51
51
|
document.documentElement.setAttribute("mode", "ios");
|
|
52
|
+
document.body?.setAttribute("mode", "ios");
|
|
52
53
|
} else {
|
|
53
54
|
document.documentElement.removeAttribute("mode");
|
|
55
|
+
document.body?.removeAttribute("mode");
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../
|
|
1
|
+
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../docs/standards/LocalizationSpec.md */
|
|
2
2
|
export declare const DEFAULT_LOCALE = "zh-CN";
|
|
3
|
-
export type SnowUIMessageKey = "copyButton.copy" | "copyButton.copied" | "codeBlock.copyCode" | "codeBlock.fullscreen" | "codeBlock.exitFullscreen" | "codeBlock.resize" | "codeBlock.fullscreenDialog" | "expandButton.expand" | "expandButton.collapse" | "sidebarSection.expand" | "sidebarSection.collapse" | "breadcrumb.navigation" | "pagination.navigation" | "spinner.loading" | "scrollArea.content" | "barChart.name" | "barChart.cells" | "lineChart.name" | "lineChart.cells" | "circularChart.name" | "gaugeChart.name" | "chartGroup.name" | "chartGroup.cells" | "chartGroup.cell" | "searchBox.placeholder" | "searchBox.clear" | "sidePanel.title" | "slider.title" | "menuItem.deleteCustom" | "listbox.search" | "tag.close" | "sidebar.navigation" | "sidebar.expand" | "sidebar.collapse" | "sidebarItem.updated" | "sidebar.resize" | "pagination.pageSize" | "pagination.previous" | "pagination.next" | "pagination.page" | "otpInput.invalidCode" | "input.clear" | "input.increment" | "input.decrement" | "input.openTime" | "input.openDate" | "input.year" | "input.month" | "input.day" | "input.week" | "input.hour" | "input.minute" | "input.second" | "input.yearPlaceholder" | "input.monthPlaceholder" | "input.dayPlaceholder" | "input.weekPlaceholder" | "imageViewer.previous" | "imageViewer.next" | "imageViewer.close" | "toast.close" | "table.scrollRegion" | "table.scrollRegionNamed" | "tableHead.selectAll" | "tableHead.resizeColumn" | "tableHead.resizeColumnGeneric" | "tableCell.selectRow" | "text.expand" | "textarea.resize" | "indicator.resizeWidth" | "indicator.resizeHeight" | "indicator.resizeBoth" | "colorSchemeButton.toLight" | "colorSchemeButton.toDark" | "styleButton.toSnowUI" | "styleButton.toApple" | "sidePanel.placement.toInline" | "sidePanel.placement.toFloating" | "sidePanel.previous" | "sidePanel.next" | "sidePanel.copy" | "sidePanel.delete" | "sidePanel.cancel" | "sidePanel.save" | "sidePanel.close" | "sidePanel.resize" | "tableToolbar.name" | "tableToolbar.search" | "tableToolbar.sort" | "tableToolbar.filter" | "tableToolbar.clear" | "tableToolbar.copy" | "tableToolbar.delete" | "tableToolbar.selected" | "tableToolbar.deleting" | "tableToolbar.defaultSort" | "tableToolbar.ascending" | "tableToolbar.descending" | "tableToolbar.defaultFilter" | "overflowActions.more" | "dialog.close";
|
|
3
|
+
export type SnowUIMessageKey = "copyButton.copy" | "copyButton.copied" | "codeBlock.copyCode" | "codeBlock.fullscreen" | "codeBlock.exitFullscreen" | "codeBlock.resize" | "codeBlock.fullscreenDialog" | "expandButton.expand" | "expandButton.collapse" | "sidebarSection.expand" | "sidebarSection.collapse" | "breadcrumb.navigation" | "pagination.navigation" | "spinner.loading" | "scrollArea.content" | "barChart.name" | "barChart.cells" | "lineChart.name" | "lineChart.cells" | "circularChart.name" | "gaugeChart.name" | "chartGroup.name" | "chartGroup.cells" | "chartGroup.cell" | "searchBox.placeholder" | "searchBox.clear" | "sidePanel.title" | "slider.title" | "menuItem.deleteCustom" | "listbox.search" | "tag.close" | "sidebar.navigation" | "sidebar.expand" | "sidebar.collapse" | "sidebarItem.updated" | "sidebar.resize" | "pagination.pageSize" | "pagination.previous" | "pagination.next" | "pagination.page" | "otpInput.invalidCode" | "input.clear" | "input.showPassword" | "input.hidePassword" | "passwordStrength.minimumLength" | "passwordStrength.requirements" | "passwordStrength.lowercase" | "passwordStrength.uppercase" | "passwordStrength.number" | "passwordStrength.symbol" | "input.increment" | "input.decrement" | "input.openTime" | "input.openDate" | "input.year" | "input.month" | "input.day" | "input.week" | "input.hour" | "input.minute" | "input.second" | "input.yearPlaceholder" | "input.monthPlaceholder" | "input.dayPlaceholder" | "input.weekPlaceholder" | "imageViewer.previous" | "imageViewer.next" | "imageViewer.close" | "toast.close" | "table.scrollRegion" | "table.scrollRegionNamed" | "tableHead.selectAll" | "tableHead.resizeColumn" | "tableHead.resizeColumnGeneric" | "tableCell.selectRow" | "text.expand" | "textarea.resize" | "indicator.resizeWidth" | "indicator.resizeHeight" | "indicator.resizeBoth" | "colorSchemeButton.toLight" | "colorSchemeButton.toDark" | "styleButton.toSnowUI" | "styleButton.toApple" | "sidePanel.placement.toInline" | "sidePanel.placement.toFloating" | "sidePanel.previous" | "sidePanel.next" | "sidePanel.copy" | "sidePanel.delete" | "sidePanel.cancel" | "sidePanel.save" | "sidePanel.close" | "sidePanel.resize" | "tableToolbar.name" | "tableToolbar.search" | "tableToolbar.sort" | "tableToolbar.filter" | "tableToolbar.clear" | "tableToolbar.copy" | "tableToolbar.delete" | "tableToolbar.selected" | "tableToolbar.deleting" | "tableToolbar.defaultSort" | "tableToolbar.ascending" | "tableToolbar.descending" | "tableToolbar.defaultFilter" | "overflowActions.more" | "dialog.close";
|
|
4
4
|
export type SnowUIMessageValues = Record<string, string | number>;
|
|
5
5
|
export type SnowUIMessageOverrides = Partial<Record<SnowUIMessageKey, string>>;
|
|
6
6
|
export declare const SNOWUI_MESSAGES: Record<string, Record<SnowUIMessageKey, string>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
|
|
2
2
|
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
3
|
-
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../
|
|
3
|
+
/** SnowUI 组件内置 UI 文案 catalog。文档: ../../../docs/standards/LocalizationSpec.md */
|
|
4
4
|
export const DEFAULT_LOCALE = "zh-CN";
|
|
5
5
|
export const SNOWUI_MESSAGES = {
|
|
6
6
|
"zh-CN": {
|
|
@@ -46,6 +46,14 @@ export const SNOWUI_MESSAGES = {
|
|
|
46
46
|
"pagination.page": "第 {{page}} 页",
|
|
47
47
|
"otpInput.invalidCode": "请输入 {{length}} 位数字验证码",
|
|
48
48
|
"input.clear": "清除输入",
|
|
49
|
+
"input.showPassword": "显示密码",
|
|
50
|
+
"input.hidePassword": "隐藏密码",
|
|
51
|
+
"passwordStrength.minimumLength": "密码至少需要 {{length}} 个字符",
|
|
52
|
+
"passwordStrength.requirements": "密码还需包含:{{requirements}}",
|
|
53
|
+
"passwordStrength.lowercase": "小写字母",
|
|
54
|
+
"passwordStrength.uppercase": "大写字母",
|
|
55
|
+
"passwordStrength.number": "数字",
|
|
56
|
+
"passwordStrength.symbol": "特殊字符(例如 ! @ # $ %)",
|
|
49
57
|
"input.increment": "增加数值",
|
|
50
58
|
"input.decrement": "减少数值",
|
|
51
59
|
"input.openTime": "打开时间选择",
|
|
@@ -149,6 +157,14 @@ export const SNOWUI_MESSAGES = {
|
|
|
149
157
|
"pagination.page": "Page {{page}}",
|
|
150
158
|
"otpInput.invalidCode": "Enter a {{length}}-digit verification code",
|
|
151
159
|
"input.clear": "Clear input",
|
|
160
|
+
"input.showPassword": "Show password",
|
|
161
|
+
"input.hidePassword": "Hide password",
|
|
162
|
+
"passwordStrength.minimumLength": "Password must be at least {{length}} characters",
|
|
163
|
+
"passwordStrength.requirements": "Password must also include: {{requirements}}",
|
|
164
|
+
"passwordStrength.lowercase": "a lowercase letter",
|
|
165
|
+
"passwordStrength.uppercase": "an uppercase letter",
|
|
166
|
+
"passwordStrength.number": "a number",
|
|
167
|
+
"passwordStrength.symbol": "a special character (e.g. ! @ # $ %)",
|
|
152
168
|
"input.increment": "Increase value",
|
|
153
169
|
"input.decrement": "Decrease value",
|
|
154
170
|
"input.openTime": "Open time picker",
|
package/dist/server/index.d.ts
CHANGED
|
@@ -126,3 +126,5 @@ export * from './blocks';
|
|
|
126
126
|
export * from './lib/split-pane';
|
|
127
127
|
export { default as SearchPopup, type SearchPopupItem } from "./blocks/SearchPopup.js";
|
|
128
128
|
export { default as BlurText } from "./components/BlurText.js";
|
|
129
|
+
export { default as MetricCard } from "./components/MetricCard.js";
|
|
130
|
+
export { default as PasswordStrength, evaluatePasswordStrength, type PasswordStrengthLevel, type PasswordStrengthEvaluator } from "./components/PasswordStrength.js";
|
package/dist/server/index.js
CHANGED
|
@@ -116,3 +116,5 @@ export * from './blocks/index.js';
|
|
|
116
116
|
export * from './lib/split-pane.js';
|
|
117
117
|
export { default as SearchPopup } from "./blocks/SearchPopup.js";
|
|
118
118
|
export { default as BlurText } from "./components/BlurText.js";
|
|
119
|
+
export { default as MetricCard } from "./components/MetricCard.js";
|
|
120
|
+
export { default as PasswordStrength, evaluatePasswordStrength } from "./components/PasswordStrength.js";
|
|
@@ -126,6 +126,20 @@ export const BUILTIN_ICON_DATA = {
|
|
|
126
126
|
"regular": "<path fill=\"currentColor\" d=\"M27 4H11a1 1 0 0 0-1 1v5H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1m-7 22H6V12h14zm6-6h-4v-9a1 1 0 0 0-1-1h-9V6h14z\"/>"
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
+
"eye": {
|
|
130
|
+
"sourceCollection": "phosphor",
|
|
131
|
+
"viewBox": "0 0 32 32",
|
|
132
|
+
"weights": {
|
|
133
|
+
"regular": "<path fill=\"currentColor\" d=\"M30.914 15.595c-.044-.099-1.103-2.447-3.457-4.801C24.322 7.657 20.36 6 16 6S7.679 7.657 4.542 10.794C2.19 13.148 1.125 15.5 1.086 15.595a1 1 0 0 0 0 .812c.044.1 1.103 2.447 3.456 4.8C7.68 24.344 11.64 26 16 26s8.321-1.657 11.458-4.792c2.353-2.354 3.412-4.702 3.456-4.8a1 1 0 0 0 0-.813M16 24c-3.847 0-7.209-1.399-9.991-4.156A16.7 16.7 0 0 1 3.125 16a16.7 16.7 0 0 1 2.884-3.844C8.79 9.4 12.152 8 16 8s7.209 1.399 9.991 4.156A16.7 16.7 0 0 1 28.881 16c-.901 1.683-4.827 8-12.881 8m0-14a6 6 0 1 0 6 6 6.006 6.006 0 0 0-6-6m0 10a4 4 0 1 1 0-8 4 4 0 0 1 0 8\"/>"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"eye-slash": {
|
|
137
|
+
"sourceCollection": "phosphor",
|
|
138
|
+
"viewBox": "0 0 32 32",
|
|
139
|
+
"weights": {
|
|
140
|
+
"regular": "<path fill=\"currentColor\" d=\"M6.74 4.327a1 1 0 1 0-1.48 1.345L7.665 8.32c-4.54 2.786-6.493 7.081-6.579 7.276a1 1 0 0 0 0 .812c.044.1 1.103 2.447 3.456 4.8C7.68 24.344 11.64 26 16 26c2.24.013 4.459-.449 6.509-1.354l2.75 3.026a1 1 0 1 0 1.48-1.344zm5.916 9.48 5.209 5.732a4 4 0 0 1-5.209-5.732M16 24c-3.847 0-7.209-1.399-9.991-4.156A16.7 16.7 0 0 1 3.125 16c.586-1.099 2.457-4.174 5.919-6.173l2.25 2.47a6 6 0 0 0 7.957 8.75l1.842 2.024A14 14 0 0 1 16 24m.75-11.929a1 1 0 1 1 .375-1.965 6.02 6.02 0 0 1 4.846 5.33 1 1 0 0 1-.902 1.089 1 1 0 0 1-.094 0 1 1 0 0 1-1-.907 4.01 4.01 0 0 0-3.225-3.547m14.16 4.336c-.052.118-1.319 2.922-4.17 5.476a1 1 0 1 1-1.334-1.49A16.6 16.6 0 0 0 28.881 16a16.6 16.6 0 0 0-2.89-3.846C23.21 9.399 19.848 8 16 8c-.81-.001-1.62.065-2.42.196a1 1 0 1 1-.33-1.972A17 17 0 0 1 16 6c4.36 0 8.321 1.657 11.458 4.794 2.353 2.354 3.412 4.702 3.456 4.801a1 1 0 0 1 0 .812z\"/>"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
129
143
|
"funnel-simple": {
|
|
130
144
|
"sourceCollection": "phosphor",
|
|
131
145
|
"viewBox": "0 0 32 32",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Auto Layout Protocol
|
|
5
5
|
* v1.1.1
|
|
6
6
|
* Level 1: 三槽位布局模型与 Pin 布局的结构化原语
|
|
7
|
-
* 规范来源:
|
|
7
|
+
* 规范来源: docs/standards/LayoutProtocol.md
|
|
8
8
|
*
|
|
9
9
|
* 必须在 layout.css 之后加载,以取得 Frame 结构基础;覆盖优先级不依赖源码顺序。
|
|
10
10
|
* 全部规则固定置于低优先级 layer;该 layer 高于 Frame 方向基座、低于未分层组件样式。
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SnowUI Components Styles — 外部样式覆盖入口
|
|
5
5
|
*
|
|
6
6
|
* 外部覆盖意义:
|
|
7
|
-
* 本文件与
|
|
7
|
+
* 本文件与 docs/reference/ComponentStyleSheet.md §3 共同构成「外部样式覆盖体系」。
|
|
8
8
|
* 用户无需修改任何组件源文件,只需取消对应注释并赋值,即可覆盖单一组件的局部样式。
|
|
9
9
|
* · 变量名的权威来源 → 运行时代码实际消费的 --snowui-*-override;ComponentStyleSheet §3 为生成索引
|
|
10
10
|
* · 变量含义与默认值 → 对应组件源码与公开组件文档;本文件注释用于发现和快速参考
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* 1. 同步对应组件公开文档与本文件的名称 / 快速参考;
|
|
21
21
|
* 2. 在 specs/ 执行 `node scripts/generate-spec-index.mjs` 刷新 ComponentStyleSheet §3;
|
|
22
22
|
* 3. 在工作区根执行 `node scripts/check-standards.js`,双向核对运行时名称、生成索引和本文件注释入口。
|
|
23
|
-
* 详见
|
|
23
|
+
* 详见 docs/standards/StyleSpec.md §2.3.1、§2.9.2 与 docs/reference/ComponentStyleSheet.md §1。
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
:root {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
/* --snowui-accordion-line-height-override: ; */ /* Title line-height(默认 sm=var(--leading-14) md=var(--leading-16) lg=var(--leading-18)) */
|
|
43
43
|
/* --snowui-accordion-content-font-size-override: ; */ /* Content font-size(默认 sm=var(--text-12) md=var(--text-14) lg=var(--text-16)) */
|
|
44
44
|
/* --snowui-accordion-content-line-height-override: ; *//* Content line-height(默认 sm=var(--leading-12) md=var(--leading-14) lg=var(--leading-16)) */
|
|
45
|
-
/* --snowui-accordion-content-color-override: ; */ /* Content 文字颜色(默认 var(--black-
|
|
45
|
+
/* --snowui-accordion-content-color-override: ; */ /* Content 文字颜色(默认 var(--black-100);随 Light / Dark 主题自适应) */
|
|
46
46
|
/* --snowui-accordion-padding-y-override: ; */ /* Trigger 纵向 padding(默认 sm 8 / md 12 / lg 16) */
|
|
47
47
|
/* --snowui-accordion-padding-x-override: ; */ /* Trigger 横向 padding(default 默认 8;filled 默认 sm 12 / md 16 / lg 20) */
|
|
48
48
|
/* --snowui-accordion-content-padding-y-override: ; */ /* Content 纵向 padding(默认 sm 8 / md 12 / lg 16) */
|
|
@@ -440,7 +440,7 @@
|
|
|
440
440
|
|
|
441
441
|
/* ─────────────────────────────────────────
|
|
442
442
|
补充覆盖入口(尺寸 / 背景 / 边框 / 动效 / 状态等)
|
|
443
|
-
名称由运行时代码决定,并生成到
|
|
443
|
+
名称由运行时代码决定,并生成到 docs/reference/ComponentStyleSheet.md §3。
|
|
444
444
|
具体默认值见对应组件 .svelte 源码。
|
|
445
445
|
───────────────────────────────────────── */
|
|
446
446
|
|
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
/* ─────────────────────────────────────────
|
|
733
733
|
共享 X 清除/关闭图标按钮基类(.snowui-clear-icon-btn)
|
|
734
734
|
被 Input / Tag / MenuItem / SearchBox / Toast 共用;改这里全局生效。
|
|
735
|
-
规范:
|
|
735
|
+
规范:docs/standards/StyleSpec.md §2.6.3 第 5 类
|
|
736
736
|
───────────────────────────────────────── */
|
|
737
737
|
/* --snowui-clear-icon-size-override: ; */ /* 尺寸(默认 var(--size-4) = 16px) */
|
|
738
738
|
/* --snowui-clear-icon-color-override: ; */ /* 图标颜色(默认 var(--black-100)) */
|
|
@@ -877,3 +877,7 @@
|
|
|
877
877
|
--snowui-search-popup-results-gap-override
|
|
878
878
|
--snowui-search-popup-group-gap-override
|
|
879
879
|
*/
|
|
880
|
+
|
|
881
|
+
/* PasswordStrength:四段指示条。 */
|
|
882
|
+
/* --snowui-password-strength-segment-gap-override: ; */ /* default: var(--gap-2) */
|
|
883
|
+
/* --snowui-password-strength-segment-radius-override: ; */ /* default: var(--radius-full) */
|
|
@@ -514,7 +514,7 @@
|
|
|
514
514
|
/* === 悬浮操作层(Floating Action Overlay)通用基类 ===
|
|
515
515
|
语义:让操作控件(删除 X / 操作按钮 / 复选框等)浮在内容之上,容器 hover 或内部聚焦时显现;
|
|
516
516
|
配合「内容边缘渐隐」(同文件 .snowui-scroll-mask 或 lib/edge-fade.ts)让控件下方内容朝控件一侧渐隐,
|
|
517
|
-
保证控件清晰可读、内容不被硬切。规范:
|
|
517
|
+
保证控件清晰可读、内容不被硬切。规范:docs/standards/StyleSpec.md §2.4;能力:components/src/lib/edge-fade.md。
|
|
518
518
|
用法:宿主加 .snowui-overlay-action-host(建立定位上下文),浮动控件加 .snowui-overlay-action 并自行声明
|
|
519
519
|
inset / 贴哪条边 / 尺寸。简单就地浮动(如 Tag 删除 X)用本类即可;需要随行 sticky / fixed 跟踪
|
|
520
520
|
(如 Table 数据行操作列)的复杂定位由组件自管,不走本类。 */
|
|
@@ -668,7 +668,7 @@
|
|
|
668
668
|
* 仅含视觉规则(背景、毛玻璃、圆角、阴影、边框、内边距),
|
|
669
669
|
* 定位(position/z-index)和结构(overflow/animation)由各组件自行声明。
|
|
670
670
|
* 当前引用:Listbox.svelte、Popover.svelte(v3.0.0 起合并 QuickAction / SearchPopup)
|
|
671
|
-
* 规范:
|
|
671
|
+
* 规范:docs/standards/StyleSpec.md §2.6.3 第 4 类(跨组件共享视觉基类)
|
|
672
672
|
*/
|
|
673
673
|
/* 共享默认低于组件自有规则,不依赖动态样式注入顺序。 */
|
|
674
674
|
@layer snowui-shared-visual {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - 支持 height / width / mixed / aspect 四种计算依据
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
:
|
|
15
|
+
:where(.snowui-scale) {
|
|
16
16
|
/* 基础输入变量(组件设置) */
|
|
17
17
|
--snowui-scale-height-resolved: var(--snowui-scale-height,
|
|
18
18
|
var(--snowui-scale-height-runtime, 2.5rem));
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
/* 注意:以下仅计算变量,不直接覆盖视觉属性。视觉属性在 apply 模式下才生效。 */
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
:
|
|
65
|
-
:
|
|
64
|
+
:where(.snowui-scale[data-scale-apply="true"]),
|
|
65
|
+
:where(.snowui-scale.snowui-scale-apply) {
|
|
66
66
|
padding-inline: var(--snowui-scale-padding-x, var(--snowui-scale-padding-x-default));
|
|
67
67
|
padding-block: var(--snowui-scale-padding-y, var(--snowui-scale-padding-y-default));
|
|
68
68
|
gap: var(--snowui-scale-gap, var(--snowui-scale-gap-default));
|
|
@@ -75,32 +75,32 @@
|
|
|
75
75
|
box-sizing: border-box;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
:
|
|
78
|
+
:where(.snowui-scale[data-scale-basis="width"]) {
|
|
79
79
|
--snowui-scale-basis-size-default: var(--snowui-scale-width-resolved);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
:
|
|
82
|
+
:where(.snowui-scale[data-scale-basis="mixed"]) {
|
|
83
83
|
--snowui-scale-basis-size-default: calc((var(--snowui-scale-height-resolved) * var(--snowui-scale-mix-height-weight-resolved)) + (var(--snowui-scale-width-resolved) * var(--snowui-scale-mix-width-weight-resolved)));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
:
|
|
86
|
+
:where(.snowui-scale[data-scale-basis="aspect"]) {
|
|
87
87
|
--snowui-scale-basis-size-default: calc(var(--snowui-scale-height-resolved) * (var(--snowui-scale-aspect-ratio-resolved) / var(--snowui-scale-aspect-base-ratio-resolved)));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
:
|
|
91
|
-
:
|
|
92
|
-
:
|
|
93
|
-
:
|
|
94
|
-
:
|
|
95
|
-
:
|
|
96
|
-
:
|
|
97
|
-
:
|
|
90
|
+
:where(.snowui-scale[data-scale-apply="true"]) :where(svg),
|
|
91
|
+
:where(.snowui-scale[data-scale-apply="true"]) :where(img),
|
|
92
|
+
:where(.snowui-scale[data-scale-apply="true"]) :where(.snowui-icon-wrapper),
|
|
93
|
+
:where(.snowui-scale[data-scale-apply="true"]) :where(.snowui-icon),
|
|
94
|
+
:where(.snowui-scale.snowui-scale-apply) :where(svg),
|
|
95
|
+
:where(.snowui-scale.snowui-scale-apply) :where(img),
|
|
96
|
+
:where(.snowui-scale.snowui-scale-apply) :where(.snowui-icon-wrapper),
|
|
97
|
+
:where(.snowui-scale.snowui-scale-apply) :where(.snowui-icon) {
|
|
98
98
|
width: max(12px, var(--snowui-scale-icon-size, var(--snowui-scale-icon-size-default)));
|
|
99
99
|
height: max(12px, var(--snowui-scale-icon-size, var(--snowui-scale-icon-size-default)));
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
:
|
|
103
|
-
:
|
|
102
|
+
:where(.snowui-scale[data-scale-apply="true"]) :where(.snowui-avatar),
|
|
103
|
+
:where(.snowui-scale.snowui-scale-apply) :where(.snowui-avatar) {
|
|
104
104
|
--snowui-scale-avatar-size-resolved: var(--snowui-scale-avatar-size,
|
|
105
105
|
var(--snowui-scale-avatar-size-default));
|
|
106
106
|
width: var(--snowui-scale-avatar-size-resolved);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SnowUI 主题唯一来源:components/src/styles/themes.css。
|
|
5
5
|
* 维护AI与脚本可修改此源;禁止手工维护第二份主题。
|
|
6
6
|
* 应用主题入口由工作区同步脚本自动生成,不单独编辑。
|
|
7
|
-
* 生成:node
|
|
7
|
+
* 生成:node docs/scripts/sync-themes.mjs --write;检查:同命令 --check。
|
|
8
8
|
* 源码许可路径以下方 notice 的权威源位置为准;生成不改变适用许可。
|
|
9
9
|
*/
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"license": "SEE LICENSE IN LICENSE",
|
|
3
3
|
"name": "@snowui-design-system/components",
|
|
4
|
-
"version": "0.3.0-alpha.
|
|
4
|
+
"version": "0.3.0-alpha.14",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"svelte-check": "^4.3.4",
|
|
108
108
|
"svelte-codemirror-editor": "^2.1.0",
|
|
109
109
|
"typescript": "^5.0.0",
|
|
110
|
-
"vite": "^8.1.
|
|
110
|
+
"vite": "^8.1.6"
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
113
|
"d3-shape": "^3.2.0",
|
|
@@ -128,7 +128,8 @@
|
|
|
128
128
|
"catalog:generate": "node scripts/generate-component-catalog.mjs",
|
|
129
129
|
"catalog:check": "node scripts/generate-component-catalog.mjs --check",
|
|
130
130
|
"verify:styles": "node scripts/verify-styles.mjs",
|
|
131
|
-
"check": "pnpm test:number-format && pnpm test:table-accessible-names && svelte-check --workspace .",
|
|
131
|
+
"check": "pnpm test:number-format && pnpm test:table-accessible-names && pnpm test:media-skeleton && svelte-check --workspace .",
|
|
132
|
+
"test:media-skeleton": "node --test scripts/auto-media-skeleton.test.mjs",
|
|
132
133
|
"pack:check": "node scripts/check-runtime-package.mjs",
|
|
133
134
|
"source:archive": "node scripts/archive-source.mjs",
|
|
134
135
|
"test:runtime": "node scripts/test-runtime-consumer.mjs",
|