@reliability-design/web 1.4.4 → 1.4.5
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/dist/components/rel-accordion/rel-accordion.ts +13 -1
- package/dist/components/rel-button/rel-button.ts +18 -2
- package/dist/components/rel-calendar/rel-calendar.ts +23 -1
- package/dist/components/rel-carousel/rel-carousel.ts +20 -0
- package/dist/components/rel-checkbox/rel-checkbox.ts +4 -1
- package/dist/components/rel-chip/rel-chip.ts +29 -0
- package/dist/components/rel-date-picker/rel-date-picker.ts +156 -13
- package/dist/components/rel-drawer/rel-drawer.ts +22 -58
- package/dist/components/rel-menu/rel-menu.ts +124 -15
- package/dist/components/rel-menubar/rel-menubar.ts +221 -63
- package/dist/components/rel-nav-menu/rel-nav-menu.ts +39 -3
- package/dist/components/rel-otp/rel-otp.ts +3 -3
- package/dist/components/rel-popover/rel-popover.ts +31 -3
- package/dist/components/rel-range-picker/rel-range-picker.ts +134 -1
- package/dist/components/rel-resizable/rel-resizable-group.ts +20 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +50 -12
- package/dist/components/rel-select/rel-select.ts +159 -11
- package/dist/components/rel-sheet/rel-sheet.ts +22 -1
- package/dist/components/rel-sidebar/rel-sidebar.ts +43 -39
- package/dist/components/rel-stepper/rel-stepper.ts +44 -1
- package/dist/components/rel-tab/rel-tab.ts +32 -7
- package/dist/components/rel-time-picker/rel-time-picker.ts +338 -206
- package/dist/components/rel-tooltip/rel-tooltip.ts +30 -0
- package/dist/components/rel-topbar/rel-topbar-actions.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-brand.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-item.ts +318 -319
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-profile.ts +224 -224
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar.ts +440 -440
- package/dist/index.d.mts +225 -17
- package/dist/index.d.ts +225 -17
- package/dist/index.js +1468 -344
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1721 -607
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ declare class RelAccordion extends LitElement {
|
|
|
11
11
|
/** Figma "Style" axis — named appearance because `style` collides with the HTML style attribute. */
|
|
12
12
|
appearance: "shadow" | "plain";
|
|
13
13
|
static styles: lit.CSSResult;
|
|
14
|
+
/** Stable id prefix wiring the header to its panel. */
|
|
15
|
+
private accordionId;
|
|
14
16
|
private toggle;
|
|
15
17
|
render(): lit_html.TemplateResult<1>;
|
|
16
18
|
}
|
|
@@ -356,6 +358,13 @@ declare class RelCalendar extends LitElement {
|
|
|
356
358
|
private nextMonth;
|
|
357
359
|
private selectDay;
|
|
358
360
|
private handleKeyDown;
|
|
361
|
+
/**
|
|
362
|
+
* Index of the single grid cell carrying tabindex="0". The old expression
|
|
363
|
+
* (`isSelected || (index === 0 && !focusedDate)`) left the grid with ZERO
|
|
364
|
+
* tab stops once the user arrowed around without a selection — Tab could
|
|
365
|
+
* never re-enter the calendar.
|
|
366
|
+
*/
|
|
367
|
+
private getRovingIndex;
|
|
359
368
|
render(): lit_html.TemplateResult<1>;
|
|
360
369
|
}
|
|
361
370
|
|
|
@@ -424,6 +433,8 @@ declare class RelCarousel extends LitElement {
|
|
|
424
433
|
private handlePointerMove;
|
|
425
434
|
private handlePointerUp;
|
|
426
435
|
private handleKeyDown;
|
|
436
|
+
private handleFocusIn;
|
|
437
|
+
private handleFocusOut;
|
|
427
438
|
private handleMouseEnter;
|
|
428
439
|
private handleMouseLeave;
|
|
429
440
|
updated(changedProperties: Map<string, any>): void;
|
|
@@ -552,8 +563,17 @@ declare class RelDatePicker extends LitElement {
|
|
|
552
563
|
private handleDayKeydown;
|
|
553
564
|
private toggleMonthDropdown;
|
|
554
565
|
private toggleYearDropdown;
|
|
566
|
+
private handleDropdownTriggerKeydown;
|
|
567
|
+
private focusOpenDropdownSelection;
|
|
568
|
+
private handleDropdownKeydown;
|
|
555
569
|
private selectMonth;
|
|
556
570
|
private selectYear;
|
|
571
|
+
/**
|
|
572
|
+
* Index of the single grid cell carrying tabindex="0". The old expression
|
|
573
|
+
* (`isSelected || (index === 0 && !value)`) left the grid with ZERO tab
|
|
574
|
+
* stops once the user arrowed around without a selection.
|
|
575
|
+
*/
|
|
576
|
+
private getRovingIndex;
|
|
557
577
|
render(): lit_html.TemplateResult<1>;
|
|
558
578
|
}
|
|
559
579
|
|
|
@@ -582,6 +602,8 @@ declare class RelRangePicker extends LitElement {
|
|
|
582
602
|
private viewMonth;
|
|
583
603
|
private isSelectingRange;
|
|
584
604
|
private hoverDate;
|
|
605
|
+
/** ISO date of the cell that owns the grid's single Tab stop (roving tabindex). */
|
|
606
|
+
private focusedDate;
|
|
585
607
|
private triggerButton?;
|
|
586
608
|
private popoverEl?;
|
|
587
609
|
private backdropEl?;
|
|
@@ -617,6 +639,14 @@ declare class RelRangePicker extends LitElement {
|
|
|
617
639
|
private getCalendarDays;
|
|
618
640
|
private handleDayClick;
|
|
619
641
|
private handleDayHover;
|
|
642
|
+
/**
|
|
643
|
+
* The cell that carries tabindex="0". Prefers the last roved date, then the
|
|
644
|
+
* draft start, then today, then the first selectable day — always exactly
|
|
645
|
+
* one Tab stop, even after arrowing away with nothing selected.
|
|
646
|
+
*/
|
|
647
|
+
private getRovingIso;
|
|
648
|
+
private handleGridKeydown;
|
|
649
|
+
private moveGridFocusTo;
|
|
620
650
|
render(): lit_html.TemplateResult<1>;
|
|
621
651
|
}
|
|
622
652
|
declare global {
|
|
@@ -651,6 +681,12 @@ declare class RelChip extends LitElement {
|
|
|
651
681
|
static styles: lit.CSSResult;
|
|
652
682
|
private get classes();
|
|
653
683
|
private handleRemove;
|
|
684
|
+
/** The chip body is announced as a button, so it must also act on keys:
|
|
685
|
+
* Enter/Space re-dispatch as a host click (consumers' @click handlers
|
|
686
|
+
* fire), Delete/Backspace remove when removable, and arrow keys ask the
|
|
687
|
+
* container to reorder a draggable chip (`chip-move`) — the keyboard
|
|
688
|
+
* alternative to pointer drag-and-drop. */
|
|
689
|
+
private handleKeydown;
|
|
654
690
|
private onDragStart;
|
|
655
691
|
private onDragEnd;
|
|
656
692
|
protected updated(changed: Map<string, unknown>): void;
|
|
@@ -723,7 +759,6 @@ declare class RelDrawer extends LitElement {
|
|
|
723
759
|
private handleClose;
|
|
724
760
|
private lockScroll;
|
|
725
761
|
private unlockScroll;
|
|
726
|
-
private getFocusableElements;
|
|
727
762
|
private handleKeydown;
|
|
728
763
|
private handleOverlayClick;
|
|
729
764
|
private handleCloseButtonClick;
|
|
@@ -804,6 +839,7 @@ declare class RelStepper extends LitElement {
|
|
|
804
839
|
private isProgress;
|
|
805
840
|
private isDisabled;
|
|
806
841
|
private getStepClasses;
|
|
842
|
+
private onStepKeyDown;
|
|
807
843
|
private onStepClick;
|
|
808
844
|
private renderIndicator;
|
|
809
845
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -863,8 +899,12 @@ declare class RelMenu extends LitElement {
|
|
|
863
899
|
type: MenuType;
|
|
864
900
|
items: MenuItem[];
|
|
865
901
|
private focusedIndex;
|
|
902
|
+
/** Index inside the open submenu that virtual focus sits on; -1 = main list. */
|
|
903
|
+
private subFocusedIndex;
|
|
866
904
|
private _items;
|
|
867
|
-
|
|
905
|
+
/** Stable id prefix for aria-activedescendant targets. */
|
|
906
|
+
private menuId;
|
|
907
|
+
static readonly _css = "\n :host {\n color: var(--rel-text-default);\n display: inline-block;\n }\n\n .rel-menu {\n position: relative;\n display: inline-block;\n background: var(--rel-bg-neutral);\n color: var(--rel-text-default);\n border-radius: var(--rel-border-radius-md);\n box-shadow: var(--rel-shadows-shadow-300);\n min-width: 220px;\n /* No vertical padding: items fill edge-to-edge so a first/last-item hover\n reaches the menu's top/bottom. NOT overflow:hidden \u2014 that clips the\n type=arrow flyout (position:absolute at left:100%). Instead the first\n and last items carry the outer corner radius so hover backgrounds clip\n to the rounded shape without any overflow. */\n padding: 0;\n outline: none;\n overflow: visible;\n font-family: var(--rel-body-lg-regular-font-family);\n font-weight: var(--rel-body-lg-regular-font-weight);\n font-size: var(--rel-body-lg-regular-font-size);\n line-height: var(--rel-body-lg-regular-line-height);\n letter-spacing: var(--rel-body-lg-regular-letter-spacing);\n }\n\n .rel-menu:focus-visible,\n :host(:focus-visible) .rel-menu {\n outline: 2px solid var(--rel-border-focus);\n outline-offset: 2px;\n }\n\n .rel-menu-item {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--rel-spacing-xs);\n padding: var(--rel-spacing-xs) var(--rel-spacing-sm);\n line-height: var(--rel-body-sm-regular-line-height);\n cursor: pointer;\n transition: background 0.15s ease, color 0.15s ease;\n user-select: none;\n }\n\n /* First/last items carry the menu's outer radius so their hover fill clips\n to the rounded corners (replaces the removed overflow:hidden). */\n .rel-menu > .rel-menu-item:first-child {\n border-top-left-radius: var(--rel-border-radius-md);\n border-top-right-radius: var(--rel-border-radius-md);\n }\n\n .rel-menu > .rel-menu-item:last-child {\n border-bottom-left-radius: var(--rel-border-radius-md);\n border-bottom-right-radius: var(--rel-border-radius-md);\n }\n\n .rel-menu-item:hover {\n background: var(--rel-bg-neutral-elevated-1);\n }\n\n .rel-menu-item:active {\n background: var(--rel-bg-neutral-elevated-1);\n }\n\n .rel-menu-item.active {\n background: var(--rel-bg-neutral-elevated-2);\n font-weight: var(--rel-body-lg-medium-font-weight);\n }\n\n .rel-menu-item.disabled {\n background-color: transparent;\n color: var(--rel-text-disabled);\n /* Keep the item pointer-interactive so cursor:not-allowed actually\n renders; clicks are already neutralised by the item.disabled guard in\n onItemClick/onItemEnter. pointer-events:none here would make the row\n transparent to the pointer and suppress the cursor. */\n cursor: not-allowed;\n }\n\n /* [data-focused] (presence, not =\"true\"): the ?data-focused boolean\n binding renders the attribute with an EMPTY value, so a =\"true\"\n selector never matches. */\n .rel-menu-item[data-focused] {\n outline: 2px solid var(--rel-border-focus);\n outline-offset: -2px;\n }\n\n /* Width modes (Figma Type=Fixed / Type=Fit) */\n .rel-menu.fixed {\n width: var(--rel-menu-width, 300px);\n min-width: 0;\n box-sizing: border-box;\n }\n\n .rel-menu.fit {\n min-width: 0;\n width: max-content;\n }\n\n /* Checkbox (Type=Checkbox) / radio (Type=Select Option) rows render the real\n rel-checkbox / rel-radio. pointer-events:none keeps the whole row the click\n target so onItemClick stays the single source of truth. */\n .menu-control {\n pointer-events: none;\n width: 100%;\n }\n\n .menu-label {\n flex: 1 1 auto;\n }\n\n /* Submenu affordance \u2014 same rel-icon chevron the menubar uses. */\n .submenu-chevron {\n margin-left: auto;\n display: inline-flex;\n align-items: center;\n opacity: 0.6;\n pointer-events: none;\n }\n\n /* Shortcut / hint text (Figma body-sm-regular, caption tone) */\n .menu-shortcut,\n ::slotted([slot=\"shortcut\"]) {\n font-family: var(--rel-body-sm-regular-font-family);\n font-weight: var(--rel-body-sm-regular-font-weight);\n font-size: var(--rel-body-sm-regular-font-size);\n line-height: var(--rel-body-sm-regular-line-height);\n letter-spacing: var(--rel-body-sm-regular-letter-spacing);\n color: var(--rel-text-caption);\n margin-left: auto;\n padding-left: var(--rel-spacing-md);\n }\n\n \n .rel-submenu {\n border: 1px solid var(--rel-border-subtle);\n position: absolute;\n top: calc(-1 * var(--rel-spacing-3xs));\n /* flush against the trigger (no gap) so moving the pointer into the flyout\n never crosses a dead zone that would fire the trigger's mouseleave */\n left: 100%;\n min-width: 200px;\n background: var(--rel-bg-neutral);\n color: var(--rel-text-default);\n border-radius: var(--rel-border-radius-md);\n box-shadow: var(--rel-shadows-shadow-300);\n /* padding:0 + overflow:hidden \u2014 safe here (a submenu has no further nested\n flyout to clip) \u2014 so sub-item hovers fill fully and clip to the corners */\n padding: 0;\n overflow: hidden;\n visibility: hidden;\n pointer-events: none;\n z-index: 20;\n }\n\n .rel-submenu.visible {\n visibility: visible;\n pointer-events: auto;\n }\n\n .rel-submenu .rel-menu-item {\n padding: var(--rel-spacing-xs) var(--rel-spacing-sm);\n }\n ";
|
|
868
908
|
createRenderRoot(): this;
|
|
869
909
|
connectedCallback(): void;
|
|
870
910
|
disconnectedCallback(): void;
|
|
@@ -876,19 +916,35 @@ declare class RelMenu extends LitElement {
|
|
|
876
916
|
private onItemLeave;
|
|
877
917
|
private onItemClick;
|
|
878
918
|
private onSubClick;
|
|
919
|
+
/** Keyboard-open locks the submenu (no hover-out to close it) and moves
|
|
920
|
+
* virtual focus onto its first entry. */
|
|
921
|
+
private openSubmenuAt;
|
|
922
|
+
private closeSubmenus;
|
|
879
923
|
private onKeydown;
|
|
880
924
|
private renderMenuItem;
|
|
881
925
|
render(): lit_html.TemplateResult<1>;
|
|
882
926
|
}
|
|
883
927
|
|
|
884
928
|
declare class RelMenubar extends LitElement {
|
|
929
|
+
/**
|
|
930
|
+
* Opt-in: actually BIND the keys declared via data-shortcut (e.g.
|
|
931
|
+
* data-shortcut="Ctrl+Z"), not just display them. "Ctrl" matches Cmd on
|
|
932
|
+
* Apple platforms when written as "Mod". Keystrokes originating in
|
|
933
|
+
* inputs/textareas/contenteditable are ignored.
|
|
934
|
+
*/
|
|
935
|
+
bindShortcuts: boolean;
|
|
885
936
|
private menus;
|
|
886
937
|
private openMenuIndex;
|
|
887
938
|
private focusedTriggerIndex;
|
|
888
939
|
private focusedItemIndex;
|
|
940
|
+
/** Virtual-focus index inside the open submenu; -1 = focus is in the panel. */
|
|
941
|
+
private focusedSubItemIndex;
|
|
889
942
|
private openSubmenuElement;
|
|
890
943
|
private hoverSwitchEnabled;
|
|
891
944
|
private _onScroll?;
|
|
945
|
+
/** Stable id prefix for aria-activedescendant targets (light DOM, so ids
|
|
946
|
+
* must be unique per menubar instance on the page). */
|
|
947
|
+
private menubarId;
|
|
892
948
|
static readonly _css = "\n /* This component renders into LIGHT DOM (createRenderRoot returns this), so\n :host / <slot> don't work here \u2014 the raw <rel-menubar-menu> definitions\n are data holders that must be hidden with a plain selector. Relying on the\n global rel-menubar-menu.css is not enough: it can't cross a consumer's\n shadow boundary AND it's a no-op in the tsup-built package (css:\"copy\"). */\n rel-menubar {\n color: var(--rel-text-default);\n display: block;\n }\n\n rel-menubar-menu {\n display: none;\n }\n\n .menubar-container {\n display: flex;\n align-items: stretch;\n background: var(--rel-bg-surface-elevated);\n border: var(--rel-stroke-sm) solid var(--rel-border-default);\n border-radius: var(--rel-border-radius-sm);\n overflow: hidden;\n padding: 0;\n gap: var(--rel-spacing-3xs);\n height: 40px;\n width: fit-content;\n font-family: var(--rel-body-sm-regular-font-family);\n font-weight: var(--rel-body-sm-regular-font-weight);\n font-size: var(--rel-body-sm-regular-font-size);\n line-height: var(--rel-body-sm-regular-line-height);\n letter-spacing: var(--rel-body-sm-regular-letter-spacing);\n }\n\n .menubar-trigger {\n display: flex;\n align-items: center;\n align-self: stretch;\n height: 100%;\n padding: 0 var(--rel-spacing-sm);\n background: transparent;\n border: none;\n cursor: pointer;\n font-family: inherit;\n font-size: inherit;\n color: var(--rel-text-label);\n transition: background 0.15s ease;\n user-select: none;\n outline: none;\n }\n\n .menubar-trigger:hover,\n .menubar-trigger.active {\n background: var(--rel-bg-neutral-elevated-2);\n }\n\n .menubar-trigger:focus-visible {\n outline: 2px solid var(--rel-border-focus);\n outline-offset: 2px;\n }\n\n .menubar-panel {\n position: fixed;\n min-width: 220px;\n background: var(--rel-bg-surface);\n border: var(--rel-stroke-sm) solid var(--rel-border-default);\n border-radius: var(--rel-border-radius-sm);\n box-shadow: var(--rel-shadows-shadow-300);\n padding: 0;\n overflow: hidden;\n z-index: 1000;\n display: none;\n }\n\n .menubar-panel.open {\n display: block;\n }\n\n .menu-item {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--rel-spacing-sm);\n padding: var(--rel-spacing-xs) var(--rel-spacing-md);\n cursor: pointer;\n transition: background 0.15s ease;\n user-select: none;\n color: var(--rel-text-label);\n line-height: var(--rel-body-sm-regular-line-height);\n }\n\n .menu-item:hover,\n .menu-item.focused {\n background: var(--rel-bg-neutral-elevated-2);\n }\n\n .menu-item[data-disabled=\"true\"] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .menu-separator {\n height: var(--rel-stroke-sm);\n background: var(--rel-border-default);\n margin: 0;\n padding: 0;\n }\n\n rel-icon {\n display: inline-flex;\n pointer-events: none;\n }\n\n .menu-submenu-trigger {\n position: relative;\n }\n\n .menu-submenu-trigger rel-icon {\n opacity: 0.6;\n }\n\n .submenu-panel {\n position: fixed;\n min-width: 200px;\n background: var(--rel-bg-surface);\n border: var(--rel-stroke-sm) solid var(--rel-border-default);\n border-radius: var(--rel-border-radius-sm);\n box-shadow: var(--rel-shadows-shadow-300);\n padding: 0;\n overflow: hidden;\n z-index: 1001;\n display: none;\n }\n\n .submenu-panel.open {\n display: block;\n }\n\n .menu-shortcut {\n opacity: 0.6;\n margin-left: auto;\n display: flex;\n align-items: center;\n gap: var(--rel-spacing-3xs);\n font-family: var(--rel-body-xs-regular-font-family);\n font-weight: var(--rel-body-xs-regular-font-weight);\n font-size: var(--rel-body-xs-regular-font-size);\n line-height: var(--rel-body-xs-regular-line-height);\n letter-spacing: var(--rel-body-xs-regular-letter-spacing);\n }\n\n .menubar-panel rel-checkbox {\n display: block;\n width: 100%;\n padding: var(--rel-spacing-xs, 8px) var(--rel-spacing-md, 16px);\n box-sizing: border-box;\n cursor: pointer;\n }\n ";
|
|
893
949
|
createRenderRoot(): this;
|
|
894
950
|
connectedCallback(): void;
|
|
@@ -896,17 +952,24 @@ declare class RelMenubar extends LitElement {
|
|
|
896
952
|
private _repositionOpenSubmenu;
|
|
897
953
|
private _repositionOpenMenu;
|
|
898
954
|
private discoverMenus;
|
|
955
|
+
private handleShortcutKeyDown;
|
|
899
956
|
private handleOutsideClick;
|
|
900
957
|
private closeAllMenus;
|
|
958
|
+
/** Close everything and put DOM focus back on the trigger that owned the
|
|
959
|
+
* open menu. (Capturing the index BEFORE closing — closeAllMenus resets
|
|
960
|
+
* openMenuIndex to -1, which used to drop focus to <body>.) */
|
|
961
|
+
private closeAllMenusAndRefocusTrigger;
|
|
901
962
|
private openMenu;
|
|
902
963
|
private handleTriggerClick;
|
|
903
964
|
private handleTriggerMouseEnter;
|
|
904
965
|
private handleTriggerKeyDown;
|
|
905
966
|
private focusTrigger;
|
|
906
967
|
private handlePanelKeyDown;
|
|
968
|
+
private getSubmenuItems;
|
|
907
969
|
private getFocusableItems;
|
|
908
970
|
private focusMenuItem;
|
|
909
971
|
private handleItemClick;
|
|
972
|
+
private dispatchSelectEvent;
|
|
910
973
|
private openSubmenu;
|
|
911
974
|
private handleSubmenuItemClick;
|
|
912
975
|
private dispatchChangeEvent;
|
|
@@ -938,7 +1001,7 @@ declare class RelNavbar extends LitElement {
|
|
|
938
1001
|
|
|
939
1002
|
/**
|
|
940
1003
|
* @deprecated Part of the deprecated rel-topbar family. Use a plain
|
|
941
|
-
* `<a>`/logo markup inside the "
|
|
1004
|
+
* `<a>`/logo markup inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
942
1005
|
*/
|
|
943
1006
|
declare class RelTopbarBrand extends LitElement {
|
|
944
1007
|
src: string;
|
|
@@ -955,7 +1018,7 @@ declare global {
|
|
|
955
1018
|
|
|
956
1019
|
/**
|
|
957
1020
|
* @deprecated Part of the deprecated rel-topbar family. Use plain
|
|
958
|
-
* `rel-button` elements inside the "
|
|
1021
|
+
* `rel-button` elements inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
959
1022
|
*/
|
|
960
1023
|
declare class RelTopbarActions extends LitElement {
|
|
961
1024
|
static styles: lit.CSSResult;
|
|
@@ -969,7 +1032,7 @@ declare global {
|
|
|
969
1032
|
|
|
970
1033
|
/**
|
|
971
1034
|
* @deprecated Part of the deprecated rel-topbar family. Use plain
|
|
972
|
-
* `rel-button` (icon variant) elements inside the "
|
|
1035
|
+
* `rel-button` (icon variant) elements inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
973
1036
|
*/
|
|
974
1037
|
declare class RelTopbarUtilities extends LitElement {
|
|
975
1038
|
static styles: lit.CSSResult;
|
|
@@ -983,7 +1046,7 @@ declare global {
|
|
|
983
1046
|
|
|
984
1047
|
/**
|
|
985
1048
|
* @deprecated Part of the deprecated rel-topbar family. Use `rel-drawer`
|
|
986
|
-
* for the mobile nav panel in the "
|
|
1049
|
+
* for the mobile nav panel in the "Navbar" recipe at /docs/recipes/navbar.
|
|
987
1050
|
*/
|
|
988
1051
|
declare class RelTopbarMobilePanel extends LitElement {
|
|
989
1052
|
static styles: lit.CSSResult;
|
|
@@ -997,7 +1060,7 @@ declare global {
|
|
|
997
1060
|
|
|
998
1061
|
/**
|
|
999
1062
|
* @deprecated Part of the deprecated rel-topbar family. Use `rel-menu` or
|
|
1000
|
-
* `rel-popover` for nav dropdowns in the "
|
|
1063
|
+
* `rel-popover` for nav dropdowns in the "Navbar" recipe at /docs/recipes/navbar.
|
|
1001
1064
|
*/
|
|
1002
1065
|
declare class RelTopbarDropdown extends LitElement {
|
|
1003
1066
|
static styles: lit.CSSResult;
|
|
@@ -1011,7 +1074,7 @@ declare global {
|
|
|
1011
1074
|
|
|
1012
1075
|
/**
|
|
1013
1076
|
* @deprecated Part of the deprecated rel-topbar family. Use `rel-menu`'s
|
|
1014
|
-
* item slots or `rel-popover` content in the "
|
|
1077
|
+
* item slots or `rel-popover` content in the "Navbar" recipe at /docs/recipes/navbar.
|
|
1015
1078
|
*/
|
|
1016
1079
|
declare class RelTopbarDropdownItem extends LitElement {
|
|
1017
1080
|
label: string;
|
|
@@ -1034,7 +1097,7 @@ type TopbarForceLayout = "auto" | "desktop" | "tablet" | "mobile";
|
|
|
1034
1097
|
*
|
|
1035
1098
|
* @deprecated This component's fixed slot structure, hardcoded breakpoint,
|
|
1036
1099
|
* and built-in overflow logic are too rigid for most real layouts. Use the
|
|
1037
|
-
* "
|
|
1100
|
+
* "Navbar" recipe at /docs/recipes/navbar instead, composed from
|
|
1038
1101
|
* rel-menu/rel-popover, rel-drawer, and rel-button. Still supported, but
|
|
1039
1102
|
* will be removed in a future major version.
|
|
1040
1103
|
*
|
|
@@ -1087,8 +1150,7 @@ declare class RelTopbar extends LitElement {
|
|
|
1087
1150
|
/**
|
|
1088
1151
|
* `rel-topbar-item` — A navigation item within rel-topbar.
|
|
1089
1152
|
*
|
|
1090
|
-
* @deprecated Part of the deprecated rel-topbar family. Use the "
|
|
1091
|
-
* Topbar" recipe at /docs/recipes/app-topbar, which composes nav links and
|
|
1153
|
+
* @deprecated Part of the deprecated rel-topbar family. Use the "Navbar" recipe at /docs/recipes/navbar, which composes nav links and
|
|
1092
1154
|
* `rel-menu`/`rel-popover` dropdowns directly instead of a dedicated item component.
|
|
1093
1155
|
*
|
|
1094
1156
|
* Renders as an `<a>` when `href` is supplied, otherwise a `<button>`.
|
|
@@ -1138,7 +1200,7 @@ type TopbarRewardTier = "gold" | "silver" | "platinum" | "bronze" | "regular";
|
|
|
1138
1200
|
* `rel-topbar-profile` — Profile / user tile for the topbar right region.
|
|
1139
1201
|
*
|
|
1140
1202
|
* @deprecated Part of the deprecated rel-topbar family. Compose `rel-avatar`
|
|
1141
|
-
* directly inside the "
|
|
1203
|
+
* directly inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
1142
1204
|
*
|
|
1143
1205
|
* type="avatar" Customer avatar with initials circle + optional name/subtitle.
|
|
1144
1206
|
* type="carrier" Carrier reward tile with reward-tier badge + name/subtitle.
|
|
@@ -1279,6 +1341,7 @@ declare class RelPopover extends LitElement {
|
|
|
1279
1341
|
private get activeOpen();
|
|
1280
1342
|
private setOpen;
|
|
1281
1343
|
private onHostPointerDown;
|
|
1344
|
+
private onHostKeyDown;
|
|
1282
1345
|
private onOpen;
|
|
1283
1346
|
private onClose;
|
|
1284
1347
|
private showNativePopover;
|
|
@@ -1406,6 +1469,9 @@ declare class RelSegmentedButton extends LitElement {
|
|
|
1406
1469
|
align: SegmentAlign;
|
|
1407
1470
|
static styles: lit.CSSResult;
|
|
1408
1471
|
private setActive;
|
|
1472
|
+
/** APG radio-group navigation: arrows move focus AND select, the group is
|
|
1473
|
+
* one Tab stop (roving tabindex on the selected segment). */
|
|
1474
|
+
private onKeyDown;
|
|
1409
1475
|
private renderSegment;
|
|
1410
1476
|
render(): lit_html.TemplateResult<1>;
|
|
1411
1477
|
}
|
|
@@ -1459,6 +1525,10 @@ declare class RelSelect extends LitElement {
|
|
|
1459
1525
|
noSearch: boolean;
|
|
1460
1526
|
private open;
|
|
1461
1527
|
private highlightedIndex;
|
|
1528
|
+
/** Virtual highlight on the Select-All header row (multi mode). */
|
|
1529
|
+
private selectAllHighlighted;
|
|
1530
|
+
private typeaheadBuffer;
|
|
1531
|
+
private typeaheadTimer;
|
|
1462
1532
|
private panelStyle;
|
|
1463
1533
|
private searchValue;
|
|
1464
1534
|
private internalState;
|
|
@@ -1515,6 +1585,12 @@ declare class RelSelect extends LitElement {
|
|
|
1515
1585
|
private onSearchInput;
|
|
1516
1586
|
private onSearchKeyDown;
|
|
1517
1587
|
private handleListNavigation;
|
|
1588
|
+
/** APG typeahead for the no-search mode (with a search field, typing
|
|
1589
|
+
* filters instead). Accumulates printable keys for 500 ms and jumps the
|
|
1590
|
+
* highlight to the next option whose label starts with the buffer. */
|
|
1591
|
+
private handleTypeahead;
|
|
1592
|
+
private activateHighlighted;
|
|
1593
|
+
private scrollHighlightedIntoView;
|
|
1518
1594
|
private renderChips;
|
|
1519
1595
|
/**
|
|
1520
1596
|
* Hidden, unconstrained copy of every selected chip used purely for width
|
|
@@ -1564,6 +1640,7 @@ declare class RelModal extends LitElement {
|
|
|
1564
1640
|
*/
|
|
1565
1641
|
breakpoint: "responsive" | "web";
|
|
1566
1642
|
private overlayElement;
|
|
1643
|
+
private panelElement;
|
|
1567
1644
|
private previousFocus;
|
|
1568
1645
|
private originalBodyOverflow;
|
|
1569
1646
|
private originalBodyPaddingRight;
|
|
@@ -1706,11 +1783,14 @@ declare class RelTab extends LitElement {
|
|
|
1706
1783
|
/** Tab size — styled via :host([size]) rules. */
|
|
1707
1784
|
size: "sm" | "md" | "lg";
|
|
1708
1785
|
private _tabItems;
|
|
1786
|
+
/** Stable id prefix linking tabs to the shared tabpanel. */
|
|
1787
|
+
private tabsId;
|
|
1709
1788
|
static styles: lit.CSSResult;
|
|
1710
1789
|
private _onSlotChange;
|
|
1711
1790
|
private get _effectiveTabs();
|
|
1712
1791
|
private selectTab;
|
|
1713
1792
|
private onKeyDown;
|
|
1793
|
+
private selectAndFocusTab;
|
|
1714
1794
|
render(): lit_html.TemplateResult<1>;
|
|
1715
1795
|
}
|
|
1716
1796
|
|
|
@@ -1722,19 +1802,27 @@ declare class RelTab extends LitElement {
|
|
|
1722
1802
|
* column selections are held in draft state until Apply is clicked; Cancel,
|
|
1723
1803
|
* Escape, or an outside click discards the draft.
|
|
1724
1804
|
*
|
|
1725
|
-
* The committed `value` is ALWAYS 24-hour "HH:mm"
|
|
1726
|
-
* `format`, so consumers get
|
|
1805
|
+
* The committed `value` is ALWAYS 24-hour "HH:mm" (or "HH:mm:ss" when
|
|
1806
|
+
* `seconds` is enabled) regardless of the display `format`, so consumers get
|
|
1807
|
+
* a consistent machine-readable string.
|
|
1808
|
+
*
|
|
1809
|
+
* Panel visuals follow the Figma "Time Picker" component (Reliability DS
|
|
1810
|
+
* V1.0, node 8301:3771): fixed panel widths 220/250/280 by size, full-bleed
|
|
1811
|
+
* columns with 1px dividers, neutral selected state, and a Now / Cancel / OK
|
|
1812
|
+
* footer whose buttons are always size S.
|
|
1727
1813
|
*/
|
|
1728
1814
|
declare class RelTimePicker extends LitElement {
|
|
1729
|
-
/** Committed time, 24-hour "HH:mm" (e.g. "09:30", "17:05"). */
|
|
1815
|
+
/** Committed time, 24-hour "HH:mm" or "HH:mm:ss" (e.g. "09:30", "17:05:30"). */
|
|
1730
1816
|
value: string | null;
|
|
1731
1817
|
placeholder: string;
|
|
1732
1818
|
label: string | null;
|
|
1733
1819
|
disabled: boolean;
|
|
1734
1820
|
required: boolean;
|
|
1735
1821
|
readonly: boolean;
|
|
1736
|
-
/** Display format of the trigger text and hour column. Value stays
|
|
1822
|
+
/** Display format of the trigger text and hour column. Value stays 24-hour. */
|
|
1737
1823
|
format: "12h" | "24h";
|
|
1824
|
+
/** Shows the seconds column; committed value becomes "HH:mm:ss". */
|
|
1825
|
+
seconds: boolean;
|
|
1738
1826
|
/** Minute granularity of the minutes column (1, 5, 10, 15, 30, …). */
|
|
1739
1827
|
minuteStep: number;
|
|
1740
1828
|
/** Earliest selectable time, "HH:mm" (inclusive). */
|
|
@@ -1754,6 +1842,9 @@ declare class RelTimePicker extends LitElement {
|
|
|
1754
1842
|
fullWidth: boolean;
|
|
1755
1843
|
private draftHour;
|
|
1756
1844
|
private draftMinute;
|
|
1845
|
+
private draftSecond;
|
|
1846
|
+
/** Panel opens above the field when there is no viewport space below. */
|
|
1847
|
+
private openUp;
|
|
1757
1848
|
private triggerButton?;
|
|
1758
1849
|
private columnsElement?;
|
|
1759
1850
|
static styles: lit.CSSResult;
|
|
@@ -1762,6 +1853,8 @@ declare class RelTimePicker extends LitElement {
|
|
|
1762
1853
|
private handleClickOutside;
|
|
1763
1854
|
private handleEscapeKey;
|
|
1764
1855
|
updated(changedProperties: Map<string, any>): void;
|
|
1856
|
+
/** Open upward when the panel doesn't fit below but does fit above. */
|
|
1857
|
+
private updatePanelPlacement;
|
|
1765
1858
|
private parseTime;
|
|
1766
1859
|
private formatValue;
|
|
1767
1860
|
private formatDisplay;
|
|
@@ -1777,6 +1870,8 @@ declare class RelTimePicker extends LitElement {
|
|
|
1777
1870
|
private isPeriodEnabled;
|
|
1778
1871
|
/** Hour column entries: display label + the 0–23 hour it maps to. */
|
|
1779
1872
|
private getHourOptions;
|
|
1873
|
+
/** Seconds shown in the seconds column (always step 1). */
|
|
1874
|
+
private getSecondOptions;
|
|
1780
1875
|
private get draftPeriod();
|
|
1781
1876
|
private resetDraftFromValue;
|
|
1782
1877
|
/** Snap the draft minute to the nearest valid step minute for the hour. */
|
|
@@ -1790,7 +1885,14 @@ declare class RelTimePicker extends LitElement {
|
|
|
1790
1885
|
private clearValue;
|
|
1791
1886
|
private selectHour;
|
|
1792
1887
|
private selectMinute;
|
|
1888
|
+
private selectSecond;
|
|
1793
1889
|
private selectPeriod;
|
|
1890
|
+
/**
|
|
1891
|
+
* Scrolls the column's own scroll container only. scrollIntoView is off
|
|
1892
|
+
* limits here: it walks ALL scrollable ancestors, so it yanked the page
|
|
1893
|
+
* up/down whenever a column recentred (user-reported jump bug).
|
|
1894
|
+
*/
|
|
1895
|
+
private scrollOptionInColumn;
|
|
1794
1896
|
private scrollColumnsToSelection;
|
|
1795
1897
|
private handleTriggerKeydown;
|
|
1796
1898
|
/**
|
|
@@ -1835,6 +1937,12 @@ declare class RelTooltip extends LitElement {
|
|
|
1835
1937
|
type: TooltipType;
|
|
1836
1938
|
private uniqueId;
|
|
1837
1939
|
static styles: lit.CSSResult;
|
|
1940
|
+
connectedCallback(): void;
|
|
1941
|
+
disconnectedCallback(): void;
|
|
1942
|
+
/** APG: Escape dismisses the tooltip. Not swallowed — an enclosing dialog
|
|
1943
|
+
* may legitimately close on the same keystroke. */
|
|
1944
|
+
private onKeydown;
|
|
1945
|
+
private clearDismissed;
|
|
1838
1946
|
firstUpdated(): void;
|
|
1839
1947
|
private linkTrigger;
|
|
1840
1948
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -2074,4 +2182,104 @@ declare global {
|
|
|
2074
2182
|
}
|
|
2075
2183
|
}
|
|
2076
2184
|
|
|
2077
|
-
|
|
2185
|
+
/**
|
|
2186
|
+
* Shared focus utilities (shadow-DOM aware).
|
|
2187
|
+
*
|
|
2188
|
+
* Most components in this package render into shadow roots, so the classic
|
|
2189
|
+
* `container.querySelectorAll(focusableSelector)` + `document.activeElement`
|
|
2190
|
+
* approach silently fails in two ways:
|
|
2191
|
+
* 1. querySelectorAll never descends into child components' shadow roots,
|
|
2192
|
+
* so slotted rel-buttons etc. are invisible to a focus trap.
|
|
2193
|
+
* 2. document.activeElement retargets to the outermost host, so equality
|
|
2194
|
+
* checks against inner elements never match.
|
|
2195
|
+
* These helpers traverse the *composed* tree and resolve the *deep* active
|
|
2196
|
+
* element instead.
|
|
2197
|
+
*/
|
|
2198
|
+
/**
|
|
2199
|
+
* All keyboard-focusable elements under `root`, in composed tree order —
|
|
2200
|
+
* descends into shadow roots and follows slot assignment.
|
|
2201
|
+
*/
|
|
2202
|
+
declare function getFocusableElements(root: Element | ShadowRoot): HTMLElement[];
|
|
2203
|
+
/** The actually-focused element, resolved through nested shadow roots. */
|
|
2204
|
+
declare function getDeepActiveElement(): HTMLElement | null;
|
|
2205
|
+
/**
|
|
2206
|
+
* Keep Tab / Shift+Tab cycling inside `container`. Call from a keydown
|
|
2207
|
+
* listener; no-op for non-Tab keys. If focus has already escaped the
|
|
2208
|
+
* container, the next Tab pulls it back in.
|
|
2209
|
+
*/
|
|
2210
|
+
declare function trapTabKey(e: KeyboardEvent, container: Element | ShadowRoot): void;
|
|
2211
|
+
/**
|
|
2212
|
+
* Reusable focus trap for dialog-like components (drawer, modal, popover…).
|
|
2213
|
+
*
|
|
2214
|
+
* private trap = new FocusTrap(() => this.panelEl);
|
|
2215
|
+
* onOpen() { this.trap.activate(); }
|
|
2216
|
+
* onClose() { this.trap.deactivate(); }
|
|
2217
|
+
*
|
|
2218
|
+
* activate() records the previously focused element, moves focus to the
|
|
2219
|
+
* first focusable inside the container (or the container itself), and wraps
|
|
2220
|
+
* Tab at the edges. deactivate() restores focus to where it was.
|
|
2221
|
+
*/
|
|
2222
|
+
declare class FocusTrap {
|
|
2223
|
+
private getContainer;
|
|
2224
|
+
private previousFocus;
|
|
2225
|
+
private active;
|
|
2226
|
+
constructor(getContainer: () => Element | ShadowRoot | null);
|
|
2227
|
+
activate(options?: {
|
|
2228
|
+
initialFocus?: HTMLElement | null;
|
|
2229
|
+
}): void;
|
|
2230
|
+
deactivate(options?: {
|
|
2231
|
+
restoreFocus?: boolean;
|
|
2232
|
+
}): void;
|
|
2233
|
+
private onKeyDown;
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
/**
|
|
2237
|
+
* Shared keyboard-shortcut utilities.
|
|
2238
|
+
*
|
|
2239
|
+
* Shortcut strings are written as "+"-joined tokens, e.g. "mod+b",
|
|
2240
|
+
* "ctrl+shift+p", "escape". The "mod" token means Cmd on Apple platforms
|
|
2241
|
+
* and Ctrl everywhere else (this is the pattern rel-sidebar's Ctrl/Cmd+B
|
|
2242
|
+
* toggle established). Matching is case-insensitive.
|
|
2243
|
+
*/
|
|
2244
|
+
type ShortcutHandler = (e: KeyboardEvent) => void;
|
|
2245
|
+
interface ParsedShortcut {
|
|
2246
|
+
key: string;
|
|
2247
|
+
ctrl: boolean;
|
|
2248
|
+
meta: boolean;
|
|
2249
|
+
alt: boolean;
|
|
2250
|
+
shift: boolean;
|
|
2251
|
+
}
|
|
2252
|
+
declare function isApplePlatform(): boolean;
|
|
2253
|
+
declare function parseShortcut(shortcut: string): ParsedShortcut;
|
|
2254
|
+
/** Does this keydown event match the shortcut string? */
|
|
2255
|
+
declare function matchesShortcut(e: KeyboardEvent, shortcut: string): boolean;
|
|
2256
|
+
/**
|
|
2257
|
+
* True when the event originates from a text-editing context (input,
|
|
2258
|
+
* textarea, select, contenteditable) — global single-key shortcuts should
|
|
2259
|
+
* stay out of the way there. Uses composedPath so it sees through shadow
|
|
2260
|
+
* roots (e.g. the real <input> inside rel-textfield).
|
|
2261
|
+
*/
|
|
2262
|
+
declare function isEditableTarget(e: Event): boolean;
|
|
2263
|
+
interface BindShortcutOptions {
|
|
2264
|
+
/** Listen on this target instead of `document`. */
|
|
2265
|
+
target?: EventTarget;
|
|
2266
|
+
/** Fire even when focus is in an input/textarea/contenteditable. */
|
|
2267
|
+
allowInEditable?: boolean;
|
|
2268
|
+
/** preventDefault on match (default true). */
|
|
2269
|
+
preventDefault?: boolean;
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* Bind a shortcut, returns the unbind function.
|
|
2273
|
+
*
|
|
2274
|
+
* private unbind = bindShortcut("mod+b", () => this.toggle());
|
|
2275
|
+
* disconnectedCallback() { this.unbind(); }
|
|
2276
|
+
*/
|
|
2277
|
+
declare function bindShortcut(shortcut: string, handler: ShortcutHandler, options?: BindShortcutOptions): () => void;
|
|
2278
|
+
/**
|
|
2279
|
+
* Display labels for a shortcut, one entry per key — feed straight into
|
|
2280
|
+
* <rel-kbd-group .items=${formatShortcutParts("mod+b")}>.
|
|
2281
|
+
* Platform-aware: "mod+b" → ["⌘","B"] on Apple, ["Ctrl","B"] elsewhere.
|
|
2282
|
+
*/
|
|
2283
|
+
declare function formatShortcutParts(shortcut: string): string[];
|
|
2284
|
+
|
|
2285
|
+
export { type AutocompleteFilter, type AutocompleteItem, type AutocompleteSearchFn, type BindShortcutOptions, type BreadcrumbItem, type ButtonTone, type ButtonVariant, type ChipBorder, type ChipSize, type ChipTone, type ChipVariant, type DrawerCloseReason, type DrawerSide, type FieldLabelStyle, FocusTrap, type LabelPlacement, type MenuItem, type MenuType, type ModalSide, type Orientation, type OtpType, type ProgressMode, type RadioOption, RelAccordion, RelAlert, RelAutocomplete, RelAvatar, RelBadge, RelBreadcrumbs, RelButton, RelCalendar, RelCard, RelCardMedia, RelCarousel, RelCheckbox, RelChip, RelContainer, RelDatePicker, RelDivider, RelDrawer, RelDrawerFooter, RelKbd, RelKbdGroup, RelLayout, RelMenu, RelMenuItem, RelMenubar, RelMenubarMenu, RelModal, RelNavbar, RelOtp, RelPagination, RelPopover, RelPopoverContent, RelProgress, RelRadio, RelRangePicker, RelResizableGroup, RelResizableHandle, RelResizablePanel, RelSegmentedButton, RelSelect, RelSkeleton, RelSlider, RelSnackbar, RelStepper, RelSwitch, RelTab, RelTabItem, RelTextfield, RelTimePicker, RelToast, RelTooltip, RelTopbar, RelTopbarActions, RelTopbarBrand, RelTopbarDropdown, RelTopbarDropdownItem, RelTopbarItem, RelTopbarMobilePanel, RelTopbarProfile, RelTopbarUtilities, RelUpload, RelUploadActions, type SegmentAlign, type SegmentOption, type SegmentSize, type SelectBorder, type SelectLabelStyle, type SelectOption, type SelectOptionObject, type SelectSize, type SelectState, type ShortcutHandler, type SkeletonAnimation, type SkeletonShape, type SliderType, type SnackbarLines, type SnackbarType, type Step, type StepStatus, type StepperSize, type StepperType, type TabItem, type TextAlign, type TextFieldSize, type TextFieldState, type TextFieldVariant, type ToastType, type TooltipPosition, type TooltipType, type TopbarForceLayout, type TopbarProfileType, type TopbarRewardTier, type TopbarVariant, type TrackStyle, type UploadFile, type UploadPhase, type UploadRejection, type UploadState, type UploadStatus, type Uploader, type UploaderContext, bindShortcut, formatShortcutParts, getDeepActiveElement, getFocusableElements, isApplePlatform, isEditableTarget, matchesShortcut, parseShortcut, trapTabKey };
|