@raylang/elements 0.6.0 → 0.7.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 (40) hide show
  1. package/check/check.d.ts +2 -0
  2. package/check/check.js +18 -4
  3. package/check/cli.js +10 -6
  4. package/components/accordion/accordion.js +1 -1
  5. package/components/alert/alert.js +1 -1
  6. package/components/attachment/attachment.js +1 -1
  7. package/components/avatar/avatar.js +1 -1
  8. package/components/bottom-nav/bottom-nav.js +2 -0
  9. package/components/breadcrumbs/breadcrumbs.js +1 -1
  10. package/components/carousel/carousel.js +4 -4
  11. package/components/checkbox/checkbox.js +1 -1
  12. package/components/code/code.js +1 -1
  13. package/components/color-picker/color-picker.js +1 -1
  14. package/components/combobox/combobox.js +3 -3
  15. package/components/command-palette/command-palette.js +1 -1
  16. package/components/date-picker/date-picker.js +4 -4
  17. package/components/dialog/dialog.js +1 -1
  18. package/components/drawer/drawer.js +1 -1
  19. package/components/file-upload/file-upload.js +1 -1
  20. package/components/icon/icon.js +6 -1
  21. package/components/nav-link/nav-link.js +1 -1
  22. package/components/notification/notification.js +1 -1
  23. package/components/number-input/number-input.js +1 -1
  24. package/components/pagination/pagination.js +4 -4
  25. package/components/password-input/password-input.js +2 -2
  26. package/components/search/search.js +2 -2
  27. package/components/select/select.js +2 -2
  28. package/components/stat/stat.js +1 -1
  29. package/components/step-dots/step-dots.js +11 -2
  30. package/components/stepper/stepper.js +1 -1
  31. package/components/table/table.js +1 -1
  32. package/components/theme-toggle/theme-toggle.js +2 -2
  33. package/core/core.js +4 -3
  34. package/core/icons.js +95 -8
  35. package/custom-elements.json +71 -17
  36. package/llms-full.txt +36 -16
  37. package/llms.txt +14 -3
  38. package/package.json +1 -1
  39. package/ray-elements.d.ts +24 -14
  40. package/vscode.html-custom-data.json +1093 -92
package/core/icons.js CHANGED
@@ -6,6 +6,16 @@
6
6
  //
7
7
  // setIcons() also adds new names, for <ray-icon name="…">. Icons are SVG
8
8
  // markup (or an SVGElement) drawn with currentColor; components size them.
9
+ //
10
+ // The components ask for roles, not glyphs: "ui.close" (a dialog's close
11
+ // button), "ui.remove" (a chip's ×), "ui.clear" (a field's ×)… Each role
12
+ // draws its glyph (ALIASES) unless the app registers the role itself, so
13
+ // setIcons({ close: … }) still changes every × and setIcons({ "ui.remove": … })
14
+ // only the chips'.
15
+ //
16
+ // An icon may have a filled version, "<name>:filled", for a state: the active
17
+ // tab, a favorite, unread. <ray-icon name="star" filled> draws it, and the
18
+ // outline one when there is none. setIcons({ "star:filled": … }) adds one.
9
19
  // The markup is inserted as HTML: register icons from your own code only,
10
20
  // never from user input.
11
21
 
@@ -62,12 +72,72 @@ const DEFAULTS = {
62
72
  "message-circle": svg(`<path d="M20 11.5a8 8 0 0 1-11.6 7.2L4 20l1.3-4.2A8 8 0 1 1 20 11.5z"/>`),
63
73
  };
64
74
 
65
- const registry = new Map(Object.entries(DEFAULTS));
75
+ // The filled versions: the outline's shapes filled (same silhouette: the
76
+ // stroke stays), or one even-odd path where a mark is cut out of a disc.
77
+ const solid = (body) =>
78
+ `<svg viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${body}</svg>`;
79
+ const cut = (d) => `<svg viewBox="0 0 24 24" fill="currentColor" fill-rule="evenodd" aria-hidden="true"><path d="${d}"/></svg>`;
80
+
81
+ /** The filled versions of the default set (registered as "<name>:filled"). */
82
+ const FILLED = {
83
+ "user": solid(`<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0z"/>`),
84
+ "info": cut("M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z"),
85
+ "circle-check": cut("M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 14.5-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z"),
86
+ "alert-triangle": cut("M10.3 3.2 1.6 18.1a2 2 0 0 0 1.7 3h17.4a2 2 0 0 0 1.7-3L13.7 3.2a2 2 0 0 0-3.4 0zM11 8.5h2v5.5h-2zM12 16a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"),
87
+ "circle-x": cut("M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM14.12 8.46 15.54 9.88 13.41 12 15.54 14.12 14.12 15.54 12 13.41 9.88 15.54 8.46 14.12 10.59 12 8.46 9.88 9.88 8.46 12 10.59z"),
88
+ "folder": solid(`<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>`),
89
+ bell: solid(`<path d="M10.3 21a1.9 1.9 0 0 0 3.4 0z"/><path d="M3.3 15.3A1 1 0 0 0 4 17h16a1 1 0 0 0 .7-1.7C19.4 14 18 12.6 18 8A6 6 0 0 0 6 8c0 4.6-1.4 6-2.7 7.3"/>`),
90
+ "star": solid(`<path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z"/>`),
91
+ "settings": solid(`<path d="M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12"/><circle cx="16" cy="6" r="2"/><circle cx="10" cy="12" r="2"/><circle cx="18" cy="18" r="2"/>`),
92
+ "home": solid(`<path d="M4 10.5 12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z"/>`),
93
+ "message-circle": solid(`<path d="M20 11.5a8 8 0 0 1-11.6 7.2L4 20l1.3-4.2A8 8 0 1 1 20 11.5z"/>`),
94
+ };
95
+
96
+ const FILLED_SUFFIX = ":filled";
97
+
98
+ /** The roles the components draw, and the glyph each one uses by default. */
99
+ const ALIASES = {
100
+ "ui.close": "close",
101
+ "ui.clear": "close",
102
+ "ui.remove": "close",
103
+ "ui.expand": "chevron-down",
104
+ "ui.disclosure": "chevron-right",
105
+ "ui.previous": "chevron-left",
106
+ "ui.next": "chevron-right",
107
+ "ui.first": "chevrons-left",
108
+ "ui.last": "chevrons-right",
109
+ "ui.separator": "chevron-right",
110
+ "ui.increment": "chevron-up",
111
+ "ui.decrement": "chevron-down",
112
+ "ui.sort": "chevron-up",
113
+ "ui.checked": "check",
114
+ "ui.indeterminate": "minus",
115
+ "ui.copy": "copy",
116
+ "ui.copied": "check",
117
+ "ui.show-password": "eye",
118
+ "ui.hide-password": "eye-off",
119
+ "ui.play": "play",
120
+ "ui.pause": "pause",
121
+ "ui.search": "search",
122
+ "ui.calendar": "calendar",
123
+ "ui.eyedropper": "pipette",
124
+ "ui.upload": "upload",
125
+ "ui.avatar": "user",
126
+ "ui.theme-light": "sun",
127
+ "ui.theme-dark": "moon",
128
+ "ui.theme-system": "monitor",
129
+ "ui.trend-up": "arrow-up-right",
130
+ "ui.trend-down": "arrow-down-right",
131
+ "ui.trend-flat": "minus",
132
+ };
133
+
134
+ const registry = new Map([...Object.entries(DEFAULTS), ...Object.entries(FILLED).map(([name, markup]) => [name + FILLED_SUFFIX, markup])]);
66
135
  const listeners = new Set();
67
136
  const warned = new Set();
68
137
 
69
138
  /**
70
- * Replaces or adds icons. Values are SVG markup or an SVGElement.
139
+ * Replaces or adds icons. Values are SVG markup or an SVGElement; a name
140
+ * ending in ":filled" is the filled version of an icon.
71
141
  * @param {Record<string, string | SVGElement>} icons
72
142
  */
73
143
  export function setIcons(icons) {
@@ -81,9 +151,19 @@ export function setIcons(icons) {
81
151
  for (const cb of listeners) cb();
82
152
  }
83
153
 
84
- /** The SVG markup of an icon ("" and one warning when it is not registered). */
85
- export function getIcon(name) {
86
- const markup = registry.get(name);
154
+ /**
155
+ * The SVG markup of an icon or a role ("" and one warning when it is not
156
+ * registered). With `filled`, its filled version, or the outline one when it
157
+ * has none.
158
+ */
159
+ export function getIcon(name, { filled = false } = {}) {
160
+ // A role the app has not registered draws its glyph.
161
+ const glyph = ALIASES[name];
162
+ if (filled) {
163
+ const solidMarkup = registry.get(name + FILLED_SUFFIX) ?? (glyph && !registry.has(name) ? registry.get(glyph + FILLED_SUFFIX) : undefined);
164
+ if (solidMarkup !== undefined) return solidMarkup;
165
+ }
166
+ const markup = registry.get(name) ?? (glyph ? registry.get(glyph) : undefined);
87
167
  if (markup !== undefined) return markup;
88
168
  if (!warned.has(name)) {
89
169
  warned.add(name);
@@ -92,9 +172,16 @@ export function getIcon(name) {
92
172
  return "";
93
173
  }
94
174
 
95
- /** The registered icon names. */
96
- export function iconNames() {
97
- return [...registry.keys()];
175
+ /** The roles the components draw ("ui.close"…) and the glyph each one uses unless registered. */
176
+ export function iconAliases() {
177
+ return { ...ALIASES };
178
+ }
179
+
180
+ /** The registered icon names; with `filled`, those that have a filled version. */
181
+ export function iconNames({ filled = false } = {}) {
182
+ const names = [...registry.keys()];
183
+ if (filled) return names.filter((n) => n.endsWith(FILLED_SUFFIX)).map((n) => n.slice(0, -FILLED_SUFFIX.length));
184
+ return names.filter((n) => !n.endsWith(FILLED_SUFFIX));
98
185
  }
99
186
 
100
187
  /** @internal Called by the core runtime to repaint components after setIcons. */
@@ -9141,9 +9141,9 @@
9141
9141
  {
9142
9142
  "name": "icon",
9143
9143
  "type": {
9144
- "text": "string"
9144
+ "text": "IconName"
9145
9145
  },
9146
- "description": "An icon of the registry (or put one in the icon slot).",
9146
+ "description": "An icon of the registry, drawn filled on the current item when it has a filled version (or put one in the icon slot: yours, as it is).",
9147
9147
  "fieldName": "icon"
9148
9148
  },
9149
9149
  {
@@ -9220,9 +9220,9 @@
9220
9220
  "kind": "field",
9221
9221
  "name": "icon",
9222
9222
  "type": {
9223
- "text": "string"
9223
+ "text": "IconName"
9224
9224
  },
9225
- "description": "An icon of the registry (or put one in the icon slot).",
9225
+ "description": "An icon of the registry, drawn filled on the current item when it has a filled version (or put one in the icon slot: yours, as it is).",
9226
9226
  "attribute": "icon",
9227
9227
  "reflects": false
9228
9228
  },
@@ -13997,7 +13997,7 @@
13997
13997
  {
13998
13998
  "name": "icon",
13999
13999
  "type": {
14000
- "text": "string"
14000
+ "text": "IconName"
14001
14001
  },
14002
14002
  "description": "Registry icon of the mark, or none. The icon slot replaces it.",
14003
14003
  "fieldName": "icon",
@@ -14083,7 +14083,7 @@
14083
14083
  "kind": "field",
14084
14084
  "name": "icon",
14085
14085
  "type": {
14086
- "text": "string"
14086
+ "text": "IconName"
14087
14087
  },
14088
14088
  "description": "Registry icon of the mark, or none. The icon slot replaces it.",
14089
14089
  "attribute": "icon",
@@ -14844,7 +14844,7 @@
14844
14844
  "name": "RayIcon",
14845
14845
  "tagName": "ray-icon",
14846
14846
  "customElement": true,
14847
- "description": "setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGElement, drawn with currentColor); iconNames() lists them. Sizes follow the font unless size; --ray-icon-size and --ray-icon-stroke tune the whole system.",
14847
+ "description": "setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGElement, drawn with currentColor); iconNames() lists them. An icon may have a filled version for a state (filled; \"<name>:filled\" in setIcons; iconNames({ filled: true }) lists them). The components draw roles (\"ui.close\", \"ui.remove\", \"ui.expand\"…; iconAliases()), each its glyph until the app registers the role: setIcons({ \"ui.remove\": … }) changes only the chips' ×. Sizes follow the font unless size; --ray-icon-size and --ray-icon-stroke tune the whole system.",
14848
14848
  "superclass": {
14849
14849
  "name": "RayElement"
14850
14850
  },
@@ -14852,11 +14852,19 @@
14852
14852
  {
14853
14853
  "name": "name",
14854
14854
  "type": {
14855
- "text": "string"
14855
+ "text": "IconName"
14856
14856
  },
14857
14857
  "description": "Registered icon name (iconNames()); \"none\" draws nothing, a blank that keeps the alignment (a menu item without its check).",
14858
14858
  "fieldName": "name"
14859
14859
  },
14860
+ {
14861
+ "name": "filled",
14862
+ "type": {
14863
+ "text": "boolean"
14864
+ },
14865
+ "description": "The filled version, for a state (active, selected, favorite, unread); the outline icon when there is none. Built in: user, info, circle-check, alert-triangle, circle-x, folder, bell, star, settings, home, message-circle.",
14866
+ "fieldName": "filled"
14867
+ },
14860
14868
  {
14861
14869
  "name": "size",
14862
14870
  "type": {
@@ -14895,12 +14903,22 @@
14895
14903
  "kind": "field",
14896
14904
  "name": "name",
14897
14905
  "type": {
14898
- "text": "string"
14906
+ "text": "IconName"
14899
14907
  },
14900
14908
  "description": "Registered icon name (iconNames()); \"none\" draws nothing, a blank that keeps the alignment (a menu item without its check).",
14901
14909
  "attribute": "name",
14902
14910
  "reflects": true
14903
14911
  },
14912
+ {
14913
+ "kind": "field",
14914
+ "name": "filled",
14915
+ "type": {
14916
+ "text": "boolean"
14917
+ },
14918
+ "description": "The filled version, for a state (active, selected, favorite, unread); the outline icon when there is none. Built in: user, info, circle-check, alert-triangle, circle-x, folder, bell, star, settings, home, message-circle.",
14919
+ "attribute": "filled",
14920
+ "reflects": true
14921
+ },
14904
14922
  {
14905
14923
  "kind": "field",
14906
14924
  "name": "size",
@@ -15999,7 +16017,7 @@
15999
16017
  {
16000
16018
  "name": "icon",
16001
16019
  "type": {
16002
- "text": "string"
16020
+ "text": "IconName"
16003
16021
  },
16004
16022
  "description": "An icon of the registry in the bullet.",
16005
16023
  "fieldName": "icon"
@@ -16047,7 +16065,7 @@
16047
16065
  "kind": "field",
16048
16066
  "name": "icon",
16049
16067
  "type": {
16050
- "text": "string"
16068
+ "text": "IconName"
16051
16069
  },
16052
16070
  "description": "An icon of the registry in the bullet.",
16053
16071
  "attribute": "icon",
@@ -16195,7 +16213,7 @@
16195
16213
  {
16196
16214
  "name": "icon",
16197
16215
  "type": {
16198
- "text": "string"
16216
+ "text": "IconName"
16199
16217
  },
16200
16218
  "description": "A registered icon name, or none.",
16201
16219
  "fieldName": "icon"
@@ -16264,7 +16282,7 @@
16264
16282
  "kind": "field",
16265
16283
  "name": "icon",
16266
16284
  "type": {
16267
- "text": "string"
16285
+ "text": "IconName"
16268
16286
  },
16269
16287
  "description": "A registered icon name, or none.",
16270
16288
  "attribute": "icon",
@@ -16483,7 +16501,7 @@
16483
16501
  {
16484
16502
  "name": "icon",
16485
16503
  "type": {
16486
- "text": "string"
16504
+ "text": "IconName"
16487
16505
  },
16488
16506
  "description": "Status icon from the registry (default: from the color); \"none\" for no icon.",
16489
16507
  "fieldName": "icon"
@@ -16546,7 +16564,7 @@
16546
16564
  "kind": "field",
16547
16565
  "name": "icon",
16548
16566
  "type": {
16549
- "text": "string"
16567
+ "text": "IconName"
16550
16568
  },
16551
16569
  "description": "Status icon from the registry (default: from the color); \"none\" for no icon.",
16552
16570
  "attribute": "icon",
@@ -17634,8 +17652,24 @@
17634
17652
  "type": {
17635
17653
  "text": "string"
17636
17654
  },
17637
- "description": "What a step is called: \"Round\" is announced \"Round 4 of 12\" and names the element. Default: Step (named Steps).",
17655
+ "description": "What a step is called: \"Round\" is announced \"Round 4 of 12\" and names the element. Default: Step (named Steps). In another language, use value-text.",
17638
17656
  "fieldName": "label"
17657
+ },
17658
+ {
17659
+ "name": "value-text",
17660
+ "type": {
17661
+ "text": "string"
17662
+ },
17663
+ "description": "The announced text, {step} (the current one, from 1) and {count} replaced, numbers in the page's language: value-text=\"Asalto {step} de {count}\". Default: \"<label> {step} of {count}\".",
17664
+ "fieldName": "valueText"
17665
+ },
17666
+ {
17667
+ "name": "done-text",
17668
+ "type": {
17669
+ "text": "string"
17670
+ },
17671
+ "description": "The announced text once every step is done (value = count), with {count}. Default: value-text, else \"{count} of {count}, done\".",
17672
+ "fieldName": "doneText"
17639
17673
  }
17640
17674
  ],
17641
17675
  "members": [
@@ -17699,9 +17733,29 @@
17699
17733
  "type": {
17700
17734
  "text": "string"
17701
17735
  },
17702
- "description": "What a step is called: \"Round\" is announced \"Round 4 of 12\" and names the element. Default: Step (named Steps).",
17736
+ "description": "What a step is called: \"Round\" is announced \"Round 4 of 12\" and names the element. Default: Step (named Steps). In another language, use value-text.",
17703
17737
  "attribute": "label",
17704
17738
  "reflects": false
17739
+ },
17740
+ {
17741
+ "kind": "field",
17742
+ "name": "valueText",
17743
+ "type": {
17744
+ "text": "string"
17745
+ },
17746
+ "description": "The announced text, {step} (the current one, from 1) and {count} replaced, numbers in the page's language: value-text=\"Asalto {step} de {count}\". Default: \"<label> {step} of {count}\".",
17747
+ "attribute": "value-text",
17748
+ "reflects": false
17749
+ },
17750
+ {
17751
+ "kind": "field",
17752
+ "name": "doneText",
17753
+ "type": {
17754
+ "text": "string"
17755
+ },
17756
+ "description": "The announced text once every step is done (value = count), with {count}. Default: value-text, else \"{count} of {count}, done\".",
17757
+ "attribute": "done-text",
17758
+ "reflects": false
17705
17759
  }
17706
17760
  ],
17707
17761
  "events": [],
package/llms-full.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # ray-elements
2
2
 
3
- > Web components (custom elements, Shadow DOM, no dependencies) for any web app: plain HTML, React, Vue or a raylang app. npm: `@raylang/elements`, `@raylang/react`, `@raylang/vue`; raylang: the `elements` package. This file describes version 0.6.0.
3
+ > Web components (custom elements, Shadow DOM, no dependencies) for any web app: plain HTML, React, Vue or a raylang app. npm: `@raylang/elements`, `@raylang/react`, `@raylang/vue`; raylang: the `elements` package. This file describes version 0.7.0.
4
4
 
5
5
  ray-elements is a design system of standard web components (custom elements
6
6
  with Shadow DOM, no dependencies): `<ray-button>`, `<ray-input>`,
@@ -75,7 +75,14 @@ reference of every component follows them.
75
75
  (`label` is required: it is the accessible name). Add or replace icons with
76
76
  `setIcons({ inbox: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>' })`
77
77
  (the style of the built-in set: 24×24, a 2px `currentColor` stroke) from
78
- your own code, never from user input.
78
+ your own code, never from user input. `filled` draws an icon's filled
79
+ version for a state (`<ray-icon name="star" filled>` when it is a favorite);
80
+ `"name:filled"` in `setIcons` adds one. An icon the set lacks (`trash`,
81
+ `save`): register it from Lucide, the same grid and stroke —
82
+ `import { Trash2 } from "lucide-static"; setIcons({ trash: Trash2 })` (or
83
+ its SVG pasted in, without a bundler); never draw your own paths. To change
84
+ one control's icon (only the chips' ×), register its role
85
+ (`setIcons({ "ui.remove": … })`, roles listed in the reference).
79
86
  - **Overlays are in the top layer**: `ray-dialog` is a native modal
80
87
  `<dialog>`; popovers, menus, tooltips and notifications are `[popover]`
81
88
  elements. Never fight them with `z-index` or `overflow`.
@@ -1448,7 +1455,7 @@ Properties:
1448
1455
 
1449
1456
  - `value`: string, reflects. Its value (default: its href, else its label).
1450
1457
  - `label`: string. The label.
1451
- - `icon`: string. An icon of the registry (or put one in the icon slot).
1458
+ - `icon`: `IconName`. An icon of the registry, drawn filled on the current item when it has a filled version (or put one in the icon slot: yours, as it is).
1452
1459
  - `href`: string, reflects. Makes it a link.
1453
1460
  - `badge`: string. A count or a short text on the icon.
1454
1461
  - `dot`: boolean, reflects. A dot on the icon (something new).
@@ -2334,7 +2341,7 @@ Properties:
2334
2341
  - `href`: string. URL of the source: the inner blockquote's cite attribute.
2335
2342
  - `color`: string, reflects. A palette color or any CSS color, for the edge, the mark and the tint. Default: the primary.
2336
2343
  - `variant`: `light` | `outline` | `filled`, default `light`, reflects. light: tinted background; outline: border and edge only; filled: solid color (a pull quote).
2337
- - `icon`: string, default `quote`. Registry icon of the mark, or none. The icon slot replaces it.
2344
+ - `icon`: `IconName`, default `quote`. Registry icon of the mark, or none. The icon slot replaces it.
2338
2345
  - `size`: `sm` | `md` | `lg`, default `md`, reflects. Text size (lg for a pull quote).
2339
2346
  - `padding`: string, reflects. Inner spacing: xs…xl (the spacing scale), px as a number, or a CSS length. Default: md.
2340
2347
  - `hideEdge` (attribute `hide-edge`): boolean, reflects. No colored edge on the start side (the tint, border and mark stay).
@@ -2461,11 +2468,12 @@ Import: `import "@raylang/elements/icon";` · Category: Data display
2461
2468
 
2462
2469
  #### `<ray-icon>` (RayIcon, extends RayElement)
2463
2470
 
2464
- setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGElement, drawn with currentColor); iconNames() lists them. Sizes follow the font unless size; --ray-icon-size and --ray-icon-stroke tune the whole system.
2471
+ setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGElement, drawn with currentColor); iconNames() lists them. An icon may have a filled version for a state (filled; "<name>:filled" in setIcons; iconNames({ filled: true }) lists them). The components draw roles ("ui.close", "ui.remove", "ui.expand"…; iconAliases()), each its glyph until the app registers the role: setIcons({ "ui.remove": … }) changes only the chips' ×. Sizes follow the font unless size; --ray-icon-size and --ray-icon-stroke tune the whole system.
2465
2472
 
2466
2473
  Properties:
2467
2474
 
2468
- - `name`: string, reflects. Registered icon name (iconNames()); "none" draws nothing, a blank that keeps the alignment (a menu item without its check).
2475
+ - `name`: `IconName`, reflects. Registered icon name (iconNames()); "none" draws nothing, a blank that keeps the alignment (a menu item without its check).
2476
+ - `filled`: boolean, reflects. The filled version, for a state (active, selected, favorite, unread); the outline icon when there is none. Built in: user, info, circle-check, alert-triangle, circle-x, folder, bell, star, settings, home, message-circle.
2469
2477
  - `size`: string, reflects. xs…xl or any CSS length. Default: 1em.
2470
2478
  - `label`: string. Accessible name; without it the icon is decorative (hidden from screen readers).
2471
2479
  - `color`: string, reflects. A palette color or any CSS color. Default: the text color.
@@ -2475,6 +2483,10 @@ Parts (`::part()`):
2475
2483
 
2476
2484
  - `icon`: The icon box.
2477
2485
 
2486
+ Types:
2487
+
2488
+ - `"close" | "check" | "minus" | "plus" | "chevron-down" | "chevron-up" | "chevron-right" | "chevron-left" | "chevrons-left" | "chevrons-right" | "search" | "arrow-up-right" | "arrow-down-right" | "sun" | "moon" | "monitor" | "user" | "info" | "circle-check" | "alert-triangle" | "circle-x" | "menu" | "more-horizontal" | "file" | "folder" | "pause" | "play" | "terminal" | "calendar" | "image" | "download" | "eye" | "eye-off" | "bell" | "copy" | "quote" | "pipette" | "star" | "upload" | "paperclip" | "panel-left" | "settings" | "home" | "arrow-left" | "message-circle" | "none" | (string & {})`: An icon name: one of the default set, or any name an app registers with setIcons().
2489
+
2478
2490
  ### Indicator
2479
2491
 
2480
2492
  A dot or a small label on the edge of any element (Mantine's Indicator): "New" on an avatar, an unread count on a bell, an online dot. Nine positions, an inward offset, palette or CSS colors, a border and a live pulse.
@@ -2637,7 +2649,7 @@ Properties:
2637
2649
 
2638
2650
  - `label`: string. The title of the event.
2639
2651
  - `time`: string. When ("2 h ago", a date).
2640
- - `icon`: string. An icon of the registry in the bullet.
2652
+ - `icon`: `IconName`. An icon of the registry in the bullet.
2641
2653
  - `color`: string, reflects. Its own color (a failed step in red).
2642
2654
  - `lineVariant` (attribute `line-variant`): `solid` | `dashed` | `dotted`, default `solid`, reflects. The line to the next item (dashed: not happened yet).
2643
2655
 
@@ -2670,7 +2682,7 @@ Properties:
2670
2682
  - `color`: string, reflects. A palette color or any CSS color.
2671
2683
  - `variant`: `light` | `filled` | `outline` | `default` | `transparent`, default `light`, reflects. Visual style.
2672
2684
  - `radius`: `xs` | `sm` | `md` | `lg` | `xl`. Corner radius.
2673
- - `icon`: string, reflects. A registered icon name, or none.
2685
+ - `icon`: `IconName`, reflects. A registered icon name, or none.
2674
2686
  - `closable`: boolean, reflects. A close button; closing hides the alert (cancel ray-close to keep it).
2675
2687
  - `closeLabel` (attribute `close-label`): string, default `Dismiss`. Accessible name of the close button.
2676
2688
 
@@ -2722,7 +2734,7 @@ Properties:
2722
2734
 
2723
2735
  - `label`: string. Title.
2724
2736
  - `color`: string, reflects. Status color: tints the status icon (and a slotted icon's circle).
2725
- - `icon`: string. Status icon from the registry (default: from the color); "none" for no icon.
2737
+ - `icon`: `IconName`. Status icon from the registry (default: from the color); "none" for no icon.
2726
2738
  - `loading`: boolean, reflects. Shows a spinner (notify() does not auto-close it).
2727
2739
  - `hideClose` (attribute `hide-close`): boolean, reflects. No close button.
2728
2740
  - `withBorder` (attribute `with-border`): boolean, reflects. Draws a border.
@@ -2893,7 +2905,9 @@ Properties:
2893
2905
  - `color`: string, reflects. A palette color or any CSS color for done and current dots. Default: the primary color.
2894
2906
  - `size`: `xs` | `sm` | `md` | `lg` | `xl`, default `sm`, reflects. Size of a dot.
2895
2907
  - `align`: `start` | `center` | `end`, default `center`, reflects. Where the row sits in its width.
2896
- - `label`: string. What a step is called: "Round" is announced "Round 4 of 12" and names the element. Default: Step (named Steps).
2908
+ - `label`: string. What a step is called: "Round" is announced "Round 4 of 12" and names the element. Default: Step (named Steps). In another language, use value-text.
2909
+ - `valueText` (attribute `value-text`): string. The announced text, {step} (the current one, from 1) and {count} replaced, numbers in the page's language: value-text="Asalto {step} de {count}". Default: "<label> {step} of {count}".
2910
+ - `doneText` (attribute `done-text`): string. The announced text once every step is done (value = count), with {count}. Default: value-text, else "{count} of {count}, done".
2897
2911
 
2898
2912
  Parts (`::part()`):
2899
2913
 
@@ -3523,7 +3537,11 @@ breakpoint:
3523
3537
 
3524
3538
  The names `<ray-icon name>` and `setIcons()` know (more with `setIcons`):
3525
3539
 
3526
- `close`, `check`, `minus`, `plus`, `chevron-down`, `chevron-up`, `chevron-right`, `chevron-left`, `chevrons-left`, `chevrons-right`, `search`, `arrow-up-right`, `arrow-down-right`, `sun`, `moon`, `monitor`, `user`, `info`, `circle-check`, `alert-triangle`, `circle-x`, `menu`, `more-horizontal`, `file`, `folder`, `pause`, `play`, `terminal`, `calendar`, `image`, `download`, `eye`, `eye-off`, `bell`, `copy`, `pipette`, `star`, `upload`, `paperclip`, `panel-left`, `settings`, `home`, `arrow-left`, `message-circle`
3540
+ `close`, `check`, `minus`, `plus`, `chevron-down`, `chevron-up`, `chevron-right`, `chevron-left`, `chevrons-left`, `chevrons-right`, `search`, `arrow-up-right`, `arrow-down-right`, `sun`, `moon`, `monitor`, `user`, `info`, `circle-check`, `alert-triangle`, `circle-x`, `menu`, `more-horizontal`, `file`, `folder`, `pause`, `play`, `terminal`, `calendar`, `image`, `download`, `eye`, `eye-off`, `bell`, `copy`, `quote`, `pipette`, `star`, `upload`, `paperclip`, `panel-left`, `settings`, `home`, `arrow-left`, `message-circle`
3541
+
3542
+ With a filled version (`<ray-icon name="star" filled>`; the others draw their outline): `user`, `info`, `circle-check`, `alert-triangle`, `circle-x`, `folder`, `bell`, `star`, `settings`, `home`, `message-circle`
3543
+
3544
+ The roles the components draw, each with its default glyph; `setIcons({ "ui.remove": … })` changes one role only, `setIcons({ close: … })` every role that uses the glyph: `ui.close` (close), `ui.clear` (close), `ui.remove` (close), `ui.expand` (chevron-down), `ui.disclosure` (chevron-right), `ui.previous` (chevron-left), `ui.next` (chevron-right), `ui.first` (chevrons-left), `ui.last` (chevrons-right), `ui.separator` (chevron-right), `ui.increment` (chevron-up), `ui.decrement` (chevron-down), `ui.sort` (chevron-up), `ui.checked` (check), `ui.indeterminate` (minus), `ui.copy` (copy), `ui.copied` (check), `ui.show-password` (eye), `ui.hide-password` (eye-off), `ui.play` (play), `ui.pause` (pause), `ui.search` (search), `ui.calendar` (calendar), `ui.eyedropper` (pipette), `ui.upload` (upload), `ui.avatar` (user), `ui.theme-light` (sun), `ui.theme-dark` (moon), `ui.theme-system` (monitor), `ui.trend-up` (arrow-up-right), `ui.trend-down` (arrow-down-right), `ui.trend-flat` (minus)
3527
3545
 
3528
3546
  ## Core API
3529
3547
 
@@ -3584,12 +3602,14 @@ export declare function getCustomPrimary(el?: Element): string | null;
3584
3602
 
3585
3603
  // --- icons -------------------------------------------------------------------
3586
3604
 
3587
- /** Replaces or adds icons (SVG markup or an SVGElement); repaints every component. */
3605
+ /** Replaces or adds icons (SVG markup or an SVGElement); repaints every component. "<name>:filled" is an icon's filled version. */
3588
3606
  export declare function setIcons(icons: Record<string, string | SVGElement>): void;
3589
- /** The SVG markup of a registered icon ("" if unknown). */
3590
- export declare function getIcon(name: string): string;
3591
- /** The registered icon names. */
3592
- export declare function iconNames(): string[];
3607
+ /** The SVG markup of a registered icon ("" if unknown); with filled, its filled version (the outline one without it). */
3608
+ export declare function getIcon(name: string, options?: { filled?: boolean }): string;
3609
+ /** The registered icon names; with filled, those that have a filled version. */
3610
+ export declare function iconNames(options?: { filled?: boolean }): string[];
3611
+ /** The roles the components draw ("ui.close", "ui.remove", "ui.expand"…) and the glyph each one uses unless the app registers the role. */
3612
+ export declare function iconAliases(): Record<string, string>;
3593
3613
 
3594
3614
  // --- base classes ------------------------------------------------------------
3595
3615
 
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # ray-elements
2
2
 
3
- > Web components (custom elements, Shadow DOM, no dependencies) for any web app: plain HTML, React, Vue or a raylang app. npm: `@raylang/elements`, `@raylang/react`, `@raylang/vue`; raylang: the `elements` package. This file describes version 0.6.0.
3
+ > Web components (custom elements, Shadow DOM, no dependencies) for any web app: plain HTML, React, Vue or a raylang app. npm: `@raylang/elements`, `@raylang/react`, `@raylang/vue`; raylang: the `elements` package. This file describes version 0.7.0.
4
4
 
5
5
  ray-elements is a design system of standard web components (custom elements
6
6
  with Shadow DOM, no dependencies): `<ray-button>`, `<ray-input>`,
@@ -75,7 +75,14 @@ reference of every component follows them.
75
75
  (`label` is required: it is the accessible name). Add or replace icons with
76
76
  `setIcons({ inbox: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>' })`
77
77
  (the style of the built-in set: 24×24, a 2px `currentColor` stroke) from
78
- your own code, never from user input.
78
+ your own code, never from user input. `filled` draws an icon's filled
79
+ version for a state (`<ray-icon name="star" filled>` when it is a favorite);
80
+ `"name:filled"` in `setIcons` adds one. An icon the set lacks (`trash`,
81
+ `save`): register it from Lucide, the same grid and stroke —
82
+ `import { Trash2 } from "lucide-static"; setIcons({ trash: Trash2 })` (or
83
+ its SVG pasted in, without a bundler); never draw your own paths. To change
84
+ one control's icon (only the chips' ×), register its role
85
+ (`setIcons({ "ui.remove": … })`, roles listed in the reference).
79
86
  - **Overlays are in the top layer**: `ray-dialog` is a native modal
80
87
  `<dialog>`; popovers, menus, tooltips and notifications are `[popover]`
81
88
  elements. Never fight them with `z-index` or `overflow`.
@@ -329,7 +336,11 @@ Members whose name starts with `_` are internal.
329
336
 
330
337
  ## Icons
331
338
 
332
- `close`, `check`, `minus`, `plus`, `chevron-down`, `chevron-up`, `chevron-right`, `chevron-left`, `chevrons-left`, `chevrons-right`, `search`, `arrow-up-right`, `arrow-down-right`, `sun`, `moon`, `monitor`, `user`, `info`, `circle-check`, `alert-triangle`, `circle-x`, `menu`, `more-horizontal`, `file`, `folder`, `pause`, `play`, `terminal`, `calendar`, `image`, `download`, `eye`, `eye-off`, `bell`, `copy`, `pipette`, `star`, `upload`, `paperclip`, `panel-left`, `settings`, `home`, `arrow-left`, `message-circle`
339
+ `close`, `check`, `minus`, `plus`, `chevron-down`, `chevron-up`, `chevron-right`, `chevron-left`, `chevrons-left`, `chevrons-right`, `search`, `arrow-up-right`, `arrow-down-right`, `sun`, `moon`, `monitor`, `user`, `info`, `circle-check`, `alert-triangle`, `circle-x`, `menu`, `more-horizontal`, `file`, `folder`, `pause`, `play`, `terminal`, `calendar`, `image`, `download`, `eye`, `eye-off`, `bell`, `copy`, `quote`, `pipette`, `star`, `upload`, `paperclip`, `panel-left`, `settings`, `home`, `arrow-left`, `message-circle`
340
+
341
+ With a filled version (`<ray-icon name="star" filled>`; the others draw their outline): `user`, `info`, `circle-check`, `alert-triangle`, `circle-x`, `folder`, `bell`, `star`, `settings`, `home`, `message-circle`
342
+
343
+ The roles the components draw, each with its default glyph; `setIcons({ "ui.remove": … })` changes one role only, `setIcons({ close: … })` every role that uses the glyph: `ui.close` (close), `ui.clear` (close), `ui.remove` (close), `ui.expand` (chevron-down), `ui.disclosure` (chevron-right), `ui.previous` (chevron-left), `ui.next` (chevron-right), `ui.first` (chevrons-left), `ui.last` (chevrons-right), `ui.separator` (chevron-right), `ui.increment` (chevron-up), `ui.decrement` (chevron-down), `ui.sort` (chevron-up), `ui.checked` (check), `ui.indeterminate` (minus), `ui.copy` (copy), `ui.copied` (check), `ui.show-password` (eye), `ui.hide-password` (eye-off), `ui.play` (play), `ui.pause` (pause), `ui.search` (search), `ui.calendar` (calendar), `ui.eyedropper` (pipette), `ui.upload` (upload), `ui.avatar` (user), `ui.theme-light` (sun), `ui.theme-dark` (moon), `ui.theme-system` (monitor), `ui.trend-up` (arrow-up-right), `ui.trend-down` (arrow-down-right), `ui.trend-flat` (minus)
333
344
 
334
345
  ## Reference
335
346
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raylang/elements",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Web components for any app, with raylang extras (shadcn/ui + Mantine inspired)",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": ["web-components", "custom-elements", "design-system", "ui", "raylang"],
package/ray-elements.d.ts CHANGED
@@ -54,12 +54,14 @@ export declare function getCustomPrimary(el?: Element): string | null;
54
54
 
55
55
  // --- icons -------------------------------------------------------------------
56
56
 
57
- /** Replaces or adds icons (SVG markup or an SVGElement); repaints every component. */
57
+ /** Replaces or adds icons (SVG markup or an SVGElement); repaints every component. "<name>:filled" is an icon's filled version. */
58
58
  export declare function setIcons(icons: Record<string, string | SVGElement>): void;
59
- /** The SVG markup of a registered icon ("" if unknown). */
60
- export declare function getIcon(name: string): string;
61
- /** The registered icon names. */
62
- export declare function iconNames(): string[];
59
+ /** The SVG markup of a registered icon ("" if unknown); with filled, its filled version (the outline one without it). */
60
+ export declare function getIcon(name: string, options?: { filled?: boolean }): string;
61
+ /** The registered icon names; with filled, those that have a filled version. */
62
+ export declare function iconNames(options?: { filled?: boolean }): string[];
63
+ /** The roles the components draw ("ui.close", "ui.remove", "ui.expand"…) and the glyph each one uses unless the app registers the role. */
64
+ export declare function iconAliases(): Record<string, string>;
63
65
 
64
66
  // --- base classes ------------------------------------------------------------
65
67
 
@@ -1216,8 +1218,8 @@ export declare class RayBottomNavItem extends RayElement {
1216
1218
  value: string | undefined;
1217
1219
  /** The label. */
1218
1220
  label: string | undefined;
1219
- /** An icon of the registry (or put one in the icon slot). */
1220
- icon: string | undefined;
1221
+ /** An icon of the registry, drawn filled on the current item when it has a filled version (or put one in the icon slot: yours, as it is). */
1222
+ icon: IconName | undefined;
1221
1223
  /** Makes it a link. */
1222
1224
  href: string | undefined;
1223
1225
  /** A count or a short text on the icon. */
@@ -1832,7 +1834,7 @@ export declare class RayBlockquote extends RayElement {
1832
1834
  /** light: tinted background; outline: border and edge only; filled: solid color (a pull quote). */
1833
1835
  variant: "light" | "outline" | "filled";
1834
1836
  /** Registry icon of the mark, or none. The icon slot replaces it. */
1835
- icon: string;
1837
+ icon: IconName;
1836
1838
  /** Text size (lg for a pull quote). */
1837
1839
  size: "sm" | "md" | "lg";
1838
1840
  /** Inner spacing: xs…xl (the spacing scale), px as a number, or a CSS length. Default: md. */
@@ -1928,10 +1930,14 @@ export interface RayCodeEventMap extends HTMLElementEventMap {
1928
1930
  }
1929
1931
 
1930
1932
  // --- Icon (icon)
1931
- /** <ray-icon> setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGElement, drawn with currentColor); iconNames() lists them. Sizes follow the font unless size; --ray-icon-size and --ray-icon-stroke tune the whole system. */
1933
+ /** An icon name: one of the default set, or any name an app registers with setIcons(). */
1934
+ export type IconName = "close" | "check" | "minus" | "plus" | "chevron-down" | "chevron-up" | "chevron-right" | "chevron-left" | "chevrons-left" | "chevrons-right" | "search" | "arrow-up-right" | "arrow-down-right" | "sun" | "moon" | "monitor" | "user" | "info" | "circle-check" | "alert-triangle" | "circle-x" | "menu" | "more-horizontal" | "file" | "folder" | "pause" | "play" | "terminal" | "calendar" | "image" | "download" | "eye" | "eye-off" | "bell" | "copy" | "quote" | "pipette" | "star" | "upload" | "paperclip" | "panel-left" | "settings" | "home" | "arrow-left" | "message-circle" | "none" | (string & {});
1935
+ /** <ray-icon> setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGElement, drawn with currentColor); iconNames() lists them. An icon may have a filled version for a state (filled; "<name>:filled" in setIcons; iconNames({ filled: true }) lists them). The components draw roles ("ui.close", "ui.remove", "ui.expand"…; iconAliases()), each its glyph until the app registers the role: setIcons({ "ui.remove": … }) changes only the chips' ×. Sizes follow the font unless size; --ray-icon-size and --ray-icon-stroke tune the whole system. */
1932
1936
  export declare class RayIcon extends RayElement {
1933
1937
  /** Registered icon name (iconNames()); "none" draws nothing, a blank that keeps the alignment (a menu item without its check). */
1934
- name: string | undefined;
1938
+ name: IconName | undefined;
1939
+ /** The filled version, for a state (active, selected, favorite, unread); the outline icon when there is none. Built in: user, info, circle-check, alert-triangle, circle-x, folder, bell, star, settings, home, message-circle. */
1940
+ filled: boolean | undefined;
1935
1941
  /** xs…xl or any CSS length. Default: 1em. */
1936
1942
  size: string | undefined;
1937
1943
  /** Accessible name; without it the icon is decorative (hidden from screen readers). */
@@ -2077,7 +2083,7 @@ export declare class RayTimelineItem extends RayElement {
2077
2083
  /** When ("2 h ago", a date). */
2078
2084
  time: string | undefined;
2079
2085
  /** An icon of the registry in the bullet. */
2080
- icon: string | undefined;
2086
+ icon: IconName | undefined;
2081
2087
  /** Its own color (a failed step in red). */
2082
2088
  color: string | undefined;
2083
2089
  /** The line to the next item (dashed: not happened yet). */
@@ -2096,7 +2102,7 @@ export declare class RayAlert extends RayElement {
2096
2102
  /** Corner radius. */
2097
2103
  radius: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
2098
2104
  /** A registered icon name, or none. */
2099
- icon: string | undefined;
2105
+ icon: IconName | undefined;
2100
2106
  /** A close button; closing hides the alert (cancel ray-close to keep it). */
2101
2107
  closable: boolean | undefined;
2102
2108
  /** Accessible name of the close button. */
@@ -2142,7 +2148,7 @@ export declare class RayNotification extends RayElement {
2142
2148
  /** Status color: tints the status icon (and a slotted icon's circle). */
2143
2149
  color: string | undefined;
2144
2150
  /** Status icon from the registry (default: from the color); "none" for no icon. */
2145
- icon: string | undefined;
2151
+ icon: IconName | undefined;
2146
2152
  /** Shows a spinner (notify() does not auto-close it). */
2147
2153
  loading: boolean | undefined;
2148
2154
  /** No close button. */
@@ -2269,8 +2275,12 @@ export declare class RayStepDots extends RayElement {
2269
2275
  size: "xs" | "sm" | "md" | "lg" | "xl";
2270
2276
  /** Where the row sits in its width. */
2271
2277
  align: "start" | "center" | "end";
2272
- /** What a step is called: "Round" is announced "Round 4 of 12" and names the element. Default: Step (named Steps). */
2278
+ /** What a step is called: "Round" is announced "Round 4 of 12" and names the element. Default: Step (named Steps). In another language, use value-text. */
2273
2279
  label: string | undefined;
2280
+ /** The announced text, {step} (the current one, from 1) and {count} replaced, numbers in the page's language: value-text="Asalto {step} de {count}". Default: "<label> {step} of {count}". */
2281
+ valueText: string | undefined;
2282
+ /** The announced text once every step is done (value = count), with {count}. Default: value-text, else "{count} of {count}, done". */
2283
+ doneText: string | undefined;
2274
2284
  }
2275
2285
 
2276
2286
  // --- App bar (app-bar)