@fusion.dev/helix-headless 0.98.0 → 0.99.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.
@@ -45070,6 +45070,14 @@
45070
45070
  }
45071
45071
  ],
45072
45072
  "members": [
45073
+ {
45074
+ "kind": "field",
45075
+ "name": "icon",
45076
+ "type": {
45077
+ "text": "HelixIcon | undefined"
45078
+ },
45079
+ "description": "The icon itself, for a consumer who imported one.\n\n**The scalable door, and the one this library uses internally.** An icon is\ndata, `{ content, name, viewBox }`, so a value imported by name ships one\nglyph rather than the set, a weight is a subpath rather than an index of\nevery weight, and the supply stops being ours: anything exporting that\nshape works, whether it is Phosphor at another weight, Lucide, or a\nconsumer's own drawings.\n\n**A property and not an attribute**, because an object is not a string. The\nframeworks set properties and plain markup cannot, which is what `name` is\nfor. Set both and this wins, the value being the more specific statement."
45080
+ },
45073
45081
  {
45074
45082
  "kind": "field",
45075
45083
  "name": "label",
@@ -45097,7 +45105,7 @@
45097
45105
  "text": "string"
45098
45106
  },
45099
45107
  "default": "''",
45100
- "description": "Name of the icon in the Helix set.",
45108
+ "description": "Name of the icon in the Helix set.\n\n**A lookup, and the reason both this and `icon` exist.** A name is a string,\nso it is what markup can carry, and resolving one means an index of the\nwhole set that no bundler can shake: 15 kB for a consumer who renders one\nmark. An attribute is the only thing an HTML author can write, and that is\nworth the index; a consumer who would rather not pay it hands over the\nvalue instead.",
45101
45109
  "attribute": "name"
45102
45110
  },
45103
45111
  {
@@ -45450,7 +45458,7 @@
45450
45458
  "text": "string"
45451
45459
  },
45452
45460
  "default": "''",
45453
- "description": "Name of the icon in the Helix set.",
45461
+ "description": "Name of the icon in the Helix set.\n\n**A lookup, and the reason both this and `icon` exist.** A name is a string,\nso it is what markup can carry, and resolving one means an index of the\nwhole set that no bundler can shake: 15 kB for a consumer who renders one\nmark. An attribute is the only thing an HTML author can write, and that is\nworth the index; a consumer who would rather not pay it hands over the\nvalue instead.",
45454
45462
  "fieldName": "name"
45455
45463
  }
45456
45464
  ],
@@ -1,4 +1,5 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
+ import { type HelixIcon } from '@fusion.dev/helix-icons';
2
3
  import { nothing, type TemplateResult } from 'lit';
3
4
  /**
4
5
  * @summary Renders a named icon from the Helix set.
@@ -36,6 +37,21 @@ import { nothing, type TemplateResult } from 'lit';
36
37
  * @csspart svg - The rendered SVG.
37
38
  */
38
39
  export declare class HelixHeadlessIcon extends HelixElement {
40
+ /**
41
+ * The icon itself, for a consumer who imported one.
42
+ *
43
+ * **The scalable door, and the one this library uses internally.** An icon is
44
+ * data, `{ content, name, viewBox }`, so a value imported by name ships one
45
+ * glyph rather than the set, a weight is a subpath rather than an index of
46
+ * every weight, and the supply stops being ours: anything exporting that
47
+ * shape works, whether it is Phosphor at another weight, Lucide, or a
48
+ * consumer's own drawings.
49
+ *
50
+ * **A property and not an attribute**, because an object is not a string. The
51
+ * frameworks set properties and plain markup cannot, which is what `name` is
52
+ * for. Set both and this wins, the value being the more specific statement.
53
+ */
54
+ icon?: HelixIcon;
39
55
  /**
40
56
  * Accessible name, for an icon that is not decorative.
41
57
  */
@@ -50,6 +66,13 @@ export declare class HelixHeadlessIcon extends HelixElement {
50
66
  mirror: boolean;
51
67
  /**
52
68
  * Name of the icon in the Helix set.
69
+ *
70
+ * **A lookup, and the reason both this and `icon` exist.** A name is a string,
71
+ * so it is what markup can carry, and resolving one means an index of the
72
+ * whole set that no bundler can shake: 15 kB for a consumer who renders one
73
+ * mark. An attribute is the only thing an HTML author can write, and that is
74
+ * worth the index; a consumer who would rather not pay it hands over the
75
+ * value instead.
53
76
  */
54
77
  name: string;
55
78
  protected render(): TemplateResult | typeof nothing;
@@ -17,7 +17,8 @@ let HelixHeadlessIcon = class HelixHeadlessIcon extends HelixElement {
17
17
  this.name = '';
18
18
  }
19
19
  render() {
20
- const icon = Object.hasOwn(icons, this.name) ? icons[this.name] : undefined;
20
+ const named = Object.hasOwn(icons, this.name) ? icons[this.name] : undefined;
21
+ const icon = this.icon ?? named;
21
22
  if (!icon) {
22
23
  return nothing;
23
24
  }
@@ -35,6 +36,9 @@ let HelixHeadlessIcon = class HelixHeadlessIcon extends HelixElement {
35
36
  </svg>`;
36
37
  }
37
38
  };
39
+ __decorate([
40
+ property({ attribute: false })
41
+ ], HelixHeadlessIcon.prototype, "icon", void 0);
38
42
  __decorate([
39
43
  property()
40
44
  ], HelixHeadlessIcon.prototype, "label", void 0);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-headless",
3
3
  "description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
4
- "version": "0.98.0",
4
+ "version": "0.99.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "bugs": "https://github.com/project-fusion/fusion/issues",
48
48
  "dependencies": {
49
- "@fusion.dev/helix-core": "0.98.0",
50
- "@fusion.dev/helix-icons": "0.98.0",
49
+ "@fusion.dev/helix-core": "0.99.0",
50
+ "@fusion.dev/helix-icons": "0.99.0",
51
51
  "uqr": "^0.1.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@fusion.dev/helix-cem": "0.98.0",
55
- "@fusion.dev/helix-testing": "0.98.0",
54
+ "@fusion.dev/helix-cem": "0.99.0",
55
+ "@fusion.dev/helix-testing": "0.99.0",
56
56
  "@fusion.dev/scripts": "0.0.0-dev",
57
57
  "@happy-dom/global-registrator": "^20.0.0",
58
58
  "@lit-labs/ssr": "^4.1.0",
package/types/jsx.d.ts CHANGED
@@ -7862,8 +7862,28 @@ Asked for rather than inferred from the name. The names are physical, and
7862
7862
  `arrow-left` drawn pointing right on an Arabic page would be the icon
7863
7863
  disagreeing with its own name for every reader who meant the left. */
7864
7864
  mirror?: (HelixHeadlessIcon["mirror"]) | undefined;
7865
- /** Name of the icon in the Helix set. */
7865
+ /** Name of the icon in the Helix set.
7866
+
7867
+ **A lookup, and the reason both this and `icon` exist.** A name is a string,
7868
+ so it is what markup can carry, and resolving one means an index of the
7869
+ whole set that no bundler can shake: 15 kB for a consumer who renders one
7870
+ mark. An attribute is the only thing an HTML author can write, and that is
7871
+ worth the index; a consumer who would rather not pay it hands over the
7872
+ value instead. */
7866
7873
  name?: (HelixHeadlessIcon["name"]) | undefined;
7874
+ /** The icon itself, for a consumer who imported one.
7875
+
7876
+ **The scalable door, and the one this library uses internally.** An icon is
7877
+ data, `{ content, name, viewBox }`, so a value imported by name ships one
7878
+ glyph rather than the set, a weight is a subpath rather than an index of
7879
+ every weight, and the supply stops being ours: anything exporting that
7880
+ shape works, whether it is Phosphor at another weight, Lucide, or a
7881
+ consumer's own drawings.
7882
+
7883
+ **A property and not an attribute**, because an object is not a string. The
7884
+ frameworks set properties and plain markup cannot, which is what `name` is
7885
+ for. Set both and this wins, the value being the more specific statement. */
7886
+ icon?: (HelixHeadlessIcon["icon"]) | undefined;
7867
7887
  };
7868
7888
 
7869
7889
  export type HelixHeadlessIconSolidJsProps = {
@@ -7875,8 +7895,28 @@ Asked for rather than inferred from the name. The names are physical, and
7875
7895
  `arrow-left` drawn pointing right on an Arabic page would be the icon
7876
7896
  disagreeing with its own name for every reader who meant the left. */
7877
7897
  "prop:mirror"?: (HelixHeadlessIcon["mirror"]) | undefined;
7878
- /** Name of the icon in the Helix set. */
7898
+ /** Name of the icon in the Helix set.
7899
+
7900
+ **A lookup, and the reason both this and `icon` exist.** A name is a string,
7901
+ so it is what markup can carry, and resolving one means an index of the
7902
+ whole set that no bundler can shake: 15 kB for a consumer who renders one
7903
+ mark. An attribute is the only thing an HTML author can write, and that is
7904
+ worth the index; a consumer who would rather not pay it hands over the
7905
+ value instead. */
7879
7906
  "prop:name"?: (HelixHeadlessIcon["name"]) | undefined;
7907
+ /** The icon itself, for a consumer who imported one.
7908
+
7909
+ **The scalable door, and the one this library uses internally.** An icon is
7910
+ data, `{ content, name, viewBox }`, so a value imported by name ships one
7911
+ glyph rather than the set, a weight is a subpath rather than an index of
7912
+ every weight, and the supply stops being ours: anything exporting that
7913
+ shape works, whether it is Phosphor at another weight, Lucide, or a
7914
+ consumer's own drawings.
7915
+
7916
+ **A property and not an attribute**, because an object is not a string. The
7917
+ frameworks set properties and plain markup cannot, which is what `name` is
7918
+ for. Set both and this wins, the value being the more specific statement. */
7919
+ "prop:icon"?: (HelixHeadlessIcon["icon"]) | undefined;
7880
7920
 
7881
7921
  /** Set the innerHTML of the element */
7882
7922
  innerHTML?: (string) | undefined;
@@ -25535,6 +25575,25 @@ export type CustomElements = {
25535
25575
  * `arrow-left` drawn pointing right on an Arabic page would be the icon
25536
25576
  * disagreeing with its own name for every reader who meant the left.
25537
25577
  * - `name`: Name of the icon in the Helix set.
25578
+ *
25579
+ * **A lookup, and the reason both this and `icon` exist.** A name is a string,
25580
+ * so it is what markup can carry, and resolving one means an index of the
25581
+ * whole set that no bundler can shake: 15 kB for a consumer who renders one
25582
+ * mark. An attribute is the only thing an HTML author can write, and that is
25583
+ * worth the index; a consumer who would rather not pay it hands over the
25584
+ * value instead.
25585
+ * - `icon`: The icon itself, for a consumer who imported one.
25586
+ *
25587
+ * **The scalable door, and the one this library uses internally.** An icon is
25588
+ * data, `{ content, name, viewBox }`, so a value imported by name ships one
25589
+ * glyph rather than the set, a weight is a subpath rather than an index of
25590
+ * every weight, and the supply stops being ours: anything exporting that
25591
+ * shape works, whether it is Phosphor at another weight, Lucide, or a
25592
+ * consumer's own drawings.
25593
+ *
25594
+ * **A property and not an attribute**, because an object is not a string. The
25595
+ * frameworks set properties and plain markup cannot, which is what `name` is
25596
+ * for. Set both and this wins, the value being the more specific statement. (property only)
25538
25597
  * - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
25539
25598
  *
25540
25599
  * **Named `whenSettled` because `settled` is taken four times over**, by
@@ -43608,6 +43667,25 @@ export type CustomElementsSolidJs = {
43608
43667
  * `arrow-left` drawn pointing right on an Arabic page would be the icon
43609
43668
  * disagreeing with its own name for every reader who meant the left.
43610
43669
  * - `name`: Name of the icon in the Helix set.
43670
+ *
43671
+ * **A lookup, and the reason both this and `icon` exist.** A name is a string,
43672
+ * so it is what markup can carry, and resolving one means an index of the
43673
+ * whole set that no bundler can shake: 15 kB for a consumer who renders one
43674
+ * mark. An attribute is the only thing an HTML author can write, and that is
43675
+ * worth the index; a consumer who would rather not pay it hands over the
43676
+ * value instead.
43677
+ * - `icon`: The icon itself, for a consumer who imported one.
43678
+ *
43679
+ * **The scalable door, and the one this library uses internally.** An icon is
43680
+ * data, `{ content, name, viewBox }`, so a value imported by name ships one
43681
+ * glyph rather than the set, a weight is a subpath rather than an index of
43682
+ * every weight, and the supply stops being ours: anything exporting that
43683
+ * shape works, whether it is Phosphor at another weight, Lucide, or a
43684
+ * consumer's own drawings.
43685
+ *
43686
+ * **A property and not an attribute**, because an object is not a string. The
43687
+ * frameworks set properties and plain markup cannot, which is what `name` is
43688
+ * for. Set both and this wins, the value being the more specific statement. (property only)
43611
43689
  * - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
43612
43690
  *
43613
43691
  * **Named `whenSettled` because `settled` is taken four times over**, by
package/types/vue.d.ts CHANGED
@@ -4025,8 +4025,28 @@ Asked for rather than inferred from the name. The names are physical, and
4025
4025
  `arrow-left` drawn pointing right on an Arabic page would be the icon
4026
4026
  disagreeing with its own name for every reader who meant the left. */
4027
4027
  mirror?: (HelixHeadlessIcon["mirror"]) | undefined;
4028
- /** Name of the icon in the Helix set. */
4028
+ /** Name of the icon in the Helix set.
4029
+
4030
+ **A lookup, and the reason both this and `icon` exist.** A name is a string,
4031
+ so it is what markup can carry, and resolving one means an index of the
4032
+ whole set that no bundler can shake: 15 kB for a consumer who renders one
4033
+ mark. An attribute is the only thing an HTML author can write, and that is
4034
+ worth the index; a consumer who would rather not pay it hands over the
4035
+ value instead. */
4029
4036
  name?: (HelixHeadlessIcon["name"]) | undefined;
4037
+ /** The icon itself, for a consumer who imported one.
4038
+
4039
+ **The scalable door, and the one this library uses internally.** An icon is
4040
+ data, `{ content, name, viewBox }`, so a value imported by name ships one
4041
+ glyph rather than the set, a weight is a subpath rather than an index of
4042
+ every weight, and the supply stops being ours: anything exporting that
4043
+ shape works, whether it is Phosphor at another weight, Lucide, or a
4044
+ consumer's own drawings.
4045
+
4046
+ **A property and not an attribute**, because an object is not a string. The
4047
+ frameworks set properties and plain markup cannot, which is what `name` is
4048
+ for. Set both and this wins, the value being the more specific statement. */
4049
+ icon?: (HelixHeadlessIcon["icon"]) | undefined;
4030
4050
  };
4031
4051
 
4032
4052
  export type HelixHeadlessIconVueEvents = {};