@fusion.dev/helix 0.143.0 → 0.145.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 (211) hide show
  1. package/custom-elements.json +19817 -1238
  2. package/dist/accordion/item/accordion-item.css.js +14 -3
  3. package/dist/accordion/item/accordion-item.d.ts +2 -0
  4. package/dist/aura/palette.d.ts +38 -0
  5. package/dist/aura/palette.js +22 -0
  6. package/dist/aura/root/aura-root.css.js +24 -3
  7. package/dist/aura/root/aura-root.d.ts +42 -7
  8. package/dist/aura/root/aura-root.js +31 -25
  9. package/dist/badge/root/badge-root.css.js +35 -0
  10. package/dist/badge/root/badge-root.d.ts +16 -0
  11. package/dist/badge/root/badge-root.js +3 -0
  12. package/dist/blockquote/root/blockquote-root.css.js +5 -5
  13. package/dist/blockquote/root/blockquote-root.d.ts +5 -0
  14. package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +7 -7
  15. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +5 -0
  16. package/dist/breadcrumbs/root/breadcrumbs-root.css.js +1 -1
  17. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +3 -0
  18. package/dist/breadcrumbs/root/breadcrumbs-root.js +2 -0
  19. package/dist/button/root/button-root.css.js +38 -1
  20. package/dist/button/root/button-root.d.ts +5 -0
  21. package/dist/button/root/button-root.js +2 -1
  22. package/dist/button-group/root/button-group-root.d.ts +3 -0
  23. package/dist/callout/root/callout-root.css.js +69 -11
  24. package/dist/callout/root/callout-root.d.ts +25 -2
  25. package/dist/callout/root/callout-root.js +4 -0
  26. package/dist/canvas/root/canvas-root.css.js +1 -0
  27. package/dist/card/root/card-root.css.js +26 -1
  28. package/dist/card/root/card-root.d.ts +11 -0
  29. package/dist/carousel/root/carousel-root.css.js +17 -1
  30. package/dist/checkbox-group/root/checkbox-group-root.d.ts +2 -0
  31. package/dist/checkbox-group/root/checkbox-group-root.js +2 -0
  32. package/dist/code-block/root/code-block-root.css.js +23 -0
  33. package/dist/code-block/root/code-block-root.d.ts +15 -0
  34. package/dist/code-block/root/code-block-root.js +8 -0
  35. package/dist/color-picker/root/color-picker-root.css.js +64 -0
  36. package/dist/color-picker/root/color-picker-root.d.ts +2 -0
  37. package/dist/copy-button/root/copy-button-root.css.js +5 -0
  38. package/dist/data-table/root/data-table-root.css.js +63 -0
  39. package/dist/data-table/root/data-table-root.d.ts +1 -0
  40. package/dist/date-input/root/date-input-root.css.js +19 -0
  41. package/dist/date-input/root/date-input-root.d.ts +8 -0
  42. package/dist/date-input/root/date-input-root.js +2 -0
  43. package/dist/date-picker/root/date-picker-root.css.js +68 -0
  44. package/dist/date-picker/root/date-picker-root.d.ts +1 -0
  45. package/dist/description-list/item/description-list-item.css.js +11 -0
  46. package/dist/dialog/root/dialog-root.css.js +47 -0
  47. package/dist/divider/root/divider-root.css.js +8 -3
  48. package/dist/divider/root/divider-root.d.ts +17 -1
  49. package/dist/divider/root/divider-root.js +4 -0
  50. package/dist/drawer/root/drawer-root.css.js +28 -1
  51. package/dist/drilldown/item/drilldown-item.css.js +2 -1
  52. package/dist/drilldown/root/drilldown-root.css.js +2 -1
  53. package/dist/element-events.generated.js +66 -14
  54. package/dist/empty/root/empty-root.css.js +9 -9
  55. package/dist/empty/root/empty-root.d.ts +9 -0
  56. package/dist/file-input/root/file-input-root.js +2 -0
  57. package/dist/filter-input/root/filter-input-root.js +2 -0
  58. package/dist/flex/root/flex-root.css.js +134 -9
  59. package/dist/flex/root/flex-root.d.ts +51 -5
  60. package/dist/flex/root/flex-root.js +17 -1
  61. package/dist/grid/root/grid-root.css.js +114 -11
  62. package/dist/grid/root/grid-root.d.ts +37 -0
  63. package/dist/grid/root/grid-root.js +13 -1
  64. package/dist/heatmap/root/heatmap-root.css.js +33 -5
  65. package/dist/heatmap/root/heatmap-root.d.ts +4 -1
  66. package/dist/icon/index.d.ts +1 -0
  67. package/dist/icon/index.js +1 -0
  68. package/dist/icon/root/icon-root.d.ts +1 -1
  69. package/dist/icon/root/icon-root.js +1 -1
  70. package/dist/icon/root/index.d.ts +2 -0
  71. package/dist/icon/root/index.js +2 -0
  72. package/dist/icon-button/root/icon-button-root.css.js +37 -0
  73. package/dist/icon-button/root/icon-button-root.d.ts +4 -0
  74. package/dist/icon-button/root/icon-button-root.js +2 -1
  75. package/dist/input/root/input-root.css.js +3 -3
  76. package/dist/input/root/input-root.d.ts +3 -0
  77. package/dist/legend/root/legend-root.css.js +40 -13
  78. package/dist/legend/root/legend-root.d.ts +6 -0
  79. package/dist/legend/root/legend-root.js +1 -1
  80. package/dist/lightbox/root/lightbox-root.css.js +84 -0
  81. package/dist/lightbox/root/lightbox-root.d.ts +1 -0
  82. package/dist/list/item/list-item.css.js +21 -1
  83. package/dist/list/item/list-item.d.ts +3 -0
  84. package/dist/list/root/list-root.css.js +13 -1
  85. package/dist/loader/root/loader-root.css.js +10 -0
  86. package/dist/loader/root/loader-root.d.ts +3 -0
  87. package/dist/menu/index.d.ts +1 -0
  88. package/dist/menu/index.js +1 -0
  89. package/dist/menu/item/menu-item.css.js +15 -1
  90. package/dist/menu/item/menu-item.d.ts +3 -0
  91. package/dist/menu/item/menu-item.js +2 -0
  92. package/dist/menu/section/menu-section.css.d.ts +1 -0
  93. package/dist/menu/section/menu-section.css.js +14 -0
  94. package/dist/menu/section/menu-section.d.ts +24 -0
  95. package/dist/menu/section/menu-section.js +16 -0
  96. package/dist/meter/root/meter-root.css.js +23 -1
  97. package/dist/meter/root/meter-root.d.ts +5 -0
  98. package/dist/navigation/root/navigation-root.css.js +3 -2
  99. package/dist/navigation/root/navigation-root.d.ts +6 -0
  100. package/dist/notifications/notification/notification.css.js +5 -0
  101. package/dist/notifications/root/notifications-root.css.js +24 -1
  102. package/dist/notifications/root/notifications-root.d.ts +1 -0
  103. package/dist/number-input/root/number-input-root.css.js +3 -3
  104. package/dist/number-input/root/number-input-root.d.ts +3 -0
  105. package/dist/object-inspector/root/object-inspector-root.css.js +36 -1
  106. package/dist/object-inspector/root/object-inspector-root.d.ts +4 -1
  107. package/dist/object-inspector/root/object-inspector-root.js +2 -1
  108. package/dist/orb/index.d.ts +1 -1
  109. package/dist/orb/index.js +1 -1
  110. package/dist/orb/root/orb-root.d.ts +31 -5
  111. package/dist/orb/root/orb-root.js +33 -4
  112. package/dist/outline/root/outline-root.css.js +10 -0
  113. package/dist/outline/root/outline-root.d.ts +7 -0
  114. package/dist/pin-input/root/pin-input-root.css.js +12 -5
  115. package/dist/pin-input/root/pin-input-root.d.ts +5 -0
  116. package/dist/popover/root/popover-root.css.js +36 -0
  117. package/dist/popover/root/popover-root.d.ts +1 -0
  118. package/dist/progress/root/progress-root.css.js +22 -1
  119. package/dist/progress/root/progress-root.d.ts +5 -0
  120. package/dist/quote/root/quote-root.css.js +1 -1
  121. package/dist/quote/root/quote-root.d.ts +1 -0
  122. package/dist/sandbox/frame.d.ts +63 -0
  123. package/dist/sandbox/frame.js +132 -0
  124. package/dist/sandbox/index.d.ts +1 -0
  125. package/dist/sandbox/index.js +1 -0
  126. package/dist/sandbox/levels.d.ts +10 -0
  127. package/dist/sandbox/levels.js +5 -0
  128. package/dist/sandbox/root/sandbox-root.d.ts +3 -0
  129. package/dist/sandbox/root/sandbox-root.js +13 -3
  130. package/dist/sandbox/source/sandbox-source.d.ts +1 -0
  131. package/dist/sandbox/source/sandbox-source.js +7 -3
  132. package/dist/sandbox/terminal/sandbox-terminal.css.js +39 -0
  133. package/dist/sandbox/terminal/sandbox-terminal.d.ts +42 -1
  134. package/dist/sandbox/terminal/sandbox-terminal.js +47 -3
  135. package/dist/scroll-area/root/scroll-area-root.css.js +83 -1
  136. package/dist/scroll-area/root/scroll-area-root.d.ts +6 -0
  137. package/dist/shared/chart/tooltip.css.js +25 -2
  138. package/dist/shared/field/field-segments.css.d.ts +1 -0
  139. package/dist/shared/field/field-segments.css.js +40 -0
  140. package/dist/skeleton/root/skeleton-root.css.js +56 -5
  141. package/dist/skeleton/root/skeleton-root.d.ts +17 -1
  142. package/dist/skeleton/root/skeleton-root.js +3 -0
  143. package/dist/skip-link/root/skip-link-root.css.js +8 -8
  144. package/dist/skip-link/root/skip-link-root.d.ts +9 -0
  145. package/dist/speed-dial/item/speed-dial-item.css.js +11 -4
  146. package/dist/speed-dial/item/speed-dial-item.d.ts +4 -0
  147. package/dist/speed-dial/root/speed-dial-root.css.js +7 -3
  148. package/dist/speed-dial/root/speed-dial-root.d.ts +9 -0
  149. package/dist/speed-dial/root/speed-dial-root.js +4 -0
  150. package/dist/stat/root/stat-root.css.js +7 -7
  151. package/dist/stat/root/stat-root.d.ts +8 -0
  152. package/dist/steps/step/step.js +2 -1
  153. package/dist/switch/root/switch-root.css.js +13 -5
  154. package/dist/switch/root/switch-root.d.ts +25 -1
  155. package/dist/switch/root/switch-root.js +7 -0
  156. package/dist/table/root/table-root.css.js +18 -0
  157. package/dist/table/root/table-root.d.ts +6 -0
  158. package/dist/table/root/table-root.js +2 -0
  159. package/dist/table/row/table-row.css.js +18 -0
  160. package/dist/table/row/table-row.d.ts +2 -0
  161. package/dist/table/row/table-row.js +2 -0
  162. package/dist/tabs/panel/tab-panel.css.js +5 -1
  163. package/dist/tabs/root/tabs-root.css.js +56 -1
  164. package/dist/tabs/tab/tab.css.js +5 -1
  165. package/dist/tag/group/tag-group.css.d.ts +1 -0
  166. package/dist/tag/group/tag-group.css.js +6 -0
  167. package/dist/tag/group/tag-group.d.ts +25 -0
  168. package/dist/tag/group/tag-group.js +16 -0
  169. package/dist/tag/index.d.ts +1 -0
  170. package/dist/tag/index.js +1 -0
  171. package/dist/tag/root/tag-root.css.js +50 -0
  172. package/dist/tag/root/tag-root.d.ts +4 -0
  173. package/dist/text/clamp.d.ts +8 -0
  174. package/dist/text/clamp.js +1 -0
  175. package/dist/text/root/text-root.css.js +85 -45
  176. package/dist/text/root/text-root.d.ts +48 -7
  177. package/dist/text/root/text-root.js +17 -11
  178. package/dist/textarea/root/textarea-root.css.js +12 -4
  179. package/dist/textarea/root/textarea-root.d.ts +4 -0
  180. package/dist/time-input/root/time-input-root.css.js +19 -0
  181. package/dist/time-input/root/time-input-root.d.ts +8 -0
  182. package/dist/time-input/root/time-input-root.js +2 -0
  183. package/dist/timeline/group/timeline-group.css.d.ts +1 -0
  184. package/dist/timeline/group/timeline-group.css.js +32 -0
  185. package/dist/timeline/group/timeline-group.d.ts +25 -0
  186. package/dist/timeline/group/timeline-group.js +16 -0
  187. package/dist/timeline/index.d.ts +1 -0
  188. package/dist/timeline/index.js +1 -0
  189. package/dist/timeline/item/timeline-item.css.js +43 -16
  190. package/dist/timeline/root/timeline-root.css.js +56 -0
  191. package/dist/timeline/root/timeline-root.d.ts +26 -0
  192. package/dist/timeline/root/timeline-root.js +7 -0
  193. package/dist/toast/item/toast-item.css.js +16 -0
  194. package/dist/toggle/group/toggle-group.css.js +16 -0
  195. package/dist/toolbar/root/toolbar-root.css.js +3 -0
  196. package/dist/toolbar/root/toolbar-root.d.ts +3 -0
  197. package/dist/tour/root/tour-root.css.js +8 -0
  198. package/dist/tour/stop/tour-stop.css.js +32 -0
  199. package/dist/tree/item/tree-item.css.js +72 -0
  200. package/dist/tree/item/tree-item.d.ts +10 -0
  201. package/dist/trend/root/trend-root.css.js +12 -5
  202. package/dist/trend/root/trend-root.d.ts +6 -1
  203. package/dist/video/root/video-root.css.js +6 -0
  204. package/dist/video/root/video-root.d.ts +3 -0
  205. package/dist/virtual-list/root/virtual-list-root.css.js +5 -0
  206. package/dist/virtual-list/root/virtual-list-root.d.ts +4 -3
  207. package/lint.json +1 -1
  208. package/package.json +6 -6
  209. package/types/jsx.d.ts +8620 -813
  210. package/types/svelte.d.ts +3 -0
  211. package/types/vue.d.ts +2372 -213
@@ -1,4 +1,22 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`:host {
3
3
  display: contents;
4
+ }
5
+
6
+ [part~="select"] {
7
+ align-items: center;
8
+ border-block-end: var(--helix-border-thin) solid var(--helix-color-border);
9
+ box-sizing: border-box;
10
+ display: flex;
11
+ min-block-size: var(--helix-size-control);
12
+ padding-inline: var(--helix-space-none) var(--helix-space-md);
13
+ }
14
+
15
+ :host(:state(selected)) [part~="select"],
16
+ :host(:state(selected)) ::slotted(*) {
17
+ background-color: color-mix(
18
+ in srgb,
19
+ var(--helix-color-primary) 10%,
20
+ var(--helix-color-background)
21
+ );
4
22
  }`);
@@ -1,5 +1,6 @@
1
1
  import { HelixHeadlessTableRow } from '@fusion.dev/helix-headless/table';
2
2
  import type { CSSResultGroup } from 'lit';
3
+ import '../../checkbox/index.js';
3
4
  /**
4
5
  * @summary One row of a table.
5
6
  *
@@ -16,6 +17,7 @@ import type { CSSResultGroup } from 'lit';
16
17
  * @slot - The row's cells.
17
18
  */
18
19
  export declare class HelixTableRow extends HelixHeadlessTableRow {
20
+ static tier: string;
19
21
  static styles: CSSResultGroup;
20
22
  }
21
23
  declare global {
@@ -7,7 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessTableRow } from '@fusion.dev/helix-headless/table';
9
9
  import { styles } from './table-row.css.js';
10
+ import '../../checkbox/index.js';
10
11
  let HelixTableRow = class HelixTableRow extends HelixHeadlessTableRow {
12
+ static { this.tier = 'helix-'; }
11
13
  static { this.styles = styles; }
12
14
  };
13
15
  HelixTableRow = __decorate([
@@ -8,7 +8,11 @@ display: contents;
8
8
  min-block-size: 0;
9
9
  min-inline-size: 0;
10
10
  outline: none;
11
- padding-block-start: var(--tabs-panel-padding-block-start, var(--helix-space-md));
11
+ padding-block-start: var(
12
+ --tabs-panel-padding-block-start,
13
+ var(--_tabs-panel-padding-block-start, var(--helix-space-md))
14
+ );
15
+ padding-inline-start: var(--_tabs-panel-padding-inline-start, var(--helix-space-none));
12
16
  }
13
17
 
14
18
  [part="panel"][hidden] {
@@ -67,7 +67,8 @@ inset-inline-start: 0;
67
67
  opacity: 0;
68
68
  position: absolute;
69
69
 
70
- translate: var(--indicator-x, 0) calc(var(--indicator-y, 0px) + var(--_indicator-offset, 0px));
70
+ translate: calc(var(--indicator-x, 0px) + var(--_indicator-offset-x, 0px))
71
+ calc(var(--indicator-y, 0px) + var(--_indicator-offset, 0px));
71
72
 
72
73
  transition:
73
74
  translate var(--helix-duration-normal) var(--helix-easing-emphasized),
@@ -126,6 +127,60 @@ var(--tabs-indicator-thickness, var(--helix-border-thick))
126
127
  --_tab-selected-shadow: none;
127
128
  }
128
129
 
130
+ :host([orientation="vertical"]) {
131
+
132
+ --_tabs-inline-sign: 1;
133
+ --_tabs-panel-padding-block-start: var(--helix-space-none);
134
+ --_tabs-panel-padding-inline-start: var(--helix-space-md);
135
+
136
+ grid-template-columns: auto minmax(0, 1fr);
137
+ grid-template-rows: minmax(0, 1fr);
138
+ }
139
+
140
+ :host([orientation="vertical"]:dir(rtl)) {
141
+ --_tabs-inline-sign: -1;
142
+ }
143
+
144
+ :host([orientation="vertical"]) [part="tabs"] {
145
+ align-content: start;
146
+ background-position: right;
147
+ background-repeat: repeat-y;
148
+ background-size: var(--helix-border-thin) 100%;
149
+ flex-direction: column;
150
+ overflow-x: visible;
151
+ overflow-y: auto;
152
+ }
153
+
154
+ :host([orientation="vertical"]:dir(rtl)) [part="tabs"] {
155
+ background-position: left;
156
+ }
157
+
158
+ :host([orientation="vertical"]) ::slotted(helix-tab) {
159
+ --_tab-inline-size: 100%;
160
+ --_tab-justify: flex-start;
161
+ }
162
+
163
+ :host([orientation="vertical"][variant="segmented"]) [part="tabs"] {
164
+ --_tab-height: initial;
165
+
166
+ block-size: auto;
167
+ justify-self: start;
168
+ }
169
+
170
+ :host([orientation="vertical"][variant="underlined"]) [part="indicator"] {
171
+ --_indicator-block: var(--indicator-block-size, 0);
172
+ --_indicator-offset: 0px;
173
+ --_indicator-offset-x: calc(
174
+ (
175
+ var(--indicator-inline-size, 0px) -
176
+ var(--tabs-indicator-thickness, var(--helix-border-thick))
177
+ ) *
178
+ var(--_tabs-inline-sign, 1)
179
+ );
180
+
181
+ inline-size: var(--tabs-indicator-thickness, var(--helix-border-thick));
182
+ }
183
+
129
184
  @media print {
130
185
  :host {
131
186
  box-shadow: none;
@@ -18,8 +18,12 @@ font: inherit;
18
18
  font-size: var(--helix-text-sm);
19
19
  font-weight: var(--helix-weight-medium);
20
20
  display: inline-flex;
21
- justify-content: center;
21
+
22
+ inline-size: var(--_tab-inline-size, auto);
23
+ justify-content: var(--_tab-justify, center);
22
24
  padding-inline: var(--tabs-tab-padding-inline, var(--helix-space-sm));
25
+
26
+ text-decoration: none;
23
27
  transition:
24
28
  background-color var(--helix-duration-fast) var(--helix-easing-standard),
25
29
  border-color var(--helix-duration-normal) var(--helix-easing-emphasized),
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,6 @@
1
+ import { createSheet } from '@fusion.dev/helix-core';
2
+ export const styles = createSheet(`:host {
3
+ display: flex;
4
+ flex-wrap: wrap;
5
+ gap: var(--tag-group-gap, var(--helix-space-2xs));
6
+ }`);
@@ -0,0 +1,25 @@
1
+ import { HelixHeadlessTagGroup } from '@fusion.dev/helix-headless/tag';
2
+ import type { CSSResultGroup } from 'lit';
3
+ /**
4
+ * @summary A set of tags that the arrow keys move through, and that can be removed and selected from the keyboard.
5
+ *
6
+ * @description
7
+ * The tags sit in a row that wraps. A selected tag is filled with its tone, as
8
+ * `emphasis="solid"` draws one, and the focused tag takes the focus ring round
9
+ * its whole box.
10
+ *
11
+ * @since 0.1.0
12
+ * @status stable
13
+ * @aliases Tag list, Chip group, Token list
14
+ * @documentation https://fusion.dev/helix/components/tag
15
+ *
16
+ * @cssproperty --tag-group-gap - The space between tags, across and between rows.
17
+ */
18
+ export declare class HelixTagGroup extends HelixHeadlessTagGroup {
19
+ static styles: CSSResultGroup;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'helix-tag-group': HelixTagGroup;
24
+ }
25
+ }
@@ -0,0 +1,16 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { customElement } from '@fusion.dev/helix-core';
8
+ import { HelixHeadlessTagGroup } from '@fusion.dev/helix-headless/tag';
9
+ import { styles } from './tag-group.css.js';
10
+ let HelixTagGroup = class HelixTagGroup extends HelixHeadlessTagGroup {
11
+ static { this.styles = styles; }
12
+ };
13
+ HelixTagGroup = __decorate([
14
+ customElement('helix-tag-group')
15
+ ], HelixTagGroup);
16
+ export { HelixTagGroup };
@@ -1 +1,2 @@
1
+ export * from './group/tag-group.js';
1
2
  export * from './root/tag-root.js';
package/dist/tag/index.js CHANGED
@@ -1 +1,2 @@
1
+ export * from './group/tag-group.js';
1
2
  export * from './root/tag-root.js';
@@ -110,6 +110,56 @@ margin-inline-end: var(--_tag-inset);
110
110
  opacity: 0.75;
111
111
  }
112
112
 
113
+ [part="link"] {
114
+ color: inherit;
115
+ display: block;
116
+ min-inline-size: 0;
117
+ text-decoration: none;
118
+ }
119
+
120
+ @media (hover: hover) {
121
+ [part="link"][href]:hover {
122
+ text-decoration: underline;
123
+ }
124
+ }
125
+
126
+ [part="link"]:focus-visible {
127
+ border-radius: var(--helix-radii-sm);
128
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
129
+ outline-offset: var(--helix-size-focus-offset);
130
+ }
131
+
132
+ :host([disabled]) {
133
+ opacity: var(--tag-disabled-opacity, 0.5);
134
+ }
135
+
136
+ :host([disabled]) [part="dismiss"] {
137
+ cursor: not-allowed;
138
+ }
139
+
140
+ [part="cell"] {
141
+ align-items: center;
142
+ align-self: stretch;
143
+ border-radius: inherit;
144
+ cursor: default;
145
+ display: inline-flex;
146
+ gap: var(--helix-space-2xs);
147
+ margin-inline: calc(var(--_tag-inset) * -1);
148
+ min-inline-size: 0;
149
+ padding-inline: var(--_tag-inset);
150
+ }
151
+
152
+ [part="cell"]:focus-visible {
153
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
154
+ outline-offset: var(--helix-size-focus-offset);
155
+ }
156
+
157
+ :host(:state(selected)) {
158
+ --_tag-fill: color-mix(in oklab, var(--_tag-color) 82%, var(--helix-color-foreground));
159
+ --_tag-edge: var(--_tag-fill);
160
+ --_tag-label: var(--helix-color-foreground-inverse);
161
+ }
162
+
113
163
  @media print {
114
164
  :host {
115
165
  print-color-adjust: economy;
@@ -14,13 +14,17 @@ import type { CSSResultGroup } from 'lit';
14
14
  * @documentation https://fusion.dev/helix/components/tag
15
15
  *
16
16
  * @slot - The tag's label.
17
+ * @slot dismiss-icon - Replaces the glyph on the remove button.
17
18
  *
18
19
  * @event {HelixDismissEvent} helix-dismiss - The remove button was pressed. The tag does not remove itself, so remove it in response. Cancelable.
19
20
  *
21
+ * @csspart cell - The grid cell in a `Tag.Group`, which takes focus and draws the ring round the whole tag.
20
22
  * @csspart dismiss - The remove button, when `dismissible`.
23
+ * @csspart link - The link around the label, under `href`.
21
24
  *
22
25
  * @cssproperty --tag-background-color - The fill behind the tag.
23
26
  * @cssproperty --tag-border-color - The color of the tag's edge.
27
+ * @cssproperty --tag-disabled-opacity - How strongly a `disabled` tag is drawn.
24
28
  * @cssproperty --tag-foreground-color - The label color.
25
29
  * @cssproperty --tag-radius - The corner radius of the tag.
26
30
  */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The line count `lines` asks for, as the declaration that clamps it, or
3
+ * `undefined` where it is no whole number above zero.
4
+ *
5
+ * Written on the part inside the shadow root, so any count works with no rule
6
+ * per number, and the server renders it with the rest of the template.
7
+ */
8
+ export declare const clampOf: (lines: number | undefined) => string | undefined;
@@ -0,0 +1 @@
1
+ export const clampOf = (lines) => Number.isInteger(lines) && lines > 0 ? `-webkit-line-clamp: ${lines}` : undefined;
@@ -1,6 +1,12 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`:host {
3
3
  display: inline;
4
+
5
+ font-family: var(--text-font-family);
6
+ font-size: var(--text-font-size);
7
+ font-weight: var(--text-font-weight);
8
+ letter-spacing: var(--text-letter-spacing);
9
+ line-height: var(--text-line-height);
4
10
  }
5
11
 
6
12
  :host([as="p"]),
@@ -15,84 +21,84 @@ display: block;
15
21
 
16
22
  :host([variant="display"]),
17
23
  :host(:not([variant])[as="h1"]) {
18
- font-family: var(--helix-font-display);
19
- font-size: var(--helix-text-3xl);
20
- font-weight: var(--helix-weight-semibold);
21
- letter-spacing: var(--helix-tracking-tight);
22
- line-height: var(--helix-leading-heading);
24
+ font-family: var(--text-font-family, var(--helix-font-display));
25
+ font-size: var(--text-font-size, var(--helix-text-3xl));
26
+ font-weight: var(--text-font-weight, var(--helix-weight-semibold));
27
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-tight));
28
+ line-height: var(--text-line-height, var(--helix-leading-heading));
23
29
  }
24
30
 
25
31
  :host([variant="heading"]),
26
32
  :host(:not([variant])[as="h2"]) {
27
- font-family: var(--helix-font-sans);
28
- font-size: var(--helix-text-2xl);
29
- font-weight: var(--helix-weight-semibold);
30
- letter-spacing: var(--helix-tracking-tight);
31
- line-height: var(--helix-leading-heading);
33
+ font-family: var(--text-font-family, var(--helix-font-sans));
34
+ font-size: var(--text-font-size, var(--helix-text-2xl));
35
+ font-weight: var(--text-font-weight, var(--helix-weight-semibold));
36
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-tight));
37
+ line-height: var(--text-line-height, var(--helix-leading-heading));
32
38
  }
33
39
 
34
40
  :host([variant="subheading"]),
35
41
  :host(:not([variant])[as="h3"]) {
36
- font-family: var(--helix-font-sans);
37
- font-size: var(--helix-text-xl);
38
- font-weight: var(--helix-weight-semibold);
39
- letter-spacing: var(--helix-tracking-tight);
40
- line-height: var(--helix-leading-heading);
42
+ font-family: var(--text-font-family, var(--helix-font-sans));
43
+ font-size: var(--text-font-size, var(--helix-text-xl));
44
+ font-weight: var(--text-font-weight, var(--helix-weight-semibold));
45
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-tight));
46
+ line-height: var(--text-line-height, var(--helix-leading-heading));
41
47
  }
42
48
 
43
49
  :host([variant="title"]),
44
50
  :host(:not([variant])[as="h4"]) {
45
- font-family: var(--helix-font-sans);
46
- font-size: var(--helix-text-lg);
47
- font-weight: var(--helix-weight-semibold);
48
- letter-spacing: var(--helix-tracking-normal);
49
- line-height: var(--helix-leading-heading);
51
+ font-family: var(--text-font-family, var(--helix-font-sans));
52
+ font-size: var(--text-font-size, var(--helix-text-lg));
53
+ font-weight: var(--text-font-weight, var(--helix-weight-semibold));
54
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-normal));
55
+ line-height: var(--text-line-height, var(--helix-leading-heading));
50
56
  }
51
57
 
52
58
  :host([variant="body"]),
53
59
  :host(:not([variant])[as="p"]) {
54
- font-family: var(--helix-font-sans);
55
- font-size: var(--helix-text-md);
56
- font-weight: var(--helix-weight-regular);
57
- letter-spacing: var(--helix-tracking-normal);
58
- line-height: var(--helix-leading-normal);
60
+ font-family: var(--text-font-family, var(--helix-font-sans));
61
+ font-size: var(--text-font-size, var(--helix-text-md));
62
+ font-weight: var(--text-font-weight, var(--helix-weight-regular));
63
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-normal));
64
+ line-height: var(--text-line-height, var(--helix-leading-normal));
59
65
  }
60
66
 
61
67
  :host([variant="body-strong"]),
62
68
  :host(:not([variant])[as="h5"]),
63
69
  :host(:not([variant])[as="h6"]),
64
70
  :host(:not([variant])[as="strong"]) {
65
- font-family: var(--helix-font-sans);
66
- font-size: var(--helix-text-md);
67
- font-weight: var(--helix-weight-medium);
68
- letter-spacing: var(--helix-tracking-normal);
69
- line-height: var(--helix-leading-normal);
71
+ font-family: var(--text-font-family, var(--helix-font-sans));
72
+ font-size: var(--text-font-size, var(--helix-text-md));
73
+ font-weight: var(--text-font-weight, var(--helix-weight-medium));
74
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-normal));
75
+ line-height: var(--text-line-height, var(--helix-leading-normal));
70
76
  }
71
77
 
72
78
  :host([variant="caption"]) {
73
- font-family: var(--helix-font-sans);
74
- font-size: var(--helix-text-sm);
75
- font-weight: var(--helix-weight-regular);
76
- letter-spacing: var(--helix-tracking-normal);
77
- line-height: var(--helix-leading-normal);
79
+ font-family: var(--text-font-family, var(--helix-font-sans));
80
+ font-size: var(--text-font-size, var(--helix-text-sm));
81
+ font-weight: var(--text-font-weight, var(--helix-weight-regular));
82
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-normal));
83
+ line-height: var(--text-line-height, var(--helix-leading-normal));
78
84
  }
79
85
 
80
86
  :host([variant="label"]),
81
87
  :host(:not([variant])[as="label"]) {
82
- font-family: var(--helix-font-sans);
83
- font-size: var(--helix-text-xs);
84
- font-weight: var(--helix-weight-medium);
85
- letter-spacing: var(--helix-tracking-wide);
86
- line-height: var(--helix-leading-normal);
88
+ font-family: var(--text-font-family, var(--helix-font-sans));
89
+ font-size: var(--text-font-size, var(--helix-text-xs));
90
+ font-weight: var(--text-font-weight, var(--helix-weight-medium));
91
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-wide));
92
+ line-height: var(--text-line-height, var(--helix-leading-normal));
87
93
  }
88
94
 
89
95
  :host([variant="code"]),
90
96
  :host(:not([variant])[as="code"]) {
91
- font-family: var(--helix-font-mono);
92
- font-size: var(--helix-text-xs);
93
- font-weight: var(--helix-weight-regular);
94
- letter-spacing: var(--helix-tracking-normal);
95
- line-height: var(--helix-leading-normal);
97
+ font-family: var(--text-font-family, var(--helix-font-mono));
98
+ font-size: var(--text-font-size, var(--helix-text-xs));
99
+ font-weight: var(--text-font-weight, var(--helix-weight-regular));
100
+ letter-spacing: var(--text-letter-spacing, var(--helix-tracking-normal));
101
+ line-height: var(--text-line-height, var(--helix-leading-normal));
96
102
  }
97
103
 
98
104
  :host(
@@ -175,6 +181,40 @@ letter-spacing: inherit;
175
181
  margin: var(--helix-space-none);
176
182
  }
177
183
 
184
+ :host([lines]) {
185
+ display: block;
186
+ min-inline-size: 0;
187
+ }
188
+
189
+ :host([lines]) [part="text"] {
190
+ -webkit-box-orient: vertical;
191
+ display: -webkit-box;
192
+ overflow: hidden;
193
+ }
194
+
195
+ :host([text-align="start"]) {
196
+ text-align: start;
197
+ }
198
+ :host([text-align="center"]) {
199
+ text-align: center;
200
+ }
201
+ :host([text-align="end"]) {
202
+ text-align: end;
203
+ }
204
+ :host([text-align="justify"]) {
205
+ text-align: justify;
206
+ }
207
+
208
+ :host([text-wrap="balance"]) {
209
+ text-wrap: balance;
210
+ }
211
+ :host([text-wrap="pretty"]) {
212
+ text-wrap: pretty;
213
+ }
214
+ :host([text-wrap="nowrap"]) {
215
+ text-wrap: nowrap;
216
+ }
217
+
178
218
  :host([as="em"]) [part="text"] {
179
219
  font-style: italic;
180
220
  }
@@ -25,6 +25,14 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
25
25
  * state. Combining them would need a variant for every pair, such as
26
26
  * `caption-danger` and `label-muted`.
27
27
  *
28
+ * `lines` cuts the text off after that many lines and ends it with an
29
+ * ellipsis. `text-wrap` balances or tidies the line breaks, and `text-align`
30
+ * sets the alignment. Each `--text-*` property overrides one value of the
31
+ * ramp, for a text or for every text inside an element.
32
+ *
33
+ * **To label a control, write a native `<label data-text="label">`.** The
34
+ * base layer gives it the label ramp. A Helix field takes its own `label`.
35
+ *
28
36
  * @since 0.1.0
29
37
  * @status stable
30
38
  * @category typography
@@ -34,6 +42,12 @@ import type { CSSResultGroup, PropertyValues } from 'lit';
34
42
  * @slot - The text.
35
43
  *
36
44
  * @csspart text - The rendered element.
45
+ *
46
+ * @cssproperty --text-font-family - The typeface. Overrides the ramp's.
47
+ * @cssproperty --text-font-size - The size. Overrides the ramp's.
48
+ * @cssproperty --text-font-weight - The weight. Overrides the ramp's.
49
+ * @cssproperty --text-letter-spacing - The tracking. Overrides the ramp's.
50
+ * @cssproperty --text-line-height - The leading. Overrides the ramp's.
37
51
  */
38
52
  export declare class HelixText extends HelixElement {
39
53
  /**
@@ -41,12 +55,14 @@ export declare class HelixText extends HelixElement {
41
55
  *
42
56
  * Decides the outline and the semantics.
43
57
  *
44
- * **`label` gives the label ramp and labels no control.** The element is in
45
- * this one's shadow root, which neither `for` nor a wrapped control can
46
- * reach, so a page that writes either is warned. Name a Helix field with its
47
- * own `label`, and a native control with `<label data-text="label">`.
58
+ * **`label` is deprecated and no longer listed.** The element is in this
59
+ * one's shadow root, which neither `for` nor a wrapped control can reach, so
60
+ * it labeled nothing. Written anyway, it still renders a `<label>` in the
61
+ * label ramp and warns. Use `variant="label"` for the look, a native
62
+ * `<label data-text="label">` to label a native control, and a Helix field's
63
+ * own `label`.
48
64
  */
49
- as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'strong' | 'em' | 'code' | 'label';
65
+ as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'strong' | 'em' | 'code';
50
66
  /**
51
67
  * Makes the text quieter: `muted`, or the quieter `subtle`.
52
68
  *
@@ -64,6 +80,33 @@ export declare class HelixText extends HelixElement {
64
80
  * The resting case is the absent attribute, full strength.
65
81
  */
66
82
  emphasis?: 'muted' | 'subtle';
83
+ /**
84
+ * The most lines to show. Text past the last one is cut off with an
85
+ * ellipsis.
86
+ *
87
+ * Lays the text out as a block, because a line count needs a width to break
88
+ * against. The whole text stays in the page, so a screen reader and a search
89
+ * still read all of it. Set it as an attribute, such as `lines="1"` for a
90
+ * single line.
91
+ */
92
+ lines?: number;
93
+ /**
94
+ * How the lines align, set as `text-align`.
95
+ *
96
+ * Named for the CSS property it sets. `align` alone is a legacy HTML
97
+ * attribute the browser maps to `text-align` by itself on any element, and
98
+ * it has no `start` or `end`.
99
+ */
100
+ textAlign?: 'start' | 'center' | 'end' | 'justify';
101
+ /**
102
+ * How the lines break, set as `text-wrap`.
103
+ *
104
+ * `balance` evens out the length of every line, for a heading of a few
105
+ * lines. `pretty` avoids a last line of one short word, for a paragraph.
106
+ * `nowrap` keeps the text on one line. Absent, the lines break as the
107
+ * browser breaks them.
108
+ */
109
+ textWrap?: 'balance' | 'pretty' | 'nowrap';
67
110
  /**
68
111
  * The meaning of the text, shown by its color, such as `danger` or `success`.
69
112
  * It is set separately from `variant`.
@@ -84,8 +127,6 @@ export declare class HelixText extends HelixElement {
84
127
  */
85
128
  variant?: 'display' | 'heading' | 'subheading' | 'title' | 'body' | 'body-strong' | 'caption' | 'label' | 'code';
86
129
  protected updated(changed: PropertyValues): void;
87
- /** Whether the page wrote this as the label of a control, which it cannot be. */
88
- private labelsNothing;
89
130
  protected render(): unknown;
90
131
  static styles: CSSResultGroup;
91
132
  }
@@ -5,8 +5,10 @@ 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
  import { customElement, HelixElement, reportRuntime } from '@fusion.dev/helix-core';
8
+ import { nothing } from 'lit';
8
9
  import { property } from 'lit/decorators.js';
9
10
  import { literal, html as staticHtml } from 'lit/static-html.js';
11
+ import { clampOf } from '../clamp.js';
10
12
  import { styles } from './text-root.css.js';
11
13
  const TAGS = {
12
14
  code: literal `code`,
@@ -25,25 +27,20 @@ const TAGS = {
25
27
  let HelixText = class HelixText extends HelixElement {
26
28
  updated(changed) {
27
29
  super.updated(changed);
28
- if (changed.has('as') && this.as === 'label' && this.labelsNothing()) {
30
+ if (changed.has('as') && this.as === 'label') {
29
31
  reportRuntime({
30
32
  kind: 'unreachable-label',
31
- message: '<helix-text as="label"> names no control: its label is in a shadow root, which ' +
32
- '`for` and a wrapped control cannot reach. Give a Helix field its own `label`, or ' +
33
- 'write `<label data-text="label">` for a native control.',
33
+ message: '<helix-text as="label"> is deprecated: its label is in a shadow root, which `for` ' +
34
+ 'and a wrapped control cannot reach, so it labels nothing. Write `variant="label"` ' +
35
+ 'for the look, `<label data-text="label">` for a native control, and give a Helix ' +
36
+ 'field its own `label`.',
34
37
  tag: this.localName,
35
38
  });
36
39
  }
37
40
  }
38
- labelsNothing() {
39
- const fields = [...this.querySelectorAll('*')].some((element) => element.constructor.formAssociated === true);
40
- return (fields ||
41
- this.hasAttribute('for') ||
42
- this.querySelector('input, select, textarea, button, meter, output, progress') !== null);
43
- }
44
41
  render() {
45
42
  const tag = (this.as && Object.hasOwn(TAGS, this.as) ? TAGS[this.as] : undefined) ?? literal `span`;
46
- return staticHtml `<${tag} part="text"><slot></slot></${tag}>`;
43
+ return staticHtml `<${tag} part="text" style=${clampOf(this.lines) ?? nothing}><slot></slot></${tag}>`;
47
44
  }
48
45
  static { this.styles = styles; }
49
46
  };
@@ -53,6 +50,15 @@ __decorate([
53
50
  __decorate([
54
51
  property({ reflect: true })
55
52
  ], HelixText.prototype, "emphasis", void 0);
53
+ __decorate([
54
+ property({ reflect: true, type: Number })
55
+ ], HelixText.prototype, "lines", void 0);
56
+ __decorate([
57
+ property({ attribute: 'text-align', reflect: true })
58
+ ], HelixText.prototype, "textAlign", void 0);
59
+ __decorate([
60
+ property({ attribute: 'text-wrap', reflect: true })
61
+ ], HelixText.prototype, "textWrap", void 0);
56
62
  __decorate([
57
63
  property({ reflect: true })
58
64
  ], HelixText.prototype, "tone", void 0);
@@ -1,10 +1,11 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`[part="field"] {
3
3
  background-color: var(--textarea-background-color, var(--helix-color-well));
4
- border: var(--helix-border-thin) solid var(--helix-color-border);
5
- border-radius: var(--helix-radii-sm);
4
+ border: var(--helix-border-thin) solid var(--textarea-border-color, var(--helix-color-border));
5
+ border-radius: var(--textarea-radius, var(--helix-radii-sm));
6
6
  display: flex;
7
- padding: var(--helix-space-xs);
7
+ gap: var(--helix-space-2xs);
8
+ padding: var(--textarea-padding, var(--helix-space-xs));
8
9
  transition:
9
10
  border-color var(--helix-duration-fast) var(--helix-easing-standard),
10
11
  background-color var(--helix-duration-fast) var(--helix-easing-standard);
@@ -14,7 +15,14 @@ background-color var(--helix-duration-fast) var(--helix-easing-standard);
14
15
  line-height: var(--helix-leading-normal);
15
16
  overflow-wrap: break-word;
16
17
 
17
- resize: vertical;
18
+ resize: var(--textarea-resize, vertical);
19
+ }
20
+
21
+ slot[name="start"]::slotted(*),
22
+ slot[name="end"]::slotted(*) {
23
+ align-self: flex-start;
24
+ color: var(--helix-color-foreground-subtle);
25
+ flex: 0 0 auto;
18
26
  }
19
27
 
20
28
  :host([auto-grow]) [part="control"] {