@snowui-design-system/components 0.3.0-alpha.14 → 0.3.0-alpha.16
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 -38
- package/README.md +19 -132
- package/dist/client/blocks/SearchPopup.js +1 -1
- package/dist/client/blocks/Sidebar.d.ts +4 -0
- package/dist/client/blocks/Sidebar.js +692 -335
- package/dist/client/blocks/SidebarItem.js +50 -88
- package/dist/client/blocks/SidebarSection.js +1 -1
- package/dist/client/components/Avatar.d.ts +1 -0
- package/dist/client/components/Avatar.js +5 -0
- package/dist/client/components/Breadcrumb.js +1 -1
- package/dist/client/components/Button.js +108 -34
- package/dist/client/components/Checkbox.d.ts +3 -0
- package/dist/client/components/Checkbox.js +137 -91
- package/dist/client/components/Chip.js +1 -1
- package/dist/client/components/CodeBlock.js +1 -1
- package/dist/client/components/ColorSchemeButton.d.ts +4 -1
- package/dist/client/components/ColorSchemeButton.js +30 -5
- package/dist/client/components/CopyButton.js +15 -10
- package/dist/client/components/DataTable.js +40 -5
- package/dist/client/components/Dialog.js +1 -1
- package/dist/client/components/Field.js +1 -1
- package/dist/client/components/Frame.js +4 -2
- package/dist/client/components/Input.js +135 -61
- package/dist/client/components/Link.js +11 -16
- package/dist/client/components/Listbox.d.ts +1 -1
- package/dist/client/components/Listbox.js +3 -1
- package/dist/client/components/MetricCard.js +22 -5
- package/dist/client/components/OTPInput.js +24 -5
- package/dist/client/components/Pagination.js +225 -208
- package/dist/client/components/PasswordStrength.js +7 -5
- package/dist/client/components/Radio.d.ts +3 -0
- package/dist/client/components/Radio.js +156 -112
- package/dist/client/components/SearchBox.js +1 -1
- package/dist/client/components/SearchInput.js +2 -1
- package/dist/client/components/Select.js +345 -298
- package/dist/client/components/SelectButton.js +2 -1
- package/dist/client/components/SidePanel.js +3 -1
- package/dist/client/components/Skeleton.d.ts +2 -0
- package/dist/client/components/Skeleton.js +115 -20
- package/dist/client/components/Slider.js +1 -1
- package/dist/client/components/Switch.d.ts +3 -0
- package/dist/client/components/Switch.js +126 -87
- package/dist/client/components/Tab.js +1 -1
- package/dist/client/components/Table.js +1 -1
- package/dist/client/components/TableBody.js +43 -10
- package/dist/client/components/TableHead.js +96 -67
- package/dist/client/components/TableToolbar.js +20 -16
- package/dist/client/components/Tag.js +2 -0
- package/dist/client/components/Textarea.d.ts +1 -0
- package/dist/client/components/Textarea.js +281 -207
- package/dist/client/components/Toast.js +14 -6
- package/dist/client/components/Tooltip.js +1 -1
- package/dist/client/i18n/messages.d.ts +1 -1
- package/dist/client/i18n/messages.js +4 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/lib/chart/ChartHoverPanel.js +1 -1
- package/dist/client/lib/number-format.d.ts +1 -1
- package/dist/client/lib/number-format.js +1 -1
- package/dist/client/lib/table-context.d.ts +1 -0
- package/dist/client/lib/table-context.js +1 -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/logic/RequiredFeedback.d.ts +10 -0
- package/dist/client/logic/RequiredFeedback.js +71 -0
- package/dist/client/logic/color-scheme-preference.d.ts +5 -0
- package/dist/client/logic/color-scheme-preference.js +46 -0
- package/dist/client/logic/content-line.js +1 -1
- package/dist/client/logic/frame-inline-style.d.ts +1 -0
- package/dist/client/logic/frame-inline-style.js +1 -0
- package/dist/client/logic/frame-responsive.js +10 -8
- package/dist/client/logic/native-validation.d.ts +5 -0
- package/dist/client/logic/native-validation.js +60 -0
- package/dist/client/logic/required-feedback.d.ts +1 -0
- package/dist/client/logic/required-feedback.js +61 -0
- package/dist/client/motion/presets/effects.d.ts +1 -0
- package/dist/client/motion/presets/effects.js +12 -1
- package/dist/client/motion/presets/input-required.d.ts +2 -0
- package/dist/client/motion/presets/input-required.js +14 -0
- package/dist/client/motion/presets/sidebar-drawer.d.ts +1 -0
- package/dist/client/motion/presets/sidebar-drawer.js +13 -0
- package/dist/client/styles/auto-layout.css +6 -1
- package/dist/client/styles/backdrop.css +1 -1
- package/dist/client/styles/components.css +7 -2
- package/dist/client/styles/layout.css +20 -1
- package/dist/server/blocks/SearchPopup.js +1 -0
- package/dist/server/blocks/Sidebar.d.ts +4 -0
- package/dist/server/blocks/Sidebar.js +278 -24
- package/dist/server/blocks/SidebarItem.js +23 -47
- package/dist/server/blocks/SidebarSection.js +1 -1
- package/dist/server/components/Avatar.d.ts +1 -0
- package/dist/server/components/Avatar.js +5 -0
- package/dist/server/components/Breadcrumb.js +1 -1
- package/dist/server/components/Button.js +58 -6
- package/dist/server/components/Checkbox.d.ts +3 -0
- package/dist/server/components/Checkbox.js +70 -44
- package/dist/server/components/Chip.js +1 -1
- package/dist/server/components/CodeBlock.js +1 -1
- package/dist/server/components/ColorSchemeButton.d.ts +4 -1
- package/dist/server/components/ColorSchemeButton.js +18 -5
- package/dist/server/components/CopyButton.js +1 -0
- package/dist/server/components/DataTable.js +30 -2
- package/dist/server/components/Dialog.js +1 -1
- package/dist/server/components/Field.js +1 -1
- package/dist/server/components/Frame.js +4 -2
- package/dist/server/components/Input.js +82 -29
- package/dist/server/components/Link.js +3 -3
- package/dist/server/components/Listbox.d.ts +1 -1
- package/dist/server/components/Listbox.js +3 -1
- package/dist/server/components/MetricCard.js +13 -4
- package/dist/server/components/OTPInput.js +22 -5
- package/dist/server/components/Pagination.js +139 -129
- package/dist/server/components/PasswordStrength.js +7 -5
- package/dist/server/components/Radio.d.ts +3 -0
- package/dist/server/components/Radio.js +79 -51
- package/dist/server/components/SearchBox.js +1 -1
- package/dist/server/components/SearchInput.js +2 -1
- package/dist/server/components/Select.js +164 -139
- package/dist/server/components/SelectButton.js +2 -1
- package/dist/server/components/SidePanel.js +3 -1
- package/dist/server/components/Skeleton.d.ts +2 -0
- package/dist/server/components/Skeleton.js +62 -4
- package/dist/server/components/Slider.js +1 -1
- package/dist/server/components/Switch.d.ts +3 -0
- package/dist/server/components/Switch.js +61 -41
- package/dist/server/components/Tab.js +1 -1
- package/dist/server/components/Table.js +1 -1
- package/dist/server/components/TableBody.js +12 -1
- package/dist/server/components/TableHead.js +67 -45
- package/dist/server/components/TableToolbar.js +21 -15
- package/dist/server/components/Tag.js +2 -0
- package/dist/server/components/Textarea.d.ts +1 -0
- package/dist/server/components/Textarea.js +57 -8
- package/dist/server/components/Toast.js +3 -2
- package/dist/server/components/Tooltip.js +1 -1
- package/dist/server/i18n/messages.d.ts +1 -1
- package/dist/server/i18n/messages.js +4 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/lib/chart/ChartHoverPanel.js +1 -1
- package/dist/server/lib/number-format.d.ts +1 -1
- package/dist/server/lib/number-format.js +1 -1
- package/dist/server/lib/table-context.d.ts +1 -0
- package/dist/server/lib/table-context.js +1 -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/logic/RequiredFeedback.d.ts +10 -0
- package/dist/server/logic/RequiredFeedback.js +45 -0
- package/dist/server/logic/color-scheme-preference.d.ts +5 -0
- package/dist/server/logic/color-scheme-preference.js +46 -0
- package/dist/server/logic/content-line.js +1 -1
- package/dist/server/logic/frame-inline-style.d.ts +1 -0
- package/dist/server/logic/frame-inline-style.js +1 -0
- package/dist/server/logic/frame-responsive.js +10 -8
- package/dist/server/logic/native-validation.d.ts +5 -0
- package/dist/server/logic/native-validation.js +12 -0
- package/dist/server/logic/required-feedback.d.ts +1 -0
- package/dist/server/logic/required-feedback.js +5 -0
- package/dist/server/motion/presets/effects.d.ts +1 -0
- package/dist/server/motion/presets/effects.js +12 -1
- package/dist/server/motion/presets/input-required.d.ts +2 -0
- package/dist/server/motion/presets/input-required.js +14 -0
- package/dist/server/motion/presets/sidebar-drawer.d.ts +1 -0
- package/dist/server/motion/presets/sidebar-drawer.js +13 -0
- package/dist/server/styles/auto-layout.css +6 -1
- package/dist/server/styles/backdrop.css +1 -1
- package/dist/server/styles/components.css +7 -2
- package/dist/server/styles/layout.css +20 -1
- package/llms.txt +3 -6
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const themePreferenceCookie = 'snowui_theme';
|
|
2
|
+
export const themePreferenceMaxAge = 365 * 24 * 60 * 60;
|
|
3
|
+
const changeEvent = 'snowui:color-scheme';
|
|
4
|
+
function savedPreference() {
|
|
5
|
+
const value = document.cookie.split('; ').find((part) => part.startsWith(`${themePreferenceCookie}=`))?.slice(themePreferenceCookie.length + 1);
|
|
6
|
+
if (!value)
|
|
7
|
+
return null;
|
|
8
|
+
const [scheme, expiration] = value.split('.');
|
|
9
|
+
const expires = Number(expiration);
|
|
10
|
+
return (scheme === 'light' || scheme === 'dark') && Number.isFinite(expires) && expires > Date.now()
|
|
11
|
+
? { scheme, expires } : null;
|
|
12
|
+
}
|
|
13
|
+
export function saveColorSchemePreference(scheme) {
|
|
14
|
+
const expires = Date.now() + themePreferenceMaxAge * 1000;
|
|
15
|
+
document.cookie = `${themePreferenceCookie}=${scheme}.${expires}; Path=/; Max-Age=${themePreferenceMaxAge}; SameSite=Lax${location.protocol === 'https:' ? '; Secure' : ''}`;
|
|
16
|
+
window.dispatchEvent(new CustomEvent(changeEvent));
|
|
17
|
+
}
|
|
18
|
+
export function observeColorSchemePreference(update) {
|
|
19
|
+
const media = window.matchMedia('(prefers-color-scheme: dark)');
|
|
20
|
+
let timer;
|
|
21
|
+
function scheduleExpiration() {
|
|
22
|
+
clearTimeout(timer);
|
|
23
|
+
const preference = savedPreference();
|
|
24
|
+
if (preference)
|
|
25
|
+
timer = setTimeout(refresh, Math.min(preference.expires - Date.now(), 2_147_483_647));
|
|
26
|
+
}
|
|
27
|
+
function refresh() {
|
|
28
|
+
const preference = savedPreference();
|
|
29
|
+
update(preference?.scheme ?? (media.matches ? 'dark' : 'light'));
|
|
30
|
+
scheduleExpiration();
|
|
31
|
+
}
|
|
32
|
+
function resume() { if (document.visibilityState === 'visible')
|
|
33
|
+
refresh(); }
|
|
34
|
+
media.addEventListener('change', refresh);
|
|
35
|
+
window.addEventListener(changeEvent, refresh);
|
|
36
|
+
window.addEventListener('focus', refresh);
|
|
37
|
+
document.addEventListener('visibilitychange', resume);
|
|
38
|
+
refresh();
|
|
39
|
+
return () => {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
media.removeEventListener('change', refresh);
|
|
42
|
+
window.removeEventListener(changeEvent, refresh);
|
|
43
|
+
window.removeEventListener('focus', refresh);
|
|
44
|
+
document.removeEventListener('visibilitychange', resume);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -9,5 +9,5 @@ export function contentLineGap(value, singleLine = false) {
|
|
|
9
9
|
const preferred = value === 0 || value === "0" ? "0px" : typeof value === "number"
|
|
10
10
|
? `var(--gap-${value}, calc(4px * ${value} * var(--gap-scale, 1)))`
|
|
11
11
|
: String(value);
|
|
12
|
-
return singleLine ? `max(4px, ${preferred})` : preferred;
|
|
12
|
+
return singleLine ? `max(var(--snowui-single-line-gap-floor, 4px), ${preferred})` : preferred;
|
|
13
13
|
}
|
|
@@ -21,6 +21,7 @@ export interface FrameInlineStyleRuntimeOptions {
|
|
|
21
21
|
getIdentityId: () => string | undefined;
|
|
22
22
|
getEffectiveLoading: () => boolean;
|
|
23
23
|
getShouldRenderSkeleton: () => boolean;
|
|
24
|
+
getShouldRenderDirectSkeleton: () => boolean;
|
|
24
25
|
getResolvedStateStyle: () => string;
|
|
25
26
|
getOrchestratedStyle: () => string;
|
|
26
27
|
}
|
|
@@ -374,6 +374,7 @@ export function createFrameInlineStyleRuntime(options) {
|
|
|
374
374
|
shouldRenderSkeleton
|
|
375
375
|
? "background: transparent; border-color: transparent; box-shadow: none; color: transparent; background-image: none;"
|
|
376
376
|
: "",
|
|
377
|
+
options.getShouldRenderDirectSkeleton() ? "padding: 0; border-width: 0;" : "",
|
|
377
378
|
toJsonCssVariable("--snowui-frame-while-appear", resolvedWhile().whileAppear),
|
|
378
379
|
toJsonCssVariable("--snowui-frame-while-disappear", resolvedWhile().whileDisappear),
|
|
379
380
|
toJsonCssVariable("--snowui-frame-while-idle", resolvedWhile().whileIdle),
|
|
@@ -229,15 +229,16 @@ export class FrameResponsive {
|
|
|
229
229
|
this.#restoreSpacing(node);
|
|
230
230
|
|
|
231
231
|
const computed = getComputedStyle(node);
|
|
232
|
+
const lineGapFloor = px(computed.getPropertyValue("--snowui-single-line-gap-floor") || "4px");
|
|
232
233
|
let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
|
|
233
234
|
|
|
234
|
-
if (isSingleLineLayout(this.#getProps()) && gap <
|
|
235
|
-
gap =
|
|
236
|
-
node.style.setProperty("gap",
|
|
235
|
+
if (isSingleLineLayout(this.#getProps()) && gap < lineGapFloor) {
|
|
236
|
+
gap = lineGapFloor;
|
|
237
|
+
node.style.setProperty("gap", `${lineGapFloor}px`);
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
const gapFloor = isSingleLineLayout(this.#getProps())
|
|
240
|
-
? Math.max(
|
|
241
|
+
? Math.max(lineGapFloor, resolveFloor(gap, this.config?.minGap))
|
|
241
242
|
: resolveFloor(gap, this.config?.minGap);
|
|
242
243
|
|
|
243
244
|
node.style.setProperty("gap", `${gapFloor}px`);
|
|
@@ -259,15 +260,16 @@ export class FrameResponsive {
|
|
|
259
260
|
this.#applyFallbackAttributes(node);
|
|
260
261
|
|
|
261
262
|
const computed = getComputedStyle(node);
|
|
263
|
+
const lineGapFloor = px(computed.getPropertyValue("--snowui-single-line-gap-floor") || "4px");
|
|
262
264
|
const direction = computed.flexDirection;
|
|
263
265
|
const isFlex = computed.display === "flex" || computed.display === "inline-flex";
|
|
264
266
|
const isRow = isFlex && (direction === "row" || direction === "row-reverse");
|
|
265
267
|
const children = Array.from(node.children).filter(isMeasurableChild);
|
|
266
268
|
let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
|
|
267
269
|
|
|
268
|
-
if (isSingleLineLayout(this.#getProps()) && gap <
|
|
269
|
-
gap =
|
|
270
|
-
node.style.setProperty("gap",
|
|
270
|
+
if (isSingleLineLayout(this.#getProps()) && gap < lineGapFloor) {
|
|
271
|
+
gap = lineGapFloor;
|
|
272
|
+
node.style.setProperty("gap", `${lineGapFloor}px`);
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
const padding = {
|
|
@@ -294,7 +296,7 @@ export class FrameResponsive {
|
|
|
294
296
|
if (preferredWidth <= width + EPSILON) return;
|
|
295
297
|
|
|
296
298
|
const gapFloor = isSingleLineLayout(this.#getProps())
|
|
297
|
-
? Math.max(
|
|
299
|
+
? Math.max(lineGapFloor, resolveFloor(gap, this.config?.minGap))
|
|
298
300
|
: resolveFloor(gap, this.config?.minGap);
|
|
299
301
|
|
|
300
302
|
const paddingFloor = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRequiredFeedback(getInput: () => HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | undefined, getSurface: () => HTMLElement | readonly HTMLElement[] | undefined, focus?: () => void): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* required-feedback.svelte.js generated by Svelte v5.56.4 */
|
|
2
|
+
import * as $ from 'svelte/internal/server';
|
|
3
|
+
import { INPUT_REQUIRED_KEYFRAMES, INPUT_REQUIRED_TIMING } from "../motion/presets/input-required.js";
|
|
4
|
+
|
|
5
|
+
export function useRequiredFeedback(getInput, getSurface, focus) {}
|
|
@@ -20,6 +20,7 @@ export declare const PANEL_REVEAL_APPEAR_MOTION: MotionConfig;
|
|
|
20
20
|
export declare const PANEL_REVEAL_DISAPPEAR_MOTION: MotionConfig;
|
|
21
21
|
export declare const PAGE_SLIDE_FROM_RIGHT_MOTION: MotionConfig;
|
|
22
22
|
export declare const PAGE_SLIDE_FROM_LEFT_MOTION: MotionConfig;
|
|
23
|
+
export declare const PANEL_EXIT_TIMING: Pick<MotionConfig, "type" | "duration" | "easing" | "stiffness" | "damping" | "mass">;
|
|
23
24
|
/** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
|
|
24
25
|
export declare const SIDE_PANEL_APPEAR_MOTION: MotionConfig;
|
|
25
26
|
/** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
|
|
@@ -81,6 +81,17 @@ export const PAGE_SLIDE_FROM_LEFT_MOTION = {
|
|
|
81
81
|
...PAGE_SLIDE_FROM_RIGHT_MOTION,
|
|
82
82
|
x: [-MOTION_DISTANCE_PAGE_SLIDE_X_PX, 0],
|
|
83
83
|
};
|
|
84
|
+
// Panel exit timing shared by SidePanel and Sidebar hidden mode.
|
|
85
|
+
// Keep direction, distance, entrance timing and toggle behavior in each consumer.
|
|
86
|
+
// Contract: docs/standards/MotionPresetSpec.md, section 5 (SnowUI workspace).
|
|
87
|
+
export const PANEL_EXIT_TIMING = {
|
|
88
|
+
type: MOVE_RIGHT_MOTION.type,
|
|
89
|
+
duration: MOVE_RIGHT_MOTION.duration ?? MOTION_DURATION_PANEL_DISAPPEAR_MS,
|
|
90
|
+
easing: MOVE_RIGHT_MOTION.easing,
|
|
91
|
+
stiffness: MOVE_RIGHT_MOTION.stiffness,
|
|
92
|
+
damping: MOVE_RIGHT_MOTION.damping,
|
|
93
|
+
mass: MOVE_RIGHT_MOTION.mass,
|
|
94
|
+
};
|
|
84
95
|
/** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
|
|
85
96
|
export const SIDE_PANEL_APPEAR_MOTION = {
|
|
86
97
|
...MOVE_LEFT_MOTION,
|
|
@@ -90,8 +101,8 @@ export const SIDE_PANEL_APPEAR_MOTION = {
|
|
|
90
101
|
/** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
|
|
91
102
|
export const SIDE_PANEL_DISAPPEAR_MOTION = {
|
|
92
103
|
...MOVE_RIGHT_MOTION,
|
|
104
|
+
...PANEL_EXIT_TIMING,
|
|
93
105
|
x: [0, "calc(100% + var(--padding-4))"],
|
|
94
|
-
duration: MOVE_RIGHT_MOTION.duration ?? MOTION_DURATION_PANEL_DISAPPEAR_MS,
|
|
95
106
|
};
|
|
96
107
|
export const TEXT_REVEAL_APPEAR_MOTION = {
|
|
97
108
|
opacity: [0, 1],
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
3
|
+
import { MOTION_DURATION_EMPHASIS_MS, MOTION_EASING_STANDARD } from "../tokens.js";
|
|
4
|
+
const active = "inset 0 0 0 var(--snowui-field-border-width, 0.03125rem) var(--secondary-red, #ff4747ff), 0 0 0 var(--snowui-field-focus-ring-width, 0.25rem) var(--snowui-field-focus-ring-color, var(--black-4, #0000000a))";
|
|
5
|
+
const idle = "inset 0 0 0 var(--snowui-field-border-width, 0.03125rem) var(--secondary-red, #ff4747ff), 0 0 0 0 transparent";
|
|
6
|
+
export const INPUT_REQUIRED_KEYFRAMES = [
|
|
7
|
+
{ boxShadow: active },
|
|
8
|
+
{ boxShadow: idle },
|
|
9
|
+
{ boxShadow: active },
|
|
10
|
+
];
|
|
11
|
+
export const INPUT_REQUIRED_TIMING = {
|
|
12
|
+
duration: MOTION_DURATION_EMPHASIS_MS * 2,
|
|
13
|
+
easing: MOTION_EASING_STANDARD,
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SIDEBAR_DRAWER_STYLE: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
|
|
2
|
+
复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
|
|
3
|
+
import { PANEL_EXIT_TIMING } from "./effects.js";
|
|
4
|
+
import { resolveMotionCssTiming } from "../spring.js";
|
|
5
|
+
const closeTiming = resolveMotionCssTiming(PANEL_EXIT_TIMING);
|
|
6
|
+
// PANEL_EXIT_TIMING is shared with SidePanel; CSS is only an execution adapter.
|
|
7
|
+
// Preserve Sidebar entrance timing and its own slide geometry.
|
|
8
|
+
export const SIDEBAR_DRAWER_STYLE = [
|
|
9
|
+
"--snowui-sidebar-drawer-duration: 220ms",
|
|
10
|
+
"--snowui-sidebar-drawer-easing: ease",
|
|
11
|
+
`--snowui-sidebar-drawer-close-duration: ${closeTiming.duration}ms`,
|
|
12
|
+
`--snowui-sidebar-drawer-close-easing: ${closeTiming.easing}`,
|
|
13
|
+
].join("; ");
|
|
@@ -276,10 +276,15 @@
|
|
|
276
276
|
}
|
|
277
277
|
/* 显式单行组合与已有三槽/Text共用,不创建第二套文本截断或附件识别。 */
|
|
278
278
|
:where([data-single-line="true"]) {
|
|
279
|
+
--snowui-single-line-gap-floor: 4px;
|
|
279
280
|
flex-wrap: nowrap;
|
|
280
281
|
white-space: nowrap;
|
|
281
282
|
align-items: center;
|
|
282
|
-
column-gap: max(
|
|
283
|
+
column-gap: max(var(--snowui-single-line-gap-floor), var(--gap-2));
|
|
284
|
+
}
|
|
285
|
+
/* LayoutProtocol §4.6: Chip and Tag retain their registered zero-gap exception. */
|
|
286
|
+
:where([data-single-line="true"].snowui-chip, [data-single-line="true"].snowui-tag) {
|
|
287
|
+
--snowui-single-line-gap-floor: 0px;
|
|
283
288
|
}
|
|
284
289
|
:where([data-single-line="true"] > :not([data-as])) {
|
|
285
290
|
flex: 0 1 auto;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
--snowui-backdrop-background: rgb(0 0 0 / 10%);
|
|
6
6
|
--snowui-backdrop-filter: none;
|
|
7
7
|
background: var(--snowui-backdrop-background-override, var(--snowui-backdrop-background));
|
|
8
|
-
backdrop-filter: var(--snowui-backdrop-filter);
|
|
9
8
|
-webkit-backdrop-filter: var(--snowui-backdrop-filter);
|
|
9
|
+
backdrop-filter: var(--snowui-backdrop-filter);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
:where(.snowui-backdrop[data-backdrop="blur"]) {
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
:root {
|
|
27
|
+
/* MetricCard */
|
|
28
|
+
/* --snowui-metric-card-background-override: ; */ /* default: var(--background-3) */
|
|
27
29
|
/* OTPInput */
|
|
28
30
|
/* --snowui-otp-input-gap-override: ; */ /* default: var(--gap-2) */
|
|
29
31
|
/* --snowui-otp-input-size-override: ; */ /* default: var(--size-10) */
|
|
@@ -305,7 +307,8 @@
|
|
|
305
307
|
继承 Input 覆盖入口;默认样式与 Input 标准一致。
|
|
306
308
|
padding-y=12px padding-x=16px gap=8px radius=16px
|
|
307
309
|
───────────────────────────────────────── */
|
|
308
|
-
/* SearchInput
|
|
310
|
+
/* SearchInput inherits Input layout overrides; this color applies only to its owned icon. */
|
|
311
|
+
/* --snowui-search-input-icon-color-override: ; */ /* default: opaque theme color; opacity owns dimming */
|
|
309
312
|
|
|
310
313
|
|
|
311
314
|
/* ─────────────────────────────────────────
|
|
@@ -582,7 +585,7 @@
|
|
|
582
585
|
|
|
583
586
|
/* Block Sidebar */
|
|
584
587
|
/* --snowui-sidebar-width-override: ; */ /* 展开宽度(默认 220px) */
|
|
585
|
-
/* --snowui-sidebar-collapsed-width-override: ; */ /*
|
|
588
|
+
/* --snowui-sidebar-collapsed-width-override: ; */ /* Collapsed width (derived from padding and icon width; default 56px) */
|
|
586
589
|
/* --snowui-sidebar-resize-indicator-offset-override: ; */ /* 展开态右侧宽度 Indicator 视觉中心距右边缘(默认 var(--padding-1) = 4px) */
|
|
587
590
|
/* --snowui-sidebar-padding-x-override: ; */ /* 根横向 padding(默认 var(--padding-3) = 12px;Body 滚动条据此保持距 Sidebar 右边框 4px) */
|
|
588
591
|
/* --snowui-sidebar-padding-y-override: ; */ /* 根纵向 padding(默认 var(--padding-4) = 16px) */
|
|
@@ -881,3 +884,5 @@
|
|
|
881
884
|
/* PasswordStrength:四段指示条。 */
|
|
882
885
|
/* --snowui-password-strength-segment-gap-override: ; */ /* default: var(--gap-2) */
|
|
883
886
|
/* --snowui-password-strength-segment-radius-override: ; */ /* default: var(--radius-full) */
|
|
887
|
+
|
|
888
|
+
/* --snowui-avatar-background-blur-override: ; */ /* default: 20px when backgroundBlur is enabled */
|
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
*/
|
|
90
90
|
@layer snowui-frame-motion-fallback {
|
|
91
91
|
:where([data-snowui-frame]) {
|
|
92
|
+
/* Component motion belongs to this Frame, never to nested Frames.
|
|
93
|
+
Initial keeps the fallback chain available; component rules override locally. */
|
|
94
|
+
--snowui-frame-component-transform: initial;
|
|
95
|
+
--snowui-frame-component-transition: initial;
|
|
92
96
|
transform: var(
|
|
93
97
|
--su-motion-transform,
|
|
94
98
|
var(--snowui-frame-component-transform, none)
|
|
@@ -674,8 +678,8 @@
|
|
|
674
678
|
@layer snowui-shared-visual {
|
|
675
679
|
:where(.snowui-quick-action-panel) {
|
|
676
680
|
background-color: var(--snowui-background-quick-action);
|
|
677
|
-
backdrop-filter: var(--snowui-backdrop-quick-action);
|
|
678
681
|
-webkit-backdrop-filter: var(--snowui-backdrop-quick-action);
|
|
682
|
+
backdrop-filter: var(--snowui-backdrop-quick-action);
|
|
679
683
|
border-radius: var(--radius-4);
|
|
680
684
|
box-shadow: var(--snowui-shadow-quick-action);
|
|
681
685
|
border: var(--snowui-border-quick-action);
|
|
@@ -764,6 +768,7 @@
|
|
|
764
768
|
|
|
765
769
|
/* Input and segmented fields share the same error text typography. */
|
|
766
770
|
:where(.snowui-field-error-message) {
|
|
771
|
+
text-align: left;
|
|
767
772
|
width: 100%;
|
|
768
773
|
padding: 0;
|
|
769
774
|
color: var(--secondary-red, #ff4747ff);
|
|
@@ -771,3 +776,17 @@
|
|
|
771
776
|
line-height: var(--leading-12);
|
|
772
777
|
box-sizing: border-box;
|
|
773
778
|
}
|
|
779
|
+
|
|
780
|
+
/* Opt-in control blur shared by Button and Avatar; each owns its enablement. */
|
|
781
|
+
@layer snowui-shared-visual {
|
|
782
|
+
:where(.snowui-button-background-blur) {
|
|
783
|
+
--snowui-control-background-blur: var(--snowui-button-background-blur-override, var(--size-5, 1.25rem));
|
|
784
|
+
}
|
|
785
|
+
:where(.snowui-avatar-background-blur) {
|
|
786
|
+
--snowui-control-background-blur: var(--snowui-avatar-background-blur-override, var(--size-5, 1.25rem));
|
|
787
|
+
}
|
|
788
|
+
:where(.snowui-control-background-blur) {
|
|
789
|
+
-webkit-backdrop-filter: blur(var(--snowui-control-background-blur, var(--size-5, 1.25rem)));
|
|
790
|
+
backdrop-filter: blur(var(--snowui-control-background-blur, var(--size-5, 1.25rem)));
|
|
791
|
+
}
|
|
792
|
+
}
|
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)
|