@fusion.dev/helix 0.146.0 → 0.147.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 (243) hide show
  1. package/custom-elements.json +5556 -539
  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/breadcrumbs/breadcrumb/breadcrumb.css.js +13 -98
  19. package/dist/breadcrumbs/root/breadcrumbs-root.css.js +5 -42
  20. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +17 -0
  21. package/dist/breadcrumbs/root/breadcrumbs-root.js +4 -0
  22. package/dist/button/root/button-root.css.js +16 -197
  23. package/dist/button/root/button-root.d.ts +1 -0
  24. package/dist/button-group/root/button-group-root.css.js +2 -52
  25. package/dist/callout/root/callout-root.css.js +5 -138
  26. package/dist/callout/root/callout-root.d.ts +4 -2
  27. package/dist/canvas/node/canvas-node.css.js +10 -367
  28. package/dist/canvas/root/canvas-root.css.js +7 -270
  29. package/dist/card/root/card-root.css.js +5 -134
  30. package/dist/carousel/root/carousel-root.css.js +20 -386
  31. package/dist/chat/composer/chat-composer.css.js +4 -105
  32. package/dist/chat/message/chat-message.css.js +5 -239
  33. package/dist/chat/message/chat-message.d.ts +5 -0
  34. package/dist/chat/root/chat-root.css.js +5 -162
  35. package/dist/chat/typing.css.js +9 -46
  36. package/dist/checkbox/root/checkbox-root.css.js +12 -177
  37. package/dist/checkbox-group/root/checkbox-group-root.css.js +1 -27
  38. package/dist/code/root/code-root.css.js +3 -25
  39. package/dist/code-block/root/code-block-root.css.js +9 -274
  40. package/dist/color-input/root/color-input-root.css.js +5 -114
  41. package/dist/color-picker/root/color-picker-root.css.js +39 -337
  42. package/dist/color-picker/root/color-picker-root.d.ts +2 -0
  43. package/dist/combobox/root/combobox-root.css.js +8 -147
  44. package/dist/command/root/command-root.css.js +3 -74
  45. package/dist/copy-button/root/copy-button-root.css.js +3 -43
  46. package/dist/data-table/root/data-table-root.css.js +21 -245
  47. package/dist/data-table/root/data-table-root.d.ts +7 -0
  48. package/dist/date-input/root/date-input-root.css.js +8 -103
  49. package/dist/date-picker/root/date-picker-root.css.js +16 -278
  50. package/dist/date-picker/root/date-picker-root.d.ts +1 -0
  51. package/dist/description-list/item/description-list-item.css.js +1 -41
  52. package/dist/description-list/item/description-list-item.d.ts +7 -0
  53. package/dist/description-list/root/description-list-root.css.js +1 -34
  54. package/dist/description-list/root/description-list-root.d.ts +1 -0
  55. package/dist/dialog/root/dialog-root.css.js +7 -221
  56. package/dist/dialog/root/dialog-root.d.ts +3 -0
  57. package/dist/divider/root/divider-root.css.js +6 -81
  58. package/dist/donut-chart/root/donut-chart-root.css.js +7 -193
  59. package/dist/drawer/root/drawer-root.css.js +11 -237
  60. package/dist/drilldown/item/drilldown-item.css.js +4 -51
  61. package/dist/drilldown/item/drilldown-item.d.ts +1 -0
  62. package/dist/drilldown/root/drilldown-root.css.js +6 -120
  63. package/dist/element-events.generated.js +4 -1
  64. package/dist/empty/root/empty-root.css.js +2 -42
  65. package/dist/file-input/root/file-input-root.css.js +7 -173
  66. package/dist/file-input/root/file-input-root.d.ts +4 -0
  67. package/dist/filter-input/chip/filter-chip.css.js +2 -84
  68. package/dist/filter-input/field/filter-field.css.js +1 -3
  69. package/dist/filter-input/menu/filter-menu.css.js +1 -3
  70. package/dist/filter-input/operator/filter-operator.css.js +1 -3
  71. package/dist/filter-input/root/filter-input-root.css.js +6 -113
  72. package/dist/flex/root/flex-root.css.js +4 -207
  73. package/dist/flex/root/flex-root.d.ts +2 -2
  74. package/dist/format-date/root/format-date-root.css.js +1 -13
  75. package/dist/graph/root/graph-root.css.js +9 -444
  76. package/dist/grid/root/grid-root.css.js +1 -171
  77. package/dist/heatmap/root/heatmap-root.css.js +8 -156
  78. package/dist/heatmap/root/heatmap-root.d.ts +2 -0
  79. package/dist/icon/index.d.ts +1 -1
  80. package/dist/icon/root/icon-root.css.js +1 -18
  81. package/dist/icon/root/index.d.ts +1 -1
  82. package/dist/icon-button/root/icon-button-root.css.js +25 -203
  83. package/dist/icon-button/root/icon-button-root.d.ts +1 -0
  84. package/dist/image/root/image-root.css.js +7 -65
  85. package/dist/image/root/image-root.d.ts +3 -0
  86. package/dist/input/root/input-root.css.js +6 -79
  87. package/dist/kbd/root/kbd-root.css.js +2 -71
  88. package/dist/kbd/root/kbd-root.d.ts +7 -0
  89. package/dist/legend/root/legend-root.css.js +9 -106
  90. package/dist/legend/root/legend-root.d.ts +2 -0
  91. package/dist/lightbox/item/lightbox-item.css.js +1 -37
  92. package/dist/lightbox/root/lightbox-root.css.js +38 -183
  93. package/dist/line-chart/root/line-chart-root.css.js +4 -170
  94. package/dist/line-chart/root/line-chart-root.d.ts +1 -0
  95. package/dist/list/item/list-item.css.js +2 -94
  96. package/dist/list/root/list-root.css.js +4 -88
  97. package/dist/listbox/root/listbox-root.css.js +4 -111
  98. package/dist/loader/root/loader-root.css.js +5 -171
  99. package/dist/map/area/map-area.css.js +1 -23
  100. package/dist/map/buildings/map-buildings.css.js +1 -26
  101. package/dist/map/contours/map-contours.css.js +2 -5
  102. package/dist/map/landcover/map-landcover.css.js +1 -4
  103. package/dist/map/marker/map-marker.css.js +14 -327
  104. package/dist/map/points/map-points.css.js +1 -86
  105. package/dist/map/position/map-position.css.js +8 -227
  106. package/dist/map/raster/map-raster.css.js +1 -3
  107. package/dist/map/root/map-root.css.js +10 -352
  108. package/dist/map/route/map-route.css.js +1 -24
  109. package/dist/map/terrain/map-terrain.css.js +3 -7
  110. package/dist/megamenu/root/megamenu-root.css.js +11 -162
  111. package/dist/megamenu/root/megamenu-root.d.ts +8 -0
  112. package/dist/menu/item/menu-item.css.js +7 -130
  113. package/dist/menu/root/menu-root.css.js +1 -110
  114. package/dist/menu/section/menu-section.css.js +1 -13
  115. package/dist/meter/root/meter-root.css.js +17 -207
  116. package/dist/meter/root/meter-root.d.ts +3 -0
  117. package/dist/navigation/root/navigation-root.css.js +2 -54
  118. package/dist/notifications/group/notification-group.css.js +1 -61
  119. package/dist/notifications/notification/notification.css.js +17 -264
  120. package/dist/notifications/root/notifications-root.css.js +7 -125
  121. package/dist/notifications/root/notifications-root.d.ts +3 -1
  122. package/dist/number-input/root/number-input-root.css.js +10 -103
  123. package/dist/object-inspector/root/object-inspector-root.css.js +11 -162
  124. package/dist/option/group/option-group.css.js +1 -22
  125. package/dist/option/index.d.ts +1 -0
  126. package/dist/option/index.js +1 -0
  127. package/dist/option/root/option-root.css.js +3 -85
  128. package/dist/option/separator/option-separator.css.d.ts +1 -0
  129. package/dist/option/separator/option-separator.css.js +3 -0
  130. package/dist/option/separator/option-separator.d.ts +26 -0
  131. package/dist/option/separator/option-separator.js +16 -0
  132. package/dist/orb/root/orb-root.css.js +1 -41
  133. package/dist/outline/root/outline-root.css.js +24 -122
  134. package/dist/outline/root/outline-root.d.ts +17 -4
  135. package/dist/pagination/root/pagination-root.css.js +9 -105
  136. package/dist/pagination/size/pagination-size.css.js +1 -22
  137. package/dist/pagination/summary/pagination-summary.css.js +1 -7
  138. package/dist/pin-input/root/pin-input-root.css.js +2 -73
  139. package/dist/pin-input/root/pin-input-root.d.ts +9 -3
  140. package/dist/popover/root/popover-root.css.js +6 -127
  141. package/dist/progress/root/progress-root.css.js +7 -230
  142. package/dist/progress/root/progress-root.d.ts +4 -0
  143. package/dist/qr-code/root/qr-code-root.css.js +1 -68
  144. package/dist/quote/root/quote-root.css.js +1 -20
  145. package/dist/radio/group/radio-group.css.js +1 -21
  146. package/dist/radio/root/radio-root.css.js +5 -208
  147. package/dist/rating/root/rating-root.css.js +4 -117
  148. package/dist/sandbox/frame.d.ts +2 -1
  149. package/dist/sandbox/frame.js +1 -1
  150. package/dist/sandbox/index.d.ts +1 -1
  151. package/dist/sandbox/preview/sandbox-preview.css.js +1 -12
  152. package/dist/sandbox/preview/sandbox-preview.d.ts +19 -3
  153. package/dist/sandbox/preview/sandbox-preview.js +17 -11
  154. package/dist/sandbox/root/sandbox-root.css.js +3 -70
  155. package/dist/sandbox/root/sandbox-root.d.ts +16 -4
  156. package/dist/sandbox/root/sandbox-root.js +29 -50
  157. package/dist/sandbox/source/sandbox-source.css.js +3 -95
  158. package/dist/sandbox/source/sandbox-source.d.ts +31 -25
  159. package/dist/sandbox/source/sandbox-source.js +12 -5
  160. package/dist/sandbox/status-bar/sandbox-status-bar.css.js +1 -21
  161. package/dist/sandbox/terminal/sandbox-terminal.css.js +5 -106
  162. package/dist/sandbox/terminal/sandbox-terminal.d.ts +4 -0
  163. package/dist/sandbox/terminal/sandbox-terminal.js +2 -1
  164. package/dist/sandbox/tokens.d.ts +2 -2
  165. package/dist/sandbox/toolbar/sandbox-toolbar.css.js +1 -36
  166. package/dist/scatter-chart/root/scatter-chart-root.css.js +11 -146
  167. package/dist/scatter-chart/root/scatter-chart-root.d.ts +1 -0
  168. package/dist/scroll-area/root/scroll-area-root.css.js +14 -181
  169. package/dist/select/root/select-root.css.js +4 -124
  170. package/dist/shared/chart/series.css.js +1 -36
  171. package/dist/shared/chart/terminus.css.js +1 -47
  172. package/dist/shared/chart/tooltip.css.js +1 -68
  173. package/dist/shared/collection/state.css.js +1 -9
  174. package/dist/shared/field/field-frame.css.js +3 -33
  175. package/dist/shared/field/field-inline.css.js +1 -4
  176. package/dist/shared/field/field-segments.css.js +1 -39
  177. package/dist/shared/field/field-stacked.css.js +1 -5
  178. package/dist/shared/field/field.css.js +3 -57
  179. package/dist/shared/floating/entrance.css.js +3 -34
  180. package/dist/shared/floating/panel.css.js +2 -17
  181. package/dist/shared/glyph/glyph.css.js +1 -5
  182. package/dist/shared/live/live.css.js +1 -8
  183. package/dist/shared/tags/tags.css.js +1 -39
  184. package/dist/shared/viewport/viewport.css.js +8 -135
  185. package/dist/skeleton/root/skeleton-root.css.js +12 -120
  186. package/dist/skip-link/root/skip-link-root.css.js +2 -47
  187. package/dist/slider/root/slider-root.css.js +19 -330
  188. package/dist/slider/root/slider-root.d.ts +2 -0
  189. package/dist/sparkline/root/sparkline-root.css.js +8 -143
  190. package/dist/sparkline/root/sparkline-root.d.ts +2 -0
  191. package/dist/speed-dial/item/speed-dial-item.css.js +4 -73
  192. package/dist/speed-dial/root/speed-dial-root.css.js +3 -149
  193. package/dist/splitter/root/splitter-root.css.js +11 -176
  194. package/dist/stat/group/stat-group.css.js +1 -36
  195. package/dist/stat/root/stat-root.css.js +3 -62
  196. package/dist/steps/root/steps-root.css.js +7 -92
  197. package/dist/steps/step/step.css.js +5 -156
  198. package/dist/switch/root/switch-root.css.js +2 -110
  199. package/dist/table/cell/table-cell.css.js +1 -33
  200. package/dist/table/column/table-column.css.js +7 -105
  201. package/dist/table/root/table-root.css.js +1 -43
  202. package/dist/table/row/table-row.css.js +6 -18
  203. package/dist/table/row/table-row.d.ts +2 -0
  204. package/dist/tabs/panel/tab-panel.css.js +2 -17
  205. package/dist/tabs/root/tabs-root.css.js +6 -177
  206. package/dist/tabs/tab/tab.css.js +6 -54
  207. package/dist/tag/group/tag-group.css.js +1 -11
  208. package/dist/tag/root/tag-root.css.js +1 -166
  209. package/dist/tag/root/tag-root.d.ts +2 -0
  210. package/dist/text/root/text-root.css.js +11 -200
  211. package/dist/textarea/root/textarea-root.css.js +3 -71
  212. package/dist/time-input/root/time-input-root.css.js +7 -118
  213. package/dist/time-picker/root/time-picker-root.css.js +10 -134
  214. package/dist/time-picker/root/time-picker-root.d.ts +1 -0
  215. package/dist/timeline/group/timeline-group.css.js +1 -31
  216. package/dist/timeline/item/timeline-item.css.js +3 -134
  217. package/dist/timeline/root/timeline-root.css.js +1 -66
  218. package/dist/toast/item/toast-item.css.js +8 -250
  219. package/dist/toast/root/toast-root.css.js +1 -85
  220. package/dist/toast/root/toast-root.js +2 -1
  221. package/dist/toggle/group/toggle-group.css.js +7 -126
  222. package/dist/toggle/root/toggle-root.css.js +1 -23
  223. package/dist/toolbar/root/toolbar-root.css.js +1 -36
  224. package/dist/toolbar/root/toolbar-root.d.ts +2 -0
  225. package/dist/tooltip/root/tooltip-root.css.js +5 -101
  226. package/dist/tooltip/root/tooltip-root.d.ts +2 -0
  227. package/dist/tour/root/tour-root.css.js +2 -28
  228. package/dist/tour/stop/tour-stop.css.js +2 -109
  229. package/dist/tree/item/tree-item.css.js +12 -238
  230. package/dist/tree/root/tree-root.css.js +1 -40
  231. package/dist/trend/root/trend-root.css.js +5 -53
  232. package/dist/video/root/video-root.css.js +16 -398
  233. package/dist/video-playlist/item/video-playlist-item.css.js +12 -86
  234. package/dist/video-playlist/item/video-playlist-item.d.ts +12 -0
  235. package/dist/video-playlist/menu/video-playlist-menu.css.js +1 -41
  236. package/dist/video-playlist/root/video-playlist-root.css.js +1 -19
  237. package/dist/video-playlist/root/video-playlist-root.d.ts +2 -0
  238. package/dist/virtual-list/root/virtual-list-root.css.js +3 -40
  239. package/lint.json +1 -1
  240. package/package.json +6 -6
  241. package/types/jsx.d.ts +2804 -619
  242. package/types/svelte.d.ts +1 -0
  243. package/types/vue.d.ts +810 -169
@@ -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>
@@ -1,96 +1,4 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
- display: block;
4
- block-size: 100%;
5
- }
6
-
7
- [part="source"] {
8
- background-color: var(--sandbox-source-background-color, var(--helix-color-background));
9
- block-size: 100%;
10
- border: none;
11
- color: var(--helix-color-foreground-muted);
12
- display: block;
13
- font-family: var(--helix-font-mono);
14
- font-size: var(--helix-text-xs);
15
- inline-size: 100%;
16
- line-height: var(--helix-leading-normal);
17
- min-block-size: var(--sandbox-source-min-block-size, 12rem);
18
- padding: var(--helix-space-sm);
19
- resize: none;
20
- tab-size: 2;
21
- }
22
-
23
- [part="source"]:focus-visible {
24
- background-color: var(--helix-color-surface);
25
- outline: none;
26
- }
27
-
28
- [part="field"] {
29
- background-color: var(--sandbox-source-background-color, var(--helix-color-background));
30
- block-size: 100%;
31
- display: grid;
32
- grid-template-rows: minmax(max-content, auto);
33
- overflow: auto;
34
- }
35
-
36
- [part="field"]:focus-within {
37
- background-color: var(--helix-color-surface);
38
- }
39
-
40
- [part="field"] > [part="highlight"],
41
- [part="field"] > [part="source"] {
42
- border: none;
43
- box-sizing: border-box;
44
- font-family: var(--helix-font-mono);
45
- font-size: var(--helix-text-xs);
46
- grid-area: 1 / 1;
47
- inline-size: 100%;
48
- letter-spacing: normal;
49
- line-height: var(--helix-leading-normal);
50
- margin: 0;
51
- min-block-size: var(--sandbox-source-min-block-size, 12rem);
52
- overflow-wrap: break-word;
53
- padding: var(--helix-space-sm);
54
- tab-size: 2;
55
- white-space: pre-wrap;
56
- }
57
-
58
- [part="field"] > [part="highlight"] {
59
- color: var(--helix-color-foreground-muted);
60
- }
61
-
62
- [part="field"] > [part="source"],
63
- [part="field"] > [part="source"]:focus-visible {
64
- -webkit-text-fill-color: transparent;
65
- align-self: stretch;
66
- background-color: transparent;
67
- block-size: auto;
68
- caret-color: var(--helix-color-foreground);
69
- color: transparent;
70
- overflow: hidden;
71
- }
72
-
73
- [part="token"][data-kind="callable"] {
74
- color: var(--sandbox-source-callable-color, var(--helix-color-syntax-callable));
75
- }
76
- [part="token"][data-kind="comment"] {
77
- color: var(--sandbox-source-comment-color, var(--helix-color-syntax-comment));
78
- }
79
- [part="token"][data-kind="constant"] {
80
- color: var(--sandbox-source-constant-color, var(--helix-color-syntax-constant));
81
- }
82
- [part="token"][data-kind="invalid"] {
83
- color: var(--sandbox-source-invalid-color, var(--helix-color-syntax-invalid));
84
- }
85
- [part="token"][data-kind="keyword"] {
86
- color: var(--sandbox-source-keyword-color, var(--helix-color-syntax-keyword));
87
- }
88
- [part="token"][data-kind="name"] {
89
- color: var(--sandbox-source-name-color, var(--helix-color-syntax-name));
90
- }
91
- [part="token"][data-kind="string"] {
92
- color: var(--sandbox-source-string-color, var(--helix-color-syntax-string));
93
- }
94
- [part="token"][data-kind="tag"] {
95
- color: var(--sandbox-source-tag-color, var(--helix-color-syntax-tag));
96
- }`);
2
+ export const styles = createSheet(`:host {display: block;block-size: 100%;}[part="highlight"],
3
+ [part="source"] {border: none;color: var(--helix-color-foreground-muted);font-family: var(--helix-font-mono);font-size: var(--helix-text-xs);inline-size: 100%;line-height: var(--helix-leading-normal);min-block-size: var(--sandbox-source-min-block-size, 12rem);padding: var(--helix-space-sm);tab-size: 2;}[part="source"] {background-color: var(--sandbox-source-background-color, var(--helix-color-background));block-size: 100%;display: block;resize: none;}[part="source"]:focus-visible {background-color: var(--helix-color-surface);outline: none;}[part="field"] {background-color: var(--sandbox-source-background-color, var(--helix-color-background));block-size: 100%;display: grid;grid-template-rows: minmax(max-content, auto);overflow: auto;}[part="field"]:focus-within {background-color: var(--helix-color-surface);}[part="field"] > [part] {grid-area: 1 / 1;letter-spacing: normal;margin: 0;overflow-wrap: break-word;white-space: pre-wrap;}[part="field"] > [part="source"],
4
+ [part="field"] > [part="source"]:focus-visible {-webkit-text-fill-color: transparent;align-self: stretch;background-color: transparent;block-size: auto;caret-color: var(--helix-color-foreground);color: transparent;overflow: hidden;}[data-kind="callable"] {color: var(--sandbox-source-callable-color, var(--helix-color-syntax-callable));}[data-kind="comment"] {color: var(--sandbox-source-comment-color, var(--helix-color-syntax-comment));}[data-kind="constant"] {color: var(--sandbox-source-constant-color, var(--helix-color-syntax-constant));}[data-kind="invalid"] {color: var(--sandbox-source-invalid-color, var(--helix-color-syntax-invalid));}[data-kind="keyword"] {color: var(--sandbox-source-keyword-color, var(--helix-color-syntax-keyword));}[data-kind="name"] {color: var(--sandbox-source-name-color, var(--helix-color-syntax-name));}[data-kind="string"] {color: var(--sandbox-source-string-color, var(--helix-color-syntax-string));}[data-kind="tag"] {color: var(--sandbox-source-tag-color, var(--helix-color-syntax-tag));}`);
@@ -1,6 +1,6 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import type { CSSResultGroup, TemplateResult } from 'lit';
3
- import { type SandboxHighlight } from '../tokens.js';
3
+ import { type SandboxTokenizer } from '../tokens.js';
4
4
  /**
5
5
  * @summary An editable source pane for a sandbox preview.
6
6
  *
@@ -12,7 +12,7 @@ import { type SandboxHighlight } from '../tokens.js';
12
12
  * field, press Escape and then Tab. Shift+Tab moves focus back as it does
13
13
  * anywhere else. The field's description says so to a screen reader.
14
14
  *
15
- * **`highlight` colors the source** with a highlighter you bring, such as one
15
+ * **`tokenize` colors the source** with a highlighter you bring, such as one
16
16
  * built on Lezer, Prism or Shiki. It is a function from the source to runs of
17
17
  * text, each with an optional kind, and the pane draws the runs under a
18
18
  * transparent field, so typing, selection and undo stay the textarea's. The
@@ -20,7 +20,9 @@ import { type SandboxHighlight } from '../tokens.js';
20
20
  * `string` and `tag`, each colored by the `--helix-color-syntax-*` token of
21
21
  * its name and a hook of its own, such as `--sandbox-source-keyword-color`.
22
22
  * A run of any other kind is drawn in the field's own color. Every run with a
23
- * kind is a `token` part, and carries its kind as `data-kind`.
23
+ * kind is a `token` part, and carries its kind as `data-kind`. A `tokenize`
24
+ * that throws leaves the source drawn plain and the field editable, and the
25
+ * error is reported to the page as an uncaught one.
24
26
  *
25
27
  * @since 0.1.0
26
28
  * @status stable
@@ -31,37 +33,27 @@ import { type SandboxHighlight } from '../tokens.js';
31
33
  * @event {HelixCaretEvent} helix-caret - Fired when the cursor moves.
32
34
  * @event {HelixEditEvent} helix-edit - Fired after the source was edited, with the new source.
33
35
  *
34
- * @csspart field - The box that scrolls the field and its colors together, under `highlight`.
35
- * @csspart highlight - The colored copy of the source drawn under the field, under `highlight`.
36
+ * @csspart field - The box that scrolls the field and its colors together, under `tokenize`.
37
+ * @csspart highlight - The colored copy of the source drawn under the field, under `tokenize`.
36
38
  * @csspart source - The editable region.
37
- * @csspart token - One run of the source that has a kind, under `highlight`.
39
+ * @csspart token - One run of the source that has a kind, under `tokenize`.
38
40
  *
39
41
  * @cssproperty --sandbox-source-background-color - Fill behind the source.
40
- * @cssproperty --sandbox-source-callable-color - Color of a `callable` run, under `highlight`. Defaults to `--helix-color-syntax-callable`.
41
- * @cssproperty --sandbox-source-comment-color - Color of a `comment` run, under `highlight`. Defaults to `--helix-color-syntax-comment`.
42
- * @cssproperty --sandbox-source-constant-color - Color of a `constant` run, under `highlight`. Defaults to `--helix-color-syntax-constant`.
43
- * @cssproperty --sandbox-source-invalid-color - Color of an `invalid` run, under `highlight`. Defaults to `--helix-color-syntax-invalid`.
44
- * @cssproperty --sandbox-source-keyword-color - Color of a `keyword` run, under `highlight`. Defaults to `--helix-color-syntax-keyword`.
42
+ * @cssproperty --sandbox-source-callable-color - Color of a `callable` run, under `tokenize`. Defaults to `--helix-color-syntax-callable`.
43
+ * @cssproperty --sandbox-source-comment-color - Color of a `comment` run, under `tokenize`. Defaults to `--helix-color-syntax-comment`.
44
+ * @cssproperty --sandbox-source-constant-color - Color of a `constant` run, under `tokenize`. Defaults to `--helix-color-syntax-constant`.
45
+ * @cssproperty --sandbox-source-invalid-color - Color of an `invalid` run, under `tokenize`. Defaults to `--helix-color-syntax-invalid`.
46
+ * @cssproperty --sandbox-source-keyword-color - Color of a `keyword` run, under `tokenize`. Defaults to `--helix-color-syntax-keyword`.
45
47
  * @cssproperty --sandbox-source-min-block-size - Minimum height of the pane.
46
- * @cssproperty --sandbox-source-name-color - Color of a `name` run, under `highlight`. Defaults to `--helix-color-syntax-name`.
47
- * @cssproperty --sandbox-source-string-color - Color of a `string` run, under `highlight`. Defaults to `--helix-color-syntax-string`.
48
- * @cssproperty --sandbox-source-tag-color - Color of a `tag` run, under `highlight`. Defaults to `--helix-color-syntax-tag`.
48
+ * @cssproperty --sandbox-source-name-color - Color of a `name` run, under `tokenize`. Defaults to `--helix-color-syntax-name`.
49
+ * @cssproperty --sandbox-source-string-color - Color of a `string` run, under `tokenize`. Defaults to `--helix-color-syntax-string`.
50
+ * @cssproperty --sandbox-source-tag-color - Color of a `tag` run, under `tokenize`. Defaults to `--helix-color-syntax-tag`.
49
51
  */
50
52
  export declare class HelixSandboxSource extends HelixElement {
51
53
  /**
52
54
  * The editable region's name, read by screen readers.
53
55
  */
54
56
  fieldLabel: string;
55
- /**
56
- * Colors the source: a function from the source and the pane's `name` to
57
- * runs of text, each with an optional kind, such as
58
- * `[{ text: '<' }, { kind: 'tag', text: 'p' }, { text: '>' }]`.
59
- *
60
- * Absent, the pane is a plain field. Runs whose text does not add up to the
61
- * source are drawn as the source, uncolored, so the colors never drift from
62
- * the caret. Set it as a property.
63
- */
64
- highlight?: SandboxHighlight;
65
57
  /**
66
58
  * The field's description, read by screen readers while Tab indents.
67
59
  */
@@ -79,6 +71,20 @@ export declare class HelixSandboxSource extends HelixElement {
79
71
  * Whether Tab indents the source. When it is off, Tab moves focus.
80
72
  */
81
73
  tabIndents: boolean;
74
+ /**
75
+ * Colors the source: a function from the source and the pane's `name` to
76
+ * runs of text, each with an optional kind, such as
77
+ * `[{ text: '<' }, { kind: 'tag', text: 'p' }, { text: '>' }]`.
78
+ *
79
+ * Absent, the pane is a plain field. Runs whose text does not add up to the
80
+ * source are drawn as the source, uncolored, so the colors never drift from
81
+ * the caret, and so is the source when the function throws. Set it as a
82
+ * property.
83
+ *
84
+ * Named for what it returns, runs of text, where Code Block's `highlight`
85
+ * returns markup.
86
+ */
87
+ tokenize?: SandboxTokenizer;
82
88
  /**
83
89
  * The source being edited.
84
90
  */
@@ -123,7 +129,7 @@ export declare class HelixSandboxSource extends HelixElement {
123
129
  private edit;
124
130
  private readonly handleKeydown;
125
131
  protected render(): TemplateResult;
126
- /** The field itself and its description, which is the whole pane without `highlight`. */
132
+ /** The field itself and its description, which is the whole pane without `tokenize`. */
127
133
  private renderField;
128
134
  static styles: CSSResultGroup;
129
135
  }
@@ -67,10 +67,17 @@ let HelixSandboxSource = class HelixSandboxSource extends HelixElement {
67
67
  }
68
68
  render() {
69
69
  const field = this.renderField();
70
- if (!this.highlight) {
70
+ if (!this.tokenize) {
71
71
  return field;
72
72
  }
73
- const runs = drawnRuns(this.value, this.highlight(this.value, this.name));
73
+ let given = [];
74
+ try {
75
+ given = this.tokenize(this.value, this.name);
76
+ }
77
+ catch (error) {
78
+ globalThis.reportError?.(error);
79
+ }
80
+ const runs = drawnRuns(this.value, given);
74
81
  return html `<div part="field">
75
82
  <pre part="highlight" aria-hidden="true">${runs.map(({ kind, text }) => kind ? html `<span part="token" data-kind=${kind}>${text}</span>` : text)}${'\n'}</pre>
76
83
  ${field}
@@ -96,9 +103,6 @@ let HelixSandboxSource = class HelixSandboxSource extends HelixElement {
96
103
  __decorate([
97
104
  property({ attribute: 'field-label' })
98
105
  ], HelixSandboxSource.prototype, "fieldLabel", void 0);
99
- __decorate([
100
- property({ attribute: false })
101
- ], HelixSandboxSource.prototype, "highlight", void 0);
102
106
  __decorate([
103
107
  property({ attribute: 'keys-description' })
104
108
  ], HelixSandboxSource.prototype, "keysDescription", void 0);
@@ -108,6 +112,9 @@ __decorate([
108
112
  __decorate([
109
113
  property({ attribute: 'tab-indents', converter: onUnlessFalse })
110
114
  ], HelixSandboxSource.prototype, "tabIndents", void 0);
115
+ __decorate([
116
+ property({ attribute: false })
117
+ ], HelixSandboxSource.prototype, "tokenize", void 0);
111
118
  __decorate([
112
119
  property()
113
120
  ], HelixSandboxSource.prototype, "value", void 0);
@@ -1,22 +1,2 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
- align-items: center;
4
- background-color: var(--helix-color-background);
5
- border-block-start: var(--helix-border-thin) solid var(--helix-color-border);
6
- color: var(--sandbox-status-bar-color, var(--helix-color-foreground-subtle));
7
- display: flex;
8
- font-size: var(--helix-text-xs);
9
- gap: var(--helix-space-sm);
10
- line-height: var(--helix-leading-tight);
11
- padding: var(--helix-space-2xs) var(--helix-space-sm);
12
-
13
- user-select: none;
14
- }
15
-
16
- slot:not([name]) + * {
17
- margin-inline-start: auto;
18
- }
19
-
20
- [part="caret"] {
21
- font-variant-numeric: tabular-nums;
22
- }`);
2
+ export const styles = createSheet(`:host {align-items: center;background-color: var(--helix-color-background);border-block-start: var(--helix-border-thin) solid var(--helix-color-border);color: var(--sandbox-status-bar-color, var(--helix-color-foreground-subtle));display: flex;font-size: var(--helix-text-xs);gap: var(--helix-space-sm);line-height: var(--helix-leading-tight);padding: var(--helix-space-2xs) var(--helix-space-sm);user-select: none;}slot:not([name]) + * {margin-inline-start: auto;}[part="caret"] {font-variant-numeric: tabular-nums;}`);
@@ -1,107 +1,6 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
-
4
- block-size: var(--sandbox-terminal-size, 100%);
5
- display: grid;
6
- grid-template-rows: minmax(0, 1fr);
7
- min-block-size: 0;
8
- }
9
-
10
- :host([controls]) {
11
- grid-template-rows: auto minmax(0, 1fr);
12
- }
13
-
14
- [part="controls"] {
15
- align-items: center;
16
- border-block-end: var(--helix-border-thin) solid var(--helix-color-border);
17
- display: flex;
18
- font-family: var(--helix-font-sans);
19
- font-size: var(--helix-text-xs);
20
- gap: var(--helix-space-xs);
21
- justify-content: space-between;
22
- padding: var(--helix-space-2xs) var(--helix-space-sm);
23
- }
24
-
25
- [part="filter"],
26
- [part="clear"] {
27
- background-color: transparent;
28
- border: var(--helix-border-thin) solid var(--helix-color-border);
29
- border-radius: var(--helix-radii-sm);
30
- color: var(--helix-color-foreground);
31
- font: inherit;
32
- padding: var(--helix-space-2xs) var(--helix-space-xs);
33
- }
34
-
35
- [part="clear"] {
36
- cursor: pointer;
37
- }
38
-
39
- [part="clear"]:hover {
40
- background-color: var(--helix-color-surface-sunken);
41
- }
42
-
43
- [part="filter"]:focus-visible,
44
- [part="clear"]:focus-visible {
45
- outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
46
- outline-offset: var(--helix-size-focus-offset);
47
- }
48
-
49
- [part="log"] {
50
- font-family: var(--helix-font-mono);
51
- font-size: var(--helix-text-xs);
52
- line-height: var(--helix-leading-normal);
53
- overflow: auto;
54
- padding: var(--helix-space-xs) var(--helix-space-sm);
55
- }
56
-
57
- [part="log"]:focus-visible {
58
- outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
59
- outline-offset: calc(var(--helix-size-focus-offset) * -1);
60
- }
61
-
62
- [part="empty"] {
63
- color: var(--helix-color-foreground-subtle);
64
- margin: var(--helix-space-none);
65
- }
66
-
67
- [part="entry"] {
68
- align-items: baseline;
69
- color: var(--helix-color-foreground-muted);
70
- display: grid;
71
- gap: var(--helix-space-xs);
72
- grid-template-columns: 3.5rem minmax(0, 1fr) auto;
73
- padding-block: var(--helix-space-2xs);
74
- }
75
-
76
- [part="level"] {
77
- color: var(--helix-color-foreground-subtle);
78
- text-transform: uppercase;
79
- }
80
-
81
- [part="message"] {
82
- white-space: pre-wrap;
83
- word-break: break-word;
84
- }
85
-
86
- [part="count"] {
87
- background-color: var(--helix-color-surface-sunken);
88
- border-radius: var(--helix-radii-full);
89
- color: var(--helix-color-foreground-subtle);
90
- padding-inline: var(--helix-space-2xs);
91
- }
92
-
93
- [part="entry"][data-level="warn"] {
94
- color: var(--helix-color-warning);
95
- }
96
-
97
- [part="entry"][data-level="warn"] [part="level"] {
98
- color: var(--helix-color-warning);
99
- }
100
-
101
- [part="entry"][data-level="error"] {
102
- color: var(--helix-color-danger);
103
- }
104
-
105
- [part="entry"][data-level="error"] [part="level"] {
106
- color: var(--helix-color-danger);
107
- }`);
2
+ export const styles = createSheet(`:host {block-size: var(--sandbox-terminal-size, 100%);display: grid;grid-template-rows: minmax(0, 1fr);min-block-size: 0;}:host([controls]) {grid-template-rows: auto minmax(0, 1fr);}[part="controls"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);gap: var(--helix-space-xs);justify-content: space-between;padding: var(--helix-space-2xs) var(--helix-space-sm);}[part="filter"],
3
+ [part="clear"] {background-color: transparent;border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground);font: inherit;padding: var(--helix-space-2xs) var(--helix-space-xs);}[part="clear"] {cursor: pointer;}[part="clear"]:hover {background-color: var(--helix-color-surface-sunken);}[part="filter"]:focus-visible,
4
+ [part="clear"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="log"] {font-family: var(--helix-font-mono);font-size: var(--helix-text-xs);line-height: var(--helix-leading-normal);overflow: auto;padding: var(--helix-space-xs) var(--helix-space-sm);}[part="log"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="empty"] {color: var(--helix-color-foreground-subtle);margin: var(--helix-space-none);}[part="entry"] {align-items: baseline;color: var(--helix-color-foreground-muted);display: grid;gap: var(--helix-space-xs);grid-template-columns: 3.5rem minmax(0, 1fr) auto;padding-block: var(--helix-space-2xs);}[part="level"] {color: var(--helix-color-foreground-subtle);text-transform: uppercase;}[part="message"] {white-space: pre-wrap;word-break: break-word;}[part="count"] {background-color: var(--helix-color-surface-sunken);border-radius: var(--helix-radii-full);color: var(--helix-color-foreground-subtle);padding-inline: var(--helix-space-2xs);}[data-level="warn"],
5
+ [data-level="warn"] [part="level"] {color: var(--helix-color-warning);}[data-level="error"],
6
+ [data-level="error"] [part="level"] {color: var(--helix-color-danger);}`);
@@ -106,6 +106,10 @@ export declare class HelixSandboxTerminal extends HelixElement {
106
106
  * Takes the level the reader chose in the filter, unless a listener
107
107
  * refused it, and then says so with the select's own `change`, which stops
108
108
  * at the shadow root otherwise. A refusal puts the select back.
109
+ *
110
+ * The select's `input` is stopped where it starts, as Pagination's is. It is
111
+ * composed and comes first, so it left this element before
112
+ * `helix-before-change` and still left it when the change was refused.
109
113
  */
110
114
  private readonly handleLevel;
111
115
  /** The clear button and the level filter, under `controls`. */
@@ -16,6 +16,7 @@ const LEVEL_WORDS = {
16
16
  warn: 'Warnings and errors',
17
17
  };
18
18
  const LIMIT = 200;
19
+ const stop = (event) => event.stopPropagation();
19
20
  let HelixSandboxTerminal = class HelixSandboxTerminal extends HelixElement {
20
21
  constructor() {
21
22
  super(...arguments);
@@ -77,7 +78,7 @@ let HelixSandboxTerminal = class HelixSandboxTerminal extends HelixElement {
77
78
  return nothing;
78
79
  }
79
80
  return html `<div part="controls">
80
- <select part="filter" aria-label=${this.levelLabel} @change=${this.handleLevel}>
81
+ <select part="filter" aria-label=${this.levelLabel} @change=${this.handleLevel} @input=${stop}>
81
82
  ${LEVELS.map((one) => html `<option value=${one} ?selected=${(this.level ?? 'log') === one}>
82
83
  ${this.levelWords?.[one] ?? LEVEL_WORDS[one]}
83
84
  </option>`)}
@@ -10,12 +10,12 @@ export interface SandboxToken {
10
10
  text: string;
11
11
  }
12
12
  /**
13
- * Splits a pane's source into runs, for `SandboxSource.highlight`.
13
+ * Splits a pane's source into runs, for `SandboxSource.tokenize`.
14
14
  *
15
15
  * Takes the source and the pane's `name`, such as `html` or `css`, so one
16
16
  * function can serve every pane.
17
17
  */
18
- export type SandboxHighlight = (source: string, name: string) => readonly SandboxToken[];
18
+ export type SandboxTokenizer = (source: string, name: string) => readonly SandboxToken[];
19
19
  /** A run as the pane draws it: its text, and its kind as an attribute holds it. */
20
20
  export interface DrawnRun {
21
21
  /** The kind, in lowercase letters, digits and hyphens, or `undefined` for plain text. */
@@ -1,37 +1,2 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {
3
-
4
- --helix-size-checkbox: var(--helix-size-checkbox-sm);
5
- --helix-size-checkbox-loose: calc(var(--helix-size-checkbox) * 1.2);
6
- --helix-size-checkbox-tight: calc(var(--helix-size-checkbox) * 0.8);
7
- --helix-size-icon: var(--helix-size-icon-sm);
8
- --helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);
9
- --helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);
10
- --helix-size-control: var(--helix-size-control-sm);
11
- --helix-size-control-loose: calc(var(--helix-size-control) * 1.2);
12
- --helix-size-control-tight: calc(var(--helix-size-control) * 0.8);
13
- --helix-size-tag: var(--helix-size-tag-sm);
14
-
15
- align-items: center;
16
- background-color: var(--helix-color-background);
17
-
18
- block-size: var(--sandbox-toolbar-size, var(--helix-size-control-lg));
19
-
20
- border-block-end: var(--helix-border-thin) solid var(--helix-color-border);
21
- display: flex;
22
- min-block-size: 0;
23
- padding-block: var(--helix-space-none);
24
-
25
- padding-inline: var(--helix-space-md);
26
- }
27
-
28
- slot {
29
- align-items: center;
30
- display: flex;
31
- gap: var(--sandbox-toolbar-gap, var(--helix-space-sm));
32
- min-inline-size: 0;
33
- }
34
-
35
- slot[name="end"] {
36
- margin-inline-start: auto;
37
- }`);
2
+ export const styles = createSheet(`:host {--helix-size-checkbox: var(--helix-size-checkbox-sm);--helix-size-checkbox-loose: calc(var(--helix-size-checkbox) * 1.2);--helix-size-checkbox-tight: calc(var(--helix-size-checkbox) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--helix-size-control: var(--helix-size-control-sm);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-tag: var(--helix-size-tag-sm);align-items: center;background-color: var(--helix-color-background);block-size: var(--sandbox-toolbar-size, var(--helix-size-control-lg));border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;min-block-size: 0;padding-block: var(--helix-space-none);padding-inline: var(--helix-space-md);}slot {align-items: center;display: flex;gap: var(--sandbox-toolbar-gap, var(--helix-space-sm));min-inline-size: 0;}slot[name="end"] {margin-inline-start: auto;}`);