@snowui-design-system/components 0.3.0-alpha.15 → 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/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/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/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/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/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/package.json +1 -1
|
@@ -101,7 +101,7 @@ var root_4 = $.from_html(`<span class="snowui-tooltip-placeholder" style="displa
|
|
|
101
101
|
|
|
102
102
|
const $$css = {
|
|
103
103
|
hash: 'svelte-sj99h3',
|
|
104
|
-
code: ':where(.snowui-tooltip-portal) {position:fixed;z-index:9999;pointer-events:none;}:where(.snowui-tooltip-portal)[data-ready="false"] {opacity:0;}:where(.snowui-tooltip-motion-shell) {position:relative;transform:translate3d(\n var(--snowui-tooltip-motion-x, 0),\n var(--snowui-tooltip-motion-y, 0),\n 0\n );}:where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"] {will-change:transform;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-size-shell)\n {will-change:width, height;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-content-layer)\n {will-change:transform;}:where(.snowui-tooltip-size-shell) {display:inline-block;position:relative;box-sizing:border-box;overflow:hidden;width:var(--snowui-tooltip-measured-width);height:var(--snowui-tooltip-measured-height);transition:width var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out),\n height var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out);}:where(.snowui-tooltip-size-shell)[data-size-motion="false"] {transition:none;}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-top,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-bottom {transform:translateX(-50%);}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-left,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-right {transform:translateY(-50%);}:where(.snowui-tooltip-content) {--snowui-tooltip-padding: var(--padding-1) var(--padding-2);--snowui-tooltip-gap: var(--gap-2);--snowui-tooltip-radius: var(--radius-3);--snowui-tooltip-font-size: var(--text-12);--snowui-tooltip-line-height: var(--leading-12);display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );border-radius:var(\n --snowui-tooltip-radius-override,\n var(--snowui-tooltip-radius)\n );font-size:var(\n --snowui-tooltip-font-size-override,\n var(--snowui-tooltip-font-size)\n );line-height:var(\n --snowui-tooltip-line-height-override,\n var(--snowui-tooltip-line-height)\n );color:var(--static-white-100, #ffffffff);white-space:normal;pointer-events:none;}:where(.snowui-tooltip-content)[data-variant="light"] {color:var(--black-100, #000000ff);}:where(.snowui-tooltip-backdrop),\n :where(.snowui-tooltip-foreground) {position:absolute;inset:0;border-radius:inherit;corner-shape:inherit;pointer-events:none;}:where(.snowui-tooltip-backdrop) {z-index:0;\n /* 透明绘制面确保浏览器合成实际 backdrop 像素,不改变 Foreground 的颜色与动效。 */background-image:linear-gradient(transparent, transparent)
|
|
104
|
+
code: ':where(.snowui-tooltip-portal) {position:fixed;z-index:9999;pointer-events:none;}:where(.snowui-tooltip-portal)[data-ready="false"] {opacity:0;}:where(.snowui-tooltip-motion-shell) {position:relative;transform:translate3d(\n var(--snowui-tooltip-motion-x, 0),\n var(--snowui-tooltip-motion-y, 0),\n 0\n );}:where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"] {will-change:transform;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-size-shell)\n {will-change:width, height;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-content-layer)\n {will-change:transform;}:where(.snowui-tooltip-size-shell) {display:inline-block;position:relative;box-sizing:border-box;overflow:hidden;width:var(--snowui-tooltip-measured-width);height:var(--snowui-tooltip-measured-height);transition:width var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out),\n height var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out);}:where(.snowui-tooltip-size-shell)[data-size-motion="false"] {transition:none;}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-top,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-bottom {transform:translateX(-50%);}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-left,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-right {transform:translateY(-50%);}:where(.snowui-tooltip-content) {--snowui-tooltip-padding: var(--padding-1) var(--padding-2);--snowui-tooltip-gap: var(--gap-2);--snowui-tooltip-radius: var(--radius-3);--snowui-tooltip-font-size: var(--text-12);--snowui-tooltip-line-height: var(--leading-12);display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );border-radius:var(\n --snowui-tooltip-radius-override,\n var(--snowui-tooltip-radius)\n );font-size:var(\n --snowui-tooltip-font-size-override,\n var(--snowui-tooltip-font-size)\n );line-height:var(\n --snowui-tooltip-line-height-override,\n var(--snowui-tooltip-line-height)\n );color:var(--static-white-100, #ffffffff);white-space:normal;pointer-events:none;}:where(.snowui-tooltip-content)[data-variant="light"] {color:var(--black-100, #000000ff);}:where(.snowui-tooltip-backdrop),\n :where(.snowui-tooltip-foreground) {position:absolute;inset:0;border-radius:inherit;corner-shape:inherit;pointer-events:none;}:where(.snowui-tooltip-backdrop) {z-index:0;\n /* 透明绘制面确保浏览器合成实际 backdrop 像素,不改变 Foreground 的颜色与动效。 */background-image:linear-gradient(transparent, transparent);-webkit-backdrop-filter:blur(1.25rem);backdrop-filter:blur(1.25rem);will-change:backdrop-filter;}:where(.snowui-tooltip-foreground) {z-index:1;display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding:inherit;background:linear-gradient(\n 0deg,\n var(--static-white-10, #ffffff1a),\n var(--static-white-10, #ffffff1a)\n ),\n var(--static-black-80, #000000cc);color:inherit;will-change:opacity, transform;}:where(.snowui-tooltip-shared-foreground) {display:block;padding:0;}:where(.snowui-tooltip-content-layer) {position:absolute;top:0;left:0;z-index:1;display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;width:var(--snowui-tooltip-layer-width);height:var(--snowui-tooltip-layer-height);padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );color:inherit;white-space:normal;pointer-events:none;transform:translate3d(\n var(--snowui-tooltip-layer-x, 0),\n var(--snowui-tooltip-layer-y, 0),\n 0\n );}\n :where(.snowui-tooltip-content-layer)[data-layer-ready="false"]\n {visibility:hidden;}\n :where(.snowui-tooltip-content)[data-variant="light"]\n :where(.snowui-tooltip-foreground)\n {background:var(--black-4, #0000000a);}:where(.snowui-tooltip-inner) {width:max-content;flex-shrink:0;overflow-wrap:anywhere;overflow:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));white-space:normal;pointer-events:auto;}\n\n @media (prefers-reduced-motion: reduce) {:where(.snowui-tooltip-motion-shell),\n :where(.snowui-tooltip-content-layer),\n :where(.snowui-tooltip-size-shell) {transition:none;}\n }'
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
export default function Tooltip($$anchor, $$props) {
|
|
@@ -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.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";
|
|
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.noData" | "table.loadMore" | "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>>;
|
|
@@ -73,6 +73,8 @@ export const SNOWUI_MESSAGES = {
|
|
|
73
73
|
"imageViewer.next": "下一张",
|
|
74
74
|
"imageViewer.close": "关闭图片预览",
|
|
75
75
|
"toast.close": "关闭通知",
|
|
76
|
+
"table.noData": "暂无数据",
|
|
77
|
+
"table.loadMore": "加载更多",
|
|
76
78
|
"table.scrollRegion": "可横向滚动的表格",
|
|
77
79
|
"table.scrollRegionNamed": "{{name}},可横向滚动",
|
|
78
80
|
"tableHead.selectAll": "选择全部当前行",
|
|
@@ -184,6 +186,8 @@ export const SNOWUI_MESSAGES = {
|
|
|
184
186
|
"imageViewer.next": "Next image",
|
|
185
187
|
"imageViewer.close": "Close image viewer",
|
|
186
188
|
"toast.close": "Close notification",
|
|
189
|
+
"table.noData": "No data",
|
|
190
|
+
"table.loadMore": "Load more",
|
|
187
191
|
"table.scrollRegion": "Scrollable table",
|
|
188
192
|
"table.scrollRegionNamed": "{{name}}, horizontally scrollable",
|
|
189
193
|
"tableHead.selectAll": "Select all current rows",
|
package/dist/client/index.d.ts
CHANGED
|
@@ -128,3 +128,4 @@ export { default as SearchPopup, type SearchPopupItem } from "./blocks/SearchPop
|
|
|
128
128
|
export { default as BlurText } from "./components/BlurText.js";
|
|
129
129
|
export { default as MetricCard } from "./components/MetricCard.js";
|
|
130
130
|
export { default as PasswordStrength, evaluatePasswordStrength, type PasswordStrengthLevel, type PasswordStrengthEvaluator } from "./components/PasswordStrength.js";
|
|
131
|
+
export { SIDEBAR_DRAWER_STYLE } from "./motion/presets/sidebar-drawer";
|
package/dist/client/index.js
CHANGED
|
@@ -118,3 +118,4 @@ export { default as SearchPopup } from "./blocks/SearchPopup.js";
|
|
|
118
118
|
export { default as BlurText } from "./components/BlurText.js";
|
|
119
119
|
export { default as MetricCard } from "./components/MetricCard.js";
|
|
120
120
|
export { default as PasswordStrength, evaluatePasswordStrength } from "./components/PasswordStrength.js";
|
|
121
|
+
export { SIDEBAR_DRAWER_STYLE } from "./motion/presets/sidebar-drawer.js";
|
|
@@ -10,7 +10,7 @@ var root_2 = $.from_html(`<!> <div class="snowui-chart-hover-panel-rows"></div>`
|
|
|
10
10
|
|
|
11
11
|
const $$css = {
|
|
12
12
|
hash: 'svelte-qoyt82',
|
|
13
|
-
code: ':where(.snowui-chart-hover-panel) {position:absolute;left:0;top:0;translate:var(--snowui-chart-hover-panel-x)\n var(--snowui-chart-hover-panel-y);z-index:30;display:inline-flex;flex-direction:column;gap:calc(var(--gap-1) / 2);padding:calc(var(--padding-1) * 1.5) var(--padding-2);border:none;outline:none;border-radius:var(--radius-3);font-size:var(--text-12);line-height:var(--leading-12);font-weight:400;pointer-events:none;contain:layout style paint;will-change:translate, opacity;white-space:nowrap;background:linear-gradient(\n 0deg,\n var(--static-white-10, #ffffff1a),\n var(--static-white-10, #ffffff1a)\n ),\n var(--static-black-80, #000000cc);color:var(--static-white-100, #ffffffff)
|
|
13
|
+
code: ':where(.snowui-chart-hover-panel) {position:absolute;left:0;top:0;translate:var(--snowui-chart-hover-panel-x)\n var(--snowui-chart-hover-panel-y);z-index:30;display:inline-flex;flex-direction:column;gap:calc(var(--gap-1) / 2);padding:calc(var(--padding-1) * 1.5) var(--padding-2);border:none;outline:none;border-radius:var(--radius-3);font-size:var(--text-12);line-height:var(--leading-12);font-weight:400;pointer-events:none;contain:layout style paint;will-change:translate, opacity;white-space:nowrap;background:linear-gradient(\n 0deg,\n var(--static-white-10, #ffffff1a),\n var(--static-white-10, #ffffff1a)\n ),\n var(--static-black-80, #000000cc);color:var(--static-white-100, #ffffffff);-webkit-backdrop-filter:blur(1.25rem);backdrop-filter:blur(1.25rem);box-shadow:none;}:where(.snowui-chart-hover-panel)[data-variant="light"] {background:var(--black-4, #0000000a);color:var(--black-100, #000000ff);border:none;box-shadow:none;}:where(.snowui-chart-hover-panel)[data-variant="surface"] {background:var(--snowui-background-quick-action);color:var(--black-100, #000000ff);-webkit-backdrop-filter:var(--snowui-backdrop-quick-action);backdrop-filter:var(--snowui-backdrop-quick-action);border:none;box-shadow:var(--snowui-shadow-quick-action);}:where(.snowui-chart-hover-panel-label) {color:var(--snowui-chart-hover-panel-label-color);}:where(.snowui-chart-hover-panel)[data-variant="dark"] {--snowui-chart-hover-panel-label-color: var(\n --static-white-100,\n #ffffffff\n );--snowui-chart-hover-panel-name-color: var(\n --static-white-40,\n #ffffff66\n );--snowui-chart-hover-panel-value-color: var(\n --static-white-100,\n #ffffffff\n );}:where(.snowui-chart-hover-panel)[data-variant="light"],\n :where(.snowui-chart-hover-panel)[data-variant="surface"] {--snowui-chart-hover-panel-label-color: var(--black-100, #000000ff);--snowui-chart-hover-panel-name-color: var(--black-40, #00000066);--snowui-chart-hover-panel-value-color: var(--black-100, #000000ff);}:where(.snowui-chart-hover-panel-rows) {display:grid;grid-template-columns:max-content max-content max-content;column-gap:0;row-gap:calc(var(--gap-1) / 2);align-items:center;}:where(.snowui-chart-hover-panel-row) {display:contents;}:where(.snowui-chart-hover-panel-dot) {width:calc(var(--size-4) * 3 / 8);height:calc(var(--size-4) * 3 / 8);border-radius:9999px;background:var(--snowui-chart-hover-panel-dot-color);opacity:var(--snowui-chart-hover-panel-dot-opacity);margin-inline-end:max(4px, var(--gap-1));}:where(.snowui-chart-hover-panel-name) {color:var(--snowui-chart-hover-panel-name-color);}:where(.snowui-chart-hover-panel-value) {color:var(--snowui-chart-hover-panel-value-color);text-align:right;margin-inline-start:max(4px, var(--gap-2));}'
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default function ChartHoverPanel($$anchor, $$props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const DEFAULT_NUMBER_VALUE_LABEL_FRACTION_DIGITS = 2;
|
|
2
2
|
export declare const DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS = 1;
|
|
3
3
|
export declare const DEFAULT_NUMBER_COMPACT_THRESHOLD = 1000000;
|
|
4
|
-
export declare const DEFAULT_NUMBER_EMPTY_VALUE = "
|
|
4
|
+
export declare const DEFAULT_NUMBER_EMPTY_VALUE = "-";
|
|
5
5
|
export declare const DEFAULT_NUMBER_LOCALE = "en-US";
|
|
6
6
|
export type NumberNotation = "standard" | "compact" | "auto";
|
|
7
7
|
export interface NumberFormatOptions {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
export const DEFAULT_NUMBER_VALUE_LABEL_FRACTION_DIGITS = 2;
|
|
4
4
|
export const DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS = 1;
|
|
5
5
|
export const DEFAULT_NUMBER_COMPACT_THRESHOLD = 1_000_000;
|
|
6
|
-
export const DEFAULT_NUMBER_EMPTY_VALUE = "
|
|
6
|
+
export const DEFAULT_NUMBER_EMPTY_VALUE = "-";
|
|
7
7
|
export const DEFAULT_NUMBER_LOCALE = "en-US";
|
|
8
8
|
const ENGLISH_COMPACT_UNITS = [
|
|
9
9
|
{ value: 1_000_000_000_000, suffix: "t" },
|
|
@@ -68,6 +68,7 @@ export interface TableContext {
|
|
|
68
68
|
setFilters: (filters: Record<string, unknown>) => void;
|
|
69
69
|
getVariant: () => "striped" | "divided" | undefined;
|
|
70
70
|
getLoading: () => boolean;
|
|
71
|
+
isEmpty: () => boolean;
|
|
71
72
|
getLoadingMore: () => boolean;
|
|
72
73
|
getLoadingRowCount: () => number;
|
|
73
74
|
getLoadingSpinner: () => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
id: string;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const RequiredFeedback: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type RequiredFeedback = ReturnType<typeof RequiredFeedback>;
|
|
10
|
+
export default RequiredFeedback;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import 'svelte/internal/disclose-version';
|
|
2
|
+
import * as $ from 'svelte/internal/client';
|
|
3
|
+
import Text from "../components/Text.js";
|
|
4
|
+
|
|
5
|
+
var root = $.from_html(`<div class="snowui-required-feedback svelte-1tekhsm"><!> <!></div>`);
|
|
6
|
+
|
|
7
|
+
const $$css = {
|
|
8
|
+
hash: 'svelte-1tekhsm',
|
|
9
|
+
code: '.snowui-required-feedback.svelte-1tekhsm {display:flex;flex-direction:column;gap:var(--size-0-5, 0.125rem);min-width:0;}[data-required-invalid="true"] {outline:var(--snowui-field-border-width, 0.03125rem) solid var(--secondary-red, #ff4747ff);outline-offset:calc(-1 * var(--snowui-field-border-width, 0.03125rem));}'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function RequiredFeedback($$anchor, $$props) {
|
|
13
|
+
$.append_styles($$anchor, $$css);
|
|
14
|
+
|
|
15
|
+
var fragment = $.comment();
|
|
16
|
+
var node = $.first_child(fragment);
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
var consequent_1 = ($$anchor) => {
|
|
20
|
+
var div = root();
|
|
21
|
+
var node_1 = $.child(div);
|
|
22
|
+
|
|
23
|
+
$.snippet(node_1, () => $$props.children);
|
|
24
|
+
|
|
25
|
+
var node_2 = $.sibling(node_1, 2);
|
|
26
|
+
|
|
27
|
+
{
|
|
28
|
+
var consequent = ($$anchor) => {
|
|
29
|
+
Text($$anchor, {
|
|
30
|
+
get id() {
|
|
31
|
+
return $$props.id;
|
|
32
|
+
},
|
|
33
|
+
as: 'error',
|
|
34
|
+
role: 'alert',
|
|
35
|
+
class: 'snowui-field-error-message',
|
|
36
|
+
children: ($$anchor, $$slotProps) => {
|
|
37
|
+
$.next();
|
|
38
|
+
|
|
39
|
+
var text = $.text();
|
|
40
|
+
|
|
41
|
+
$.template_effect(() => $.set_text(text, $$props.message));
|
|
42
|
+
$.append($$anchor, text);
|
|
43
|
+
},
|
|
44
|
+
$$slots: { default: true }
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
$.if(node_2, ($$render) => {
|
|
49
|
+
if ($$props.message) $$render(consequent);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
$.reset(div);
|
|
54
|
+
$.append($$anchor, div);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var alternate = ($$anchor) => {
|
|
58
|
+
var fragment_3 = $.comment();
|
|
59
|
+
var node_3 = $.first_child(fragment_3);
|
|
60
|
+
|
|
61
|
+
$.snippet(node_3, () => $$props.children);
|
|
62
|
+
$.append($$anchor, fragment_3);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
$.if(node, ($$render) => {
|
|
66
|
+
if ($$props.enabled) $$render(consequent_1); else $$render(alternate, -1);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
$.append($$anchor, fragment);
|
|
71
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type PreferredColorScheme = 'light' | 'dark';
|
|
2
|
+
export declare const themePreferenceCookie = "snowui_theme";
|
|
3
|
+
export declare const themePreferenceMaxAge: number;
|
|
4
|
+
export declare function saveColorSchemePreference(scheme: PreferredColorScheme): void;
|
|
5
|
+
export declare function observeColorSchemePreference(update: (scheme: PreferredColorScheme) => void): () => void;
|
|
@@ -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", $.get(resolvedWhile).whileAppear),
|
|
378
379
|
toJsonCssVariable("--snowui-frame-while-disappear", $.get(resolvedWhile).whileDisappear),
|
|
379
380
|
toJsonCssVariable("--snowui-frame-while-idle", $.get(resolvedWhile).whileIdle),
|
|
@@ -247,15 +247,16 @@ export class FrameResponsive {
|
|
|
247
247
|
this.#restoreSpacing(node);
|
|
248
248
|
|
|
249
249
|
const computed = getComputedStyle(node);
|
|
250
|
+
const lineGapFloor = px(computed.getPropertyValue("--snowui-single-line-gap-floor") || "4px");
|
|
250
251
|
let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
|
|
251
252
|
|
|
252
|
-
if (isSingleLineLayout(this.#getProps()) && gap <
|
|
253
|
-
gap =
|
|
254
|
-
node.style.setProperty("gap",
|
|
253
|
+
if (isSingleLineLayout(this.#getProps()) && gap < lineGapFloor) {
|
|
254
|
+
gap = lineGapFloor;
|
|
255
|
+
node.style.setProperty("gap", `${lineGapFloor}px`);
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
const gapFloor = isSingleLineLayout(this.#getProps())
|
|
258
|
-
? Math.max(
|
|
259
|
+
? Math.max(lineGapFloor, resolveFloor(gap, this.config?.minGap))
|
|
259
260
|
: resolveFloor(gap, this.config?.minGap);
|
|
260
261
|
|
|
261
262
|
node.style.setProperty("gap", `${gapFloor}px`);
|
|
@@ -277,15 +278,16 @@ export class FrameResponsive {
|
|
|
277
278
|
this.#applyFallbackAttributes(node);
|
|
278
279
|
|
|
279
280
|
const computed = getComputedStyle(node);
|
|
281
|
+
const lineGapFloor = px(computed.getPropertyValue("--snowui-single-line-gap-floor") || "4px");
|
|
280
282
|
const direction = computed.flexDirection;
|
|
281
283
|
const isFlex = computed.display === "flex" || computed.display === "inline-flex";
|
|
282
284
|
const isRow = isFlex && (direction === "row" || direction === "row-reverse");
|
|
283
285
|
const children = Array.from(node.children).filter(isMeasurableChild);
|
|
284
286
|
let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
|
|
285
287
|
|
|
286
|
-
if (isSingleLineLayout(this.#getProps()) && gap <
|
|
287
|
-
gap =
|
|
288
|
-
node.style.setProperty("gap",
|
|
288
|
+
if (isSingleLineLayout(this.#getProps()) && gap < lineGapFloor) {
|
|
289
|
+
gap = lineGapFloor;
|
|
290
|
+
node.style.setProperty("gap", `${lineGapFloor}px`);
|
|
289
291
|
}
|
|
290
292
|
|
|
291
293
|
const padding = {
|
|
@@ -312,7 +314,7 @@ export class FrameResponsive {
|
|
|
312
314
|
if (preferredWidth <= width + EPSILON) return;
|
|
313
315
|
|
|
314
316
|
const gapFloor = isSingleLineLayout(this.#getProps())
|
|
315
|
-
? Math.max(
|
|
317
|
+
? Math.max(lineGapFloor, resolveFloor(gap, this.config?.minGap))
|
|
316
318
|
: resolveFloor(gap, this.config?.minGap);
|
|
317
319
|
|
|
318
320
|
const paddingFloor = {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* native-validation.svelte.js generated by Svelte v5.56.4 */
|
|
2
|
+
import * as $ from 'svelte/internal/client';
|
|
3
|
+
|
|
4
|
+
export function useNativeValidation(getControl, focus) {
|
|
5
|
+
let message = $.state("");
|
|
6
|
+
|
|
7
|
+
$.user_effect(() => {
|
|
8
|
+
const control = getControl();
|
|
9
|
+
|
|
10
|
+
if (!control) return;
|
|
11
|
+
|
|
12
|
+
const form = control.form;
|
|
13
|
+
|
|
14
|
+
function invalid(event) {
|
|
15
|
+
if (event.defaultPrevented) return;
|
|
16
|
+
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
$.set(message, control.validity.valueMissing ? "" : control.validationMessage, true);
|
|
19
|
+
|
|
20
|
+
const first = form
|
|
21
|
+
? Array.from(form.elements).find((item) => item.matches(":invalid"))
|
|
22
|
+
: control;
|
|
23
|
+
|
|
24
|
+
if (first === control) {
|
|
25
|
+
if (focus) focus(); else control.focus();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function update() {
|
|
30
|
+
if ($.get(message)) $.set(message, control.validity.valueMissing ? "" : control.validationMessage, true);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function reset() {
|
|
34
|
+
$.set(message, "");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
control.addEventListener("invalid", invalid);
|
|
38
|
+
control.addEventListener("input", update);
|
|
39
|
+
control.addEventListener("change", update);
|
|
40
|
+
|
|
41
|
+
const radioForm = control instanceof HTMLInputElement && control.type === "radio" ? form : null;
|
|
42
|
+
|
|
43
|
+
radioForm?.addEventListener("change", update);
|
|
44
|
+
form?.addEventListener("reset", reset);
|
|
45
|
+
|
|
46
|
+
return () => {
|
|
47
|
+
control.removeEventListener("invalid", invalid);
|
|
48
|
+
control.removeEventListener("input", update);
|
|
49
|
+
control.removeEventListener("change", update);
|
|
50
|
+
radioForm?.removeEventListener("change", update);
|
|
51
|
+
form?.removeEventListener("reset", reset);
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
get message() {
|
|
57
|
+
return $.get(message);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRequiredFeedback(getInput: () => HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | undefined, getSurface: () => HTMLElement | readonly HTMLElement[] | undefined, focus?: () => void): void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* required-feedback.svelte.js generated by Svelte v5.56.4 */
|
|
2
|
+
import * as $ from 'svelte/internal/client';
|
|
3
|
+
import { INPUT_REQUIRED_KEYFRAMES, INPUT_REQUIRED_TIMING } from "../motion/presets/input-required.js";
|
|
4
|
+
|
|
5
|
+
export function useRequiredFeedback(getInput, getSurface, focus) {
|
|
6
|
+
$.user_effect(() => {
|
|
7
|
+
const input = getInput();
|
|
8
|
+
const surface = getSurface();
|
|
9
|
+
|
|
10
|
+
if (!input || !surface) return;
|
|
11
|
+
|
|
12
|
+
let feedback = [];
|
|
13
|
+
|
|
14
|
+
function stop() {
|
|
15
|
+
feedback.forEach((animation) => animation.cancel());
|
|
16
|
+
feedback = [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function invalid() {
|
|
20
|
+
if (!input.validity.valueMissing) return;
|
|
21
|
+
|
|
22
|
+
const first = input.form
|
|
23
|
+
? Array.from(input.form.elements).find((control) => control.matches("input:invalid, textarea:invalid, select:invalid"))
|
|
24
|
+
: input;
|
|
25
|
+
|
|
26
|
+
if (first !== input) return;
|
|
27
|
+
|
|
28
|
+
stop();
|
|
29
|
+
|
|
30
|
+
if (focus) focus(); else input.focus();
|
|
31
|
+
|
|
32
|
+
if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
33
|
+
const current = getSurface();
|
|
34
|
+
const surfaces = Array.isArray(current) ? current : current ? [current] : [];
|
|
35
|
+
|
|
36
|
+
feedback = surfaces.map((target) => {
|
|
37
|
+
const animation = target.animate(INPUT_REQUIRED_KEYFRAMES, INPUT_REQUIRED_TIMING);
|
|
38
|
+
|
|
39
|
+
animation.id = "snowui-required-feedback";
|
|
40
|
+
|
|
41
|
+
return animation;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
input.addEventListener("invalid", invalid);
|
|
47
|
+
input.addEventListener("input", stop);
|
|
48
|
+
input.addEventListener("change", stop);
|
|
49
|
+
input.addEventListener("blur", stop);
|
|
50
|
+
input.form?.addEventListener("reset", stop);
|
|
51
|
+
|
|
52
|
+
return () => {
|
|
53
|
+
stop();
|
|
54
|
+
input.removeEventListener("invalid", invalid);
|
|
55
|
+
input.removeEventListener("input", stop);
|
|
56
|
+
input.removeEventListener("change", stop);
|
|
57
|
+
input.removeEventListener("blur", stop);
|
|
58
|
+
input.form?.removeEventListener("reset", stop);
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
@@ -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 */
|