@fusion.dev/helix 0.146.0 → 0.148.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 (273) hide show
  1. package/custom-elements.json +10225 -1400
  2. package/dist/accordion/item/accordion-item.css.js +4 -96
  3. package/dist/accordion/root/accordion-root.css.js +2 -28
  4. package/dist/announcement/root/announcement-root.css.js +10 -154
  5. package/dist/announcement/root/announcement-root.d.ts +3 -0
  6. package/dist/app-header/root/app-header-root.css.js +2 -118
  7. package/dist/area-chart/root/area-chart-root.css.js +4 -94
  8. package/dist/area-chart/root/area-chart-root.d.ts +1 -0
  9. package/dist/aura/root/aura-root.css.js +2 -57
  10. package/dist/avatar/group/avatar-group.css.js +5 -36
  11. package/dist/avatar/group/avatar-group.d.ts +3 -0
  12. package/dist/avatar/root/avatar-root.css.js +1 -53
  13. package/dist/avatar/root/avatar-root.d.ts +2 -0
  14. package/dist/badge/root/badge-root.css.js +12 -207
  15. package/dist/badge/root/badge-root.d.ts +2 -0
  16. package/dist/bar-chart/root/bar-chart-root.css.js +8 -292
  17. package/dist/blockquote/root/blockquote-root.css.js +1 -43
  18. package/dist/blockquote/root/blockquote-root.d.ts +8 -2
  19. package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +13 -98
  20. package/dist/breadcrumbs/root/breadcrumbs-root.css.js +5 -42
  21. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +17 -0
  22. package/dist/breadcrumbs/root/breadcrumbs-root.js +4 -0
  23. package/dist/button/root/button-root.css.js +16 -197
  24. package/dist/button/root/button-root.d.ts +1 -0
  25. package/dist/button-group/root/button-group-root.css.js +11 -52
  26. package/dist/button-group/root/button-group-root.d.ts +29 -7
  27. package/dist/button-group/root/button-group-root.js +19 -0
  28. package/dist/callout/root/callout-root.css.js +5 -138
  29. package/dist/callout/root/callout-root.d.ts +4 -2
  30. package/dist/canvas/node/canvas-node.css.js +10 -367
  31. package/dist/canvas/node/canvas-node.d.ts +5 -0
  32. package/dist/canvas/root/canvas-root.css.js +11 -270
  33. package/dist/canvas/root/canvas-root.d.ts +6 -0
  34. package/dist/card/root/card-root.css.js +5 -134
  35. package/dist/card/root/card-root.d.ts +4 -0
  36. package/dist/carousel/root/carousel-root.css.js +20 -386
  37. package/dist/chat/composer/chat-composer.css.js +4 -105
  38. package/dist/chat/message/chat-message.css.js +5 -239
  39. package/dist/chat/message/chat-message.d.ts +5 -0
  40. package/dist/chat/root/chat-root.css.js +5 -162
  41. package/dist/chat/typing.css.js +9 -46
  42. package/dist/checkbox/root/checkbox-root.css.js +12 -177
  43. package/dist/checkbox-group/root/checkbox-group-root.css.js +1 -27
  44. package/dist/code/root/code-root.css.js +3 -25
  45. package/dist/code-block/root/code-block-root.css.js +22 -279
  46. package/dist/code-block/root/code-block-root.d.ts +7 -0
  47. package/dist/color-input/root/color-input-root.css.js +5 -114
  48. package/dist/color-picker/root/color-picker-root.css.js +39 -337
  49. package/dist/color-picker/root/color-picker-root.d.ts +2 -0
  50. package/dist/combobox/root/combobox-root.css.js +8 -147
  51. package/dist/combobox/root/combobox-root.js +2 -0
  52. package/dist/command/root/command-root.css.js +3 -74
  53. package/dist/copy-button/root/copy-button-root.css.js +3 -43
  54. package/dist/data-table/root/data-table-root.css.js +21 -245
  55. package/dist/data-table/root/data-table-root.d.ts +7 -0
  56. package/dist/date-input/root/date-input-root.css.js +8 -103
  57. package/dist/date-picker/root/date-picker-root.css.js +16 -278
  58. package/dist/date-picker/root/date-picker-root.d.ts +1 -0
  59. package/dist/description-list/item/description-list-item.css.js +1 -41
  60. package/dist/description-list/item/description-list-item.d.ts +8 -0
  61. package/dist/description-list/root/description-list-root.css.js +2 -34
  62. package/dist/description-list/root/description-list-root.d.ts +13 -0
  63. package/dist/description-list/root/description-list-root.js +7 -0
  64. package/dist/dialog/root/dialog-root.css.js +7 -221
  65. package/dist/dialog/root/dialog-root.d.ts +3 -0
  66. package/dist/divider/root/divider-root.css.js +5 -81
  67. package/dist/divider/root/divider-root.d.ts +3 -0
  68. package/dist/donut-chart/root/donut-chart-root.css.js +7 -193
  69. package/dist/drawer/root/drawer-root.css.js +11 -237
  70. package/dist/drilldown/item/drilldown-item.css.js +4 -51
  71. package/dist/drilldown/item/drilldown-item.d.ts +1 -0
  72. package/dist/drilldown/root/drilldown-root.css.js +6 -120
  73. package/dist/element-events.generated.js +5 -1
  74. package/dist/empty/root/empty-root.css.js +2 -42
  75. package/dist/file-input/root/file-input-root.css.js +7 -173
  76. package/dist/file-input/root/file-input-root.d.ts +4 -0
  77. package/dist/filter-input/chip/filter-chip.css.js +2 -84
  78. package/dist/filter-input/field/filter-field.css.js +1 -3
  79. package/dist/filter-input/menu/filter-menu.css.js +1 -3
  80. package/dist/filter-input/operator/filter-operator.css.js +1 -3
  81. package/dist/filter-input/root/filter-input-root.css.js +6 -113
  82. package/dist/flex/root/flex-root.css.js +4 -207
  83. package/dist/flex/root/flex-root.d.ts +2 -2
  84. package/dist/format-date/root/format-date-root.css.js +1 -13
  85. package/dist/format-date/root/format-date-root.d.ts +0 -1
  86. package/dist/format-date/root/format-date-root.js +0 -1
  87. package/dist/graph/root/graph-root.css.js +9 -444
  88. package/dist/grid/root/grid-root.css.js +1 -171
  89. package/dist/heatmap/root/heatmap-root.css.js +8 -156
  90. package/dist/heatmap/root/heatmap-root.d.ts +2 -0
  91. package/dist/icon/index.d.ts +1 -1
  92. package/dist/icon/root/icon-root.css.js +1 -18
  93. package/dist/icon/root/index.d.ts +1 -1
  94. package/dist/icon-button/root/icon-button-root.css.js +25 -203
  95. package/dist/icon-button/root/icon-button-root.d.ts +1 -0
  96. package/dist/image/root/image-root.css.js +7 -65
  97. package/dist/image/root/image-root.d.ts +3 -0
  98. package/dist/input/root/input-root.css.js +6 -79
  99. package/dist/kbd/root/kbd-root.css.js +2 -71
  100. package/dist/kbd/root/kbd-root.d.ts +7 -0
  101. package/dist/legend/root/legend-root.css.js +9 -106
  102. package/dist/legend/root/legend-root.d.ts +2 -0
  103. package/dist/lightbox/item/lightbox-item.css.js +1 -37
  104. package/dist/lightbox/root/lightbox-root.css.js +38 -183
  105. package/dist/line-chart/root/line-chart-root.css.js +4 -170
  106. package/dist/line-chart/root/line-chart-root.d.ts +1 -0
  107. package/dist/list/item/list-item.css.js +2 -94
  108. package/dist/list/root/list-root.css.js +4 -88
  109. package/dist/listbox/root/listbox-root.css.js +7 -111
  110. package/dist/listbox/root/listbox-root.d.ts +2 -0
  111. package/dist/listbox/root/listbox-root.js +1 -0
  112. package/dist/loader/root/loader-root.css.js +5 -171
  113. package/dist/map/area/map-area.css.js +1 -23
  114. package/dist/map/buildings/map-buildings.css.js +1 -26
  115. package/dist/map/contours/map-contours.css.js +2 -5
  116. package/dist/map/landcover/map-landcover.css.js +1 -4
  117. package/dist/map/marker/map-marker.css.js +14 -327
  118. package/dist/map/points/map-points.css.js +1 -86
  119. package/dist/map/position/map-position.css.js +8 -227
  120. package/dist/map/raster/map-raster.css.js +1 -3
  121. package/dist/map/root/map-root.css.js +14 -352
  122. package/dist/map/root/map-root.d.ts +10 -0
  123. package/dist/map/route/map-route.css.js +1 -24
  124. package/dist/map/terrain/map-terrain.css.js +3 -7
  125. package/dist/megamenu/root/megamenu-root.css.js +11 -162
  126. package/dist/megamenu/root/megamenu-root.d.ts +8 -0
  127. package/dist/menu/item/menu-item.css.js +7 -130
  128. package/dist/menu/root/menu-root.css.js +1 -110
  129. package/dist/menu/section/menu-section.css.js +1 -13
  130. package/dist/meter/root/meter-root.css.js +17 -207
  131. package/dist/meter/root/meter-root.d.ts +3 -0
  132. package/dist/navigation/root/navigation-root.css.js +2 -54
  133. package/dist/notifications/group/notification-group.css.js +1 -61
  134. package/dist/notifications/notification/notification.css.js +17 -264
  135. package/dist/notifications/root/notifications-root.css.js +7 -125
  136. package/dist/notifications/root/notifications-root.d.ts +7 -2
  137. package/dist/number-input/root/number-input-root.css.js +10 -103
  138. package/dist/object-inspector/root/object-inspector-root.css.js +11 -162
  139. package/dist/option/group/option-group.css.js +1 -22
  140. package/dist/option/index.d.ts +1 -0
  141. package/dist/option/index.js +1 -0
  142. package/dist/option/root/option-root.css.js +3 -85
  143. package/dist/option/separator/option-separator.css.d.ts +1 -0
  144. package/dist/option/separator/option-separator.css.js +3 -0
  145. package/dist/option/separator/option-separator.d.ts +26 -0
  146. package/dist/option/separator/option-separator.js +16 -0
  147. package/dist/orb/root/orb-root.css.js +1 -41
  148. package/dist/outline/root/outline-root.css.js +24 -122
  149. package/dist/outline/root/outline-root.d.ts +17 -4
  150. package/dist/pagination/root/pagination-root.css.js +9 -105
  151. package/dist/pagination/root/pagination-root.d.ts +14 -0
  152. package/dist/pagination/size/pagination-size.css.js +1 -22
  153. package/dist/pagination/size/pagination-size.d.ts +3 -0
  154. package/dist/pagination/summary/pagination-summary.css.js +1 -7
  155. package/dist/pagination/summary/pagination-summary.d.ts +3 -0
  156. package/dist/pin-input/root/pin-input-root.css.js +2 -73
  157. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  158. package/dist/popover/root/popover-root.css.js +6 -127
  159. package/dist/progress/root/progress-root.css.js +7 -230
  160. package/dist/progress/root/progress-root.d.ts +4 -0
  161. package/dist/qr-code/root/qr-code-root.css.js +1 -68
  162. package/dist/qr-code/root/qr-code-root.d.ts +3 -0
  163. package/dist/quote/root/quote-root.css.js +1 -20
  164. package/dist/radio/group/radio-group.css.js +1 -21
  165. package/dist/radio/root/radio-root.css.js +5 -208
  166. package/dist/rating/root/rating-root.css.js +4 -117
  167. package/dist/sandbox/frame.d.ts +2 -1
  168. package/dist/sandbox/frame.js +1 -1
  169. package/dist/sandbox/index.d.ts +1 -1
  170. package/dist/sandbox/preview/sandbox-preview.css.js +1 -12
  171. package/dist/sandbox/preview/sandbox-preview.d.ts +27 -3
  172. package/dist/sandbox/preview/sandbox-preview.js +17 -11
  173. package/dist/sandbox/root/sandbox-root.css.js +3 -70
  174. package/dist/sandbox/root/sandbox-root.d.ts +16 -4
  175. package/dist/sandbox/root/sandbox-root.js +29 -50
  176. package/dist/sandbox/source/sandbox-source.css.js +3 -95
  177. package/dist/sandbox/source/sandbox-source.d.ts +31 -25
  178. package/dist/sandbox/source/sandbox-source.js +12 -5
  179. package/dist/sandbox/status-bar/sandbox-status-bar.css.js +1 -21
  180. package/dist/sandbox/terminal/sandbox-terminal.css.js +5 -106
  181. package/dist/sandbox/terminal/sandbox-terminal.d.ts +4 -0
  182. package/dist/sandbox/terminal/sandbox-terminal.js +2 -1
  183. package/dist/sandbox/tokens.d.ts +2 -2
  184. package/dist/sandbox/toolbar/sandbox-toolbar.css.js +1 -36
  185. package/dist/scatter-chart/root/scatter-chart-root.css.js +11 -146
  186. package/dist/scatter-chart/root/scatter-chart-root.d.ts +1 -0
  187. package/dist/scroll-area/root/scroll-area-root.css.js +14 -181
  188. package/dist/select/root/select-root.css.js +7 -124
  189. package/dist/select/root/select-root.js +2 -0
  190. package/dist/shared/chart/series.css.js +1 -36
  191. package/dist/shared/chart/terminus.css.js +1 -47
  192. package/dist/shared/chart/tooltip.css.js +1 -68
  193. package/dist/shared/collection/state.css.js +1 -9
  194. package/dist/shared/field/field-frame.css.js +3 -33
  195. package/dist/shared/field/field-inline.css.js +1 -4
  196. package/dist/shared/field/field-segments.css.js +1 -39
  197. package/dist/shared/field/field-stacked.css.js +1 -5
  198. package/dist/shared/field/field.css.js +3 -57
  199. package/dist/shared/floating/entrance.css.js +3 -34
  200. package/dist/shared/floating/panel.css.js +2 -17
  201. package/dist/shared/glyph/glyph.css.js +1 -5
  202. package/dist/shared/live/live.css.js +1 -8
  203. package/dist/shared/tags/tags.css.js +1 -39
  204. package/dist/shared/viewport/viewport.css.js +8 -135
  205. package/dist/skeleton/root/skeleton-root.css.js +12 -120
  206. package/dist/skip-link/root/skip-link-root.css.js +2 -47
  207. package/dist/slider/root/slider-root.css.js +19 -330
  208. package/dist/slider/root/slider-root.d.ts +2 -0
  209. package/dist/sparkline/root/sparkline-root.css.js +8 -143
  210. package/dist/sparkline/root/sparkline-root.d.ts +2 -0
  211. package/dist/speed-dial/group/speed-dial-group.css.d.ts +1 -0
  212. package/dist/speed-dial/group/speed-dial-group.css.js +2 -0
  213. package/dist/speed-dial/group/speed-dial-group.d.ts +27 -0
  214. package/dist/speed-dial/group/speed-dial-group.js +16 -0
  215. package/dist/speed-dial/index.d.ts +1 -0
  216. package/dist/speed-dial/index.js +1 -0
  217. package/dist/speed-dial/item/speed-dial-item.css.js +4 -73
  218. package/dist/speed-dial/item/speed-dial-item.d.ts +1 -0
  219. package/dist/speed-dial/root/speed-dial-root.css.js +3 -149
  220. package/dist/splitter/root/splitter-root.css.js +19 -176
  221. package/dist/splitter/root/splitter-root.d.ts +4 -0
  222. package/dist/stat/group/stat-group.css.js +1 -36
  223. package/dist/stat/root/stat-root.css.js +3 -62
  224. package/dist/steps/root/steps-root.css.js +7 -92
  225. package/dist/steps/step/step.css.js +5 -156
  226. package/dist/switch/root/switch-root.css.js +2 -110
  227. package/dist/table/cell/table-cell.css.js +1 -33
  228. package/dist/table/column/table-column.css.js +7 -105
  229. package/dist/table/root/table-root.css.js +1 -43
  230. package/dist/table/row/table-row.css.js +6 -18
  231. package/dist/table/row/table-row.d.ts +2 -0
  232. package/dist/tabs/panel/tab-panel.css.js +2 -17
  233. package/dist/tabs/root/tabs-root.css.js +6 -177
  234. package/dist/tabs/tab/tab.css.js +6 -54
  235. package/dist/tag/group/tag-group.css.js +1 -11
  236. package/dist/tag/root/tag-root.css.js +1 -166
  237. package/dist/tag/root/tag-root.d.ts +2 -0
  238. package/dist/text/root/text-root.css.js +11 -200
  239. package/dist/textarea/root/textarea-root.css.js +3 -71
  240. package/dist/time-input/root/time-input-root.css.js +7 -118
  241. package/dist/time-picker/root/time-picker-root.css.js +15 -134
  242. package/dist/time-picker/root/time-picker-root.d.ts +7 -0
  243. package/dist/timeline/group/timeline-group.css.js +1 -31
  244. package/dist/timeline/item/timeline-item.css.js +3 -134
  245. package/dist/timeline/root/timeline-root.css.js +1 -66
  246. package/dist/toast/item/toast-item.css.js +11 -250
  247. package/dist/toast/item/toast-item.d.ts +10 -0
  248. package/dist/toast/root/toast-root.css.js +1 -85
  249. package/dist/toast/root/toast-root.js +2 -1
  250. package/dist/toggle/group/toggle-group.css.js +7 -126
  251. package/dist/toggle/root/toggle-root.css.js +1 -23
  252. package/dist/toolbar/root/toolbar-root.css.js +1 -36
  253. package/dist/toolbar/root/toolbar-root.d.ts +11 -0
  254. package/dist/toolbar/root/toolbar-root.js +4 -0
  255. package/dist/tooltip/root/tooltip-root.css.js +5 -101
  256. package/dist/tooltip/root/tooltip-root.d.ts +2 -0
  257. package/dist/tour/root/tour-root.css.js +2 -28
  258. package/dist/tour/stop/tour-stop.css.js +2 -109
  259. package/dist/tree/item/tree-item.css.js +12 -238
  260. package/dist/tree/root/tree-root.css.js +1 -40
  261. package/dist/trend/root/trend-root.css.js +5 -53
  262. package/dist/video/root/video-root.css.js +16 -398
  263. package/dist/video-playlist/item/video-playlist-item.css.js +12 -86
  264. package/dist/video-playlist/item/video-playlist-item.d.ts +12 -0
  265. package/dist/video-playlist/menu/video-playlist-menu.css.js +1 -41
  266. package/dist/video-playlist/root/video-playlist-root.css.js +1 -19
  267. package/dist/video-playlist/root/video-playlist-root.d.ts +2 -0
  268. package/dist/virtual-list/root/virtual-list-root.css.js +3 -40
  269. package/lint.json +1 -1
  270. package/package.json +6 -6
  271. package/types/jsx.d.ts +4595 -777
  272. package/types/svelte.d.ts +2 -0
  273. package/types/vue.d.ts +1312 -210
@@ -1,126 +1,13 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
-
4
- --_rating-mark-size: var(--rating-size, var(--helix-size-icon-md));
5
- --_rating-mark-gap: var(--rating-gap, var(--helix-space-2xs));
6
-
7
- display: inline-flex;
8
- flex-direction: column;
9
- gap: var(--helix-space-2xs);
10
- }
11
-
12
- [part="field"] {
13
- align-items: center;
14
- display: inline-flex;
15
- gap: var(--helix-space-xs);
16
- }
17
-
18
- [part="marks"] {
19
- display: inline-flex;
20
- position: relative;
21
-
22
- touch-action: pan-y;
23
- }
24
-
25
- [part="track"],
26
- [part="fill"] {
27
- display: inline-flex;
28
- gap: var(--_rating-mark-gap);
29
- }
30
-
31
- [part="track"] {
32
- color: var(--rating-empty-color, var(--helix-color-border));
33
- }
34
-
35
- [part="fill"] {
36
- color: var(--rating-color, var(--helix-color-warning));
37
- inline-size: calc(
2
+ export const styles = createSheet(`:host {--_rating-mark-size: var(--rating-size, var(--helix-size-icon-md));--_rating-mark-gap: var(--rating-gap, var(--helix-space-2xs));display: inline-flex;flex-direction: column;gap: var(--helix-space-2xs);}[part="field"] {align-items: center;display: inline-flex;gap: var(--helix-space-xs);}[part="marks"] {display: inline-flex;position: relative;touch-action: pan-y;}[part="track"],
3
+ [part="fill"] {display: inline-flex;gap: var(--_rating-mark-gap);}[part="track"] {color: var(--rating-empty-color, var(--helix-color-border));}[part="fill"] {color: var(--rating-color, var(--helix-color-warning));inline-size: calc(
38
4
  var(--rating-full, 0) *
39
5
  (var(--_rating-mark-size) + var(--_rating-mark-gap)) +
40
6
  var(--rating-part, 0) *
41
7
  var(--_rating-mark-size)
42
- );
43
- inset-block: 0;
44
- inset-inline-start: 0;
45
- overflow: hidden;
46
- position: absolute;
47
- }
48
-
49
- [part="mark"] {
50
- --_rating-star: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2.6l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5L2.6 9.4l6.5-.9z"/></svg>');
51
-
52
- background-color: currentcolor;
53
- block-size: var(--_rating-mark-size);
54
- flex: 0 0 auto;
55
- inline-size: var(--_rating-mark-size);
56
- mask-image: var(--rating-mark, var(--_rating-star));
57
- mask-position: center;
58
- mask-repeat: no-repeat;
59
- mask-size: contain;
60
- }
61
-
62
- [part="option"] {
63
- all: unset;
64
- box-sizing: border-box;
65
-
66
- cursor: pointer;
67
- inset-block: 0;
68
- position: absolute;
69
- }
70
-
71
- [part="option"] {
72
- --_rating-pitch: calc((100% + var(--_rating-mark-gap)) / var(--rating-steps, 1));
73
-
74
- inline-size: var(--_rating-pitch);
75
- inset-inline-start: calc(
8
+ );inset-block: 0;inset-inline-start: 0;overflow: hidden;position: absolute;}[part="mark"] {--_rating-star: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2.6l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5L2.6 9.4l6.5-.9z"/></svg>');background-color: currentcolor;block-size: var(--_rating-mark-size);flex: 0 0 auto;inline-size: var(--_rating-mark-size);mask-image: var(--rating-mark, var(--_rating-star));mask-position: center;mask-repeat: no-repeat;mask-size: contain;}[part="option"] {all: unset;box-sizing: border-box;cursor: pointer;inset-block: 0;position: absolute;}[part="option"] {--_rating-pitch: calc((100% + var(--_rating-mark-gap)) / var(--rating-steps, 1));inline-size: var(--_rating-pitch);inset-inline-start: calc(
76
9
  (var(--rating-step, 1) - 1) *
77
10
  var(--_rating-pitch) -
78
11
  var(--_rating-mark-gap) /
79
12
  2
80
- );
81
- }
82
-
83
- [part="value"] {
84
- color: var(--helix-color-foreground-muted);
85
- font-size: var(--helix-text-sm);
86
- font-variant-numeric: tabular-nums;
87
- line-height: 1;
88
- }
89
-
90
- :host([shape="dots"]) {
91
- --_rating-mark-size: var(--rating-size, var(--helix-size-icon-sm));
92
- }
93
-
94
- :host([shape="dots"]) [part="mark"] {
95
- border-radius: var(--helix-radii-full);
96
- mask-image: none;
97
- }
98
-
99
- [part="option"]:focus-visible {
100
- border-radius: var(--helix-radii-sm);
101
- outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
102
- outline-offset: var(--helix-size-focus-offset);
103
- }
104
-
105
- :host(:disabled) [part="option"] {
106
- cursor: not-allowed;
107
- }
108
-
109
- :host(:disabled) [part="marks"] {
110
- opacity: 0.5;
111
- }
112
-
113
- :host([readonly]) [part="marks"] {
114
- cursor: default;
115
- }
116
-
117
- [data-slotted] [part="mark"] {
118
- background-color: transparent;
119
- mask-image: none;
120
- }
121
-
122
- @media print {
123
- :host {
124
- print-color-adjust: exact;
125
- }
126
- }`);
13
+ );}[part="value"] {color: var(--helix-color-foreground-muted);font-size: var(--helix-text-sm);font-variant-numeric: tabular-nums;line-height: 1;}:host([shape="dots"]) {--_rating-mark-size: var(--rating-size, var(--helix-size-icon-sm));}:host([shape="dots"]) [part="mark"] {border-radius: var(--helix-radii-full);mask-image: none;}[part="option"]:focus-visible {border-radius: var(--helix-radii-sm);outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}:host(:disabled) [part="option"] {cursor: not-allowed;}:host(:disabled) [part="marks"] {opacity: 0.5;}:host([readonly]) [part="marks"] {cursor: default;}[data-slotted] [part="mark"] {background-color: transparent;mask-image: none;}@media print {:host {print-color-adjust: exact;}}`);
@@ -51,7 +51,8 @@ export declare const loggedText: (value: unknown) => string;
51
51
  * - Writes each `helix-preview-render` into the root: the markup, the
52
52
  * stylesheet, the direction, the layout and the color mode. Scripts in the
53
53
  * markup run.
54
- * - Posts every console call and uncaught error as `helix-preview-console`.
54
+ * - Posts every console call and uncaught error as `helix-preview-console`,
55
+ * an uncaught one marked `uncaught`, which marks the preview `failed`.
55
56
  * - Posts `helix-preview-size` whenever what was drawn changes height.
56
57
  * - Posts `helix-preview-press` on every press, so menus outside close.
57
58
  *
@@ -71,7 +71,7 @@ export const servePreview = (options = {}) => {
71
71
  };
72
72
  }
73
73
  const failed = (event) => {
74
- post({ level: 'error', text: event.message, type: 'helix-preview-console' });
74
+ post({ level: 'error', text: event.message, type: 'helix-preview-console', uncaught: true });
75
75
  };
76
76
  const measure = () => {
77
77
  const boxes = [...root.children].flatMap(drawn);
@@ -18,5 +18,5 @@ export * from './root/sandbox-root.js';
18
18
  export * from './source/sandbox-source.js';
19
19
  export * from './status-bar/sandbox-status-bar.js';
20
20
  export * from './terminal/sandbox-terminal.js';
21
- export type { SandboxHighlight, SandboxToken } from './tokens.js';
21
+ export type { SandboxToken, SandboxTokenizer } from './tokens.js';
22
22
  export * from './toolbar/sandbox-toolbar.js';
@@ -1,13 +1,2 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
- display: block;
4
- min-block-size: 0;
5
- }
6
-
7
- [part="frame"] {
8
- background-color: var(--helix-color-background);
9
- block-size: 100%;
10
- border: none;
11
- display: block;
12
- inline-size: 100%;
13
- }`);
2
+ export const styles = createSheet(`:host {display: block;min-block-size: 0;}[part="frame"] {background-color: var(--helix-color-background);block-size: 100%;border: none;display: block;inline-size: 100%;}`);
@@ -19,6 +19,8 @@ export interface PreviewConsole {
19
19
  level: 'log' | 'info' | 'warn' | 'error';
20
20
  text: string;
21
21
  type: 'helix-preview-console';
22
+ /** Set for an error the example threw and did not catch, which marks the preview `failed`. */
23
+ uncaught?: boolean;
22
24
  }
23
25
  /**
24
26
  * A press inside the frame, which is the one event the page cannot see for
@@ -57,6 +59,13 @@ export type PreviewMessage = PreviewConsole | PreviewPress | PreviewReady | Prev
57
59
  * let a document on the same origin remove its own sandbox, which is the same
58
60
  * as having none.
59
61
  *
62
+ * **A preview says where it is.** It is `:state(loading)` from the moment it
63
+ * has a `src` until that document can take the example, and again through
64
+ * `reload()`. It is `:state(failed)` once the example throws an error it does
65
+ * not catch, until the next source is sent, which a frame on `servePreview`
66
+ * reports. A page draws its own spinner or message from either, such as a
67
+ * sibling shown by `helix-sandbox-preview:state(failed) + .message`.
68
+ *
60
69
  * @since 0.1.0
61
70
  * @status stable
62
71
  * @aliases Result, Output
@@ -66,6 +75,9 @@ export type PreviewMessage = PreviewConsole | PreviewPress | PreviewReady | Prev
66
75
  * @event {HelixResizeEvent} helix-resize - Fired when the height of the frame's content changes, with the new height.
67
76
  *
68
77
  * @csspart frame - The iframe.
78
+ *
79
+ * @cssstate failed - Since the example threw an error it did not catch, until the next source is sent.
80
+ * @cssstate loading - While the frame's document loads, until it can take the example.
69
81
  */
70
82
  export declare class HelixSandboxPreview extends HelixElement {
71
83
  /**
@@ -127,7 +139,9 @@ export declare class HelixSandboxPreview extends HelixElement {
127
139
  private ready;
128
140
  private get frame();
129
141
  /**
130
- * The frame's document has finished loading, so its listener exists.
142
+ * The frame's document has finished loading, so its listener exists, the
143
+ * example is sent and the preview is no longer `loading`. The frame saying
144
+ * `helix-preview-ready` lands here too.
131
145
  *
132
146
  * **The announcement is one shot and the parent can miss it.** The frame posts
133
147
  * `helix-preview-ready` at the end of its own module evaluation and never
@@ -180,8 +194,16 @@ export declare class HelixSandboxPreview extends HelixElement {
180
194
  * thing on the page already entitled to both.
181
195
  */
182
196
  private static readonly target;
183
- /** Set while a coalesced send is waiting, so only one is ever queued. */
184
- private pending;
197
+ /**
198
+ * Holds a coalesced send, so only one is ever queued, and drops it on
199
+ * disconnect.
200
+ *
201
+ * **It renders nothing**, so it asks for no update when its wait starts or
202
+ * ends. One that did sent the source at once from that update, ahead of the
203
+ * wait, and the send at the end of the wait then cleared `failed` after the
204
+ * error it should have reported.
205
+ */
206
+ private readonly settle;
185
207
  /**
186
208
  * Sends once the typing stops, replacing anything already waiting.
187
209
  *
@@ -211,6 +233,8 @@ export declare class HelixSandboxPreview extends HelixElement {
211
233
  * new document announces itself the same way the first one did.
212
234
  */
213
235
  reload(): void;
236
+ /** A new document is on its way, so nothing is sent until it listens, and nothing has failed in it. */
237
+ private unready;
214
238
  protected updated(changed: PropertyValues): void;
215
239
  protected render(): TemplateResult;
216
240
  static styles: CSSResultGroup;
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  var HelixSandboxPreview_1;
8
- import { customElement, HelixConsoleEvent, HelixElement, HelixResizeEvent, } from '@fusion.dev/helix-core';
8
+ import { customElement, DelayController, HelixConsoleEvent, HelixElement, HelixResizeEvent, } from '@fusion.dev/helix-core';
9
9
  const SETTLE = 120;
10
10
  import { html } from 'lit';
11
11
  import { property } from 'lit/decorators.js';
@@ -20,6 +20,7 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
20
20
  this.ready = false;
21
21
  this.handleFrameLoad = () => {
22
22
  this.ready = true;
23
+ this.toggleState('loading', false);
23
24
  this.send();
24
25
  };
25
26
  this.handleMessage = (event) => {
@@ -27,12 +28,14 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
27
28
  return;
28
29
  }
29
30
  if (event.data?.type === 'helix-preview-ready') {
30
- this.ready = true;
31
- this.send();
31
+ this.handleFrameLoad();
32
32
  return;
33
33
  }
34
34
  if (event.data?.type === 'helix-preview-console') {
35
35
  this.dispatchEvent(new HelixConsoleEvent({ level: event.data.level, text: event.data.text }));
36
+ if (event.data.uncaught) {
37
+ this.toggleState('failed', true);
38
+ }
36
39
  }
37
40
  if (event.data?.type === 'helix-preview-press') {
38
41
  this.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, composed: true }));
@@ -41,6 +44,7 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
41
44
  this.dispatchEvent(new HelixResizeEvent({ size: event.data.size }));
42
45
  }
43
46
  };
47
+ this.settle = new DelayController(this, { renders: false });
44
48
  }
45
49
  static { HelixSandboxPreview_1 = this; }
46
50
  get frame() {
@@ -48,11 +52,10 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
48
52
  }
49
53
  static { this.target = '*'; }
50
54
  scheduleSend() {
51
- clearTimeout(this.pending);
52
- this.pending = setTimeout(() => {
53
- this.pending = undefined;
55
+ this.settle.start(SETTLE, () => {
56
+ this.toggleState('failed', false);
54
57
  this.send();
55
- }, SETTLE);
58
+ });
56
59
  }
57
60
  send() {
58
61
  if (!this.ready) {
@@ -74,8 +77,6 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
74
77
  }
75
78
  disconnectedCallback() {
76
79
  super.disconnectedCallback();
77
- clearTimeout(this.pending);
78
- this.pending = undefined;
79
80
  window.removeEventListener('message', this.handleMessage);
80
81
  }
81
82
  reload() {
@@ -83,13 +84,18 @@ let HelixSandboxPreview = class HelixSandboxPreview extends HelixElement {
83
84
  if (!frame) {
84
85
  return;
85
86
  }
86
- this.ready = false;
87
+ this.unready();
87
88
  frame.src = this.src;
88
89
  }
90
+ unready() {
91
+ this.ready = false;
92
+ this.toggleState('failed', false);
93
+ this.toggleState('loading', this.src !== '');
94
+ }
89
95
  updated(changed) {
90
96
  super.updated(changed);
91
97
  if (changed.has('src')) {
92
- this.ready = false;
98
+ this.unready();
93
99
  return;
94
100
  }
95
101
  if (changed.has('source') || changed.has('styles')) {
@@ -1,71 +1,4 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
- background-color: var(--helix-color-background);
4
- display: grid;
5
- grid-template-rows: auto minmax(0, 1fr) auto;
6
- min-block-size: var(--sandbox-min-block-size, 20rem);
7
- overflow: hidden;
8
- }
9
-
10
- ::slotted([slot="toolbar"]) {
11
- grid-row: 1;
12
- }
13
-
14
- [part="body"] {
15
- grid-row: 2;
16
- }
17
-
18
- ::slotted([slot="status"]) {
19
- grid-row: 3;
20
- }
21
-
22
- [part="body"],
23
- [part="panes"] {
24
- --splitter-color: var(--sandbox-separator-color, var(--helix-color-border));
25
- --splitter-target: calc(var(--sandbox-grab, var(--helix-space-2xs)) * 2);
26
- min-block-size: 0;
27
- min-inline-size: 0;
28
- }
29
-
30
- [part="panes"] {
31
- block-size: 100%;
32
- }
33
-
34
- [part="body"]:not([data-panel])::part(separator) {
35
- display: none;
36
- }
37
-
38
- [part="body"]:not([data-panel])::part(corner) {
39
- display: none;
40
- }
41
-
42
- [part="pane"] {
43
- block-size: 100%;
44
- min-block-size: 0;
45
- min-inline-size: 0;
46
- overflow: hidden;
47
- }
48
-
49
- [part="panel"] {
50
- block-size: 100%;
51
- min-block-size: 0;
52
- overflow: hidden;
53
- }
54
-
55
- ::slotted([slot="panel"]) {
56
- block-size: 100%;
57
- min-block-size: 0;
58
- }
59
-
60
- ::slotted(helix-sandbox-preview) {
61
- background-color: var(--helix-color-background);
62
- block-size: 100%;
63
- color: var(--helix-color-foreground);
64
- display: block;
65
- }
66
-
67
- @media print {
68
- :host {
69
- display: none;
70
- }
71
- }`);
2
+ export const styles = createSheet(`:host {background-color: var(--helix-color-background);display: grid;grid-template-rows: auto minmax(0, 1fr) auto;min-block-size: var(--sandbox-min-block-size, 20rem);overflow: hidden;}::slotted([slot="toolbar"]) {grid-row: 1;}[part="body"] {grid-row: 2;}::slotted([slot="status"]) {grid-row: 3;}[part="body"],
3
+ [part="panes"] {--splitter-color: var(--sandbox-separator-color, var(--helix-color-border));--splitter-target: calc(var(--sandbox-grab, var(--helix-space-2xs)) * 2);min-block-size: 0;min-inline-size: 0;}[part="panes"] {block-size: 100%;}[part="body"]:not([data-panel])::part(corner),
4
+ [part="body"]:not([data-panel])::part(separator) {display: none;}[part="pane"] {block-size: 100%;min-block-size: 0;min-inline-size: 0;overflow: hidden;}[part="panel"] {block-size: 100%;min-block-size: 0;overflow: hidden;}::slotted([slot="panel"]) {block-size: 100%;min-block-size: 0;}::slotted(helix-sandbox-preview) {background-color: var(--helix-color-background);block-size: 100%;color: var(--helix-color-foreground);display: block;}@media print {:host {display: none;}}`);
@@ -41,16 +41,18 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
41
41
  * @event {HelixResizeEvent} helix-resize - Fired by the preview pane when the height of the frame's content changes, with the new height.
42
42
  * @event {HelixSplitEvent} helix-split - Fired after the panes' divider settled somewhere new, with the lead pane's share.
43
43
  *
44
- * @csspart body - The splitter holding the panes above the panel.
44
+ * @csspart body - The splitter holding the panes above the panel. `::part(body):state(dragging)` matches while its divider is held.
45
45
  * @csspart corner - The handle where the two dividers cross.
46
46
  * @csspart pane - Either pane.
47
47
  * @csspart panel - The box that holds the slotted panel.
48
- * @csspart panes - The splitter holding the source and preview panes.
48
+ * @csspart panes - The splitter holding the source and preview panes. `::part(panes):state(dragging)` matches while its divider is held.
49
49
  * @csspart separator - Either divider.
50
50
  *
51
51
  * @cssproperty --sandbox-grab - The invisible width of a divider's drag target.
52
52
  * @cssproperty --sandbox-min-block-size - Minimum height of the sandbox.
53
53
  * @cssproperty --sandbox-separator-color - Color of the divider.
54
+ *
55
+ * @cssstate panel-collapsed - While there is a panel and it is no taller than `panel-collapsed-size`.
54
56
  */
55
57
  export declare class HelixSandbox extends HelixElement {
56
58
  /**
@@ -176,8 +178,12 @@ export declare class HelixSandbox extends HelixElement {
176
178
  * back into the position that answered it.
177
179
  */
178
180
  private readonly watch;
179
- /** The panel as a share of the body, which is what the splitter takes. */
180
- private get panelShare();
181
+ /**
182
+ * A panel height as a share of the body, which is what the splitter takes,
183
+ * held to what the panel may have. A height that is no number is the
184
+ * default one.
185
+ */
186
+ private shareOf;
181
187
  /**
182
188
  * Where the outer divider goes: everything the panel is not.
183
189
  *
@@ -305,6 +311,12 @@ export declare class HelixSandbox extends HelixElement {
305
311
  private requestSplit;
306
312
  /** As `requestSplit`, for the panel, whose value is pixels rather than a share. */
307
313
  private requestPanelSize;
314
+ /**
315
+ * Takes a request a splitter of this sandbox made for itself, stopped and
316
+ * refused, and gives its value. Gives nothing for one that came up from
317
+ * something slotted into a pane, which passes through untouched.
318
+ */
319
+ private claim;
308
320
  /**
309
321
  * Answers a divider that has asked to move.
310
322
  *
@@ -74,54 +74,42 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
74
74
  }
75
75
  };
76
76
  this.handlePanesChange = (event) => {
77
- if (event.target !== event.currentTarget) {
77
+ const value = this.claim(event);
78
+ if (value === undefined) {
78
79
  return;
79
80
  }
80
- const { value } = event.detail;
81
- event.stopPropagation();
82
- event.preventDefault();
83
81
  this.requestSplit(Number(value));
84
82
  this.answer(event.currentTarget, this.split);
85
83
  };
86
84
  this.handlePanelChange = (event) => {
87
- if (event.target !== event.currentTarget) {
85
+ const value = this.claim(event);
86
+ if (value === undefined) {
88
87
  return;
89
88
  }
90
- const { value } = event.detail;
91
- event.stopPropagation();
92
- event.preventDefault();
93
89
  if (this.bodyHeight > 0) {
94
90
  this.requestPanelSize(Math.max(this.panelFloor, ((100 - Number(value)) / 100) * this.bodyHeight));
95
91
  }
96
92
  this.answer(event.currentTarget, this.panelPosition);
97
93
  };
98
94
  this.handleCollapse = (event) => {
99
- if (event.target !== event.currentTarget) {
100
- return;
101
- }
102
- event.stopPropagation();
103
- event.preventDefault();
95
+ this.claim(event);
104
96
  };
105
97
  this.readPanel = () => {
106
98
  this.hasPanel = this.querySelector(':scope > [slot="panel"]') !== null;
107
99
  };
108
100
  }
109
- get panelShare() {
110
- const size = Number.isFinite(this.panelSize) ? this.panelSize : DEFAULT_PANEL;
101
+ shareOf(size) {
111
102
  if (this.bodyHeight <= 0) {
112
103
  return 0;
113
104
  }
114
- return Math.min(PANEL_MAX * 100, Math.max(0, (size / this.bodyHeight) * 100));
105
+ const panel = Number.isFinite(size) ? size : DEFAULT_PANEL;
106
+ return Math.min(PANEL_MAX * 100, Math.max(0, (panel / this.bodyHeight) * 100));
115
107
  }
116
108
  get panelPosition() {
117
- return this.hasPanel ? 100 - this.panelShare : 100;
109
+ return this.hasPanel ? 100 - this.shareOf(this.panelSize) : 100;
118
110
  }
119
111
  get homePanelPosition() {
120
- const panel = Number.isFinite(this.defaultPanelSize) ? this.defaultPanelSize : DEFAULT_PANEL;
121
- if (!this.hasPanel || this.bodyHeight <= 0) {
122
- return 100;
123
- }
124
- return 100 - Math.min(PANEL_MAX * 100, Math.max(0, (panel / this.bodyHeight) * 100));
112
+ return this.hasPanel ? 100 - this.shareOf(this.defaultPanelSize) : 100;
125
113
  }
126
114
  get panelSliver() {
127
115
  if (this.bodyHeight <= 0) {
@@ -176,7 +164,6 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
176
164
  if (accepted && this.split !== was) {
177
165
  this.dispatchEvent(new HelixSplitEvent({ value: String(this.split) }));
178
166
  }
179
- return accepted;
180
167
  }
181
168
  requestPanelSize(next) {
182
169
  const was = this.panelSize;
@@ -191,7 +178,14 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
191
178
  if (accepted && this.panelSize !== was) {
192
179
  this.dispatchEvent(new HelixPanelResizeEvent({ value: String(this.panelSize) }));
193
180
  }
194
- return accepted;
181
+ }
182
+ claim(event) {
183
+ if (event.target !== event.currentTarget) {
184
+ return undefined;
185
+ }
186
+ event.stopPropagation();
187
+ event.preventDefault();
188
+ return event.detail.value;
195
189
  }
196
190
  answer(divider, position) {
197
191
  const target = divider;
@@ -224,6 +218,7 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
224
218
  if (!this.hasUpdated && this.childrenKnown) {
225
219
  this.readPanel();
226
220
  }
221
+ this.toggleState('panel-collapsed', this.hasPanel && this.panelSize <= this.panelCollapsedSize);
227
222
  if (!this.hasUpdated || typeof this.renderRoot?.querySelector !== 'function') {
228
223
  return;
229
224
  }
@@ -253,33 +248,17 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
253
248
  const first = this.lead === 'preview' ? 'preview' : 'source';
254
249
  const second = first === 'preview' ? 'source' : 'preview';
255
250
  const split = Number.isFinite(this.split) ? this.split : DEFAULT_SPLIT;
251
+ const home = Number.isFinite(this.defaultSplit) ? this.defaultSplit : DEFAULT_SPLIT;
252
+ const label = this.separatorLabel || (first === 'preview' ? 'Resize preview pane' : 'Resize source pane');
256
253
  return html `<slot name="toolbar"></slot>
257
- <helix-splitter
258
- part="body"
259
- ?data-panel=${this.hasPanel}
260
- exportparts="separator, corner"
261
- orientation="vertical"
262
- collapsed-size=${this.panelSliver}
263
- corner-label=${this.cornerLabel}
264
- label=${this.panelLabel}
265
- default-position=${this.homePanelPosition}
266
- min=${100 - PANEL_MAX * 100}
267
- .position=${this.panelPosition}
268
- @helix-before-collapse=${this.handleCollapse}
269
- @helix-before-resize=${this.handlePanelChange}
270
- >
271
- <helix-splitter
272
- slot="start"
273
- part="panes"
274
- exportparts="separator"
275
- default-position=${Number.isFinite(this.defaultSplit) ? this.defaultSplit : DEFAULT_SPLIT}
276
- label=${this.separatorLabel || (first === 'preview' ? 'Resize preview pane' : 'Resize source pane')}
277
- orientation=${vertical ? 'vertical' : 'horizontal'}
278
- .position=${split}
279
- @helix-before-collapse=${this.handleCollapse}
280
- @helix-before-resize=${this.handlePanesChange}
281
- >
282
- ${''}
254
+ <helix-splitter part="body" ?data-panel=${this.hasPanel} exportparts="separator, corner"
255
+ orientation="vertical" collapsed-size=${this.panelSliver} corner-label=${this.cornerLabel}
256
+ label=${this.panelLabel} default-position=${this.homePanelPosition}
257
+ min=${100 - PANEL_MAX * 100} .position=${this.panelPosition}
258
+ @helix-before-collapse=${this.handleCollapse} @helix-before-resize=${this.handlePanelChange}>
259
+ <helix-splitter slot="start" part="panes" exportparts="separator" default-position=${home}
260
+ label=${label} orientation=${vertical ? 'vertical' : 'horizontal'} .position=${split}
261
+ @helix-before-collapse=${this.handleCollapse} @helix-before-resize=${this.handlePanesChange}>
283
262
  <div part="pane" data-pane=${first} slot="start"><slot name=${first} @slotchange=${this.seed}></slot></div>
284
263
  <div part="pane" data-pane=${second} slot="end"><slot name=${second} @slotchange=${this.seed}></slot></div>
285
264
  </helix-splitter>