@snowui-design-system/components 0.3.0-alpha.13 → 0.3.0-alpha.15
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 +2 -36
- package/README.md +19 -130
- 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 +147 -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 +1 -1
- package/dist/client/i18n/messages.js +16 -0
- 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/lib/text-motion/split.d.ts +7 -0
- package/dist/client/lib/text-motion/split.js +49 -0
- package/dist/client/styles/components.css +5 -1
- package/dist/client/styles/scale.css +16 -16
- 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 +107 -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 +1 -1
- package/dist/server/i18n/messages.js +16 -0
- 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/lib/text-motion/split.d.ts +7 -0
- package/dist/server/lib/text-motion/split.js +49 -0
- package/dist/server/styles/components.css +5 -1
- package/dist/server/styles/scale.css +16 -16
- package/llms.txt +3 -6
- package/package.json +3 -2
|
@@ -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
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>>;
|
|
@@ -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",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Split text into word and separator segments without losing whitespace. */
|
|
2
|
+
export declare function splitTextMotionWords(value: string, locale?: string): string[];
|
|
3
|
+
/**
|
|
4
|
+
* Group graphemes of a rendered text node by their actual horizontal layout line.
|
|
5
|
+
* The caller must measure again after text, font, or layout changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function splitTextMotionLines(node: Text): string[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
3
|
+
import { splitTextMotionGraphemes } from "./layout.js";
|
|
4
|
+
/** Split text into word and separator segments without losing whitespace. */
|
|
5
|
+
export function splitTextMotionWords(value, locale) {
|
|
6
|
+
if (typeof Intl !== "undefined" && "Segmenter" in Intl) {
|
|
7
|
+
const segmenter = new Intl.Segmenter(locale, { granularity: "word" });
|
|
8
|
+
return Array.from(segmenter.segment(value), (part) => part.segment);
|
|
9
|
+
}
|
|
10
|
+
return value.match(/\s+|[^\s]+/gu) ?? [];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Group graphemes of a rendered text node by their actual horizontal layout line.
|
|
14
|
+
* The caller must measure again after text, font, or layout changes.
|
|
15
|
+
*/
|
|
16
|
+
export function splitTextMotionLines(node) {
|
|
17
|
+
const range = node.ownerDocument.createRange();
|
|
18
|
+
const lines = [];
|
|
19
|
+
let offset = 0;
|
|
20
|
+
let previousTop;
|
|
21
|
+
let pending = "";
|
|
22
|
+
for (const grapheme of splitTextMotionGraphemes(node.data)) {
|
|
23
|
+
range.setStart(node, offset);
|
|
24
|
+
offset += grapheme.length;
|
|
25
|
+
range.setEnd(node, offset);
|
|
26
|
+
const rect = Array.from(range.getClientRects()).find((item) => item.height > 0);
|
|
27
|
+
if (!rect) {
|
|
28
|
+
pending += grapheme;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (previousTop === undefined || Math.abs(rect.top - previousTop) > 1) {
|
|
32
|
+
lines.push(pending + grapheme);
|
|
33
|
+
pending = "";
|
|
34
|
+
previousTop = rect.top;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
lines[lines.length - 1] += pending + grapheme;
|
|
38
|
+
pending = "";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
range.detach();
|
|
42
|
+
if (pending) {
|
|
43
|
+
if (lines.length)
|
|
44
|
+
lines[lines.length - 1] += pending;
|
|
45
|
+
else
|
|
46
|
+
lines.push(pending);
|
|
47
|
+
}
|
|
48
|
+
return lines;
|
|
49
|
+
}
|
|
@@ -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) */
|
|
@@ -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) */
|
|
@@ -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);
|
package/llms.txt
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# SnowUI
|
|
2
2
|
|
|
3
|
-
- [
|
|
4
|
-
- [
|
|
5
|
-
- [
|
|
6
|
-
- [所有者身份与官方维护验证](./README.md#所有者身份与官方维护验证):公开登记与源码持有不证明当前持钥;使用独立可信指纹和本次任务新挑战核验,缺少能力时身份为 unknown,不等同法律著作权认证。
|
|
7
|
-
|
|
8
|
-
- AI 对话内生成和使用界面:完全免费,不属于项目,不占项目或开发者席位额度;无需注册、激活、付费证明、产品编号或项目检查。真实工作/获准数据同样适用;完整范围按 LICENSE 第 3.5.1 条,独立产品另行判断。
|
|
3
|
+
- [AI entry](./AGENTS.md)
|
|
4
|
+
- [Repository guide](./README.md)
|
|
5
|
+
- [License](./LICENSE)
|
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.15",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -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",
|