@raylang/react 0.7.0 → 0.9.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.
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayCode = /*#__PURE__*/ createComponent("ray-code", {
7
7
  displayName: "RayCode",
8
- properties: ["code", "language", "filename", "lineNumbers", "highlight", "wrap", "maxHeight", "expanded", "hideCopy", "hideHeader", "size", "radius", "copyLabel", "copiedLabel"],
8
+ properties: ["code", "language", "filename", "lineNumbers", "highlight", "wrap", "verbatim", "maxHeight", "expanded", "hideCopy", "hideHeader", "size", "radius", "copyLabel", "copiedLabel"],
9
9
  events: { onRayCopy: "ray-copy" },
10
10
  });
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayCommandPalette = /*#__PURE__*/ createComponent("ray-command-palette", {
7
7
  displayName: "RayCommandPalette",
8
- properties: ["open", "actions", "query", "placeholder", "hotkey", "limit", "emptyLabel", "label", "hideHint", "nativeMenus", "overlayBlur"],
8
+ properties: ["open", "actions", "query", "placeholder", "hotkey", "limit", "emptyLabel", "label", "hideHint", "navigateLabel", "runLabel", "closeLabel", "nativeMenus", "overlayBlur"],
9
9
  events: { onRaySelect: "ray-select", onRayOpen: "ray-open", onRayClose: "ray-close" },
10
10
  });
@@ -0,0 +1,15 @@
1
+ // Generated by ray-elements tools from component.toml files. Do not edit.
2
+
3
+ import "@raylang/elements/doc-tabs";
4
+ import { createComponent } from "../create.js";
5
+
6
+ export const RayDocTabs = /*#__PURE__*/ createComponent("ray-doc-tabs", {
7
+ displayName: "RayDocTabs",
8
+ properties: ["value", "panel", "label", "closeLabel", "dirtyLabel"],
9
+ events: { onChange: "change", onRayRequestClose: "ray-request-close" },
10
+ });
11
+ export const RayDocTab = /*#__PURE__*/ createComponent("ray-doc-tab", {
12
+ displayName: "RayDocTab",
13
+ properties: ["value", "dirty", "hideClose"],
14
+ events: { },
15
+ });
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayIcon = /*#__PURE__*/ createComponent("ray-icon", {
7
7
  displayName: "RayIcon",
8
- properties: ["name", "filled", "size", "label", "color", "stroke"],
8
+ properties: ["name", "filled", "mirror", "size", "label", "color", "stroke"],
9
9
  events: { },
10
10
  });
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayInput = /*#__PURE__*/ createComponent("ray-input", {
7
7
  displayName: "RayInput",
8
- properties: ["value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant"],
9
- events: { onInput: "input", onChange: "change" },
8
+ properties: ["value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
+ events: { onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
10
10
  });
@@ -6,11 +6,11 @@ import { createComponent } from "../create.js";
6
6
  export const RayMenu = /*#__PURE__*/ createComponent("ray-menu", {
7
7
  displayName: "RayMenu",
8
8
  properties: ["open", "placement", "context", "keepOpen", "native", "offset"],
9
- events: { onRaySelect: "ray-select", onRayOpen: "ray-open", onRayClose: "ray-close" },
9
+ events: { onRaySelect: "ray-select", onRayRequestOpen: "ray-request-open", onRayOpen: "ray-open", onRayClose: "ray-close" },
10
10
  });
11
11
  export const RayMenuItem = /*#__PURE__*/ createComponent("ray-menu-item", {
12
12
  displayName: "RayMenuItem",
13
- properties: ["value", "disabled", "color"],
13
+ properties: ["value", "disabled", "color", "type", "checked", "name"],
14
14
  events: { },
15
15
  });
16
16
  export const RayMenuLabel = /*#__PURE__*/ createComponent("ray-menu-label", {
@@ -0,0 +1,10 @@
1
+ // Generated by ray-elements tools from component.toml files. Do not edit.
2
+
3
+ import "@raylang/elements/mode-input";
4
+ import { createComponent } from "../create.js";
5
+
6
+ export const RayModeInput = /*#__PURE__*/ createComponent("ray-mode-input", {
7
+ displayName: "RayModeInput",
8
+ properties: ["mode", "options", "display", "position", "menuLabel", "nativeMenu", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
+ events: { onRayModeChange: "ray-mode-change", onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
10
+ });
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayPasswordInput = /*#__PURE__*/ createComponent("ray-password-input", {
7
7
  displayName: "RayPasswordInput",
8
- properties: ["visible", "showLabel", "hideLabel", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant"],
9
- events: { onRayVisibilityChange: "ray-visibility-change", onInput: "input", onChange: "change" },
8
+ properties: ["visible", "showLabel", "hideLabel", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
+ events: { onRayVisibilityChange: "ray-visibility-change", onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
10
10
  });
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayPathInput = /*#__PURE__*/ createComponent("ray-path-input", {
7
7
  displayName: "RayPathInput",
8
- properties: ["mode", "accept", "browseLabel", "dialogTitle", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant"],
9
- events: { onChange: "change", onRayError: "ray-error", onInput: "input" },
8
+ properties: ["mode", "accept", "browseLabel", "dialogTitle", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
+ events: { onChange: "change", onRayError: "ray-error", onRayComplete: "ray-complete", onInput: "input" },
10
10
  });
@@ -5,8 +5,8 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RaySidebar = /*#__PURE__*/ createComponent("ray-sidebar", {
7
7
  displayName: "RaySidebar",
8
- properties: ["collapsed", "open", "side", "variant", "width", "collapsedWidth", "breakpoint", "label"],
9
- events: { onRayToggle: "ray-toggle", onRayOpen: "ray-open", onRayClose: "ray-close" },
8
+ properties: ["collapsed", "collapse", "open", "side", "variant", "width", "collapsedWidth", "breakpoint", "label", "resizable", "minWidth", "maxWidth", "autosave", "resizeLabel"],
9
+ events: { onRayResize: "ray-resize", onRayToggle: "ray-toggle", onRayOpen: "ray-open", onRayClose: "ray-close" },
10
10
  });
11
11
  export const RaySidebarGroup = /*#__PURE__*/ createComponent("ray-sidebar-group", {
12
12
  displayName: "RaySidebarGroup",
@@ -5,12 +5,12 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayTabs = /*#__PURE__*/ createComponent("ray-tabs", {
7
7
  displayName: "RayTabs",
8
- properties: ["value", "variant", "orientation", "color", "activation", "grow"],
8
+ properties: ["value", "variant", "orientation", "color", "size", "activation", "grow"],
9
9
  events: { onChange: "change" },
10
10
  });
11
11
  export const RayTab = /*#__PURE__*/ createComponent("ray-tab", {
12
12
  displayName: "RayTab",
13
- properties: ["value", "disabled"],
13
+ properties: ["value", "disabled", "count"],
14
14
  events: { },
15
15
  });
16
16
  export const RayTabPanel = /*#__PURE__*/ createComponent("ray-tab-panel", {
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayTextarea = /*#__PURE__*/ createComponent("ray-textarea", {
7
7
  displayName: "RayTextarea",
8
- properties: ["value", "rows", "autosize", "maxRows", "name", "label", "description", "descriptionPosition", "error", "required", "disabled", "readonly", "size", "variant", "radius"],
9
- events: { onInput: "input", onChange: "change" },
8
+ properties: ["value", "rows", "autosize", "maxRows", "name", "label", "description", "descriptionPosition", "error", "required", "disabled", "readonly", "size", "variant", "highlight", "complete", "suggestionsLabel", "radius"],
9
+ events: { onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
10
10
  });
package/index.d.ts CHANGED
@@ -188,8 +188,8 @@ export interface RayCheckboxOwnProps {
188
188
  color?: string;
189
189
  /** Box and font size. */
190
190
  size?: "xs" | "sm" | "md" | "lg" | "xl";
191
- /** Side of the label. */
192
- labelPosition?: "right" | "left";
191
+ /** Side of the label: start/end follow the writing direction; left/right are sides of the screen. */
192
+ labelPosition?: "end" | "start" | "right" | "left";
193
193
  /** Corner radius. */
194
194
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
195
195
  /** Description before or after the control. */
@@ -520,6 +520,12 @@ export interface RayInputOwnProps {
520
520
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
521
521
  /** Box style. */
522
522
  variant?: "default" | "filled" | "unstyled";
523
+ /** Marks ranges of the text, painted behind it: called with the text on every change (typed or set), it returns { start, end, kind?, title? } offsets. kind "error" is red with a wavy underline; any other kind is styled with ::part(highlight-<kind>); title is the tooltip over the range. Ranges must not overlap. */
524
+ highlight?: ((text: string) => Ray.HighlightRange[]) | null;
525
+ /** Inline suggestions: called as the user types (and on Ctrl+Space) with the text and the caret, it returns the part of the text a suggestion would replace and the suggestions ({ from, to, items }), or null for none. A list opens under that part (ArrowUp/Down, Enter or Tab to accept, Escape to close); the chosen item's value replaces from–to as an undoable edit, then ray-complete fires. The field becomes a combobox (aria-autocomplete, aria-expanded, aria-activedescendant). */
526
+ complete?: ((text: string, caret: number) => Ray.CompletionResult | null | Promise<Ray.CompletionResult | null>) | null;
527
+ /** Accessible name of the suggestion list. */
528
+ suggestionsLabel?: string;
523
529
  /** Forwarded to the inner input. */
524
530
  autocomplete?: string;
525
531
  /** Virtual keyboard hint. */
@@ -542,6 +548,8 @@ export interface RayInputOwnProps {
542
548
  enterkeyhint?: string;
543
549
  /** Id of a <datalist> with suggestions. */
544
550
  list?: string;
551
+ /** A suggestion was accepted (the text already has it). */
552
+ onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
545
553
  /** On every edit (value already updated). */
546
554
  onInput?: (event: Event) => void;
547
555
  /** When an edit is committed (blur, Enter). */
@@ -551,6 +559,88 @@ export type RayInputProps = RayInputOwnProps & Omit<React.HTMLAttributes<Ray.Ray
551
559
  /** <ray-input> as a React component. */
552
560
  export declare const RayInput: React.ForwardRefExoticComponent<RayInputProps & React.RefAttributes<Ray.RayInput>>;
553
561
 
562
+ export interface RayModeInputOwnProps {
563
+ /** The chosen mode's value (default: the first). Setting it applies that mode without ray-mode-change. */
564
+ mode?: string;
565
+ /** The modes; when not set, the <option> children. */
566
+ options?: Ray.ModeOption[];
567
+ /** What the trigger shows: the mode's hint or label, its icon, or both. Default: the icon when the mode has one, else the label. */
568
+ display?: "label" | "icon" | "both";
569
+ /** The side of the field the trigger sits on. */
570
+ position?: "start" | "end";
571
+ /** The trigger's accessible name, read with the current mode ("Mode: File"). */
572
+ menuLabel?: string;
573
+ /** With a native host (a std/ui window with the bridge), the system's menu (no descriptions there). */
574
+ nativeMenu?: boolean;
575
+ /** Current value. The value attribute is the initial value (restored on form reset). */
576
+ value?: string;
577
+ /** Input type. */
578
+ type?: "text" | "email" | "password" | "search" | "number" | "url" | "tel";
579
+ /** Form field name. */
580
+ name?: string;
581
+ /** Visible label (also the accessible name). */
582
+ label?: string;
583
+ /** Help text under the label. */
584
+ description?: string;
585
+ /** The description before the control (help first) or after it, with the error (fields in a row stay aligned). */
586
+ descriptionPosition?: "above" | "below";
587
+ /** Error text; marks the field invalid (display only — does not block submit). */
588
+ error?: string;
589
+ /** Placeholder text. */
590
+ placeholder?: string;
591
+ /** Required for form submission; shows an asterisk. */
592
+ required?: boolean;
593
+ /** Not editable nor submitted. */
594
+ disabled?: boolean;
595
+ /** Not editable, still submitted. */
596
+ readonly?: boolean;
597
+ /** Height and font size. */
598
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
599
+ /** Corner radius. */
600
+ radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
601
+ /** Box style. */
602
+ variant?: "default" | "filled" | "unstyled";
603
+ /** Marks ranges of the text, painted behind it: called with the text on every change (typed or set), it returns { start, end, kind?, title? } offsets. kind "error" is red with a wavy underline; any other kind is styled with ::part(highlight-<kind>); title is the tooltip over the range. Ranges must not overlap. */
604
+ highlight?: ((text: string) => Ray.HighlightRange[]) | null;
605
+ /** Inline suggestions: called as the user types (and on Ctrl+Space) with the text and the caret, it returns the part of the text a suggestion would replace and the suggestions ({ from, to, items }), or null for none. A list opens under that part (ArrowUp/Down, Enter or Tab to accept, Escape to close); the chosen item's value replaces from–to as an undoable edit, then ray-complete fires. The field becomes a combobox (aria-autocomplete, aria-expanded, aria-activedescendant). */
606
+ complete?: ((text: string, caret: number) => Ray.CompletionResult | null | Promise<Ray.CompletionResult | null>) | null;
607
+ /** Accessible name of the suggestion list. */
608
+ suggestionsLabel?: string;
609
+ /** Forwarded to the inner input. */
610
+ autocomplete?: string;
611
+ /** Virtual keyboard hint. */
612
+ inputmode?: string;
613
+ /** Validation pattern (regular expression). */
614
+ pattern?: string;
615
+ /** Minimum (number/date types). */
616
+ min?: string;
617
+ /** Maximum (number/date types). */
618
+ max?: string;
619
+ /** Step (number types). */
620
+ step?: string;
621
+ /** Minimum length. */
622
+ minlength?: string;
623
+ /** Maximum length. */
624
+ maxlength?: string;
625
+ /** Mobile auto-capitalization. */
626
+ autocapitalize?: string;
627
+ /** Label of the Enter key on virtual keyboards. */
628
+ enterkeyhint?: string;
629
+ /** Id of a <datalist> with suggestions. */
630
+ list?: string;
631
+ /** The user chose a mode (mode is already the new one); cancelable: preventDefault keeps the previous mode. */
632
+ onRayModeChange?: (event: CustomEvent<{ mode: string; previous: string | null; option: Ray.ModeOption }>) => void;
633
+ /** A suggestion was accepted (the text already has it). */
634
+ onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
635
+ /** On every edit (value already updated). */
636
+ onInput?: (event: Event) => void;
637
+ /** When an edit is committed (blur, Enter). */
638
+ onChange?: (event: Event) => void;
639
+ }
640
+ export type RayModeInputProps = RayModeInputOwnProps & Omit<React.HTMLAttributes<Ray.RayModeInput>, keyof RayModeInputOwnProps> & { children?: React.ReactNode };
641
+ /** <ray-mode-input> as a React component. */
642
+ export declare const RayModeInput: React.ForwardRefExoticComponent<RayModeInputProps & React.RefAttributes<Ray.RayModeInput>>;
643
+
554
644
  export interface RayNumberInputOwnProps {
555
645
  /** The number (undefined when empty). */
556
646
  value?: number;
@@ -644,6 +734,12 @@ export interface RayPasswordInputOwnProps {
644
734
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
645
735
  /** Box style. */
646
736
  variant?: "default" | "filled" | "unstyled";
737
+ /** Marks ranges of the text, painted behind it: called with the text on every change (typed or set), it returns { start, end, kind?, title? } offsets. kind "error" is red with a wavy underline; any other kind is styled with ::part(highlight-<kind>); title is the tooltip over the range. Ranges must not overlap. */
738
+ highlight?: ((text: string) => Ray.HighlightRange[]) | null;
739
+ /** Inline suggestions: called as the user types (and on Ctrl+Space) with the text and the caret, it returns the part of the text a suggestion would replace and the suggestions ({ from, to, items }), or null for none. A list opens under that part (ArrowUp/Down, Enter or Tab to accept, Escape to close); the chosen item's value replaces from–to as an undoable edit, then ray-complete fires. The field becomes a combobox (aria-autocomplete, aria-expanded, aria-activedescendant). */
740
+ complete?: ((text: string, caret: number) => Ray.CompletionResult | null | Promise<Ray.CompletionResult | null>) | null;
741
+ /** Accessible name of the suggestion list. */
742
+ suggestionsLabel?: string;
647
743
  /** Forwarded to the inner input. */
648
744
  autocomplete?: string;
649
745
  /** Virtual keyboard hint. */
@@ -668,6 +764,8 @@ export interface RayPasswordInputOwnProps {
668
764
  list?: string;
669
765
  /** The user showed or hid the password. */
670
766
  onRayVisibilityChange?: (event: CustomEvent<{ visible: boolean }>) => void;
767
+ /** A suggestion was accepted (the text already has it). */
768
+ onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
671
769
  /** On every edit (value already updated). */
672
770
  onInput?: (event: Event) => void;
673
771
  /** When an edit is committed (blur, Enter). */
@@ -714,6 +812,12 @@ export interface RayPathInputOwnProps {
714
812
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
715
813
  /** Box style. */
716
814
  variant?: "default" | "filled" | "unstyled";
815
+ /** Marks ranges of the text, painted behind it: called with the text on every change (typed or set), it returns { start, end, kind?, title? } offsets. kind "error" is red with a wavy underline; any other kind is styled with ::part(highlight-<kind>); title is the tooltip over the range. Ranges must not overlap. */
816
+ highlight?: ((text: string) => Ray.HighlightRange[]) | null;
817
+ /** Inline suggestions: called as the user types (and on Ctrl+Space) with the text and the caret, it returns the part of the text a suggestion would replace and the suggestions ({ from, to, items }), or null for none. A list opens under that part (ArrowUp/Down, Enter or Tab to accept, Escape to close); the chosen item's value replaces from–to as an undoable edit, then ray-complete fires. The field becomes a combobox (aria-autocomplete, aria-expanded, aria-activedescendant). */
818
+ complete?: ((text: string, caret: number) => Ray.CompletionResult | null | Promise<Ray.CompletionResult | null>) | null;
819
+ /** Accessible name of the suggestion list. */
820
+ suggestionsLabel?: string;
717
821
  /** Forwarded to the inner input. */
718
822
  autocomplete?: string;
719
823
  /** Virtual keyboard hint. */
@@ -740,6 +844,8 @@ export interface RayPathInputOwnProps {
740
844
  onChange?: (event: Event) => void;
741
845
  /** The system dialog failed. */
742
846
  onRayError?: (event: CustomEvent<{ error: Error }>) => void;
847
+ /** A suggestion was accepted (the text already has it). */
848
+ onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
743
849
  /** On every edit (value already updated). */
744
850
  onInput?: (event: Event) => void;
745
851
  }
@@ -994,8 +1100,8 @@ export interface RaySwitchOwnProps {
994
1100
  description?: string;
995
1101
  /** Error text. */
996
1102
  error?: string;
997
- /** Side of the label. */
998
- labelPosition?: "right" | "left";
1103
+ /** Side of the label: start/end follow the writing direction; left/right are sides of the screen. */
1104
+ labelPosition?: "end" | "start" | "right" | "left";
999
1105
  /** Track color when on. */
1000
1106
  color?: string;
1001
1107
  /** Track size. */
@@ -1048,6 +1154,12 @@ export interface RayTextareaOwnProps {
1048
1154
  size?: "xs" | "sm" | "md" | "lg" | "xl";
1049
1155
  /** Box style. */
1050
1156
  variant?: "default" | "filled" | "unstyled";
1157
+ /** Marks ranges of the text, painted behind it: called with the text on every change (typed or set), it returns { start, end, kind?, title? } offsets. kind "error" is red with a wavy underline; any other kind is styled with ::part(highlight-<kind>); title is the tooltip over the range. Ranges must not overlap. */
1158
+ highlight?: ((text: string) => Ray.HighlightRange[]) | null;
1159
+ /** Inline suggestions: called as the user types (and on Ctrl+Space) with the text and the caret, it returns the part of the text a suggestion would replace and the suggestions ({ from, to, items }), or null for none. A list opens under that part (ArrowUp/Down, Enter or Tab to accept, Escape to close); the chosen item's value replaces from–to as an undoable edit, then ray-complete fires. The field becomes a combobox (aria-autocomplete, aria-expanded, aria-activedescendant). */
1160
+ complete?: ((text: string, caret: number) => Ray.CompletionResult | null | Promise<Ray.CompletionResult | null>) | null;
1161
+ /** Accessible name of the suggestion list. */
1162
+ suggestionsLabel?: string;
1051
1163
  /** Corner radius. */
1052
1164
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full";
1053
1165
  /** Placeholder text. */
@@ -1060,6 +1172,8 @@ export interface RayTextareaOwnProps {
1060
1172
  maxlength?: string;
1061
1173
  /** soft or hard. */
1062
1174
  wrap?: string;
1175
+ /** A suggestion was accepted (the text already has it). */
1176
+ onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
1063
1177
  /** On every edit. */
1064
1178
  onInput?: (event: Event) => void;
1065
1179
  /** When an edit is committed. */
@@ -1145,6 +1259,38 @@ export type RayBreadcrumbProps = RayBreadcrumbOwnProps & Omit<React.HTMLAttribut
1145
1259
  /** <ray-breadcrumb> as a React component. */
1146
1260
  export declare const RayBreadcrumb: React.ForwardRefExoticComponent<RayBreadcrumbProps & React.RefAttributes<Ray.RayBreadcrumb>>;
1147
1261
 
1262
+ export interface RayDocTabsOwnProps {
1263
+ /** Value of the selected tab (default: the first). */
1264
+ value?: string;
1265
+ /** The id of the shared panel: it gets role=tabpanel and aria-labelledby the selected tab; the tabs get aria-controls. */
1266
+ panel?: string;
1267
+ /** Accessible name of the tab list ("Open requests"). */
1268
+ label?: string;
1269
+ /** Tooltip of the ×. */
1270
+ closeLabel?: string;
1271
+ /** What assistive technology hears after the name of a dirty tab. */
1272
+ dirtyLabel?: string;
1273
+ /** The selected tab changed: a click, the arrow keys, or the selected tab removed. */
1274
+ onChange?: (event: Event) => void;
1275
+ /** The × was clicked, the tab middle-clicked, or Delete/Backspace pressed on it: remove the tab to close it (not fired for hide-close tabs). */
1276
+ onRayRequestClose?: (event: CustomEvent<{ value: string; tab: Ray.RayDocTab; source: "button" | "middle" | "key" }>) => void;
1277
+ }
1278
+ export type RayDocTabsProps = RayDocTabsOwnProps & Omit<React.HTMLAttributes<Ray.RayDocTabs>, keyof RayDocTabsOwnProps> & { children?: React.ReactNode };
1279
+ /** <ray-doc-tabs> as a React component. */
1280
+ export declare const RayDocTabs: React.ForwardRefExoticComponent<RayDocTabsProps & React.RefAttributes<Ray.RayDocTabs>>;
1281
+
1282
+ export interface RayDocTabOwnProps {
1283
+ /** Identifies the document (ray-doc-tabs value). */
1284
+ value?: string;
1285
+ /** Unsaved changes: a dot in place of the ×, which comes back under the pointer. */
1286
+ dirty?: boolean;
1287
+ /** Cannot be closed: no ×, no middle click, no Delete. */
1288
+ hideClose?: boolean;
1289
+ }
1290
+ export type RayDocTabProps = RayDocTabOwnProps & Omit<React.HTMLAttributes<Ray.RayDocTab>, keyof RayDocTabOwnProps> & { children?: React.ReactNode };
1291
+ /** <ray-doc-tab> as a React component. */
1292
+ export declare const RayDocTab: React.ForwardRefExoticComponent<RayDocTabProps & React.RefAttributes<Ray.RayDocTab>>;
1293
+
1148
1294
  export interface RayNavLinkOwnProps {
1149
1295
  /** Text. */
1150
1296
  label?: string;
@@ -1202,12 +1348,14 @@ export type RayPaginationProps = RayPaginationOwnProps & Omit<React.HTMLAttribut
1202
1348
  export declare const RayPagination: React.ForwardRefExoticComponent<RayPaginationProps & React.RefAttributes<Ray.RayPagination>>;
1203
1349
 
1204
1350
  export interface RaySidebarOwnProps {
1205
- /** Wide screens: an icon rail instead of the full panel. */
1351
+ /** Wide screens: collapsed as collapse says (an icon rail, or out of view). */
1206
1352
  collapsed?: boolean;
1353
+ /** What collapsed does on wide screens: icon, a rail of the nav links' icons; offcanvas, hidden entirely (no width, out of the tab order). */
1354
+ collapse?: "icon" | "offcanvas";
1207
1355
  /** Narrow screens: the drawer is shown (modal, focus trapped; Escape, backdrop click or a followed link close it). */
1208
1356
  open?: boolean;
1209
- /** The edge it sits on. */
1210
- side?: "left" | "right";
1357
+ /** The edge it sits on (its border faces the content, its narrow-screen drawer slides from there): start/end follow the writing direction; left/right are sides of the screen. */
1358
+ side?: "start" | "end" | "left" | "right";
1211
1359
  /** A panel against the edge, or a floating card with a margin. */
1212
1360
  variant?: "sidebar" | "floating";
1213
1361
  /** Width when expanded (CSS length). Default 16rem. */
@@ -1218,6 +1366,18 @@ export interface RaySidebarOwnProps {
1218
1366
  breakpoint?: string;
1219
1367
  /** Accessible name of its navigation. */
1220
1368
  label?: string;
1369
+ /** Wide screens, expanded: its inner edge drags (or, focused, arrow-keys; Shift is faster, Home/End go to the limits) the width between min-width and max-width. */
1370
+ resizable?: boolean;
1371
+ /** Narrowest width when resizing, in px. */
1372
+ minWidth?: number;
1373
+ /** Widest width when resizing, in px. */
1374
+ maxWidth?: number;
1375
+ /** A key: the resized width is saved in localStorage and restored. A later change of width wins. */
1376
+ autosave?: string;
1377
+ /** Accessible name of the resize edge. */
1378
+ resizeLabel?: string;
1379
+ /** After a drag or a key resized it (resizable). */
1380
+ onRayResize?: (event: CustomEvent<{ width: number }>) => void;
1221
1381
  /** After toggle(). */
1222
1382
  onRayToggle?: (event: CustomEvent<{ collapsed: boolean; open: boolean; mobile: boolean }>) => void;
1223
1383
  /** The drawer opened (narrow screens). */
@@ -1242,8 +1402,8 @@ export interface RayStepperOwnProps {
1242
1402
  active?: number;
1243
1403
  /** Steps in a row above the content, or in a column beside it. */
1244
1404
  orientation?: "horizontal" | "vertical";
1245
- /** Label beside the number, or under it (narrow screens, many steps). */
1246
- iconPosition?: "left" | "top";
1405
+ /** Label beside the number (after it in the reading direction), or under it (narrow screens, many steps). "left", its former name, still works. */
1406
+ iconPosition?: "start" | "top" | "left";
1247
1407
  /** Completed steps are buttons that go back to them. */
1248
1408
  allowStepSelect?: boolean;
1249
1409
  /** With allow-step-select off, false lets the user jump to any step. */
@@ -1290,6 +1450,8 @@ export interface RayTabsOwnProps {
1290
1450
  orientation?: "horizontal" | "vertical";
1291
1451
  /** Active indicator color. */
1292
1452
  color?: string;
1453
+ /** Height, font size and padding of the tabs (xs for a compact bar). */
1454
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
1293
1455
  /** manual: arrows move focus, Enter/Space activates. */
1294
1456
  activation?: "auto" | "manual";
1295
1457
  /** Tabs share the full width. */
@@ -1306,6 +1468,8 @@ export interface RayTabOwnProps {
1306
1468
  value?: string;
1307
1469
  /** Cannot be activated. */
1308
1470
  disabled?: boolean;
1471
+ /** A small number after the label ("3", "99+"), lighter than a badge; part of the tab's accessible name. Empty: none. */
1472
+ count?: string;
1309
1473
  }
1310
1474
  export type RayTabProps = RayTabOwnProps & Omit<React.HTMLAttributes<Ray.RayTab>, keyof RayTabOwnProps> & { children?: React.ReactNode };
1311
1475
  /** <ray-tab> as a React component. */
@@ -1338,6 +1502,12 @@ export interface RayCommandPaletteOwnProps {
1338
1502
  label?: string;
1339
1503
  /** No keyboard hint at the bottom. */
1340
1504
  hideHint?: boolean;
1505
+ /** The keyboard hint's word for ↑↓. */
1506
+ navigateLabel?: string;
1507
+ /** The keyboard hint's word for ↵. */
1508
+ runLabel?: string;
1509
+ /** The keyboard hint's word for esc. */
1510
+ closeLabel?: string;
1341
1511
  /** With a native host (ray-elements/core/raylang.js in a std/ui window, menus declared with elements/bridge), also lists the app's menu bar, grouped by menu with its shortcuts; running one gives the program the menu's own event. */
1342
1512
  nativeMenus?: boolean;
1343
1513
  /** Blur of the page behind: px ("8"), a CSS length or "none". Default: --ray-overlay-blur ([overlay] blur in tokens.toml). */
@@ -1392,8 +1562,8 @@ export interface RayDrawerOwnProps {
1392
1562
  label?: string;
1393
1563
  /** A line under the title (the drawer's accessible description). */
1394
1564
  description?: string;
1395
- /** The edge it slides from. */
1396
- position?: "right" | "left" | "top" | "bottom";
1565
+ /** The edge it slides from: start/end follow the writing direction; left/right are sides of the screen. */
1566
+ position?: "end" | "start" | "right" | "left" | "top" | "bottom";
1397
1567
  /** Width (left/right) or height (top/bottom): xs…xl, full, or any CSS length. */
1398
1568
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | (string & {});
1399
1569
  /** No backdrop nor scroll lock: the page stays interactive (a side panel). */
@@ -1420,7 +1590,7 @@ export declare const RayDrawer: React.ForwardRefExoticComponent<RayDrawerProps &
1420
1590
  export interface RayMenuOwnProps {
1421
1591
  /** Shown. */
1422
1592
  open?: boolean;
1423
- /** Preferred side and alignment. */
1593
+ /** Preferred side and alignment: top/bottom/left/right are sides of the screen; on top and bottom, -start/-end follow the writing direction (right to left, "bottom-start" lines up the right edges). */
1424
1594
  placement?: "bottom-start" | "bottom" | "bottom-end" | "top-start" | "top" | "top-end" | "right-start" | "left-start";
1425
1595
  /** Opens on right click (contextmenu) over the trigger area, at the pointer. */
1426
1596
  context?: boolean;
@@ -1432,6 +1602,8 @@ export interface RayMenuOwnProps {
1432
1602
  offset?: number;
1433
1603
  /** An item was chosen; detail: { value, item }. */
1434
1604
  onRaySelect?: (event: CustomEvent<{ value: string; item: Ray.RayMenuItem }>) => void;
1605
+ /** Its trigger is about to open it (click, Arrow keys, right click), before the items are read, native menu included: fill items that depend on what was clicked here. Cancelable (preventDefault keeps it closed). Not fired by show() or open = true. detail: { event }. */
1606
+ onRayRequestOpen?: (event: CustomEvent<{ event: Event }>) => void;
1435
1607
  /** After it opened. */
1436
1608
  onRayOpen?: (event: CustomEvent<unknown>) => void;
1437
1609
  /** After it closed. */
@@ -1448,6 +1620,12 @@ export interface RayMenuItemOwnProps {
1448
1620
  disabled?: boolean;
1449
1621
  /** Text and hover color (e.g. red for destructive actions). */
1450
1622
  color?: string;
1623
+ /** checkbox: choosing it toggles checked (menuitemcheckbox); radio: choosing it checks it and unchecks the radio items of the menu with the same name (menuitemradio). Both show a check mark when checked, in the native menu too. */
1624
+ type?: "item" | "checkbox" | "radio";
1625
+ /** Checked (checkbox and radio items). Already updated when ray-select fires. */
1626
+ checked?: boolean;
1627
+ /** The group of a radio item: one checked per name in the menu. */
1628
+ name?: string;
1451
1629
  }
1452
1630
  export type RayMenuItemProps = RayMenuItemOwnProps & Omit<React.HTMLAttributes<Ray.RayMenuItem>, keyof RayMenuItemOwnProps> & { children?: React.ReactNode };
1453
1631
  /** <ray-menu-item> as a React component. */
@@ -1468,7 +1646,7 @@ export declare const RayMenuDivider: React.ForwardRefExoticComponent<RayMenuDivi
1468
1646
  export interface RayPopoverOwnProps {
1469
1647
  /** Shown. */
1470
1648
  open?: boolean;
1471
- /** Preferred side and alignment. */
1649
+ /** Preferred side and alignment: top/bottom/left/right are sides of the screen; on top and bottom, -start/-end follow the writing direction (right to left, "bottom-start" lines up the right edges). */
1472
1650
  placement?: "bottom" | "bottom-start" | "bottom-end" | "top" | "top-start" | "top-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
1473
1651
  /** Gap to the trigger in px. */
1474
1652
  offset?: number;
@@ -1492,7 +1670,7 @@ export declare const RayPopover: React.ForwardRefExoticComponent<RayPopoverProps
1492
1670
  export interface RayTooltipOwnProps {
1493
1671
  /** Tooltip text. */
1494
1672
  label?: string;
1495
- /** Preferred side. */
1673
+ /** Preferred side; -start/-end follow the writing direction. */
1496
1674
  placement?: "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
1497
1675
  /** ms before showing. */
1498
1676
  openDelay?: number;
@@ -1518,8 +1696,8 @@ export interface RayAccordionOwnProps {
1518
1696
  multiple?: boolean;
1519
1697
  /** Visual style. */
1520
1698
  variant?: "default" | "contained" | "separated" | "filled";
1521
- /** Side of the chevron. */
1522
- chevronPosition?: "right" | "left";
1699
+ /** Side of the chevron: start/end follow the writing direction; left/right are sides of the screen. */
1700
+ chevronPosition?: "end" | "start" | "right" | "left";
1523
1701
  /** The user opened or closed an item. */
1524
1702
  onChange?: (event: Event) => void;
1525
1703
  }
@@ -1684,6 +1862,8 @@ export interface RayCodeOwnProps {
1684
1862
  highlight?: string;
1685
1863
  /** Wraps long lines instead of scrolling sideways. */
1686
1864
  wrap?: boolean;
1865
+ /** Shows and copies the text exactly as given: no common indentation or blank first and last lines removed. For data (a response body, a log) rather than code written in the page. */
1866
+ verbatim?: boolean;
1687
1867
  /** Height before it scrolls: px as a number, or a CSS length. A taller block gets a "Show all N lines" button. */
1688
1868
  maxHeight?: string;
1689
1869
  /** Shown whole, past max-height. */
@@ -1712,6 +1892,8 @@ export interface RayIconOwnProps {
1712
1892
  name?: Ray.IconName;
1713
1893
  /** 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. */
1714
1894
  filled?: boolean;
1895
+ /** Mirrored in a right-to-left context (dir="rtl"), for an icon that points along the text: back, forward, send, undo. The roles that do (ui.next, ui.previous, ui.first, ui.last, ui.disclosure, ui.separator) mirror by themselves. */
1896
+ mirror?: boolean;
1715
1897
  /** xs…xl or any CSS length. Default: 1em. */
1716
1898
  size?: string;
1717
1899
  /** Accessible name; without it the icon is decorative (hidden from screen readers). */
@@ -1830,8 +2012,8 @@ export declare const RayTable: React.ForwardRefExoticComponent<RayTableProps & R
1830
2012
  export interface RayTimelineOwnProps {
1831
2013
  /** Index of the last reached item (-1: none). */
1832
2014
  active?: number;
1833
- /** Side of the line. */
1834
- align?: "left" | "right";
2015
+ /** Side of the line: start/end follow the writing direction; left/right are sides of the screen. */
2016
+ align?: "start" | "end" | "left" | "right";
1835
2017
  /** Bullet size: px as a number or a CSS length (default 20px). */
1836
2018
  bulletSize?: string;
1837
2019
  /** Line width in px (default 2). */
@@ -1920,8 +2102,8 @@ export type RayNotificationProps = RayNotificationOwnProps & Omit<React.HTMLAttr
1920
2102
  export declare const RayNotification: React.ForwardRefExoticComponent<RayNotificationProps & React.RefAttributes<Ray.RayNotification>>;
1921
2103
 
1922
2104
  export interface RayToasterOwnProps {
1923
- /** Corner of the stack. */
1924
- position?: "bottom-right" | "bottom-left" | "bottom-center" | "top-right" | "top-left" | "top-center";
2105
+ /** Corner of the stack: -start/-end follow the writing direction; -left/-right are sides of the screen. */
2106
+ position?: "bottom-end" | "bottom-start" | "bottom-center" | "top-end" | "top-start" | "top-center" | "bottom-right" | "bottom-left" | "top-right" | "top-left";
1925
2107
  /** Maximum kept; the oldest go first. */
1926
2108
  limit?: number;
1927
2109
  /** Toasts shown in the collapsed stack (the rest wait, hidden). */
@@ -2166,8 +2348,8 @@ export interface RayScrollAreaOwnProps {
2166
2348
  threshold?: number;
2167
2349
  /** Accessible name: makes the scrolling box a named region. */
2168
2350
  label?: string;
2169
- /** The end came within threshold (once per arrival). */
2170
- onRayReachEnd?: (event: CustomEvent<{ edge: "bottom" | "right" }>) => void;
2351
+ /** The end came within threshold (once per arrival): the bottom, or the right when horizontal (the left right to left). */
2352
+ onRayReachEnd?: (event: CustomEvent<{ edge: "bottom" | "right" | "left" }>) => void;
2171
2353
  }
2172
2354
  export type RayScrollAreaProps = RayScrollAreaOwnProps & Omit<React.HTMLAttributes<Ray.RayScrollArea>, keyof RayScrollAreaOwnProps> & { children?: React.ReactNode };
2173
2355
  /** <ray-scroll-area> as a React component. */
@@ -2178,8 +2360,8 @@ export interface RaySeparatorOwnProps {
2178
2360
  orientation?: "horizontal" | "vertical";
2179
2361
  /** Text in the middle of a horizontal rule. */
2180
2362
  label?: string;
2181
- /** Where the label sits. */
2182
- labelPosition?: "left" | "center" | "right";
2363
+ /** Where the label sits: start/end follow the writing direction; left/right are sides of the screen. */
2364
+ labelPosition?: "start" | "center" | "end" | "left" | "right";
2183
2365
  /** Thickness (1–5px). */
2184
2366
  size?: "xs" | "sm" | "md" | "lg" | "xl";
2185
2367
  /** Line style. */
@@ -2202,7 +2384,7 @@ export interface RaySplitOwnProps {
2202
2384
  collapsed?: boolean;
2203
2385
  /** The divider cannot be moved. */
2204
2386
  disabled?: boolean;
2205
- /** A key: the size is saved in localStorage and restored. */
2387
+ /** A key: the size and the collapsed state are saved in localStorage and restored (a saved state wins over the collapsed attribute). */
2206
2388
  autosave?: string;
2207
2389
  /** After a drag, a key or a collapse. */
2208
2390
  onRayResize?: (event: CustomEvent<{ size: number; collapsed: boolean }>) => void;
package/index.js CHANGED
@@ -16,6 +16,7 @@ export { RayCombobox } from "./components/combobox.js";
16
16
  export { RayDatePicker, RayCalendar } from "./components/date-picker.js";
17
17
  export { RayFileUpload } from "./components/file-upload.js";
18
18
  export { RayInput } from "./components/input.js";
19
+ export { RayModeInput } from "./components/mode-input.js";
19
20
  export { RayNumberInput } from "./components/number-input.js";
20
21
  export { RayPasswordInput } from "./components/password-input.js";
21
22
  export { RayPathInput } from "./components/path-input.js";
@@ -28,6 +29,7 @@ export { RaySwitch } from "./components/switch.js";
28
29
  export { RayTextarea } from "./components/textarea.js";
29
30
  export { RayBottomNav, RayBottomNavItem } from "./components/bottom-nav.js";
30
31
  export { RayBreadcrumbs, RayBreadcrumb } from "./components/breadcrumbs.js";
32
+ export { RayDocTabs, RayDocTab } from "./components/doc-tabs.js";
31
33
  export { RayNavLink } from "./components/nav-link.js";
32
34
  export { RayPagination } from "./components/pagination.js";
33
35
  export { RaySidebar, RaySidebarGroup } from "./components/sidebar.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raylang/react",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "React wrappers of the ray-elements web components",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": ["web-components", "design-system", "ui", "raylang", "react"],
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "sideEffects": false,
30
30
  "peerDependencies": {
31
- "@raylang/elements": "^0.7.0",
31
+ "@raylang/elements": "^0.9.0",
32
32
  "react": ">=18"
33
33
  }
34
34
  }