@raylang/elements 0.5.0 → 0.5.2

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.
package/llms.txt ADDED
@@ -0,0 +1,342 @@
1
+ # ray-elements
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.5.2.
4
+
5
+ ray-elements is a design system of standard web components (custom elements
6
+ with Shadow DOM, no dependencies): `<ray-button>`, `<ray-input>`,
7
+ `<ray-dialog>`… They work in plain HTML, React, Vue, a browser or any webview,
8
+ and get extras in a raylang app (a native bridge to the program). The rules
9
+ below are what this library does differently from what you may assume; the
10
+ reference of every component follows them.
11
+
12
+ ## Load it
13
+
14
+ ```html
15
+ <link rel="stylesheet" href="node_modules/@raylang/elements/tokens.css"> <!-- required: the components read the tokens -->
16
+ <link rel="stylesheet" href="node_modules/@raylang/elements/base.css"> <!-- optional: font, colors and margins of the document -->
17
+ <script type="module">
18
+ import "@raylang/elements"; // registers EVERY <ray-*> element and exports the whole API
19
+ </script>
20
+ ```
21
+
22
+ - The bare name (`"@raylang/elements"`) resolves with a bundler (Vite,
23
+ esbuild…) and in a raylang app (raylang serves the package with an import
24
+ map). A plain page without either imports the files:
25
+ `import { notify } from "./node_modules/@raylang/elements/index.js";`
26
+ (everything), `./node_modules/@raylang/elements/components/<name>/<name>.js`
27
+ (one component), `./node_modules/@raylang/elements/core.js` (the API), or
28
+ declares an import map:
29
+ `<script type="importmap">{ "imports": { "@raylang/elements": "./node_modules/@raylang/elements/index.js" } }</script>`.
30
+
31
+ - `npm install @raylang/elements` (React: also `@raylang/react`; Vue: also
32
+ `@raylang/vue`). With a bundler: `import "@raylang/elements/tokens.css";`.
33
+ - Only some components: `import "@raylang/elements/button";` — one entry per
34
+ component directory (the "Import" line of each component below). Each brings
35
+ what it uses. `import { notify } from "@raylang/elements/notification";` gets
36
+ a component's exports with it.
37
+ - The API without registering any element: `import { setTheme } from
38
+ "@raylang/elements/core";`. Note that `import { RayButton } from
39
+ "@raylang/elements"` loads everything (that entry registers every element).
40
+ - Avoid a flash of unstyled tags: `<style>:not(:defined) { visibility: hidden; }</style>`.
41
+
42
+ ## Rules
43
+
44
+ - **Attributes are kebab-case, properties camelCase**: `full-width` /
45
+ `fullWidth`. Boolean attributes are present or absent (`disabled`, never
46
+ `disabled="false"`). Properties marked "property only" have no attribute:
47
+ set them from JS (arrays, objects, functions). The exception is `checked`
48
+ and `value` on form controls: their attribute is the initial state (see
49
+ Forms).
50
+ - **Shared vocabulary**: `size` = `xs` | `sm` | `md` | `lg` | `xl` (default
51
+ `sm`); `radius` = `xs`…`xl` | `full`; `color` = a palette color (`blue`,
52
+ `red`, `teal`, `gray`…) or any CSS color, default the primary; `variant` per
53
+ component (button: `filled`, `light`, `outline`, `subtle`, `default`,
54
+ `transparent`, `gradient`, `raised`). Use only the values the reference lists.
55
+ - **Slots have exact names**: an icon in a button goes in `slot="left"` or
56
+ `slot="right"` (not `start`/`end`, not `prefix`): `<ray-button><ray-icon
57
+ slot="left" name="plus"></ray-icon>Add</ray-button>`. Content without a
58
+ `slot` goes to the default slot. Check the slot list of the component.
59
+ - **Never hard-code colors, spacing, radii or shadows** in your own CSS: use
60
+ the tokens (`var(--ray-background)`, `var(--ray-foreground)`,
61
+ `var(--ray-border)`, `var(--ray-space-md)`, `var(--ray-radius-default)`,
62
+ `var(--ray-shadow-sm)`). They follow light and dark themes; literal colors do
63
+ not. Prefer the semantic tokens over the palette (`--ray-blue-6`).
64
+ - **Style components from outside** with `color`/`variant`/`size`/`radius`,
65
+ the tokens (custom properties pierce the shadow root) and `::part()` (the
66
+ parts each lists). Do not reach into their
67
+ `shadowRoot` or depend on its markup.
68
+ - **Layout components exist**: `ray-stack` (vertical), `ray-group`
69
+ (horizontal), `ray-grid`, `ray-container`, `ray-center`, `ray-card`
70
+ (a heading of your own in its `header` slot), `ray-app-shell`. Their
71
+ `gap`/`padding` take `xs`…`xl`.
72
+ - **Icons**: `<ray-icon name="settings"></ray-icon>`, from the registry (a
73
+ small set, listed in the reference: there is no `save` or `trash`); decorative unless it has `label`. An icon-only button is
74
+ `<ray-icon-button label="Settings"><ray-icon name="settings"></ray-icon></ray-icon-button>`
75
+ (`label` is required: it is the accessible name). Add or replace icons with
76
+ `setIcons({ inbox: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>' })`
77
+ (the style of the built-in set: 24×24, a 2px `currentColor` stroke) from
78
+ your own code, never from user input.
79
+ - **Overlays are in the top layer**: `ray-dialog` is a native modal
80
+ `<dialog>`; popovers, menus, tooltips and notifications are `[popover]`
81
+ elements. Never fight them with `z-index` or `overflow`.
82
+
83
+ ## An app's frame
84
+
85
+ ```html
86
+ <ray-app-shell>
87
+ <ray-app-bar slot="header" label="Files" description="No folder chosen">
88
+ <ray-button slot="end" variant="default" size="xs">Commands</ray-button>
89
+ <ray-theme-toggle slot="end"></ray-theme-toggle>
90
+ </ray-app-bar>
91
+ <ray-sidebar slot="navbar" label="Workspace">
92
+ <ray-nav-link label="Files" href="#files" active><ray-icon slot="left" name="folder"></ray-icon></ray-nav-link>
93
+ <ray-nav-link label="Settings" href="#settings"><ray-icon slot="left" name="settings"></ray-icon></ray-nav-link>
94
+ </ray-sidebar>
95
+ <main>…</main>
96
+ </ray-app-shell>
97
+ ```
98
+
99
+ `ray-app-bar` is the header on the desktop too (its `label` is the title;
100
+ several elements may share the `end` slot). On narrow screens the sidebar
101
+ becomes a drawer and the shell switches to a phone layout by itself.
102
+
103
+ ## Forms
104
+
105
+ - Inputs are **form-associated**: inside a `<form>` they submit under `name`,
106
+ validate (`required`, `pattern`, `min`…), reset with it and follow a
107
+ disabled `<fieldset>`. Read values with `new FormData(form)` or the
108
+ element's `.value` / `.checked`.
109
+ - The `value` / `checked` **attributes are the initial value**; the
110
+ properties hold the current one. Set `el.value = …` to change it.
111
+ - Fields take `label`, `description` and `error` (the error text also marks it
112
+ invalid): do not wrap them in your own `<label>`.
113
+ - Enter in a `ray-input` submits its form, as in a native field; a submit
114
+ button is `<ray-button type="submit">`.
115
+ - As with native controls: an invalid field (`required` and empty, a wrong
116
+ `type="email"`…) blocks the submit and the browser shows its message; an
117
+ unchecked `ray-checkbox`/`ray-switch` and a `ray-select` with nothing chosen
118
+ are left out of `FormData` (a select's `placeholder` shows meanwhile).
119
+
120
+ ## Events
121
+
122
+ - A value change is a plain `input` (while typing) and `change` event: read
123
+ `event.target.value`.
124
+ - Everything else is a `ray-*` custom event (bubbles, composed) with its data
125
+ in `event.detail`: `ray-select` on a menu (`detail.value`), `ray-close` on a
126
+ dialog (`detail.returnValue`), `ray-request-close` (cancelable). The
127
+ reference lists each component's events and their `detail`.
128
+
129
+ ## Dialogs and notifications
130
+
131
+ ```html
132
+ <ray-dialog id="d" label="Rename">
133
+ <ray-input label="Name" name="name"></ray-input>
134
+ <ray-button slot="footer" variant="default" data-dialog-close>Cancel</ray-button>
135
+ <ray-button slot="footer" data-dialog-close="ok">Save</ray-button>
136
+ </ray-dialog>
137
+ ```
138
+
139
+ `d.show()` or the `open` attribute opens it; any slotted element with
140
+ `data-dialog-close` closes it (its value becomes `returnValue`); the close
141
+ button, Escape and the backdrop close it with `returnValue` `""` (after a
142
+ cancelable `ray-request-close`).
143
+ `await confirmDialog({ label, message, confirmLabel, cancelLabel, color: "red" })`
144
+ asks a yes/no question (every option is optional: "Are you sure?",
145
+ "Confirm", "Cancel"); `notify({ title, message, color })` shows a
146
+ notification (`message` is plain text; a `color` adds a status icon:
147
+ green a check, red an error, yellow a warning, others info).
148
+
149
+ ## Theme
150
+
151
+ - The theme follows the system. Force it on the page or any subtree with
152
+ `data-theme="light"` | `"dark"`; change the primary color with
153
+ `data-primary="violet"` (a palette color).
154
+ - From JS: `setTheme("light" | "dark" | "system")`, `setPrimary("violet")`,
155
+ `definePrimary("#7c3aed")` (any brand color: builds the ten shades and
156
+ checks contrast), `onThemeChange(cb)`. `<ray-theme-toggle>` is the switch.
157
+ - App-wide defaults for a component: `configure({ defaults: { "ray-button":
158
+ { variant: "light" } } })`.
159
+
160
+ ## React and Vue
161
+
162
+ ```tsx
163
+ import "@raylang/elements/tokens.css";
164
+ import { RayInput, RayMenu, RayMenuItem, RayButton } from "@raylang/react";
165
+
166
+ <RayInput label="Name" value={name} onInput={(e) => setName(e.currentTarget.value)} />
167
+ <RayMenu onRaySelect={(e) => run(e.detail.value)}>
168
+ <RayButton slot="trigger">Actions</RayButton>
169
+ <RayMenuItem value="rename">Rename</RayMenuItem>
170
+ </RayMenu>
171
+ ```
172
+
173
+ ```vue
174
+ <!-- main.ts: import RayElements from "@raylang/vue"; app.use(RayElements) -->
175
+ <RayInput v-model="name" label="Name" required />
176
+ <RayDialog v-model="open" label="Confirm" @ray-close="onClose">…</RayDialog>
177
+ ```
178
+
179
+ - The wrapper of `<ray-tag-name>` is `RayTagName`. React events are `on` +
180
+ PascalCase of the event (`onRaySelect`, `onChange`); props are set as DOM
181
+ properties. Vue has `v-model` where the reference lists a model (`value`,
182
+ `checked` or `open`).
183
+ - A wrapper registers only its own element: a plain `<ray-*>` tag in JSX
184
+ needs its import (`import "@raylang/elements/badge"`).
185
+
186
+ ## In a raylang app
187
+
188
+ `ray add elements` brings the raylang package `elements`: it serves
189
+ `@raylang/elements` to the app's pages by its npm name, with no npm and no
190
+ build step. The page:
191
+
192
+ ```html
193
+ <link rel="stylesheet" href="/node_modules/@raylang/elements/tokens.css">
194
+ <script type="module">
195
+ import { enableRaylang } from "@raylang/elements";
196
+ const host = await enableRaylang(); // the native host, or null in a browser
197
+ </script>
198
+ ```
199
+
200
+ The program serves the page and answers the bridge before its own events:
201
+
202
+ ```ray
203
+ import std/ui;
204
+ import elements/bridge;
205
+
206
+ fn main() -> int {
207
+ match (run()) {
208
+ Result.Ok(code) => code,
209
+ Result.Err(e) => {
210
+ eprint(e);
211
+ 1
212
+ },
213
+ }
214
+ }
215
+
216
+ fn run() -> Result<int, string> {
217
+ ui.mount_embed_at("", "assets")?; // the page: assets/index.html, ray.toml [native] embed = ["assets"]
218
+ ui.open_with("App", "ray://app/index.html", ui.options(800, 600))?;
219
+ while (true) {
220
+ let e = ui.next_event()?;
221
+ if (bridge.handle(e)) {
222
+ continue; // a ray-elements request, already answered
223
+ }
224
+ if (e.kind == "closed") {
225
+ return Result.Ok(0);
226
+ }
227
+ // the app's own events: e.kind == "message" (window.ray.send), e.tag…
228
+ }
229
+ }
230
+ ```
231
+
232
+ With the bridge: `<ray-file-upload native>` and `<ray-path-input>` use the
233
+ system file dialogs and give real paths, `confirmDialog()` asks with the
234
+ system dialog, `<ray-menu native>` opens a native context menu,
235
+ `<ray-command-palette native-menus>` runs the app's menu bar
236
+ (`bridge.menu`, `bridge.route`), `ray-app-shell` becomes the title bar of a
237
+ `full_content` window, and `trackEdits(form)` shows the unsaved mark. The
238
+ components that use it have an "In a raylang app" section. Without the
239
+ bridge every component keeps its web behavior.
240
+
241
+ ## Check your markup
242
+
243
+ The package checks markup against this version:
244
+ `npx ray-elements check src/` (with npm), or
245
+ `node node_modules/@raylang/elements/check/cli.js check assets/` (a raylang
246
+ app). It reports unknown elements, attributes, slots and `ray-*` events,
247
+ invalid values, unregistered icons and literal colors, with the line and a
248
+ suggestion, and exits with 1 on an error. Run it after writing a page and fix
249
+ what it reports; `--format json` gives the diagnostics as JSON.
250
+
251
+ ## Your own components
252
+
253
+ Extend `RayElement`, `FormControl`, `FieldControl` or `Floating` (or any
254
+ component class) from `@raylang/elements/core`; see the Extending guide.
255
+ Members whose name starts with `_` are internal.
256
+
257
+ ## Components
258
+
259
+ - [Button](https://elements.raylang.dev/components/button.md): `<ray-button>` (Buttons). A button, or a link styled as one with href.
260
+ - [Button group](https://elements.raylang.dev/components/button-group.md): `<ray-button-group>` (Buttons). Buttons joined into one control: inner corners squared, borders overlapped.
261
+ - [Icon button](https://elements.raylang.dev/components/icon-button.md): `<ray-icon-button>` (Buttons). A square button for an icon (Mantine's ActionIcon).
262
+ - [Toggle](https://elements.raylang.dev/components/toggle.md): `<ray-toggle>` (Buttons). A two-state button (aria-pressed): bold in a toolbar, mute, favorite.
263
+ - [Toggle group](https://elements.raylang.dev/components/toggle-group.md): `<ray-toggle-group>` (Buttons). ray-toggle elements with one shared value: type="single" (at most one on: alignment, view mode) or "multiple" (bold / italic / underline).
264
+ - [Checkbox](https://elements.raylang.dev/components/checkbox.md): `<ray-checkbox>` (Inputs). A checkbox with label, description and error.
265
+ - [Checkbox group](https://elements.raylang.dev/components/checkbox-group.md): `<ray-checkbox-group>` (Inputs). Several choices among options (Mantine's Checkbox.Group): a label, description and error around ray-checkbox elements; the value is the array of the checked ones.
266
+ - [Color picker](https://elements.raylang.dev/components/color-picker.md): `<ray-color-picker>`, `<ray-color-input>` (Inputs). Pick a color: an inline picker (saturation area, hue, opacity, swatches) and a text field with the picker in a dropdown and an eyedropper.
267
+ - [Combobox](https://elements.raylang.dev/components/combobox.md): `<ray-combobox>` (Inputs). A select you can type in, an autocomplete (Mantine's searchable Select, MultiSelect and TagsInput): typing filters the options; multiple keeps chips; creatable adds new values; clearable, max-values, groups, a result limit.
268
+ - [Date picker](https://elements.raylang.dev/components/date-picker.md): `<ray-date-picker>`, `<ray-calendar>` (Inputs). A date field with a calendar dropdown, and the calendar on its own.
269
+ - [File upload](https://elements.raylang.dev/components/file-upload.md): `<ray-file-upload>` (Inputs). A drop zone to pick files: drag, click, keyboard or paste.
270
+ - [Input](https://elements.raylang.dev/components/input.md): `<ray-input>` (Inputs). A text field with label, description and error (Mantine's TextInput).
271
+ - [Number input](https://elements.raylang.dev/components/number-input.md): `<ray-number-input>` (Inputs). A number field (Mantine's NumberInput): + and − buttons (hold to repeat), arrow keys, min, max and step, fixed decimals, a prefix and a suffix, a thousands separator.
272
+ - [Password input](https://elements.raylang.dev/components/password-input.md): `<ray-password-input>` (Inputs). A password field with a button that shows or hides what was typed (Mantine's PasswordInput).
273
+ - [Path input](https://elements.raylang.dev/components/path-input.md): `<ray-path-input>` (Inputs). A field for a path on disk: a file to open, a folder, or where to save.
274
+ - [Radio group](https://elements.raylang.dev/components/radio.md): `<ray-radio-group>`, `<ray-radio>` (Inputs). One choice among options: ray-radio elements inside a ray-radio-group, which is the form control.
275
+ - [Search](https://elements.raylang.dev/components/search.md): `<ray-search>` (Inputs). A search box: icon, clear button, an optional shortcut that focuses it, and a debounced ray-search event.
276
+ - [Segmented control](https://elements.raylang.dev/components/segmented-control.md): `<ray-segmented-control>` (Inputs). One choice among a few, as a segmented row with a sliding indicator.
277
+ - [Select](https://elements.raylang.dev/components/select.md): `<ray-select>` (Inputs). A select with its own dropdown (keyboard, typeahead, groups); options from child <option> elements or the data property.
278
+ - [Slider](https://elements.raylang.dev/components/slider.md): `<ray-slider>` (Inputs). A native range input (keyboard, touch and screen readers as usual) with label, value display and marks.
279
+ - [Switch](https://elements.raylang.dev/components/switch.md): `<ray-switch>` (Inputs). An on/off toggle with the same API as Checkbox, announced as a switch.
280
+ - [Textarea](https://elements.raylang.dev/components/textarea.md): `<ray-textarea>` (Inputs). A multi-line text field that can grow with its content.
281
+ - [Bottom nav](https://elements.raylang.dev/components/bottom-nav.md): `<ray-bottom-nav>`, `<ray-bottom-nav-item>` (Navigation). The bottom navigation of a phone app (Material's navigation bar, the iOS tab bar): three to five destinations with an icon, a label and a badge, the current one marked by a pill.
282
+ - [Breadcrumbs](https://elements.raylang.dev/components/breadcrumbs.md): `<ray-breadcrumbs>`, `<ray-breadcrumb>` (Navigation). Where a page sits (Mantine's Breadcrumbs, the WAI-ARIA breadcrumb pattern): links in a labelled nav, the last one the current page.
283
+ - [Nav link](https://elements.raylang.dev/components/nav-link.md): `<ray-nav-link>` (Navigation). A sidebar/navigation item: icon, label, description, badge, active state, and nested nav links that collapse under it.
284
+ - [Pagination](https://elements.raylang.dev/components/pagination.md): `<ray-pagination>` (Navigation). Page navigation: previous/next, optional first/last, page numbers with ellipses; the number of items stays constant so it does not jump.
285
+ - [Sidebar](https://elements.raylang.dev/components/sidebar.md): `<ray-sidebar>`, `<ray-sidebar-group>` (Navigation). The side navigation of an app shell: header, content and footer; on wide screens it collapses to an icon rail, below a breakpoint it becomes an off-canvas drawer.
286
+ - [Stepper](https://elements.raylang.dev/components/stepper.md): `<ray-stepper>`, `<ray-step>` (Navigation). A task in steps (Mantine's Stepper): a wizard, a checkout, an onboarding.
287
+ - [Tabs](https://elements.raylang.dev/components/tabs.md): `<ray-tabs>`, `<ray-tab>`, `<ray-tab-panel>` (Navigation). Tabs and panels (WAI-ARIA tabs pattern): arrows, Home/End, automatic or manual activation.
288
+ - [Command palette](https://elements.raylang.dev/components/command-palette.md): `<ray-command-palette>` (Overlays). Search and run actions from the keyboard (Mantine's Spotlight): fuzzy search, groups, shortcuts, ⌘K / Ctrl+K; combobox + listbox pattern in a modal dialog.
289
+ - [Dialog](https://elements.raylang.dev/components/dialog.md): `<ray-dialog>` (Overlays). ray-elements's modal, on the native <dialog>: top layer, the rest of the page inert, focus trapped and restored, stackable.
290
+ - [Drawer](https://elements.raylang.dev/components/drawer.md): `<ray-drawer>` (Overlays). A panel sliding in from an edge: a RayDialog (focus, Escape, persistent, data-dialog-close, returnValue) with another look; modeless for side panels that keep the page interactive.
291
+ - [Menu](https://elements.raylang.dev/components/menu.md): `<ray-menu>`, `<ray-menu-item>`, `<ray-menu-label>`, `<ray-menu-divider>` (Overlays). A dropdown menu (menu button pattern: arrows, Home/End, typeahead, Enter, Escape) or, with context, a context menu at the pointer.
292
+ - [Popover](https://elements.raylang.dev/components/popover.md): `<ray-popover>` (Overlays). A floating panel anchored to a trigger, in the top layer; closes on Escape and outside clicks.
293
+ - [Tooltip](https://elements.raylang.dev/components/tooltip.md): `<ray-tooltip>` (Overlays). A short hint on hover and focus of its child; the label also becomes the child's accessible description.
294
+ - [Accordion](https://elements.raylang.dev/components/accordion.md): `<ray-accordion>`, `<ray-accordion-item>` (Data display). Collapsible sections (WAI-ARIA accordion pattern); one open at a time, or several with multiple.
295
+ - [Attachment](https://elements.raylang.dev/components/attachment.md): `<ray-attachment>`, `<ray-attachments>` (Data display). A file in a composer, upload list or chat: thumbnail or type icon, name, size, upload progress, error, remove and download.
296
+ - [Avatar](https://elements.raylang.dev/components/avatar.md): `<ray-avatar>` (Data display). An image, the initials of a name, or a placeholder icon.
297
+ - [Badge](https://elements.raylang.dev/components/badge.md): `<ray-badge>` (Data display). A short status label.
298
+ - [Blockquote](https://elements.raylang.dev/components/blockquote.md): `<ray-blockquote>` (Data display). A quotation set apart from the text (Mantine's Blockquote): a colored edge, a quote mark on it and the attribution below.
299
+ - [Carousel](https://elements.raylang.dev/components/carousel.md): `<ray-carousel>` (Data display). Slides in a scroll-snap viewport: native swipe and scrolling, previous/next controls, indicators, keyboard, loop and autoplay with a pause button.
300
+ - [Code](https://elements.raylang.dev/components/code.md): `<ray-code>` (Data display). A block of source code: header with file name and language, copy button, line numbers, highlighted lines, diff lines, wrapping and a "show more" height.
301
+ - [Icon](https://elements.raylang.dev/components/icon.md): `<ray-icon>` (Data display). An icon of the registry: the whole set (the components' too) changes with setIcons().
302
+ - [Indicator](https://elements.raylang.dev/components/indicator.md): `<ray-indicator>` (Data display). 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.
303
+ - [Kbd](https://elements.raylang.dev/components/kbd.md): `<ray-kbd>` (Data display). A keyboard key: a raised keycap, or a flat chip (filled or outline) for hints in menus and buttons.
304
+ - [Stat](https://elements.raylang.dev/components/stat.md): `<ray-stat>` (Data display). A metric tile: label, value, change against a previous period, note.
305
+ - [Table](https://elements.raylang.dev/components/table.md): `<ray-table>` (Data display). A data table from columns and data: sorting (aria-sort), row selection, clickable rows, sticky header, striped, empty state.
306
+ - [Timeline](https://elements.raylang.dev/components/timeline.md): `<ray-timeline>`, `<ray-timeline-item>` (Data display). Events in order along a line (Mantine's Timeline): activity, history, a deploy's stages.
307
+ - [Alert](https://elements.raylang.dev/components/alert.md): `<ray-alert>` (Feedback). An inline message: title, text, an icon of the registry, the color variants and an optional close button.
308
+ - [Empty state](https://elements.raylang.dev/components/empty-state.md): `<ray-empty-state>` (Feedback). What a list, table or pane shows when it is empty: icon, title, text and the action that fills it.
309
+ - [Notification](https://elements.raylang.dev/components/notification.md): `<ray-notification>`, `<ray-toaster>` (Feedback). Toasts: notify(), updateNotification(), hideNotification(), clearNotifications(); shown in a ray-toaster (a polite live region in the top layer).
310
+ - [Progress](https://elements.raylang.dev/components/progress.md): `<ray-progress>` (Feedback). A determinate or (without value) indeterminate progress bar, announced as a progressbar.
311
+ - [Skeleton](https://elements.raylang.dev/components/skeleton.md): `<ray-skeleton>` (Feedback). A placeholder while content loads: a shimmering block, a circle or text lines; with loaded it shows its content.
312
+ - [Spinner](https://elements.raylang.dev/components/spinner.md): `<ray-spinner>` (Feedback). An indeterminate loading indicator, announced as a status.
313
+ - [App bar](https://elements.raylang.dev/components/app-bar.md): `<ray-app-bar>` (Layout). The top bar of a phone screen (Material's top app bar, the iOS navigation bar): back or menu, a title and subtitle, actions, and an optional row under it.
314
+ - [App shell](https://elements.raylang.dev/components/app-shell.md): `<ray-app-shell>` (Layout). The frame of an app (Mantine's AppShell): header, navbar, main, aside and footer on wide screens; on phones one column with a bottom bar.
315
+ - [Aspect ratio](https://elements.raylang.dev/components/aspect-ratio.md): `<ray-aspect-ratio>` (Layout). A box with a fixed width/height ratio; its image, video or iframe fills it.
316
+ - [Card](https://elements.raylang.dev/components/card.md): `<ray-card>` (Layout). A surface for grouped content, with optional media, header and footer.
317
+ - [Center](https://elements.raylang.dev/components/center.md): `<ray-center>` (Layout). Its content centered on both axes (Mantine's Center): empty states, loaders, a sign-in card.
318
+ - [Container](https://elements.raylang.dev/components/container.md): `<ray-container>` (Layout). Its content centered, up to a maximum width, with side padding (Mantine's Container): the column of a page.
319
+ - [Grid](https://elements.raylang.dev/components/grid.md): `<ray-grid>` (Layout). A responsive grid: a column count per width (cols="1 sm:2 lg:4") measured on the grid itself, or as many columns of a minimum width as fit.
320
+ - [Group](https://elements.raylang.dev/components/group.md): `<ray-group>` (Layout). Its children in a row (Mantine's Group): spaced by the space scale, centered, wrapping when they do not fit.
321
+ - [Scroll area](https://elements.raylang.dev/components/scroll-area.md): `<ray-scroll-area>` (Layout). A box that scrolls its content with the native scrolling and a thin themed scrollbar (Mantine's ScrollArea).
322
+ - [Separator](https://elements.raylang.dev/components/separator.md): `<ray-separator>` (Layout). A horizontal or vertical rule, optionally labeled (Mantine's Divider).
323
+ - [Split](https://elements.raylang.dev/components/split.md): `<ray-split>` (Layout). Two panes with a draggable, keyboard-accessible divider (window splitter pattern); the size can be remembered.
324
+ - [Stack](https://elements.raylang.dev/components/stack.md): `<ray-stack>` (Layout). Its children in a column, spaced by the space scale (Mantine's Stack): forms, panels, anything stacked.
325
+ - [Status bar](https://elements.raylang.dev/components/statusbar.md): `<ray-statusbar>`, `<ray-statusbar-item>` (Layout). The bar at the bottom of an app window: items on the left and on the right; items with action are buttons.
326
+ - [Theme toggle](https://elements.raylang.dev/components/theme-toggle.md): `<ray-theme-toggle>` (Theme). Icon button that cycles the document theme: system, light, dark.
327
+
328
+ ## Icons
329
+
330
+ `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`
331
+
332
+ ## Reference
333
+
334
+ - [llms-full.txt](https://elements.raylang.dev/llms-full.txt): these rules and the whole reference in one file: every component's API, the tokens, the icon names and the core's TypeScript declarations
335
+ - [Foundations](https://elements.raylang.dev/foundations.html): the tokens, with their values in both themes
336
+ - [Getting started](https://elements.raylang.dev/getting-started.html): install, load, theme
337
+
338
+ ## Optional
339
+
340
+ - [raylang](https://elements.raylang.dev/raylang.html): the native bridge and the `elements` package in detail
341
+ - [Extending](https://elements.raylang.dev/extending.html): the component contract and the base classes
342
+ - [Charts](https://elements.raylang.dev/charts.html): theming Chart.js, uPlot or ECharts with the chart tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raylang/elements",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
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"],
@@ -20,6 +20,9 @@
20
20
  "main": "./index.js",
21
21
  "module": "./index.js",
22
22
  "types": "./ray-elements.d.ts",
23
+ "bin": {
24
+ "ray-elements": "./check/cli.js"
25
+ },
23
26
  "exports": {
24
27
  ".": {
25
28
  "types": "./ray-elements.d.ts",
@@ -29,6 +32,10 @@
29
32
  "types": "./ray-elements.d.ts",
30
33
  "default": "./core.js"
31
34
  },
35
+ "./check": {
36
+ "types": "./check/check.d.ts",
37
+ "default": "./check/check.js"
38
+ },
32
39
  "./button": {
33
40
  "types": "./ray-elements.d.ts",
34
41
  "default": "./components/button/button.js"
@@ -306,6 +313,8 @@
306
313
  "./base.css": "./base.css",
307
314
  "./custom-elements.json": "./custom-elements.json",
308
315
  "./vscode.html-custom-data.json": "./vscode.html-custom-data.json",
316
+ "./llms.txt": "./llms.txt",
317
+ "./llms-full.txt": "./llms-full.txt",
309
318
  "./core/*": "./core/*",
310
319
  "./components/*": "./components/*"
311
320
  },
package/ray-elements.d.ts CHANGED
@@ -957,6 +957,8 @@ export declare class RayRadioGroup extends FormControl {
957
957
  export declare class RayRadio extends RayElement {
958
958
  /** Value given to the group when chosen. */
959
959
  value: string | undefined;
960
+ /** Whether this radio is the group's value; setting it sets the group's value. The checked attribute marks the group's initial value (when the group has no value attribute). */
961
+ checked: boolean | undefined;
960
962
  /** Label text (or the content). */
961
963
  label: string | undefined;
962
964
  /** Help text under the label. */
@@ -969,8 +971,6 @@ export declare class RayRadio extends RayElement {
969
971
  size: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
970
972
  /** Overrides the group variant. */
971
973
  variant: "filled" | "outline" | undefined;
972
- /** Whether this radio is the group's value. */
973
- readonly checked: boolean;
974
974
  }
975
975
 
976
976
  // --- Search (search)
@@ -1923,7 +1923,7 @@ export interface RayCodeEventMap extends HTMLElementEventMap {
1923
1923
  // --- Icon (icon)
1924
1924
  /** <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. */
1925
1925
  export declare class RayIcon extends RayElement {
1926
- /** Registered icon name (iconNames()). */
1926
+ /** Registered icon name (iconNames()); "none" draws nothing, a blank that keeps the alignment (a menu item without its check). */
1927
1927
  name: string | undefined;
1928
1928
  /** xs…xl or any CSS length. Default: 1em. */
1929
1929
  size: string | undefined;