@fusion.dev/helix 0.39.0 → 0.41.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.
@@ -12,19 +12,17 @@ import type { CSSResultGroup } from 'lit';
12
12
  * Usable on its own as a disclosure, with no accordion around it.
13
13
  *
14
14
  * @since 0.1.0
15
- * @status experimental
15
+ * @status stable
16
16
  * @aliases Collapsible, Expander, Disclosure
17
17
  * @documentation https://fusion.dev/helix/components/accordion
18
18
  *
19
19
  * @slot - The content revealed when open.
20
20
  * @slot summary - The always-visible trigger content.
21
21
  *
22
- * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the item opens or closes. Cancelable: refusing it takes the decision and nothing moves.
23
- *
24
22
  * @csspart chevron - The open and close indicator.
25
23
  * @csspart container - The outer wrapper.
26
24
  * @csspart content - The revealed region.
27
- * @csspart content-inner - Padding wrapper inside the animated region.
25
+ * @csspart content-inner - The clipping box inside the animated region. The inset is on the slot within it, not here: padding on the grid item survives a zero track, which left a shut section with a band of space under it.
28
26
  * @csspart trigger - The clickable summary row.
29
27
  *
30
28
  * @cssproperty --accordion-item-padding - Inset of the trigger and content.
@@ -10,7 +10,7 @@ import type { CSSResultGroup } from 'lit';
10
10
  * the default: an accordion is a list, where a card is a surface.
11
11
  *
12
12
  * @since 0.1.0
13
- * @status experimental
13
+ * @status stable
14
14
  * @category layout
15
15
  * @aliases Collapse, Expander group
16
16
  * @documentation https://fusion.dev/helix/components/accordion
@@ -13,11 +13,35 @@ import '../../tooltip/index.js';
13
13
  * the bands overlap where they are drawn and a translucent one would show the
14
14
  * others through it.
15
15
  *
16
+ * **No visual axis applies here, and that is the answer rather than a gap.**
17
+ * Both refusals are geometric and both were argued in the stylesheet before
18
+ * they were argued anywhere a reader looks.
19
+ *
20
+ * `emphasis` is which of a family's two marks carries the reading, and here
21
+ * neither can give way. The fill is the value, a band's thickness being its
22
+ * amount, and the edge is the boundary, which is why it is drawn at full color
23
+ * over a pale fill rather than left to two pale fills meeting. Every point on
24
+ * the axis moves one at the other's expense: `outlined` thins the fill until
25
+ * the chart is a set of cumulative lines, which is `LineChart` and is the form
26
+ * this one exists because a reader cannot read shares off; `solid` takes the
27
+ * fill to the series' own color, which is the edge's color, so the boundary
28
+ * disappears into the band it bounds. `LineChart` can take the axis because its
29
+ * wash is optional there, `area` deciding whether one is drawn at all.
30
+ *
31
+ * `material` is what reads through a mark, and a band cannot let anything
32
+ * through. Each is drawn as everything under its top edge with the next one
33
+ * down covering the rest, so a translucent band shows the bands behind it and
34
+ * reads as a third color that is in no palette. That is `LineChart`'s recorded
35
+ * reason for refusing `wash`, met here from the other side. The strength of a
36
+ * fill is still adjustable and is `--area-chart-fill-strength`, which is a
37
+ * continuum rather than an axis and is a theme's business rather than a
38
+ * reader's.
39
+ *
16
40
  * @since 0.1.0
17
- * @status experimental
41
+ * @status stable
18
42
  * @category charts
19
43
  * @groups charts
20
- * @aliases Stacked Area Chart, Composition Chart, Stream Chart
44
+ * @aliases Stacked Area Chart, Composition Chart, Banded Chart
21
45
  * @documentation https://fusion.dev/helix/components/area-chart
22
46
  *
23
47
  * @cssproperty --area-chart-block-size - Height of the drawing.
@@ -25,6 +49,7 @@ import '../../tooltip/index.js';
25
49
  * @cssproperty --area-chart-gap - Space between the drawing and its labels.
26
50
  * @cssproperty --area-chart-gridline-color - One rule across the plot, under `gridlines`.
27
51
  * @cssproperty --area-chart-width - Thickness of a band's top edge, over `--chart-stroke`.
52
+ * @cssproperty --chart-stroke - Thickness of a band's top edge, one name across this family, Line Chart and Bar Chart's `lines`, since the three read one shared rule. `--area-chart-width` overrides it here.
28
53
  */
29
54
  export declare class HelixAreaChart extends HelixHeadlessAreaChart {
30
55
  /** The styled tier, so the tooltip this renders is the styled one. */
@@ -267,7 +267,6 @@ var(--helix-color-background)
267
267
  --_bar-chart-through: calc(0.62 * var(--helix-material-opacity));
268
268
  }
269
269
 
270
- [part="bar"][data-material="frosted"],
271
270
  :host([material="frosted"]) [part="bar"]:not([data-material]) {
272
271
  --_bar-chart-through: calc(0.88 * var(--helix-material-opacity));
273
272
  }
@@ -11,7 +11,7 @@ import '../../tooltip/index.js';
11
11
  * it is measured against.
12
12
  *
13
13
  * @since 0.1.0
14
- * @status experimental
14
+ * @status stable
15
15
  * @category charts
16
16
  * @groups charts
17
17
  * @aliases Column Chart, Categorical Chart
@@ -26,6 +26,7 @@ import '../../tooltip/index.js';
26
26
  * @cssproperty --bar-chart-gridline-color - One rule across the plot, under `gridlines`.
27
27
  * @cssproperty --bar-chart-line-color - A `lines` series, overriding its series color.
28
28
  * @cssproperty --bar-chart-line-width - Thickness of a `lines` series, over `--chart-stroke`.
29
+ * @cssproperty --chart-stroke - Thickness of a `lines` series, one name across this family, Line Chart and Area Chart's top edge, since the three read one shared rule. `--bar-chart-line-width` overrides it here.
29
30
  */
30
31
  export declare class HelixBarChart extends HelixHeadlessBarChart {
31
32
  /**
@@ -47,6 +48,12 @@ export declare class HelixBarChart extends HelixHeadlessBarChart {
47
48
  * of the series color with that edge on it, and absent is the filled column,
48
49
  * per the rule that a reflected property takes no default.
49
50
  *
51
+ * `solid` is that filled column written out. It matches no rule in the sheet
52
+ * and lands on the base one, which is what the resting value of every axis in
53
+ * the registry does, and it is worth having so a consumer switching a chart
54
+ * between treatments has a word for the one it started at rather than having
55
+ * to remove the attribute.
56
+ *
50
57
  * **It composes with `material` rather than competing with it.** Emphasis
51
58
  * decides what is drawn and material decides how much of it comes through, so
52
59
  * `glass` thins whatever emphasis put there: the fill on a solid column, the
@@ -109,10 +116,15 @@ export declare class HelixBarChart extends HelixHeadlessBarChart {
109
116
  /**
110
117
  * Which series are drawn as an outline rather than a fill, by name.
111
118
  *
112
- * Space separated and matched against the column headings the table gives,
113
- * the way `lines` and `secondary` are, so a chart says `outlined="Forecast"`
114
- * rather than counting columns. Names because they are what the table already
115
- * carries and what the legend already shows.
119
+ * Separated by whitespace or commas and matched against the column headings
120
+ * the table gives, the way `lines` and `secondary` are, so a chart says
121
+ * `outlined="Forecast"` rather than counting columns. Names because they are
122
+ * what the table already carries and what the legend already shows.
123
+ *
124
+ * All five read one splitter, `seriesNames` in `core`, because the sentence
125
+ * above was true of the matching and false of the splitting: these three took
126
+ * a comma and those two did not, so `lines="Gateway, Billing"` drew no line
127
+ * and said nothing.
116
128
  *
117
129
  * **The case this exists for is a series that is not a measurement.** A
118
130
  * forecast, a target, a budget: something drawn on the same axis as the
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, seriesIndex } from '@fusion.dev/helix-core';
7
+ import { customElement, seriesIndex, seriesNames } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessBarChart } from '@fusion.dev/helix-headless/bar-chart';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { styles as seriesStyles } from '../../shared/chart/series.css.js';
@@ -15,11 +15,7 @@ let HelixBarChart = class HelixBarChart extends HelixHeadlessBarChart {
15
15
  static { this.tier = 'helix-'; }
16
16
  updated(changed) {
17
17
  super.updated(changed);
18
- const slots = (list) => new Set((list ?? '')
19
- .split(/[\s,]+/)
20
- .filter(Boolean)
21
- .map((name) => name.toLowerCase())
22
- .flatMap((name) => {
18
+ const slots = (list) => new Set(seriesNames(list).flatMap((name) => {
23
19
  const at = this.series.findIndex((one) => one.name.trim().toLowerCase() === name);
24
20
  return at < 0 ? [] : [seriesIndex(at)];
25
21
  }));
@@ -60,7 +60,7 @@ box-sizing: border-box;
60
60
 
61
61
  container-type: inline-size;
62
62
  display: grid;
63
- inline-size: calc(100% * (var(--_donut-chart-ring) - var(--donut-chart-stroke, 16)) / 100);
63
+ inline-size: calc(100% * (var(--_donut-chart-ring) - 2 * var(--donut-chart-stroke, 16)) / 100);
64
64
  place-items: center;
65
65
  text-align: center;
66
66
  }
@@ -23,7 +23,7 @@ import '../../tooltip/index.js';
23
23
  * and `large` was drawn larger than the default.
24
24
  *
25
25
  * @since 0.1.0
26
- * @status experimental
26
+ * @status stable
27
27
  * @category charts
28
28
  * @groups charts
29
29
  * @aliases Pie Chart, Ring Chart, Share Chart
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement } from '@fusion.dev/helix-core';
7
+ import { customElement, seriesNames } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessLegend } from '@fusion.dev/helix-headless/legend';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { styles as seriesStyles } from '../../shared/chart/series.css.js';
@@ -14,11 +14,7 @@ let HelixLegend = class HelixLegend extends HelixHeadlessLegend {
14
14
  updated(changed) {
15
15
  super.updated(changed);
16
16
  const showing = this.names().map((name) => name.trim().toLowerCase());
17
- const slots = (value) => new Set((value ?? '')
18
- .split(/[\s,]+/)
19
- .filter(Boolean)
20
- .map((name) => name.toLowerCase())
21
- .flatMap((name) => {
17
+ const slots = (value) => new Set(seriesNames(value).flatMap((name) => {
22
18
  const at = showing.indexOf(name);
23
19
  return at < 0 ? [] : [at];
24
20
  }));
@@ -13,19 +13,28 @@ import '../../tooltip/index.js';
13
13
  * lets one drawing fill a narrow card and a wide panel, and without
14
14
  * `vector-effect: non-scaling-stroke` the same line comes out hairline in the
15
15
  * first and heavy in the second. It rescues strokes and not geometry, which is
16
- * why the readings are joined by lines and marked by nothing: a circle in a
17
- * stretched coordinate space is an ellipse, and there is no vector-effect that
18
- * answers for a shape.
16
+ * why nothing inside the drawing marks a reading: a circle in a stretched
17
+ * coordinate space is an ellipse, and there is no vector-effect that answers
18
+ * for a shape.
19
+ *
20
+ * **The last reading of each series is marked, and that is the same rule rather
21
+ * than an exception to it.** `terminus` draws an HTML element placed over the
22
+ * plot by percentage instead of a shape inside it, so it keeps its shape at any
23
+ * width. It is on by default, as a dot, because the column of marks at the far
24
+ * edge is where a reader looks for "and what is it now".
19
25
  *
20
26
  * @since 0.1.0
21
- * @status experimental
27
+ * @status stable
22
28
  * @category charts
23
29
  * @groups charts
24
30
  * @aliases Time Series, Trend Chart, Multi-line Chart
25
31
  * @documentation https://fusion.dev/helix/components/line-chart
26
32
  *
27
- * @cssproperty --chart-stroke - Thickness of a series drawn as a line, here and on Area
28
- * Chart's top edge and Bar Chart's `lines`. Each family's own width hook overrides it.
33
+ * @cssproperty --chart-stroke - Thickness of a series drawn as a line, one name across this
34
+ * family, Area Chart's top edge and Bar Chart's `lines`, since the three read one shared
35
+ * rule. Each family's own width hook overrides it.
36
+ * @cssproperty --chart-terminus-hole - A fill for the middle of a `ring` terminus, which is otherwise open. One name across this family and Sparkline, the two reading one shared sheet.
37
+ * @cssproperty --chart-terminus-size - Size of the mark on each series' last reading. One name across this family and Sparkline, the two reading one shared sheet.
29
38
  * @cssproperty --line-chart-area-opacity - How much of a line's color its wash takes.
30
39
  * @cssproperty --line-chart-band-color - The slot the pointer is resting in.
31
40
  * @cssproperty --line-chart-block-size - Height of the drawing.
@@ -4,12 +4,15 @@ import type { CSSResultGroup } from 'lit';
4
4
  * @summary One row in a menu: a command, a choice, or a way into a submenu.
5
5
  *
6
6
  * @description
7
- * The tick and the arrow hold their space whether or not they are showing, so
8
- * the labels in a menu start at one place and the rows read as a column rather
9
- * than as a ragged list.
7
+ * A row draws a column beside its label only where it has something to put in
8
+ * one, and the width is the menu's rather than the row's: the page reserves a
9
+ * leading or a trailing track as soon as any row on it fills one, so every
10
+ * label on that page starts at the same edge and a page that fills neither pays
11
+ * for neither. A row knows about its own slots and nothing about its
12
+ * neighbors, which is why the reservation is not made here.
10
13
  *
11
14
  * @since 0.1.0
12
- * @status experimental
15
+ * @status stable
13
16
  * @aliases Menu option, Menu row
14
17
  * @documentation https://fusion.dev/helix/components/menu
15
18
  *
@@ -11,7 +11,7 @@ import type { CSSResultGroup } from 'lit';
11
11
  * one panel and reads the same on a phone as on a desk.
12
12
  *
13
13
  * @since 0.1.0
14
- * @status experimental
14
+ * @status stable
15
15
  * @category overlays
16
16
  * @aliases Dropdown, Action menu
17
17
  * @documentation https://fusion.dev/helix/components/menu
@@ -10,7 +10,7 @@ import type { CSSResultGroup } from 'lit';
10
10
  * says where the current page was as well as where it is.
11
11
  *
12
12
  * @since 0.1.0
13
- * @status experimental
13
+ * @status stable
14
14
  * @category navigation
15
15
  * @aliases Nav, NavList, Tabs
16
16
  * @documentation https://fusion.dev/helix/components/navigation
@@ -29,7 +29,7 @@ import type { CSSResultGroup } from 'lit';
29
29
  * is a way through rather than a destination, so it does not compete.
30
30
  *
31
31
  * @since 0.1.0
32
- * @status experimental
32
+ * @status stable
33
33
  * @category navigation
34
34
  * @aliases Pager, Page nav
35
35
  * @documentation https://fusion.dev/helix/components/pagination
@@ -15,7 +15,7 @@ import '../../select/index.js';
15
15
  * as the select it is.
16
16
  *
17
17
  * @since 0.1.0
18
- * @status experimental
18
+ * @status stable
19
19
  * @aliases Page size, Rows per page
20
20
  * @documentation https://fusion.dev/helix/components/pagination
21
21
  *
@@ -9,7 +9,7 @@ import type { CSSResultGroup } from 'lit';
9
9
  * a way to move through it.
10
10
  *
11
11
  * @since 0.1.0
12
- * @status experimental
12
+ * @status stable
13
13
  * @aliases Result count, Range
14
14
  * @documentation https://fusion.dev/helix/components/pagination
15
15
  */
@@ -6,7 +6,7 @@ position: relative;
6
6
  }
7
7
 
8
8
  [part="plane"] {
9
- column-gap: var(--helix-space-xs);
9
+ column-gap: var(--scatter-chart-gap, var(--helix-space-xs));
10
10
  display: grid;
11
11
  grid-template-areas:
12
12
  "y-name y-name"
@@ -12,8 +12,32 @@ import '../../tooltip/index.js';
12
12
  * dense cluster reads as dense rather than as one blot, and two points that
13
13
  * overlap each keep their edge.
14
14
  *
15
+ * **No visual axis applies here, and that is the answer rather than a gap.**
16
+ * Both refusals come out of that sentence, and both were argued in the
17
+ * stylesheet before they were argued anywhere a reader looks.
18
+ *
19
+ * `emphasis` is how much ink a mark claims, and on a scatter that channel is
20
+ * already carrying data. The points rest at 0.8 so that where they pile up they
21
+ * compound: how dark a region is *is* how many rows are in it, which is most of
22
+ * what a reader is looking at a scatter to see and is the one thing a table of
23
+ * the same numbers hides. `solid` flattens a dense cluster and a sparse one into
24
+ * the same picture; `outlined` replaces the pile with overlapping rings, which
25
+ * reads as texture rather than as count. An axis whose two ends each cost the
26
+ * drawing its density is not a treatment, it is a second meaning for a property
27
+ * the chart already spends.
28
+ *
29
+ * `material` is the same refusal said once more. Translucency is the density
30
+ * channel here, so `glass` and `frosted` are two more named stops on a scale
31
+ * the data is using, and a point admitting the page through is a point that
32
+ * counts for less than one.
33
+ *
34
+ * What stays adjustable is `--scatter-chart-point-opacity`, and it is a
35
+ * continuum rather than an axis: a chart drawn over a busier ground wants a
36
+ * different resting density, and that is a fact about the ground rather than a
37
+ * claim about the points.
38
+ *
15
39
  * @since 0.1.0
16
- * @status experimental
40
+ * @status stable
17
41
  * @category charts
18
42
  * @groups charts
19
43
  * @aliases Scatter Plot, XY Chart, Correlation Chart, Dot Plot
@@ -14,7 +14,7 @@ import type { CSSResultGroup } from 'lit';
14
14
  * second name for it here would be a second thing to keep in step.
15
15
  *
16
16
  * @since 0.1.0
17
- * @status experimental
17
+ * @status stable
18
18
  * @category navigation
19
19
  * @aliases Stepper, Wizard, Progress steps
20
20
  * @documentation https://fusion.dev/helix/components/steps
@@ -5,7 +5,7 @@ import '../../button/index.js';
5
5
  * @summary One stage in a sequence.
6
6
  *
7
7
  * @since 0.1.0
8
- * @status experimental
8
+ * @status stable
9
9
  * @aliases Stage
10
10
  * @documentation https://fusion.dev/helix/components/steps
11
11
  */
@@ -4,17 +4,24 @@ import type { CSSResultGroup } from 'lit';
4
4
  * @summary A row of tabs and the panel each one shows.
5
5
  *
6
6
  * @description
7
- * Selection is marked with a rule under the active tab rather than a filled
8
- * pill, which keeps the row flat and lets the underline animate between tabs as
9
- * a movement instead of two separate fills.
7
+ * One mark travels between the tabs rather than each of them filling and
8
+ * emptying in turn. A fill that swaps is two things changing at once and reads
9
+ * as a flicker; one that moves is a single object the eye follows, and it says
10
+ * where the current tab was as well as where it is. `Navigation` marks its
11
+ * destinations the same way and for the same reason.
12
+ *
13
+ * What the mark is depends on `variant`: unset it is a raised pill on the
14
+ * selected tab with nothing behind the row, `underlined` makes it a bar along
15
+ * the bottom of the strip on a rule, and `segmented` grows it to the tab's own
16
+ * box inside a sunken track.
10
17
  *
11
18
  * @since 0.1.0
12
19
  * @status experimental
13
20
  * @category navigation
14
21
  * @documentation https://fusion.dev/helix/components/tabs
15
22
  *
16
- * @slot - The tabs.
17
- * @slot panels - The panels.
23
+ * @slot - The tabs, which are this element's own children.
24
+ * @slot panels - The panels, which are this element's own children. A wrapper around them is assigned to the slot and pairs with nothing, since the pairing walks these children rather than the slot's tree.
18
25
  *
19
26
  * @csspart panels - The panel container.
20
27
  * @csspart tabs - The tab list.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix",
3
3
  "description": "Styled component tier. Extends the headless tier with token-driven presentation.",
4
- "version": "0.39.0",
4
+ "version": "0.41.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -47,14 +47,14 @@
47
47
  },
48
48
  "bugs": "https://github.com/project-fusion/fusion/issues",
49
49
  "dependencies": {
50
- "@fusion.dev/helix-core": "0.39.0",
51
- "@fusion.dev/helix-headless": "0.39.0",
52
- "@fusion.dev/helix-styles": "0.39.0"
50
+ "@fusion.dev/helix-core": "0.41.0",
51
+ "@fusion.dev/helix-headless": "0.41.0",
52
+ "@fusion.dev/helix-styles": "0.41.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@custom-elements-manifest/analyzer": "^0.11.0",
56
- "@fusion.dev/helix-cem": "0.39.0",
57
- "@fusion.dev/helix-testing": "0.39.0",
56
+ "@fusion.dev/helix-cem": "0.41.0",
57
+ "@fusion.dev/helix-testing": "0.41.0",
58
58
  "@fusion.dev/scripts": "0.0.0-dev",
59
59
  "@happy-dom/global-registrator": "^20.0.0",
60
60
  "@lit-labs/ssr": "^4.1.0",