@snowui-design-system/components 0.1.0 → 0.2.0-alpha.3

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 (319) hide show
  1. package/README.md +1 -2
  2. package/package.json +6 -2
  3. package/src/components/Accordion.md +218 -0
  4. package/src/components/Accordion.svelte +301 -0
  5. package/src/components/Accordion.test.ts +126 -0
  6. package/src/components/AccordionItem.md +114 -0
  7. package/src/components/AccordionItem.svelte +389 -0
  8. package/src/components/AccordionItem.test.ts +52 -0
  9. package/src/components/Avatar.md +54 -36
  10. package/src/components/Avatar.svelte +73 -126
  11. package/src/components/AvatarGroup.md +17 -14
  12. package/src/components/AvatarGroup.svelte +12 -50
  13. package/src/components/AvatarGroup.test.ts +69 -68
  14. package/src/components/Badge.md +53 -8
  15. package/src/components/Badge.svelte +303 -79
  16. package/src/components/Badge.test.ts +47 -0
  17. package/src/components/Breadcrumb.md +164 -0
  18. package/src/components/Breadcrumb.svelte +330 -0
  19. package/src/components/Breadcrumb.test.ts +154 -0
  20. package/src/components/Button.md +243 -57
  21. package/src/components/Button.svelte +278 -177
  22. package/src/components/Button.test.ts +175 -86
  23. package/src/components/ButtonGroup.md +140 -0
  24. package/src/components/ButtonGroup.svelte +491 -0
  25. package/src/components/ButtonGroup.test.ts +58 -0
  26. package/src/components/Card.md +186 -0
  27. package/src/components/Card.svelte +408 -0
  28. package/src/components/Card.test.ts +193 -0
  29. package/src/components/Checkbox.md +14 -10
  30. package/src/components/Checkbox.svelte +39 -99
  31. package/src/components/Chip.md +185 -0
  32. package/src/components/Chip.svelte +241 -0
  33. package/src/components/Chip.test.ts +117 -0
  34. package/src/components/CodeBlock.md +29 -16
  35. package/src/components/CodeBlock.svelte +132 -352
  36. package/src/components/CodeBlock.test.ts +15 -1
  37. package/src/components/CopyButton.md +41 -0
  38. package/src/components/CopyButton.svelte +164 -0
  39. package/src/components/CopyButton.test.ts +26 -0
  40. package/src/components/Dialog.md +95 -0
  41. package/src/components/Dialog.svelte +416 -0
  42. package/src/components/Dialog.test.ts +145 -0
  43. package/src/components/ExpandButton.md +41 -0
  44. package/src/components/ExpandButton.svelte +103 -0
  45. package/src/components/ExpandButton.test.ts +18 -0
  46. package/src/components/Form.md +4 -3
  47. package/src/components/Form.test.ts +72 -73
  48. package/src/components/Frame.md +243 -0
  49. package/src/components/Frame.svelte +208 -87
  50. package/src/components/Frame.test.ts +121 -0
  51. package/src/components/Icon.md +34 -6
  52. package/src/components/Icon.svelte +46 -95
  53. package/src/components/Image.md +24 -13
  54. package/src/components/Image.svelte +42 -128
  55. package/src/components/ImageGroup.md +6 -7
  56. package/src/components/ImageGroup.svelte +1 -28
  57. package/src/components/Indicator.md +92 -0
  58. package/src/components/Indicator.svelte +490 -0
  59. package/src/components/Indicator.test.ts +57 -0
  60. package/src/components/Input.md +81 -28
  61. package/src/components/Input.svelte +291 -178
  62. package/src/components/Input.test.ts +85 -48
  63. package/src/components/Kbd.md +0 -3
  64. package/src/components/Kbd.svelte +0 -1
  65. package/src/components/Link.md +192 -0
  66. package/src/components/Link.svelte +464 -0
  67. package/src/components/Link.test.ts +110 -0
  68. package/src/components/Listbox.md +52 -10
  69. package/src/components/Listbox.svelte +204 -50
  70. package/src/components/Listbox.test.ts +76 -33
  71. package/src/components/LocaleProvider.md +52 -0
  72. package/src/components/LocaleProvider.svelte +30 -0
  73. package/src/components/LocaleProvider.test.ts +32 -0
  74. package/src/components/MenuItem.md +23 -9
  75. package/src/components/MenuItem.svelte +57 -47
  76. package/src/components/MenuItem.test.ts +72 -65
  77. package/src/components/Pagination.md +504 -0
  78. package/src/components/Pagination.svelte +958 -0
  79. package/src/components/Pagination.test.ts +316 -0
  80. package/src/components/Popover.md +245 -42
  81. package/src/components/Popover.svelte +558 -127
  82. package/src/components/Popover.test.ts +361 -44
  83. package/src/components/Progress.md +91 -0
  84. package/src/components/Progress.svelte +374 -0
  85. package/src/components/Progress.test.ts +56 -0
  86. package/src/components/Radio.md +4 -6
  87. package/src/components/Radio.svelte +25 -117
  88. package/src/components/ScrollArea.md +116 -0
  89. package/src/components/ScrollArea.svelte +180 -0
  90. package/src/components/ScrollArea.test.ts +84 -0
  91. package/src/components/SearchInput.md +135 -0
  92. package/src/components/SearchInput.svelte +153 -0
  93. package/src/components/SearchInput.test.ts +61 -0
  94. package/src/components/Select.md +39 -8
  95. package/src/components/Select.svelte +196 -45
  96. package/src/components/Select.test.ts +79 -41
  97. package/src/components/SelectButton.md +50 -0
  98. package/src/components/SelectButton.svelte +186 -0
  99. package/src/components/SelectButton.test.ts +142 -0
  100. package/src/components/Separator.md +89 -0
  101. package/src/components/Separator.svelte +143 -0
  102. package/src/components/Separator.test.ts +35 -0
  103. package/src/components/Skeleton.md +2 -5
  104. package/src/components/Skeleton.svelte +202 -7
  105. package/src/components/Skeleton.test.ts +10 -10
  106. package/src/components/Slider.md +101 -0
  107. package/src/components/Slider.svelte +566 -0
  108. package/src/components/Slider.test.ts +51 -0
  109. package/src/components/Spinner.md +3 -4
  110. package/src/components/Spinner.svelte +11 -23
  111. package/src/components/{Toggle.md → Switch.md} +20 -21
  112. package/src/components/Switch.svelte +314 -0
  113. package/src/components/Switch.test.ts +57 -0
  114. package/src/components/Table.md +249 -0
  115. package/src/components/Table.svelte +139 -0
  116. package/src/components/Table.test.ts +64 -0
  117. package/src/components/TableBody.md +63 -0
  118. package/src/components/TableBody.svelte +78 -0
  119. package/src/components/TableBody.test.ts +13 -0
  120. package/src/components/TableCell.md +89 -0
  121. package/src/components/TableCell.svelte +368 -0
  122. package/src/components/TableCell.test.ts +51 -0
  123. package/src/components/TableHead.md +129 -0
  124. package/src/components/TableHead.svelte +281 -0
  125. package/src/components/TableHead.test.ts +44 -0
  126. package/src/components/TableHeader.md +26 -0
  127. package/src/components/TableHeader.svelte +10 -0
  128. package/src/components/TableHeader.test.ts +3 -0
  129. package/src/components/TableRow.md +36 -0
  130. package/src/components/TableRow.svelte +64 -0
  131. package/src/components/TableRow.test.ts +2 -0
  132. package/src/components/TableToolbar.svelte +260 -0
  133. package/src/components/Tag.md +270 -0
  134. package/src/components/Tag.svelte +462 -0
  135. package/src/components/Tag.test.ts +91 -0
  136. package/src/components/Text.md +87 -25
  137. package/src/components/Text.svelte +467 -93
  138. package/src/components/Text.test.ts +21 -36
  139. package/src/components/Textarea.md +22 -7
  140. package/src/components/Textarea.svelte +76 -155
  141. package/src/components/Textarea.test.ts +12 -5
  142. package/src/components/Tooltip.md +101 -12
  143. package/src/components/Tooltip.svelte +581 -108
  144. package/src/components/Tooltip.test.ts +63 -1
  145. package/src/context.ts +93 -5
  146. package/src/dev.ts +6 -10
  147. package/src/i18n/locale.svelte.ts +60 -0
  148. package/src/i18n/messages.ts +45 -0
  149. package/src/index.ts +177 -2
  150. package/src/keys.ts +7 -0
  151. package/src/lib/clipboard.ts +10 -0
  152. package/src/lib/color.md +36 -0
  153. package/src/lib/color.ts +57 -0
  154. package/src/lib/date-format.md +37 -0
  155. package/src/lib/date-format.ts +130 -0
  156. package/src/lib/edge-fade.md +101 -0
  157. package/src/lib/edge-fade.ts +55 -0
  158. package/src/lib/floating-position.md +20 -0
  159. package/src/lib/floating-position.ts +107 -0
  160. package/src/lib/number-format.md +40 -0
  161. package/src/lib/number-format.ts +132 -0
  162. package/src/lib/overlay-scrollbar.md +36 -0
  163. package/src/lib/overlay-scrollbar.svelte.ts +221 -0
  164. package/src/lib/overlay-trigger-timing.md +15 -0
  165. package/src/lib/overlay-trigger-timing.ts +8 -0
  166. package/src/lib/progressive-blur.md +95 -0
  167. package/src/lib/progressive-blur.ts +266 -0
  168. package/src/lib/resizable.md +41 -0
  169. package/src/lib/resizable.ts +211 -0
  170. package/src/lib/table-context.svelte.ts +129 -0
  171. package/src/lib/table-row-context.svelte.ts +16 -0
  172. package/src/lib/tooltip-behavior.ts +39 -0
  173. package/src/lib/tooltip-delay.md +33 -0
  174. package/src/lib/tooltip-delay.ts +49 -0
  175. package/src/lib/tooltip-overlay.md +30 -0
  176. package/src/lib/tooltip-overlay.ts +64 -0
  177. package/src/lib/truncate.md +7 -2
  178. package/src/lib/truncate.ts +105 -10
  179. package/src/logic/README.md +17 -7
  180. package/src/logic/component-parts.md +32 -0
  181. package/src/logic/component-parts.svelte.ts +130 -0
  182. package/src/logic/dialog.md +30 -0
  183. package/src/logic/dialog.svelte.ts +88 -0
  184. package/src/logic/frame-actions.md +28 -0
  185. package/src/logic/frame-actions.svelte.ts +49 -0
  186. package/src/logic/frame-class-state.md +21 -0
  187. package/src/logic/frame-class-state.svelte.ts +163 -0
  188. package/src/logic/frame-dom-runtime.svelte.ts +51 -0
  189. package/src/logic/frame-inline-style.md +56 -0
  190. package/src/logic/frame-inline-style.svelte.ts +623 -0
  191. package/src/logic/frame-motion-defaults.md +90 -9
  192. package/src/logic/frame-motion-defaults.ts +55 -49
  193. package/src/logic/frame-motion.svelte.ts +173 -0
  194. package/src/logic/frame-perception.md +83 -0
  195. package/src/logic/frame-perception.svelte.ts +273 -0
  196. package/src/logic/frame-prop-filter.ts +7 -1
  197. package/src/logic/frame-scale-observer.md +153 -0
  198. package/src/logic/frame-scale-observer.svelte.ts +98 -0
  199. package/src/logic/frame-scale-resolver.md +25 -0
  200. package/src/logic/frame-scale-resolver.svelte.ts +56 -0
  201. package/src/logic/frame-state-value.md +74 -0
  202. package/src/logic/frame-state-value.ts +30 -0
  203. package/src/logic/frame-state.svelte.ts +426 -0
  204. package/src/logic/frame-truncation.md +17 -3
  205. package/src/logic/frame-truncation.svelte.ts +23 -43
  206. package/src/logic/frame-types.md +2 -1
  207. package/src/logic/frame-types.ts +41 -7
  208. package/src/logic/frame-utils.md +4 -0
  209. package/src/logic/frame-utils.ts +54 -26
  210. package/src/logic/image-preview.md +9 -2
  211. package/src/logic/image-preview.ts +33 -7
  212. package/src/logic/morph.md +19 -0
  213. package/src/logic/morph.ts +7 -0
  214. package/src/logic/motion-config.ts +49 -3
  215. package/src/logic/motion-engine.md +43 -0
  216. package/src/logic/motion-engine.ts +272 -0
  217. package/src/logic/overlay-presence.svelte.ts +71 -0
  218. package/src/logic/popover.md +89 -0
  219. package/src/logic/popover.svelte.ts +236 -0
  220. package/src/logic/resource-size.md +21 -0
  221. package/src/logic/resource-size.ts +53 -0
  222. package/src/logic/text-collapse.md +2 -1
  223. package/src/logic/text-collapse.svelte.ts +1 -1
  224. package/src/logic/wc-adapter.ts +1 -1
  225. package/src/motion/README.md +97 -37
  226. package/src/motion/{defaults/bridge.md → bridge.md} +24 -4
  227. package/src/motion/{defaults/bridge.ts → bridge.ts} +16 -5
  228. package/src/motion/{defaults/content-crossfade.ts → content-crossfade.ts} +1 -1
  229. package/src/motion/{defaults/expand.md → expand.md} +2 -2
  230. package/src/motion/{defaults/expand.ts → expand.ts} +4 -3
  231. package/src/motion/fade-in.md +40 -0
  232. package/src/motion/fade-in.ts +14 -0
  233. package/src/motion/{defaults/fade-out.md → fade-out.md} +2 -2
  234. package/src/motion/fade-out.ts +14 -0
  235. package/src/motion/{defaults/morph.md → morph.md} +1 -1
  236. package/src/motion/{defaults/morph.ts → morph.ts} +3 -3
  237. package/src/motion/move.md +179 -0
  238. package/src/motion/move.ts +74 -0
  239. package/src/motion/number.md +50 -0
  240. package/src/motion/number.ts +30 -0
  241. package/src/motion/presets/README.md +50 -0
  242. package/src/motion/presets/dialog.md +20 -0
  243. package/src/motion/presets/dialog.ts +47 -0
  244. package/src/motion/presets/effects.md +32 -0
  245. package/src/motion/presets/effects.ts +111 -0
  246. package/src/motion/presets/generic.md +27 -0
  247. package/src/motion/presets/generic.ts +32 -0
  248. package/src/motion/presets/overlay.md +21 -0
  249. package/src/motion/presets/overlay.ts +18 -0
  250. package/src/motion/presets/replacement.md +19 -0
  251. package/src/motion/presets/replacement.ts +6 -0
  252. package/src/motion/presets/resize.md +23 -0
  253. package/src/motion/presets/resize.ts +16 -0
  254. package/src/motion/presets/tab.md +21 -0
  255. package/src/motion/presets/tab.ts +19 -0
  256. package/src/motion/presets/tooltip.md +20 -0
  257. package/src/motion/presets/tooltip.ts +37 -0
  258. package/src/motion/presets/utils.md +15 -0
  259. package/src/motion/presets/utils.ts +11 -0
  260. package/src/motion/primitives.md +22 -0
  261. package/src/motion/primitives.ts +46 -0
  262. package/src/motion/{defaults/replace.md → replace.md} +2 -2
  263. package/src/motion/{defaults/replace.ts → replace.ts} +4 -4
  264. package/src/motion/{defaults/rotate.md → rotate.md} +4 -4
  265. package/src/motion/{defaults/rotate.ts → rotate.ts} +4 -3
  266. package/src/motion/scale-in.md +40 -0
  267. package/src/motion/scale-in.ts +19 -0
  268. package/src/motion/spring.md +19 -0
  269. package/src/motion/spring.ts +96 -0
  270. package/src/motion/tokens.md +45 -0
  271. package/src/motion/tokens.ts +80 -0
  272. package/src/motion/{defaults/while-2xl.ts → while-2xl.ts} +1 -1
  273. package/src/motion/{defaults/while-active.ts → while-active.ts} +1 -1
  274. package/src/motion/while-appear.ts +10 -0
  275. package/src/motion/{defaults/while-click.ts → while-click.ts} +1 -1
  276. package/src/motion/{defaults/while-collapsed.ts → while-collapsed.ts} +1 -1
  277. package/src/motion/{defaults/while-disabled.ts → while-disabled.ts} +3 -2
  278. package/src/motion/while-disappear.ts +10 -0
  279. package/src/motion/{defaults/while-drag.ts → while-drag.ts} +1 -1
  280. package/src/motion/{defaults/while-editing.ts → while-editing.ts} +1 -1
  281. package/src/motion/{defaults/while-expanded.ts → while-expanded.ts} +1 -1
  282. package/src/motion/{defaults/while-focus.ts → while-focus.ts} +1 -1
  283. package/src/motion/{defaults/while-hover.ts → while-hover.ts} +1 -1
  284. package/src/motion/{defaults/while-idle.ts → while-idle.ts} +1 -1
  285. package/src/motion/{defaults/while-key.ts → while-key.ts} +1 -1
  286. package/src/motion/{defaults/while-lg.ts → while-lg.ts} +1 -1
  287. package/src/motion/{defaults/while-load.ts → while-load.ts} +3 -2
  288. package/src/motion/{defaults/while-md.ts → while-md.ts} +1 -1
  289. package/src/motion/{defaults/while-reload.ts → while-reload.ts} +1 -1
  290. package/src/motion/{defaults/while-scroll.ts → while-scroll.ts} +1 -1
  291. package/src/motion/{defaults/while-sm.ts → while-sm.ts} +1 -1
  292. package/src/motion/{defaults/while-uploading.ts → while-uploading.ts} +1 -1
  293. package/src/motion/{defaults/while-validating.ts → while-validating.ts} +1 -1
  294. package/src/motion/{defaults/while-xl.ts → while-xl.ts} +1 -1
  295. package/src/motion/{defaults/while-xs.ts → while-xs.ts} +1 -1
  296. package/src/styles/auto-layout.css +92 -10
  297. package/src/styles/layout.css +370 -30
  298. package/src/styles/scrollbar.css +72 -7
  299. package/src/App.svelte +0 -103
  300. package/src/components/QuickAction.md +0 -146
  301. package/src/components/QuickAction.svelte +0 -161
  302. package/src/components/QuickAction.test.ts +0 -299
  303. package/src/components/Test.md +0 -72
  304. package/src/components/Test.svelte +0 -106
  305. package/src/components/Test.test.ts +0 -27
  306. package/src/components/Toggle.svelte +0 -384
  307. package/src/components/Toggle.test.ts +0 -57
  308. package/src/logic/frame-profile.md +0 -156
  309. package/src/logic/frame-profile.ts +0 -130
  310. package/src/motion/NumberFlow.md +0 -16
  311. package/src/motion/defaults/fade-out.ts +0 -14
  312. package/src/motion/defaults/move.md +0 -81
  313. package/src/motion/defaults/move.ts +0 -31
  314. package/src/motion/defaults/number.md +0 -41
  315. package/src/motion/defaults/number.ts +0 -17
  316. package/src/motion/defaults/while-appear.ts +0 -12
  317. package/src/motion/defaults/while-disappear.ts +0 -12
  318. package/src//344/273/243/347/240/201.txt +0 -61
  319. /package/src/motion/{defaults/rotate.css → rotate.css} +0 -0
@@ -1,72 +1,6 @@
1
- <!--
1
+ <!--
2
2
  Button 组件:基础交互按钮
3
- v1.4.4
4
-
5
- 变更记录 (2026-03-16):
6
- - 移除 `control="date-picker"` 行为协议;日期触发器回归 `as="trailing"` 组合规则,复杂结构仅在 `Field` 直系或 `row` 容器内识别
7
-
8
- 变更记录 (2026-03-15):
9
- - 修复 `as` 角色透传:Button 现在把 `as` 透传给 Frame 角色类,支持 `as="trailing"` 参与 Field 组合协议
10
- - 为单图标 `iconButton` 增加最小 `16x16` 的透明点击热区;通过绝对定位伪元素扩展命中区域,不使用 padding 改变可见布局
11
- - 调整 `iconButton` 行为优先级:忽略 `variant` 视觉;未显式传尺寸时,图标回退到当前 `size` 档位的常规图标尺寸(`sm/md/lg -> 12/16/20`)
12
- - `iconButton` 仅在“存在图标”时接管图标尺寸,仅在“单图标内容”时接管方形外壳尺寸;无图标内容时只保留透明度与 hover 透明度规则
13
- - 新增 `iconButton` 图标按钮模式:支持复用 Icon 尺寸梯度(12/16/20/24/28/32/40/48/80),默认透明度 40%,hover 提升到 100%
14
- - `iconButton` 模式关闭 Surface 默认 hover 背景叠加,并让骨架提示与宽高跟随 Icon 尺寸梯度
15
-
16
- 变更记录 (2026-03-10):
17
- - 新增 Image / ImageViewer 宿主角色接入,支持 as="badge" / "icon" / "prev" / "next" / "close"
18
-
19
- 变更记录 (2026-03-03):
20
- - 尺寸默认值改为“可覆盖”模式:移除 sm/md/lg 默认最小宽高约束,外部 class/style/父容器可直接接管尺寸
21
-
22
- 变更记录 (2026-02-25):
23
- - 新增 Resource Icon 尺寸上下文注入:`<Button><ArrowLineDown2 /></Button>` 直放资源图标时,默认尺寸跟随按钮档位(sm/md/lg => 16/20/24),与 `<Icon>` 包裹行为一致
24
- - `as="more"` 角色识别改为仅基于 as 值,不再依赖 TextContext 是否存在,确保在 Text 内容中声明即获得 more 按钮定位样式
25
- - 保留点击时的 Text 展开联动:存在 TextContext 时触发 `handleExpand`
26
- - 调整 `as="more"` 渲染策略:不再按 `isCollapsed` 条件隐藏,是否显示由 Text 内容是否声明 `<Button as="more">` 决定
27
- - 保留与 Text 的联动点击行为(`handleExpand`)
28
-
29
- 变更记录 (2026-02-23):
30
- - 移除 Button 内置文本截断能力(buttonLines + truncate action)
31
- - 截断统一交由 Text 组件承载,Button 聚焦交互与布局能力
32
-
33
- 变更记录 (2026-02-18):
34
- - 新增变量桥接链:按钮核心视觉属性改为 override -> internal -> token 三层变量链
35
- - 变体与状态改为通过桥接变量驱动,保留现有选择器结构与优先级行为
36
- - link/outline hover 改为更新桥接变量,保留禁用态排除规则
37
-
38
- 变更记录 (2026-02-18):
39
- - 移除 sm/md/lg 的最小宽高限制(min-width/min-height)
40
- - 精简尺寸样式写法:减少中间变量,按档位直接声明核心属性
41
- - 对齐 Figma 尺寸规范:sm/md/lg 的 icon-size、padding、gap、radius
42
- - 字号与行高改为强配对:sm=12/16, md=14/20, lg=16/24
43
- - 单图标按钮(icon-only)padding 按档位统一为 4/8/12
44
-
45
- 变更记录 (2026-02-07):
46
- - 修复 icon+text 被误判为 icon-only 的问题(改为运行时精确检测文本节点)
47
- - icon-only padding 规则由 :has 选择器改为 .snowui-button-icon-only 类触发
48
-
49
- 变更记录 (2026-02-07):
50
- - 修复 Icon 组件尺寸未与 Button 档位联动的问题(通过 Frame Size Context 传递 16/20/24)
51
- - 修复 icon-only 选择器未命中 Icon 根节点的问题(补充 .snowui-icon-wrapper)
52
- - 修正 link 变体最小高度重置
53
-
54
- 变更记录 (2026-02-07):
55
- - 调整 sm/md/lg 最小宽高(28/40/56)
56
- - 调整 sm 常规 padding 为 12x4
57
- - 增加单图标按钮(icon-only)在 sm/md/lg 的独立 padding(4/8/12)
58
- - 补齐图标容器(.snowui-icon)尺寸与按钮档位联动
59
-
60
- 变更记录 (2026-02-03):
61
- - 按钮样式迁移到外部样式文件
62
- - 补齐 Frame 能力开关显式传参
63
-
64
- 变更记录 (2026-02-26):
65
- - 子内容透传 Frame 状态:Button 的 children snippet 现在接收 Frame 提供的状态对象(含 currentState)
66
- - 便于在 Button 示例中使用纯声明式状态链实现文本切换,无需手动 DOM 操作
67
-
68
- 变更记录 (2026-02-26):
69
- - 移除 stateText 特化能力,统一回归 Frame 的通用状态变量机制(stateVars/stateClass/stateStyle)
3
+ v2.3.2
70
4
 
71
5
  1. 核心能力 (Capabilities):
72
6
  - 继承 Frame 组件的所有通用能力 (交互、动效、响应式等)
@@ -86,14 +20,33 @@
86
20
  import { onDestroy, setContext, type Snippet } from "svelte";
87
21
  import { RESOURCE_ICON_CONTEXT_KEY } from "@snowui-design-system/resource-svelte";
88
22
  import Frame, { type FrameProps } from "./Frame.svelte";
89
- import { getImage, getImageViewer, getText, getSize } from "../context";
90
-
91
- type ButtonIconButtonSize = 12 | 16 | 20 | 24 | 28 | 32 | 40 | 48 | 80;
23
+ import {
24
+ mergeComponentPartProps,
25
+ useComponentPart,
26
+ } from "../logic/component-parts.svelte";
27
+ import {
28
+ getImage,
29
+ getImageViewer,
30
+ getText,
31
+ getSize,
32
+ getButtonGroup,
33
+ getButtonSize,
34
+ getBreadcrumb,
35
+ } from "../context";
92
36
 
93
37
  interface Props extends Omit<FrameProps, "size"> {
94
- variant?: "gray" | "filled" | "outline" | "borderless" | "link";
38
+ variant?: "gray" | "filled" | "outline" | "borderless";
95
39
  size?: "sm" | "md" | "lg";
96
- iconButton?: boolean | ButtonIconButtonSize;
40
+ bare?: boolean;
41
+ /** 是否启用背景内容模糊;默认 false。 */
42
+ backgroundBlur?: boolean;
43
+ /**
44
+ * Toggle 模式:内部自动注入 `Click={{Idle:"Active",Active:"Idle"}}` 与 `whileClick=false` 默认值,
45
+ * 配合 Frame 自动暴露的 `data-state="Active"` 让根节点在激活态自动套用 Secondary/Indigo 配色。
46
+ * `aria-pressed` 也由 Frame 自动输出。
47
+ * 消费方可继续传 `Click` / `whileClick` 覆盖默认行为。
48
+ */
49
+ toggle?: boolean;
97
50
  holdRepeat?: boolean;
98
51
  holdRepeatDelay?: number;
99
52
  holdRepeatInterval?: number;
@@ -101,10 +54,14 @@
101
54
  [key: string]: any;
102
55
  }
103
56
 
57
+ const inheritedButtonPart = useComponentPart<Props>("Button");
58
+ let explicitProps: Props = $props();
104
59
  let {
105
- variant = "gray",
106
- size = "sm",
107
- iconButton = false,
60
+ variant = undefined,
61
+ size = undefined,
62
+ bare = false,
63
+ backgroundBlur = false,
64
+ toggle = false,
108
65
  href = undefined,
109
66
  target = undefined,
110
67
  rel = undefined,
@@ -117,19 +74,51 @@
117
74
  onpointerup: userOnPointerUp,
118
75
  onpointerleave: userOnPointerLeave,
119
76
  onpointercancel: userOnPointerCancel,
77
+ Click: clickProp = undefined,
120
78
  style: userStyle = "",
121
79
  class: className = "",
122
80
  renderHints: userRenderHints = undefined,
123
81
  as = undefined,
124
82
  children,
125
83
  ...rest // Pass everything else to Frame
126
- }: Props = $props();
84
+ }: Props = $derived(
85
+ mergeComponentPartProps(inheritedButtonPart.current, explicitProps),
86
+ );
87
+
88
+ // toggle 模式默认值注入:消费方未传 Click 时注入 toggle 状态机,未传 whileClick 时关闭 press 反馈。
89
+ // 任一已显式传入则尊重消费方意图。
90
+ const toggleDefaults = $derived.by(() => {
91
+ if (!toggle) return undefined;
92
+ const out: Record<string, any> = {};
93
+ if (clickProp === undefined) out.Click = { Idle: "Active", Active: "Idle" };
94
+ if (rest.whileClick === undefined) out.whileClick = false;
95
+ return out;
96
+ });
127
97
 
128
98
  // 上下文感知
129
99
  const contextSize = getSize();
100
+ const buttonGroupCtx = getButtonGroup();
101
+ const buttonSizeCtx = getButtonSize();
102
+ const breadcrumbCtx = getBreadcrumb();
103
+ const isButtonGroupEmbedded = $derived(
104
+ as === "item" && buttonGroupCtx?.present === true,
105
+ );
106
+ const resolvedVariant = $derived.by(() => {
107
+ if (variant !== undefined) return variant;
108
+ if (isButtonGroupEmbedded && buttonGroupCtx?.variant !== undefined) return buttonGroupCtx.variant;
109
+ if (as === "item" && breadcrumbCtx?.variant !== undefined) {
110
+ return breadcrumbCtx.variant;
111
+ }
112
+ return "gray";
113
+ });
114
+ const resolvedDisabled = $derived(
115
+ disabled || (isButtonGroupEmbedded && buttonGroupCtx?.disabled === true),
116
+ );
130
117
  // 计算最终尺寸:优先使用 prop size,其次映射上下文尺寸
131
118
  const resolvedSize = $derived.by(() => {
132
119
  if (size) return size;
120
+ if (isButtonGroupEmbedded && buttonGroupCtx?.size) return buttonGroupCtx.size;
121
+ if (as === "item" && buttonSizeCtx?.present) return buttonSizeCtx.size;
133
122
  if (contextSize === undefined) return "sm";
134
123
  if (typeof contextSize === "number") {
135
124
  if (contextSize <= 16) return "sm";
@@ -141,36 +130,17 @@
141
130
 
142
131
  // 响应式的单个图标状态
143
132
  let isIconOnly = $state(false);
144
- let hasIcon = $state(false);
145
133
  let buttonElement = $state<HTMLElement | undefined>(undefined);
146
134
 
147
- const iconButtonTokenMap: Record<ButtonIconButtonSize, string> = {
148
- 12: "var(--size-3)",
149
- 16: "var(--size-4)",
150
- 20: "var(--size-5)",
151
- 24: "var(--size-6)",
152
- 28: "var(--size-7)",
153
- 32: "var(--size-8)",
154
- 40: "var(--size-10)",
155
- 48: "var(--size-12)",
156
- 80: "var(--size-20)",
157
- };
158
-
159
135
  const defaultButtonIconSize = $derived.by(() => {
160
136
  if (resolvedSize === "lg") return 20;
161
137
  if (resolvedSize === "md") return 16;
162
138
  return 12;
163
139
  });
164
140
 
165
- const iconButtonIconSize = $derived.by(() => {
166
- if (!iconButton || !hasIcon) return undefined;
167
- if (typeof iconButton === "number") return iconButton;
168
- return defaultButtonIconSize;
169
- });
170
-
171
141
  // 传递给 Frame Context 的尺寸(供 Icon/Avatar 等子组件继承)
172
142
  const contextPixelSize = $derived.by(() => {
173
- if (iconButtonIconSize !== undefined) return iconButtonIconSize;
143
+ if (bare && isIconOnly) return defaultButtonIconSize;
174
144
  if (isIconOnly) {
175
145
  if (resolvedSize === "lg") return 24;
176
146
  if (resolvedSize === "md") return 20;
@@ -182,13 +152,12 @@
182
152
  }
183
153
  });
184
154
  const buttonRenderHints = $derived.by(() => {
185
- if (iconButtonIconSize !== undefined && isIconOnly) {
186
- const iconSizeToken = iconButtonTokenMap[iconButtonIconSize];
155
+ if (bare && isIconOnly) {
187
156
  return {
188
157
  variant: userRenderHints?.variant ?? "circle",
189
- width: userRenderHints?.width ?? iconSizeToken,
190
- height: userRenderHints?.height ?? iconSizeToken,
191
- radius: userRenderHints?.radius ?? "var(--radius-full)",
158
+ width: userRenderHints?.width ?? `${defaultButtonIconSize}px`,
159
+ height: userRenderHints?.height ?? `${defaultButtonIconSize}px`,
160
+ radius: userRenderHints?.radius ?? "0",
192
161
  };
193
162
  }
194
163
  const base =
@@ -236,6 +205,7 @@
236
205
  // 是否存在 TextContext 仅影响点击联动,不影响按钮本身渲染与定位样式。
237
206
  const isExpandButton = $derived(as === "more");
238
207
  const hostStyle = $derived.by(() => {
208
+ if (as === "more") return "--pin-offset: 4px;";
239
209
  if (as === "badge" && imageCtx) return imageCtx.badgeStyle || "";
240
210
  if (as === "icon" && imageCtx) return imageCtx.iconStyle || "";
241
211
  // ImageViewer 角色仅保留显隐控制,布局定位已回归架构代理
@@ -247,15 +217,31 @@
247
217
  return "";
248
218
  });
249
219
  const buttonStyle = $derived.by(() => {
250
- const iconButtonStyle =
251
- iconButtonIconSize !== undefined && isIconOnly
252
- ? `--snowui-button-icon-button-size: ${iconButtonTokenMap[iconButtonIconSize]};`
253
- : "";
254
- const styles = [hostStyle, iconButtonStyle, userStyle]
220
+ const styles = [hostStyle, userStyle]
255
221
  .filter(Boolean)
256
222
  .join("; ");
257
223
  return styles || undefined;
258
224
  });
225
+ const clickProps = $derived.by(() => {
226
+ if (isExpandButton || clickProp === undefined) return {};
227
+ return { Click: clickProp };
228
+ });
229
+ const frameRestProps = $derived.by(() => {
230
+ const next = { ...rest };
231
+ delete next.Click;
232
+ return next;
233
+ });
234
+ const layoutAs = $derived.by(() => {
235
+ if (as === "more") return "pin-bottom-right";
236
+ if (as === "badge" && imageCtx) return imageCtx.badgeAs || as;
237
+ if (as === "icon" && imageCtx) return imageCtx.iconAs || as;
238
+ if (imageViewerCtx) {
239
+ if (as === "prev") return imageViewerCtx.prevAs || as;
240
+ if (as === "next") return imageViewerCtx.nextAs || as;
241
+ if (as === "close") return imageViewerCtx.closeAs || as;
242
+ }
243
+ return as;
244
+ });
259
245
 
260
246
  // 计算最终的标签
261
247
  let tag = $derived(href ? "a" : "button");
@@ -324,7 +310,7 @@
324
310
  node: HTMLElement | undefined,
325
311
  event?: MouseEvent,
326
312
  ) {
327
- if (!node || disabled) return false;
313
+ if (!node || resolvedDisabled) return false;
328
314
 
329
315
  const binding = resolveDateTriggerBinding(node);
330
316
  if (!binding) return false;
@@ -372,6 +358,12 @@
372
358
 
373
359
  // 处理点击 (Button 特有逻辑: 展开)
374
360
  function handleClick(event?: MouseEvent) {
361
+ if (buttonElement?.getAttribute("aria-current") === "page") {
362
+ event?.preventDefault();
363
+ event?.stopPropagation();
364
+ return;
365
+ }
366
+
375
367
  // holdRepeat 模式下,按下已主动触发 click,这里丢弃随后浏览器的原生 trusted click,避免重复计算
376
368
  if (holdRepeat && holdNativeClickSuppressed && event?.isTrusted) {
377
369
  holdNativeClickSuppressed = false;
@@ -380,7 +372,26 @@
380
372
  }
381
373
 
382
374
  if (isExpandButton && textCtx) {
383
- textCtx.handleExpand();
375
+ const currentTarget =
376
+ event?.currentTarget instanceof HTMLElement
377
+ ? event.currentTarget
378
+ : buttonElement;
379
+ const expandDelay = Number(textCtx.handleExpand() ?? 0);
380
+ const expandClick = clickProp;
381
+ if (
382
+ expandClick &&
383
+ typeof expandClick === "object" &&
384
+ "run" in expandClick &&
385
+ typeof expandClick.run === "function"
386
+ ) {
387
+ window.setTimeout(() => {
388
+ expandClick.run({
389
+ currentTarget,
390
+ target: currentTarget,
391
+ originalEvent: event,
392
+ });
393
+ }, Math.max(0, expandDelay));
394
+ }
384
395
  }
385
396
  userOnClick?.(event);
386
397
  if (event?.defaultPrevented || userOnClick) return;
@@ -405,7 +416,7 @@
405
416
  function handlePointerDown(event: PointerEvent) {
406
417
  userOnPointerDown?.(event);
407
418
  if (!holdRepeat) return;
408
- if (disabled) return;
419
+ if (resolvedDisabled) return;
409
420
  if (tag !== "button") return;
410
421
  if (event.button !== 0) return;
411
422
 
@@ -465,8 +476,9 @@
465
476
  ".snowui-icon-wrapper, .snowui-icon, .snowui-avatar, svg, img";
466
477
 
467
478
  const update = () => {
468
- const elementChildren = Array.from(node.children);
469
- const hasAnyIconElement = node.querySelector(iconSelector) !== null;
479
+ const elementChildren = Array.from(node.children).filter(
480
+ (child) => !child.classList.contains("snowui-tooltip-placeholder"),
481
+ );
470
482
  const hasSingleIconElement =
471
483
  elementChildren.length === 1 &&
472
484
  elementChildren[0]?.matches?.(iconSelector);
@@ -479,7 +491,6 @@
479
491
  "snowui-button-icon-only",
480
492
  hasSingleIconElement && !hasTextNode,
481
493
  );
482
- hasIcon = hasAnyIconElement;
483
494
  isIconOnly = hasSingleIconElement && !hasTextNode;
484
495
  };
485
496
 
@@ -505,25 +516,31 @@
505
516
  });
506
517
  </script>
507
518
 
519
+ {#snippet buttonChildren()}
520
+ {@render children?.()}
521
+ {/snippet}
522
+
508
523
  <Frame
509
524
  bind:element={buttonElement}
510
525
  enableResponsive={false}
511
526
  enableContext={true}
512
527
  enableScaleObserver={false}
513
- profile="Surface"
514
528
  size={contextPixelSize}
515
529
  {tag}
516
- {as}
530
+ as={layoutAs}
517
531
  {href}
518
532
  {target}
519
533
  {rel}
520
- data-variant={iconButton ? undefined : variant}
534
+ data-variant={bare ? undefined : resolvedVariant}
535
+ data-embedded={isButtonGroupEmbedded ? "button-group" : undefined}
521
536
  data-leading={as === "leading" ? "true" : undefined}
522
537
  data-trailing={as === "trailing" ? "true" : undefined}
523
538
  type={tag === "button" ? rest.type || "button" : undefined}
539
+ disabled={resolvedDisabled}
524
540
  class={[
525
541
  "snowui-button",
526
- `snowui-button-${variant}`,
542
+ "snowui-hoverable",
543
+ `snowui-button-${resolvedVariant}`,
527
544
  `snowui-button-${resolvedSize}`,
528
545
  isExpandButton ? "snowui-text-expand-button" : "",
529
546
  as === "badge" ? "snowui-button-role-badge" : "",
@@ -531,9 +548,12 @@
531
548
  as === "prev" ? "snowui-button-role-prev" : "",
532
549
  as === "next" ? "snowui-button-role-next" : "",
533
550
  as === "close" ? "snowui-button-role-close" : "",
534
- iconButton ? "snowui-button-icon-button" : "",
535
- iconButton && isIconOnly && iconButtonIconSize !== undefined
536
- ? "snowui-button-icon-button-layout"
551
+ as === "item" ? "snowui-button-role-item" : "",
552
+ bare ? "snowui-button-bare" : "",
553
+ backgroundBlur ? "snowui-button-background-blur" : "",
554
+ isButtonGroupEmbedded ? "snowui-button-embedded-button-group" : "",
555
+ bare && isIconOnly
556
+ ? "snowui-button-bare-icon-only"
537
557
  : "",
538
558
  className,
539
559
  ]
@@ -546,13 +566,12 @@
546
566
  onpointerleave={handlePointerLeave}
547
567
  onpointercancel={handlePointerCancel}
548
568
  renderHints={buttonRenderHints}
549
- {...rest}
569
+ {...toggleDefaults}
570
+ {...clickProps}
571
+ {...frameRestProps}
550
572
  use={[detectIconOnly]}
551
- >
552
- {#snippet children(frameState)}
553
- {@render children?.(frameState)}
554
- {/snippet}
555
- </Frame>
573
+ children={buttonChildren}
574
+ />
556
575
 
557
576
  <style>
558
577
  /* Button 样式 */
@@ -574,18 +593,22 @@
574
593
  outline: none;
575
594
  box-sizing: border-box;
576
595
  text-decoration: none;
596
+ white-space: nowrap;
577
597
  transform: translate(var(--snowui-drag-x, 0), var(--snowui-drag-y, 0));
578
598
  opacity: var(--snowui-button-opacity-override, var(--snowui-button-opacity));
579
599
 
580
600
  /* 内部计算层(internal) */
581
601
  --snowui-button-border-width: var(--border-1);
582
- --snowui-button-padding: var(--padding-1) var(--padding-3);
602
+ --snowui-button-padding-block: var(--padding-1);
603
+ --snowui-button-padding-inline: var(--padding-3);
604
+ --snowui-button-padding: var(--snowui-button-padding-block)
605
+ var(--snowui-button-padding-inline);
583
606
  --snowui-button-icon-only-padding: var(--padding-1);
584
607
  --snowui-button-gap: var(--gap-1);
585
608
  --snowui-button-radius: var(--radius-3);
586
609
  --snowui-button-font-size: var(--text-12);
587
610
  --snowui-button-line-height: var(--leading-12);
588
- --snowui-button-min-width: 0;
611
+ --snowui-button-min-width: max-content;
589
612
  --snowui-button-min-height: 0;
590
613
  --snowui-button-width: auto;
591
614
  --snowui-button-height: auto;
@@ -644,6 +667,31 @@
644
667
  );
645
668
  }
646
669
 
670
+ :global(:where(.snowui-button-background-blur)) {
671
+ backdrop-filter: blur(
672
+ var(--snowui-button-background-blur-override, 1.25rem)
673
+ );
674
+ -webkit-backdrop-filter: blur(
675
+ var(--snowui-button-background-blur-override, 1.25rem)
676
+ );
677
+ }
678
+
679
+ :global(:where(.snowui-button[data-as^="pin-"])) {
680
+ position: absolute;
681
+ }
682
+
683
+ :global(:where(.snowui-button) > :not(.snowui-disabled)) {
684
+ cursor: pointer;
685
+ }
686
+
687
+ :global(
688
+ :where(.snowui-button):disabled,
689
+ :where(.snowui-button)[aria-disabled="true"],
690
+ :where(.snowui-button).snowui-disabled
691
+ ) {
692
+ cursor: default;
693
+ }
694
+
647
695
  :global(:where(.snowui-button) svg),
648
696
  :global(:where(.snowui-button) img),
649
697
  :global(:where(.snowui-button) .snowui-icon-wrapper) {
@@ -652,26 +700,38 @@
652
700
  object-fit: cover;
653
701
  }
654
702
 
703
+ /* 组合容器只能通过根属性请求内容显隐;Button 自己拥有内部 Text。 */
704
+ :global(:where(.snowui-button[data-composition-content="hidden"]) .snowui-text) {
705
+ display: none;
706
+ opacity: 0;
707
+ }
708
+
655
709
  /* Sizes (Level 4 - compound selector ensures 0,2,0 specificity) */
656
710
  :global(:where(.snowui-button).snowui-button-md) {
657
- --snowui-button-padding: var(--padding-2) var(--padding-4);
711
+ --snowui-button-padding-block: var(--padding-2);
712
+ --snowui-button-padding-inline: var(--padding-4);
713
+ --snowui-button-padding: var(--snowui-button-padding-block)
714
+ var(--snowui-button-padding-inline);
658
715
  --snowui-button-icon-only-padding: var(--padding-2);
659
716
  --snowui-button-gap: calc((var(--gap-1) + var(--gap-2)) / 2);
660
717
  --snowui-button-radius: var(--radius-4);
661
718
  --snowui-button-font-size: var(--text-14);
662
719
  --snowui-button-line-height: var(--leading-14);
663
- --snowui-button-min-width: 0;
720
+ --snowui-button-min-width: max-content;
664
721
  --snowui-button-min-height: 0;
665
722
  }
666
723
 
667
724
  :global(:where(.snowui-button).snowui-button-lg) {
668
- --snowui-button-padding: var(--padding-3) var(--padding-5);
725
+ --snowui-button-padding-block: var(--padding-3);
726
+ --snowui-button-padding-inline: var(--padding-5);
727
+ --snowui-button-padding: var(--snowui-button-padding-block)
728
+ var(--snowui-button-padding-inline);
669
729
  --snowui-button-icon-only-padding: var(--padding-3);
670
730
  --snowui-button-gap: var(--gap-2);
671
731
  --snowui-button-radius: var(--radius-5);
672
732
  --snowui-button-font-size: var(--text-16);
673
733
  --snowui-button-line-height: var(--leading-16);
674
- --snowui-button-min-width: 0;
734
+ --snowui-button-min-width: max-content;
675
735
  --snowui-button-min-height: 0;
676
736
  }
677
737
 
@@ -719,32 +779,19 @@
719
779
  --snowui-button-border-color: transparent;
720
780
  }
721
781
 
722
- :global(:where(.snowui-button)[data-variant="link"]) {
723
- --snowui-button-background: transparent;
724
- --snowui-button-color: var(--secondary-indigo, #adadfbff);
725
- --snowui-button-border-color: transparent;
726
- --snowui-button-padding: 0;
727
- --snowui-button-radius: 0;
728
- --snowui-button-height: auto;
729
- --snowui-button-min-height: 0;
730
- --snowui-button-min-width: 0;
731
- --snowui-hover-overlay-opacity: 0%;
732
- background-image: none;
733
- text-decoration: none;
734
- }
735
-
736
- :global(
737
- :where(.snowui-button)[data-variant="link"]:hover:not(.snowui-disabled)
738
- ) {
739
- --snowui-button-color: color-mix(
782
+ /* Toggle / 瞬时反馈:Active 状态由 Frame 自动暴露的 data-state="Active" 触发,
783
+ 无需消费方手写 stateClass,配色与 Tag variant="active" 一致(Secondary/Indigo)。 */
784
+ :global(:where(.snowui-button)[data-state="Active"]:not([data-variant="filled"])) {
785
+ --snowui-button-background: color-mix(
740
786
  in srgb,
741
- var(--secondary-indigo, #adadfbff),
742
- var(--black-80, #000000cc)
787
+ var(--secondary-indigo, #adadfb) 10%,
788
+ transparent
743
789
  );
744
- text-decoration: none;
790
+ --snowui-button-color: var(--secondary-indigo, #adadfb);
791
+ --snowui-button-border-color: transparent;
745
792
  }
746
793
 
747
- :global(:where(.snowui-button).snowui-button-icon-button) {
794
+ :global(:where(.snowui-button).snowui-button-bare) {
748
795
  --snowui-button-background: transparent;
749
796
  --snowui-button-border-color: transparent;
750
797
  --snowui-button-opacity: var(--snowui-state-opacity, 0.4);
@@ -753,44 +800,98 @@
753
800
  opacity var(--snowui-frame-color-motion-duration, 0.15s) var(--snowui-frame-color-motion-easing, ease-out);
754
801
  }
755
802
 
756
- :global(:where(.snowui-button).snowui-button-icon-button-layout) {
757
- --snowui-button-width: var(
758
- --snowui-button-icon-button-size,
759
- var(--size-4)
760
- );
761
- --snowui-button-height: var(
762
- --snowui-button-icon-button-size,
763
- var(--size-4)
764
- );
765
- --snowui-button-min-width: var(
766
- --snowui-button-icon-button-size,
767
- var(--size-4)
768
- );
769
- --snowui-button-min-height: var(
770
- --snowui-button-icon-button-size,
771
- var(--size-4)
772
- );
803
+ :global(:where(.snowui-button).snowui-button-bare) {
773
804
  --snowui-button-padding: 0;
774
805
  --snowui-button-icon-only-padding: 0;
775
- --snowui-button-gap: 0;
776
- --snowui-button-radius: var(--radius-full);
806
+ --snowui-button-radius: 0;
777
807
  }
778
808
 
779
- :global(:where(.snowui-button).snowui-button-icon-button-layout)::before {
809
+ :global(:where(.snowui-button).snowui-button-bare-icon-only)::before {
780
810
  content: "";
781
811
  position: absolute;
782
812
  left: 50%;
783
813
  top: 50%;
784
- width: var(--snowui-button-icon-button-hit-size, var(--size-4));
785
- height: var(--snowui-button-icon-button-hit-size, var(--size-4));
814
+ width: var(--snowui-button-bare-hit-size, var(--size-4));
815
+ height: var(--snowui-button-bare-hit-size, var(--size-4));
786
816
  transform: translate(-50%, -50%);
787
817
  background: transparent;
788
818
  }
789
819
 
820
+ :global(:where(.snowui-button).snowui-button-role-item[aria-current="page"]) {
821
+ --snowui-button-opacity: var(--snowui-state-opacity, 1);
822
+ --snowui-hover-overlay-opacity: 0%;
823
+ cursor: default;
824
+ pointer-events: none;
825
+ background-image: none;
826
+ }
827
+
790
828
  :global(
791
- :where(.snowui-button).snowui-button-icon-button:hover:not(.snowui-disabled):not(:disabled)
829
+ :where(.snowui-button).snowui-button-bare:hover:not(.snowui-disabled):not(:disabled)
792
830
  ) {
793
831
  --snowui-button-opacity: var(--snowui-state-opacity, 1);
794
832
  background-image: none;
795
833
  }
834
+
835
+ :global(:where(.snowui-button).snowui-button-embedded-button-group) {
836
+ --snowui-button-background: transparent;
837
+ --snowui-button-border-color: transparent;
838
+ --snowui-button-border-width: 0;
839
+ --snowui-button-color: inherit;
840
+ --snowui-button-group-cell-hover-opacity: 0%;
841
+ --snowui-button-padding: var(
842
+ --snowui-button-group-cell-padding-override,
843
+ var(--snowui-button-group-cell-padding, 0)
844
+ );
845
+ --snowui-button-icon-only-padding: var(
846
+ --snowui-button-group-cell-padding-override,
847
+ var(--snowui-button-group-cell-padding, 0)
848
+ );
849
+ --snowui-button-gap: var(
850
+ --snowui-button-group-cell-gap-override,
851
+ var(--snowui-button-group-cell-gap, var(--gap-1))
852
+ );
853
+ --snowui-button-radius: 0;
854
+ padding: var(
855
+ --snowui-button-group-cell-padding-override,
856
+ var(--snowui-button-group-cell-padding, 0)
857
+ );
858
+ background-image: none;
859
+ isolation: isolate;
860
+ overflow: visible;
861
+ align-self: stretch;
862
+ box-shadow: none;
863
+ }
864
+
865
+ :global(:where(.snowui-button).snowui-button-embedded-button-group)::before {
866
+ content: "";
867
+ position: absolute;
868
+ top: calc(var(--snowui-button-group-cell-extend-top, 0px) * -1);
869
+ right: calc(var(--snowui-button-group-cell-extend-right, 0px) * -1);
870
+ bottom: calc(var(--snowui-button-group-cell-extend-bottom, 0px) * -1);
871
+ left: calc(var(--snowui-button-group-cell-extend-left, 0px) * -1);
872
+ background-image: linear-gradient(
873
+ color-mix(
874
+ in srgb,
875
+ var(--snowui-hover-color, currentColor)
876
+ var(--snowui-button-group-cell-hover-opacity),
877
+ transparent
878
+ ),
879
+ color-mix(
880
+ in srgb,
881
+ var(--snowui-hover-color, currentColor)
882
+ var(--snowui-button-group-cell-hover-opacity),
883
+ transparent
884
+ )
885
+ );
886
+ pointer-events: auto;
887
+ }
888
+
889
+ :global(
890
+ :where(.snowui-button).snowui-button-embedded-button-group:hover:not(.snowui-disabled):not(:disabled)
891
+ ) {
892
+ --snowui-button-group-cell-hover-opacity: var(
893
+ --snowui-hover-opacity,
894
+ var(--snowui-frame-hover-opacity, 4%)
895
+ );
896
+ }
796
897
  </style>