@greypan/web-ui 12.0.1 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.CN.md +4 -0
  2. package/README.md +4 -0
  3. package/dist/assets/menu-portal.js +1 -1
  4. package/dist/assets/menu-portal.js.map +1 -1
  5. package/dist/assets/toast-containers.js +1 -1
  6. package/dist/assets/toast-containers.js.map +1 -1
  7. package/dist/components/autocomplete/index.d.ts +5 -0
  8. package/dist/components/autocomplete/index.d.ts.map +1 -1
  9. package/dist/components/autocomplete/index.js +18 -2
  10. package/dist/components/autocomplete/index.js.map +1 -1
  11. package/dist/components/autocomplete/style.js +1 -1
  12. package/dist/components/autocomplete/style.js.map +1 -1
  13. package/dist/components/back-top/style.js +1 -1
  14. package/dist/components/back-top/style.js.map +1 -1
  15. package/dist/components/button-group/style.js +1 -1
  16. package/dist/components/button-group/style.js.map +1 -1
  17. package/dist/components/dialog/index.d.ts +5 -1
  18. package/dist/components/dialog/index.d.ts.map +1 -1
  19. package/dist/components/dialog/index.js +16 -4
  20. package/dist/components/dialog/index.js.map +1 -1
  21. package/dist/components/dialog/style.js +1 -1
  22. package/dist/components/dialog/style.js.map +1 -1
  23. package/dist/components/drawer/index.d.ts +11 -0
  24. package/dist/components/drawer/index.d.ts.map +1 -1
  25. package/dist/components/drawer/index.js +23 -1
  26. package/dist/components/drawer/index.js.map +1 -1
  27. package/dist/components/drawer/page-shift.js +113 -0
  28. package/dist/components/drawer/page-shift.js.map +1 -0
  29. package/dist/components/dropdown/index.js +1 -1
  30. package/dist/components/grouped-text/grouping.d.ts +25 -0
  31. package/dist/components/grouped-text/grouping.d.ts.map +1 -0
  32. package/dist/components/grouped-text/grouping.js +147 -0
  33. package/dist/components/grouped-text/grouping.js.map +1 -0
  34. package/dist/components/grouped-text/index.d.ts +36 -0
  35. package/dist/components/grouped-text/index.d.ts.map +1 -0
  36. package/dist/components/grouped-text/index.js +28 -0
  37. package/dist/components/grouped-text/index.js.map +1 -0
  38. package/dist/components/grouped-text/style.js +5 -0
  39. package/dist/components/grouped-text/style.js.map +1 -0
  40. package/dist/components/icon/index.d.ts +1 -1
  41. package/dist/components/icon/index.d.ts.map +1 -1
  42. package/dist/components/index.d.ts +6 -2
  43. package/dist/components/index.d.ts.map +1 -1
  44. package/dist/components/index.js +4 -1
  45. package/dist/components/layout/index.d.ts +8 -0
  46. package/dist/components/layout/index.d.ts.map +1 -1
  47. package/dist/components/layout/index.js +24 -13
  48. package/dist/components/layout/index.js.map +1 -1
  49. package/dist/components/layout/style.js +1 -1
  50. package/dist/components/layout/style.js.map +1 -1
  51. package/dist/components/middle-ellipsis/index.js +1 -1
  52. package/dist/components/popover/index.d.ts +5 -2
  53. package/dist/components/popover/index.d.ts.map +1 -1
  54. package/dist/components/popover/index.js +32 -21
  55. package/dist/components/popover/index.js.map +1 -1
  56. package/dist/components/popover/style.js +1 -1
  57. package/dist/components/popover/style.js.map +1 -1
  58. package/dist/components/progress/index.d.ts +30 -0
  59. package/dist/components/progress/index.d.ts.map +1 -0
  60. package/dist/components/progress/index.js +103 -0
  61. package/dist/components/progress/index.js.map +1 -0
  62. package/dist/components/progress/style.js +5 -0
  63. package/dist/components/progress/style.js.map +1 -0
  64. package/dist/components/segmented-trigger/index.d.ts +2 -0
  65. package/dist/components/segmented-trigger/index.d.ts.map +1 -1
  66. package/dist/components/segmented-trigger/index.js +7 -0
  67. package/dist/components/segmented-trigger/index.js.map +1 -1
  68. package/dist/components/select/index.d.ts +13 -0
  69. package/dist/components/select/index.d.ts.map +1 -1
  70. package/dist/components/select/index.js +41 -3
  71. package/dist/components/select/index.js.map +1 -1
  72. package/dist/components/select/style.js +1 -1
  73. package/dist/components/select/style.js.map +1 -1
  74. package/dist/components/shake/index.d.ts +43 -0
  75. package/dist/components/shake/index.d.ts.map +1 -0
  76. package/dist/components/shake/index.js +103 -0
  77. package/dist/components/shake/index.js.map +1 -0
  78. package/dist/components/spinner/index.d.ts +0 -3
  79. package/dist/components/spinner/index.d.ts.map +1 -1
  80. package/dist/components/spinner/index.js +5 -20
  81. package/dist/components/spinner/index.js.map +1 -1
  82. package/dist/components/spinner/style.js +1 -1
  83. package/dist/components/spinner/style.js.map +1 -1
  84. package/dist/components/theme/style.js +1 -1
  85. package/dist/components/theme/style.js.map +1 -1
  86. package/dist/components/tooltip/index.d.ts +8 -0
  87. package/dist/components/tooltip/index.d.ts.map +1 -1
  88. package/dist/components/tooltip/index.js +60 -10
  89. package/dist/components/tooltip/index.js.map +1 -1
  90. package/dist/components/tooltip/style.js +1 -1
  91. package/dist/components/tooltip/style.js.map +1 -1
  92. package/dist/icons/generated/ant-design-sync-outlined.d.ts +7 -0
  93. package/dist/icons/generated/ant-design-sync-outlined.d.ts.map +1 -0
  94. package/dist/icons/generated/ant-design-sync-outlined.js +9 -0
  95. package/dist/icons/generated/ant-design-sync-outlined.js.map +1 -0
  96. package/dist/icons/generated/ic-baseline-phonelink.d.ts +7 -0
  97. package/dist/icons/generated/ic-baseline-phonelink.d.ts.map +1 -0
  98. package/dist/icons/generated/ic-baseline-phonelink.js +9 -0
  99. package/dist/icons/generated/ic-baseline-phonelink.js.map +1 -0
  100. package/dist/icons/generated/ic-outline-motion-photos-off.d.ts +7 -0
  101. package/dist/icons/generated/ic-outline-motion-photos-off.d.ts.map +1 -0
  102. package/dist/icons/generated/ic-outline-motion-photos-off.js +9 -0
  103. package/dist/icons/generated/ic-outline-motion-photos-off.js.map +1 -0
  104. package/dist/icons/generated/ic-outline-motion-photos-on.d.ts +7 -0
  105. package/dist/icons/generated/ic-outline-motion-photos-on.d.ts.map +1 -0
  106. package/dist/icons/generated/ic-outline-motion-photos-on.js +9 -0
  107. package/dist/icons/generated/ic-outline-motion-photos-on.js.map +1 -0
  108. package/dist/icons/generated/ic-round-menu-open.d.ts +7 -0
  109. package/dist/icons/generated/ic-round-menu-open.d.ts.map +1 -0
  110. package/dist/icons/generated/ic-round-menu-open.js +9 -0
  111. package/dist/icons/generated/ic-round-menu-open.js.map +1 -0
  112. package/dist/icons/generated/lucide-accessibility.d.ts +7 -0
  113. package/dist/icons/generated/lucide-accessibility.d.ts.map +1 -0
  114. package/dist/icons/generated/lucide-accessibility.js +9 -0
  115. package/dist/icons/generated/lucide-accessibility.js.map +1 -0
  116. package/dist/icons/generated/lucide-boxes.d.ts +7 -0
  117. package/dist/icons/generated/lucide-boxes.d.ts.map +1 -0
  118. package/dist/icons/generated/lucide-boxes.js +9 -0
  119. package/dist/icons/generated/lucide-boxes.js.map +1 -0
  120. package/dist/icons/generated/lucide-contrast.d.ts +7 -0
  121. package/dist/icons/generated/lucide-contrast.d.ts.map +1 -0
  122. package/dist/icons/generated/lucide-contrast.js +9 -0
  123. package/dist/icons/generated/lucide-contrast.js.map +1 -0
  124. package/dist/icons/generated/lucide-keyboard.d.ts +7 -0
  125. package/dist/icons/generated/lucide-keyboard.d.ts.map +1 -0
  126. package/dist/icons/generated/lucide-keyboard.js +9 -0
  127. package/dist/icons/generated/lucide-keyboard.js.map +1 -0
  128. package/dist/icons/generated/lucide-languages.d.ts +7 -0
  129. package/dist/icons/generated/lucide-languages.d.ts.map +1 -0
  130. package/dist/icons/generated/lucide-languages.js +9 -0
  131. package/dist/icons/generated/lucide-languages.js.map +1 -0
  132. package/dist/icons/generated/lucide-list.d.ts +7 -0
  133. package/dist/icons/generated/lucide-list.d.ts.map +1 -0
  134. package/dist/icons/generated/lucide-list.js +9 -0
  135. package/dist/icons/generated/lucide-list.js.map +1 -0
  136. package/dist/icons/generated/lucide-moon.d.ts +7 -0
  137. package/dist/icons/generated/lucide-moon.d.ts.map +1 -0
  138. package/dist/icons/generated/lucide-moon.js +9 -0
  139. package/dist/icons/generated/lucide-moon.js.map +1 -0
  140. package/dist/icons/generated/lucide-sparkles.d.ts +7 -0
  141. package/dist/icons/generated/lucide-sparkles.d.ts.map +1 -0
  142. package/dist/icons/generated/lucide-sparkles.js +9 -0
  143. package/dist/icons/generated/lucide-sparkles.js.map +1 -0
  144. package/dist/icons/generated/lucide-sun.d.ts +7 -0
  145. package/dist/icons/generated/lucide-sun.d.ts.map +1 -0
  146. package/dist/icons/generated/lucide-sun.js +9 -0
  147. package/dist/icons/generated/lucide-sun.js.map +1 -0
  148. package/dist/icons/generated/tabler-brand-typescript.d.ts +7 -0
  149. package/dist/icons/generated/tabler-brand-typescript.d.ts.map +1 -0
  150. package/dist/icons/generated/tabler-brand-typescript.js +9 -0
  151. package/dist/icons/generated/tabler-brand-typescript.js.map +1 -0
  152. package/dist/icons/index.d.ts +87 -72
  153. package/dist/icons/index.js +16 -1
  154. package/dist/shared/locale/builtin-labels.js +2 -1
  155. package/dist/shared/locale/builtin-labels.js.map +1 -1
  156. package/dist/shared/overlay/anchored-panel.js +2 -2
  157. package/dist/shared/overlay/anchored-panel.js.map +1 -1
  158. package/dist/shared/overlay/presence.js +2 -2
  159. package/dist/shared/overlay/presence.js.map +1 -1
  160. package/dist/shared/overlay/trigger-props.d.ts +10 -0
  161. package/dist/shared/overlay/trigger-props.d.ts.map +1 -0
  162. package/dist/shared/overlay/trigger-props.js +42 -0
  163. package/dist/shared/overlay/trigger-props.js.map +1 -0
  164. package/package.json +4 -2
@@ -1,8 +1,6 @@
1
1
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
2
- import { defineOpenOverlay } from "../../shared/overlay/open-overlay.js";
3
2
  import { getFallbackOverlayRoot } from "../../shared/overlay/overlay-root.js";
4
3
  import { findRootTheme } from "../../shared/overlay/theme-overlay-scope.js";
5
- import { defineScrollLockLease } from "../../shared/scroll-lock/scroll-lock.js";
6
4
  import style_default from "./style.js";
7
5
  import { LitElement, html, nothing, unsafeCSS } from "lit";
8
6
  import { customElement, property } from "lit/decorators.js";
@@ -29,11 +27,6 @@ let WebUiSpinner = class WebUiSpinner extends LitElement {
29
27
  this.size = 24;
30
28
  this.description = "";
31
29
  this.color = "";
32
- this._overlay = defineOpenOverlay().make({
33
- requestClose: () => void 0,
34
- isConnected: () => this.isConnected
35
- });
36
- this._scrollLock = defineScrollLockLease().make();
37
30
  this._imperative = false;
38
31
  }
39
32
  static {
@@ -85,16 +78,12 @@ let WebUiSpinner = class WebUiSpinner extends LitElement {
85
78
  if (_WebUiSpinner._current && _WebUiSpinner._current !== this) _WebUiSpinner._current.remove();
86
79
  _WebUiSpinner._current = this;
87
80
  this.classList.add("wui-spinner-overlay");
88
- this._scrollLock.sync(true);
89
81
  this.requestUpdate();
90
82
  }
91
83
  }
92
84
  disconnectedCallback() {
93
85
  super.disconnectedCallback();
94
86
  this._closeDialog();
95
- this._overlayHandle?.release();
96
- this._overlayHandle = void 0;
97
- this._scrollLock.release();
98
87
  if (this._timer) {
99
88
  const timer = this._timer;
100
89
  queueMicrotask(() => {
@@ -113,9 +102,10 @@ let WebUiSpinner = class WebUiSpinner extends LitElement {
113
102
  if (!this._imperative || !this.isConnected) return;
114
103
  const dialog = this.shadowRoot?.querySelector("dialog");
115
104
  if (!dialog || dialog.open) return;
116
- if (typeof dialog.showModal === "function") {
117
- dialog.showModal();
118
- this._overlayHandle = this._overlay.claim(dialog, { ancestryFrom: this });
105
+ const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
106
+ if (typeof dialog.show === "function") {
107
+ dialog.show();
108
+ if (previouslyFocused && previouslyFocused !== document.body) previouslyFocused.focus({ preventScroll: true });
119
109
  } else dialog.setAttribute("open", "");
120
110
  }
121
111
  _handleDialogCancel(event) {
@@ -137,12 +127,7 @@ let WebUiSpinner = class WebUiSpinner extends LitElement {
137
127
  ${this.description ? html`<div class="spinner-description">${this.description}</div>` : nothing}
138
128
  <slot name="description"></slot>
139
129
  `;
140
- return this._imperative ? html`<dialog
141
- class="wui-spinner-overlay"
142
- aria-label=${this._ariaLabel}
143
- aria-modal="true"
144
- @cancel=${this._handleDialogCancel}
145
- >
130
+ return this._imperative ? html`<dialog class="wui-spinner-overlay" aria-label=${this._ariaLabel} @cancel=${this._handleDialogCancel}>
146
131
  <div class="wui-spinner-overlay-content" role="status" aria-label=${this._ariaLabel}>${spinner}</div>
147
132
  </dialog>` : spinner;
148
133
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["style"],"sources":["../../../src/components/spinner/index.ts"],"sourcesContent":["import { html, LitElement, nothing, type PropertyValues, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { styleMap } from 'lit/directives/style-map.js'\n\nimport type { WebUiTheme } from '@/components/theme'\nimport { defineOpenOverlay, type OpenOverlayHandle } from '@/shared/overlay/open-overlay'\nimport { getFallbackOverlayRoot } from '@/shared/overlay/overlay-root'\nimport { findRootTheme } from '@/shared/overlay/theme-overlay-scope'\nimport { defineScrollLockLease } from '@/shared/scroll-lock/scroll-lock'\n\nimport style from './style.css?inline'\n\nconst LEAF_COUNT = 8\n\ntype SpinnerMountTarget = {\n element: HTMLElement\n initializingTheme?: WebUiTheme\n}\n\nfunction getSpinnerMountTarget(): SpinnerMountTarget {\n const rootTheme = findRootTheme()\n const overlayRoot = rootTheme?.getOverlayRoot()\n if (overlayRoot) return { element: overlayRoot }\n\n const initializingTheme = Array.from(document.querySelectorAll<WebUiTheme>('web-ui-theme')).find(\n theme => theme.appearance !== undefined\n )\n return initializingTheme ? { element: initializingTheme, initializingTheme } : { element: getFallbackOverlayRoot() }\n}\n\n@customElement('web-ui-spinner')\nexport class WebUiSpinner extends LitElement {\n static override styles = unsafeCSS(style)\n\n @property({ type: Number, reflect: true }) size = 24\n @property({ type: String }) description = ''\n /** 叶片颜色;空字符串时跟随主题次要文本色。 */\n @property({ type: String }) color = ''\n @property({ type: String, attribute: 'aria-label' }) private _ariaLabel?: string\n\n private readonly _overlay = defineOpenOverlay().make({\n requestClose: () => undefined,\n isConnected: () => this.isConnected\n })\n private _overlayHandle?: OpenOverlayHandle\n private readonly _scrollLock = defineScrollLockLease().make()\n\n /**\n * 显示一个全屏加载实例并挂载到主题 overlay root(无主题时挂载到 fallback overlay root);新实例会替换之前由此方法创建的实例。\n * @param options 尺寸、说明文字、颜色与可选自动关闭时长。\n * @returns 已挂载的 spinner 实例。\n */\n static show(options?: { size?: number; duration?: number; description?: string; color?: string }): WebUiSpinner {\n const el = document.createElement('web-ui-spinner')\n el._imperative = true\n if (options?.size) el.size = options.size\n if (options?.description) el.description = options.description\n if (options?.color !== undefined) el.color = options.color\n const mountTarget = getSpinnerMountTarget()\n mountTarget.element.appendChild(el)\n if (mountTarget.initializingTheme) {\n const theme = mountTarget.initializingTheme\n const moveIntoOverlayRoot = () => {\n const overlayRoot = theme.getOverlayRoot()\n if (overlayRoot && theme.isConnected && el.parentElement === theme) overlayRoot.appendChild(el)\n }\n void theme.updateComplete.then(\n () => {\n moveIntoOverlayRoot()\n if (el.parentElement === theme) window.requestAnimationFrame(moveIntoOverlayRoot)\n },\n () => undefined\n )\n }\n if (options?.duration && options.duration > 0) {\n el._timer = window.setTimeout(() => WebUiSpinner.hide(), options.duration)\n }\n return el\n }\n\n // 销毁由 show() 挂载的实例。\n static hide() {\n const current = WebUiSpinner._current\n if (!current) return\n\n if (current._timer) {\n clearTimeout(current._timer)\n current._timer = undefined\n }\n current._closeDialog()\n current.remove()\n if (WebUiSpinner._current === current) WebUiSpinner._current = undefined\n }\n\n /** @internal 当前命令式实例 */\n static _current?: WebUiSpinner\n\n /** @internal */\n _imperative = false\n /** @internal */\n _timer?: ReturnType<typeof setTimeout>\n\n override connectedCallback() {\n super.connectedCallback()\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'status')\n }\n if (!this.hasAttribute('aria-label')) {\n this.setAttribute('aria-label', 'Loading')\n }\n if (this._imperative) {\n if (WebUiSpinner._current && WebUiSpinner._current !== this) WebUiSpinner._current.remove()\n WebUiSpinner._current = this\n this.classList.add('wui-spinner-overlay')\n this._scrollLock.sync(true)\n this.requestUpdate()\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback()\n this._closeDialog()\n this._overlayHandle?.release()\n this._overlayHandle = undefined\n this._scrollLock.release()\n if (this._timer) {\n const timer = this._timer\n queueMicrotask(() => {\n if (this.isConnected || this._timer !== timer) return\n clearTimeout(timer)\n this._timer = undefined\n })\n }\n }\n\n protected override updated(props: PropertyValues) {\n super.updated(props)\n this._syncImperativeOverlay()\n if (props.has('size')) {\n this.style.setProperty('--wui-spinner-size', `${this.size}px`)\n }\n }\n\n private _syncImperativeOverlay() {\n if (!this._imperative || !this.isConnected) return\n const dialog = this.shadowRoot?.querySelector('dialog')\n if (!dialog || dialog.open) return\n\n if (typeof dialog.showModal === 'function') {\n dialog.showModal()\n this._overlayHandle = this._overlay.claim(dialog, { ancestryFrom: this })\n } else {\n dialog.setAttribute('open', '')\n }\n }\n\n private _handleDialogCancel(event: Event) {\n event.preventDefault()\n }\n\n private _closeDialog() {\n const dialog = this.shadowRoot?.querySelector('dialog')\n if (!dialog?.open) return\n if (typeof dialog.close === 'function') dialog.close()\n else dialog.removeAttribute('open')\n }\n\n override render() {\n const spinner = html`\n <div class=\"wui-spinner\" style=${styleMap({ color: this.color || undefined })}>\n ${repeat(\n Array.from({ length: LEAF_COUNT }, (_, i) => i),\n i =>\n html`<span\n style=\"transform:rotate(${i * 45}deg);animation-delay:calc(-${LEAF_COUNT - i} / ${LEAF_COUNT} * var(--wui-duration-spinner, 800ms))\"\n ></span>`\n )}\n </div>\n ${this.description ? html`<div class=\"spinner-description\">${this.description}</div>` : nothing}\n <slot name=\"description\"></slot>\n `\n return this._imperative\n ? html`<dialog\n class=\"wui-spinner-overlay\"\n aria-label=${this._ariaLabel}\n aria-modal=\"true\"\n @cancel=${this._handleDialogCancel}\n >\n <div class=\"wui-spinner-overlay-content\" role=\"status\" aria-label=${this._ariaLabel}>${spinner}</div>\n </dialog>`\n : spinner\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-spinner': WebUiSpinner\n }\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,aAAa;AAOnB,SAAS,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AA,GAAA,aAAA,WAAA,cAAA,KAAA,CAAA;AARpD,eAAA,gBAAA,WAAA,CAAA,cAAc,gBAAgB,CAAA,GAAA,YAAA"}
1
+ {"version":3,"file":"index.js","names":["style"],"sources":["../../../src/components/spinner/index.ts"],"sourcesContent":["import { html, LitElement, nothing, type PropertyValues, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { styleMap } from 'lit/directives/style-map.js'\n\nimport type { WebUiTheme } from '@/components/theme'\nimport { getFallbackOverlayRoot } from '@/shared/overlay/overlay-root'\nimport { findRootTheme } from '@/shared/overlay/theme-overlay-scope'\n\nimport style from './style.css?inline'\n\nconst LEAF_COUNT = 8\n\ntype SpinnerMountTarget = {\n element: HTMLElement\n initializingTheme?: WebUiTheme\n}\n\nfunction getSpinnerMountTarget(): SpinnerMountTarget {\n const rootTheme = findRootTheme()\n const overlayRoot = rootTheme?.getOverlayRoot()\n if (overlayRoot) return { element: overlayRoot }\n\n const initializingTheme = Array.from(document.querySelectorAll<WebUiTheme>('web-ui-theme')).find(\n theme => theme.appearance !== undefined\n )\n return initializingTheme ? { element: initializingTheme, initializingTheme } : { element: getFallbackOverlayRoot() }\n}\n\n@customElement('web-ui-spinner')\nexport class WebUiSpinner extends LitElement {\n static override styles = unsafeCSS(style)\n\n @property({ type: Number, reflect: true }) size = 24\n @property({ type: String }) description = ''\n /** 叶片颜色;空字符串时跟随主题次要文本色。 */\n @property({ type: String }) color = ''\n @property({ type: String, attribute: 'aria-label' }) private _ariaLabel?: string\n\n /**\n * 显示一个全屏加载实例并挂载到主题 overlay root(无主题时挂载到 fallback overlay root);新实例会替换之前由此方法创建的实例。\n * @param options 尺寸、说明文字、颜色与可选自动关闭时长。\n * @returns 已挂载的 spinner 实例。\n */\n static show(options?: { size?: number; duration?: number; description?: string; color?: string }): WebUiSpinner {\n const el = document.createElement('web-ui-spinner')\n el._imperative = true\n if (options?.size) el.size = options.size\n if (options?.description) el.description = options.description\n if (options?.color !== undefined) el.color = options.color\n const mountTarget = getSpinnerMountTarget()\n mountTarget.element.appendChild(el)\n if (mountTarget.initializingTheme) {\n const theme = mountTarget.initializingTheme\n const moveIntoOverlayRoot = () => {\n const overlayRoot = theme.getOverlayRoot()\n if (overlayRoot && theme.isConnected && el.parentElement === theme) overlayRoot.appendChild(el)\n }\n void theme.updateComplete.then(\n () => {\n moveIntoOverlayRoot()\n if (el.parentElement === theme) window.requestAnimationFrame(moveIntoOverlayRoot)\n },\n () => undefined\n )\n }\n if (options?.duration && options.duration > 0) {\n el._timer = window.setTimeout(() => WebUiSpinner.hide(), options.duration)\n }\n return el\n }\n\n // 销毁由 show() 挂载的实例。\n static hide() {\n const current = WebUiSpinner._current\n if (!current) return\n\n if (current._timer) {\n clearTimeout(current._timer)\n current._timer = undefined\n }\n current._closeDialog()\n current.remove()\n if (WebUiSpinner._current === current) WebUiSpinner._current = undefined\n }\n\n /** @internal 当前命令式实例 */\n static _current?: WebUiSpinner\n\n /** @internal */\n _imperative = false\n /** @internal */\n _timer?: ReturnType<typeof setTimeout>\n\n override connectedCallback() {\n super.connectedCallback()\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'status')\n }\n if (!this.hasAttribute('aria-label')) {\n this.setAttribute('aria-label', 'Loading')\n }\n if (this._imperative) {\n if (WebUiSpinner._current && WebUiSpinner._current !== this) WebUiSpinner._current.remove()\n WebUiSpinner._current = this\n this.classList.add('wui-spinner-overlay')\n this.requestUpdate()\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback()\n this._closeDialog()\n if (this._timer) {\n const timer = this._timer\n queueMicrotask(() => {\n if (this.isConnected || this._timer !== timer) return\n clearTimeout(timer)\n this._timer = undefined\n })\n }\n }\n\n protected override updated(props: PropertyValues) {\n super.updated(props)\n this._syncImperativeOverlay()\n if (props.has('size')) {\n this.style.setProperty('--wui-spinner-size', `${this.size}px`)\n }\n }\n\n private _syncImperativeOverlay() {\n if (!this._imperative || !this.isConnected) return\n const dialog = this.shadowRoot?.querySelector('dialog')\n if (!dialog || dialog.open) return\n\n // 加载提示不是模态框:只占位显示状态,页面其余控件与滚动保持可用。\n const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null\n if (typeof dialog.show === 'function') {\n dialog.show()\n if (previouslyFocused && previouslyFocused !== document.body) previouslyFocused.focus({ preventScroll: true })\n } else {\n dialog.setAttribute('open', '')\n }\n }\n\n private _handleDialogCancel(event: Event) {\n event.preventDefault()\n }\n\n private _closeDialog() {\n const dialog = this.shadowRoot?.querySelector('dialog')\n if (!dialog?.open) return\n if (typeof dialog.close === 'function') dialog.close()\n else dialog.removeAttribute('open')\n }\n\n override render() {\n const spinner = html`\n <div class=\"wui-spinner\" style=${styleMap({ color: this.color || undefined })}>\n ${repeat(\n Array.from({ length: LEAF_COUNT }, (_, i) => i),\n i =>\n html`<span\n style=\"transform:rotate(${i * 45}deg);animation-delay:calc(-${LEAF_COUNT - i} / ${LEAF_COUNT} * var(--wui-duration-spinner, 800ms))\"\n ></span>`\n )}\n </div>\n ${this.description ? html`<div class=\"spinner-description\">${this.description}</div>` : nothing}\n <slot name=\"description\"></slot>\n `\n return this._imperative\n ? html`<dialog class=\"wui-spinner-overlay\" aria-label=${this._ariaLabel} @cancel=${this._handleDialogCancel}>\n <div class=\"wui-spinner-overlay-content\" role=\"status\" aria-label=${this._ariaLabel}>${spinner}</div>\n </dialog>`\n : spinner\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-spinner': WebUiSpinner\n }\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,aAAa;AAOnB,SAAS,wBAA4C;CAEnD,MAAM,cADY,cACU,CAAC,EAAE,eAAe;CAC9C,IAAI,aAAa,OAAO,EAAE,SAAS,YAAY;CAE/C,MAAM,oBAAoB,MAAM,KAAK,SAAS,iBAA6B,cAAc,CAAC,CAAC,CAAC,MAC1F,UAAS,MAAM,eAAe,KAAA,CAChC;CACA,OAAO,oBAA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OAChD,OAAO,gBAAgB,MAAM;CACpC;CAEA,SAAkB;EAChB,MAAM,UAAU,IAAI;uCACe,SAAS,EAAE,OAAO,KAAK,SAAS,KAAA,EAAU,CAAC,EAAE;UAC1E,OACA,MAAM,KAAK,EAAE,QAAQ,WAAW,IAAI,GAAG,MAAM,CAAC,IAC9C,MACE,IAAI;wCACwB,IAAI,GAAG,6BAA6B,aAAa,EAAE,KAAK,WAAW;qBAEnG,EAAE;;QAEF,KAAK,cAAc,IAAI,oCAAoC,KAAK,YAAY,UAAU,QAAQ;;;EAGlG,OAAO,KAAK,cACR,IAAI,kDAAkD,KAAK,WAAW,WAAW,KAAK,oBAAoB;8EACpC,KAAK,WAAW,GAAG,QAAQ;qBAEjG;CACN;AACF;AAhJG,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,aAAA,WAAA,QAAA,KAAA,CAAA;AACxC,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,aAAA,WAAA,eAAA,KAAA,CAAA;AAEzB,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,aAAA,WAAA,SAAA,KAAA,CAAA;AACzB,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAa,CAAC,CAAA,GAAA,aAAA,WAAA,cAAA,KAAA,CAAA;AARpD,eAAA,gBAAA,WAAA,CAAA,cAAc,gBAAgB,CAAA,GAAA,YAAA"}
@@ -1,5 +1,5 @@
1
1
  // src/components/spinner/style.css?inline
2
- var style_default = "*,:before,:after{box-sizing:border-box}:host{color:var(--wui-color-text-secondary,#6a6a6a);justify-content:center;align-items:center;display:inline-flex}:host(.wui-spinner-overlay){display:contents}.wui-spinner{width:var(--wui-spinner-size,24px);height:var(--wui-spinner-size,24px);position:relative}.wui-spinner span{transform-origin:50%;width:10%;height:100%;animation:wui-spinner-leaf-fade var(--wui-duration-spinner,.8s) linear infinite;position:absolute;top:0;left:50%}.wui-spinner span:before{content:\"\";border-radius:var(--wui-radius-control,calc(infinity * 1px));background-color:currentColor;width:100%;height:30%;margin-top:12%;display:block}.wui-spinner-overlay{pointer-events:auto;z-index:var(--wui-layer-loading,300);width:100%;max-width:none;height:100%;max-height:none;color:inherit;background:0 0;border:0;justify-content:center;align-items:center;margin:0;padding:0;display:flex;position:fixed;inset:0;overflow:hidden}.wui-spinner-overlay::backdrop{background:0 0}.wui-spinner-overlay-content{gap:var(--wui-space-2,8px);flex-direction:column;justify-content:center;align-items:center;display:flex}.spinner-description{max-width:240px;font-size:var(--wui-font-size,14px);line-height:var(--wui-line-height-normal,1.5);color:var(--wui-color-text-secondary,#6a6a6a);text-align:center}@keyframes wui-spinner-leaf-fade{0%{opacity:1}to{opacity:0}}\n";
2
+ var style_default = "*,:before,:after{box-sizing:border-box}:host{color:var(--wui-color-text-secondary,#6a6a6a);justify-content:center;align-items:center;display:inline-flex}:host(.wui-spinner-overlay){display:contents}.wui-spinner{width:var(--wui-spinner-size,24px);height:var(--wui-spinner-size,24px);position:relative}.wui-spinner span{transform-origin:50%;width:10%;height:100%;animation:wui-spinner-leaf-fade var(--wui-duration-spinner,.8s) linear infinite;position:absolute;top:0;left:50%}.wui-spinner span:before{content:\"\";border-radius:var(--wui-radius-control,calc(infinity * 1px));background-color:currentColor;width:100%;height:30%;margin-top:12%;display:block}.wui-spinner-overlay{pointer-events:none;z-index:var(--wui-layer-loading,3000);width:100%;max-width:none;height:100%;max-height:none;color:inherit;background:0 0;border:0;justify-content:center;align-items:center;margin:0;padding:0;display:flex;position:fixed;inset:0;overflow:hidden}.wui-spinner-overlay::backdrop{background:0 0}.wui-spinner-overlay-content{gap:var(--wui-space-2,8px);flex-direction:column;justify-content:center;align-items:center;display:flex}.spinner-description{max-width:240px;font-size:var(--wui-font-size,14px);line-height:var(--wui-line-height-normal,1.5);color:var(--wui-color-text-secondary,#6a6a6a);text-align:center}@keyframes wui-spinner-leaf-fade{0%{opacity:1}to{opacity:0}}\n";
3
3
  export { style_default as default };
4
4
 
5
5
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":[],"sources":["../../../src/components/spinner/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--wui-color-text-secondary, #6a6a6a);\n}\n\n:host(.wui-spinner-overlay) {\n display: contents;\n}\n\n.wui-spinner {\n position: relative;\n width: var(--wui-spinner-size, 24px);\n height: var(--wui-spinner-size, 24px);\n\n span {\n position: absolute;\n top: 0;\n left: 50%;\n transform-origin: center center;\n\n width: 10%;\n height: 100%;\n\n animation: wui-spinner-leaf-fade var(--wui-duration-spinner, 800ms) linear infinite;\n\n &::before {\n content: '';\n\n display: block;\n\n width: 100%;\n height: 30%;\n margin-top: 12%;\n border-radius: var(--wui-radius-control, calc(infinity * 1px));\n\n background-color: currentcolor;\n }\n }\n}\n\n.wui-spinner-overlay {\n pointer-events: auto;\n\n position: fixed;\n z-index: var(--wui-layer-loading, 300);\n inset: 0;\n\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n max-width: none;\n height: 100%;\n max-height: none;\n margin: 0;\n padding: 0;\n border: 0;\n\n color: inherit;\n\n background: transparent;\n\n &::backdrop {\n background: transparent;\n }\n}\n\n.wui-spinner-overlay-content {\n display: flex;\n flex-direction: column;\n gap: var(--wui-space-2, 8px);\n align-items: center;\n justify-content: center;\n}\n\n.spinner-description {\n max-width: 240px;\n\n font-size: var(--wui-font-size, 14px);\n line-height: var(--wui-line-height-normal, 1.5);\n color: var(--wui-color-text-secondary, #6a6a6a);\n text-align: center;\n}\n\n@keyframes wui-spinner-leaf-fade {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n"],"mappings":";AAAA,IAAA,gBAAA"}
1
+ {"version":3,"file":"style.js","names":[],"sources":["../../../src/components/spinner/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--wui-color-text-secondary, #6a6a6a);\n}\n\n:host(.wui-spinner-overlay) {\n display: contents;\n}\n\n.wui-spinner {\n position: relative;\n width: var(--wui-spinner-size, 24px);\n height: var(--wui-spinner-size, 24px);\n\n span {\n position: absolute;\n top: 0;\n left: 50%;\n transform-origin: center center;\n\n width: 10%;\n height: 100%;\n\n animation: wui-spinner-leaf-fade var(--wui-duration-spinner, 800ms) linear infinite;\n\n &::before {\n content: '';\n\n display: block;\n\n width: 100%;\n height: 30%;\n margin-top: 12%;\n border-radius: var(--wui-radius-control, calc(infinity * 1px));\n\n background-color: currentcolor;\n }\n }\n}\n\n.wui-spinner-overlay {\n /* 状态提示不占据命中层:全屏实例出现时,页面控件与滚动仍然可用。 */\n pointer-events: none;\n\n position: fixed;\n z-index: var(--wui-layer-loading, 3000);\n inset: 0;\n\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n max-width: none;\n height: 100%;\n max-height: none;\n margin: 0;\n padding: 0;\n border: 0;\n\n color: inherit;\n\n background: transparent;\n\n &::backdrop {\n background: transparent;\n }\n}\n\n.wui-spinner-overlay-content {\n display: flex;\n flex-direction: column;\n gap: var(--wui-space-2, 8px);\n align-items: center;\n justify-content: center;\n}\n\n.spinner-description {\n max-width: 240px;\n\n font-size: var(--wui-font-size, 14px);\n line-height: var(--wui-line-height-normal, 1.5);\n color: var(--wui-color-text-secondary, #6a6a6a);\n text-align: center;\n}\n\n@keyframes wui-spinner-leaf-fade {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n"],"mappings":";AAAA,IAAA,gBAAA"}
@@ -1,5 +1,5 @@
1
1
  // src/components/theme/style.css?inline
2
- var style_default = "*,:before,:after{box-sizing:border-box}:host{--wui-font-size-caption:12px;--wui-font-size-readout:13px;--wui-font-size:14px;--wui-font-size-title:18px;--wui-font-weight-medium:500;--wui-font-weight-semibold:600;--wui-line-height-tight:1.2;--wui-line-height-snug:1.4;--wui-line-height-normal:1.5;--wui-line-height-relaxed:1.6;--wui-space-1:4px;--wui-space-2:8px;--wui-space-3:12px;--wui-space-4:16px;--wui-space-5:20px;--wui-space-6:24px;--wui-input-width:200px;--wui-control-size:36px;--wui-overlay-min-width:200px;--wui-selection-control-size:18px;--wui-radio-group-gap:var(--wui-space-2);--wui-checkbox-group-gap:var(--wui-space-2);--wui-layer-inline-overlay:1;--wui-layer-header:10;--wui-layer-auxiliary:20;--wui-layer-banner:30;--wui-layer-tabbar:40;--wui-layer-sidebar:50;--wui-layer-menu:100;--wui-layer-menu-nested:110;--wui-layer-toast:200;--wui-layer-loading:300;--wui-duration-press:80ms;--wui-duration-feedback:.1s;--wui-duration-trigger:.16s;--wui-duration-focus:.2s;--wui-duration-float-enter:.24s;--wui-duration-float-exit:.16s;--wui-duration-dialog-enter:.32s;--wui-duration-dialog-exit:.26s;--wui-duration-drawer-enter:.28s;--wui-duration-drawer-exit:.24s;--wui-duration-drawer-nested:.45s;--wui-duration-toast-enter:.28s;--wui-duration-toast-exit:.2s;--wui-duration-collapse-enter:.2s;--wui-duration-collapse-exit:.16s;--wui-duration-layout:.2s;--wui-duration-swipe-settle:.22s;--wui-duration-spin:.6s;--wui-duration-spinner:.8s;--wui-theme-transition-duration:.5s;--wui-theme-transition-easing:ease-in;--wui-ease-enter:cubic-bezier(.23, 1, .32, 1);--wui-ease-dialog:cubic-bezier(.2, 0, 0, 1);--wui-ease-slide:cubic-bezier(.77, 0, .175, 1);--wui-ease-swipe:cubic-bezier(.32, .72, 0, 1);--wui-ease-float:cubic-bezier(.4, .38, .2, 1);--wui-scale-enter:.9;--wui-dialog-scale-enter:1.1;--wui-focus-ring-width:3px;--wui-radius-control:calc(infinity * 1px);--wui-radius-menu:18px;--wui-radius-overlay:28px;display:contents}:host([motion=reduced]){--wui-duration-press:0s;--wui-duration-feedback:0s;--wui-duration-trigger:0s;--wui-duration-focus:0s;--wui-duration-float-enter:0s;--wui-duration-float-exit:0s;--wui-duration-dialog-enter:0s;--wui-duration-dialog-exit:0s;--wui-duration-drawer-enter:0s;--wui-duration-drawer-exit:0s;--wui-duration-drawer-nested:0s;--wui-duration-toast-enter:0s;--wui-duration-toast-exit:0s;--wui-duration-collapse-enter:0s;--wui-duration-collapse-exit:0s;--wui-duration-layout:0s;--wui-duration-swipe-settle:0s;--wui-theme-transition-duration:0s;--wui-duration-spin:1.6s;--wui-duration-spinner:1.6s;--wui-scale-enter:1;--wui-dialog-scale-enter:1}@media (prefers-reduced-motion:reduce){:host([motion=system]){--wui-duration-press:0s;--wui-duration-feedback:0s;--wui-duration-trigger:0s;--wui-duration-focus:0s;--wui-duration-float-enter:0s;--wui-duration-float-exit:0s;--wui-duration-dialog-enter:0s;--wui-duration-dialog-exit:0s;--wui-duration-drawer-enter:0s;--wui-duration-drawer-exit:0s;--wui-duration-drawer-nested:0s;--wui-duration-toast-enter:0s;--wui-duration-toast-exit:0s;--wui-duration-collapse-enter:0s;--wui-duration-collapse-exit:0s;--wui-duration-layout:0s;--wui-duration-swipe-settle:0s;--wui-theme-transition-duration:0s;--wui-duration-spin:1.6s;--wui-duration-spinner:1.6s;--wui-scale-enter:1;--wui-dialog-scale-enter:1}}:host([appearance=light]),:host([appearance=system]){--wui-color-page:#fff;--wui-color-surface:#fff;--wui-color-surface-raised:#f2f2f7;--wui-color-surface-control:#dfdfdf;--wui-color-surface-track:#e5e5ea;--wui-color-surface-menu:#fafafac2;--wui-color-surface-glass:#fafafa57;--wui-color-surface-glass-hover:color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));--wui-color-surface-glass-active:color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));--wui-color-surface-overlay:#f8f8f8eb;--wui-color-surface-sidebar:#e9e9e9d1;--wui-color-surface-segmented:#dfdfdf;--wui-color-surface-segmented-track:#e5e5ea;--wui-color-surface-selected:#fff;--wui-color-text:#1b1b1b;--wui-color-text-secondary:#6a6a6a;--wui-color-text-tertiary:color-mix(in srgb, var(--wui-color-text) 35%, transparent);--wui-color-text-disabled:color-mix(in srgb, var(--wui-color-text) 32%, transparent);--wui-color-state-layer-hover:color-mix(in srgb, var(--wui-color-text) 6%, transparent);--wui-color-state-layer-active:color-mix(in srgb, var(--wui-color-text) 15%, transparent);--wui-color-border:#0000001a;--wui-color-glass-highlight:#ffffffe6;--wui-color-glass-ring:#0000000d;--wui-color-glass-ring-sheen:#ffffff80;--wui-color-glass-ring-shade:#00000008;--wui-glass-brightness:1.06;--wui-color-accent:#0071e3;--wui-color-on-accent:#fff;--wui-color-on-danger:#fff;--wui-color-on-control:#fff;--wui-color-success:#16a34a;--wui-color-warning:#d97706;--wui-color-danger:#dc2626;--wui-color-info:#2563eb;--wui-color-backdrop:#0000001f;--wui-shadow-overlay:2px 16px 40px #0006;--wui-shadow-panel:0 3px 9px #00000045;--wui-shadow-glass:0 0 1px #00000005, 0 0 8px #00000008, 0 2px 16px #00000006, 0 8px 32px #00000004;--wui-color-focus-ring:color-mix(in srgb, var(--wui-color-accent,#0071e3) 40%, transparent);--wui-scrollbar-handle:#00000063;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}:host([appearance=dark]){--wui-color-page:#242628;--wui-color-surface:#2c2c2e;--wui-color-surface-raised:#2c2c2e;--wui-color-surface-control:#3a3a3c;--wui-color-surface-track:#444446;--wui-color-surface-menu:#313032bd;--wui-color-surface-glass:#2c2c2e6b;--wui-color-surface-glass-hover:color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));--wui-color-surface-glass-active:color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));--wui-color-surface-overlay:#202222eb;--wui-color-surface-sidebar:#2c2c2ecc;--wui-color-surface-segmented:#3a3a3c;--wui-color-surface-segmented-track:#17191a;--wui-color-surface-selected:#242628;--wui-color-text:#e9eaea;--wui-color-text-secondary:#a1a1a6;--wui-color-text-tertiary:color-mix(in srgb, var(--wui-color-text) 42%, transparent);--wui-color-text-disabled:color-mix(in srgb, var(--wui-color-text) 38%, transparent);--wui-color-state-layer-hover:color-mix(in srgb, var(--wui-color-text) 6%, transparent);--wui-color-state-layer-active:color-mix(in srgb, var(--wui-color-text) 15%, transparent);--wui-color-border:#ffffff24;--wui-color-glass-highlight:#ffffff1a;--wui-color-glass-ring:#ffffff0d;--wui-color-glass-ring-sheen:#fff3;--wui-color-glass-ring-shade:#00000080;--wui-glass-brightness:1.02;--wui-color-accent:#0a84ff;--wui-color-on-accent:#000;--wui-color-on-danger:#000;--wui-color-on-control:#f2f2f7;--wui-color-success:#30d158;--wui-color-warning:#ff9f0a;--wui-color-danger:#ff453a;--wui-color-info:#64d2ff;--wui-color-backdrop:#0000007a;--wui-shadow-overlay:0 18px 48px #0000007a;--wui-shadow-panel:0 4px 16px #00000052;--wui-shadow-glass:0 8px 24px #00000014;--wui-color-focus-ring:color-mix(in srgb, var(--wui-color-accent,#0a84ff) 62%, var(--wui-color-text) 38%);--wui-scrollbar-handle:#ffffff80;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@media (prefers-color-scheme:dark){:host([appearance=system]){--wui-color-page:#242628;--wui-color-surface:#2c2c2e;--wui-color-surface-raised:#2c2c2e;--wui-color-surface-control:#3a3a3c;--wui-color-surface-track:#444446;--wui-color-surface-menu:#313032bd;--wui-color-surface-glass:#2c2c2e6b;--wui-color-surface-glass-hover:color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));--wui-color-surface-glass-active:color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));--wui-color-surface-overlay:#202222eb;--wui-color-surface-sidebar:#2c2c2ecc;--wui-color-surface-segmented:#3a3a3c;--wui-color-surface-segmented-track:#17191a;--wui-color-surface-selected:#242628;--wui-color-text:#e9eaea;--wui-color-text-secondary:#a1a1a6;--wui-color-text-tertiary:color-mix(in srgb, var(--wui-color-text) 42%, transparent);--wui-color-text-disabled:color-mix(in srgb, var(--wui-color-text) 38%, transparent);--wui-color-state-layer-hover:color-mix(in srgb, var(--wui-color-text) 6%, transparent);--wui-color-state-layer-active:color-mix(in srgb, var(--wui-color-text) 15%, transparent);--wui-color-border:#ffffff24;--wui-color-glass-highlight:#ffffff1a;--wui-color-glass-ring:#ffffff0d;--wui-color-glass-ring-sheen:#fff3;--wui-color-glass-ring-shade:#00000080;--wui-glass-brightness:1.02;--wui-color-accent:#0a84ff;--wui-color-on-accent:#000;--wui-color-on-danger:#000;--wui-color-on-control:#f2f2f7;--wui-color-success:#30d158;--wui-color-warning:#ff9f0a;--wui-color-danger:#ff453a;--wui-color-info:#64d2ff;--wui-color-backdrop:#0000007a;--wui-shadow-overlay:0 18px 48px #0000007a;--wui-shadow-panel:0 4px 16px #00000052;--wui-shadow-glass:0 8px 24px #00000014;--wui-color-focus-ring:color-mix(in srgb, var(--wui-color-accent,#0a84ff) 62%, var(--wui-color-text) 38%);--wui-scrollbar-handle:#ffffff80;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}\n";
2
+ var style_default = "*,:before,:after{box-sizing:border-box}:host{--wui-font-size-caption:12px;--wui-font-size-readout:13px;--wui-font-size:14px;--wui-font-size-title:18px;--wui-font-weight-medium:500;--wui-font-weight-semibold:600;--wui-line-height-tight:1.2;--wui-line-height-snug:1.4;--wui-line-height-normal:1.5;--wui-line-height-relaxed:1.6;--wui-space-1:4px;--wui-space-2:8px;--wui-space-3:12px;--wui-space-4:16px;--wui-space-5:20px;--wui-space-6:24px;--wui-input-width:200px;--wui-control-size:36px;--wui-overlay-min-width:200px;--wui-selection-control-size:18px;--wui-radio-group-gap:var(--wui-space-2);--wui-checkbox-group-gap:var(--wui-space-2);--wui-layer-inline-overlay:10;--wui-layer-header:100;--wui-layer-auxiliary:200;--wui-layer-banner:300;--wui-layer-tabbar:400;--wui-layer-sidebar:500;--wui-layer-menu:1000;--wui-layer-menu-nested:1100;--wui-layer-toast:2000;--wui-layer-loading:3000;--wui-duration-press:80ms;--wui-duration-feedback:.1s;--wui-duration-trigger:.16s;--wui-duration-focus:.2s;--wui-duration-float-enter:.24s;--wui-duration-float-exit:.16s;--wui-duration-dialog-enter:.32s;--wui-duration-dialog-exit:.26s;--wui-duration-drawer-enter:.28s;--wui-duration-drawer-exit:.24s;--wui-duration-drawer-nested:.45s;--wui-duration-toast-enter:.28s;--wui-duration-toast-exit:.2s;--wui-duration-collapse-enter:.2s;--wui-duration-collapse-exit:.16s;--wui-duration-layout:.2s;--wui-duration-swipe-settle:.22s;--wui-duration-spin:.6s;--wui-duration-spinner:.8s;--wui-theme-transition-duration:.5s;--wui-theme-transition-easing:ease-in;--wui-ease-enter:cubic-bezier(.23, 1, .32, 1);--wui-ease-dialog:cubic-bezier(.2, 0, 0, 1);--wui-ease-slide:cubic-bezier(.77, 0, .175, 1);--wui-ease-swipe:cubic-bezier(.32, .72, 0, 1);--wui-ease-float:cubic-bezier(.4, .38, .2, 1);--wui-scale-enter:.9;--wui-dialog-scale-enter:1.1;--wui-focus-ring-width:3px;--wui-radius-control:calc(infinity * 1px);--wui-radius-menu:18px;--wui-radius-overlay:28px;display:contents}:host([motion=reduced]){--wui-duration-press:0s;--wui-duration-feedback:0s;--wui-duration-trigger:0s;--wui-duration-focus:0s;--wui-duration-float-enter:0s;--wui-duration-float-exit:0s;--wui-duration-dialog-enter:0s;--wui-duration-dialog-exit:0s;--wui-duration-drawer-enter:0s;--wui-duration-drawer-exit:0s;--wui-duration-drawer-nested:0s;--wui-duration-toast-enter:0s;--wui-duration-toast-exit:0s;--wui-duration-collapse-enter:0s;--wui-duration-collapse-exit:0s;--wui-duration-layout:0s;--wui-duration-swipe-settle:0s;--wui-theme-transition-duration:0s;--wui-duration-spin:1.6s;--wui-duration-spinner:1.6s;--wui-scale-enter:1;--wui-dialog-scale-enter:1}@media (prefers-reduced-motion:reduce){:host([motion=system]){--wui-duration-press:0s;--wui-duration-feedback:0s;--wui-duration-trigger:0s;--wui-duration-focus:0s;--wui-duration-float-enter:0s;--wui-duration-float-exit:0s;--wui-duration-dialog-enter:0s;--wui-duration-dialog-exit:0s;--wui-duration-drawer-enter:0s;--wui-duration-drawer-exit:0s;--wui-duration-drawer-nested:0s;--wui-duration-toast-enter:0s;--wui-duration-toast-exit:0s;--wui-duration-collapse-enter:0s;--wui-duration-collapse-exit:0s;--wui-duration-layout:0s;--wui-duration-swipe-settle:0s;--wui-theme-transition-duration:0s;--wui-duration-spin:1.6s;--wui-duration-spinner:1.6s;--wui-scale-enter:1;--wui-dialog-scale-enter:1}}:host([appearance=light]),:host([appearance=system]){--wui-color-page:#fff;--wui-color-surface:#fff;--wui-color-surface-raised:#f2f2f7;--wui-color-surface-control:#dfdfdf;--wui-color-surface-track:#e5e5ea;--wui-color-surface-menu:#fafafac2;--wui-color-surface-glass:#fafafa57;--wui-color-surface-glass-hover:color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));--wui-color-surface-glass-active:color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));--wui-color-surface-overlay:#f8f8f8eb;--wui-color-surface-sidebar:#e9e9e9d1;--wui-color-surface-segmented:#dfdfdf;--wui-color-surface-segmented-track:#e5e5ea;--wui-color-surface-selected:#fff;--wui-color-text:#1b1b1b;--wui-color-text-secondary:#6a6a6a;--wui-color-text-tertiary:color-mix(in srgb, var(--wui-color-text) 35%, transparent);--wui-color-text-disabled:color-mix(in srgb, var(--wui-color-text) 32%, transparent);--wui-color-state-layer-hover:color-mix(in srgb, var(--wui-color-text) 6%, transparent);--wui-color-state-layer-active:color-mix(in srgb, var(--wui-color-text) 15%, transparent);--wui-color-border:#0000001a;--wui-color-glass-highlight:#ffffffe6;--wui-color-glass-ring:#0000000d;--wui-color-glass-ring-sheen:#ffffff80;--wui-color-glass-ring-shade:#00000008;--wui-glass-brightness:1.06;--wui-color-accent:#0071e3;--wui-color-on-accent:#fff;--wui-color-on-danger:#fff;--wui-color-on-control:#fff;--wui-color-success:#16a34a;--wui-color-warning:#d97706;--wui-color-danger:#dc2626;--wui-color-info:#2563eb;--wui-color-backdrop:#0000001f;--wui-shadow-overlay:2px 16px 40px #0006;--wui-shadow-panel:0 3px 9px #00000045;--wui-shadow-glass:0 0 1px #00000005, 0 0 8px #00000008, 0 2px 16px #00000006, 0 8px 32px #00000004;--wui-color-focus-ring:color-mix(in srgb, var(--wui-color-accent,#0071e3) 40%, transparent);--wui-scrollbar-handle:#00000063;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}:host([appearance=dark]){--wui-color-page:#242628;--wui-color-surface:#2c2c2e;--wui-color-surface-raised:#2c2c2e;--wui-color-surface-control:#3a3a3c;--wui-color-surface-track:#444446;--wui-color-surface-menu:#313032bd;--wui-color-surface-glass:#2c2c2e6b;--wui-color-surface-glass-hover:color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));--wui-color-surface-glass-active:color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));--wui-color-surface-overlay:#202222eb;--wui-color-surface-sidebar:#2c2c2ecc;--wui-color-surface-segmented:#3a3a3c;--wui-color-surface-segmented-track:#17191a;--wui-color-surface-selected:#242628;--wui-color-text:#e9eaea;--wui-color-text-secondary:#a1a1a6;--wui-color-text-tertiary:color-mix(in srgb, var(--wui-color-text) 42%, transparent);--wui-color-text-disabled:color-mix(in srgb, var(--wui-color-text) 38%, transparent);--wui-color-state-layer-hover:color-mix(in srgb, var(--wui-color-text) 6%, transparent);--wui-color-state-layer-active:color-mix(in srgb, var(--wui-color-text) 15%, transparent);--wui-color-border:#ffffff24;--wui-color-glass-highlight:#ffffff1a;--wui-color-glass-ring:#ffffff0d;--wui-color-glass-ring-sheen:#fff3;--wui-color-glass-ring-shade:#00000080;--wui-glass-brightness:1.02;--wui-color-accent:#0a84ff;--wui-color-on-accent:#000;--wui-color-on-danger:#000;--wui-color-on-control:#f2f2f7;--wui-color-success:#30d158;--wui-color-warning:#ff9f0a;--wui-color-danger:#ff453a;--wui-color-info:#64d2ff;--wui-color-backdrop:#0000007a;--wui-shadow-overlay:0 18px 48px #0000007a;--wui-shadow-panel:0 4px 16px #00000052;--wui-shadow-glass:0 8px 24px #00000014;--wui-color-focus-ring:color-mix(in srgb, var(--wui-color-accent,#0a84ff) 62%, var(--wui-color-text) 38%);--wui-scrollbar-handle:#ffffff80;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@media (prefers-color-scheme:dark){:host([appearance=system]){--wui-color-page:#242628;--wui-color-surface:#2c2c2e;--wui-color-surface-raised:#2c2c2e;--wui-color-surface-control:#3a3a3c;--wui-color-surface-track:#444446;--wui-color-surface-menu:#313032bd;--wui-color-surface-glass:#2c2c2e6b;--wui-color-surface-glass-hover:color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));--wui-color-surface-glass-active:color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));--wui-color-surface-overlay:#202222eb;--wui-color-surface-sidebar:#2c2c2ecc;--wui-color-surface-segmented:#3a3a3c;--wui-color-surface-segmented-track:#17191a;--wui-color-surface-selected:#242628;--wui-color-text:#e9eaea;--wui-color-text-secondary:#a1a1a6;--wui-color-text-tertiary:color-mix(in srgb, var(--wui-color-text) 42%, transparent);--wui-color-text-disabled:color-mix(in srgb, var(--wui-color-text) 38%, transparent);--wui-color-state-layer-hover:color-mix(in srgb, var(--wui-color-text) 6%, transparent);--wui-color-state-layer-active:color-mix(in srgb, var(--wui-color-text) 15%, transparent);--wui-color-border:#ffffff24;--wui-color-glass-highlight:#ffffff1a;--wui-color-glass-ring:#ffffff0d;--wui-color-glass-ring-sheen:#fff3;--wui-color-glass-ring-shade:#00000080;--wui-glass-brightness:1.02;--wui-color-accent:#0a84ff;--wui-color-on-accent:#000;--wui-color-on-danger:#000;--wui-color-on-control:#f2f2f7;--wui-color-success:#30d158;--wui-color-warning:#ff9f0a;--wui-color-danger:#ff453a;--wui-color-info:#64d2ff;--wui-color-backdrop:#0000007a;--wui-shadow-overlay:0 18px 48px #0000007a;--wui-shadow-panel:0 4px 16px #00000052;--wui-shadow-glass:0 8px 24px #00000014;--wui-color-focus-ring:color-mix(in srgb, var(--wui-color-accent,#0a84ff) 62%, var(--wui-color-text) 38%);--wui-scrollbar-handle:#ffffff80;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}\n";
3
3
  export { style_default as default };
4
4
 
5
5
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":[],"sources":["../../../src/components/theme/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n /*\n * 排版族:按角色命名,不引入数字阶(与 §6.3 的 radius 决策同构——名字回答\n * 「这块文字是什么」,不回答「它是第几号」)。\n *\n * 字号四档,各自对应一个真实角色而非尺寸偏好:\n * caption 12px 密集 chrome label(badge、toast 时间戳、menu 分组头)\n * readout 13px 数字读数(image-preview 计数与缩放比,带 tabular-nums;\n * 13px 是承重的——它要装进 min-width:48px 的胶囊)\n * 14px 正文基准,即下面的 --wui-font-size\n * title 18px 有界卡片标题(dialog、drawer)\n *\n * 行高同理分四档。组件里的 line-height:1 与 0 刻意不 token 化:前者是控件内\n * 单行 label 的垂直居中手段,后者是让包裹盒高收缩到内容的技巧,两者都不是\n * 排版行高,token 化会误导后来者以为可以整体调它们。\n */\n --wui-font-size-caption: 12px;\n --wui-font-size-readout: 13px;\n --wui-font-size: 14px;\n --wui-font-size-title: 18px;\n --wui-font-weight-medium: 500;\n --wui-font-weight-semibold: 600;\n --wui-line-height-tight: 1.2;\n --wui-line-height-snug: 1.4;\n --wui-line-height-normal: 1.5;\n --wui-line-height-relaxed: 1.6;\n\n /*\n * 间距阶:4px 基准的 6 级,止于组件层以生效的静态节奏字面量写入的最大值 24px(唯一更宽的\n * empty padding 由 --wui-empty-size 在 JS 侧派生,属尺寸那根轴)。它不替代组件的\n * 局部覆盖 token(--wui-button-px、--wui-dialog-padding 等),而是充当那些\n * token 的 fallback 默认值——组件继续决定「我的 padding 是多少」,本族提供\n * 「这个值在整套尺度里的位置」,嵌入方因此拿到一个全局密度杠杆。\n *\n * 本族刻意不含 1px / 2px / 6px / 7.5px / 10px 与负值。1px 是发丝线与描边环的\n * 结构宽度;2px、6px、7.5px 是光学修正;10px 是 4px 阶之外的半档耦合值;负\n * margin 用来抵消 flex gap 或 button padding。它们都是「为什么是这个数」各自独立\n * 的答案,不共享「间距」语义,收进同一把尺子只会让覆盖其中之一时误伤其余。\n */\n --wui-space-1: 4px;\n --wui-space-2: 8px;\n --wui-space-3: 12px;\n --wui-space-4: 16px;\n --wui-space-5: 20px;\n --wui-space-6: 24px;\n\n --wui-input-width: 200px;\n --wui-control-size: 36px;\n --wui-overlay-min-width: 200px;\n\n /* radio / checkbox indicator 尺寸。宿主高度由内容撑开,不继承页面行高。 */\n --wui-selection-control-size: 18px;\n\n /* radio-group / checkbox-group 成员间距,两个 group 各自可覆盖。 */\n --wui-radio-group-gap: var(--wui-space-2);\n --wui-checkbox-group-gap: var(--wui-space-2);\n\n --wui-layer-inline-overlay: 1;\n --wui-layer-header: 10;\n --wui-layer-auxiliary: 20;\n --wui-layer-banner: 30;\n --wui-layer-tabbar: 40;\n --wui-layer-sidebar: 50;\n\n --wui-layer-menu: 100;\n --wui-layer-menu-nested: 110;\n --wui-layer-toast: 200;\n --wui-layer-loading: 300;\n --wui-duration-press: 80ms;\n --wui-duration-feedback: 100ms;\n --wui-duration-trigger: 160ms;\n --wui-duration-focus: 200ms;\n\n /* 锚定浮动 panel(menu/popover/select/dropdown/tooltip/autocomplete)的进场与退场时长,\n 出场快于入场。 */\n --wui-duration-float-enter: 240ms;\n --wui-duration-float-exit: 160ms;\n --wui-duration-dialog-enter: 320ms;\n --wui-duration-dialog-exit: 260ms;\n --wui-duration-drawer-enter: 280ms;\n --wui-duration-drawer-exit: 240ms;\n --wui-duration-drawer-nested: 450ms;\n --wui-duration-toast-enter: 280ms;\n --wui-duration-toast-exit: 200ms;\n --wui-duration-collapse-enter: 200ms;\n --wui-duration-collapse-exit: 160ms;\n --wui-duration-layout: 200ms;\n\n /* image-preview 轮播回位:跟手结束后把 track 过渡到目标位。不属于进出场族,故单独成 token。 */\n --wui-duration-swipe-settle: 220ms;\n\n /* 无限循环的加载指示:icon 旋转与 spinner 叶片追光。周期属于动画自身而非转场,\n 但同样受 motion 契约约束,reduce 下只放慢不停。 */\n --wui-duration-spin: 600ms;\n --wui-duration-spinner: 800ms;\n --wui-theme-transition-duration: 500ms;\n --wui-theme-transition-easing: ease-in;\n\n --wui-ease-enter: cubic-bezier(0.23, 1, 0.32, 1);\n --wui-ease-dialog: cubic-bezier(0.2, 0, 0, 1);\n --wui-ease-slide: cubic-bezier(0.77, 0, 0.175, 1);\n\n /* 轮播回位的缓动:起步快、末段极慢,与 --wui-ease-slide(整卡位移)区分开。 */\n --wui-ease-swipe: cubic-bezier(0.32, 0.72, 0, 1);\n\n /* 锚定浮动 panel 专属进场缓动,无回弹弹簧拟合曲线。若改用 --wui-ease-enter,\n 开局 30% 的时间就走完 85% 进度,观感是先弹出再落位。 */\n --wui-ease-float: cubic-bezier(0.4, 0.38, 0.2, 1);\n\n /* 进场缩放起点。两族方向相反,各自成 token:浮动 panel 与 image-preview 由小到大展开\n (0.9 → 1),dialog 由大到小收缩(1.1 → 1,退场反向)。\n 方向由承载层决定。image-preview 是满视口表面,起点 >1 会把贴边的 counter/close/\n toolbar 推出视口并裁掉图片四边,只能留在 <1 的档位。dialog 是有界卡片,起点须低于\n 零越界上限 1/0.9 ≈ 1.111(min(90vw, --wui-dialog-width) 两分支在 400px 视口汇合);\n 1.1 在任意视口都不越界;起点再高(1.2)就会在窄视口短暂越界(约 57ms、卡片不透明度 ≤44.4%,\n 分析见 ADR-0006)。 */\n --wui-scale-enter: 0.9;\n --wui-dialog-scale-enter: 1.1;\n --wui-focus-ring-width: 3px;\n\n /* control=胶囊控件、menu=浮动 menu panel、overlay=大型覆盖层卡片 */\n --wui-radius-control: calc(infinity * 1px);\n --wui-radius-menu: 18px;\n --wui-radius-overlay: 28px;\n\n /* contents:主题宿主不生成盒、不绘制页面背景,嵌入方保留对宿主背景的完全控制\n (组件库不在宿主页面画背景)。自定义属性仍沿 DOM 树正常继承到 slotted 内容。 */\n display: contents;\n}\n\n:host([motion='reduced']) {\n --wui-duration-press: 0ms;\n --wui-duration-feedback: 0ms;\n --wui-duration-trigger: 0ms;\n --wui-duration-focus: 0ms;\n --wui-duration-float-enter: 0ms;\n --wui-duration-float-exit: 0ms;\n --wui-duration-dialog-enter: 0ms;\n --wui-duration-dialog-exit: 0ms;\n --wui-duration-drawer-enter: 0ms;\n --wui-duration-drawer-exit: 0ms;\n --wui-duration-drawer-nested: 0ms;\n --wui-duration-toast-enter: 0ms;\n --wui-duration-toast-exit: 0ms;\n --wui-duration-collapse-enter: 0ms;\n --wui-duration-collapse-exit: 0ms;\n --wui-duration-layout: 0ms;\n --wui-duration-swipe-settle: 0ms;\n --wui-theme-transition-duration: 0ms;\n\n /* 加载循环不在 reduce 下归零:它是「正在进行」的唯一信号,停掉会被读成界面卡死,只放慢。 */\n --wui-duration-spin: 1600ms;\n --wui-duration-spinner: 1600ms;\n\n --wui-scale-enter: 1;\n --wui-dialog-scale-enter: 1;\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host([motion='system']) {\n --wui-duration-press: 0ms;\n --wui-duration-feedback: 0ms;\n --wui-duration-trigger: 0ms;\n --wui-duration-focus: 0ms;\n --wui-duration-float-enter: 0ms;\n --wui-duration-float-exit: 0ms;\n --wui-duration-dialog-enter: 0ms;\n --wui-duration-dialog-exit: 0ms;\n --wui-duration-drawer-enter: 0ms;\n --wui-duration-drawer-exit: 0ms;\n --wui-duration-drawer-nested: 0ms;\n --wui-duration-toast-enter: 0ms;\n --wui-duration-toast-exit: 0ms;\n --wui-duration-collapse-enter: 0ms;\n --wui-duration-collapse-exit: 0ms;\n --wui-duration-layout: 0ms;\n --wui-duration-swipe-settle: 0ms;\n --wui-theme-transition-duration: 0ms;\n\n /* 加载循环不在 reduce 下归零:它是「正在进行」的唯一信号,停掉会被读成界面卡死,只放慢。 */\n --wui-duration-spin: 1600ms;\n --wui-duration-spinner: 1600ms;\n\n --wui-scale-enter: 1;\n --wui-dialog-scale-enter: 1;\n }\n}\n\n:host([appearance='light']),\n:host([appearance='system']) {\n --wui-color-page: #fff;\n --wui-color-surface: #fff;\n --wui-color-surface-raised: #f2f2f7;\n --wui-color-surface-control: #dfdfdf;\n --wui-color-surface-track: #e5e5ea;\n --wui-color-surface-menu: rgb(250 250 250 / 0.76);\n --wui-color-surface-glass: rgb(250 250 250 / 0.34);\n --wui-color-surface-glass-hover: color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));\n --wui-color-surface-glass-active: color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));\n --wui-color-surface-overlay: rgb(248 248 248 / 0.92);\n\n /* 侧边栏专用表面:浅色保持中性分层,深色单独抬升一档(见下方 dark 块注释)。 */\n --wui-color-surface-sidebar: rgb(233 233 233 / 0.82);\n\n /* 凹变种 indicator 与中性可交互控件同面:浅色与深色的默认值都取 control(= secondary button 的面)。\n 凸变种那颗另走一条等式(chip 与 page 同色、track 沉到 page 之下),规则见 segmented/style.css。 */\n --wui-color-surface-segmented: #dfdfdf;\n --wui-color-surface-segmented-track: #e5e5ea;\n --wui-color-surface-selected: #fff;\n --wui-color-text: #1b1b1b;\n --wui-color-text-secondary: #6a6a6a;\n --wui-color-text-tertiary: color-mix(in srgb, var(--wui-color-text) 35%, transparent);\n --wui-color-text-disabled: color-mix(in srgb, var(--wui-color-text) 32%, transparent);\n --wui-color-state-layer-hover: color-mix(in srgb, var(--wui-color-text) 6%, transparent);\n --wui-color-state-layer-active: color-mix(in srgb, var(--wui-color-text) 15%, transparent);\n --wui-color-border: rgb(0 0 0 / 0.1);\n\n /*\n * 玻璃色按「绘制在哪一层」分组,两个前缀对应两个互不相干的层:\n *\n * glass-highlight → 元素自身的 box-shadow inset 高光(不是描边环的一部分)\n * glass-ring-* → ::before 用 mask 挖出来的 1px 描边环,共三枚:\n * ring 是铺满整圈的底色,ring-sheen / ring-shade 是其上\n * 两枚对角 radial,只覆盖四个角\n *\n * 底色必须存在:四枚 radial 都锚在角点且半径固定(sheen 2R、shade R),一条边\n * 长过约 3R 就有一段落在所有 radial 之外,只靠 radial 时那段会整段消失。\n */\n --wui-color-glass-highlight: rgb(255 255 255 / 0.9);\n --wui-color-glass-ring: rgb(0 0 0 / 0.05);\n --wui-color-glass-ring-sheen: rgb(255 255 255 / 0.5);\n --wui-color-glass-ring-shade: rgb(0 0 0 / 0.03);\n --wui-glass-brightness: 1.06;\n --wui-color-accent: #0071e3;\n --wui-color-on-accent: #fff;\n --wui-color-on-danger: #fff;\n --wui-color-on-control: #fff;\n --wui-color-success: #16a34a;\n --wui-color-warning: #d97706;\n --wui-color-danger: #dc2626;\n --wui-color-info: #2563eb;\n --wui-color-backdrop: rgb(0 0 0 / 0.12);\n --wui-shadow-overlay: 2px 16px 40px rgb(0 0 0 / 0.4);\n --wui-shadow-panel: 0 3px 9px rgb(0 0 0 / 0.27);\n --wui-shadow-glass:\n 0 0 1px rgb(0 0 0 / 0.02), 0 0 8px rgb(0 0 0 / 0.03), 0 2px 16px rgb(0 0 0 / 0.025), 0 8px 32px rgb(0 0 0 / 0.015);\n --wui-color-focus-ring: color-mix(in srgb, var(--wui-color-accent, #0071e3) 40%, transparent);\n --wui-scrollbar-handle: rgb(0 0 0 / 0.39);\n color-scheme: light;\n}\n\n:host([appearance='dark']) {\n --wui-color-page: #242628;\n --wui-color-surface: #2c2c2e;\n --wui-color-surface-raised: #2c2c2e;\n --wui-color-surface-control: #3a3a3c;\n --wui-color-surface-track: #444446;\n --wui-color-surface-menu: rgb(49 48 50 / 0.74);\n --wui-color-surface-glass: rgb(44 44 46 / 0.42);\n --wui-color-surface-glass-hover: color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));\n --wui-color-surface-glass-active: color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));\n --wui-color-surface-overlay: rgb(32 34 34 / 0.92);\n\n /* 深色 elevation:浮动 panel 与侧边栏都比 page 浅一档。取 --wui-color-surface\n (#2c2c2e)作为「page 之上一档」的基准色,panel 按自身 alpha 叠在 page 上,\n 合成结果约 rgb(46 45 47),与 #2c2c2e 相差不超过 2/255。\n alpha 不取 0.92/0.9:颜色抬升后高 alpha 会让 panel 读成实心纸片,\n 取 0.74/0.8 才保留透感(模糊底内容可透出),层级方向不变。\n overlay 是唯一的例外:dialog/drawer/toast 背后的内容是被遮住的主体内容,\n 透过去会与 overlay 自身文字叠出干扰读的对比,因此单独抬到 0.92 换取可读性,\n 代价是失去透感——它本来也不属于「panel 透出 page」的层级语义。 */\n --wui-color-surface-sidebar: rgb(44 44 46 / 0.8);\n\n /* Segmented 的深色两档。凸变种(raised)复刻浅色那条「indicator 与 page 同色、track 沉一档」的\n 关系:浅色是 chip #fff(= page)浮在 #e5e5ea 上,深色 page(#242628)本来就是阶梯最暗的一档,\n 所以要让 chip 取到 page 色,只能把 track 再往下开一档到 #17191a(比 page 暗 13~14/255,与该主题\n 往上走的档差同量级:page→surface +6~+8、surface→control +14、control→track +10)。凸起方向仍由\n 「chip 比 track 亮」读出,WCAG 亮度比 1.16:1,与浅色的 1.26:1 同量级,不会盖过柔投影。\n 凹变种(inset)不参与:它的语义是「按下去的灰面」,track 取 surface(#2c2c2e)、indicator 取\n control(#3a3a3c,与浅色那颗同档),与 page 同色反而读不出选中。 */\n --wui-color-surface-segmented: #3a3a3c;\n --wui-color-surface-segmented-track: #17191a;\n --wui-color-surface-selected: #242628;\n --wui-color-text: #e9eaea;\n --wui-color-text-secondary: #a1a1a6;\n --wui-color-text-tertiary: color-mix(in srgb, var(--wui-color-text) 42%, transparent);\n --wui-color-text-disabled: color-mix(in srgb, var(--wui-color-text) 38%, transparent);\n --wui-color-state-layer-hover: color-mix(in srgb, var(--wui-color-text) 6%, transparent);\n --wui-color-state-layer-active: color-mix(in srgb, var(--wui-color-text) 15%, transparent);\n --wui-color-border: rgb(255 255 255 / 0.14);\n --wui-color-glass-highlight: rgb(255 255 255 / 0.1);\n --wui-color-glass-ring: rgb(255 255 255 / 0.05);\n --wui-color-glass-ring-sheen: rgb(255 255 255 / 0.2);\n --wui-color-glass-ring-shade: rgb(0 0 0 / 0.5);\n --wui-glass-brightness: 1.02;\n --wui-color-accent: #0a84ff;\n --wui-color-on-accent: #000;\n --wui-color-on-danger: #000;\n --wui-color-on-control: #f2f2f7;\n --wui-color-success: #30d158;\n --wui-color-warning: #ff9f0a;\n --wui-color-danger: #ff453a;\n --wui-color-info: #64d2ff;\n --wui-color-backdrop: rgb(0 0 0 / 0.48);\n --wui-shadow-overlay: 0 18px 48px rgb(0 0 0 / 0.48);\n --wui-shadow-panel: 0 4px 16px rgb(0 0 0 / 0.32);\n --wui-shadow-glass: 0 8px 24px rgb(0 0 0 / 0.08);\n --wui-color-focus-ring: color-mix(in srgb, var(--wui-color-accent, #0a84ff) 62%, var(--wui-color-text) 38%);\n --wui-scrollbar-handle: rgb(255 255 255 / 0.5);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :host([appearance='system']) {\n --wui-color-page: #242628;\n --wui-color-surface: #2c2c2e;\n --wui-color-surface-raised: #2c2c2e;\n --wui-color-surface-control: #3a3a3c;\n --wui-color-surface-track: #444446;\n --wui-color-surface-menu: rgb(49 48 50 / 0.74);\n --wui-color-surface-glass: rgb(44 44 46 / 0.42);\n --wui-color-surface-glass-hover: color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));\n --wui-color-surface-glass-active: color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));\n --wui-color-surface-overlay: rgb(32 34 34 / 0.92);\n --wui-color-surface-sidebar: rgb(44 44 46 / 0.8);\n --wui-color-surface-segmented: #3a3a3c;\n --wui-color-surface-segmented-track: #17191a;\n --wui-color-surface-selected: #242628;\n --wui-color-text: #e9eaea;\n --wui-color-text-secondary: #a1a1a6;\n --wui-color-text-tertiary: color-mix(in srgb, var(--wui-color-text) 42%, transparent);\n --wui-color-text-disabled: color-mix(in srgb, var(--wui-color-text) 38%, transparent);\n --wui-color-state-layer-hover: color-mix(in srgb, var(--wui-color-text) 6%, transparent);\n --wui-color-state-layer-active: color-mix(in srgb, var(--wui-color-text) 15%, transparent);\n --wui-color-border: rgb(255 255 255 / 0.14);\n --wui-color-glass-highlight: rgb(255 255 255 / 0.1);\n --wui-color-glass-ring: rgb(255 255 255 / 0.05);\n --wui-color-glass-ring-sheen: rgb(255 255 255 / 0.2);\n --wui-color-glass-ring-shade: rgb(0 0 0 / 0.5);\n --wui-glass-brightness: 1.02;\n --wui-color-accent: #0a84ff;\n --wui-color-on-accent: #000;\n --wui-color-on-danger: #000;\n --wui-color-on-control: #f2f2f7;\n --wui-color-success: #30d158;\n --wui-color-warning: #ff9f0a;\n --wui-color-danger: #ff453a;\n --wui-color-info: #64d2ff;\n --wui-color-backdrop: rgb(0 0 0 / 0.48);\n --wui-shadow-overlay: 0 18px 48px rgb(0 0 0 / 0.48);\n --wui-shadow-panel: 0 4px 16px rgb(0 0 0 / 0.32);\n --wui-shadow-glass: 0 8px 24px rgb(0 0 0 / 0.08);\n --wui-color-focus-ring: color-mix(in srgb, var(--wui-color-accent, #0a84ff) 62%, var(--wui-color-text) 38%);\n --wui-scrollbar-handle: rgb(255 255 255 / 0.5);\n color-scheme: dark;\n }\n}\n"],"mappings":";AAAA,IAAA,gBAAA"}
1
+ {"version":3,"file":"style.js","names":[],"sources":["../../../src/components/theme/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n /*\n * 排版族:按角色命名,不引入数字阶(与 §6.3 的 radius 决策同构——名字回答\n * 「这块文字是什么」,不回答「它是第几号」)。\n *\n * 字号四档,各自对应一个真实角色而非尺寸偏好:\n * caption 12px 密集 chrome label(badge、toast 时间戳、menu 分组头)\n * readout 13px 数字读数(image-preview 计数与缩放比,带 tabular-nums;\n * 13px 是承重的——它要装进 min-width:48px 的胶囊)\n * 14px 正文基准,即下面的 --wui-font-size\n * title 18px 有界卡片标题(dialog、drawer)\n *\n * 行高同理分四档。组件里的 line-height:1 与 0 刻意不 token 化:前者是控件内\n * 单行 label 的垂直居中手段,后者是让包裹盒高收缩到内容的技巧,两者都不是\n * 排版行高,token 化会误导后来者以为可以整体调它们。\n */\n --wui-font-size-caption: 12px;\n --wui-font-size-readout: 13px;\n --wui-font-size: 14px;\n --wui-font-size-title: 18px;\n --wui-font-weight-medium: 500;\n --wui-font-weight-semibold: 600;\n --wui-line-height-tight: 1.2;\n --wui-line-height-snug: 1.4;\n --wui-line-height-normal: 1.5;\n --wui-line-height-relaxed: 1.6;\n\n /*\n * 间距阶:4px 基准的 6 级,止于组件层以生效的静态节奏字面量写入的最大值 24px(唯一更宽的\n * empty padding 由 --wui-empty-size 在 JS 侧派生,属尺寸那根轴)。它不替代组件的\n * 局部覆盖 token(--wui-button-px、--wui-dialog-padding 等),而是充当那些\n * token 的 fallback 默认值——组件继续决定「我的 padding 是多少」,本族提供\n * 「这个值在整套尺度里的位置」,嵌入方因此拿到一个全局密度杠杆。\n *\n * 本族刻意不含 1px / 2px / 6px / 7.5px / 10px 与负值。1px 是发丝线与描边环的\n * 结构宽度;2px、6px、7.5px 是光学修正;10px 是 4px 阶之外的半档耦合值;负\n * margin 用来抵消 flex gap 或 button padding。它们都是「为什么是这个数」各自独立\n * 的答案,不共享「间距」语义,收进同一把尺子只会让覆盖其中之一时误伤其余。\n */\n --wui-space-1: 4px;\n --wui-space-2: 8px;\n --wui-space-3: 12px;\n --wui-space-4: 16px;\n --wui-space-5: 20px;\n --wui-space-6: 24px;\n\n --wui-input-width: 200px;\n --wui-control-size: 36px;\n --wui-overlay-min-width: 200px;\n\n /* radio / checkbox indicator 尺寸。宿主高度由内容撑开,不继承页面行高。 */\n --wui-selection-control-size: 18px;\n\n /* radio-group / checkbox-group 成员间距,两个 group 各自可覆盖。 */\n --wui-radio-group-gap: var(--wui-space-2);\n --wui-checkbox-group-gap: var(--wui-space-2);\n\n /*\n * 层级 token 按十位递进:布局层占 10–500,浮动层从 1000 起。应用内容里的局部\n * z-index 保持两位数量级,就不会越过 layout 的 header / sidebar。\n */\n --wui-layer-inline-overlay: 10;\n --wui-layer-header: 100;\n --wui-layer-auxiliary: 200;\n --wui-layer-banner: 300;\n --wui-layer-tabbar: 400;\n --wui-layer-sidebar: 500;\n\n --wui-layer-menu: 1000;\n --wui-layer-menu-nested: 1100;\n --wui-layer-toast: 2000;\n --wui-layer-loading: 3000;\n --wui-duration-press: 80ms;\n --wui-duration-feedback: 100ms;\n --wui-duration-trigger: 160ms;\n --wui-duration-focus: 200ms;\n\n /* 锚定浮动 panel(menu/popover/select/dropdown/tooltip/autocomplete)的进场与退场时长,\n 出场快于入场。 */\n --wui-duration-float-enter: 240ms;\n --wui-duration-float-exit: 160ms;\n --wui-duration-dialog-enter: 320ms;\n --wui-duration-dialog-exit: 260ms;\n --wui-duration-drawer-enter: 280ms;\n --wui-duration-drawer-exit: 240ms;\n --wui-duration-drawer-nested: 450ms;\n --wui-duration-toast-enter: 280ms;\n --wui-duration-toast-exit: 200ms;\n --wui-duration-collapse-enter: 200ms;\n --wui-duration-collapse-exit: 160ms;\n --wui-duration-layout: 200ms;\n\n /* image-preview 轮播回位:跟手结束后把 track 过渡到目标位。不属于进出场族,故单独成 token。 */\n --wui-duration-swipe-settle: 220ms;\n\n /* 无限循环的加载指示:icon 旋转与 spinner 叶片追光。周期属于动画自身而非转场,\n 但同样受 motion 契约约束,reduce 下只放慢不停。 */\n --wui-duration-spin: 600ms;\n --wui-duration-spinner: 800ms;\n --wui-theme-transition-duration: 500ms;\n --wui-theme-transition-easing: ease-in;\n\n --wui-ease-enter: cubic-bezier(0.23, 1, 0.32, 1);\n --wui-ease-dialog: cubic-bezier(0.2, 0, 0, 1);\n --wui-ease-slide: cubic-bezier(0.77, 0, 0.175, 1);\n\n /* 轮播回位的缓动:起步快、末段极慢,与 --wui-ease-slide(整卡位移)区分开。 */\n --wui-ease-swipe: cubic-bezier(0.32, 0.72, 0, 1);\n\n /* 锚定浮动 panel 专属进场缓动,无回弹弹簧拟合曲线。若改用 --wui-ease-enter,\n 开局 30% 的时间就走完 85% 进度,观感是先弹出再落位。 */\n --wui-ease-float: cubic-bezier(0.4, 0.38, 0.2, 1);\n\n /* 进场缩放起点。两族方向相反,各自成 token:浮动 panel 与 image-preview 由小到大展开\n (0.9 → 1),dialog 由大到小收缩(1.1 → 1,退场反向)。\n 方向由承载层决定。image-preview 是满视口表面,起点 >1 会把贴边的 counter/close/\n toolbar 推出视口并裁掉图片四边,只能留在 <1 的档位。dialog 是有界卡片,起点须低于\n 零越界上限 1/0.9 ≈ 1.111(min(90vw, --wui-dialog-width) 两分支在 400px 视口汇合);\n 1.1 在任意视口都不越界;起点再高(1.2)就会在窄视口短暂越界(约 57ms、卡片不透明度 ≤44.4%,\n 分析见 ADR-0006)。 */\n --wui-scale-enter: 0.9;\n --wui-dialog-scale-enter: 1.1;\n --wui-focus-ring-width: 3px;\n\n /* control=胶囊控件、menu=浮动 menu panel、overlay=大型覆盖层卡片 */\n --wui-radius-control: calc(infinity * 1px);\n --wui-radius-menu: 18px;\n --wui-radius-overlay: 28px;\n\n /* contents:主题宿主不生成盒、不绘制页面背景,嵌入方保留对宿主背景的完全控制\n (组件库不在宿主页面画背景)。自定义属性仍沿 DOM 树正常继承到 slotted 内容。 */\n display: contents;\n}\n\n:host([motion='reduced']) {\n --wui-duration-press: 0ms;\n --wui-duration-feedback: 0ms;\n --wui-duration-trigger: 0ms;\n --wui-duration-focus: 0ms;\n --wui-duration-float-enter: 0ms;\n --wui-duration-float-exit: 0ms;\n --wui-duration-dialog-enter: 0ms;\n --wui-duration-dialog-exit: 0ms;\n --wui-duration-drawer-enter: 0ms;\n --wui-duration-drawer-exit: 0ms;\n --wui-duration-drawer-nested: 0ms;\n --wui-duration-toast-enter: 0ms;\n --wui-duration-toast-exit: 0ms;\n --wui-duration-collapse-enter: 0ms;\n --wui-duration-collapse-exit: 0ms;\n --wui-duration-layout: 0ms;\n --wui-duration-swipe-settle: 0ms;\n --wui-theme-transition-duration: 0ms;\n\n /* 加载循环不在 reduce 下归零:它是「正在进行」的唯一信号,停掉会被读成界面卡死,只放慢。 */\n --wui-duration-spin: 1600ms;\n --wui-duration-spinner: 1600ms;\n\n --wui-scale-enter: 1;\n --wui-dialog-scale-enter: 1;\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host([motion='system']) {\n --wui-duration-press: 0ms;\n --wui-duration-feedback: 0ms;\n --wui-duration-trigger: 0ms;\n --wui-duration-focus: 0ms;\n --wui-duration-float-enter: 0ms;\n --wui-duration-float-exit: 0ms;\n --wui-duration-dialog-enter: 0ms;\n --wui-duration-dialog-exit: 0ms;\n --wui-duration-drawer-enter: 0ms;\n --wui-duration-drawer-exit: 0ms;\n --wui-duration-drawer-nested: 0ms;\n --wui-duration-toast-enter: 0ms;\n --wui-duration-toast-exit: 0ms;\n --wui-duration-collapse-enter: 0ms;\n --wui-duration-collapse-exit: 0ms;\n --wui-duration-layout: 0ms;\n --wui-duration-swipe-settle: 0ms;\n --wui-theme-transition-duration: 0ms;\n\n /* 加载循环不在 reduce 下归零:它是「正在进行」的唯一信号,停掉会被读成界面卡死,只放慢。 */\n --wui-duration-spin: 1600ms;\n --wui-duration-spinner: 1600ms;\n\n --wui-scale-enter: 1;\n --wui-dialog-scale-enter: 1;\n }\n}\n\n:host([appearance='light']),\n:host([appearance='system']) {\n --wui-color-page: #fff;\n --wui-color-surface: #fff;\n --wui-color-surface-raised: #f2f2f7;\n --wui-color-surface-control: #dfdfdf;\n --wui-color-surface-track: #e5e5ea;\n --wui-color-surface-menu: rgb(250 250 250 / 0.76);\n --wui-color-surface-glass: rgb(250 250 250 / 0.34);\n --wui-color-surface-glass-hover: color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));\n --wui-color-surface-glass-active: color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));\n --wui-color-surface-overlay: rgb(248 248 248 / 0.92);\n\n /* 侧边栏专用表面:浅色保持中性分层,深色单独抬升一档(见下方 dark 块注释)。 */\n --wui-color-surface-sidebar: rgb(233 233 233 / 0.82);\n\n /* 凹变种 indicator 与中性可交互控件同面:浅色与深色的默认值都取 control(= secondary button 的面)。\n 凸变种那颗另走一条等式(chip 与 page 同色、track 沉到 page 之下),规则见 segmented/style.css。 */\n --wui-color-surface-segmented: #dfdfdf;\n --wui-color-surface-segmented-track: #e5e5ea;\n --wui-color-surface-selected: #fff;\n --wui-color-text: #1b1b1b;\n --wui-color-text-secondary: #6a6a6a;\n --wui-color-text-tertiary: color-mix(in srgb, var(--wui-color-text) 35%, transparent);\n --wui-color-text-disabled: color-mix(in srgb, var(--wui-color-text) 32%, transparent);\n --wui-color-state-layer-hover: color-mix(in srgb, var(--wui-color-text) 6%, transparent);\n --wui-color-state-layer-active: color-mix(in srgb, var(--wui-color-text) 15%, transparent);\n --wui-color-border: rgb(0 0 0 / 0.1);\n\n /*\n * 玻璃色按「绘制在哪一层」分组,两个前缀对应两个互不相干的层:\n *\n * glass-highlight → 元素自身的 box-shadow inset 高光(不是描边环的一部分)\n * glass-ring-* → ::before 用 mask 挖出来的 1px 描边环,共三枚:\n * ring 是铺满整圈的底色,ring-sheen / ring-shade 是其上\n * 两枚对角 radial,只覆盖四个角\n *\n * 底色必须存在:四枚 radial 都锚在角点且半径固定(sheen 2R、shade R),一条边\n * 长过约 3R 就有一段落在所有 radial 之外,只靠 radial 时那段会整段消失。\n */\n --wui-color-glass-highlight: rgb(255 255 255 / 0.9);\n --wui-color-glass-ring: rgb(0 0 0 / 0.05);\n --wui-color-glass-ring-sheen: rgb(255 255 255 / 0.5);\n --wui-color-glass-ring-shade: rgb(0 0 0 / 0.03);\n --wui-glass-brightness: 1.06;\n --wui-color-accent: #0071e3;\n --wui-color-on-accent: #fff;\n --wui-color-on-danger: #fff;\n --wui-color-on-control: #fff;\n --wui-color-success: #16a34a;\n --wui-color-warning: #d97706;\n --wui-color-danger: #dc2626;\n --wui-color-info: #2563eb;\n --wui-color-backdrop: rgb(0 0 0 / 0.12);\n --wui-shadow-overlay: 2px 16px 40px rgb(0 0 0 / 0.4);\n --wui-shadow-panel: 0 3px 9px rgb(0 0 0 / 0.27);\n --wui-shadow-glass:\n 0 0 1px rgb(0 0 0 / 0.02), 0 0 8px rgb(0 0 0 / 0.03), 0 2px 16px rgb(0 0 0 / 0.025), 0 8px 32px rgb(0 0 0 / 0.015);\n --wui-color-focus-ring: color-mix(in srgb, var(--wui-color-accent, #0071e3) 40%, transparent);\n --wui-scrollbar-handle: rgb(0 0 0 / 0.39);\n color-scheme: light;\n}\n\n:host([appearance='dark']) {\n --wui-color-page: #242628;\n --wui-color-surface: #2c2c2e;\n --wui-color-surface-raised: #2c2c2e;\n --wui-color-surface-control: #3a3a3c;\n --wui-color-surface-track: #444446;\n --wui-color-surface-menu: rgb(49 48 50 / 0.74);\n --wui-color-surface-glass: rgb(44 44 46 / 0.42);\n --wui-color-surface-glass-hover: color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));\n --wui-color-surface-glass-active: color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));\n --wui-color-surface-overlay: rgb(32 34 34 / 0.92);\n\n /* 深色 elevation:浮动 panel 与侧边栏都比 page 浅一档。取 --wui-color-surface\n (#2c2c2e)作为「page 之上一档」的基准色,panel 按自身 alpha 叠在 page 上,\n 合成结果约 rgb(46 45 47),与 #2c2c2e 相差不超过 2/255。\n alpha 不取 0.92/0.9:颜色抬升后高 alpha 会让 panel 读成实心纸片,\n 取 0.74/0.8 才保留透感(模糊底内容可透出),层级方向不变。\n overlay 是唯一的例外:dialog/drawer/toast 背后的内容是被遮住的主体内容,\n 透过去会与 overlay 自身文字叠出干扰读的对比,因此单独抬到 0.92 换取可读性,\n 代价是失去透感——它本来也不属于「panel 透出 page」的层级语义。 */\n --wui-color-surface-sidebar: rgb(44 44 46 / 0.8);\n\n /* Segmented 的深色两档。凸变种(raised)复刻浅色那条「indicator 与 page 同色、track 沉一档」的\n 关系:浅色是 chip #fff(= page)浮在 #e5e5ea 上,深色 page(#242628)本来就是阶梯最暗的一档,\n 所以要让 chip 取到 page 色,只能把 track 再往下开一档到 #17191a(比 page 暗 13~14/255,与该主题\n 往上走的档差同量级:page→surface +6~+8、surface→control +14、control→track +10)。凸起方向仍由\n 「chip 比 track 亮」读出,WCAG 亮度比 1.16:1,与浅色的 1.26:1 同量级,不会盖过柔投影。\n 凹变种(inset)不参与:它的语义是「按下去的灰面」,track 取 surface(#2c2c2e)、indicator 取\n control(#3a3a3c,与浅色那颗同档),与 page 同色反而读不出选中。 */\n --wui-color-surface-segmented: #3a3a3c;\n --wui-color-surface-segmented-track: #17191a;\n --wui-color-surface-selected: #242628;\n --wui-color-text: #e9eaea;\n --wui-color-text-secondary: #a1a1a6;\n --wui-color-text-tertiary: color-mix(in srgb, var(--wui-color-text) 42%, transparent);\n --wui-color-text-disabled: color-mix(in srgb, var(--wui-color-text) 38%, transparent);\n --wui-color-state-layer-hover: color-mix(in srgb, var(--wui-color-text) 6%, transparent);\n --wui-color-state-layer-active: color-mix(in srgb, var(--wui-color-text) 15%, transparent);\n --wui-color-border: rgb(255 255 255 / 0.14);\n --wui-color-glass-highlight: rgb(255 255 255 / 0.1);\n --wui-color-glass-ring: rgb(255 255 255 / 0.05);\n --wui-color-glass-ring-sheen: rgb(255 255 255 / 0.2);\n --wui-color-glass-ring-shade: rgb(0 0 0 / 0.5);\n --wui-glass-brightness: 1.02;\n --wui-color-accent: #0a84ff;\n --wui-color-on-accent: #000;\n --wui-color-on-danger: #000;\n --wui-color-on-control: #f2f2f7;\n --wui-color-success: #30d158;\n --wui-color-warning: #ff9f0a;\n --wui-color-danger: #ff453a;\n --wui-color-info: #64d2ff;\n --wui-color-backdrop: rgb(0 0 0 / 0.48);\n --wui-shadow-overlay: 0 18px 48px rgb(0 0 0 / 0.48);\n --wui-shadow-panel: 0 4px 16px rgb(0 0 0 / 0.32);\n --wui-shadow-glass: 0 8px 24px rgb(0 0 0 / 0.08);\n --wui-color-focus-ring: color-mix(in srgb, var(--wui-color-accent, #0a84ff) 62%, var(--wui-color-text) 38%);\n --wui-scrollbar-handle: rgb(255 255 255 / 0.5);\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :host([appearance='system']) {\n --wui-color-page: #242628;\n --wui-color-surface: #2c2c2e;\n --wui-color-surface-raised: #2c2c2e;\n --wui-color-surface-control: #3a3a3c;\n --wui-color-surface-track: #444446;\n --wui-color-surface-menu: rgb(49 48 50 / 0.74);\n --wui-color-surface-glass: rgb(44 44 46 / 0.42);\n --wui-color-surface-glass-hover: color-mix(in srgb, var(--wui-color-text) 6%, var(--wui-color-surface-glass));\n --wui-color-surface-glass-active: color-mix(in srgb, var(--wui-color-text) 15%, var(--wui-color-surface-glass));\n --wui-color-surface-overlay: rgb(32 34 34 / 0.92);\n --wui-color-surface-sidebar: rgb(44 44 46 / 0.8);\n --wui-color-surface-segmented: #3a3a3c;\n --wui-color-surface-segmented-track: #17191a;\n --wui-color-surface-selected: #242628;\n --wui-color-text: #e9eaea;\n --wui-color-text-secondary: #a1a1a6;\n --wui-color-text-tertiary: color-mix(in srgb, var(--wui-color-text) 42%, transparent);\n --wui-color-text-disabled: color-mix(in srgb, var(--wui-color-text) 38%, transparent);\n --wui-color-state-layer-hover: color-mix(in srgb, var(--wui-color-text) 6%, transparent);\n --wui-color-state-layer-active: color-mix(in srgb, var(--wui-color-text) 15%, transparent);\n --wui-color-border: rgb(255 255 255 / 0.14);\n --wui-color-glass-highlight: rgb(255 255 255 / 0.1);\n --wui-color-glass-ring: rgb(255 255 255 / 0.05);\n --wui-color-glass-ring-sheen: rgb(255 255 255 / 0.2);\n --wui-color-glass-ring-shade: rgb(0 0 0 / 0.5);\n --wui-glass-brightness: 1.02;\n --wui-color-accent: #0a84ff;\n --wui-color-on-accent: #000;\n --wui-color-on-danger: #000;\n --wui-color-on-control: #f2f2f7;\n --wui-color-success: #30d158;\n --wui-color-warning: #ff9f0a;\n --wui-color-danger: #ff453a;\n --wui-color-info: #64d2ff;\n --wui-color-backdrop: rgb(0 0 0 / 0.48);\n --wui-shadow-overlay: 0 18px 48px rgb(0 0 0 / 0.48);\n --wui-shadow-panel: 0 4px 16px rgb(0 0 0 / 0.32);\n --wui-shadow-glass: 0 8px 24px rgb(0 0 0 / 0.08);\n --wui-color-focus-ring: color-mix(in srgb, var(--wui-color-accent, #0a84ff) 62%, var(--wui-color-text) 38%);\n --wui-scrollbar-handle: rgb(255 255 255 / 0.5);\n color-scheme: dark;\n }\n}\n"],"mappings":";AAAA,IAAA,gBAAA"}
@@ -1,4 +1,5 @@
1
1
  import { OverlayContainer } from "../../shared/overlay/portal.js";
2
+ import { OverlayTriggerMode } from "../../shared/overlay/trigger-props.js";
2
3
  import { LitElement } from "lit";
3
4
  import { Placement } from "@floating-ui/dom";
4
5
  export declare class WebUiTooltip extends LitElement {
@@ -6,6 +7,9 @@ export declare class WebUiTooltip extends LitElement {
6
7
  get placement(): Placement;
7
8
  set placement(v: string);
8
9
  private _placement;
10
+ get trigger(): string;
11
+ set trigger(v: string | readonly OverlayTriggerMode[]);
12
+ private _trigger;
9
13
  get showDelay(): number;
10
14
  set showDelay(v: number);
11
15
  private _showDelay;
@@ -41,6 +45,10 @@ export declare class WebUiTooltip extends LitElement {
41
45
  firstUpdated(): void;
42
46
  protected willUpdate(changed: Map<string, unknown>): void;
43
47
  protected updated(changed: Map<string, unknown>): void;
48
+ private _syncTriggerListeners;
49
+ private _clearTriggerListeners;
50
+ private _onTriggerClick;
51
+ private _onClickOutside;
44
52
  private _onPointerEnter;
45
53
  private _onPointerLeave;
46
54
  private _onFocusIn;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/tooltip/index.ts"],"mappings":";;;qBAqBa,qBAAqB;SAChB,sBAAM;MAGlB,aAAa;MAGb,UAAU;UAKN;MAGJ;MAGA,UAAU;UAKN;MAGJ;MAGA,UAAU;UAKN;EAEoC;MAGxC;MAGA,OAAO;UAKH;EAEoB;EAEgB;EACA;EACZ,mBAAmB;UAE3C;UACA;UACA;mBACS;UACT;UACA;mBACS;mBAOA;;;;;;mBAMA;mBAIA;MAgBb;EAIK;EASA;EAeA;YAQU,WAAW,SAAS;YAQpB,QAAQ,SAAS;UA4B5B;UASA;UAMA;UAUA;UAKA;UAOA;UAMA;UAIA;UAwBM;UAIN;UAIA;UAkBA;UAIA;UAUA;UAWA;UAwBA;UAKA;UAKA;UAIA;UAIA;EAUC,wBAAM;WAoBE;IACf,eAAe;MAAc;;;;QAIzB;YACI;IACR,kBAAkB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/tooltip/index.ts"],"mappings":";;;;qBAyBa,qBAAqB;SAChB,sBAAM;MAGlB,aAAa;MAGb,UAAU;UAKN;MAGJ;MAGA,QAAQ,qBAAqB;UAKzB;MAGJ;MAGA,UAAU;UAKN;MAGJ;MAGA,UAAU;UAKN;EAEoC;MAGxC;MAGA,OAAO;UAKH;EAEoB;EAEgB;EACA;EACZ,mBAAmB;UAE3C;UACA;UACA;mBACS;UACT;UACA;mBACS;mBAOA;;;;;;mBAMA;mBAIA;MAgBb;EAIK;EAMA;EAYA;YAQU,WAAW,SAAS;YAQpB,QAAQ,SAAS;UAkC5B;UAYA;UAQA;UASA;UAWA;UASA;UAMA;UAUA;UAKA;UAOA;UAMA;UAIA;UAwBM;UAIN;UAIA;UAkBA;UAIA;UAUA;UAWA;UAwBA;UAKA;UAKA;UAIA;UAIA;EAUC,wBAAM;WAuBE;IACf,eAAe;MAAc;;;;QAIzB;YACI;IACR,kBAAkB"}
@@ -5,20 +5,24 @@ import overlay_motion_default from "../../assets/overlay-motion.js";
5
5
  import { dispatchOpenChangeEvent } from "../../shared/open-state/index.js";
6
6
  import { defineAnchoredPanel } from "../../shared/overlay/anchored-panel.js";
7
7
  import { defineOpenOverlay } from "../../shared/overlay/open-overlay.js";
8
+ import { FLOATING_PLACEMENTS } from "../../shared/overlay/placement-props.js";
8
9
  import { defineOverlayPortal } from "../../shared/overlay/portal.js";
9
10
  import { UserChangeController } from "../../shared/events/user-change.js";
10
11
  import { findFocusTarget } from "../../shared/focus/tabbable.js";
11
- import { FLOATING_PLACEMENTS } from "../../shared/overlay/placement-props.js";
12
+ import { hasTriggerMode, normalizeTriggerSet } from "../../shared/overlay/trigger-props.js";
12
13
  import style_default from "./style.js";
13
14
  import { LitElement, html, nothing, unsafeCSS } from "lit";
14
15
  import { customElement, property } from "lit/decorators.js";
15
16
  // src/components/tooltip/index.ts
17
+ /** 指针悬停与键盘聚焦是 tooltip 的常驻手势;`manual` 表示只由 `open` 控制。 */
18
+ const DEFAULT_TRIGGERS = ["hover", "focus"];
16
19
  let visibleTooltipCount = 0;
17
20
  let tooltipIdCounter = 0;
18
21
  let WebUiTooltip = class WebUiTooltip extends LitElement {
19
22
  constructor(..._args) {
20
23
  super(..._args);
21
24
  this._placement = "top";
25
+ this._trigger = DEFAULT_TRIGGERS.join(" ");
22
26
  this._showDelay = 200;
23
27
  this._hideDelay = 100;
24
28
  this.disabled = false;
@@ -48,6 +52,19 @@ let WebUiTooltip = class WebUiTooltip extends LitElement {
48
52
  openOverlay: this._overlay,
49
53
  arbitration: "none"
50
54
  });
55
+ this._onTriggerClick = (event) => {
56
+ if (this.disabled || !hasTriggerMode(this.trigger, "click")) return;
57
+ clearTimeout(this._showTimer);
58
+ clearTimeout(this._hideTimer);
59
+ if (this.open) this._hide();
60
+ else this._show(event.detail === 0);
61
+ };
62
+ this._onClickOutside = (event) => {
63
+ if (!this.open) return;
64
+ if (event.composedPath().includes(this)) return;
65
+ if (this._panel.getHandle()?.containsEvent(event)) return;
66
+ this._hide();
67
+ };
51
68
  this._onPointerEnter = (e) => {
52
69
  if (e.pointerType === "touch") return;
53
70
  if (this.disabled) return;
@@ -93,6 +110,14 @@ let WebUiTooltip = class WebUiTooltip extends LitElement {
93
110
  this._placement = normalizeLiteral(v, FLOATING_PLACEMENTS, "top");
94
111
  this.requestUpdate("placement", old);
95
112
  }
113
+ get trigger() {
114
+ return this._trigger;
115
+ }
116
+ set trigger(v) {
117
+ const old = this._trigger;
118
+ this._trigger = normalizeTriggerSet(v, DEFAULT_TRIGGERS);
119
+ this.requestUpdate("trigger", old);
120
+ }
96
121
  get showDelay() {
97
122
  return this._showDelay;
98
123
  }
@@ -123,17 +148,11 @@ let WebUiTooltip = class WebUiTooltip extends LitElement {
123
148
  connectedCallback() {
124
149
  super.connectedCallback();
125
150
  this._overlay.resume();
126
- this.addEventListener("pointerenter", this._onPointerEnter);
127
- this.addEventListener("pointerleave", this._onPointerLeave);
128
- this.addEventListener("focusin", this._onFocusIn);
129
- this.addEventListener("focusout", this._onFocusOut);
151
+ this._syncTriggerListeners();
130
152
  }
131
153
  disconnectedCallback() {
132
154
  super.disconnectedCallback();
133
- this.removeEventListener("pointerenter", this._onPointerEnter);
134
- this.removeEventListener("pointerleave", this._onPointerLeave);
135
- this.removeEventListener("focusin", this._onFocusIn);
136
- this.removeEventListener("focusout", this._onFocusOut);
155
+ this._clearTriggerListeners();
137
156
  clearTimeout(this._showTimer);
138
157
  clearTimeout(this._hideTimer);
139
158
  this._overlay.suspend();
@@ -156,6 +175,12 @@ let WebUiTooltip = class WebUiTooltip extends LitElement {
156
175
  }
157
176
  }
158
177
  updated(changed) {
178
+ if (changed.has("trigger")) {
179
+ this._clearTriggerListeners();
180
+ clearTimeout(this._showTimer);
181
+ clearTimeout(this._hideTimer);
182
+ this._syncTriggerListeners();
183
+ }
159
184
  if (changed.has("portal") || changed.has("overlayContainer")) {
160
185
  this._overlay.invalidate();
161
186
  this._overlay.scheduleFrame(() => this._reconfigureOverlay());
@@ -179,6 +204,24 @@ let WebUiTooltip = class WebUiTooltip extends LitElement {
179
204
  if (this.open) this._syncDescription();
180
205
  }
181
206
  }
207
+ _syncTriggerListeners() {
208
+ if (hasTriggerMode(this.trigger, "hover")) {
209
+ this.addEventListener("pointerenter", this._onPointerEnter);
210
+ this.addEventListener("pointerleave", this._onPointerLeave);
211
+ }
212
+ if (hasTriggerMode(this.trigger, "focus")) {
213
+ this.addEventListener("focusin", this._onFocusIn);
214
+ this.addEventListener("focusout", this._onFocusOut);
215
+ }
216
+ if (hasTriggerMode(this.trigger, "click")) document.addEventListener("click", this._onClickOutside);
217
+ }
218
+ _clearTriggerListeners() {
219
+ this.removeEventListener("pointerenter", this._onPointerEnter);
220
+ this.removeEventListener("pointerleave", this._onPointerLeave);
221
+ this.removeEventListener("focusin", this._onFocusIn);
222
+ this.removeEventListener("focusout", this._onFocusOut);
223
+ document.removeEventListener("click", this._onClickOutside);
224
+ }
182
225
  _show(isInstant = false) {
183
226
  if (this.open) return;
184
227
  this._shouldOpenInstantly = isInstant;
@@ -294,7 +337,10 @@ let WebUiTooltip = class WebUiTooltip extends LitElement {
294
337
  render() {
295
338
  return html`
296
339
  <div class="tooltip-anchor">
297
- <div class="tooltip-trigger"><slot @slotchange=${this._onTriggerSlotChange}></slot></div>
340
+ <!-- 点击只挂在 trigger 包装层:panel 里的内容被点击不该把提示切走。 -->
341
+ <div class="tooltip-trigger" @click=${this._onTriggerClick}>
342
+ <slot @slotchange=${this._onTriggerSlotChange}></slot>
343
+ </div>
298
344
  <div
299
345
  class="tooltip-panel wui-floating-panel wui-glass"
300
346
  hidden
@@ -311,6 +357,10 @@ __decorate([property({
311
357
  type: String,
312
358
  reflect: true
313
359
  })], WebUiTooltip.prototype, "placement", null);
360
+ __decorate([property({
361
+ type: String,
362
+ reflect: true
363
+ })], WebUiTooltip.prototype, "trigger", null);
314
364
  __decorate([property({
315
365
  type: Number,
316
366
  attribute: "show-delay"
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["glass","overlayMotion","style"],"sources":["../../../src/components/tooltip/index.ts"],"sourcesContent":["import type { Placement } from '@floating-ui/dom'\nimport { html, LitElement, nothing, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport overlayMotion from '@/assets/overlay-motion.css?inline'\nimport glass from '@/classes/glass.css?inline'\nimport { UserChangeController } from '@/shared/events/user-change'\nimport { findFocusTarget } from '@/shared/focus/tabbable'\nimport { normalizeLiteral, normalizeNumber } from '@/shared/normalize'\nimport { dispatchOpenChangeEvent } from '@/shared/open-state'\nimport { defineAnchoredPanel } from '@/shared/overlay/anchored-panel'\nimport { defineOpenOverlay } from '@/shared/overlay/open-overlay'\nimport { FLOATING_PLACEMENTS } from '@/shared/overlay/placement-props'\nimport { defineOverlayPortal, type OverlayContainer, type OverlayPortal } from '@/shared/overlay/portal'\n\nimport style from './style.css?inline'\n\nlet visibleTooltipCount = 0\nlet tooltipIdCounter = 0\n\n@customElement('web-ui-tooltip')\nexport class WebUiTooltip extends LitElement {\n static override styles = [unsafeCSS(glass), unsafeCSS(overlayMotion), unsafeCSS(style)]\n\n @property({ type: String, reflect: true })\n get placement(): Placement {\n return this._placement\n }\n set placement(v: string) {\n const old = this._placement\n this._placement = normalizeLiteral(v, FLOATING_PLACEMENTS, 'top')\n this.requestUpdate('placement', old)\n }\n private _placement: Placement = 'top'\n\n @property({ type: Number, attribute: 'show-delay' })\n get showDelay(): number {\n return this._showDelay\n }\n set showDelay(v: number) {\n const old = this._showDelay\n this._showDelay = normalizeNumber(v, 0, 5000, 200)\n this.requestUpdate('showDelay', old)\n }\n private _showDelay = 200\n\n @property({ type: Number, attribute: 'hide-delay' })\n get hideDelay(): number {\n return this._hideDelay\n }\n set hideDelay(v: number) {\n const old = this._hideDelay\n this._hideDelay = normalizeNumber(v, 0, 5000, 100)\n this.requestUpdate('hideDelay', old)\n }\n private _hideDelay = 100\n\n @property({ type: Boolean, reflect: true }) disabled = false\n\n @property({ type: Number })\n get offset(): number {\n return this._offset\n }\n set offset(v: number) {\n const old = this._offset\n this._offset = normalizeNumber(v, 0, 100, 6)\n this.requestUpdate('offset', old)\n }\n private _offset = 6\n\n @property({ type: String }) content = ''\n\n @property({ type: Boolean, reflect: true }) open = false\n @property({ type: Boolean, reflect: true }) portal = false\n @property({ attribute: false }) overlayContainer?: OverlayContainer\n\n private _showTimer?: ReturnType<typeof setTimeout>\n private _hideTimer?: ReturnType<typeof setTimeout>\n private _isCountedVisible = false\n private readonly _userOpenChange = new UserChangeController()\n private _shouldOpenInstantly = true\n private _portal?: OverlayPortal\n private readonly _panelId = `wui-tooltip-panel-${++tooltipIdCounter}`\n /*\n * 面板在 shadow DOM 里,而 trigger 的可聚焦元素可能在更内层的 shadow root:\n * `aria-describedby` 的 IDREF 无法跨 shadow 边界解析,面板 id 因此只能供消费者自行引用,\n * 读屏可达性由 `aria-description` 承担(打开时写入、关闭时按原值还原)。\n * 保存原值是为了不吞掉消费者自己写在 trigger 上的描述。\n */\n private readonly _descriptionTargets = new Map<HTMLElement, string | null>()\n /**\n * 实例作用域的帧事务入口。`requestClose` 是关闭入口的唯一接线:panel 的\n * `arbitration: 'none'` 让 tooltip 在组合树里但永不成候选,因此这条**现在不会被\n * 模块调用**。保留它是不想把「怎么关」藏起来,也让仲裁策略变化时依然成立。\n */\n private readonly _overlay = defineOpenOverlay().make({\n requestClose: () => this._hide(),\n isConnected: () => this.isConnected\n })\n private readonly _panel = defineAnchoredPanel().make({\n getAnchor: () => this.shadowRoot?.querySelector<HTMLElement>('.tooltip-trigger') ?? null,\n getLocalPanel: () => this.shadowRoot?.querySelector<HTMLElement>('.tooltip-panel') ?? null,\n getPositioning: () => ({\n placement: this.placement,\n offset: this.offset,\n strategy: this.portal ? 'fixed' : 'absolute'\n }),\n isPortal: () => this.portal,\n createPortal: () => this._createPortal(),\n openOverlay: this._overlay,\n // tooltip 在逻辑组合树里(panel 迁移后仍要判对「谁在谁里面」),但从不作为 Escape\n // 候选:按键穿过它落到下层 overlay。\n arbitration: 'none'\n })\n\n get isOpen(): boolean {\n return this.open\n }\n\n override connectedCallback() {\n super.connectedCallback()\n this._overlay.resume()\n this.addEventListener('pointerenter', this._onPointerEnter)\n this.addEventListener('pointerleave', this._onPointerLeave)\n this.addEventListener('focusin', this._onFocusIn)\n this.addEventListener('focusout', this._onFocusOut)\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListener('pointerenter', this._onPointerEnter)\n this.removeEventListener('pointerleave', this._onPointerLeave)\n this.removeEventListener('focusin', this._onFocusIn)\n this.removeEventListener('focusout', this._onFocusOut)\n clearTimeout(this._showTimer)\n clearTimeout(this._hideTimer)\n // 停止帧调度;撤销登记由 _panel.dispose() 完成(handle 归它持有)。\n this._overlay.suspend()\n this._syncVisibleTooltipCount(false)\n this._clearDescription()\n this._panel.dispose()\n }\n\n override firstUpdated() {\n if (this.open) {\n this._openOverlay(this._shouldOpenInstantly)\n this._shouldOpenInstantly = true\n this._syncDescription()\n }\n }\n\n protected override willUpdate(changed: Map<string, unknown>) {\n if (this.disabled && (changed.has('disabled') || changed.has('open'))) {\n clearTimeout(this._showTimer)\n clearTimeout(this._hideTimer)\n this.open = false\n }\n }\n\n protected override updated(changed: Map<string, unknown>) {\n if (changed.has('portal') || changed.has('overlayContainer')) {\n // 同帧 open + reconfigure 可能重复建事务;invalidate 保证 reconfigure 是当前唯一帧回调。\n this._overlay.invalidate()\n this._overlay.scheduleFrame(() => this._reconfigureOverlay())\n } else if (changed.has('placement') || changed.has('offset'))\n requestAnimationFrame(() => this._panel.updatePosition())\n\n if (changed.has('open')) {\n this._syncVisibleTooltipCount(this.open)\n if (this.open) {\n clearTimeout(this._hideTimer)\n this._openOverlay(this._shouldOpenInstantly)\n this._shouldOpenInstantly = true\n this._syncDescription()\n } else {\n this._overlay.invalidate()\n this._clearDescription()\n void this._closeOverlay()\n }\n if (this._userOpenChange.consume()) this._dispatchChange(this.open)\n }\n if (changed.has('content')) {\n this._syncPortalContent()\n if (this.open) this._syncDescription()\n }\n }\n\n private _onPointerEnter = (e: PointerEvent) => {\n if (e.pointerType === 'touch') return\n if (this.disabled) return\n clearTimeout(this._hideTimer)\n // 已有 tooltip 在场时(指针滑到相邻目标):既不等延迟,也不播入场动画。\n const isRepeat = visibleTooltipCount > 0\n this._showTimer = setTimeout(() => this._show(isRepeat), isRepeat ? 0 : this.showDelay)\n }\n\n private _onPointerLeave = (e: PointerEvent) => {\n if (e.pointerType === 'touch') return\n clearTimeout(this._showTimer)\n this._hideTimer = setTimeout(() => this._hide(), this.hideDelay)\n }\n\n private _onFocusIn = (event: FocusEvent) => {\n if (this.disabled) return\n\n const focusedElement = event.composedPath()[0] ?? event.target\n if (!(focusedElement instanceof Element) || !focusedElement.matches(':focus-visible')) return\n\n clearTimeout(this._hideTimer)\n this._show(true)\n }\n\n private _onFocusOut = () => {\n clearTimeout(this._showTimer)\n this._hide()\n }\n\n private _show(isInstant = false) {\n if (this.open) return\n this._shouldOpenInstantly = isInstant\n this._userOpenChange.mark()\n this.open = true\n }\n\n private _hide() {\n if (!this.open) return\n this._userOpenChange.mark()\n this.open = false\n }\n\n private _openOverlay(isInstant = false) {\n this._panel.open(isInstant)\n }\n\n private _createPortal(): OverlayPortal {\n const portal = defineOverlayPortal().make({\n container: this.overlayContainer,\n target: this,\n style: `${glass}\\n${overlayMotion}\\n${style}`,\n className: 'tooltip-panel portal wui-glass wui-floating-panel',\n // 已迁移节点被框架删除后的解除追踪是 portal 内建默认行为,这里无需 onContentChange\n // 打开期实时渲染:新增的 slot=content 元素实时迁入 panel(注释锚点无法携带\n // slot 属性,天然留在宿主作为框架 patch 的插入基准)。\n migrateAddedNodes: addedNodes =>\n addedNodes.filter(node => node instanceof Element && node.getAttribute('slot') === 'content')\n })\n this._portal = portal\n if (this.content) {\n const text = document.createElement('span')\n text.className = 'tooltip-text'\n text.textContent = this.content\n portal.panel.append(text)\n } else portal.moveContent(Array.from(this.querySelectorAll('[slot=\"content\"]')))\n portal.panel.setAttribute('role', 'tooltip')\n portal.panel.id = this._panelId\n return portal\n }\n\n private async _closeOverlay() {\n await this._panel.close(() => this.open)\n }\n\n private _reconfigureOverlay() {\n this._panel.reconfigure(this.open)\n }\n\n private _syncPortalContent() {\n if (!this.portal || !this.open) return\n const localPanel = this._panel.getPanel()\n if (!localPanel) return\n const panel = this._portal?.panel ?? localPanel\n const text = localPanel.querySelector<HTMLElement>('.tooltip-text')\n if (text) {\n text.textContent = this.content\n return\n }\n if (!this.content) return\n panel.replaceChildren()\n const nextText = document.createElement('span')\n nextText.className = 'tooltip-text'\n nextText.textContent = this.content\n panel.append(nextText)\n }\n\n private _dispatchChange(open: boolean) {\n dispatchOpenChangeEvent(this, open)\n }\n\n private _getDescriptionTargets(): HTMLElement[] {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('.tooltip-trigger > slot')\n const targets: HTMLElement[] = []\n for (const element of slot?.assignedElements({ flatten: true }) ?? []) {\n if (!(element instanceof HTMLElement)) continue\n targets.push(findFocusTarget(element) ?? element)\n }\n return targets\n }\n\n private _readDescription(): string {\n if (this.content) return this.content.trim()\n const portalText = this.portal ? (this._portal?.panel.textContent ?? '').trim() : ''\n if (portalText) return portalText\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('.tooltip-panel > slot[name=\"content\"]')\n return (slot?.assignedNodes({ flatten: true }) ?? [])\n .map(node => node.textContent ?? '')\n .join('')\n .trim()\n }\n\n private _syncDescription() {\n if (!this.open) {\n this._clearDescription()\n return\n }\n const description = this._readDescription()\n if (!description) {\n this._clearDescription()\n return\n }\n const targets = new Set(this._getDescriptionTargets())\n for (const [target, previous] of this._descriptionTargets) {\n if (targets.has(target)) continue\n this._restoreDescription(target, previous)\n this._descriptionTargets.delete(target)\n }\n for (const target of targets) {\n if (!this._descriptionTargets.has(target)) {\n this._descriptionTargets.set(target, target.getAttribute('aria-description'))\n }\n target.setAttribute('aria-description', description)\n }\n }\n\n private _clearDescription() {\n for (const [target, previous] of this._descriptionTargets) this._restoreDescription(target, previous)\n this._descriptionTargets.clear()\n }\n\n private _restoreDescription(target: HTMLElement, previous: string | null) {\n if (previous === null) target.removeAttribute('aria-description')\n else target.setAttribute('aria-description', previous)\n }\n\n private _onTriggerSlotChange = () => {\n if (this.open) this._syncDescription()\n }\n\n private _onContentSlotChange = () => {\n if (this.open) this._syncDescription()\n }\n\n private _syncVisibleTooltipCount(isVisible: boolean) {\n if (isVisible && !this._isCountedVisible) {\n visibleTooltipCount += 1\n this._isCountedVisible = true\n } else if (!isVisible && this._isCountedVisible) {\n visibleTooltipCount = Math.max(0, visibleTooltipCount - 1)\n this._isCountedVisible = false\n }\n }\n\n override render() {\n return html`\n <div class=\"tooltip-anchor\">\n <div class=\"tooltip-trigger\"><slot @slotchange=${this._onTriggerSlotChange}></slot></div>\n <div\n class=\"tooltip-panel wui-floating-panel wui-glass\"\n hidden\n role=\"tooltip\"\n id=${this.portal ? nothing : this._panelId}\n >\n ${\n this.content\n ? html`<span class=\"tooltip-text\">${this.content}</span>`\n : html`<slot name=\"content\" @slotchange=${this._onContentSlotChange}></slot>`\n }\n </div>\n </div>\n `\n }\n\n declare readonly $events: {\n 'open-change': CustomEvent<{ open: boolean }>\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-tooltip': WebUiTooltip\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AAGhB,IAAM,eAAN,MAAM,qBAAqB,WAAW;;;EAYX,KAAA,aAAA;EAWX,KAAA,aAAA;EAWA,KAAA,aAAA;EAEkC,KAAA,WAAA;EAWrC,KAAA,UAAA;EAEoB,KAAA,UAAA;EAEa,KAAA,OAAA;EACE,KAAA,SAAA;EAKzB,KAAA,oBAAA;EACO,KAAA,kBAAA,IAAI,qBAAqB;EAC7B,KAAA,uBAAA;EAEH,KAAA,WAAA,qBAAqB,EAAE;EAOZ,KAAA,sCAAA,IAAI,IAAgC;EAM/C,KAAA,WAAA,kBAAkB,CAAC,CAAC,KAAK;GACnD,oBAAoB,KAAK,MAAM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AAA,WAAA,KAAA,CAAA;AAEzB,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,aAAA,WAAA,QAAA,KAAA,CAAA;AACzC,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,aAAA,WAAA,UAAA,KAAA,CAAA;AACzC,WAAA,CAAA,SAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAAA,aAAA,WAAA,oBAAA,KAAA,CAAA;AAtD/B,eAAA,WAAA,CAAA,cAAc,gBAAgB,CAAA,GAAA,YAAA"}
1
+ {"version":3,"file":"index.js","names":["glass","overlayMotion","style"],"sources":["../../../src/components/tooltip/index.ts"],"sourcesContent":["import type { Placement } from '@floating-ui/dom'\nimport { html, LitElement, nothing, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport overlayMotion from '@/assets/overlay-motion.css?inline'\nimport glass from '@/classes/glass.css?inline'\nimport { UserChangeController } from '@/shared/events/user-change'\nimport { findFocusTarget } from '@/shared/focus/tabbable'\nimport { normalizeLiteral, normalizeNumber } from '@/shared/normalize'\nimport { dispatchOpenChangeEvent } from '@/shared/open-state'\nimport { defineAnchoredPanel } from '@/shared/overlay/anchored-panel'\nimport { defineOpenOverlay } from '@/shared/overlay/open-overlay'\nimport { FLOATING_PLACEMENTS } from '@/shared/overlay/placement-props'\nimport { defineOverlayPortal, type OverlayContainer, type OverlayPortal } from '@/shared/overlay/portal'\nimport { hasTriggerMode, normalizeTriggerSet, type OverlayTriggerMode } from '@/shared/overlay/trigger-props'\n\nimport style from './style.css?inline'\n\n/** 指针悬停与键盘聚焦是 tooltip 的常驻手势;`manual` 表示只由 `open` 控制。 */\nconst DEFAULT_TRIGGERS = ['hover', 'focus'] as const\n\nlet visibleTooltipCount = 0\nlet tooltipIdCounter = 0\n\n@customElement('web-ui-tooltip')\nexport class WebUiTooltip extends LitElement {\n static override styles = [unsafeCSS(glass), unsafeCSS(overlayMotion), unsafeCSS(style)]\n\n @property({ type: String, reflect: true })\n get placement(): Placement {\n return this._placement\n }\n set placement(v: string) {\n const old = this._placement\n this._placement = normalizeLiteral(v, FLOATING_PLACEMENTS, 'top')\n this.requestUpdate('placement', old)\n }\n private _placement: Placement = 'top'\n\n @property({ type: String, reflect: true })\n get trigger(): string {\n return this._trigger\n }\n set trigger(v: string | readonly OverlayTriggerMode[]) {\n const old = this._trigger\n this._trigger = normalizeTriggerSet(v, DEFAULT_TRIGGERS)\n this.requestUpdate('trigger', old)\n }\n private _trigger: string = DEFAULT_TRIGGERS.join(' ')\n\n @property({ type: Number, attribute: 'show-delay' })\n get showDelay(): number {\n return this._showDelay\n }\n set showDelay(v: number) {\n const old = this._showDelay\n this._showDelay = normalizeNumber(v, 0, 5000, 200)\n this.requestUpdate('showDelay', old)\n }\n private _showDelay = 200\n\n @property({ type: Number, attribute: 'hide-delay' })\n get hideDelay(): number {\n return this._hideDelay\n }\n set hideDelay(v: number) {\n const old = this._hideDelay\n this._hideDelay = normalizeNumber(v, 0, 5000, 100)\n this.requestUpdate('hideDelay', old)\n }\n private _hideDelay = 100\n\n @property({ type: Boolean, reflect: true }) disabled = false\n\n @property({ type: Number })\n get offset(): number {\n return this._offset\n }\n set offset(v: number) {\n const old = this._offset\n this._offset = normalizeNumber(v, 0, 100, 6)\n this.requestUpdate('offset', old)\n }\n private _offset = 6\n\n @property({ type: String }) content = ''\n\n @property({ type: Boolean, reflect: true }) open = false\n @property({ type: Boolean, reflect: true }) portal = false\n @property({ attribute: false }) overlayContainer?: OverlayContainer\n\n private _showTimer?: ReturnType<typeof setTimeout>\n private _hideTimer?: ReturnType<typeof setTimeout>\n private _isCountedVisible = false\n private readonly _userOpenChange = new UserChangeController()\n private _shouldOpenInstantly = true\n private _portal?: OverlayPortal\n private readonly _panelId = `wui-tooltip-panel-${++tooltipIdCounter}`\n /*\n * 面板在 shadow DOM 里,而 trigger 的可聚焦元素可能在更内层的 shadow root:\n * `aria-describedby` 的 IDREF 无法跨 shadow 边界解析,面板 id 因此只能供消费者自行引用,\n * 读屏可达性由 `aria-description` 承担(打开时写入、关闭时按原值还原)。\n * 保存原值是为了不吞掉消费者自己写在 trigger 上的描述。\n */\n private readonly _descriptionTargets = new Map<HTMLElement, string | null>()\n /**\n * 实例作用域的帧事务入口。`requestClose` 是关闭入口的唯一接线:panel 的\n * `arbitration: 'none'` 让 tooltip 在组合树里但永不成候选,因此这条**现在不会被\n * 模块调用**。保留它是不想把「怎么关」藏起来,也让仲裁策略变化时依然成立。\n */\n private readonly _overlay = defineOpenOverlay().make({\n requestClose: () => this._hide(),\n isConnected: () => this.isConnected\n })\n private readonly _panel = defineAnchoredPanel().make({\n getAnchor: () => this.shadowRoot?.querySelector<HTMLElement>('.tooltip-trigger') ?? null,\n getLocalPanel: () => this.shadowRoot?.querySelector<HTMLElement>('.tooltip-panel') ?? null,\n getPositioning: () => ({\n placement: this.placement,\n offset: this.offset,\n strategy: this.portal ? 'fixed' : 'absolute'\n }),\n isPortal: () => this.portal,\n createPortal: () => this._createPortal(),\n openOverlay: this._overlay,\n // tooltip 在逻辑组合树里(panel 迁移后仍要判对「谁在谁里面」),但从不作为 Escape\n // 候选:按键穿过它落到下层 overlay。\n arbitration: 'none'\n })\n\n get isOpen(): boolean {\n return this.open\n }\n\n override connectedCallback() {\n super.connectedCallback()\n this._overlay.resume()\n this._syncTriggerListeners()\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback()\n this._clearTriggerListeners()\n clearTimeout(this._showTimer)\n clearTimeout(this._hideTimer)\n // 停止帧调度;撤销登记由 _panel.dispose() 完成(handle 归它持有)。\n this._overlay.suspend()\n this._syncVisibleTooltipCount(false)\n this._clearDescription()\n this._panel.dispose()\n }\n\n override firstUpdated() {\n if (this.open) {\n this._openOverlay(this._shouldOpenInstantly)\n this._shouldOpenInstantly = true\n this._syncDescription()\n }\n }\n\n protected override willUpdate(changed: Map<string, unknown>) {\n if (this.disabled && (changed.has('disabled') || changed.has('open'))) {\n clearTimeout(this._showTimer)\n clearTimeout(this._hideTimer)\n this.open = false\n }\n }\n\n protected override updated(changed: Map<string, unknown>) {\n if (changed.has('trigger')) {\n this._clearTriggerListeners()\n clearTimeout(this._showTimer)\n clearTimeout(this._hideTimer)\n this._syncTriggerListeners()\n }\n if (changed.has('portal') || changed.has('overlayContainer')) {\n // 同帧 open + reconfigure 可能重复建事务;invalidate 保证 reconfigure 是当前唯一帧回调。\n this._overlay.invalidate()\n this._overlay.scheduleFrame(() => this._reconfigureOverlay())\n } else if (changed.has('placement') || changed.has('offset'))\n requestAnimationFrame(() => this._panel.updatePosition())\n\n if (changed.has('open')) {\n this._syncVisibleTooltipCount(this.open)\n if (this.open) {\n clearTimeout(this._hideTimer)\n this._openOverlay(this._shouldOpenInstantly)\n this._shouldOpenInstantly = true\n this._syncDescription()\n } else {\n this._overlay.invalidate()\n this._clearDescription()\n void this._closeOverlay()\n }\n if (this._userOpenChange.consume()) this._dispatchChange(this.open)\n }\n if (changed.has('content')) {\n this._syncPortalContent()\n if (this.open) this._syncDescription()\n }\n }\n\n private _syncTriggerListeners() {\n if (hasTriggerMode(this.trigger, 'hover')) {\n this.addEventListener('pointerenter', this._onPointerEnter)\n this.addEventListener('pointerleave', this._onPointerLeave)\n }\n if (hasTriggerMode(this.trigger, 'focus')) {\n this.addEventListener('focusin', this._onFocusIn)\n this.addEventListener('focusout', this._onFocusOut)\n }\n if (hasTriggerMode(this.trigger, 'click')) document.addEventListener('click', this._onClickOutside)\n }\n\n private _clearTriggerListeners() {\n this.removeEventListener('pointerenter', this._onPointerEnter)\n this.removeEventListener('pointerleave', this._onPointerLeave)\n this.removeEventListener('focusin', this._onFocusIn)\n this.removeEventListener('focusout', this._onFocusOut)\n document.removeEventListener('click', this._onClickOutside)\n }\n\n private _onTriggerClick = (event: MouseEvent) => {\n if (this.disabled || !hasTriggerMode(this.trigger, 'click')) return\n clearTimeout(this._showTimer)\n clearTimeout(this._hideTimer)\n // 键盘激活(detail 0)与聚焦同等对待:不播入场动画。\n if (this.open) this._hide()\n else this._show(event.detail === 0)\n }\n\n private _onClickOutside = (event: MouseEvent) => {\n if (!this.open) return\n /*\n * 在监听器内部判定:composedPath() 在派发结束后会被清空。trigger 及其 light DOM\n * 内容都在宿主路径里;portal 后的 panel 挂在主题的 overlay 容器里,走 handle 判定。\n */\n if (event.composedPath().includes(this)) return\n if (this._panel.getHandle()?.containsEvent(event)) return\n this._hide()\n }\n\n private _onPointerEnter = (e: PointerEvent) => {\n if (e.pointerType === 'touch') return\n if (this.disabled) return\n clearTimeout(this._hideTimer)\n // 已有 tooltip 在场时(指针滑到相邻目标):既不等延迟,也不播入场动画。\n const isRepeat = visibleTooltipCount > 0\n this._showTimer = setTimeout(() => this._show(isRepeat), isRepeat ? 0 : this.showDelay)\n }\n\n private _onPointerLeave = (e: PointerEvent) => {\n if (e.pointerType === 'touch') return\n clearTimeout(this._showTimer)\n this._hideTimer = setTimeout(() => this._hide(), this.hideDelay)\n }\n\n private _onFocusIn = (event: FocusEvent) => {\n if (this.disabled) return\n\n const focusedElement = event.composedPath()[0] ?? event.target\n if (!(focusedElement instanceof Element) || !focusedElement.matches(':focus-visible')) return\n\n clearTimeout(this._hideTimer)\n this._show(true)\n }\n\n private _onFocusOut = () => {\n clearTimeout(this._showTimer)\n this._hide()\n }\n\n private _show(isInstant = false) {\n if (this.open) return\n this._shouldOpenInstantly = isInstant\n this._userOpenChange.mark()\n this.open = true\n }\n\n private _hide() {\n if (!this.open) return\n this._userOpenChange.mark()\n this.open = false\n }\n\n private _openOverlay(isInstant = false) {\n this._panel.open(isInstant)\n }\n\n private _createPortal(): OverlayPortal {\n const portal = defineOverlayPortal().make({\n container: this.overlayContainer,\n target: this,\n style: `${glass}\\n${overlayMotion}\\n${style}`,\n className: 'tooltip-panel portal wui-glass wui-floating-panel',\n // 已迁移节点被框架删除后的解除追踪是 portal 内建默认行为,这里无需 onContentChange\n // 打开期实时渲染:新增的 slot=content 元素实时迁入 panel(注释锚点无法携带\n // slot 属性,天然留在宿主作为框架 patch 的插入基准)。\n migrateAddedNodes: addedNodes =>\n addedNodes.filter(node => node instanceof Element && node.getAttribute('slot') === 'content')\n })\n this._portal = portal\n if (this.content) {\n const text = document.createElement('span')\n text.className = 'tooltip-text'\n text.textContent = this.content\n portal.panel.append(text)\n } else portal.moveContent(Array.from(this.querySelectorAll('[slot=\"content\"]')))\n portal.panel.setAttribute('role', 'tooltip')\n portal.panel.id = this._panelId\n return portal\n }\n\n private async _closeOverlay() {\n await this._panel.close(() => this.open)\n }\n\n private _reconfigureOverlay() {\n this._panel.reconfigure(this.open)\n }\n\n private _syncPortalContent() {\n if (!this.portal || !this.open) return\n const localPanel = this._panel.getPanel()\n if (!localPanel) return\n const panel = this._portal?.panel ?? localPanel\n const text = localPanel.querySelector<HTMLElement>('.tooltip-text')\n if (text) {\n text.textContent = this.content\n return\n }\n if (!this.content) return\n panel.replaceChildren()\n const nextText = document.createElement('span')\n nextText.className = 'tooltip-text'\n nextText.textContent = this.content\n panel.append(nextText)\n }\n\n private _dispatchChange(open: boolean) {\n dispatchOpenChangeEvent(this, open)\n }\n\n private _getDescriptionTargets(): HTMLElement[] {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('.tooltip-trigger > slot')\n const targets: HTMLElement[] = []\n for (const element of slot?.assignedElements({ flatten: true }) ?? []) {\n if (!(element instanceof HTMLElement)) continue\n targets.push(findFocusTarget(element) ?? element)\n }\n return targets\n }\n\n private _readDescription(): string {\n if (this.content) return this.content.trim()\n const portalText = this.portal ? (this._portal?.panel.textContent ?? '').trim() : ''\n if (portalText) return portalText\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('.tooltip-panel > slot[name=\"content\"]')\n return (slot?.assignedNodes({ flatten: true }) ?? [])\n .map(node => node.textContent ?? '')\n .join('')\n .trim()\n }\n\n private _syncDescription() {\n if (!this.open) {\n this._clearDescription()\n return\n }\n const description = this._readDescription()\n if (!description) {\n this._clearDescription()\n return\n }\n const targets = new Set(this._getDescriptionTargets())\n for (const [target, previous] of this._descriptionTargets) {\n if (targets.has(target)) continue\n this._restoreDescription(target, previous)\n this._descriptionTargets.delete(target)\n }\n for (const target of targets) {\n if (!this._descriptionTargets.has(target)) {\n this._descriptionTargets.set(target, target.getAttribute('aria-description'))\n }\n target.setAttribute('aria-description', description)\n }\n }\n\n private _clearDescription() {\n for (const [target, previous] of this._descriptionTargets) this._restoreDescription(target, previous)\n this._descriptionTargets.clear()\n }\n\n private _restoreDescription(target: HTMLElement, previous: string | null) {\n if (previous === null) target.removeAttribute('aria-description')\n else target.setAttribute('aria-description', previous)\n }\n\n private _onTriggerSlotChange = () => {\n if (this.open) this._syncDescription()\n }\n\n private _onContentSlotChange = () => {\n if (this.open) this._syncDescription()\n }\n\n private _syncVisibleTooltipCount(isVisible: boolean) {\n if (isVisible && !this._isCountedVisible) {\n visibleTooltipCount += 1\n this._isCountedVisible = true\n } else if (!isVisible && this._isCountedVisible) {\n visibleTooltipCount = Math.max(0, visibleTooltipCount - 1)\n this._isCountedVisible = false\n }\n }\n\n override render() {\n return html`\n <div class=\"tooltip-anchor\">\n <!-- 点击只挂在 trigger 包装层:panel 里的内容被点击不该把提示切走。 -->\n <div class=\"tooltip-trigger\" @click=${this._onTriggerClick}>\n <slot @slotchange=${this._onTriggerSlotChange}></slot>\n </div>\n <div\n class=\"tooltip-panel wui-floating-panel wui-glass\"\n hidden\n role=\"tooltip\"\n id=${this.portal ? nothing : this._panelId}\n >\n ${\n this.content\n ? html`<span class=\"tooltip-text\">${this.content}</span>`\n : html`<slot name=\"content\" @slotchange=${this._onContentSlotChange}></slot>`\n }\n </div>\n </div>\n `\n }\n\n declare readonly $events: {\n 'open-change': CustomEvent<{ open: boolean }>\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'web-ui-tooltip': WebUiTooltip\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,MAAM,mBAAmB,CAAC,SAAS,OAAO;AAE1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AAA,aAAA,WAAA,aAAA,IAAA;AAWlD,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAa,CAAC,CAAA,GAAA,aAAA,WAAA,aAAA,IAAA;AAWlD,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,aAAA,WAAA,YAAA,KAAA,CAAA;AAEzC,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,aAAA,WAAA,UAAA,IAAA;AAWzB,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,aAAA,WAAA,WAAA,KAAA,CAAA;AAEzB,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,aAAA,WAAA,QAAA,KAAA,CAAA;AACzC,WAAA,CAAA,SAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,aAAA,WAAA,UAAA,KAAA,CAAA;AACzC,WAAA,CAAA,SAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAAA,aAAA,WAAA,oBAAA,KAAA,CAAA;AAjE/B,eAAA,WAAA,CAAA,cAAc,gBAAgB,CAAA,GAAA,YAAA"}
@@ -1,5 +1,5 @@
1
1
  // src/components/tooltip/style.css?inline
2
- var style_default = "*,:before,:after{box-sizing:border-box}:host,.tooltip-trigger{display:inline-flex}.tooltip-anchor{display:inline-flex;position:relative}.tooltip-panel{--wui-internal-glass-shadow:var(--wui-shadow-panel,0 3px 9px #00000045);--wui-glass-corner-radius:var(--wui-radius-menu,18px);--wui-color-glass-ring:transparent;pointer-events:none;z-index:var(--wui-layer-inline-overlay,1);box-sizing:border-box;width:max-content;max-width:var(--wui-tooltip-max-width,240px);border-radius:var(--wui-radius-menu,18px);font-size:var(--wui-tooltip-font-size,13px);color:var(--wui-color-text,#1b1b1b);background-color:var(--wui-color-surface-menu,#fafafac2);padding:6px 10px;position:absolute;top:-9999px;left:-9999px}.tooltip-panel.portal{z-index:var(--wui-layer-menu,100);position:fixed}.tooltip-panel.hidden{display:none}.tooltip-text{overflow-wrap:break-word;white-space:normal;display:block}:host([portal]) .tooltip-panel{display:none}\n";
2
+ var style_default = "*,:before,:after{box-sizing:border-box}:host,.tooltip-trigger{display:inline-flex}.tooltip-anchor{display:inline-flex;position:relative}.tooltip-panel{--wui-internal-glass-shadow:var(--wui-shadow-panel,0 3px 9px #00000045);--wui-glass-corner-radius:var(--wui-radius-menu,18px);--wui-color-glass-ring:transparent;pointer-events:none;z-index:var(--wui-layer-inline-overlay,10);box-sizing:border-box;width:max-content;max-width:var(--wui-tooltip-max-width,240px);border-radius:var(--wui-radius-menu,18px);font-size:var(--wui-tooltip-font-size,13px);color:var(--wui-color-text,#1b1b1b);background-color:var(--wui-color-surface-menu,#fafafac2);padding:6px 10px;position:absolute;top:-9999px;left:-9999px}.tooltip-panel.portal{z-index:var(--wui-layer-menu,1000);position:fixed}.tooltip-panel.hidden{display:none}.tooltip-text{overflow-wrap:break-word;white-space:normal;display:block}:host([portal]) .tooltip-panel{display:none}\n";
3
3
  export { style_default as default };
4
4
 
5
5
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":[],"sources":["../../../src/components/tooltip/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-flex;\n}\n\n.tooltip-trigger {\n display: inline-flex;\n}\n\n.tooltip-anchor {\n position: relative;\n display: inline-flex;\n}\n\n.tooltip-panel {\n --wui-internal-glass-shadow: var(--wui-shadow-panel, 0 3px 9px rgb(0 0 0 / 0.27));\n --wui-glass-corner-radius: var(--wui-radius-menu, 18px);\n\n /* 环底色转 transparent,宽 panel 的长边中段不留铺底,见 menu-portal.css 同处注释。 */\n --wui-color-glass-ring: transparent;\n\n pointer-events: none;\n\n position: absolute;\n z-index: var(--wui-layer-inline-overlay, 1);\n top: -9999px;\n left: -9999px;\n\n box-sizing: border-box;\n width: max-content;\n max-width: var(--wui-tooltip-max-width, 240px);\n padding: 6px 10px;\n border-radius: var(--wui-radius-menu, 18px);\n\n font-size: var(--wui-tooltip-font-size, 13px);\n color: var(--wui-color-text, #1b1b1b);\n\n /* 玻璃背景:wui-glass 在 panel 自身,这里覆盖其默认玻璃底为 menu surface 色 */\n background-color: var(--wui-color-surface-menu, rgb(250 250 250 / 0.76));\n}\n\n.tooltip-panel.portal {\n position: fixed;\n z-index: var(--wui-layer-menu, 100);\n}\n\n.tooltip-panel.hidden {\n display: none;\n}\n\n.tooltip-text {\n display: block;\n overflow-wrap: break-word;\n white-space: normal;\n}\n\n:host([portal]) .tooltip-panel {\n display: none;\n}\n"],"mappings":";AAAA,IAAA,gBAAA"}
1
+ {"version":3,"file":"style.js","names":[],"sources":["../../../src/components/tooltip/style.css?inline"],"sourcesContent":["*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n:host {\n display: inline-flex;\n}\n\n.tooltip-trigger {\n display: inline-flex;\n}\n\n.tooltip-anchor {\n position: relative;\n display: inline-flex;\n}\n\n.tooltip-panel {\n --wui-internal-glass-shadow: var(--wui-shadow-panel, 0 3px 9px rgb(0 0 0 / 0.27));\n --wui-glass-corner-radius: var(--wui-radius-menu, 18px);\n\n /* 环底色转 transparent,宽 panel 的长边中段不留铺底,见 menu-portal.css 同处注释。 */\n --wui-color-glass-ring: transparent;\n\n pointer-events: none;\n\n position: absolute;\n z-index: var(--wui-layer-inline-overlay, 10);\n top: -9999px;\n left: -9999px;\n\n box-sizing: border-box;\n width: max-content;\n max-width: var(--wui-tooltip-max-width, 240px);\n padding: 6px 10px;\n border-radius: var(--wui-radius-menu, 18px);\n\n font-size: var(--wui-tooltip-font-size, 13px);\n color: var(--wui-color-text, #1b1b1b);\n\n /* 玻璃背景:wui-glass 在 panel 自身,这里覆盖其默认玻璃底为 menu surface 色 */\n background-color: var(--wui-color-surface-menu, rgb(250 250 250 / 0.76));\n}\n\n.tooltip-panel.portal {\n position: fixed;\n z-index: var(--wui-layer-menu, 1000);\n}\n\n.tooltip-panel.hidden {\n display: none;\n}\n\n.tooltip-text {\n display: block;\n overflow-wrap: break-word;\n white-space: normal;\n}\n\n:host([portal]) .tooltip-panel {\n display: none;\n}\n"],"mappings":";AAAA,IAAA,gBAAA"}
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ body: string;
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export { _default as default };
7
+ //# sourceMappingURL=ant-design-sync-outlined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ant-design-sync-outlined.d.ts","names":[],"sources":["../../../src/icons/generated/ant-design-sync-outlined.ts"],"mappings":""}