@raylang/elements 0.5.1 → 0.6.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.
- package/check/check.d.ts +45 -0
- package/check/check.js +419 -0
- package/check/cli.js +145 -0
- package/components/button/button.js +17 -0
- package/components/number-input/number-input.js +54 -8
- package/components/radio/radio.js +86 -6
- package/components/ring-progress/ring-progress.js +127 -0
- package/components/step-dots/step-dots.js +86 -0
- package/custom-elements.json +1457 -144
- package/index.js +3 -1
- package/llms-full.txt +97 -14
- package/llms.txt +15 -3
- package/package.json +16 -1
- package/ray-elements.d.ts +57 -9
- package/vscode.html-custom-data.json +612 -62
package/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { RayInput } from "./components/input/input.js";
|
|
|
19
19
|
export { RayNumberInput, parseNumber, formatNumber } from "./components/number-input/number-input.js";
|
|
20
20
|
export { RayPasswordInput } from "./components/password-input/password-input.js";
|
|
21
21
|
export { RayPathInput, dirName, baseName } from "./components/path-input/path-input.js";
|
|
22
|
-
export { RayRadioGroup, RayRadio } from "./components/radio/radio.js";
|
|
22
|
+
export { RayRadioGroup, RayRadio, RayRadioCard } from "./components/radio/radio.js";
|
|
23
23
|
export { RaySearch } from "./components/search/search.js";
|
|
24
24
|
export { RaySegmentedControl } from "./components/segmented-control/segmented-control.js";
|
|
25
25
|
export { RaySelect } from "./components/select/select.js";
|
|
@@ -56,8 +56,10 @@ export { RayAlert } from "./components/alert/alert.js";
|
|
|
56
56
|
export { RayEmptyState } from "./components/empty-state/empty-state.js";
|
|
57
57
|
export { RayNotification, RayToaster, notify, updateNotification, hideNotification, clearNotifications, statusIcon } from "./components/notification/notification.js";
|
|
58
58
|
export { RayProgress } from "./components/progress/progress.js";
|
|
59
|
+
export { RayRingProgress } from "./components/ring-progress/ring-progress.js";
|
|
59
60
|
export { RaySkeleton } from "./components/skeleton/skeleton.js";
|
|
60
61
|
export { RaySpinner } from "./components/spinner/spinner.js";
|
|
62
|
+
export { RayStepDots } from "./components/step-dots/step-dots.js";
|
|
61
63
|
export { RayAppBar } from "./components/app-bar/app-bar.js";
|
|
62
64
|
export { RayAppShell } from "./components/app-shell/app-shell.js";
|
|
63
65
|
export { RayAspectRatio, parseRatio } from "./components/aspect-ratio/aspect-ratio.js";
|
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.
|
|
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.
|
|
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>`,
|
|
@@ -238,6 +238,16 @@ system dialog, `<ray-menu native>` opens a native context menu,
|
|
|
238
238
|
components that use it have an "In a raylang app" section. Without the
|
|
239
239
|
bridge every component keeps its web behavior.
|
|
240
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
|
+
|
|
241
251
|
## Your own components
|
|
242
252
|
|
|
243
253
|
Extend `RayElement`, `FormControl`, `FieldControl` or `Floating` (or any
|
|
@@ -282,7 +292,7 @@ Properties:
|
|
|
282
292
|
- `variant`: `filled` | `light` | `outline` | `subtle` | `default` | `transparent` | `gradient` | `raised`, default `filled`, reflects. Visual style. raised: a physical key on a darker edge that sinks when pressed (mouse, touch or keyboard).
|
|
283
293
|
- `gradient`: string, reflects. With variant=gradient: "from to [deg]", palette colors or CSS colors ("teal blue 90"). Default: the --ray-gradient-* tokens.
|
|
284
294
|
- `color`: string. A palette color (blue, red…) or any CSS color. Default: the primary color.
|
|
285
|
-
- `size`: `xs
|
|
295
|
+
- `size`: `"xs" | "sm" | "md" | "lg" | "xl" | (string & {})`, default `sm`, reflects. Height, padding and font size: xs…xl or any CSS length (the padding and the font follow).
|
|
286
296
|
- `radius`: `xs` | `sm` | `md` | `lg` | `xl` | `full`. Corner radius. Default: --ray-radius-default.
|
|
287
297
|
- `type`: `button` | `submit` | `reset`, default `button`. submit/reset act on the enclosing form.
|
|
288
298
|
- `disabled`: boolean. Not interactive (also when inside a disabled fieldset).
|
|
@@ -344,7 +354,7 @@ Properties:
|
|
|
344
354
|
- `variant`: `filled` | `light` | `outline` | `subtle` | `default` | `transparent` | `gradient` | `raised`, default `subtle`, reflects. Visual style.
|
|
345
355
|
- `gradient`: string, reflects. With variant=gradient: "from to [deg]", palette colors or CSS colors ("teal blue 90"). Default: the --ray-gradient-* tokens.
|
|
346
356
|
- `color`: string. A palette color or any CSS color.
|
|
347
|
-
- `size`: `xs
|
|
357
|
+
- `size`: `"xs" | "sm" | "md" | "lg" | "xl" | (string & {})`, default `sm`, reflects. Width and height: xs…xl or any CSS length ("5.5rem": a big main action, round with radius=full); the icon scales with it.
|
|
348
358
|
- `disabled`: boolean. Not interactive.
|
|
349
359
|
- `loading`: boolean. Shows a spinner instead of the icon.
|
|
350
360
|
|
|
@@ -434,7 +444,7 @@ Import: `import "@raylang/elements/checkbox";` · Category: Inputs
|
|
|
434
444
|
|
|
435
445
|
Properties:
|
|
436
446
|
|
|
437
|
-
- `checked` (
|
|
447
|
+
- `checked` (attribute `checked`: the initial value only): boolean. Current state. The checked attribute is the initial state (restored on reset).
|
|
438
448
|
- `indeterminate`: boolean, reflects. Mixed state; cleared on the next user change.
|
|
439
449
|
- `value`: string, default `on`, reflects. Submitted value when checked.
|
|
440
450
|
- `name`: string. Form field name.
|
|
@@ -478,7 +488,7 @@ The group is the form control: one entry per checked value under name (like chec
|
|
|
478
488
|
|
|
479
489
|
Properties:
|
|
480
490
|
|
|
481
|
-
- `value` (
|
|
491
|
+
- `value` (attribute `value`: the initial value only): `string[]`. The checked values. The value attribute: "a,b".
|
|
482
492
|
- `name`: string, reflects. Form field name.
|
|
483
493
|
- `label`: string. Group label (also its accessible name).
|
|
484
494
|
- `description`: string. Help text.
|
|
@@ -615,7 +625,7 @@ The WAI-ARIA combobox pattern (a text field with a listbox popup; the active opt
|
|
|
615
625
|
|
|
616
626
|
Properties:
|
|
617
627
|
|
|
618
|
-
- `value` (
|
|
628
|
+
- `value` (attribute `value`: the initial value only): `string | string[]`. The chosen value; an array with multiple. The value attribute: "a,b" with multiple.
|
|
619
629
|
- `data` (property only): `Array<string | { value: string; label?: string; disabled?: boolean; group?: string }>`. Options instead of child <option>/<optgroup> elements.
|
|
620
630
|
- `multiple`: boolean, reflects. Several values, shown as chips.
|
|
621
631
|
- `placeholder`: string. Shown while empty.
|
|
@@ -901,7 +911,7 @@ Vue `v-model`: `value` (updated on input).
|
|
|
901
911
|
|
|
902
912
|
### Number input
|
|
903
913
|
|
|
904
|
-
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. An ARIA spinbutton.
|
|
914
|
+
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, or a duration (m:ss). An ARIA spinbutton.
|
|
905
915
|
|
|
906
916
|
Import: `import "@raylang/elements/number-input";` · Category: Inputs
|
|
907
917
|
|
|
@@ -921,6 +931,7 @@ Properties:
|
|
|
921
931
|
- `thousandsSeparator` (attribute `thousands-separator`): string. Groups thousands in the shown text (",", ".", " ").
|
|
922
932
|
- `decimalSeparator` (attribute `decimal-separator`): string, default `.`. The decimal mark shown and typed ("," in many locales).
|
|
923
933
|
- `clamp`: `blur` | `strict` | `none`, default `blur`. When out-of-range input is clamped: on blur, while typing, or never (then it is invalid).
|
|
934
|
+
- `format`: `number` | `duration`, default `number`, reflects. duration: the value is seconds, shown and typed as m:ss (h:mm:ss when min or max reaches an hour; a plain number is seconds); aria-valuetext says "3 minutes, 15 seconds" in the page's language. decimals, prefix, suffix and the separators do not apply.
|
|
924
935
|
- `hideControls` (attribute `hide-controls`): boolean, reflects. No + and − buttons (the keys still step).
|
|
925
936
|
- `placeholder`: string. Shown while empty.
|
|
926
937
|
- `readonly`: boolean, reflects. Not editable, still submitted.
|
|
@@ -1042,7 +1053,7 @@ for e in ui.events() {
|
|
|
1042
1053
|
|
|
1043
1054
|
### Radio group
|
|
1044
1055
|
|
|
1045
|
-
One choice among options: ray-radio elements inside a ray-radio-group, which is the form control.
|
|
1056
|
+
One choice among options: ray-radio (or ray-radio-card) elements inside a ray-radio-group, which is the form control.
|
|
1046
1057
|
|
|
1047
1058
|
Import: `import "@raylang/elements/radio";` · Category: Inputs
|
|
1048
1059
|
|
|
@@ -1072,11 +1083,11 @@ Events:
|
|
|
1072
1083
|
|
|
1073
1084
|
Slots:
|
|
1074
1085
|
|
|
1075
|
-
- (default): ray-radio elements (may be wrapped in layout elements).
|
|
1086
|
+
- (default): ray-radio or ray-radio-card elements (may be wrapped in layout elements: a ray-grid of cards).
|
|
1076
1087
|
|
|
1077
1088
|
Methods and properties:
|
|
1078
1089
|
|
|
1079
|
-
- `readonly radios: RayRadio[]`: The radios of the group.
|
|
1090
|
+
- `readonly radios: RayRadio[]`: The radios (and radio cards) of the group.
|
|
1080
1091
|
|
|
1081
1092
|
Vue `v-model`: `value` (updated on change).
|
|
1082
1093
|
|
|
@@ -1085,6 +1096,7 @@ Vue `v-model`: `value` (updated on change).
|
|
|
1085
1096
|
Properties:
|
|
1086
1097
|
|
|
1087
1098
|
- `value`: string, reflects. Value given to the group when chosen.
|
|
1099
|
+
- `checked` (attribute `checked`: the initial value only): boolean. 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).
|
|
1088
1100
|
- `label`: string. Label text (or the content).
|
|
1089
1101
|
- `description`: string. Help text under the label.
|
|
1090
1102
|
- `disabled`: boolean. Cannot be chosen.
|
|
@@ -1101,9 +1113,25 @@ Parts (`::part()`):
|
|
|
1101
1113
|
- `indicator`: The circle.
|
|
1102
1114
|
- `label`: The label.
|
|
1103
1115
|
|
|
1104
|
-
|
|
1116
|
+
#### `<ray-radio-card>` (RayRadioCard, extends RayRadio)
|
|
1117
|
+
|
|
1118
|
+
A radio drawn as a card: a title (label), a detail (description), an icon, more content; checked, it takes the color's border and light background. Inside a ray-radio-group like a ray-radio (arrow keys, the form, required, disabled); put the cards in a ray-grid for columns.
|
|
1119
|
+
|
|
1120
|
+
Properties:
|
|
1121
|
+
|
|
1122
|
+
- `hideIndicator` (attribute `hide-indicator`): boolean, reflects. No radio circle: the card's border and background alone show the choice.
|
|
1123
|
+
|
|
1124
|
+
Also the properties of RayRadio (`<ray-radio>`): `value`, `checked`, `label`, `description`, `disabled`, `color`, `size`, `variant`.
|
|
1125
|
+
|
|
1126
|
+
Slots:
|
|
1105
1127
|
|
|
1106
|
-
-
|
|
1128
|
+
- (default): More content under the description.
|
|
1129
|
+
- `icon`: An icon before the title.
|
|
1130
|
+
|
|
1131
|
+
Parts (`::part()`):
|
|
1132
|
+
|
|
1133
|
+
- `root`: The card.
|
|
1134
|
+
- `icon`: Around the icon slot.
|
|
1107
1135
|
|
|
1108
1136
|
### Search
|
|
1109
1137
|
|
|
@@ -1293,7 +1321,7 @@ Same properties and events as ray-checkbox (indeterminate does not apply).
|
|
|
1293
1321
|
|
|
1294
1322
|
Properties:
|
|
1295
1323
|
|
|
1296
|
-
- `checked` (
|
|
1324
|
+
- `checked` (attribute `checked`: the initial value only): boolean. Current state. The checked attribute is the initial state.
|
|
1297
1325
|
- `value`: string, default `on`. Submitted value when on.
|
|
1298
1326
|
- `name`: string. Form field name.
|
|
1299
1327
|
- `label`: string. Label text (or the content).
|
|
@@ -2437,7 +2465,7 @@ setIcons({ name: '<svg…>' }) replaces or adds icons (SVG markup or an SVGEleme
|
|
|
2437
2465
|
|
|
2438
2466
|
Properties:
|
|
2439
2467
|
|
|
2440
|
-
- `name`: string, reflects. Registered icon name (iconNames()).
|
|
2468
|
+
- `name`: string, reflects. Registered icon name (iconNames()); "none" draws nothing, a blank that keeps the alignment (a menu item without its check).
|
|
2441
2469
|
- `size`: string, reflects. xs…xl or any CSS length. Default: 1em.
|
|
2442
2470
|
- `label`: string. Accessible name; without it the icon is decorative (hidden from screen readers).
|
|
2443
2471
|
- `color`: string, reflects. A palette color or any CSS color. Default: the text color.
|
|
@@ -2770,6 +2798,37 @@ Parts (`::part()`):
|
|
|
2770
2798
|
- `bar`: The filled bar.
|
|
2771
2799
|
- `value`: The percentage beside the bar (show-value on xs, sm, md).
|
|
2772
2800
|
|
|
2801
|
+
### Ring progress
|
|
2802
|
+
|
|
2803
|
+
Progress as a ring (Mantine's RingProgress), with content in the middle: a countdown, a goal, an upload. Announced as a progressbar.
|
|
2804
|
+
|
|
2805
|
+
Import: `import "@raylang/elements/ring-progress";` · Category: Feedback
|
|
2806
|
+
|
|
2807
|
+
#### `<ray-ring-progress>` (RayRingProgress, extends RayElement)
|
|
2808
|
+
|
|
2809
|
+
The arc starts at 12 o'clock and runs clockwise; a countdown is a value that goes down. Without value it spins (indeterminate). The middle holds the default slot (a clock), or the percentage with show-value.
|
|
2810
|
+
|
|
2811
|
+
Properties:
|
|
2812
|
+
|
|
2813
|
+
- `value`: number. Progress, from 0 to max. Unset: indeterminate (a spinning arc).
|
|
2814
|
+
- `max`: number, default `100`. The value of a full ring.
|
|
2815
|
+
- `color`: string, reflects. A palette color or any CSS color. Default: the primary color.
|
|
2816
|
+
- `size`: `"xs" | "sm" | "md" | "lg" | "xl" | (string & {})`, default `md`, reflects. Diameter: xs…xl (3, 5, 7.5, 10, 12.5rem) or any CSS length.
|
|
2817
|
+
- `thickness`: string, reflects. Width of the ring: a CSS length (a bare number is px). Default: a tenth of the diameter.
|
|
2818
|
+
- `roundCaps` (attribute `round-caps`): boolean, reflects. Rounded ends of the arc.
|
|
2819
|
+
- `showValue` (attribute `show-value`): boolean, reflects. Shows the percentage in the middle (when the default slot is empty).
|
|
2820
|
+
- `label`: string. Accessible name (default: Progress).
|
|
2821
|
+
|
|
2822
|
+
Slots:
|
|
2823
|
+
|
|
2824
|
+
- (default): The middle of the ring (a clock, a figure, an icon); its font scales with size.
|
|
2825
|
+
|
|
2826
|
+
Parts (`::part()`):
|
|
2827
|
+
|
|
2828
|
+
- `track`: The background circle.
|
|
2829
|
+
- `bar`: The arc.
|
|
2830
|
+
- `center`: The middle, around the default slot.
|
|
2831
|
+
|
|
2773
2832
|
### Skeleton
|
|
2774
2833
|
|
|
2775
2834
|
A placeholder while content loads: a shimmering block, a circle or text lines; with loaded it shows its content.
|
|
@@ -2817,6 +2876,30 @@ Parts (`::part()`):
|
|
|
2817
2876
|
|
|
2818
2877
|
- `spinner`: The ring.
|
|
2819
2878
|
|
|
2879
|
+
### Step dots
|
|
2880
|
+
|
|
2881
|
+
A row of dots, one per step: done, current, to do. A compact progress for rounds, onboarding pages or a quiz; announced as a progressbar ("Round 4 of 12").
|
|
2882
|
+
|
|
2883
|
+
Import: `import "@raylang/elements/step-dots";` · Category: Feedback
|
|
2884
|
+
|
|
2885
|
+
#### `<ray-step-dots>` (RayStepDots, extends RayElement)
|
|
2886
|
+
|
|
2887
|
+
Dots before value are done (filled), the one at value is current (a filled pill), the rest are to do (empty). Not interactive: for steps the user picks, use ray-stepper (or the dots of ray-carousel). Many dots wrap onto more lines.
|
|
2888
|
+
|
|
2889
|
+
Properties:
|
|
2890
|
+
|
|
2891
|
+
- `count`: number, default `0`. Number of steps (dots).
|
|
2892
|
+
- `value`: number, default `0`. The current step, 0-based; count means every step is done.
|
|
2893
|
+
- `color`: string, reflects. A palette color or any CSS color for done and current dots. Default: the primary color.
|
|
2894
|
+
- `size`: `xs` | `sm` | `md` | `lg` | `xl`, default `sm`, reflects. Size of a dot.
|
|
2895
|
+
- `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).
|
|
2897
|
+
|
|
2898
|
+
Parts (`::part()`):
|
|
2899
|
+
|
|
2900
|
+
- `dots`: The row.
|
|
2901
|
+
- `dot`: Each dot ([data-state] done, current or todo).
|
|
2902
|
+
|
|
2820
2903
|
### App bar
|
|
2821
2904
|
|
|
2822
2905
|
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. It elevates once the content scrolls, or hides while scrolling down.
|
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.
|
|
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.
|
|
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>`,
|
|
@@ -238,6 +238,16 @@ system dialog, `<ray-menu native>` opens a native context menu,
|
|
|
238
238
|
components that use it have an "In a raylang app" section. Without the
|
|
239
239
|
bridge every component keeps its web behavior.
|
|
240
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
|
+
|
|
241
251
|
## Your own components
|
|
242
252
|
|
|
243
253
|
Extend `RayElement`, `FormControl`, `FieldControl` or `Floating` (or any
|
|
@@ -258,10 +268,10 @@ Members whose name starts with `_` are internal.
|
|
|
258
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.
|
|
259
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.
|
|
260
270
|
- [Input](https://elements.raylang.dev/components/input.md): `<ray-input>` (Inputs). A text field with label, description and error (Mantine's TextInput).
|
|
261
|
-
- [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.
|
|
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, or a duration (m:ss).
|
|
262
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).
|
|
263
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.
|
|
264
|
-
- [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.
|
|
274
|
+
- [Radio group](https://elements.raylang.dev/components/radio.md): `<ray-radio-group>`, `<ray-radio>`, `<ray-radio-card>` (Inputs). One choice among options: ray-radio (or ray-radio-card) elements inside a ray-radio-group, which is the form control.
|
|
265
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.
|
|
266
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.
|
|
267
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.
|
|
@@ -298,8 +308,10 @@ Members whose name starts with `_` are internal.
|
|
|
298
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.
|
|
299
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).
|
|
300
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
|
+
- [Ring progress](https://elements.raylang.dev/components/ring-progress.md): `<ray-ring-progress>` (Feedback). Progress as a ring (Mantine's RingProgress), with content in the middle: a countdown, a goal, an upload.
|
|
301
312
|
- [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.
|
|
302
313
|
- [Spinner](https://elements.raylang.dev/components/spinner.md): `<ray-spinner>` (Feedback). An indeterminate loading indicator, announced as a status.
|
|
314
|
+
- [Step dots](https://elements.raylang.dev/components/step-dots.md): `<ray-step-dots>` (Feedback). A row of dots, one per step: done, current, to do.
|
|
303
315
|
- [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.
|
|
304
316
|
- [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.
|
|
305
317
|
- [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.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raylang/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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"],
|
|
@@ -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"
|
|
@@ -237,6 +244,10 @@
|
|
|
237
244
|
"types": "./ray-elements.d.ts",
|
|
238
245
|
"default": "./components/progress/progress.js"
|
|
239
246
|
},
|
|
247
|
+
"./ring-progress": {
|
|
248
|
+
"types": "./ray-elements.d.ts",
|
|
249
|
+
"default": "./components/ring-progress/ring-progress.js"
|
|
250
|
+
},
|
|
240
251
|
"./skeleton": {
|
|
241
252
|
"types": "./ray-elements.d.ts",
|
|
242
253
|
"default": "./components/skeleton/skeleton.js"
|
|
@@ -245,6 +256,10 @@
|
|
|
245
256
|
"types": "./ray-elements.d.ts",
|
|
246
257
|
"default": "./components/spinner/spinner.js"
|
|
247
258
|
},
|
|
259
|
+
"./step-dots": {
|
|
260
|
+
"types": "./ray-elements.d.ts",
|
|
261
|
+
"default": "./components/step-dots/step-dots.js"
|
|
262
|
+
},
|
|
248
263
|
"./app-bar": {
|
|
249
264
|
"types": "./ray-elements.d.ts",
|
|
250
265
|
"default": "./components/app-bar/app-bar.js"
|
package/ray-elements.d.ts
CHANGED
|
@@ -361,8 +361,8 @@ export declare class RayButton extends RayElement {
|
|
|
361
361
|
gradient: string | undefined;
|
|
362
362
|
/** A palette color (blue, red…) or any CSS color. Default: the primary color. */
|
|
363
363
|
color: string | undefined;
|
|
364
|
-
/** Height, padding and font size. */
|
|
365
|
-
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
364
|
+
/** Height, padding and font size: xs…xl or any CSS length (the padding and the font follow). */
|
|
365
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | (string & {});
|
|
366
366
|
/** Corner radius. Default: --ray-radius-default. */
|
|
367
367
|
radius: "xs" | "sm" | "md" | "lg" | "xl" | "full" | undefined;
|
|
368
368
|
/** submit/reset act on the enclosing form. */
|
|
@@ -407,8 +407,8 @@ export declare class RayIconButton extends RayButton {
|
|
|
407
407
|
gradient: string | undefined;
|
|
408
408
|
/** A palette color or any CSS color. */
|
|
409
409
|
color: string | undefined;
|
|
410
|
-
/** Width and height. */
|
|
411
|
-
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
410
|
+
/** Width and height: xs…xl or any CSS length ("5.5rem": a big main action, round with radius=full); the icon scales with it. */
|
|
411
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | (string & {});
|
|
412
412
|
/** Not interactive. */
|
|
413
413
|
disabled: boolean | undefined;
|
|
414
414
|
/** Shows a spinner instead of the icon. */
|
|
@@ -865,6 +865,8 @@ export declare class RayNumberInput extends FieldControl {
|
|
|
865
865
|
decimalSeparator: string;
|
|
866
866
|
/** When out-of-range input is clamped: on blur, while typing, or never (then it is invalid). */
|
|
867
867
|
clamp: "blur" | "strict" | "none";
|
|
868
|
+
/** duration: the value is seconds, shown and typed as m:ss (h:mm:ss when min or max reaches an hour; a plain number is seconds); aria-valuetext says "3 minutes, 15 seconds" in the page's language. decimals, prefix, suffix and the separators do not apply. */
|
|
869
|
+
format: "number" | "duration";
|
|
868
870
|
/** No + and − buttons (the keys still step). */
|
|
869
871
|
hideControls: boolean | undefined;
|
|
870
872
|
/** Shown while empty. */
|
|
@@ -950,13 +952,15 @@ export declare class RayRadioGroup extends FormControl {
|
|
|
950
952
|
color: string | undefined;
|
|
951
953
|
/** Checked look of every radio: filled circle, or colored ring and dot. */
|
|
952
954
|
variant: "filled" | "outline";
|
|
953
|
-
/** The radios of the group. */
|
|
955
|
+
/** The radios (and radio cards) of the group. */
|
|
954
956
|
readonly radios: RayRadio[];
|
|
955
957
|
}
|
|
956
|
-
/** <ray-radio> One choice among options: ray-radio elements inside a ray-radio-group, which is the form control. */
|
|
958
|
+
/** <ray-radio> One choice among options: ray-radio (or ray-radio-card) elements inside a ray-radio-group, which is the form control. */
|
|
957
959
|
export declare class RayRadio extends RayElement {
|
|
958
960
|
/** Value given to the group when chosen. */
|
|
959
961
|
value: string | undefined;
|
|
962
|
+
/** 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). */
|
|
963
|
+
checked: boolean | undefined;
|
|
960
964
|
/** Label text (or the content). */
|
|
961
965
|
label: string | undefined;
|
|
962
966
|
/** Help text under the label. */
|
|
@@ -969,8 +973,11 @@ export declare class RayRadio extends RayElement {
|
|
|
969
973
|
size: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
970
974
|
/** Overrides the group variant. */
|
|
971
975
|
variant: "filled" | "outline" | undefined;
|
|
972
|
-
|
|
973
|
-
|
|
976
|
+
}
|
|
977
|
+
/** <ray-radio-card> A radio drawn as a card: a title (label), a detail (description), an icon, more content; checked, it takes the color's border and light background. Inside a ray-radio-group like a ray-radio (arrow keys, the form, required, disabled); put the cards in a ray-grid for columns. */
|
|
978
|
+
export declare class RayRadioCard extends RayRadio {
|
|
979
|
+
/** No radio circle: the card's border and background alone show the choice. */
|
|
980
|
+
hideIndicator: boolean | undefined;
|
|
974
981
|
}
|
|
975
982
|
|
|
976
983
|
// --- Search (search)
|
|
@@ -1923,7 +1930,7 @@ export interface RayCodeEventMap extends HTMLElementEventMap {
|
|
|
1923
1930
|
// --- Icon (icon)
|
|
1924
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. */
|
|
1925
1932
|
export declare class RayIcon extends RayElement {
|
|
1926
|
-
/** Registered icon name (iconNames()). */
|
|
1933
|
+
/** Registered icon name (iconNames()); "none" draws nothing, a blank that keeps the alignment (a menu item without its check). */
|
|
1927
1934
|
name: string | undefined;
|
|
1928
1935
|
/** xs…xl or any CSS length. Default: 1em. */
|
|
1929
1936
|
size: string | undefined;
|
|
@@ -2198,6 +2205,27 @@ export declare class RayProgress extends RayElement {
|
|
|
2198
2205
|
label: string | undefined;
|
|
2199
2206
|
}
|
|
2200
2207
|
|
|
2208
|
+
// --- Ring progress (ring-progress)
|
|
2209
|
+
/** <ray-ring-progress> The arc starts at 12 o'clock and runs clockwise; a countdown is a value that goes down. Without value it spins (indeterminate). The middle holds the default slot (a clock), or the percentage with show-value. */
|
|
2210
|
+
export declare class RayRingProgress extends RayElement {
|
|
2211
|
+
/** Progress, from 0 to max. Unset: indeterminate (a spinning arc). */
|
|
2212
|
+
value: number | undefined;
|
|
2213
|
+
/** The value of a full ring. */
|
|
2214
|
+
max: number;
|
|
2215
|
+
/** A palette color or any CSS color. Default: the primary color. */
|
|
2216
|
+
color: string | undefined;
|
|
2217
|
+
/** Diameter: xs…xl (3, 5, 7.5, 10, 12.5rem) or any CSS length. */
|
|
2218
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | (string & {});
|
|
2219
|
+
/** Width of the ring: a CSS length (a bare number is px). Default: a tenth of the diameter. */
|
|
2220
|
+
thickness: string | undefined;
|
|
2221
|
+
/** Rounded ends of the arc. */
|
|
2222
|
+
roundCaps: boolean | undefined;
|
|
2223
|
+
/** Shows the percentage in the middle (when the default slot is empty). */
|
|
2224
|
+
showValue: boolean | undefined;
|
|
2225
|
+
/** Accessible name (default: Progress). */
|
|
2226
|
+
label: string | undefined;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2201
2229
|
// --- Skeleton (skeleton)
|
|
2202
2230
|
/** <ray-skeleton> aria-busy="true" on the host while loading; the placeholder is aria-hidden. */
|
|
2203
2231
|
export declare class RaySkeleton extends RayElement {
|
|
@@ -2228,6 +2256,23 @@ export declare class RaySpinner extends RayElement {
|
|
|
2228
2256
|
label: string;
|
|
2229
2257
|
}
|
|
2230
2258
|
|
|
2259
|
+
// --- Step dots (step-dots)
|
|
2260
|
+
/** <ray-step-dots> Dots before value are done (filled), the one at value is current (a filled pill), the rest are to do (empty). Not interactive: for steps the user picks, use ray-stepper (or the dots of ray-carousel). Many dots wrap onto more lines. */
|
|
2261
|
+
export declare class RayStepDots extends RayElement {
|
|
2262
|
+
/** Number of steps (dots). */
|
|
2263
|
+
count: number;
|
|
2264
|
+
/** The current step, 0-based; count means every step is done. */
|
|
2265
|
+
value: number;
|
|
2266
|
+
/** A palette color or any CSS color for done and current dots. Default: the primary color. */
|
|
2267
|
+
color: string | undefined;
|
|
2268
|
+
/** Size of a dot. */
|
|
2269
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
2270
|
+
/** Where the row sits in its width. */
|
|
2271
|
+
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). */
|
|
2273
|
+
label: string | undefined;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2231
2276
|
// --- App bar (app-bar)
|
|
2232
2277
|
/** <ray-app-bar> It follows the scroller of its ray-app-shell, else scroll-target, else the window; clear of the notch (safe-area inset). The title is plain text: put a heading in the default slot when the page needs one. */
|
|
2233
2278
|
export declare class RayAppBar extends RayElement {
|
|
@@ -2500,6 +2545,7 @@ declare global {
|
|
|
2500
2545
|
"ray-path-input": RayPathInput;
|
|
2501
2546
|
"ray-radio-group": RayRadioGroup;
|
|
2502
2547
|
"ray-radio": RayRadio;
|
|
2548
|
+
"ray-radio-card": RayRadioCard;
|
|
2503
2549
|
"ray-search": RaySearch;
|
|
2504
2550
|
"ray-segmented-control": RaySegmentedControl;
|
|
2505
2551
|
"ray-select": RaySelect;
|
|
@@ -2549,8 +2595,10 @@ declare global {
|
|
|
2549
2595
|
"ray-notification": RayNotification;
|
|
2550
2596
|
"ray-toaster": RayToaster;
|
|
2551
2597
|
"ray-progress": RayProgress;
|
|
2598
|
+
"ray-ring-progress": RayRingProgress;
|
|
2552
2599
|
"ray-skeleton": RaySkeleton;
|
|
2553
2600
|
"ray-spinner": RaySpinner;
|
|
2601
|
+
"ray-step-dots": RayStepDots;
|
|
2554
2602
|
"ray-app-bar": RayAppBar;
|
|
2555
2603
|
"ray-app-shell": RayAppShell;
|
|
2556
2604
|
"ray-aspect-ratio": RayAspectRatio;
|