@fusion.dev/helix 0.142.1 → 0.144.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 (160) hide show
  1. package/README.md +9 -5
  2. package/custom-elements.json +29287 -1905
  3. package/dist/accordion/item/accordion-item.css.js +6 -1
  4. package/dist/accordion/item/accordion-item.d.ts +1 -0
  5. package/dist/announcement/root/announcement-root.d.ts +3 -3
  6. package/dist/app-header/root/app-header-root.d.ts +1 -3
  7. package/dist/aura/shader.d.ts +5 -1
  8. package/dist/aura/shader.js +88 -613
  9. package/dist/avatar/root/avatar-root.d.ts +3 -3
  10. package/dist/badge/root/badge-root.css.js +38 -2
  11. package/dist/badge/root/badge-root.d.ts +17 -0
  12. package/dist/badge/root/badge-root.js +3 -0
  13. package/dist/bar-chart/root/bar-chart-root.css.js +10 -0
  14. package/dist/blockquote/root/blockquote-root.css.js +9 -5
  15. package/dist/blockquote/root/blockquote-root.d.ts +5 -0
  16. package/dist/button/root/button-root.css.js +38 -1
  17. package/dist/button/root/button-root.d.ts +5 -0
  18. package/dist/button/root/button-root.js +2 -1
  19. package/dist/callout/root/callout-root.css.js +69 -11
  20. package/dist/callout/root/callout-root.d.ts +25 -2
  21. package/dist/callout/root/callout-root.js +4 -0
  22. package/dist/card/root/card-root.css.js +27 -1
  23. package/dist/card/root/card-root.d.ts +11 -0
  24. package/dist/carousel/root/carousel-root.js +2 -1
  25. package/dist/checkbox/root/checkbox-root.css.js +3 -3
  26. package/dist/checkbox-group/root/checkbox-group-root.d.ts +2 -0
  27. package/dist/checkbox-group/root/checkbox-group-root.js +2 -0
  28. package/dist/code-block/root/code-block-root.css.js +23 -0
  29. package/dist/code-block/root/code-block-root.d.ts +15 -0
  30. package/dist/code-block/root/code-block-root.js +8 -0
  31. package/dist/color-picker/root/color-picker-root.css.js +64 -0
  32. package/dist/color-picker/root/color-picker-root.d.ts +2 -1
  33. package/dist/color-picker/root/color-picker-root.js +0 -1
  34. package/dist/combobox/root/combobox-root.css.js +5 -4
  35. package/dist/copy-button/root/copy-button-root.css.js +5 -0
  36. package/dist/data-table/root/data-table-root.css.js +7 -0
  37. package/dist/date-input/root/date-input-root.css.js +19 -0
  38. package/dist/date-input/root/date-input-root.d.ts +8 -0
  39. package/dist/date-input/root/date-input-root.js +2 -0
  40. package/dist/date-picker/root/date-picker-root.css.js +83 -3
  41. package/dist/date-picker/root/date-picker-root.d.ts +1 -0
  42. package/dist/dialog/root/dialog-root.css.js +47 -0
  43. package/dist/divider/root/divider-root.css.js +8 -3
  44. package/dist/divider/root/divider-root.d.ts +17 -1
  45. package/dist/divider/root/divider-root.js +4 -0
  46. package/dist/donut-chart/root/donut-chart-root.css.js +10 -0
  47. package/dist/drawer/root/drawer-root.css.js +53 -5
  48. package/dist/element-events.generated.js +48 -14
  49. package/dist/empty/root/empty-root.css.js +9 -9
  50. package/dist/empty/root/empty-root.d.ts +9 -0
  51. package/dist/file-input/root/file-input-root.d.ts +0 -1
  52. package/dist/file-input/root/file-input-root.js +2 -1
  53. package/dist/filter-input/root/filter-input-root.d.ts +0 -1
  54. package/dist/filter-input/root/filter-input-root.js +2 -1
  55. package/dist/grid/root/grid-root.d.ts +15 -11
  56. package/dist/grid/root/grid-root.js +49 -15
  57. package/dist/heatmap/root/heatmap-root.css.js +33 -5
  58. package/dist/heatmap/root/heatmap-root.d.ts +4 -1
  59. package/dist/icon/index.d.ts +1 -0
  60. package/dist/icon/index.js +1 -0
  61. package/dist/icon/root/icon-root.d.ts +1 -1
  62. package/dist/icon/root/icon-root.js +1 -1
  63. package/dist/icon/root/index.d.ts +2 -0
  64. package/dist/icon/root/index.js +2 -0
  65. package/dist/icon-button/root/icon-button-root.css.js +80 -16
  66. package/dist/icon-button/root/icon-button-root.d.ts +8 -1
  67. package/dist/icon-button/root/icon-button-root.js +2 -1
  68. package/dist/image/root/image-root.css.js +1 -1
  69. package/dist/input/root/input-root.css.js +3 -3
  70. package/dist/input/root/input-root.d.ts +3 -1
  71. package/dist/input/root/input-root.js +0 -1
  72. package/dist/legend/root/legend-root.css.js +40 -13
  73. package/dist/legend/root/legend-root.d.ts +6 -0
  74. package/dist/legend/root/legend-root.js +1 -1
  75. package/dist/lightbox/root/lightbox-root.css.js +84 -0
  76. package/dist/lightbox/root/lightbox-root.d.ts +1 -0
  77. package/dist/line-chart/root/line-chart-root.css.js +10 -0
  78. package/dist/list/item/list-item.css.js +7 -1
  79. package/dist/loader/root/loader-root.css.js +10 -0
  80. package/dist/loader/root/loader-root.d.ts +10 -4
  81. package/dist/menu/item/menu-item.css.js +1 -1
  82. package/dist/menu/root/menu-root.d.ts +0 -3
  83. package/dist/meter/root/meter-root.css.js +27 -5
  84. package/dist/meter/root/meter-root.d.ts +5 -0
  85. package/dist/notifications/notification/notification.css.js +5 -0
  86. package/dist/number-input/root/number-input-root.css.js +3 -3
  87. package/dist/number-input/root/number-input-root.d.ts +6 -0
  88. package/dist/orb/root/orb-root.d.ts +11 -2
  89. package/dist/orb/root/orb-root.js +5 -1
  90. package/dist/pin-input/root/pin-input-root.css.js +12 -5
  91. package/dist/pin-input/root/pin-input-root.d.ts +5 -0
  92. package/dist/popover/root/popover-root.css.js +36 -0
  93. package/dist/popover/root/popover-root.d.ts +1 -0
  94. package/dist/progress/root/progress-root.css.js +22 -1
  95. package/dist/progress/root/progress-root.d.ts +5 -0
  96. package/dist/qr-code/root/qr-code-root.css.js +2 -1
  97. package/dist/qr-code/root/qr-code-root.d.ts +2 -2
  98. package/dist/quote/root/quote-root.css.js +1 -1
  99. package/dist/quote/root/quote-root.d.ts +1 -0
  100. package/dist/rating/root/rating-root.d.ts +3 -0
  101. package/dist/sandbox/index.d.ts +2 -2
  102. package/dist/sandbox/root/sandbox-root.d.ts +20 -1
  103. package/dist/sandbox/root/sandbox-root.js +27 -10
  104. package/dist/sandbox/source/sandbox-source.d.ts +6 -1
  105. package/dist/sandbox/source/sandbox-source.js +13 -3
  106. package/dist/sandbox/terminal/sandbox-terminal.d.ts +3 -1
  107. package/dist/sandbox/terminal/sandbox-terminal.js +3 -1
  108. package/dist/shared/chart/tooltip.css.js +25 -2
  109. package/dist/shared/field/field-segments.css.d.ts +1 -0
  110. package/dist/shared/field/field-segments.css.js +40 -0
  111. package/dist/skeleton/root/skeleton-root.css.js +60 -5
  112. package/dist/skeleton/root/skeleton-root.d.ts +21 -2
  113. package/dist/skeleton/root/skeleton-root.js +3 -0
  114. package/dist/stat/root/stat-root.css.js +7 -7
  115. package/dist/stat/root/stat-root.d.ts +8 -0
  116. package/dist/switch/root/switch-root.css.js +13 -5
  117. package/dist/switch/root/switch-root.d.ts +25 -1
  118. package/dist/switch/root/switch-root.js +7 -0
  119. package/dist/table/column/table-column.css.js +5 -0
  120. package/dist/tabs/panel/tab-panel.css.js +1 -1
  121. package/dist/tabs/panel/tab-panel.d.ts +2 -0
  122. package/dist/tabs/root/tabs-root.css.js +13 -7
  123. package/dist/tabs/root/tabs-root.d.ts +5 -0
  124. package/dist/tabs/tab/tab.css.js +4 -4
  125. package/dist/tabs/tab/tab.d.ts +5 -0
  126. package/dist/tag/group/tag-group.css.d.ts +1 -0
  127. package/dist/tag/group/tag-group.css.js +6 -0
  128. package/dist/tag/group/tag-group.d.ts +25 -0
  129. package/dist/tag/group/tag-group.js +16 -0
  130. package/dist/tag/index.d.ts +1 -0
  131. package/dist/tag/index.js +1 -0
  132. package/dist/tag/root/tag-root.css.js +50 -0
  133. package/dist/tag/root/tag-root.d.ts +6 -3
  134. package/dist/text/root/text-root.css.js +58 -1
  135. package/dist/text/root/text-root.d.ts +11 -2
  136. package/dist/text/root/text-root.js +19 -1
  137. package/dist/textarea/root/textarea-root.css.js +12 -4
  138. package/dist/textarea/root/textarea-root.d.ts +4 -0
  139. package/dist/time-input/root/time-input-root.css.js +19 -0
  140. package/dist/time-input/root/time-input-root.d.ts +8 -1
  141. package/dist/time-input/root/time-input-root.js +2 -1
  142. package/dist/toast/item/toast-item.css.js +16 -0
  143. package/dist/toast/root/toast-root.css.js +31 -7
  144. package/dist/toast/root/toast-root.d.ts +6 -9
  145. package/dist/toggle/group/toggle-group.css.js +16 -0
  146. package/dist/toggle/group/toggle-group.d.ts +3 -0
  147. package/dist/tour/root/tour-root.css.js +8 -0
  148. package/dist/tour/stop/tour-stop.css.js +37 -0
  149. package/dist/trend/root/trend-root.css.js +12 -5
  150. package/dist/trend/root/trend-root.d.ts +6 -2
  151. package/dist/trend/root/trend-root.js +0 -1
  152. package/dist/video/root/video-root.d.ts +0 -1
  153. package/dist/video/root/video-root.js +0 -1
  154. package/dist/video-playlist/menu/video-playlist-menu.d.ts +0 -1
  155. package/dist/video-playlist/menu/video-playlist-menu.js +0 -1
  156. package/lint.json +1 -1
  157. package/package.json +6 -6
  158. package/types/jsx.d.ts +9515 -2061
  159. package/types/svelte.d.ts +1 -0
  160. package/types/vue.d.ts +2302 -233
@@ -6,6 +6,8 @@ display: inline-flex;
6
6
 
7
7
  :host {
8
8
  --_icon-button-edge: var(--helix-color-border);
9
+
10
+ --_icon-button-turn: 0.8s;
9
11
  --_icon-button-ink: var(--helix-color-foreground-muted);
10
12
  --_icon-button-ink-hover: var(--helix-color-foreground);
11
13
 
@@ -58,7 +60,7 @@ var(--helix-color-foreground)
58
60
 
59
61
  [part="button"] {
60
62
  align-items: center;
61
- background-color: transparent;
63
+ background-color: var(--icon-button-background-color, transparent);
62
64
  block-size: var(--_icon-button-size);
63
65
  border: var(--helix-border-thin) solid transparent;
64
66
 
@@ -75,7 +77,7 @@ border-start-start-radius: var(
75
77
  --button-radius-start,
76
78
  var(--icon-button-radius, var(--helix-radii-sm))
77
79
  );
78
- color: var(--_icon-button-ink);
80
+ color: var(--icon-button-foreground-color, var(--_icon-button-ink));
79
81
  cursor: pointer;
80
82
  display: inline-flex;
81
83
 
@@ -89,8 +91,14 @@ color var(--helix-duration-fast) var(--helix-easing-standard);
89
91
  }
90
92
 
91
93
  :host(:not(:disabled)) [part="button"]:hover {
92
- background-color: color-mix(in oklab, var(--_icon-button-tone) 8%, transparent);
93
- color: var(--_icon-button-ink-hover);
94
+ background-color: var(
95
+ --icon-button-background-color-hover,
96
+ var(
97
+ --icon-button-background-color,
98
+ color-mix(in oklab, var(--_icon-button-tone) 8%, transparent)
99
+ )
100
+ );
101
+ color: var(--icon-button-foreground-color, var(--_icon-button-ink-hover));
94
102
  }
95
103
 
96
104
  :host([shape="circle"]) [part="button"] {
@@ -115,34 +123,55 @@ outline-offset: var(--helix-size-focus-offset);
115
123
  }
116
124
 
117
125
  :host([emphasis="solid"]) [part="button"] {
118
- background-color: var(--_icon-button-fill);
126
+ background-color: var(--icon-button-background-color, var(--_icon-button-fill));
119
127
  border-color: transparent;
120
- color: var(--_icon-button-on-tone);
128
+ color: var(--icon-button-foreground-color, var(--_icon-button-on-tone));
121
129
  }
122
130
  :host(:not(:disabled)[emphasis="solid"]) [part="button"]:hover {
123
- background-color: var(--_icon-button-fill-hover);
124
- color: var(--_icon-button-on-tone);
131
+ background-color: var(
132
+ --icon-button-background-color-hover,
133
+ var(--icon-button-background-color, var(--_icon-button-fill-hover))
134
+ );
135
+ color: var(--icon-button-foreground-color, var(--_icon-button-on-tone));
125
136
  }
126
137
 
127
138
  :host([emphasis="outlined"]) [part="button"] {
128
- background-color: color-mix(in oklab, var(--_icon-button-tone) 6%, transparent);
139
+ background-color: var(
140
+ --icon-button-background-color,
141
+ color-mix(in oklab, var(--_icon-button-tone) 6%, transparent)
142
+ );
129
143
  border-color: var(--_icon-button-edge);
130
- color: var(--_icon-button-tone);
144
+ color: var(--icon-button-foreground-color, var(--_icon-button-tone));
131
145
  }
132
146
  :host(:not(:disabled)[emphasis="outlined"]) [part="button"]:hover {
133
- background-color: color-mix(in oklab, var(--_icon-button-tone) 12%, transparent);
134
- color: var(--_icon-button-tone);
147
+ background-color: var(
148
+ --icon-button-background-color-hover,
149
+ var(
150
+ --icon-button-background-color,
151
+ color-mix(in oklab, var(--_icon-button-tone) 12%, transparent)
152
+ )
153
+ );
154
+ color: var(--icon-button-foreground-color, var(--_icon-button-tone));
135
155
  }
136
156
 
137
157
  :host([emphasis="subtle"]) [part="button"] {
138
- background-color: color-mix(in oklab, var(--_icon-button-tone) 14%, transparent);
158
+ background-color: var(
159
+ --icon-button-background-color,
160
+ color-mix(in oklab, var(--_icon-button-tone) 14%, transparent)
161
+ );
139
162
  border-color: transparent;
140
- color: var(--_icon-button-tone);
163
+ color: var(--icon-button-foreground-color, var(--_icon-button-tone));
141
164
  }
142
165
 
143
166
  :host(:not(:disabled)[emphasis="subtle"]) [part="button"]:hover {
144
- background-color: color-mix(in oklab, var(--_icon-button-tone) 22%, transparent);
145
- color: var(--_icon-button-tone);
167
+ background-color: var(
168
+ --icon-button-background-color-hover,
169
+ var(
170
+ --icon-button-background-color,
171
+ color-mix(in oklab, var(--_icon-button-tone) 22%, transparent)
172
+ )
173
+ );
174
+ color: var(--icon-button-foreground-color, var(--_icon-button-tone));
146
175
  }
147
176
 
148
177
  :host(:disabled) [part="button"] {
@@ -150,6 +179,41 @@ cursor: not-allowed;
150
179
  opacity: 0.5;
151
180
  }
152
181
 
182
+ :host(:state(pending)) [part="button"] {
183
+ cursor: progress;
184
+ position: relative;
185
+ }
186
+
187
+ :host(:state(pending)) [part="button"] > * {
188
+ visibility: hidden;
189
+ }
190
+
191
+ :host(:state(pending)) [part="button"]::after {
192
+ animation: helix-icon-button-turn var(--_icon-button-turn) linear infinite;
193
+ block-size: var(--icon-button-spinner-size, 1.15em);
194
+ border: var(--helix-border-thick) solid color-mix(in oklab, currentColor 30%, transparent);
195
+ border-block-start-color: currentColor;
196
+ border-radius: var(--helix-radii-full);
197
+ box-sizing: border-box;
198
+ content: "";
199
+ inline-size: var(--icon-button-spinner-size, 1.15em);
200
+ inset: 0;
201
+ margin: auto;
202
+ position: absolute;
203
+ }
204
+
205
+ @keyframes helix-icon-button-turn {
206
+ to {
207
+ rotate: 1turn;
208
+ }
209
+ }
210
+
211
+ @media (prefers-reduced-motion: reduce) {
212
+ :host(:state(pending)) [part="button"]::after {
213
+ animation-duration: calc(var(--helix-duration-slow) * 12);
214
+ }
215
+ }
216
+
153
217
  @media print {
154
218
  :host {
155
219
  display: none;
@@ -21,11 +21,18 @@ declare const HelixIconButton_base: (new (...args: any[]) => import("../../share
21
21
  *
22
22
  * @slot - The icon.
23
23
  *
24
- * @csspart button - The inner button or anchor.
24
+ * @csspart button - The inner button.
25
+ * @csspart live - The live region that says `pending-label` when the button becomes pending under focus. It is clipped out of view and still read.
25
26
  *
27
+ * @cssproperty --icon-button-background-color - Fill behind the button, in every state.
28
+ * @cssproperty --icon-button-background-color-hover - Fill behind the button under the pointer. Without it, `--icon-button-background-color` also applies on hover.
29
+ * @cssproperty --icon-button-foreground-color - Icon color.
26
30
  * @cssproperty --icon-button-radius - Corner radius of the control, which a group flattens through `--button-radius-start` and `--button-radius-end`.
27
31
  * @cssproperty --icon-button-shadow - Shadow of a raised icon button.
28
32
  * @cssproperty --icon-button-size - Edge length of the control.
33
+ * @cssproperty --icon-button-spinner-size - Size of the ring a pending button turns.
34
+ *
35
+ * @cssstate pending - The button is pending: `pending` is set. A ring turns over its hidden icon.
29
36
  */
30
37
  export declare class HelixIconButton extends HelixIconButton_base {
31
38
  /**
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessIconButton } from '@fusion.dev/helix-headless/icon-button';
9
9
  import { property } from 'lit/decorators.js';
10
+ import { styles as liveStyles } from '../../shared/live/live.css.js';
10
11
  import { MixinControlSurface } from '../../shared/mixin-control-surface/mixin-control-surface.js';
11
12
  import { styles } from './icon-button-root.css.js';
12
13
  let HelixIconButton = class HelixIconButton extends MixinControlSurface(HelixHeadlessIconButton) {
@@ -14,7 +15,7 @@ let HelixIconButton = class HelixIconButton extends MixinControlSurface(HelixHea
14
15
  super(...arguments);
15
16
  this.raised = false;
16
17
  }
17
- static { this.styles = styles; }
18
+ static { this.styles = [liveStyles, styles]; }
18
19
  };
19
20
  __decorate([
20
21
  property({ reflect: true, type: Boolean })
@@ -19,7 +19,7 @@ object-position: var(--image-position, center);
19
19
  }
20
20
 
21
21
  :host([data-status="error"]) [part="image"] {
22
- visibility: hidden;
22
+ opacity: 0;
23
23
  }
24
24
 
25
25
  [part="placeholder"],
@@ -7,12 +7,12 @@ export const styles = createSheet(`:host {
7
7
  align-items: center;
8
8
  background-color: var(--input-background-color, var(--helix-color-well));
9
9
  block-size: var(--_input-size);
10
- border: var(--helix-border-thin) solid var(--helix-color-border);
11
- border-radius: var(--helix-radii-sm);
10
+ border: var(--helix-border-thin) solid var(--input-border-color, var(--helix-color-border));
11
+ border-radius: var(--input-radius, var(--helix-radii-sm));
12
12
  color: var(--helix-color-foreground-subtle);
13
13
  display: flex;
14
14
  gap: var(--helix-space-2xs);
15
- padding-inline: var(--helix-space-xs);
15
+ padding-inline: var(--input-padding-inline, var(--helix-space-xs));
16
16
  transition:
17
17
  border-color var(--helix-duration-fast) var(--helix-easing-standard),
18
18
  background-color var(--helix-duration-fast) var(--helix-easing-standard);
@@ -1,6 +1,5 @@
1
1
  import { HelixHeadlessInput } from '@fusion.dev/helix-headless/input';
2
2
  import type { CSSResultGroup } from 'lit';
3
- import '../../icon/index.js';
4
3
  /**
5
4
  * @summary A field for a single line of text.
6
5
  *
@@ -24,6 +23,9 @@ import '../../icon/index.js';
24
23
  * @documentation https://fusion.dev/helix/components/input
25
24
  *
26
25
  * @cssproperty --input-background-color - Fill behind the text.
26
+ * @cssproperty --input-border-color - Edge of the field at rest. Hover, focus and an error still draw their own.
27
+ * @cssproperty --input-padding-inline - Space between the edge of the field and what is inside it.
28
+ * @cssproperty --input-radius - Corner radius of the field.
27
29
  * @cssproperty --input-size - Height of the field.
28
30
  */
29
31
  export declare class HelixInput extends HelixHeadlessInput {
@@ -6,7 +6,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessInput } from '@fusion.dev/helix-headless/input';
9
- import '../../icon/index.js';
10
9
  import { styles as fieldStyles } from '../../shared/field/field.css.js';
11
10
  import { styles as fieldFrameStyles } from '../../shared/field/field-frame.css.js';
12
11
  import { styles as fieldStackedStyles } from '../../shared/field/field-stacked.css.js';
@@ -14,12 +14,12 @@ margin: var(--helix-space-none);
14
14
  padding: var(--helix-space-none);
15
15
  }
16
16
 
17
- [part="entry"] {
17
+ [part~="entry"] {
18
18
  align-items: center;
19
19
  color: var(--helix-color-foreground-muted);
20
20
  display: flex;
21
21
  font-size: var(--helix-text-sm);
22
- gap: var(--helix-space-2xs);
22
+ gap: var(--legend-entry-gap, var(--helix-space-2xs));
23
23
  line-height: var(--helix-leading-tight);
24
24
  }
25
25
 
@@ -28,23 +28,23 @@ line-height: var(--helix-leading-tight);
28
28
  flex-direction: column;
29
29
  }
30
30
 
31
- :host([placement="end"]) [part="entry"] {
31
+ :host([placement="end"]) [part~="entry"] {
32
32
  flex-direction: row-reverse;
33
33
  text-align: end;
34
34
  }
35
35
 
36
- [part="entry"]::before {
36
+ [part~="entry"]::before {
37
37
  --_legend-shade: color-mix(in oklab, var(--chart-series) 60%, var(--helix-color-background));
38
38
 
39
39
  block-size: var(--legend-swatch-size, var(--helix-space-sm));
40
40
 
41
- border-radius: var(--helix-radii-sm);
41
+ border-radius: var(--legend-swatch-radius, var(--helix-radii-sm));
42
42
  content: "";
43
43
  flex: 0 0 auto;
44
44
  inline-size: var(--legend-swatch-size, var(--helix-space-sm));
45
45
  }
46
46
 
47
- [part="entry"]::before {
47
+ [part~="entry"]::before {
48
48
  background-color: color-mix(
49
49
  in oklab,
50
50
  var(--chart-series) calc(var(--_legend-area, 1) * var(--_legend-through, 1) * 100%),
@@ -52,8 +52,8 @@ transparent
52
52
  );
53
53
  }
54
54
 
55
- [part="entry"][data-emphasis="outlined"]::before,
56
- :host([emphasis="outlined"]) [part="entry"]:not([data-emphasis])::before {
55
+ [part~="entry"][data-emphasis="outlined"]::before,
56
+ :host([emphasis="outlined"]) [part~="entry"]:not([data-emphasis])::before {
57
57
  background-color: color-mix(
58
58
  in oklab,
59
59
  var(--_legend-shade) calc(var(--_legend-through, 1) * 100%),
@@ -63,22 +63,49 @@ border: var(--legend-swatch-stroke, var(--helix-border-thick)) solid
63
63
  color-mix(in oklab, var(--chart-series) calc(var(--_legend-through, 1) * 100%), transparent);
64
64
  }
65
65
 
66
- [part="entry"][data-emphasis="subtle"]::before,
67
- :host([emphasis="subtle"]) [part="entry"]:not([data-emphasis])::before {
66
+ [part~="entry"][data-emphasis="subtle"]::before,
67
+ :host([emphasis="subtle"]) [part~="entry"]:not([data-emphasis])::before {
68
68
  --_legend-area: 0.2;
69
69
  border: var(--legend-swatch-stroke, var(--helix-border-thick)) solid
70
70
  color-mix(in oklab, var(--chart-series) calc(var(--_legend-through, 1) * 100%), transparent);
71
71
  }
72
72
 
73
- [part="entry"][data-material="glass"]::before,
74
- :host([material="glass"]) [part="entry"]:not([data-material])::before {
73
+ [part~="entry"][data-material="glass"]::before,
74
+ :host([material="glass"]) [part~="entry"]:not([data-material])::before {
75
75
  --_legend-through: calc(0.62 * var(--helix-material-opacity));
76
76
  }
77
77
 
78
- :host([material="frosted"]) [part="entry"]:not([data-material])::before {
78
+ :host([material="frosted"]) [part~="entry"]:not([data-material])::before {
79
79
  --_legend-through: calc(0.88 * var(--helix-material-opacity));
80
80
  }
81
81
 
82
+ [part="toggle"] {
83
+ all: unset;
84
+ box-sizing: border-box;
85
+ border-radius: var(--helix-radii-sm);
86
+ cursor: pointer;
87
+ }
88
+
89
+ [part="toggle"]:focus-visible {
90
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
91
+ outline-offset: var(--helix-size-focus-offset);
92
+ }
93
+
94
+ @media (hover: hover) {
95
+ [part="toggle"]:hover {
96
+ color: var(--helix-color-foreground);
97
+ }
98
+ }
99
+
100
+ [part~="entry-hidden"] {
101
+ opacity: var(--legend-hidden-opacity, 0.56);
102
+ }
103
+
104
+ [part~="entry-hidden"]::before {
105
+ background-color: transparent;
106
+ border: var(--legend-swatch-stroke, var(--helix-border-thick)) solid var(--chart-series);
107
+ }
108
+
82
109
  @media print {
83
110
  :host {
84
111
  print-color-adjust: economy;
@@ -14,6 +14,9 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
14
14
  * put a color in the headless tier. Charts and legends share the file, so both
15
15
  * use the same twenty-four color names.
16
16
  *
17
+ * Under `toggles`, each name is a button. A hidden series' entry fades and
18
+ * its swatch empties to an outline, so the color stays readable.
19
+ *
17
20
  * @since 0.1.0
18
21
  * @status stable
19
22
  * @category charts
@@ -22,7 +25,10 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
22
25
  * @documentation https://fusion.dev/helix/components/legend
23
26
  *
24
27
  * @cssproperty --legend-direction - The direction the entries run: `row`, which wraps, or `column`.
28
+ * @cssproperty --legend-entry-gap - The space between a swatch and its name.
25
29
  * @cssproperty --legend-gap - The space between entries.
30
+ * @cssproperty --legend-hidden-opacity - How strongly a hidden series' entry is drawn, under `toggles`.
31
+ * @cssproperty --legend-swatch-radius - The corner of the color swatch.
26
32
  * @cssproperty --legend-swatch-size - The size of the color swatch.
27
33
  * @cssproperty --legend-swatch-stroke - The width of the edge an `outlined` or
28
34
  * `subtle` swatch is drawn with.
@@ -29,7 +29,7 @@ let HelixLegend = class HelixLegend extends HelixHeadlessLegend {
29
29
  const outlined = slots(this.outlined);
30
30
  const subtle = slots(this.subtle);
31
31
  const glass = slots(this.glass);
32
- const entries = [...this.renderRoot.querySelectorAll('[part="entry"]')];
32
+ const entries = [...this.renderRoot.querySelectorAll('[part~="entry"]')];
33
33
  for (const [at, entry] of entries.entries()) {
34
34
  mark(entry, 'emphasis', outlined.has(at) ? 'outlined' : subtle.has(at) ? 'subtle' : undefined);
35
35
  mark(entry, 'material', glass.has(at) ? 'glass' : undefined);
@@ -17,6 +17,8 @@ inline-size: 100vw;
17
17
  max-block-size: 100dvh;
18
18
  max-inline-size: 100vw;
19
19
  padding: var(--lightbox-padding, var(--helix-space-md));
20
+
21
+ touch-action: pan-y pinch-zoom;
20
22
  }
21
23
 
22
24
  [part="dialog"]:focus-visible {
@@ -64,6 +66,88 @@ transition: none;
64
66
  }
65
67
  }
66
68
 
69
+ [part="previous"],
70
+ [part="next"],
71
+ [part="dismiss"] {
72
+ all: unset;
73
+
74
+ box-sizing: border-box;
75
+ align-items: center;
76
+ background-color: var(--helix-color-surface-overlay);
77
+ block-size: var(--lightbox-control-size, var(--helix-size-control));
78
+ border-radius: var(--helix-radii-full);
79
+ box-shadow: var(--helix-shadow-md);
80
+ color: var(--lightbox-foreground, var(--helix-color-foreground));
81
+ cursor: pointer;
82
+ display: inline-flex;
83
+ inline-size: var(--lightbox-control-size, var(--helix-size-control));
84
+ justify-content: center;
85
+ position: absolute;
86
+ transition:
87
+ opacity var(--helix-duration-fast) var(--helix-easing-standard),
88
+ visibility var(--helix-duration-fast) var(--helix-easing-standard);
89
+ }
90
+
91
+ [part="previous"],
92
+ [part="next"] {
93
+ inset-block-start: 50%;
94
+ translate: 0 -50%;
95
+ }
96
+
97
+ [part="previous"] {
98
+ inset-inline-start: var(--lightbox-padding, var(--helix-space-md));
99
+ }
100
+
101
+ [part="next"] {
102
+ inset-inline-end: var(--lightbox-padding, var(--helix-space-md));
103
+ }
104
+
105
+ [part="dismiss"] {
106
+ inset-block-start: var(--lightbox-padding, var(--helix-space-md));
107
+ inset-inline-end: var(--lightbox-padding, var(--helix-space-md));
108
+ }
109
+
110
+ [part="previous"] svg,
111
+ [part="next"] svg,
112
+ [part="dismiss"] svg {
113
+ block-size: var(--helix-size-icon);
114
+ inline-size: var(--helix-size-icon);
115
+ }
116
+
117
+ [part="previous"]:hover,
118
+ [part="next"]:hover,
119
+ [part="dismiss"]:hover {
120
+ background-color: var(--helix-color-surface-sunken);
121
+ }
122
+
123
+ [part="previous"]:focus-visible,
124
+ [part="next"]:focus-visible,
125
+ [part="dismiss"]:focus-visible {
126
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
127
+ outline-offset: var(--helix-size-focus-offset);
128
+ }
129
+
130
+ [part="previous"][aria-disabled="true"],
131
+ [part="next"][aria-disabled="true"] {
132
+ cursor: default;
133
+ opacity: 0.4;
134
+ }
135
+
136
+ :host(:state(idle)) [part="previous"],
137
+ :host(:state(idle)) [part="next"],
138
+ :host(:state(idle)) [part="dismiss"] {
139
+ opacity: 0;
140
+ visibility: hidden;
141
+ }
142
+
143
+ @media (prefers-reduced-motion: reduce) {
144
+ [part="previous"],
145
+ [part="next"],
146
+ [part="dismiss"] {
147
+ transition: none;
148
+ }
149
+ }
150
+
67
151
  @media print {
68
152
  :host {
69
153
  display: none;
@@ -23,6 +23,7 @@ import type { CSSResultGroup } from 'lit';
23
23
  *
24
24
  * @event {HelixActivateEvent} helix-activate - Fired after the shown item changes, when the element already holds the new item.
25
25
  *
26
+ * @cssproperty --lightbox-control-size - Size of the previous, next and close controls drawn with `controls`.
26
27
  * @cssproperty --lightbox-foreground - Color of the controls and text drawn over the content.
27
28
  * @cssproperty --lightbox-gap - Space between the header or footer and the content.
28
29
  * @cssproperty --lightbox-padding - Inset from the edges of the screen.
@@ -144,4 +144,14 @@ stroke-opacity: calc(0.62 * var(--helix-material-opacity));
144
144
 
145
145
  :host([material="frosted"]) [part="line"] {
146
146
  stroke-opacity: calc(0.88 * var(--helix-material-opacity));
147
+ }
148
+
149
+ [part="summary"] {
150
+ block-size: 1px;
151
+ clip-path: inset(50%);
152
+ inline-size: 1px;
153
+ margin: var(--helix-space-none);
154
+ overflow: hidden;
155
+ position: absolute;
156
+ white-space: nowrap;
147
157
  }`);
@@ -63,7 +63,13 @@ grid-column: 4;
63
63
  grid-row: 1 / span 2;
64
64
  }
65
65
 
66
- a[part="row"] {
66
+ [part="link"] {
67
+ align-items: center;
67
68
  color: inherit;
69
+ display: grid;
70
+ grid-column: 1 / 4;
71
+ grid-row: 1 / span 2;
72
+ grid-template-columns: subgrid;
73
+ grid-template-rows: subgrid;
68
74
  text-decoration: none;
69
75
  }`);
@@ -155,6 +155,16 @@ opacity: 1;
155
155
  }
156
156
  }
157
157
 
158
+ [part="svg"][hidden] {
159
+ display: inline;
160
+ visibility: hidden;
161
+ }
162
+
163
+ [part="mark"][hidden] {
164
+ display: flex;
165
+ visibility: hidden;
166
+ }
167
+
158
168
  @media print {
159
169
  :host {
160
170
  display: none;
@@ -4,8 +4,14 @@ import type { CSSResultGroup } from 'lit';
4
4
  * @summary Shows that work of unknown length is in progress.
5
5
  *
6
6
  * @description
7
- * Sized in `em`, so it matches the text beside it. The color is `currentColor`,
8
- * so it matches the text color around it, including inside a primary button.
7
+ * Sized from the loader size tokens, so a loader is the same size wherever it
8
+ * is placed and follows the density region it sits in. Set `--loader-size:
9
+ * 1em` to match the text beside it, as inside a button. The color is
10
+ * `currentColor`, so it matches the text color around it, including inside a
11
+ * primary button.
12
+ *
13
+ * While `delay` runs, the loader keeps its size and draws nothing, so the line
14
+ * it sits in does not move when it appears.
9
15
  *
10
16
  * @since 0.1.0
11
17
  * @status stable
@@ -14,12 +20,12 @@ import type { CSSResultGroup } from 'lit';
14
20
  * @documentation https://fusion.dev/helix/components/loader
15
21
  *
16
22
  * @cssproperty --loader-color - Color of the moving arc.
17
- * @cssproperty --loader-size - Diameter. Defaults to 1.5em.
23
+ * @cssproperty --loader-size - Diameter. Defaults to the size token that `size` picks, which is 1.5rem at the default density.
18
24
  * @cssproperty --loader-track-color - Color of the circle behind the arc.
19
25
  */
20
26
  export declare class HelixLoader extends HelixHeadlessLoader {
21
27
  /**
22
- * Diameter relative to the surrounding text.
28
+ * Diameter, from the loader size tokens.
23
29
  */
24
30
  size?: 'sm' | 'md' | 'lg';
25
31
  /**
@@ -90,7 +90,7 @@ svg[part="mark"] {
90
90
  color: var(--helix-color-foreground-subtle);
91
91
  }
92
92
 
93
- :host([checked]) svg[part="mark"] {
93
+ :host(:state(checked)) svg[part="mark"] {
94
94
  color: var(--helix-color-foreground);
95
95
  }
96
96
 
@@ -19,12 +19,9 @@ import type { CSSResultGroup } from 'lit';
19
19
  * @cssproperty --menu-background-color - Fill of the surface.
20
20
  * @cssproperty --menu-border-color - Color of the panel's edge.
21
21
  * @cssproperty --menu-border-width - Width of the panel's edge. Defaults to `--helix-border-floating`, which is `0`, so the panel stands out by its shadow unless a theme sets a border.
22
- * `--helix-border-floating`, which is `0`, so the panel is told apart by its lift unless a
23
- * theme says otherwise.
24
22
  * @cssproperty --menu-max-block-size - The tallest the menu grows before it scrolls.
25
23
  * @cssproperty --menu-min-inline-size - The narrowest the menu gets.
26
24
  * @cssproperty --menu-shadow - Shadow under the panel. Defaults to `--helix-shadow-floating`, so the panel keeps a shadow over any content below it.
27
- * floating surface sits over content nobody can predict, so it keeps a lift by default.
28
25
  */
29
26
  export declare class HelixMenu extends HelixHeadlessMenu {
30
27
  static styles: CSSResultGroup;
@@ -5,9 +5,30 @@ display: block;
5
5
 
6
6
  :host([show-value]) {
7
7
  align-items: center;
8
+ column-gap: var(--helix-space-sm);
8
9
  display: grid;
9
- gap: var(--helix-space-sm);
10
10
  grid-template-columns: 1fr auto;
11
+
12
+ row-gap: var(--meter-label-gap, var(--helix-space-2xs));
13
+ }
14
+
15
+ slot[name="label"]::slotted(*) {
16
+ color: var(--meter-label-color, var(--helix-color-foreground));
17
+ display: block;
18
+ font-size: var(--meter-label-size, var(--helix-text-sm));
19
+ grid-column: 1 / -1;
20
+ margin-block-end: var(--meter-label-gap, var(--helix-space-2xs));
21
+ }
22
+
23
+ :host([show-value]) slot[name="label"]::slotted(*) {
24
+ margin-block-end: 0;
25
+ }
26
+
27
+ :host([shape="arc"]) slot[name="label"]::slotted(*),
28
+ :host([shape="ring"]) slot[name="label"]::slotted(*) {
29
+
30
+ grid-column: 1;
31
+ margin-block: 0;
11
32
  }
12
33
 
13
34
  [part="value"] {
@@ -88,6 +109,7 @@ z-index: var(--helix-layer-raised);
88
109
  :host([shape="ring"]) {
89
110
  display: inline-grid;
90
111
  place-items: center;
112
+ row-gap: var(--meter-label-gap, var(--helix-space-2xs));
91
113
  }
92
114
 
93
115
  :host([shape="arc"]) [part="track"],
@@ -131,7 +153,7 @@ stroke-dasharray: var(--meter-sweep) 100;
131
153
  :host([shape="arc"]) [part~="indicator"],
132
154
  :host([shape="ring"]) [part~="indicator"] {
133
155
 
134
- --_meter-hue: var(--helix-color-foreground-muted);
156
+ --_meter-hue: var(--meter-color, var(--helix-color-foreground-muted));
135
157
  scale: none;
136
158
  stroke: var(--_meter-hue);
137
159
  stroke-dasharray: var(--meter-along) 100;
@@ -151,19 +173,19 @@ stroke-dashoffset: calc(var(--meter-along) * -1);
151
173
 
152
174
  :host([shape="arc"]) [part~="indicator"][data-band="good"],
153
175
  :host([shape="ring"]) [part~="indicator"][data-band="good"] {
154
- --_meter-hue: var(--helix-color-success);
176
+ --_meter-hue: var(--meter-color, var(--helix-color-success));
155
177
  stroke: var(--_meter-hue);
156
178
  }
157
179
 
158
180
  :host([shape="arc"]) [part~="indicator"][data-band="fair"],
159
181
  :host([shape="ring"]) [part~="indicator"][data-band="fair"] {
160
- --_meter-hue: var(--helix-color-warning);
182
+ --_meter-hue: var(--meter-color, var(--helix-color-warning));
161
183
  stroke: var(--_meter-hue);
162
184
  }
163
185
 
164
186
  :host([shape="arc"]) [part~="indicator"][data-band="poor"],
165
187
  :host([shape="ring"]) [part~="indicator"][data-band="poor"] {
166
- --_meter-hue: var(--helix-color-danger);
188
+ --_meter-hue: var(--meter-color, var(--helix-color-danger));
167
189
  stroke: var(--_meter-hue);
168
190
  }
169
191