@reliability-design/web 1.4.5 → 1.4.7
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/CHANGELOG.md +211 -49
- package/dist/components/rel-accordion/README.md +132 -132
- package/dist/components/rel-alert/README.md +145 -141
- package/dist/components/rel-autocomplete/README.md +156 -61
- package/dist/components/rel-avatar/README.md +116 -130
- package/dist/components/rel-badge/README.md +98 -93
- package/dist/components/rel-breadcrumb/README.md +96 -102
- package/dist/components/rel-button/README.md +160 -130
- package/dist/components/rel-calendar/README.md +109 -109
- package/dist/components/rel-card/README.md +75 -94
- package/dist/components/rel-cardmedia/README.md +100 -127
- package/dist/components/rel-carousel/README.md +184 -166
- package/dist/components/rel-checkbox/README.md +93 -75
- package/dist/components/rel-chip/README.md +132 -121
- package/dist/components/rel-container/README.md +107 -99
- package/dist/components/rel-date-picker/README.md +200 -289
- package/dist/components/rel-divider/README.md +78 -100
- package/dist/components/rel-drawer/README.md +187 -200
- package/dist/components/rel-kbd/README.md +141 -151
- package/dist/components/rel-menu/README.md +178 -151
- package/dist/components/rel-menubar/README.md +218 -329
- package/dist/components/rel-otp/README.md +170 -440
- package/dist/components/rel-pagination/README.md +100 -424
- package/dist/components/rel-popover/README.md +203 -568
- package/dist/components/rel-progress/README.md +88 -110
- package/dist/components/rel-radio/README.md +131 -135
- package/dist/components/rel-range-picker/README.md +162 -0
- package/dist/components/rel-resizable/README.md +199 -140
- package/dist/components/rel-segmented-button/README.md +155 -141
- package/dist/components/rel-select/README.md +154 -93
- package/dist/components/rel-sheet/README.md +168 -224
- package/dist/components/rel-skeleton/README.md +103 -0
- package/dist/components/rel-slider/README.md +130 -135
- package/dist/components/rel-snackbar/README.md +162 -134
- package/dist/components/rel-stepper/README.md +158 -160
- package/dist/components/rel-switch/README.md +108 -102
- package/dist/components/rel-tab/README.md +171 -163
- package/dist/components/rel-textfield/README.md +159 -69
- package/dist/components/rel-time-picker/README.md +122 -157
- package/dist/components/rel-toast/README.md +157 -148
- package/dist/components/rel-tooltip/README.md +108 -103
- package/dist/components/rel-upload/README.md +220 -0
- package/dist/index.d.mts +1387 -350
- package/dist/index.d.ts +1387 -350
- package/dist/index.js +5863 -3600
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5864 -3592
- package/dist/index.mjs.map +1 -1
- package/dist/styles/vars.css +877 -866
- package/dist/{vars-XNMTSRVN.css → vars-JHTUGNRG.css} +877 -866
- package/package.json +4 -3
- package/dist/components/rel-accordion/rel-accordion.ts +0 -336
- package/dist/components/rel-alert/rel-alert.ts +0 -305
- package/dist/components/rel-autocomplete/rel-autocomplete.ts +0 -689
- package/dist/components/rel-avatar/rel-avatar.ts +0 -142
- package/dist/components/rel-badge/rel-badge.ts +0 -170
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +0 -106
- package/dist/components/rel-button/rel-button.ts +0 -560
- package/dist/components/rel-calendar/index.ts +0 -1
- package/dist/components/rel-calendar/rel-calendar.ts +0 -519
- package/dist/components/rel-card/rel-card.ts +0 -88
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +0 -88
- package/dist/components/rel-carousel/index.ts +0 -1
- package/dist/components/rel-carousel/rel-carousel.ts +0 -700
- package/dist/components/rel-chart/README.md +0 -286
- package/dist/components/rel-chart/index.ts +0 -1
- package/dist/components/rel-chart/rel-chart.ts +0 -754
- package/dist/components/rel-checkbox/rel-checkbox.ts +0 -382
- package/dist/components/rel-chip/rel-chip.ts +0 -472
- package/dist/components/rel-container/rel-container.ts +0 -95
- package/dist/components/rel-date-picker/date-format.test.ts +0 -43
- package/dist/components/rel-date-picker/date-format.ts +0 -47
- package/dist/components/rel-date-picker/index.ts +0 -1
- package/dist/components/rel-date-picker/rel-date-picker.ts +0 -1237
- package/dist/components/rel-divider/rel-divider.ts +0 -54
- package/dist/components/rel-drawer/index.ts +0 -1
- package/dist/components/rel-drawer/rel-drawer-footer.ts +0 -27
- package/dist/components/rel-drawer/rel-drawer.ts +0 -604
- package/dist/components/rel-kbd/rel-kbd.ts +0 -188
- package/dist/components/rel-layout/rel-layout.ts +0 -49
- package/dist/components/rel-menu/rel-menu.ts +0 -535
- package/dist/components/rel-menubar/index.ts +0 -2
- package/dist/components/rel-menubar/rel-menubar-menu.css +0 -3
- package/dist/components/rel-menubar/rel-menubar-menu.ts +0 -17
- package/dist/components/rel-menubar/rel-menubar.ts +0 -777
- package/dist/components/rel-nav-menu/README.md +0 -289
- package/dist/components/rel-nav-menu/index.ts +0 -3
- package/dist/components/rel-nav-menu/rel-nav-menu-item.ts +0 -243
- package/dist/components/rel-nav-menu/rel-nav-menu-panel.ts +0 -72
- package/dist/components/rel-nav-menu/rel-nav-menu.ts +0 -270
- package/dist/components/rel-navbar/README.md +0 -126
- package/dist/components/rel-navbar/rel-navbar.ts +0 -105
- package/dist/components/rel-otp/index.ts +0 -1
- package/dist/components/rel-otp/rel-otp.ts +0 -517
- package/dist/components/rel-pagination/index.ts +0 -1
- package/dist/components/rel-pagination/rel-pagination.ts +0 -509
- package/dist/components/rel-popover/index.ts +0 -2
- package/dist/components/rel-popover/rel-popover-content.ts +0 -81
- package/dist/components/rel-popover/rel-popover.ts +0 -444
- package/dist/components/rel-progress/rel-progress.ts +0 -225
- package/dist/components/rel-radio/rel-radio.ts +0 -305
- package/dist/components/rel-range-picker/rel-range-picker.ts +0 -1331
- package/dist/components/rel-resizable/index.ts +0 -3
- package/dist/components/rel-resizable/rel-resizable-group.ts +0 -405
- package/dist/components/rel-resizable/rel-resizable-handle.ts +0 -150
- package/dist/components/rel-resizable/rel-resizable-panel.ts +0 -58
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +0 -213
- package/dist/components/rel-select/rel-select.ts +0 -1385
- package/dist/components/rel-sheet/rel-sheet.ts +0 -465
- package/dist/components/rel-sidebar/README.md +0 -209
- package/dist/components/rel-sidebar/rel-sidebar.ts +0 -1185
- package/dist/components/rel-skeleton/rel-skeleton.ts +0 -134
- package/dist/components/rel-slider/rel-slider.ts +0 -670
- package/dist/components/rel-snackbar/rel-snackbar.ts +0 -325
- package/dist/components/rel-stepper/rel-stepper.ts +0 -565
- package/dist/components/rel-switch/rel-switch.ts +0 -197
- package/dist/components/rel-tab/rel-tab.ts +0 -264
- package/dist/components/rel-table/README.md +0 -178
- package/dist/components/rel-table/rel-table-body.ts +0 -22
- package/dist/components/rel-table/rel-table-caption.ts +0 -30
- package/dist/components/rel-table/rel-table-cell.ts +0 -43
- package/dist/components/rel-table/rel-table-footer.ts +0 -24
- package/dist/components/rel-table/rel-table-head.ts +0 -47
- package/dist/components/rel-table/rel-table-header.ts +0 -22
- package/dist/components/rel-table/rel-table-row.ts +0 -37
- package/dist/components/rel-table/rel-table.ts +0 -62
- package/dist/components/rel-textfield/rel-textfield.ts +0 -866
- package/dist/components/rel-time-picker/rel-time-picker.ts +0 -1126
- package/dist/components/rel-toast/rel-toast.ts +0 -204
- package/dist/components/rel-tooltip/rel-tooltip.ts +0 -190
- package/dist/components/rel-topbar/rel-topbar-actions.ts +0 -27
- package/dist/components/rel-topbar/rel-topbar-brand.ts +0 -54
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +0 -69
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +0 -31
- package/dist/components/rel-topbar/rel-topbar-item.ts +0 -324
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +0 -27
- package/dist/components/rel-topbar/rel-topbar-profile.ts +0 -243
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +0 -27
- package/dist/components/rel-topbar/rel-topbar.ts +0 -446
- package/dist/components/rel-upload/UPLOAD-DESIGN-CHANGES.md +0 -134
- package/dist/components/rel-upload/rel-upload-actions.ts +0 -163
- package/dist/components/rel-upload/rel-upload.ts +0 -943
package/dist/index.d.mts
CHANGED
|
@@ -3,12 +3,32 @@ import * as lit from 'lit';
|
|
|
3
3
|
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
4
4
|
export * from '@reliability-design/icons';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Single collapsible section (Figma "Accordion", 6021:1085): a clickable header
|
|
8
|
+
* that expands/collapses the slotted body with an animated chevron.
|
|
9
|
+
* @slot - Body content, revealed when `open`
|
|
10
|
+
* @slot icon - Leading icon in the header (`type="action"` only); replaces the default rotating chevron-down
|
|
11
|
+
* @slot trailing-icon - Trailing icon in the header; replaces the default chevron-down (default type) or arrow-expansion (action type)
|
|
12
|
+
* @csspart base - The outer card (`.accordion`) carrying the appearance border / shadow
|
|
13
|
+
* @csspart trigger - The `role="button"` header row
|
|
14
|
+
* @csspart label - The title row (leading icon + title text)
|
|
15
|
+
* @csspart icon - The trailing icon wrapper
|
|
16
|
+
* @csspart content - The `role="region"` body that holds the default slot
|
|
17
|
+
*/
|
|
6
18
|
declare class RelAccordion extends LitElement {
|
|
19
|
+
/** Header text. Note it is also the native HTML `title` attribute, so browsers show it as a tooltip on hover. */
|
|
7
20
|
title: string;
|
|
21
|
+
/** Whether the body is expanded; toggled by the header and reported via `open-change`. Setting it from code does not fire the event. */
|
|
8
22
|
open: boolean;
|
|
9
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Header scale (Figma "Size"): `large` = 56px header / heading-md title, `medium` = 48px / heading-sm,
|
|
25
|
+
* `small` = 44px / heading-xs (new in 1.4.7). The historical spellings stay supported as aliases:
|
|
26
|
+
* `md` = large (the default), `sm` = medium.
|
|
27
|
+
*/
|
|
28
|
+
size: "md" | "sm" | "large" | "medium" | "small";
|
|
29
|
+
/** Header layout (Figma "Type"): `default` = title + trailing rotating chevron; `action` = leading icon slot (rotating chevron by default) + static trailing arrow-expansion icon, with the body indented under the title. */
|
|
10
30
|
type: "default" | "action";
|
|
11
|
-
/** Figma "Style" axis — named appearance because `style` collides with the HTML style attribute. */
|
|
31
|
+
/** Figma "Style" axis — named appearance because `style` collides with the HTML style attribute. `shadow` = 4px-radius card with the shadow-sm effect and no border; `plain` = square corners with a 1px border-subtle stroke and no elevation. */
|
|
12
32
|
appearance: "shadow" | "plain";
|
|
13
33
|
static styles: lit.CSSResult;
|
|
14
34
|
/** Stable id prefix wiring the header to its panel. */
|
|
@@ -17,15 +37,44 @@ declare class RelAccordion extends LitElement {
|
|
|
17
37
|
render(): lit_html.TemplateResult<1>;
|
|
18
38
|
}
|
|
19
39
|
|
|
40
|
+
/** Canonical semantic tones (Figma "Tone"). */
|
|
41
|
+
type AlertTone = "neutral" | "info" | "success" | "warning" | "destructive";
|
|
42
|
+
/** Deprecated tone spellings, all mapped to "destructive". */
|
|
43
|
+
type AlertToneAlias = "error" | "danger" | "critical";
|
|
44
|
+
type AlertToneInput = AlertTone | AlertToneAlias;
|
|
45
|
+
/**
|
|
46
|
+
* Inline status banner (Figma "Alert"): a tone-coloured box with a leading status icon, a bold title, optional supporting text, an optional link and an optional dismiss button. Use it for persistent page- or section-level messages; use `rel-toast` / `rel-snackbar` for transient feedback.
|
|
47
|
+
* @csspart base - The `role="alert"` container that carries the tone and appearance styling
|
|
48
|
+
* @csspart icon - Wrapper around the leading status `<rel-icon>`
|
|
49
|
+
* @csspart content - Column that stacks the title, helper text and link
|
|
50
|
+
* @csspart label - The primary message (`message1`) paragraph
|
|
51
|
+
* @csspart helper - The secondary message (`message2`) paragraph; rendered only when `message2` is set
|
|
52
|
+
* @csspart action - The inline link; rendered only when both `url-text` and `url-href` are set
|
|
53
|
+
* @csspart close-button - The dismiss (✕) button; rendered only while `dismissible` is true
|
|
54
|
+
*/
|
|
20
55
|
declare class RelAlert extends LitElement {
|
|
21
|
-
|
|
22
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Semantic tone (Figma "Tone"): `"neutral"` (default) | `"info"` | `"success"` | `"warning"` | `"destructive"`. Drives the fill/border colour, the title colour and the leading icon (info, check-circle, alert-circle, error). `"error"`, `"danger"` and `"critical"` are deprecated aliases of `"destructive"` and log a one-time console notice. Takes precedence over the deprecated `type` prop.
|
|
58
|
+
*/
|
|
59
|
+
tone?: AlertToneInput;
|
|
60
|
+
/** @deprecated Deprecated since 1.4.7 — alias of `tone`; use `tone`. Same values as `tone`; `type="error"` maps to `tone="destructive"`. Ignored when `tone` is set. Logs a one-time console notice. */
|
|
61
|
+
type?: AlertToneInput;
|
|
62
|
+
/** Read-only canonical tone actually rendered: explicit `tone` wins, else `type`, else `"neutral"`; deprecated aliases are resolved to `"destructive"`. */
|
|
63
|
+
get resolvedTone(): AlertTone;
|
|
64
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
65
|
+
/** Visual treatment (Figma "Style"): `"subtle"` (default: tone-light fill, no border) | `"solid"` (tone fill, inverse text, `--rel-shadows-md` elevation) | `"outline"` (transparent fill, tone border). `"filled"` is a deprecated alias of `"solid"` (no console notice). */
|
|
23
66
|
appearance: "solid" | "subtle" | "outline" | "filled";
|
|
67
|
+
/** Primary message (title), rendered in body-lg medium weight in the tone colour. */
|
|
24
68
|
message1: string;
|
|
69
|
+
/** Optional secondary message rendered under the title in body-md at 90% opacity; omitted when unset. */
|
|
25
70
|
message2?: string;
|
|
71
|
+
/** Text of the inline link rendered under the messages. The link appears only when both `urlText` and `urlHref` are set. */
|
|
26
72
|
urlText?: string;
|
|
73
|
+
/** `href` of the inline link. The link appears only when both `urlText` and `urlHref` are set. */
|
|
27
74
|
urlHref?: string;
|
|
75
|
+
/** Shows the dismiss (✕) button. Defaults to true; because it is a Lit boolean, `dismissible="false"` is still true — set the property to `false` from script to hide the button. */
|
|
28
76
|
dismissible: boolean;
|
|
77
|
+
/** True once the alert has been dismissed; hides the host via `:host([dismissed]) { display: none }`. Set it back to `false` to show the alert again. */
|
|
29
78
|
dismissed: boolean;
|
|
30
79
|
static styles: lit.CSSResult;
|
|
31
80
|
private dismissAlert;
|
|
@@ -36,6 +85,13 @@ declare class RelAlert extends LitElement {
|
|
|
36
85
|
type TextFieldState = "default" | "error" | "disabled";
|
|
37
86
|
type TextFieldSize = "small" | "medium" | "large";
|
|
38
87
|
type TextFieldVariant = "default" | "underline" | "legend";
|
|
88
|
+
/**
|
|
89
|
+
* How the prefix block is drawn (Figma `.Preffix` → Style):
|
|
90
|
+
* - `"clear"` — bare icon/text, no separator (the legacy `leftIcon` look)
|
|
91
|
+
* - `"divider"` — hairline between the prefix and the input
|
|
92
|
+
* - `"fill"` — tinted block flush with the control's left edge
|
|
93
|
+
*/
|
|
94
|
+
type TextFieldPrefixStyle = "clear" | "divider" | "fill";
|
|
39
95
|
/**
|
|
40
96
|
* How a field presents its label. Shared by `<rel-textfield>`, `<rel-select>`
|
|
41
97
|
* and `<rel-autocomplete>` so the three stay in step.
|
|
@@ -45,20 +101,61 @@ type TextFieldVariant = "default" | "underline" | "legend";
|
|
|
45
101
|
* `fieldAriaLabelledby` to keep an accessible name
|
|
46
102
|
*/
|
|
47
103
|
type FieldLabelStyle = "default" | "floating" | "none";
|
|
104
|
+
/**
|
|
105
|
+
* `<rel-textfield>` — single-line or multi-line text input (Figma "Text Field").
|
|
106
|
+
* @slot prefix - Custom content at the far left of the control (e.g. a unit dropdown); shares the prefix block with `prefixIcon` / `prefixText`. Hidden when `multiline` is set.
|
|
107
|
+
* @slot suffix - Custom content at the far right of the control (e.g. an action button); shares the suffix block with `rightIcon` / `suffixText`. Hidden when `multiline` is set.
|
|
108
|
+
* @csspart label - The visible label element (default and floating label styles)
|
|
109
|
+
* @csspart control - The bordered control box (the fieldset in the legend variant)
|
|
110
|
+
* @csspart input - The native input / textarea
|
|
111
|
+
* @csspart prefix - The prefix block (leading icon, prefix text and the `prefix` slot)
|
|
112
|
+
* @csspart suffix - The suffix block (suffix text, trailing icon and the `suffix` slot)
|
|
113
|
+
* @csspart right-icon - The trailing `rel-icon`
|
|
114
|
+
* @csspart helper - The helper / error text line below the control
|
|
115
|
+
* @cssprop --rel-field-label-reserve - Height held for the absent label row under `labelStyle="none"` so the control bottom-aligns with labelled siblings; defaults to the label line-height plus the wrapper gap. Set to `0` to collapse the row entirely (toolbars, table cells).
|
|
116
|
+
*/
|
|
48
117
|
declare class RelTextfield extends LitElement {
|
|
118
|
+
/**
|
|
119
|
+
* Visible label text. Rendered above the control (default), inside it as a
|
|
120
|
+
* floating label (`labelStyle="floating"`) or as the notch of the `legend`
|
|
121
|
+
* variant; omitted entirely under `labelStyle="none"`.
|
|
122
|
+
*/
|
|
49
123
|
label?: string;
|
|
124
|
+
/** Placeholder shown while the field is empty. Under the floating label style it stays hidden until the field is focused. */
|
|
50
125
|
placeholder: string;
|
|
126
|
+
/** Native input `type` (`text`, `email`, `password`, `number`, …). Ignored when `multiline` is set. */
|
|
51
127
|
type: string;
|
|
128
|
+
/** Current text. Updated on every keystroke; set it to control the field programmatically. */
|
|
52
129
|
value: string;
|
|
130
|
+
/** Legacy name for the leading icon (a `rel-icon` name). `prefixIcon` wins when both are set. */
|
|
53
131
|
leftIcon?: string;
|
|
132
|
+
/** Trailing `rel-icon` name rendered in the suffix block. Decorative unless `clickableRightIcon` is set. */
|
|
54
133
|
rightIcon?: string;
|
|
55
134
|
/** Makes the trailing icon interactive (pointer + focusable) and emits
|
|
56
135
|
* `rel-right-icon-click` — e.g. a password show/hide toggle or clear button. */
|
|
57
136
|
clickableRightIcon: boolean;
|
|
58
137
|
/** Accessible label for the trailing icon when it is clickable. */
|
|
59
138
|
rightIconAriaLabel?: string;
|
|
139
|
+
/** Short text rendered before the input, e.g. `"http://"` or `"$"`. Sits in
|
|
140
|
+
* the same prefix block as `prefixIcon` and is styled by `prefixStyle`. */
|
|
141
|
+
prefixText?: string;
|
|
142
|
+
/** Visual treatment of the prefix block — applies to the prefix icon, text
|
|
143
|
+
* and slotted `prefix` content alike. See `TextFieldPrefixStyle`. */
|
|
144
|
+
prefixStyle: TextFieldPrefixStyle;
|
|
145
|
+
/** Short text rendered after the input, e.g. `"kg"` or `".00"`. Shares the
|
|
146
|
+
* suffix block with `rightIcon` and slotted `suffix` content. */
|
|
147
|
+
suffixText?: string;
|
|
148
|
+
/** Draws a hairline between the input and the suffix block. */
|
|
149
|
+
suffixDivider: boolean;
|
|
150
|
+
/** Legacy name for the helper line below the control. `helperText` wins when both are set. */
|
|
60
151
|
supportingText?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Legacy visual state. `"error"` / `"disabled"` behave like the `error` /
|
|
154
|
+
* `disabled` booleans, which are preferred and take precedence. Typing into a
|
|
155
|
+
* `state="error"` field resets it to `"default"` until the value is emptied again.
|
|
156
|
+
*/
|
|
61
157
|
state: TextFieldState;
|
|
158
|
+
/** Control height — `small` 32px, `medium` 40px, `large` 48px — which also scales the text and the affix icons. */
|
|
62
159
|
size: TextFieldSize;
|
|
63
160
|
/**
|
|
64
161
|
* Label presentation. Left `undefined` the deprecated `floatingLabel` boolean
|
|
@@ -76,22 +173,39 @@ declare class RelTextfield extends LitElement {
|
|
|
76
173
|
fieldAriaLabel?: string;
|
|
77
174
|
/** IDREF list of external element(s) naming the input. Wins over `fieldAriaLabel`. */
|
|
78
175
|
fieldAriaLabelledby?: string;
|
|
176
|
+
/** Field chrome: `default` outlined box, `underline` bottom border only, `legend` notched outline with the label sitting in the top border (native fieldset/legend). */
|
|
79
177
|
variant: TextFieldVariant;
|
|
178
|
+
/** Disables the input (not focusable, not editable) and dims the control. */
|
|
80
179
|
disabled: boolean;
|
|
180
|
+
/** Marks the input required: sets native `required` / `aria-required` and appends an asterisk to the label. */
|
|
81
181
|
required: boolean;
|
|
182
|
+
/** Renders a textarea instead of a single-line input (see `rows`). Prefix/suffix blocks and `type` are ignored in this mode. */
|
|
82
183
|
multiline: boolean;
|
|
184
|
+
/** Visible text rows of the textarea when `multiline` is set. */
|
|
83
185
|
rows: number;
|
|
186
|
+
/** Leading `rel-icon` name rendered in the prefix block (preferred over the legacy `leftIcon`). */
|
|
84
187
|
prefixIcon?: string;
|
|
188
|
+
/** Accessible label for the leading icon. Without it the icon is `aria-hidden` (decorative). */
|
|
85
189
|
prefixIconAriaLabel?: string;
|
|
190
|
+
/** Puts the field in the error state: danger border, `aria-invalid`, and `errorMessage` replacing the helper text. */
|
|
86
191
|
error: boolean;
|
|
192
|
+
/** Text shown below the control instead of `helperText` while the field is in the error state. */
|
|
87
193
|
errorMessage?: string;
|
|
194
|
+
/** Helper line below the control (preferred over the legacy `supportingText`); linked to the input via `aria-describedby`. */
|
|
88
195
|
helperText?: string;
|
|
196
|
+
/** Makes the input read-only: focusable and selectable but not editable. */
|
|
89
197
|
readonly: boolean;
|
|
198
|
+
/** Maximum number of characters (native `maxlength`). */
|
|
90
199
|
maxLength?: number;
|
|
200
|
+
/** Form field name forwarded to the native input, for form submission and autofill. */
|
|
91
201
|
name?: string;
|
|
202
|
+
/** Fills the parent width as a block element (default). Unset it to render inline at the content's natural width. */
|
|
92
203
|
fullWidth: boolean;
|
|
93
204
|
private internalState;
|
|
205
|
+
/** Whether the `prefix` / `suffix` named slots currently have content. */
|
|
206
|
+
private slotted;
|
|
94
207
|
private _wasError;
|
|
208
|
+
private _prefixObserver?;
|
|
95
209
|
private uniqueId;
|
|
96
210
|
private get isDisabled();
|
|
97
211
|
private get isError();
|
|
@@ -103,6 +217,24 @@ declare class RelTextfield extends LitElement {
|
|
|
103
217
|
private get labelHidden();
|
|
104
218
|
static styles: lit.CSSResult;
|
|
105
219
|
connectedCallback(): void;
|
|
220
|
+
disconnectedCallback(): void;
|
|
221
|
+
private handleSlotChange;
|
|
222
|
+
/**
|
|
223
|
+
* The whole control is the input's hit area. The input already stretches
|
|
224
|
+
* to the row (CSS), but the control's own border, the legend notch, and
|
|
225
|
+
* any padding around slotted content are still container pixels — press
|
|
226
|
+
* there and focus the input, as clicking a <label> would. Skipped when the
|
|
227
|
+
* press is on the input itself (native caret placement), a clickable icon,
|
|
228
|
+
* or slotted content (their own behaviour), and when disabled.
|
|
229
|
+
* preventDefault keeps the press from moving focus to the body first.
|
|
230
|
+
*/
|
|
231
|
+
private handleControlMousedown;
|
|
232
|
+
/** Clicking the (non-interactive) prefix/suffix area focuses the input, as a
|
|
233
|
+
* label would. Clickable icons and slotted controls keep their own clicks. */
|
|
234
|
+
private handleAffixClick;
|
|
235
|
+
/** Publishes the prefix block's width as --_rel-tf-prefix-w on its parent so
|
|
236
|
+
* the floated label can slide back over a clear-style prefix (see CSS). */
|
|
237
|
+
private observePrefix;
|
|
106
238
|
willUpdate(changed: PropertyValues<this>): void;
|
|
107
239
|
private _warnedNoName;
|
|
108
240
|
updated(): void;
|
|
@@ -116,7 +248,12 @@ declare class RelTextfield extends LitElement {
|
|
|
116
248
|
render(): lit_html.TemplateResult<1>;
|
|
117
249
|
}
|
|
118
250
|
|
|
119
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* An item is a plain string or any object read through displayField/valueField.
|
|
253
|
+
* Two keys are read off objects directly, whatever those fields are named:
|
|
254
|
+
* `icon` (a `rel-icon` name shown before the label) and `disabled` (`true`
|
|
255
|
+
* renders the row dulled and makes it unselectable by click or keyboard).
|
|
256
|
+
*/
|
|
120
257
|
type AutocompleteItem = string | Record<string, unknown>;
|
|
121
258
|
type AutocompleteFilter = "contains" | "starts-with" | "none";
|
|
122
259
|
type AutocompleteSearchFn = (query: string) => Promise<AutocompleteItem[]>;
|
|
@@ -133,6 +270,24 @@ type AutocompleteSearchFn = (query: string) => Promise<AutocompleteItem[]>;
|
|
|
133
270
|
* `valueField`) — typing alone emits `rel-change` with the raw text but does
|
|
134
271
|
* not change `value` until an item is picked (or the text exactly matches an
|
|
135
272
|
* item's label/value on Enter/blur).
|
|
273
|
+
* @csspart panel - The suggestion listbox container (same node as `list`)
|
|
274
|
+
* @csspart list - Alias of `panel`
|
|
275
|
+
* @csspart option - A suggestion row
|
|
276
|
+
* @csspart label - The inner field's label (re-exported from `rel-textfield`)
|
|
277
|
+
* @csspart control - The inner field's bordered control box (re-exported from `rel-textfield`)
|
|
278
|
+
* @csspart input - The inner native input (re-exported from `rel-textfield`)
|
|
279
|
+
* @csspart helper - The inner field's helper / error line (re-exported from `rel-textfield`)
|
|
280
|
+
* @csspart right-icon - The clear icon shown when `clearable` (re-exported from `rel-textfield`)
|
|
281
|
+
* @cssprop --rel-autocomplete-bg - Panel and row background
|
|
282
|
+
* @cssprop --rel-autocomplete-menu-border - Panel border colour. The panel is borderless by design and only draws this on dark surfaces, where its shadow alone can't separate it from the page.
|
|
283
|
+
* @cssprop --rel-autocomplete-menu-radius - Panel corner radius
|
|
284
|
+
* @cssprop --rel-autocomplete-menu-shadow - Panel box-shadow
|
|
285
|
+
* @cssprop --rel-autocomplete-divider - Hairline between rows
|
|
286
|
+
* @cssprop --rel-autocomplete-option-hover - Background of the hovered / keyboard-highlighted / selected row
|
|
287
|
+
* @cssprop --rel-autocomplete-option-pressed - Background of a row while it is being pressed
|
|
288
|
+
* @cssprop --rel-autocomplete-value-color - Suggestion label colour
|
|
289
|
+
* @cssprop --rel-autocomplete-icon-color - Colour of a row's leading `icon`
|
|
290
|
+
* @cssprop --rel-autocomplete-status-color - Colour of the loading / no-results status rows
|
|
136
291
|
*/
|
|
137
292
|
declare class RelAutocomplete extends LitElement {
|
|
138
293
|
/** Local (or fallback initial) suggestion list. Ignored while searchFn drives results. */
|
|
@@ -159,12 +314,17 @@ declare class RelAutocomplete extends LitElement {
|
|
|
159
314
|
loading: boolean;
|
|
160
315
|
/** Row shown when a query yields nothing. */
|
|
161
316
|
noResultsText: string;
|
|
317
|
+
/** Text shown next to the spinner while suggestions load. */
|
|
162
318
|
loadingText: string;
|
|
319
|
+
/** Visible label, forwarded to the inner `rel-textfield`. Also names the suggestion panel. */
|
|
163
320
|
label?: string;
|
|
321
|
+
/** Placeholder of the input, forwarded to the inner `rel-textfield`. */
|
|
164
322
|
placeholder: string;
|
|
323
|
+
/** Field height — `small` 32px, `medium` 40px, `large` 48px — forwarded to the inner `rel-textfield`. Also drives the suggestion panel's row ramp. */
|
|
165
324
|
size: TextFieldSize;
|
|
325
|
+
/** Field chrome (`default` outlined, `underline`, `legend` notched outline), forwarded to the inner `rel-textfield`. */
|
|
166
326
|
variant: TextFieldVariant;
|
|
167
|
-
/**
|
|
327
|
+
/** Label presentation (`default` / `floating` / `none`), forwarded to the inner field. Left `undefined`, the deprecated `floatingLabel` decides. */
|
|
168
328
|
labelStyle?: FieldLabelStyle;
|
|
169
329
|
/** @deprecated Use `labelStyle="floating"`. Kept permanently as an alias. */
|
|
170
330
|
floatingLabel: boolean;
|
|
@@ -172,14 +332,23 @@ declare class RelAutocomplete extends LitElement {
|
|
|
172
332
|
fieldAriaLabel?: string;
|
|
173
333
|
/** IDREF list of external element(s) naming the input. Wins over `fieldAriaLabel`. */
|
|
174
334
|
fieldAriaLabelledby?: string;
|
|
335
|
+
/** Leading `rel-icon` name in the field's prefix block, e.g. `search`. */
|
|
175
336
|
prefixIcon?: string;
|
|
337
|
+
/** Disables the field; the panel never opens and the clear affordance is hidden. */
|
|
176
338
|
disabled: boolean;
|
|
339
|
+
/** Read-only field: focusable but not editable; the panel never opens and the clear affordance is hidden. */
|
|
177
340
|
readonly: boolean;
|
|
341
|
+
/** Marks the input required (native `required` / `aria-required`, asterisk on the label). */
|
|
178
342
|
required: boolean;
|
|
343
|
+
/** Puts the field in the error state (danger border, `aria-invalid`); pair with `errorMessage`. */
|
|
179
344
|
error: boolean;
|
|
345
|
+
/** Text shown below the field instead of `helperText` while `error` is set. */
|
|
180
346
|
errorMessage?: string;
|
|
347
|
+
/** Helper line below the field, linked to the input via `aria-describedby`. */
|
|
181
348
|
helperText?: string;
|
|
349
|
+
/** Form field name forwarded to the native input. */
|
|
182
350
|
name?: string;
|
|
351
|
+
/** Fills the parent width as a block element (default). Unset it to render inline at the content's natural width. */
|
|
183
352
|
fullWidth: boolean;
|
|
184
353
|
private open;
|
|
185
354
|
private inputText;
|
|
@@ -202,6 +371,8 @@ declare class RelAutocomplete extends LitElement {
|
|
|
202
371
|
static styles: lit.CSSResult;
|
|
203
372
|
disconnectedCallback(): void;
|
|
204
373
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
374
|
+
private wasLoading;
|
|
375
|
+
protected updated(): void;
|
|
205
376
|
/** Full normalized source list (remote results while searchFn drives, else items). */
|
|
206
377
|
private get allItems();
|
|
207
378
|
private normalizeItem;
|
|
@@ -221,6 +392,7 @@ declare class RelAutocomplete extends LitElement {
|
|
|
221
392
|
/** Re-evaluates whether the panel should be showing for the current state. */
|
|
222
393
|
private syncPanel;
|
|
223
394
|
private onFieldInput;
|
|
395
|
+
private announceResults;
|
|
224
396
|
private runSearch;
|
|
225
397
|
private selectItem;
|
|
226
398
|
/** Silent commit when typed text exactly matches an item (label or value, case-insensitive). */
|
|
@@ -228,6 +400,9 @@ declare class RelAutocomplete extends LitElement {
|
|
|
228
400
|
private emitChanged;
|
|
229
401
|
private clear;
|
|
230
402
|
private onKeyDown;
|
|
403
|
+
/** First selectable row at or past `from`, walking in `step`; -1 if none. */
|
|
404
|
+
private nextEnabledIndex;
|
|
405
|
+
private announceHighlighted;
|
|
231
406
|
private onFocusIn;
|
|
232
407
|
private onFocusOut;
|
|
233
408
|
/** Delegates focus to the inner textfield. */
|
|
@@ -242,24 +417,58 @@ declare global {
|
|
|
242
417
|
}
|
|
243
418
|
}
|
|
244
419
|
|
|
420
|
+
/**
|
|
421
|
+
* Circular avatar (Figma "Avatar"): shows a photo, text initials or a slotted icon in one of four sizes and three fill variants.
|
|
422
|
+
* @slot - Icon content rendered when `type="icon"` (typically an inline SVG, sized to 50% of the circle)
|
|
423
|
+
* @csspart base - The circular wrapper that carries the size, variant and inline `bg` / `color` overrides
|
|
424
|
+
* @csspart icon - The `<img>` (`type="image"`) or the icon wrapper span around the slot (`type="icon"`)
|
|
425
|
+
* @csspart label - The `<span>` holding the initials when `type="text"`
|
|
426
|
+
* @cssprop --rel-avatar-bg-fill - Background colour of the `fill` variant
|
|
427
|
+
* @cssprop --rel-avatar-color-fill - Text / icon colour of the `fill` variant
|
|
428
|
+
* @cssprop --rel-avatar-bg-subtle - Background colour of the `subtle` variant
|
|
429
|
+
* @cssprop --rel-avatar-color-subtle - Text / icon colour of the `subtle` variant
|
|
430
|
+
* @cssprop --rel-avatar-border-outline - 1px border colour of the `outline` variant
|
|
431
|
+
* @cssprop --rel-avatar-color-outline - Text / icon colour of the `outline` variant
|
|
432
|
+
* @cssprop --rel-avatar-size - Overrides the circle's width/height for sizes between (or below) the `size` presets; defaults to the preset's diameter
|
|
433
|
+
* @cssprop --rel-avatar-font-size - Overrides the initials' font-size, for use alongside `--rel-avatar-size`; defaults to the preset's text role
|
|
434
|
+
*/
|
|
245
435
|
declare class RelAvatar extends LitElement {
|
|
436
|
+
/** Diameter step: `lg` 40px, `md` 32px, `sm` 24px, `xs` 20px; each binds the matching body-*-semibold text role for initials. */
|
|
246
437
|
size: "lg" | "md" | "sm" | "xs";
|
|
438
|
+
/** What is rendered inside the circle: `image` shows `src`, `text` shows the `text` initials, `icon` shows the default slot. */
|
|
247
439
|
type: "image" | "text" | "icon";
|
|
440
|
+
/** Fill style: `fill` = solid inverse background with light text, `subtle` = elevated neutral background, `outline` = transparent with a 1px border. */
|
|
248
441
|
variant: "fill" | "subtle" | "outline";
|
|
442
|
+
/** Image URL for `type="image"`; when empty nothing is rendered inside the circle (there is no fallback to initials). */
|
|
249
443
|
src: string;
|
|
444
|
+
/** Initials shown for `type="text"`; rendered uppercase via `text-transform`. */
|
|
250
445
|
text: string;
|
|
446
|
+
/** Alt text of the `<img>` for `type="image"`; the default is the generic word "Avatar", so pass the person's name. */
|
|
251
447
|
alt: string;
|
|
448
|
+
/** Any CSS colour applied inline as `background-color` on the circle, overriding the variant background. */
|
|
252
449
|
bg: string;
|
|
450
|
+
/** Any CSS colour applied inline as `color` on the circle (initials / icon), overriding the variant text colour. */
|
|
253
451
|
color: string;
|
|
254
452
|
static styles: lit.CSSResult;
|
|
255
453
|
render(): lit_html.TemplateResult<1>;
|
|
256
454
|
}
|
|
257
455
|
|
|
456
|
+
/**
|
|
457
|
+
* Notification badge (Figma "Badge"): a small count pill or an unlabeled dot, usually positioned over an icon or avatar.
|
|
458
|
+
* @csspart base - The `role="status"` pill / dot that carries the size, variant and colour overrides
|
|
459
|
+
* @cssprop --rel-badge-bg - Background colour of the badge; the `color` prop writes this on the host
|
|
460
|
+
* @cssprop --rel-badge-color - Text colour of the count; the `text-color` prop writes this on the host
|
|
461
|
+
*/
|
|
258
462
|
declare class RelBadge extends LitElement {
|
|
463
|
+
/** Text shown in the `number` variant (a count such as "5" or "99+"); not rendered by `variant="dot"` but still used to build the accessible name. */
|
|
259
464
|
number: string;
|
|
465
|
+
/** Explicit accessible name; when empty it is composed as "<number> <suffix>" or, with no number, "New <suffix>". Attribute is `arialabel`. */
|
|
260
466
|
ariaLabel: string;
|
|
467
|
+
/** Noun appended to the count in the generated accessible name, e.g. "3 notifications". */
|
|
261
468
|
suffix: string;
|
|
469
|
+
/** Badge scale (Figma Badge S/M/L/XL): number badges are 20 / 24 / 28 / 40px tall, dot badges 8 / 10 / 12 / 12px. */
|
|
262
470
|
size: "sm" | "md" | "lg" | "xl";
|
|
471
|
+
/** `number` renders the `number` text in a pill that widens with its content; `dot` renders a small disc with no text. */
|
|
263
472
|
variant: "dot" | "number";
|
|
264
473
|
/**
|
|
265
474
|
* Direct CSS color override for the badge background. Accepts any valid
|
|
@@ -277,6 +486,7 @@ declare class RelBadge extends LitElement {
|
|
|
277
486
|
textColor: string;
|
|
278
487
|
static styles: lit.CSSResult;
|
|
279
488
|
private get classes();
|
|
489
|
+
private get computedAriaLabel();
|
|
280
490
|
updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
281
491
|
render(): lit_html.TemplateResult<1>;
|
|
282
492
|
}
|
|
@@ -285,40 +495,62 @@ interface BreadcrumbItem {
|
|
|
285
495
|
label: string;
|
|
286
496
|
url?: string;
|
|
287
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Breadcrumb trail: a `<nav aria-label="Breadcrumb">` ordered list of links with chevron separators, whose last entry is the current page. Use it to show where a page sits in a hierarchy; do not use it as primary navigation.
|
|
500
|
+
* @csspart base - The `<nav>` landmark wrapping the ordered list.
|
|
501
|
+
* @csspart label - The non-link current-page text (`aria-current="page"`), also used for any item without a `url`.
|
|
502
|
+
*/
|
|
288
503
|
declare class RelBreadcrumbs extends LitElement {
|
|
504
|
+
/** Ordered trail, root first: `{ label: string; url?: string }[]`. Items with a `url` render as links except the last one, which is always the current page (and never a link). Set as a property — arrays do not survive attribute serialisation. */
|
|
289
505
|
items: BreadcrumbItem[];
|
|
290
506
|
static styles: lit.CSSResult;
|
|
291
507
|
render(): lit_html.TemplateResult<1>;
|
|
292
508
|
}
|
|
293
509
|
|
|
294
510
|
/**
|
|
295
|
-
* Style axis
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
511
|
+
* Style axis (Figma "Style"): primary | secondary | ghost | link | static.
|
|
512
|
+
* "outline" (= secondary) and "text" (= ghost) are the historical spellings
|
|
513
|
+
* and stay supported; "default" is the legacy neutral-fill style. "static" is
|
|
514
|
+
* the Figma Style=Static treatment (transparent, static-light label — for use
|
|
515
|
+
* on colored/dark surfaces). Legacy "icon" is the pre-2.0 collapsed
|
|
516
|
+
* icon-button variant and keeps its exact behavior; prefer icon-only + a
|
|
517
|
+
* style instead.
|
|
300
518
|
*/
|
|
301
519
|
type ButtonVariant = "default" | "primary" | "secondary" | "text" | "link" | "icon" | "static" | "outline" | "ghost";
|
|
302
|
-
/**
|
|
303
|
-
|
|
520
|
+
/**
|
|
521
|
+
* Tone axis (Figma "Tone"): neutral | brand | destructive. Historical
|
|
522
|
+
* spellings "default" (= neutral), "primary" (= brand), "critical" and
|
|
523
|
+
* "danger" (= destructive) stay supported; "critical"/"danger" log a one-time
|
|
524
|
+
* deprecation notice. "secondary"/"success" are legacy extras.
|
|
525
|
+
*/
|
|
526
|
+
type ButtonTone = "default" | "primary" | "secondary" | "critical" | "success" | "neutral" | "brand" | "danger" | "destructive";
|
|
527
|
+
/**
|
|
528
|
+
* Action button (Figma "Button"): a native `<button>` with the Figma Style / Tone / Size axes, an icon-only mode, a loading spinner and an optional corner badge. Use it for every clickable action; use an anchor for navigation.
|
|
529
|
+
* @slot - Button content: label text, a `rel-icon`, or icon + text (kept on one line with the size's gap).
|
|
530
|
+
* @csspart base - The inner native `<button>` element (padding, min-width, fill, border, focus ring).
|
|
531
|
+
* @csspart indicator - The loading spinner, rendered only while `loading` is set.
|
|
532
|
+
* @cssprop --rel-button-min-width - Overrides the per-size minimum width (Figma small/medium/large = 80/100/120px, ghost small = 56px). Ignored by `icon-only` and `link`.
|
|
533
|
+
*/
|
|
304
534
|
declare class RelButton extends LitElement {
|
|
535
|
+
/** Style axis (Figma "Style"). Canonical: `default` (legacy neutral fill), `primary`, `secondary` (outlined), `ghost` (text-only), `link` (underlined inline text), `static` (transparent, static-light label for dark/colored surfaces). Deprecated aliases still accepted: `outline` = secondary, `text` = ghost, and `icon` (pre-2.0 40px circular icon button — use `icon-only` with a style instead). */
|
|
305
536
|
variant: ButtonVariant;
|
|
537
|
+
/** Tone axis (Figma "Tone"). Canonical: `neutral` (= `default`), `brand` (= `primary`), `destructive`. Deprecated aliases `critical` and `danger` map to destructive and log a one-time console notice. `secondary` and `success` are legacy extras with no Figma counterpart (secondary only affects the legacy `icon` variant). */
|
|
306
538
|
tone: ButtonTone;
|
|
307
|
-
/**
|
|
308
|
-
* Figma "Type=Icon Only" as an independent axis: a square button of the
|
|
309
|
-
* current style/tone. Unlike legacy variant="icon", this composes with
|
|
310
|
-
* every style (outline/ghost/link included).
|
|
311
|
-
*/
|
|
539
|
+
/** Figma "Type=Icon Only": renders a square button (32/40/48px per `size`) of the current style and tone with no padding or min-width. Composes with every `variant`; slot a single `rel-icon` and set `aria-label`. */
|
|
312
540
|
iconOnly: boolean;
|
|
313
|
-
/** Figma "State=Loading":
|
|
541
|
+
/** Figma "State=Loading": replaces the label with a spinner (`indicator` part), sets `aria-busy`, and blocks pointer and programmatic clicks. The button keeps its width. */
|
|
314
542
|
loading: boolean;
|
|
543
|
+
/** Figma "Size": `small` = 32px, `medium` = 40px, `large` = 48px height, with matching padding, typography and minimum width. */
|
|
315
544
|
size: "small" | "medium" | "large";
|
|
545
|
+
/** Corner treatment: `corner-radius` = fully rounded pill, `small-corner-radius` = small radius token, `no-corner-radius` = square corners. */
|
|
316
546
|
border: "corner-radius" | "small-corner-radius" | "no-corner-radius";
|
|
547
|
+
/** Figma "State=Disabled": dims the button to 50% opacity, flattens filled styles to the disabled fill, shows a `not-allowed` cursor and swallows every click (including programmatic `.click()`). */
|
|
317
548
|
disabled: boolean;
|
|
549
|
+
/** Accessible name forwarded to the inner native `<button>`. Required for `icon-only` buttons, whose slotted icon has no visible text. */
|
|
318
550
|
ariaLabel: string | null;
|
|
319
|
-
/**
|
|
551
|
+
/** Text for a small `rel-badge` anchored to the top-right corner (e.g. "3", "999+"). Empty string renders no badge. Ignored when `badge-dot` is set. */
|
|
320
552
|
badge: string;
|
|
321
|
-
/**
|
|
553
|
+
/** Renders a small dot badge in the top-right corner instead of a numbered badge; takes precedence over `badge`. The dot is inset 2px from the corner so it lands on a circular icon button's edge. */
|
|
322
554
|
badgeDot: boolean;
|
|
323
555
|
static styles: lit.CSSResult;
|
|
324
556
|
connectedCallback(): void;
|
|
@@ -326,20 +558,37 @@ declare class RelButton extends LitElement {
|
|
|
326
558
|
private handleHostClick;
|
|
327
559
|
/** Style axis with Figma-vocabulary aliases folded onto canonical values. */
|
|
328
560
|
private get styleVariant();
|
|
329
|
-
/** Tone axis with Figma-vocabulary aliases folded onto
|
|
561
|
+
/** Tone axis with Figma-vocabulary aliases folded onto the internal class names. */
|
|
330
562
|
private get effectiveTone();
|
|
563
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
331
564
|
private get classes();
|
|
332
565
|
private handleClick;
|
|
333
566
|
render(): lit_html.TemplateResult<1>;
|
|
334
567
|
}
|
|
335
568
|
|
|
569
|
+
/**
|
|
570
|
+
* Inline single-date calendar (Figma "Calendar"): a month grid with previous/next
|
|
571
|
+
* navigation, always visible — no trigger or popover. Use rel-date-picker for a form field.
|
|
572
|
+
* @csspart header - Month navigation row (previous button, month/year label, next button)
|
|
573
|
+
* @csspart action - The previous-month and next-month buttons
|
|
574
|
+
* @csspart label - The month/year heading and each weekday column header
|
|
575
|
+
* @csspart list - The weekday-header row and the day grid
|
|
576
|
+
* @csspart item - Each day cell button
|
|
577
|
+
*/
|
|
336
578
|
declare class RelCalendar extends LitElement {
|
|
579
|
+
/** Selected date as an ISO `YYYY-MM-DD` string, or `null` for no selection; setting it also moves the visible month. */
|
|
337
580
|
value: string | null;
|
|
581
|
+
/** Earliest selectable date (ISO `YYYY-MM-DD`); earlier days render disabled. */
|
|
338
582
|
min: string | null;
|
|
583
|
+
/** Latest selectable date (ISO `YYYY-MM-DD`); later days render disabled. */
|
|
339
584
|
max: string | null;
|
|
585
|
+
/** Disables every day cell and the month navigation; the host dims to 40% opacity (Figma State=Disabled). */
|
|
340
586
|
disabled: boolean;
|
|
587
|
+
/** First column of the week grid: `"sun"` (default) or `"mon"`. */
|
|
341
588
|
weekStart: "sun" | "mon";
|
|
589
|
+
/** BCP 47 locale for the month name, weekday headers and day cell labels (via `Intl.DateTimeFormat`). */
|
|
342
590
|
locale: string;
|
|
591
|
+
/** Custom predicate that disables individual days (return `true` to disable); applied on top of `min`/`max`. Property only — assign it from JavaScript. */
|
|
343
592
|
isDateDisabled?: (date: Date) => boolean;
|
|
344
593
|
private viewYear;
|
|
345
594
|
private viewMonth;
|
|
@@ -354,6 +603,10 @@ declare class RelCalendar extends LitElement {
|
|
|
354
603
|
private getCalendarDays;
|
|
355
604
|
private getWeekdayLabels;
|
|
356
605
|
private getMonthName;
|
|
606
|
+
private dayLabelFormatter;
|
|
607
|
+
private dayLabelLocale;
|
|
608
|
+
private formatDayLabel;
|
|
609
|
+
private announceMonth;
|
|
357
610
|
private previousMonth;
|
|
358
611
|
private nextMonth;
|
|
359
612
|
private selectDay;
|
|
@@ -368,6 +621,15 @@ declare class RelCalendar extends LitElement {
|
|
|
368
621
|
render(): lit_html.TemplateResult<1>;
|
|
369
622
|
}
|
|
370
623
|
|
|
624
|
+
/**
|
|
625
|
+
* `<rel-card>` — bordered surface that groups related content (Figma "Card").
|
|
626
|
+
* Use `type="media"` with a `<rel-card-media>` in the `media` slot for a flush image header.
|
|
627
|
+
* @slot - Card body; slotted headings and paragraphs receive the Figma card typography
|
|
628
|
+
* @slot media - Flush media region above the body; rendered only when `type="media"`
|
|
629
|
+
* @csspart base - The outer bordered card surface
|
|
630
|
+
* @csspart header - The media region wrapper (present only when `type="media"`)
|
|
631
|
+
* @csspart content - The padded body that wraps the default slot
|
|
632
|
+
*/
|
|
371
633
|
declare class RelCard extends LitElement {
|
|
372
634
|
/**
|
|
373
635
|
* Figma "Type" axis: custom (default) renders slotted content with card
|
|
@@ -379,24 +641,62 @@ declare class RelCard extends LitElement {
|
|
|
379
641
|
render(): lit_html.TemplateResult<1>;
|
|
380
642
|
}
|
|
381
643
|
|
|
644
|
+
/**
|
|
645
|
+
* Slide carousel (Figma "Carousel"): shows one slotted slide at a time in a horizontal or vertical viewport, with optional arrows, dot indicators, drag/swipe, looping and autoplay.
|
|
646
|
+
* @slot - The slides: one light-DOM element per slide (each is sized to one panel and given `role="group"` / `aria-roledescription="slide"`).
|
|
647
|
+
* @csspart viewport - The focusable `role="region"` box that clips the track (also the keyboard target).
|
|
648
|
+
* @csspart track - The flex row / column that translates to reveal the current slide.
|
|
649
|
+
* @csspart ${direction}-button - The two arrow buttons, exposed as `prev-button` and `next-button` (`type="side-arrows"` overlays them on the viewport; `type="bottom-arrows"` inlines them in the dots row).
|
|
650
|
+
* @csspart dots - The indicator row under the viewport (also hosts the arrows for `type="bottom-arrows"`).
|
|
651
|
+
* @csspart dot - One indicator button per reachable position (per slide at `panels="1"`); the active one carries the `active` class and `aria-current="true"`.
|
|
652
|
+
* @csspart dot-group - The row of dots inside `dots` (for `type="bottom-arrows"` it is the middle child, between the two arrows).
|
|
653
|
+
* @cssprop --rel-carousel-height - Viewport height in `orientation="vertical"` (default 320px); the horizontal viewport takes the height of its tallest slide.
|
|
654
|
+
* @cssprop --rel-carousel-nav-size - Width / height of the arrow buttons (default 32px, matching Figma; applies to both side and bottom arrows).
|
|
655
|
+
* @cssprop --rel-carousel-dot-size - Diameter of an inactive dot (default 8px).
|
|
656
|
+
* @cssprop --rel-carousel-dot-size-active - Width of the active (brand-coloured, pill-shaped) dot (default 16px).
|
|
657
|
+
* @cssprop --rel-carousel-slide-width - Written by the component on its own host to the computed panel width (viewport width for `panels="1"`, a fraction of it above that); not meant to be set by consumers (an inline value is overwritten on resize).
|
|
658
|
+
* @cssprop --rel-carousel-slide-height - Written by the component on its own host to the computed panel height (used for vertical slides); not meant to be set by consumers.
|
|
659
|
+
*/
|
|
382
660
|
declare class RelCarousel extends LitElement {
|
|
661
|
+
/** Index of the current slide (0-based). Set it to jump; it is clamped to the slide count and reflected as an attribute. */
|
|
383
662
|
value: number;
|
|
663
|
+
/** Wrap from the last slide to the first (and back) with a seamless clone transition instead of stopping at the ends. */
|
|
384
664
|
loop: boolean;
|
|
665
|
+
/** Advance automatically every `interval` ms; implies looping and pauses while hovered (see `pause-on-hover`) or while focus is inside the carousel. */
|
|
385
666
|
autoplay: boolean;
|
|
667
|
+
/** Autoplay delay between slides, in milliseconds (default 5000). */
|
|
386
668
|
interval: number;
|
|
669
|
+
/** Pause autoplay while the pointer is over the carousel or while dragging (default true; switch off via the property, e.g. `el.pauseOnHover = false`). */
|
|
387
670
|
pauseOnHover: boolean;
|
|
671
|
+
/** Legacy toggle for the overlaid previous / next arrows; ignored whenever `type` is set. */
|
|
388
672
|
showButtons: boolean;
|
|
389
|
-
|
|
673
|
+
/**
|
|
674
|
+
* Figma "Show Dots" property. Tri-state: left off it defers to `type` (dots for every type
|
|
675
|
+
* except `default`, and nothing at all when `type` is unset too); `show-dots` turns them on;
|
|
676
|
+
* `show-dots="false"` turns them off even when `type` would have shown them.
|
|
677
|
+
*/
|
|
678
|
+
showDots?: boolean;
|
|
390
679
|
/**
|
|
391
680
|
* Figma "Type" axis. When set it drives which controls render:
|
|
392
681
|
* default = content only · only-indicators = dots · side-arrows = overlaid
|
|
393
682
|
* arrows + dots · bottom-arrows = dots flanked by arrows below the slide.
|
|
394
|
-
* When unset, the legacy show-buttons
|
|
683
|
+
* When unset, the legacy show-buttons boolean applies unchanged. The dots a type
|
|
684
|
+
* implies can always be overridden by an explicit `show-dots`.
|
|
395
685
|
*/
|
|
396
686
|
type?: "default" | "only-indicators" | "side-arrows" | "bottom-arrows";
|
|
687
|
+
/** Slide axis: `horizontal` (default) translates the track left / right; `vertical` stacks slides in a fixed-height viewport (`--rel-carousel-height`) and translates up / down. */
|
|
397
688
|
orientation: "horizontal" | "vertical";
|
|
689
|
+
/** Accessible name of the carousel region (`aria-label` on the viewport); default "Carousel". */
|
|
398
690
|
label: string;
|
|
399
|
-
gap
|
|
691
|
+
/** Space between consecutive slides in pixels (applied as the track `gap` and added to each slide step); default 8 (Figma `spacing/xs`), 0 = slides touch. */
|
|
692
|
+
gap: number;
|
|
693
|
+
/**
|
|
694
|
+
* Figma "Multi Panels" axis, as a count: how many slides are visible at once (default 1).
|
|
695
|
+
* Fractions are allowed and produce a peek of the next slide — `panels="1.5"` reproduces the
|
|
696
|
+
* Figma Multi Panels=True variant. Navigation still advances one slide at a time.
|
|
697
|
+
*/
|
|
698
|
+
panels: number;
|
|
699
|
+
/** Disables arrows, dots, drag and keyboard navigation, stops autoplay and renders the carousel at 60% opacity. */
|
|
400
700
|
disabled: boolean;
|
|
401
701
|
private slideCount;
|
|
402
702
|
private isDragging;
|
|
@@ -411,15 +711,35 @@ declare class RelCarousel extends LitElement {
|
|
|
411
711
|
private prefersReducedMotion;
|
|
412
712
|
private clonesBefore;
|
|
413
713
|
private _silentJumping;
|
|
714
|
+
private _autoplayTick;
|
|
414
715
|
private _ro?;
|
|
415
716
|
static styles: lit.CSSResult;
|
|
416
717
|
connectedCallback(): void;
|
|
417
718
|
firstUpdated(): void;
|
|
719
|
+
/**
|
|
720
|
+
* Write the computed panel size to the custom properties the slides (and the loop clones)
|
|
721
|
+
* are sized from, then re-align the track. The cross axis keeps the raw viewport measurement.
|
|
722
|
+
*/
|
|
723
|
+
private measure;
|
|
418
724
|
disconnectedCallback(): void;
|
|
419
725
|
private handleSlotChange;
|
|
420
726
|
private get vertical();
|
|
421
727
|
/** Translate along the orientation axis. */
|
|
422
728
|
private axisTransform;
|
|
729
|
+
private get panelCount();
|
|
730
|
+
private get gapPx();
|
|
731
|
+
/**
|
|
732
|
+
* Size of a single panel along the scroll axis. A viewport showing `n` panels contains
|
|
733
|
+
* `ceil(n) - 1` whole gaps — one for a 1.5-panel peek, two for three panels — so those are
|
|
734
|
+
* subtracted before the remainder is split. At `panels="1"` this is just the viewport size.
|
|
735
|
+
*/
|
|
736
|
+
private panelSize;
|
|
737
|
+
/**
|
|
738
|
+
* Highest index that may lead the viewport. Without looping the track stops once the last
|
|
739
|
+
* slide is flush with the trailing edge, so multi-panel carousels never scroll into empty
|
|
740
|
+
* space; with clones in play every slide can lead because the clones fill the tail.
|
|
741
|
+
*/
|
|
742
|
+
private get maxIndex();
|
|
423
743
|
private unit;
|
|
424
744
|
private updateTransform;
|
|
425
745
|
private goToPrevious;
|
|
@@ -440,15 +760,27 @@ declare class RelCarousel extends LitElement {
|
|
|
440
760
|
updated(changedProperties: Map<string, any>): void;
|
|
441
761
|
/** Where nav arrows render, honouring the Figma type when set. */
|
|
442
762
|
private get buttonPlacement();
|
|
763
|
+
/** Explicit `show-dots` wins; otherwise `type` decides, as it always has. */
|
|
443
764
|
private get dotsVisible();
|
|
444
765
|
private renderNavButton;
|
|
445
766
|
render(): lit_html.TemplateResult<1>;
|
|
446
767
|
}
|
|
447
768
|
|
|
769
|
+
/**
|
|
770
|
+
* Media card: a bordered surface with an optional full-width image on top, then a title, subtitle and slotted body. Use it for previews with a hero image (articles, products, galleries); use `rel-card` for free-form or custom layouts.
|
|
771
|
+
* @slot - Body content rendered inside the padded content area below the title and subtitle.
|
|
772
|
+
* @csspart base - The outer bordered card surface (background, border, radius, overflow clip).
|
|
773
|
+
* @csspart icon - The image wrapper above the content, rendered only when `image-src` is set.
|
|
774
|
+
* @csspart content - The padded area holding the title, subtitle and slotted body.
|
|
775
|
+
*/
|
|
448
776
|
declare class RelCardMedia extends LitElement {
|
|
777
|
+
/** URL of the hero image shown full-width at the top of the card. Empty (the default) omits the image section entirely. */
|
|
449
778
|
imageSrc: string;
|
|
779
|
+
/** Alternative text for the hero image. Replace the generic default with a real description, or an empty string for purely decorative images. */
|
|
450
780
|
imageAlt: string;
|
|
781
|
+
/** Heading rendered as an `<h3>` above the subtitle; empty omits it. Note this is also the native `title` attribute, so a value shows as a browser tooltip on hover. */
|
|
451
782
|
title: string;
|
|
783
|
+
/** Secondary line rendered as a paragraph under the title; empty omits it. */
|
|
452
784
|
subtitle: string;
|
|
453
785
|
static styles: lit.CSSResult;
|
|
454
786
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -456,19 +788,32 @@ declare class RelCardMedia extends LitElement {
|
|
|
456
788
|
|
|
457
789
|
type CheckboxState = "default" | "error" | "disabled";
|
|
458
790
|
type CheckboxStatus = "unchecked" | "checked" | "indeterminate";
|
|
459
|
-
type CheckboxSize = "small" | "medium";
|
|
791
|
+
type CheckboxSize = "small" | "medium" | "large";
|
|
460
792
|
type CheckboxDensity = "compact" | "comfortable";
|
|
461
793
|
type CheckboxAlignment = "leading" | "trailing";
|
|
794
|
+
/**
|
|
795
|
+
* Tri-state checkbox (Figma "Checkbox"): a hidden native checkbox behind a custom box, with label, optional prefix icon and supporting text.
|
|
796
|
+
* @csspart base - The outer wrapper that carries the `state` / `status` classes
|
|
797
|
+
* @csspart label - The visible label text
|
|
798
|
+
* @csspart helper - The supporting text (rendered beside the box in comfortable density, under the row in compact)
|
|
799
|
+
*/
|
|
462
800
|
declare class RelCheckbox extends LitElement {
|
|
801
|
+
/** Label text rendered next to the box. */
|
|
463
802
|
label: string;
|
|
464
|
-
/** rel-icon name rendered between the checkbox and the label (label prefix icon). */
|
|
803
|
+
/** rel-icon name rendered between the checkbox and the label (label prefix icon); scales with `size`. Unset renders no icon and reserves no space. */
|
|
465
804
|
icon: string;
|
|
805
|
+
/** Supporting text under or beside the label; where it renders depends on `density`. */
|
|
466
806
|
supportingtext: string;
|
|
807
|
+
/** Visual and interaction state (Figma State): `"error"` swaps in the danger colours, `"disabled"` blocks input and dims the control to 0.55 opacity. */
|
|
467
808
|
state: CheckboxState;
|
|
809
|
+
/** Check state. `"indeterminate"` is programmatic-only — a user toggle always resolves to checked or unchecked. */
|
|
468
810
|
status: CheckboxStatus;
|
|
811
|
+
/** Value reported in the `rel-change` event detail (it is not submitted with a form). */
|
|
469
812
|
value: string;
|
|
470
813
|
/** Control scale (Figma Size). `"medium"` (default) = 18px box with body-lg
|
|
471
|
-
* label; `"small"` = 14px box with body-md label
|
|
814
|
+
* label; `"small"` = 14px box with body-md label; `"large"` (Figma L,
|
|
815
|
+
* added 2026-09-04) = 20px box with body-lg label and body-sm supporting
|
|
816
|
+
* text — the same additive step rel-radio took for its large size. */
|
|
472
817
|
size: CheckboxSize;
|
|
473
818
|
/** Supporting-text layout (Figma Density). `"compact"` (default) puts the
|
|
474
819
|
* supporting text on its own line under the row, indented past the box;
|
|
@@ -479,6 +824,7 @@ declare class RelCheckbox extends LitElement {
|
|
|
479
824
|
* Trailing has no compact layout in the spec, so it always renders with
|
|
480
825
|
* comfortable density. */
|
|
481
826
|
alignment: CheckboxAlignment;
|
|
827
|
+
/** Boolean view of `status`: `true` when `status === "checked"`; setting it writes `"checked"` / `"unchecked"`. */
|
|
482
828
|
get checked(): boolean;
|
|
483
829
|
set checked(val: boolean);
|
|
484
830
|
private _onChange;
|
|
@@ -488,52 +834,109 @@ declare class RelCheckbox extends LitElement {
|
|
|
488
834
|
/** Trailing has no compact layout in the spec — trailing wins. */
|
|
489
835
|
private get effectiveDensity();
|
|
490
836
|
private toggle;
|
|
837
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
491
838
|
registerOnChange(fn: (value: boolean) => void): void;
|
|
839
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
492
840
|
registerOnTouched(fn: () => void): void;
|
|
841
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
493
842
|
writeValue(checked: boolean): void;
|
|
494
843
|
render(): lit_html.TemplateResult<1>;
|
|
495
844
|
}
|
|
496
845
|
|
|
846
|
+
/**
|
|
847
|
+
* Single-date form field (Figma "Date Picker"): a text field with typed date entry plus a
|
|
848
|
+
* popover calendar whose header pills drill into month and year grids, above
|
|
849
|
+
* Today/Tomorrow/Yesterday shortcut chips.
|
|
850
|
+
* Use rel-calendar for an always-visible grid and rel-range-picker for a from/to range.
|
|
851
|
+
* @csspart base - Outer wrapper carrying the size class (`small` / `medium` / `large`)
|
|
852
|
+
* @csspart label - The visible field label (rendered only when `label` is set)
|
|
853
|
+
* @csspart trigger - The field box that wraps the text input and the clear/calendar icons
|
|
854
|
+
* @csspart value - The editable text input inside the trigger
|
|
855
|
+
* @csspart shortcuts - The Today / Tomorrow / Yesterday chip row at the top of the popover
|
|
856
|
+
*/
|
|
497
857
|
declare class RelDatePicker extends LitElement {
|
|
858
|
+
/** Selected date as an ISO `YYYY-MM-DD` string, or `null` when empty; setting it also moves the popover to that month. */
|
|
498
859
|
value: string | null;
|
|
860
|
+
/** Placeholder text shown while the field is empty (visual only; the accessible name comes from `label`, or "Select date" when unset). */
|
|
499
861
|
placeholder: string;
|
|
862
|
+
/** Visible label rendered above the field and wired to the input via `aria-labelledby`; `null` renders no label. */
|
|
500
863
|
label: string | null;
|
|
864
|
+
/** Disables the field, the icons and the popover; the host dims to 60% opacity. */
|
|
501
865
|
disabled: boolean;
|
|
866
|
+
/** Appends a `*` to the label and sets `aria-required`; no validation is performed. */
|
|
502
867
|
required: boolean;
|
|
868
|
+
/** Makes the input read-only and stops the field, icon, Enter and ArrowDown from opening the popover. */
|
|
503
869
|
readonly: boolean;
|
|
870
|
+
/** Earliest selectable date (ISO `YYYY-MM-DD`); earlier days are disabled and typed dates before it are rejected. Wins over the deprecated `min`. */
|
|
504
871
|
minDate: string | null;
|
|
872
|
+
/** Latest selectable date (ISO `YYYY-MM-DD`); later days are disabled and typed dates after it are rejected. Wins over the deprecated `max`. */
|
|
505
873
|
maxDate: string | null;
|
|
506
|
-
/** @deprecated use minDate */
|
|
874
|
+
/** Legacy alias of `minDate`; ignored when `minDate` is set. @deprecated use minDate */
|
|
507
875
|
min: string | null;
|
|
508
|
-
/** @deprecated use maxDate */
|
|
876
|
+
/** Legacy alias of `maxDate`; ignored when `maxDate` is set. @deprecated use maxDate */
|
|
509
877
|
max: string | null;
|
|
878
|
+
/** First column of the calendar grid: `"sun"` (default) or `"mon"`. */
|
|
510
879
|
weekStart: "sun" | "mon";
|
|
880
|
+
/** BCP 47 locale for weekday/month names, the default long-date display, and day/month order when parsing ambiguous typed input. */
|
|
511
881
|
locale: string;
|
|
882
|
+
/** Token pattern for the displayed value (`YYYY`, `YY`, `MMMM`, `MMM`, `MM`, `M`, `DD`, `D`; literal text in `[ ]`), e.g. `DD/MM/YYYY`. Unset → the locale long date. Affects only the visible text, never `value`. */
|
|
512
883
|
displayFormat: string | null;
|
|
513
884
|
/**
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
*
|
|
885
|
+
* Callback with full control over the displayed value; wins over `displayFormat`.
|
|
886
|
+
* Assign it from JavaScript; it stays reactive so setting it after render re-renders
|
|
887
|
+
* the field. The Date it receives is at local midnight.
|
|
517
888
|
*/
|
|
518
889
|
formatDate?: (date: Date) => string;
|
|
890
|
+
/** Whether the calendar popover is open; set it directly to open/close programmatically (focus then moves into the grid). */
|
|
519
891
|
open: boolean;
|
|
892
|
+
/** Closes the popover after a day is picked in the grid (default `true`). */
|
|
520
893
|
closeOnSelect: boolean;
|
|
894
|
+
/** Shows a clear (×) icon while a value is set; clearing fires `rel-change` with `value: null`. */
|
|
521
895
|
clearable: boolean;
|
|
896
|
+
/**
|
|
897
|
+
* Figma ".Date Picker Calendar" Show Shortcuts: renders the Today / Tomorrow /
|
|
898
|
+
* Yesterday chip row and its divider at the top of the popover. On by default —
|
|
899
|
+
* write `show-shortcuts="false"` to hide both (a plain boolean attribute could
|
|
900
|
+
* not express a default of `true`). The typed `T` / `T±N` shortcuts and the
|
|
901
|
+
* in-panel `T` key keep working either way.
|
|
902
|
+
*/
|
|
903
|
+
showShortcuts: boolean;
|
|
904
|
+
/** Forces the error style (danger border, `aria-invalid`) and shows `errorMessage` below the field. Typed-entry parse errors set the same style on their own. */
|
|
522
905
|
error: boolean;
|
|
906
|
+
/** Text shown below the field while `error` is set (or a typed date failed to parse); falls back to `helperText`. */
|
|
523
907
|
errorMessage?: string;
|
|
908
|
+
/** Supporting text shown below the field when there is no error. */
|
|
524
909
|
helperText?: string;
|
|
910
|
+
/** When set, renders a hidden `<input name>` carrying the ISO value so the picker submits with a native form. */
|
|
525
911
|
name?: string;
|
|
912
|
+
/** Field height scale shared with rel-textfield / rel-select: `small` 32px, `medium` 40px (default), `large` 48px. */
|
|
526
913
|
size: "small" | "medium" | "large";
|
|
914
|
+
/** Visual style of the field; `outlined` is the only variant today. */
|
|
527
915
|
variant: "outlined";
|
|
916
|
+
/** Stretches the host to fill its parent's width (attribute `fullwidth`); off by default so the field keeps its intrinsic inline width. */
|
|
528
917
|
fullWidth: boolean;
|
|
918
|
+
/** Custom predicate that disables individual days (return `true` to disable); applied on top of `minDate`/`maxDate` and also rejects typed input. Property only — assign it from JavaScript. */
|
|
529
919
|
isDateDisabled?: (date: Date) => boolean;
|
|
530
920
|
private get minBound();
|
|
531
921
|
private get maxBound();
|
|
532
922
|
private viewYear;
|
|
533
923
|
private viewMonth;
|
|
534
924
|
private focusedDate;
|
|
535
|
-
|
|
536
|
-
private
|
|
925
|
+
/** Panel body: the day grid, or the month / year picker reached via the header pills. */
|
|
926
|
+
private panelView;
|
|
927
|
+
/** First year of the visible Years page; re-anchored whenever that view opens. */
|
|
928
|
+
private yearPageStart;
|
|
929
|
+
/** Uncommitted typed text; null → the input shows the committed value. */
|
|
930
|
+
private inputText;
|
|
931
|
+
/** Parse/range error message for the typed text (cleared on next input). */
|
|
932
|
+
private inputError;
|
|
933
|
+
/**
|
|
934
|
+
* Whether the next popover open should move focus into the calendar grid.
|
|
935
|
+
* Icon-click / ArrowDown / external `open` do (previous behavior); opening
|
|
936
|
+
* by clicking into the text input must NOT, or typing would be impossible.
|
|
937
|
+
*/
|
|
938
|
+
private focusPanelOnOpen;
|
|
939
|
+
private triggerInput?;
|
|
537
940
|
private triggerButton?;
|
|
538
941
|
private popoverElement?;
|
|
539
942
|
private calendarGrid?;
|
|
@@ -543,6 +946,12 @@ declare class RelDatePicker extends LitElement {
|
|
|
543
946
|
private handleClickOutside;
|
|
544
947
|
private handleEscapeKey;
|
|
545
948
|
updated(changedProperties: Map<string, any>): void;
|
|
949
|
+
private showTopLayer;
|
|
950
|
+
private hideTopLayer;
|
|
951
|
+
private onReposition;
|
|
952
|
+
private updatePopoverPosition;
|
|
953
|
+
/** Focus the roving day cell (selected day, else today, else first). */
|
|
954
|
+
private focusPanelSelection;
|
|
546
955
|
private parseISODate;
|
|
547
956
|
private formatISODate;
|
|
548
957
|
private formatDisplayDate;
|
|
@@ -551,50 +960,134 @@ declare class RelDatePicker extends LitElement {
|
|
|
551
960
|
private getCalendarDays;
|
|
552
961
|
private getWeekdayLabels;
|
|
553
962
|
private getMonthName;
|
|
963
|
+
private dayLabelFormatter;
|
|
964
|
+
private dayLabelLocale;
|
|
965
|
+
private formatDayLabel;
|
|
966
|
+
private announceMonth;
|
|
967
|
+
/** Short month names for the Months grid (Figma shows "Jan", "Feb", …). */
|
|
554
968
|
private getMonthsList;
|
|
555
|
-
|
|
969
|
+
/** The 12 years on the current Years page. */
|
|
970
|
+
private getYearsPage;
|
|
971
|
+
/**
|
|
972
|
+
* A month or year is out of bounds only when EVERY day it contains is —
|
|
973
|
+
* a min of the 10th must not grey out that whole month.
|
|
974
|
+
*/
|
|
975
|
+
private isMonthOutOfBounds;
|
|
976
|
+
private isYearOutOfBounds;
|
|
556
977
|
private toggleCalendarPopover;
|
|
557
978
|
private closeCalendarPopover;
|
|
558
979
|
private previousMonth;
|
|
559
980
|
private nextMonth;
|
|
560
981
|
private selectDay;
|
|
982
|
+
/** Commit a date: set value, reset typed text/error, fire rel-change. */
|
|
983
|
+
private commitDate;
|
|
561
984
|
private clearValue;
|
|
562
|
-
|
|
985
|
+
/** Ambiguous "a/b" day/month order: display format wins, then locale. */
|
|
986
|
+
private get dayFirst();
|
|
987
|
+
/**
|
|
988
|
+
* Parse and commit the typed text (Enter / blur). Invalid or out-of-range
|
|
989
|
+
* text keeps the field in an error state with the text preserved for
|
|
990
|
+
* correction; the committed value is untouched (Escape reverts the text).
|
|
991
|
+
*/
|
|
992
|
+
private commitTypedValue;
|
|
993
|
+
/** Today ± offset days, committed directly (T shortcuts / popover chips). */
|
|
994
|
+
private applyDayOffsetShortcut;
|
|
995
|
+
private handleInputInput;
|
|
996
|
+
private handleInputKeydown;
|
|
997
|
+
/** Clicking anywhere on the field opens the popover, keeping focus typed-in. */
|
|
998
|
+
private handleFieldClick;
|
|
999
|
+
/** The calendar icon toggles the popover with the previous focus behavior. */
|
|
1000
|
+
private handleIconClick;
|
|
1001
|
+
/** Commit typed text when focus leaves the component entirely. */
|
|
1002
|
+
private handleInputBlur;
|
|
1003
|
+
/** T inside the panel (grid/header focus) applies Today directly. */
|
|
1004
|
+
private handlePanelKeydown;
|
|
563
1005
|
private handleDayKeydown;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
private
|
|
1006
|
+
/**
|
|
1007
|
+
* The chevrons step by whatever the visible body is made of, so they stay
|
|
1008
|
+
* useful in every view: a month, a year, or a whole 12-year page.
|
|
1009
|
+
*/
|
|
1010
|
+
private goPrev;
|
|
1011
|
+
private goNext;
|
|
1012
|
+
private announceYearPage;
|
|
1013
|
+
/** A pill toggles its own view; tapping it again returns to the day grid. */
|
|
1014
|
+
private switchView;
|
|
1015
|
+
/** Focus the selected month/year cell so the keyboard lands somewhere useful. */
|
|
1016
|
+
private focusPanelGridSelection;
|
|
569
1017
|
private selectMonth;
|
|
570
1018
|
private selectYear;
|
|
1019
|
+
/** Arrow-key roving across the 3-column month / year grid. */
|
|
1020
|
+
private handlePeriodGridKeydown;
|
|
571
1021
|
/**
|
|
572
1022
|
* Index of the single grid cell carrying tabindex="0". The old expression
|
|
573
1023
|
* (`isSelected || (index === 0 && !value)`) left the grid with ZERO tab
|
|
574
1024
|
* stops once the user arrowed around without a selection.
|
|
575
1025
|
*/
|
|
576
1026
|
private getRovingIndex;
|
|
1027
|
+
/** Days view: weekday header + the six week rows. */
|
|
1028
|
+
private renderDaysView;
|
|
1029
|
+
/** Months view: the 3x4 grid the month pill drills into. */
|
|
1030
|
+
private renderMonthsView;
|
|
1031
|
+
/** Years view: one 3x4 page, centred on the year in view. */
|
|
1032
|
+
private renderYearsView;
|
|
577
1033
|
render(): lit_html.TemplateResult<1>;
|
|
578
1034
|
}
|
|
579
1035
|
|
|
1036
|
+
/**
|
|
1037
|
+
* Date-range form field (Figma "Date Range Picker"): a text field with typed "from → to"
|
|
1038
|
+
* entry and a two-pane panel — quick-select presets with single-key shortcuts on the left,
|
|
1039
|
+
* a month grid on the right — committed with Apply (Reset / Cancel discard the draft).
|
|
1040
|
+
* Use rel-date-picker for a single date.
|
|
1041
|
+
* @csspart trigger - The field box that wraps the text input and the clear/calendar icons (default trigger variant only)
|
|
1042
|
+
* @csspart value - The editable text input inside the trigger
|
|
1043
|
+
* @csspart overlay - The full-screen backdrop rendered in `mode="popup"` while open
|
|
1044
|
+
* @csspart panel - The floating panel (`role="dialog"`) holding presets and calendar
|
|
1045
|
+
* @csspart list - The preset column and the day grid
|
|
1046
|
+
* @csspart option - Each quick-select preset button
|
|
1047
|
+
* @csspart action - The previous-month and next-month buttons
|
|
1048
|
+
* @csspart footer - The Reset / Cancel / Apply button row
|
|
1049
|
+
*/
|
|
580
1050
|
declare class RelRangePicker extends LitElement {
|
|
1051
|
+
/** Committed range start as an ISO `YYYY-MM-DD` string; empty string when no range is set. */
|
|
581
1052
|
from: string;
|
|
1053
|
+
/** Committed range end as an ISO `YYYY-MM-DD` string; empty string when no range is set. Always ≥ `from`. */
|
|
582
1054
|
to: string;
|
|
1055
|
+
/** Locale used to match month names in typed input; the visible trigger text and calendar labels are always `en-US` (`MM/DD/YYYY`). */
|
|
583
1056
|
locale: string;
|
|
1057
|
+
/** First column of the calendar grid: `"sun"` (default) or `"mon"`. Presets always compute weeks Sunday–Saturday. */
|
|
584
1058
|
weekStart: "mon" | "sun";
|
|
1059
|
+
/** Earliest selectable date (ISO `YYYY-MM-DD`); earlier days are disabled and typed ranges starting before it are rejected. */
|
|
585
1060
|
minDate: string;
|
|
1061
|
+
/** Latest selectable date (ISO `YYYY-MM-DD`); later days are disabled and typed ranges ending after it are rejected. */
|
|
586
1062
|
maxDate: string;
|
|
1063
|
+
/** Disables the trigger, the icons and the panel controls; the host dims to 60% opacity. */
|
|
587
1064
|
disabled: boolean;
|
|
1065
|
+
/** Whether the panel is open. Setting it directly shows/hides the panel but does not seed the draft from `from`/`to` or fire `rel-open-change` — user interaction does both. */
|
|
588
1066
|
open: boolean;
|
|
1067
|
+
/** `popover` anchors the panel below the trigger; `popup` centres it in the viewport behind a dimmed backdrop (part `overlay`). */
|
|
589
1068
|
mode: "popover" | "popup";
|
|
1069
|
+
/** CSS width applied to the host (any CSS length, e.g. `320px`); empty leaves the intrinsic width. */
|
|
590
1070
|
width: string;
|
|
1071
|
+
/** CSS `min-width` applied to the host. */
|
|
591
1072
|
minWidth: string;
|
|
1073
|
+
/** CSS `max-width` applied to the host. */
|
|
592
1074
|
maxWidth: string;
|
|
1075
|
+
/** CSS height applied to the host. */
|
|
593
1076
|
height: string;
|
|
1077
|
+
/** CSS `min-height` applied to the host. */
|
|
594
1078
|
minHeight: string;
|
|
1079
|
+
/** CSS `max-height` applied to the host. */
|
|
595
1080
|
maxHeight: string;
|
|
1081
|
+
/** Placeholder shown in the empty field; also the accessible name of the input (and of the icon trigger while no range is set). */
|
|
596
1082
|
placeholder: string;
|
|
1083
|
+
/** `default` renders the text field; `icon` renders a single calendar icon button instead (no typed entry, no clear button, parts `trigger`/`value` absent). */
|
|
597
1084
|
triggerVariant: "default" | "icon";
|
|
1085
|
+
/** Shows a clear (×) icon while a range is set; clearing fires `rel-change` with empty `from`/`to`. Only with the default trigger. */
|
|
1086
|
+
clearable: boolean;
|
|
1087
|
+
/** Stretches the host to fill its parent's width (attribute `fullwidth`),
|
|
1088
|
+
* mirroring rel-time-picker / rel-date-picker. Off by default so the
|
|
1089
|
+
* existing intrinsic-width (`inline-block`) rendering is unchanged. */
|
|
1090
|
+
fullWidth: boolean;
|
|
598
1091
|
private draftFrom;
|
|
599
1092
|
private draftTo;
|
|
600
1093
|
private draftActivePreset;
|
|
@@ -604,7 +1097,11 @@ declare class RelRangePicker extends LitElement {
|
|
|
604
1097
|
private hoverDate;
|
|
605
1098
|
/** ISO date of the cell that owns the grid's single Tab stop (roving tabindex). */
|
|
606
1099
|
private focusedDate;
|
|
607
|
-
|
|
1100
|
+
/** Uncommitted typed text; null → the input shows the committed range. */
|
|
1101
|
+
private inputText;
|
|
1102
|
+
/** Parse/range error message for the typed text (cleared on next input). */
|
|
1103
|
+
private inputError;
|
|
1104
|
+
private triggerInput?;
|
|
608
1105
|
private popoverEl?;
|
|
609
1106
|
private backdropEl?;
|
|
610
1107
|
static styles: lit.CSSResult;
|
|
@@ -622,6 +1119,31 @@ declare class RelRangePicker extends LitElement {
|
|
|
622
1119
|
private cancelPopover;
|
|
623
1120
|
private applySelection;
|
|
624
1121
|
private resetDraft;
|
|
1122
|
+
private clearRange;
|
|
1123
|
+
/**
|
|
1124
|
+
* Parse "date → date" text into an ISO from/to pair, or null. Each side
|
|
1125
|
+
* goes through rel-date-picker's parseDateInput, so ISO / numeric /
|
|
1126
|
+
* month-name dates and the t / t±N shortcuts all work per side.
|
|
1127
|
+
* Separators: "→", "..", spaced "-", or the word "to" ("t - t+7",
|
|
1128
|
+
* "21/7 to 28/7"). A single date yields a one-day range. Reversed input
|
|
1129
|
+
* is normalized (from ≤ to). dayFirst is hard-coded false because the
|
|
1130
|
+
* displayed format is always MM/DD/YYYY.
|
|
1131
|
+
*/
|
|
1132
|
+
private parseRangeText;
|
|
1133
|
+
/**
|
|
1134
|
+
* Parse and commit the typed text (Enter / blur). Invalid or out-of-range
|
|
1135
|
+
* text keeps the field in an error state with the text preserved for
|
|
1136
|
+
* correction; the committed range is untouched (Escape reverts the text).
|
|
1137
|
+
*/
|
|
1138
|
+
private commitTypedValue;
|
|
1139
|
+
private handleInputInput;
|
|
1140
|
+
private handleInputKeydown;
|
|
1141
|
+
/** Clicking anywhere on the field opens the panel (never closes). */
|
|
1142
|
+
private handleFieldClick;
|
|
1143
|
+
/** The calendar icon toggles the panel (previous trigger behavior). */
|
|
1144
|
+
private handleIconClick;
|
|
1145
|
+
/** Commit typed text when focus leaves the component entirely. */
|
|
1146
|
+
private handleInputBlur;
|
|
625
1147
|
private getTriggerLabel;
|
|
626
1148
|
/** Formatted "MM/DD/YYYY → MM/DD/YYYY" (or single date / "") for the current committed `from`/`to`. */
|
|
627
1149
|
get displayLabel(): string;
|
|
@@ -635,6 +1157,8 @@ declare class RelRangePicker extends LitElement {
|
|
|
635
1157
|
private previousMonth;
|
|
636
1158
|
private nextMonth;
|
|
637
1159
|
private getMonthName;
|
|
1160
|
+
private dayLabelFormatter;
|
|
1161
|
+
private formatDayLabel;
|
|
638
1162
|
private getWeekdayLabels;
|
|
639
1163
|
private getCalendarDays;
|
|
640
1164
|
private handleDayClick;
|
|
@@ -659,22 +1183,38 @@ type ChipTone = "neutral" | "danger" | "warning" | "success" | "info";
|
|
|
659
1183
|
type ChipVariant = "fill" | "subtle";
|
|
660
1184
|
type ChipSize = "sm" | "md" | "lg";
|
|
661
1185
|
type ChipBorder = "default" | "rounded";
|
|
1186
|
+
/**
|
|
1187
|
+
* Compact chip (Figma "Chip") for tags, filters and selected values: tone x variant
|
|
1188
|
+
* colouring, optional leading icon / avatar / trailing icon, a remove control and
|
|
1189
|
+
* opt-in drag-and-drop.
|
|
1190
|
+
* @csspart base - The chip body (`.chip`) that carries size, tone, variant and border styling
|
|
1191
|
+
* @csspart icon - The leading `<rel-icon>` (rendered only when `leading-icon` is set and no avatar)
|
|
1192
|
+
* @csspart label - The label text
|
|
1193
|
+
* @cssprop --rel-chip-focus-ring - Colour of the keyboard focus outline; default `var(--rel-border-focus)`
|
|
1194
|
+
*/
|
|
662
1195
|
declare class RelChip extends LitElement {
|
|
663
1196
|
static shadowRootOptions: ShadowRootInit;
|
|
1197
|
+
/** Text shown in the chip; also its accessible name and the drag payload. */
|
|
664
1198
|
label: string;
|
|
1199
|
+
/** Colour tone (Figma Tone): `neutral`, `danger`, `warning`, `success` or `info`. Combined with `variant`. */
|
|
665
1200
|
tone: ChipTone;
|
|
1201
|
+
/** Emphasis (Figma Variant): `fill` = solid tone background, `subtle` = tinted background with tone-coloured text. */
|
|
666
1202
|
variant: ChipVariant;
|
|
1203
|
+
/** Height scale (Figma Size): `sm` 24px / body-sm, `md` 28px / body-md, `lg` 32px / body-lg. Icon size follows (12 / 14 / 16px). */
|
|
667
1204
|
size: ChipSize;
|
|
1205
|
+
/** Corner shape (Figma Border): `default` = 4px radius, `rounded` = fully rounded with 12px horizontal padding. */
|
|
668
1206
|
border: ChipBorder;
|
|
669
|
-
/** Icon name from the generated icon dictionary (e.g. "settings") — rendered via <rel-icon
|
|
1207
|
+
/** Icon name from the generated icon dictionary (e.g. "settings") — rendered via <rel-icon> before the label. Ignored when `avatar` is set. */
|
|
670
1208
|
leadingIcon?: string;
|
|
1209
|
+
/** Icon name from the generated icon dictionary, rendered after the label. */
|
|
671
1210
|
trailingIcon?: string;
|
|
672
|
-
/** Initials text for the avatar (e.g. "JD"). Mutually exclusive with leadingIcon. */
|
|
1211
|
+
/** Initials text for the avatar (e.g. "JD"), rendered as a `<rel-avatar type="text">` before the label. Mutually exclusive with leadingIcon (avatar wins). */
|
|
673
1212
|
avatar?: string;
|
|
1213
|
+
/** Shows a remove (close) button after the label; clicking it sets `removed` and fires `removed`. */
|
|
674
1214
|
removable: boolean;
|
|
675
|
-
/**
|
|
1215
|
+
/** `true` once the chip has been removed — the host is hidden via `:host([removed])`. Reflected so CSS and Angular can see it; reset to `false` to show the chip again. */
|
|
676
1216
|
removed: boolean;
|
|
677
|
-
/** Opt-in native drag-and-drop
|
|
1217
|
+
/** Opt-in native drag-and-drop: sets `draggable="true"` on the host, shows the Figma "Dragged" state during a real drag gesture, and makes Left/Right arrow keys fire `chip-move`. */
|
|
678
1218
|
draggableChip: boolean;
|
|
679
1219
|
/** Reflected so CSS can target the Figma "Dragged" visual state. Driven automatically by dragstart/dragend when draggableChip is set. */
|
|
680
1220
|
private dragging;
|
|
@@ -698,16 +1238,42 @@ declare global {
|
|
|
698
1238
|
}
|
|
699
1239
|
}
|
|
700
1240
|
|
|
1241
|
+
/** Canonical surface names (audit 12). */
|
|
1242
|
+
type ContainerSurface = "default" | "elevated" | "transparent";
|
|
1243
|
+
/** @deprecated since 1.4.7 — use `ContainerSurface` / the `surface` prop. */
|
|
1244
|
+
type ContainerBackground = "light" | "white" | "none";
|
|
1245
|
+
/**
|
|
1246
|
+
* Padded surface block (Figma "Container"): a full-width wrapper with a surface fill, a padding step and an optional shadow, used to group a section of content.
|
|
1247
|
+
* @slot - Section content; slotted `h1`–`h4` get the headings-sm role and `p` the body-md role
|
|
1248
|
+
* @csspart base - The padded surface `<div>` (same element as `container`)
|
|
1249
|
+
* @csspart container - Alias of `base`, kept for existing `::part(container)` selectors
|
|
1250
|
+
*/
|
|
701
1251
|
declare class RelContainer extends LitElement {
|
|
1252
|
+
/** Inner padding step: `sm` = spacing-xs, `md` = spacing-md, `lg` = spacing-xl, `xl` = spacing-2xl. */
|
|
702
1253
|
padding: "sm" | "md" | "lg" | "xl";
|
|
1254
|
+
/** Adds the shadow-300 elevation box-shadow to the surface. */
|
|
703
1255
|
shadow: boolean;
|
|
704
|
-
|
|
1256
|
+
/**
|
|
1257
|
+
* Surface fill: default (page surface) | elevated (raised surface) |
|
|
1258
|
+
* transparent. Takes precedence over the deprecated `background` prop.
|
|
1259
|
+
*/
|
|
1260
|
+
surface?: ContainerSurface;
|
|
1261
|
+
/** @deprecated Deprecated since 1.4.7 — use `surface` (white→default, light→elevated, none→transparent). */
|
|
1262
|
+
background?: ContainerBackground;
|
|
1263
|
+
/** Resolved surface: explicit `surface` wins, else mapped `background`, else "default". */
|
|
1264
|
+
get resolvedSurface(): ContainerSurface;
|
|
1265
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
705
1266
|
static styles: lit.CSSResult;
|
|
706
1267
|
private get classes();
|
|
707
1268
|
render(): lit_html.TemplateResult<1>;
|
|
708
1269
|
}
|
|
709
1270
|
|
|
1271
|
+
/**
|
|
1272
|
+
* Thin separator rule that splits content horizontally or vertically. Use it between sections, list groups or toolbar clusters; do not use it as a spacer.
|
|
1273
|
+
* @csspart base - The rendered rule (`role="separator"` div) — restyle thickness, colour or margin here.
|
|
1274
|
+
*/
|
|
710
1275
|
declare class RelDivider extends LitElement {
|
|
1276
|
+
/** Axis of the rule: `horizontal` spans the full width with vertical margin; `vertical` is a full-height line with horizontal margin (the parent needs a defined height or a flex row). Mirrored to `aria-orientation` on the host. */
|
|
711
1277
|
orientation: "horizontal" | "vertical";
|
|
712
1278
|
static styles: lit.CSSResult;
|
|
713
1279
|
connectedCallback(): void;
|
|
@@ -715,6 +1281,11 @@ declare class RelDivider extends LitElement {
|
|
|
715
1281
|
render(): lit_html.TemplateResult<1>;
|
|
716
1282
|
}
|
|
717
1283
|
|
|
1284
|
+
/**
|
|
1285
|
+
* Layout helper used by `<rel-drawer>` for its footer: a right-aligned flex
|
|
1286
|
+
* row with an 8px gap. Can also be used standalone for a matching actions row.
|
|
1287
|
+
* @slot - Footer actions (typically `<rel-button>`s)
|
|
1288
|
+
*/
|
|
718
1289
|
declare class RelDrawerFooter extends LitElement {
|
|
719
1290
|
static styles: lit.CSSResult;
|
|
720
1291
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -727,19 +1298,51 @@ declare global {
|
|
|
727
1298
|
|
|
728
1299
|
type DrawerSide = "bottom" | "left" | "right";
|
|
729
1300
|
type DrawerCloseReason = "backdrop" | "escape" | "drag" | "programmatic";
|
|
1301
|
+
/**
|
|
1302
|
+
* Edge-anchored drawer (Figma "Drawer", 5699:6844): a panel that slides in
|
|
1303
|
+
* from the bottom, left or right over a scrim, with an optional drag handle
|
|
1304
|
+
* (bottom only), a title/description header, a scrollable body and a footer.
|
|
1305
|
+
* @slot - Body content of the drawer
|
|
1306
|
+
* @slot footer - Actions row; rendered inside a `<rel-drawer-footer>` (right-aligned, 8px gap)
|
|
1307
|
+
* @csspart overlay - The full-viewport scrim behind the panel
|
|
1308
|
+
* @csspart panel - The sliding panel (role="dialog")
|
|
1309
|
+
* @csspart handle - The drag-to-close grab bar (bottom drawers only)
|
|
1310
|
+
* @csspart header - Header block holding title, description and close button
|
|
1311
|
+
* @csspart close-button - The "X" close button
|
|
1312
|
+
* @csspart content - Scrollable body wrapper around the default slot
|
|
1313
|
+
* @csspart footer - Footer wrapper around the `footer` slot
|
|
1314
|
+
* @cssprop --rel-drawer-width - Panel width. Default `clamp(640px, 66vw, 952px)` for `side="bottom"`, `clamp(280px, 24vw, 420px)` for left/right. The `width` prop sets this on the panel and wins over a host value
|
|
1315
|
+
* @cssprop --rel-drawer-height - Panel height for `side="bottom"`; default `clamp(360px, 49vh, 600px)`. Left/right drawers are always full height
|
|
1316
|
+
* @cssprop --rel-drawer-transition-duration - Slide/scrim animation duration; default `0.3s`
|
|
1317
|
+
* @cssprop --rel-drawer-transition-timing - Slide/scrim animation easing; default `cubic-bezier(0.32, 0.72, 0, 1)`
|
|
1318
|
+
* @cssprop --rel-drawer-scrim-opacity - Opacity of the scrim while open; default `1`
|
|
1319
|
+
*/
|
|
730
1320
|
declare class RelDrawer extends LitElement {
|
|
1321
|
+
/** Whether the drawer is shown. Toggle it to open/close; every change fires `rel-open-change`. */
|
|
731
1322
|
open: boolean;
|
|
1323
|
+
/** Edge the panel slides in from. `bottom` is centred horizontally and supports the drag handle; `left`/`right` are full-height side panels. */
|
|
732
1324
|
side: DrawerSide;
|
|
1325
|
+
/** When false the close button is hidden and backdrop clicks / Escape are ignored (drag-to-close still works). */
|
|
733
1326
|
dismissible: boolean;
|
|
1327
|
+
/** Modal mode: renders the scrim, sets `role="dialog"` + `aria-modal`, traps Tab inside the panel and moves focus in on open. When false the panel is a `region` with no scrim and no focus trap. */
|
|
734
1328
|
modal: boolean;
|
|
1329
|
+
/** Close when the scrim is clicked. Only effective while `dismissible` is true. */
|
|
735
1330
|
closeOnBackdrop: boolean;
|
|
1331
|
+
/** Close on the Escape key. Only effective while `dismissible` is true. */
|
|
736
1332
|
closeOnEscape: boolean;
|
|
1333
|
+
/** Show the grab bar above the header. Only rendered when `side="bottom"` and `draggable` is true. */
|
|
737
1334
|
showHandle: boolean;
|
|
1335
|
+
/** Enable drag-to-close on the handle (pointer or touch). Bottom drawers only. */
|
|
738
1336
|
draggable: boolean;
|
|
1337
|
+
/** Fraction (0–1) of the panel height the user must drag down before release closes the drawer; shorter drags snap back. */
|
|
739
1338
|
snapThreshold: number;
|
|
1339
|
+
/** Written to the panel as the `--drawer-max-height` custom property (any CSS length). No built-in rule reads it yet; use `--rel-drawer-height` to size a bottom drawer. */
|
|
740
1340
|
maxHeight: string;
|
|
1341
|
+
/** Explicit panel width (any CSS length). Empty by default, which uses the per-side `--rel-drawer-width` default. */
|
|
741
1342
|
width: string;
|
|
1343
|
+
/** Heading text (rendered as an `<h2>`, linked via `aria-labelledby`). */
|
|
742
1344
|
title: string;
|
|
1345
|
+
/** Supporting text under the title (linked via `aria-describedby`). */
|
|
743
1346
|
description: string;
|
|
744
1347
|
private isDragging;
|
|
745
1348
|
private dragOffset;
|
|
@@ -776,11 +1379,31 @@ declare global {
|
|
|
776
1379
|
}
|
|
777
1380
|
}
|
|
778
1381
|
|
|
1382
|
+
/**
|
|
1383
|
+
* Key-cap scale (Figma Kbd 6316:284): S 20 / M 24 / L 28px tall with
|
|
1384
|
+
* label-sm / label-md / label-lg type. `sm` / `md` / `lg` are the original
|
|
1385
|
+
* names; the full words are accepted as aliases (Trello 4).
|
|
1386
|
+
*/
|
|
1387
|
+
type KbdSize = "sm" | "md" | "lg" | "small" | "medium" | "large";
|
|
1388
|
+
/**
|
|
1389
|
+
* Single key cap (Figma "Kbd", 6316:284) for showing a keyboard key or shortcut
|
|
1390
|
+
* inline with text; the key label is the slotted content.
|
|
1391
|
+
* @slot - The key label (e.g. `Ctrl`, `K`, `⌘`)
|
|
1392
|
+
*/
|
|
779
1393
|
declare class RelKbd extends LitElement {
|
|
780
|
-
|
|
1394
|
+
/** Key-cap scale (Figma Size): `small` 20px tall / label-sm, `medium` 24px / label-md, `large` 28px / label-lg; 4px radius at every size. `sm` / `md` / `lg` are the legacy short spellings and stay accepted. */
|
|
1395
|
+
size: KbdSize;
|
|
1396
|
+
/** Fill / text contrast: `default` = elevated-1 background with label text; `muted` = elevated-2 background with placeholder-tone text for secondary shortcuts. Both are flat with a 1px border. */
|
|
781
1397
|
variant: "default" | "muted";
|
|
1398
|
+
/**
|
|
1399
|
+
* Fully rounded corners. Logs a one-time console notice when set.
|
|
1400
|
+
* @deprecated The Kbd spec has a single 4px radius at every size (audit
|
|
1401
|
+
* 16); `pill` is kept working as an alias but logs a one-time notice.
|
|
1402
|
+
*/
|
|
782
1403
|
pill: boolean;
|
|
1404
|
+
/** Pressed look: border-strong stroke, 1px downward nudge and (muted variant) a darker fill. */
|
|
783
1405
|
inset: boolean;
|
|
1406
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
784
1407
|
static styles: lit.CSSResult;
|
|
785
1408
|
render(): lit_html.TemplateResult<1>;
|
|
786
1409
|
}
|
|
@@ -789,11 +1412,17 @@ declare class RelKbd extends LitElement {
|
|
|
789
1412
|
* entry in `items` with "+" separators between them. Slotted <rel-kbd>
|
|
790
1413
|
* children may be used instead of the items array.
|
|
791
1414
|
*
|
|
792
|
-
* <rel-kbd-group .items=${["Ctrl", "Shift", "P"]} size="
|
|
1415
|
+
* <rel-kbd-group .items=${["Ctrl", "Shift", "P"]} size="medium"></rel-kbd-group>
|
|
1416
|
+
* @slot - Extra content rendered after the generated keys (e.g. hand-written `<rel-kbd>` children)
|
|
1417
|
+
* @csspart item - Each generated `<rel-kbd>` key cap
|
|
1418
|
+
* @csspart label - The `+` separator between generated keys
|
|
793
1419
|
*/
|
|
794
1420
|
declare class RelKbdGroup extends LitElement {
|
|
1421
|
+
/** Key labels to render, one `<rel-kbd>` each, joined by `+` separators. Set as a property or as a JSON array attribute (`items='["Ctrl","K"]'`). */
|
|
795
1422
|
items: string[];
|
|
796
|
-
|
|
1423
|
+
/** Passed through to every generated <rel-kbd>: `small` / `medium` / `large` (legacy `sm` / `md` / `lg` still accepted). */
|
|
1424
|
+
size: KbdSize;
|
|
1425
|
+
/** Passed through to every generated <rel-kbd>: `default` or `muted`. */
|
|
797
1426
|
variant: "default" | "muted";
|
|
798
1427
|
static styles: lit.CSSResult;
|
|
799
1428
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -820,19 +1449,31 @@ interface Step {
|
|
|
820
1449
|
title: string;
|
|
821
1450
|
status: StepStatus;
|
|
822
1451
|
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Multi-step progress indicator (Figma "Stepper"): renders one focusable step per entry in `steps` — a circular indicator (number, check, dot or icon per `type`), a label and a connector line to the next step — in a row or a column.
|
|
1454
|
+
* @csspart indicator - The 24px circle (8px for `type="dot"`) that holds the step number, check mark or icon.
|
|
1455
|
+
* @csspart track - The 1px connector line from a step to the next one (not rendered on the last step).
|
|
1456
|
+
* @csspart label - The step title text.
|
|
1457
|
+
* @cssprop --rel-stepper-indicator-size - Indicator diameter (default 24px; `type="dot"` is fixed at 8px).
|
|
1458
|
+
* @cssprop --rel-stepper-connector-length-lg - Connector length and step gap for `size="large"` in both orientations (default 86px).
|
|
1459
|
+
* @cssprop --rel-stepper-connector-length-md - Connector length and step gap for `size="small"` in `orientation="horizontal"` (default 60px).
|
|
1460
|
+
* @cssprop --rel-stepper-connector-length-sm - Connector length and step gap for `size="small"` in `orientation="vertical"` (default 42px).
|
|
1461
|
+
*/
|
|
823
1462
|
declare class RelStepper extends LitElement {
|
|
1463
|
+
/** The steps in order, each `{ title: string; status: "done" | "progress" | "disabled" }`. Set as a property (or a JSON array attribute); the component never mutates it — update it from the `rel-step-change` handler. */
|
|
824
1464
|
steps: Step[];
|
|
1465
|
+
/**
|
|
1466
|
+
* Legacy label placement (attribute `textalign`): `below` (default) puts the label under the indicator, `right` puts it beside the indicator. Ignored whenever `label-placement` is set.
|
|
1467
|
+
* @deprecated Deprecated alias of `label-placement`; use `label-placement="inverted"` instead of `textalign="below"` and `label-placement="centered"` instead of `textalign="right"`.
|
|
1468
|
+
*/
|
|
825
1469
|
textAlign: TextAlign;
|
|
1470
|
+
/** Layout axis: `horizontal` (default) lays the steps out in a centred row; `vertical` stacks them. */
|
|
826
1471
|
orientation: Orientation;
|
|
1472
|
+
/** `large` (default) or `small`: controls the label type (body-md vs body-sm) and the connector length / step gap (see the `--rel-stepper-connector-length-*` hooks). */
|
|
827
1473
|
size: StepperSize;
|
|
1474
|
+
/** Figma "Type" axis — what the indicator shows: `default` (step number, check mark once done), `dot` (8px dot, no glyph), `number` (always the number) or `icon` (always the check mark). */
|
|
828
1475
|
type: StepperType;
|
|
829
|
-
/**
|
|
830
|
-
* Figma Typel axis: top = label top-aligned beside the indicator,
|
|
831
|
-
* centered = label vertically centered beside it, inverted = indicator above
|
|
832
|
-
* the label. When unset, the legacy textAlign prop drives the layout
|
|
833
|
-
* (below ≈ inverted, right ≈ centered). Note Figma marks Top+Horizontal
|
|
834
|
-
* as an unsupported combination.
|
|
835
|
-
*/
|
|
1476
|
+
/** Figma "Typel" axis — where the label sits: `top` (top-aligned beside the indicator), `centered` (vertically centred beside it) or `inverted` (indicator above the label). When unset, the deprecated `textAlign` prop drives the layout (`below` ≈ `inverted`, `right` ≈ `centered`). Figma marks Top + Horizontal as an unsupported combination. */
|
|
836
1477
|
labelPlacement?: LabelPlacement;
|
|
837
1478
|
static styles: lit.CSSResult;
|
|
838
1479
|
private isDone;
|
|
@@ -850,35 +1491,92 @@ interface RadioOption {
|
|
|
850
1491
|
label: string;
|
|
851
1492
|
supportingText?: string;
|
|
852
1493
|
disabled?: boolean;
|
|
1494
|
+
/** rel-icon name rendered before the label (Figma Has Icon/Avatar, Type=Icon). */
|
|
1495
|
+
icon?: string;
|
|
1496
|
+
/** 1–2 initials rendered as a circular chip before the label (Type=Avatar).
|
|
1497
|
+
* Ignored when `icon` is also set. */
|
|
1498
|
+
avatar?: string;
|
|
853
1499
|
}
|
|
1500
|
+
type RadioSize = "small" | "medium" | "large";
|
|
1501
|
+
type RadioDensity = "compact" | "comfortable";
|
|
1502
|
+
type RadioAlignment = "leading" | "trailing";
|
|
1503
|
+
/**
|
|
1504
|
+
* Single-select radio group (Figma "Radio"): renders one native radio input per
|
|
1505
|
+
* entry in `options`, with optional supporting text, icon or avatar prefix.
|
|
1506
|
+
* @csspart base - The `role="radiogroup"` container that lays out the options
|
|
1507
|
+
* @csspart label - The visible label text of each option
|
|
1508
|
+
*/
|
|
854
1509
|
declare class RelRadio extends LitElement {
|
|
1510
|
+
/** The options to render, in order. Each entry is a `RadioOption` (`value`, `label`,
|
|
1511
|
+
* optional `supportingText`, `disabled`, `icon` or `avatar`). Set as a property
|
|
1512
|
+
* (`.options=`) or as a JSON attribute. */
|
|
855
1513
|
options: RadioOption[];
|
|
1514
|
+
/** `name` given to every native radio input inside this element. It scopes native
|
|
1515
|
+
* radio-group behaviour (arrow-key movement, mutual exclusion) to this group, so give
|
|
1516
|
+
* each group on a page a distinct name. */
|
|
856
1517
|
name: string;
|
|
857
1518
|
/** Layout axis of the option list. `"vertical"` (default) stacks options in
|
|
858
1519
|
* a column; `"horizontal"` lays them out in a wrapping row. */
|
|
859
1520
|
orientation: Orientation;
|
|
860
|
-
/** Control scale. `"medium"` (default) = 20px
|
|
861
|
-
* `"
|
|
862
|
-
|
|
1521
|
+
/** Control scale (Figma Size). `"medium"` (default, Figma M) = 20px control
|
|
1522
|
+
* with body-lg labels; `"large"` (Figma L) = 24px control with body-xl
|
|
1523
|
+
* labels; `"small"` (Figma S) = 20px control with body-md labels — S and M
|
|
1524
|
+
* share the control size in the spec, only typography steps down. */
|
|
1525
|
+
size: RadioSize;
|
|
1526
|
+
/** Supporting-text layout (Figma Density). `"compact"` (default) puts the
|
|
1527
|
+
* supporting text on its own line under the row, indented past the control;
|
|
1528
|
+
* `"comfortable"` stacks label + supporting text beside the control. */
|
|
1529
|
+
density: RadioDensity;
|
|
1530
|
+
/** Control position (Figma Layout). `"leading"` (default) renders the
|
|
1531
|
+
* control before the label; `"trailing"` pushes it to the far edge of the
|
|
1532
|
+
* row. Trailing has no compact layout in the spec, so it always renders
|
|
1533
|
+
* with comfortable density. Meant for vertical orientation — trailing
|
|
1534
|
+
* options stretch to the group's full width. */
|
|
1535
|
+
alignment: RadioAlignment;
|
|
1536
|
+
/** `value` of the currently selected option, or `null` when nothing is selected.
|
|
1537
|
+
* Set it to preselect an option; it is updated on every user selection. */
|
|
863
1538
|
selectedValue: string | null;
|
|
1539
|
+
/** Disables every option (Figma State=Disabled: the whole group at 40% opacity).
|
|
1540
|
+
* Individual options can also be disabled via `RadioOption.disabled`. */
|
|
864
1541
|
disabled: boolean;
|
|
1542
|
+
/** Error state (Figma State=Error): rings, dots and supporting text turn danger.
|
|
1543
|
+
* Applies to every option while nothing is selected, and only to the selected
|
|
1544
|
+
* option once a choice is made. Selection is still allowed. */
|
|
865
1545
|
error: boolean;
|
|
1546
|
+
/** Message rendered under the group (live region) while `error` is set; hidden
|
|
1547
|
+
* when `error` is false or the text is empty. */
|
|
866
1548
|
errorMessage: string;
|
|
1549
|
+
/** Accessible name for the radiogroup (it renders no visible group label). */
|
|
1550
|
+
fieldAriaLabel?: string;
|
|
1551
|
+
/** Value reported to the Angular forms bridge (`registerOnChange` callback) on each
|
|
1552
|
+
* change and compared by `writeValue`. Not used for rendering; read `selectedValue`
|
|
1553
|
+
* or the `rel-change` detail for the selected option. */
|
|
867
1554
|
value: string;
|
|
1555
|
+
/** Set by the Angular forms bridge (`writeValue`) to whether the written form value
|
|
1556
|
+
* equals `value`. Not used for rendering — read `selectedValue` for the selection. */
|
|
868
1557
|
checked: boolean;
|
|
869
1558
|
private _onChange;
|
|
870
1559
|
private _onTouched;
|
|
871
1560
|
static styles: lit.CSSResult;
|
|
1561
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
1562
|
+
/** Trailing has no compact layout in the spec — trailing wins. */
|
|
1563
|
+
private get effectiveDensity();
|
|
872
1564
|
private onChange;
|
|
1565
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
873
1566
|
registerOnChange(fn: (value: string) => void): void;
|
|
1567
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
874
1568
|
registerOnTouched(fn: () => void): void;
|
|
1569
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
875
1570
|
writeValue(value: string): void;
|
|
876
1571
|
private get hasSelection();
|
|
1572
|
+
private renderPrefix;
|
|
877
1573
|
private renderOption;
|
|
878
1574
|
render(): lit_html.TemplateResult<1>;
|
|
879
1575
|
}
|
|
880
1576
|
|
|
881
1577
|
type MenuType = "default" | "checkbox" | "arrow" | "select-option" | "fixed" | "fit";
|
|
1578
|
+
/** Figma ".Menu Item" Size: large (48px rows) | medium (40px) | small (32px). */
|
|
1579
|
+
type MenuSize = "large" | "medium" | "small";
|
|
882
1580
|
interface MenuItem {
|
|
883
1581
|
label: string;
|
|
884
1582
|
active?: boolean;
|
|
@@ -887,16 +1585,46 @@ interface MenuItem {
|
|
|
887
1585
|
submenu?: MenuItem[];
|
|
888
1586
|
open?: boolean;
|
|
889
1587
|
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Declarative menu-item placeholder. It renders nothing and `<rel-menu>` does not
|
|
1590
|
+
* currently read slotted children — menus are built from the `items` property.
|
|
1591
|
+
* Registered so markup can carry item metadata for future declarative support.
|
|
1592
|
+
*/
|
|
890
1593
|
declare class RelMenuItem extends LitElement {
|
|
1594
|
+
/** Display text of the item. */
|
|
891
1595
|
label: string;
|
|
1596
|
+
/** Value that identifies the item (not used by `rel-menu` today). */
|
|
892
1597
|
value: string;
|
|
1598
|
+
/** Marks the item as non-interactive. */
|
|
893
1599
|
disabled: boolean;
|
|
1600
|
+
/** `rel-icon` name to render before the label (not used by `rel-menu` today). */
|
|
894
1601
|
icon: string;
|
|
895
1602
|
createRenderRoot(): this;
|
|
896
1603
|
render(): lit_html.TemplateResult<1>;
|
|
897
1604
|
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Light-DOM menu (Figma "Menu", 6326:2931) driven by the `items` array: single-select
|
|
1607
|
+
* rows, checkbox rows, radio-style select-option rows, or hover/keyboard submenus.
|
|
1608
|
+
* @csspart list - The `role="menu"` root list (a light-DOM `[part="list"]` attribute)
|
|
1609
|
+
* @csspart panel - A submenu flyout (`type="arrow"` only; light-DOM `[part="panel"]` attribute)
|
|
1610
|
+
* @cssprop --rel-menu-width - Width of the menu when `type="fixed"`; default 300px
|
|
1611
|
+
*/
|
|
898
1612
|
declare class RelMenu extends LitElement {
|
|
1613
|
+
/** Menu behaviour / width mode (Figma Type). `default` = single-select rows
|
|
1614
|
+
* (`rel-select`); `checkbox` = toggling rows with a checkbox (`rel-check`);
|
|
1615
|
+
* `select-option` = single-select rows with a radio control; `arrow` = rows whose
|
|
1616
|
+
* `submenu` opens a flyout (`rel-submenu-select`); `fixed` / `fit` behave like
|
|
1617
|
+
* `default` but size the menu to `--rel-menu-width` (300px) or to its content. */
|
|
899
1618
|
type: MenuType;
|
|
1619
|
+
/**
|
|
1620
|
+
* Row size (Figma ".Menu Item" Size, 6326:616): large = 48px rows with
|
|
1621
|
+
* body-lg labels (Figma default), medium = 40px / body-md, small = 32px /
|
|
1622
|
+
* body-sm. Added in 1.4.7; before that rows were a fixed 36px.
|
|
1623
|
+
*/
|
|
1624
|
+
size: MenuSize;
|
|
1625
|
+
/** The rows to render, in order. Each entry is a `MenuItem` (`label`, optional
|
|
1626
|
+
* `active`, `checked`, `disabled`, `submenu`, `open`). The array is copied on
|
|
1627
|
+
* assignment, so mutate and reassign it to update the menu. */
|
|
900
1628
|
items: MenuItem[];
|
|
901
1629
|
private focusedIndex;
|
|
902
1630
|
/** Index inside the open submenu that virtual focus sits on; -1 = main list. */
|
|
@@ -904,7 +1632,7 @@ declare class RelMenu extends LitElement {
|
|
|
904
1632
|
private _items;
|
|
905
1633
|
/** Stable id prefix for aria-activedescendant targets. */
|
|
906
1634
|
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-
|
|
1635
|
+
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 /* Audit 17: 8px (border-radius/sm), was 16px; Figma Menu (6326:2931) = shadow/md */\n border-radius: var(--rel-border-radius-sm);\n box-shadow: var(--rel-shadows-md);\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 /* Rows follow Figma \".Menu Item\" (6326:616) per size:\n Large 48px = pad 12/12 + body-lg (24 line-height)\n Medium 40px = pad 8/12 + body-md (22)\n Small 32px = pad 4/8 + body-sm (20)\n (audit 17a \u2014 before 1.4.7 every row was 36px: pad 8/12 + a 20px line-height) */\n .rel-menu-item {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--rel-spacing-md);\n padding: var(--rel-spacing-sm) var(--rel-spacing-sm);\n line-height: var(--rel-body-lg-regular-line-height);\n min-height: 48px;\n cursor: pointer;\n transition: background 0.15s ease, color 0.15s ease;\n user-select: none;\n box-sizing: border-box;\n }\n\n /* Light-DOM component: :host never matches here, so size rules key off the\n reflected attribute on the <rel-menu> element itself. */\n rel-menu[size=\"medium\"] .rel-menu,\n rel-menu[size=\"medium\"] .rel-submenu {\n font-family: var(--rel-body-md-regular-font-family);\n font-weight: var(--rel-body-md-regular-font-weight);\n font-size: var(--rel-body-md-regular-font-size);\n line-height: var(--rel-body-md-regular-line-height);\n letter-spacing: var(--rel-body-md-regular-letter-spacing);\n }\n\n /* Figma Medium / Small frames are fixed at 40 / 32 (content sums to 38 / 28) */\n rel-menu[size=\"medium\"] .rel-menu-item {\n padding: var(--rel-spacing-xs) var(--rel-spacing-sm);\n line-height: var(--rel-body-md-regular-line-height);\n min-height: 40px;\n }\n\n rel-menu[size=\"small\"] .rel-menu,\n rel-menu[size=\"small\"] .rel-submenu {\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 rel-menu[size=\"small\"] .rel-menu-item {\n padding: var(--rel-spacing-2xs) var(--rel-spacing-xs);\n line-height: var(--rel-body-sm-regular-line-height);\n min-height: 32px;\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-sm);\n border-top-right-radius: var(--rel-border-radius-sm);\n }\n\n .rel-menu > .rel-menu-item:last-child {\n border-bottom-left-radius: var(--rel-border-radius-sm);\n border-bottom-right-radius: var(--rel-border-radius-sm);\n }\n\n /* Figma states (6326:616): Hover = action overlay 0.05, Pressed = 0.10\n (nearest token: overlay-pressed), Active/selected list row = the hover\n overlay + medium label; Checkbox / Select Option rows keep no fill when\n selected. Disabled = 40% opacity. (audit 17) */\n .rel-menu-item:hover {\n background: var(--rel-action-overlay-hover);\n }\n\n .rel-menu-item:active {\n background: var(--rel-action-overlay-pressed);\n }\n\n .rel-menu-item.active {\n background: var(--rel-action-overlay-hover);\n font-weight: var(--rel-body-lg-medium-font-weight);\n }\n\n .rel-menu.type-checkbox .rel-menu-item.active,\n .rel-menu.type-select-option .rel-menu-item.active {\n background: transparent;\n }\n\n .rel-menu.type-checkbox .rel-menu-item.active:hover,\n .rel-menu.type-select-option .rel-menu-item.active:hover {\n background: var(--rel-action-overlay-hover);\n }\n\n .rel-menu-item.disabled {\n background-color: transparent;\n opacity: 0.4;\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-sm);\n box-shadow: var(--rel-shadows-md);\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-sm) var(--rel-spacing-sm);\n }\n\n rel-menu[size=\"medium\"] .rel-submenu .rel-menu-item {\n padding: var(--rel-spacing-xs) var(--rel-spacing-sm);\n }\n\n rel-menu[size=\"small\"] .rel-submenu .rel-menu-item {\n padding: var(--rel-spacing-2xs) var(--rel-spacing-xs);\n }\n ";
|
|
908
1636
|
createRenderRoot(): this;
|
|
909
1637
|
connectedCallback(): void;
|
|
910
1638
|
disconnectedCallback(): void;
|
|
@@ -925,14 +1653,22 @@ declare class RelMenu extends LitElement {
|
|
|
925
1653
|
render(): lit_html.TemplateResult<1>;
|
|
926
1654
|
}
|
|
927
1655
|
|
|
1656
|
+
/** Figma "Menu Bar" Type (8699:4): `fit` hugs the triggers, `fixed` spans the container. */
|
|
1657
|
+
type MenubarType = "fixed" | "fit";
|
|
1658
|
+
/**
|
|
1659
|
+
* Horizontal application menubar (`role="menubar"`) that turns each child `<rel-menubar-menu>` into a trigger button with a dropdown panel of items, separators, submenus, checkbox items and radio groups; renders into light DOM (no slots or parts).
|
|
1660
|
+
* @cssprop --rel-menubar-width - Width of the bar when `type="fixed"`; default 100%
|
|
1661
|
+
* @cssprop --rel-menubar-panel-width - Width of the dropdown and submenu panels; default 300px
|
|
1662
|
+
*/
|
|
928
1663
|
declare class RelMenubar extends LitElement {
|
|
929
1664
|
/**
|
|
930
|
-
* Opt-in: actually
|
|
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.
|
|
1665
|
+
* Opt-in: actually bind the keys declared via `data-shortcut` on items (e.g. `data-shortcut="Ctrl+Z"`) instead of only displaying them; a "Mod" token means Cmd on Apple platforms and Ctrl elsewhere, and keystrokes that originate in inputs, textareas or contenteditable regions are ignored.
|
|
934
1666
|
*/
|
|
935
1667
|
bindShortcuts: boolean;
|
|
1668
|
+
/**
|
|
1669
|
+
* Width mode (Figma "Menu Bar" Type, 8699:4): `fit` sizes the bar to its triggers, `fixed` stretches it across its container (override the stretched width with `--rel-menubar-width`). Added in 1.4.8; the default stays `fit`, which is how the bar has always rendered.
|
|
1670
|
+
*/
|
|
1671
|
+
type: MenubarType;
|
|
936
1672
|
private menus;
|
|
937
1673
|
private openMenuIndex;
|
|
938
1674
|
private focusedTriggerIndex;
|
|
@@ -945,7 +1681,7 @@ declare class RelMenubar extends LitElement {
|
|
|
945
1681
|
/** Stable id prefix for aria-activedescendant targets (light DOM, so ids
|
|
946
1682
|
* must be unique per menubar instance on the page). */
|
|
947
1683
|
private menubarId;
|
|
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-
|
|
1684
|
+
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 /* Figma Menu Bar / .Menu Bar Item (8699:4, 8698:13) label = body/lg.\n Declared on the host, not on .menubar-container, so the position:fixed\n panels \u2014 siblings of the container, not descendants \u2014 inherit it too. */\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-menubar-menu {\n display: none;\n }\n\n /* Figma Menu Bar (8699:4): bg/fill/neutral/default on border-radius/sm,\n clipping its children, gap spacing/none \u2014 no border and no shadow. */\n .menubar-container {\n display: flex;\n align-items: stretch;\n background: var(--rel-bg-neutral);\n border-radius: var(--rel-border-radius-sm);\n overflow: hidden;\n padding: 0;\n gap: 0;\n min-height: 40px;\n width: fit-content;\n }\n\n /* Type=Fit hugs its triggers (the default); Type=Fixed spans its container.\n Light-DOM component: :host never matches, so these key off the reflected\n attribute on the <rel-menubar> element itself. */\n rel-menubar[type=\"fixed\"] .menubar-container {\n width: var(--rel-menubar-width, 100%);\n }\n\n rel-menubar[type=\"fit\"] .menubar-container {\n width: fit-content;\n }\n\n /* Figma .Menu Bar Item (8698:13): spacing/xs vertical + spacing/md\n horizontal padding around a body/lg label = a 40px trigger. */\n .menubar-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n padding: var(--rel-spacing-xs) var(--rel-spacing-md);\n background: transparent;\n border: none;\n cursor: pointer;\n font: inherit;\n color: var(--rel-text-default);\n white-space: nowrap;\n transition: background 0.15s ease;\n user-select: none;\n outline: none;\n }\n\n /* State=Hover / State=Pressed / State=Active / State=Disabled. Active (the\n trigger whose menu is open) is the hover overlay plus a medium label \u2014\n hence the .open class rather than .active, which would collide with the\n :active pressed pseudo at equal specificity. */\n .menubar-trigger:hover:not(.disabled) {\n background: var(--rel-action-overlay-hover);\n }\n\n .menubar-trigger:active:not(.disabled) {\n background: var(--rel-action-overlay-pressed);\n }\n\n .menubar-trigger.open:not(.disabled) {\n background: var(--rel-action-overlay-hover);\n font-weight: var(--rel-body-lg-medium-font-weight);\n }\n\n .menubar-trigger.disabled {\n color: var(--rel-text-disabled);\n background: transparent;\n cursor: not-allowed;\n }\n\n /* Inset ring: the container clips (overflow:hidden), so a positive\n outline-offset would be cut off on the first and last trigger. */\n .menubar-trigger:focus-visible {\n outline: 2px solid var(--rel-border-focus);\n outline-offset: -2px;\n }\n\n /* Figma pairs the Menu Bar with the Menu component (6326:2932) for the\n panel each trigger opens: 300px, bg/fill/neutral/default, border\n radius/sm, shadow/md, clipped \u2014 no border. */\n .menubar-panel,\n .submenu-panel {\n position: fixed;\n width: var(--rel-menubar-panel-width, 300px);\n box-sizing: border-box;\n background: var(--rel-bg-neutral);\n border-radius: var(--rel-border-radius-sm);\n box-shadow: var(--rel-shadows-md);\n padding: 0;\n overflow: hidden;\n display: none;\n outline: none;\n }\n\n .menubar-panel {\n z-index: 1000;\n }\n\n .submenu-panel {\n z-index: 1001;\n }\n\n .menubar-panel.open,\n .submenu-panel.open {\n display: block;\n }\n\n /* Rows follow Figma .Menu Item Large (6326:616): spacing/sm padding all\n round on a body/lg label = 48px, with a border/neutral/subtle rule\n between rows. The rule is an INSET shadow, not a border: Figma strokes\n are drawn inside the 48px frame, so a real border-bottom would push\n every row to 49px. */\n .menu-item {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--rel-spacing-md);\n padding: var(--rel-spacing-sm);\n min-height: 48px;\n box-sizing: border-box;\n box-shadow: inset 0 calc(-1 * var(--rel-stroke-sm)) 0 var(--rel-border-subtle);\n cursor: pointer;\n transition: background 0.15s ease;\n user-select: none;\n color: var(--rel-text-default);\n line-height: var(--rel-body-lg-regular-line-height);\n }\n\n .menu-label {\n flex: 1 1 auto;\n }\n\n .menu-item:hover,\n .menu-item.focused {\n background: var(--rel-action-overlay-hover);\n }\n\n .menu-item:active {\n background: var(--rel-action-overlay-pressed);\n }\n\n .menu-item[data-disabled=\"true\"] {\n opacity: 0.4;\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 /* An explicit data-separator replaces the preceding row's subtle rule\n instead of stacking a second line on top of it. */\n .menu-item:has(+ .menu-separator),\n .menubar-panel > rel-checkbox:has(+ .menu-separator),\n .menubar-panel > rel-radio:has(+ .menu-separator) {\n box-shadow: none;\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 /* Figma draws the 20px chevron at full contrast \u2014 no dimming. */\n .submenu-chevron {\n margin-left: auto;\n display: inline-flex;\n align-items: center;\n pointer-events: none;\n }\n\n .menu-shortcut {\n margin-left: auto;\n padding-left: var(--rel-spacing-md);\n display: flex;\n align-items: center;\n gap: var(--rel-spacing-3xs);\n color: var(--rel-text-caption);\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 /* Checkbox / radio rows are real rel-checkbox / rel-radio elements rendered\n straight into the panel, so they carry the .Menu Item row box themselves. */\n .menubar-panel > rel-checkbox,\n .menubar-panel > rel-radio {\n display: block;\n width: 100%;\n min-height: 48px;\n padding: var(--rel-spacing-sm);\n box-sizing: border-box;\n box-shadow: inset 0 calc(-1 * var(--rel-stroke-sm)) 0 var(--rel-border-subtle);\n }\n\n .menubar-panel > rel-checkbox {\n cursor: pointer;\n transition: background 0.15s ease;\n }\n\n .menubar-panel > rel-checkbox:hover {\n background: var(--rel-action-overlay-hover);\n }\n ";
|
|
949
1685
|
createRenderRoot(): this;
|
|
950
1686
|
connectedCallback(): void;
|
|
951
1687
|
disconnectedCallback(): void;
|
|
@@ -960,6 +1696,8 @@ declare class RelMenubar extends LitElement {
|
|
|
960
1696
|
* openMenuIndex to -1, which used to drop focus to <body>.) */
|
|
961
1697
|
private closeAllMenusAndRefocusTrigger;
|
|
962
1698
|
private openMenu;
|
|
1699
|
+
/** A disabled <rel-menubar-menu> keeps its trigger focusable but never opens. */
|
|
1700
|
+
private isMenuDisabled;
|
|
963
1701
|
private handleTriggerClick;
|
|
964
1702
|
private handleTriggerMouseEnter;
|
|
965
1703
|
private handleTriggerKeyDown;
|
|
@@ -979,276 +1717,94 @@ declare class RelMenubar extends LitElement {
|
|
|
979
1717
|
render(): lit_html.TemplateResult<1>;
|
|
980
1718
|
}
|
|
981
1719
|
|
|
982
|
-
declare class RelMenubarMenu extends LitElement {
|
|
983
|
-
label: string;
|
|
984
|
-
createRenderRoot(): this;
|
|
985
|
-
render(): lit_html.TemplateResult<1>;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
/**
|
|
989
|
-
* @deprecated rel-navbar is deprecated and will be removed in a future release.
|
|
990
|
-
* Use rel-topbar and its sub-components instead:
|
|
991
|
-
* rel-topbar, rel-topbar-brand, rel-topbar-actions, rel-topbar-utilities,
|
|
992
|
-
* rel-topbar-item, rel-topbar-dropdown, rel-topbar-dropdown-item
|
|
993
|
-
*/
|
|
994
|
-
declare class RelNavbar extends LitElement {
|
|
995
|
-
constructor();
|
|
996
|
-
sticky: boolean;
|
|
997
|
-
device: "desktop" | "tablet" | "mobile";
|
|
998
|
-
static styles: lit.CSSResult;
|
|
999
|
-
render(): lit_html.TemplateResult<1>;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
/**
|
|
1003
|
-
* @deprecated Part of the deprecated rel-topbar family. Use a plain
|
|
1004
|
-
* `<a>`/logo markup inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
1005
|
-
*/
|
|
1006
|
-
declare class RelTopbarBrand extends LitElement {
|
|
1007
|
-
src: string;
|
|
1008
|
-
href: string;
|
|
1009
|
-
label: string;
|
|
1010
|
-
static styles: lit.CSSResult;
|
|
1011
|
-
render(): lit_html.TemplateResult<1>;
|
|
1012
|
-
}
|
|
1013
|
-
declare global {
|
|
1014
|
-
interface HTMLElementTagNameMap {
|
|
1015
|
-
"rel-topbar-brand": RelTopbarBrand;
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
/**
|
|
1020
|
-
* @deprecated Part of the deprecated rel-topbar family. Use plain
|
|
1021
|
-
* `rel-button` elements inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
1022
|
-
*/
|
|
1023
|
-
declare class RelTopbarActions extends LitElement {
|
|
1024
|
-
static styles: lit.CSSResult;
|
|
1025
|
-
render(): lit_html.TemplateResult<1>;
|
|
1026
|
-
}
|
|
1027
|
-
declare global {
|
|
1028
|
-
interface HTMLElementTagNameMap {
|
|
1029
|
-
"rel-topbar-actions": RelTopbarActions;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
/**
|
|
1034
|
-
* @deprecated Part of the deprecated rel-topbar family. Use plain
|
|
1035
|
-
* `rel-button` (icon variant) elements inside the "Navbar" recipe at /docs/recipes/navbar.
|
|
1036
|
-
*/
|
|
1037
|
-
declare class RelTopbarUtilities extends LitElement {
|
|
1038
|
-
static styles: lit.CSSResult;
|
|
1039
|
-
render(): lit_html.TemplateResult<1>;
|
|
1040
|
-
}
|
|
1041
|
-
declare global {
|
|
1042
|
-
interface HTMLElementTagNameMap {
|
|
1043
|
-
"rel-topbar-utilities": RelTopbarUtilities;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
/**
|
|
1048
|
-
* @deprecated Part of the deprecated rel-topbar family. Use `rel-drawer`
|
|
1049
|
-
* for the mobile nav panel in the "Navbar" recipe at /docs/recipes/navbar.
|
|
1050
|
-
*/
|
|
1051
|
-
declare class RelTopbarMobilePanel extends LitElement {
|
|
1052
|
-
static styles: lit.CSSResult;
|
|
1053
|
-
render(): lit_html.TemplateResult<1>;
|
|
1054
|
-
}
|
|
1055
|
-
declare global {
|
|
1056
|
-
interface HTMLElementTagNameMap {
|
|
1057
|
-
"rel-topbar-mobile-panel": RelTopbarMobilePanel;
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
1720
|
/**
|
|
1062
|
-
*
|
|
1063
|
-
* `rel-popover` for nav dropdowns in the "Navbar" recipe at /docs/recipes/navbar.
|
|
1721
|
+
* Declarative menu definition for `<rel-menubar>`: a hidden (`display: none`) light-DOM holder whose children (`data-item`, `data-separator`, `data-submenu`, `data-checkbox`, `data-radio-group`) the parent menubar reads and renders into a dropdown panel.
|
|
1064
1722
|
*/
|
|
1065
|
-
declare class
|
|
1066
|
-
|
|
1067
|
-
render(): lit_html.TemplateResult<1>;
|
|
1068
|
-
}
|
|
1069
|
-
declare global {
|
|
1070
|
-
interface HTMLElementTagNameMap {
|
|
1071
|
-
"rel-topbar-dropdown": RelTopbarDropdown;
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* @deprecated Part of the deprecated rel-topbar family. Use `rel-menu`'s
|
|
1077
|
-
* item slots or `rel-popover` content in the "Navbar" recipe at /docs/recipes/navbar.
|
|
1078
|
-
*/
|
|
1079
|
-
declare class RelTopbarDropdownItem extends LitElement {
|
|
1723
|
+
declare class RelMenubarMenu extends LitElement {
|
|
1724
|
+
/** Text of the trigger button the parent menubar renders for this menu. */
|
|
1080
1725
|
label: string;
|
|
1081
|
-
href: string;
|
|
1082
|
-
active: boolean;
|
|
1083
|
-
static styles: lit.CSSResult;
|
|
1084
|
-
private _handleClick;
|
|
1085
|
-
render(): lit_html.TemplateResult<1>;
|
|
1086
|
-
}
|
|
1087
|
-
declare global {
|
|
1088
|
-
interface HTMLElementTagNameMap {
|
|
1089
|
-
"rel-topbar-dropdown-item": RelTopbarDropdownItem;
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
type TopbarVariant = "customer" | "carrier";
|
|
1094
|
-
type TopbarForceLayout = "auto" | "desktop" | "tablet" | "mobile";
|
|
1095
|
-
/**
|
|
1096
|
-
* `rel-topbar` — Application-level top navigation / header shell.
|
|
1097
|
-
*
|
|
1098
|
-
* @deprecated This component's fixed slot structure, hardcoded breakpoint,
|
|
1099
|
-
* and built-in overflow logic are too rigid for most real layouts. Use the
|
|
1100
|
-
* "Navbar" recipe at /docs/recipes/navbar instead, composed from
|
|
1101
|
-
* rel-menu/rel-popover, rel-drawer, and rel-button. Still supported, but
|
|
1102
|
-
* will be removed in a future major version.
|
|
1103
|
-
*
|
|
1104
|
-
* Slots:
|
|
1105
|
-
* brand — Logo / wordmark region (left)
|
|
1106
|
-
* (default) — Primary nav items (rel-topbar-item elements)
|
|
1107
|
-
* actions — CTA / action buttons (customer) or dark-pill area (carrier)
|
|
1108
|
-
* utilities — Utility icon buttons (notifications, search, etc.)
|
|
1109
|
-
* profile — rel-topbar-profile tile
|
|
1110
|
-
* mobile-panel — Collapsed nav panel shown when mobileOpen is true
|
|
1111
|
-
*
|
|
1112
|
-
* Events:
|
|
1113
|
-
* rel-menu-toggle — fired when hamburger is clicked { open: boolean }
|
|
1114
|
-
* rel-mobile-open-change — alias of rel-menu-toggle for convenience
|
|
1115
|
-
* rel-nav-select — bubbled from child rel-topbar-item { value, label }
|
|
1116
|
-
*/
|
|
1117
|
-
declare class RelTopbar extends LitElement {
|
|
1118
|
-
/** Visual variant — affects action/profile region styling */
|
|
1119
|
-
variant: TopbarVariant;
|
|
1120
|
-
/** Whether the mobile nav panel is currently open */
|
|
1121
|
-
mobileOpen: boolean;
|
|
1122
|
-
/** Whether to render the hamburger / close toggle button */
|
|
1123
|
-
showMenuToggle: boolean;
|
|
1124
|
-
/** Reduce height to compact (48 px) mode */
|
|
1125
|
-
compact: boolean;
|
|
1126
|
-
/** Stick topbar to top of viewport while scrolling */
|
|
1127
|
-
sticky: boolean;
|
|
1128
1726
|
/**
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1727
|
+
* Renders this menu's trigger in the Figma State=Disabled style and stops it
|
|
1728
|
+
* opening by pointer, keyboard or hover-switch. The trigger stays in the tab
|
|
1729
|
+
* order and reachable with the arrow keys (`aria-disabled`, not the native
|
|
1730
|
+
* `disabled` attribute), matching how disabled `data-item` rows behave.
|
|
1131
1731
|
*/
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
private _overflowCount;
|
|
1135
|
-
private _overflowItemsData;
|
|
1136
|
-
private _resizeObserver?;
|
|
1137
|
-
private _resizeTimer?;
|
|
1138
|
-
private _measuring;
|
|
1139
|
-
private _lastNavWidth;
|
|
1140
|
-
static styles: lit.CSSResult;
|
|
1141
|
-
firstUpdated(): void;
|
|
1142
|
-
disconnectedCallback(): void;
|
|
1143
|
-
private _measureNav;
|
|
1144
|
-
private onRouterSlotChange;
|
|
1145
|
-
private get layoutClass();
|
|
1146
|
-
private handleMenuToggle;
|
|
1732
|
+
disabled: boolean;
|
|
1733
|
+
createRenderRoot(): this;
|
|
1147
1734
|
render(): lit_html.TemplateResult<1>;
|
|
1148
1735
|
}
|
|
1149
1736
|
|
|
1737
|
+
/** What the cells accept — digits only, or digits + ASCII letters. */
|
|
1738
|
+
type OtpInputMode = "numeric" | "alphanumeric";
|
|
1739
|
+
/** @deprecated Use `OtpInputMode`. */
|
|
1740
|
+
type OtpType = OtpInputMode;
|
|
1150
1741
|
/**
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
*
|
|
1154
|
-
* `rel-menu`/`rel-popover` dropdowns directly instead of a dedicated item component.
|
|
1155
|
-
*
|
|
1156
|
-
* Renders as an `<a>` when `href` is supplied, otherwise a `<button>`.
|
|
1157
|
-
*
|
|
1158
|
-
* Slots:
|
|
1159
|
-
* (default) — Label text / icon (overrides `label` property)
|
|
1160
|
-
* prefix — Icon/content before the label
|
|
1161
|
-
* suffix — Icon/content after the label (e.g. badge)
|
|
1162
|
-
* dropdown — Expandable panel content shown below the item
|
|
1163
|
-
*
|
|
1164
|
-
* Events:
|
|
1165
|
-
* rel-select — fired when a non-disabled, non-expandable item is activated
|
|
1166
|
-
* rel-toggle — fired when an expandable item is opened/closed { open: boolean }
|
|
1742
|
+
* Cell scale. Canonical values are the full words (shared field scale:
|
|
1743
|
+
* small 32 / medium 40 / large 48); `sm` / `md` / `lg` are the original
|
|
1744
|
+
* names and keep working as aliases.
|
|
1167
1745
|
*/
|
|
1168
|
-
|
|
1169
|
-
/** Accessible label — also shown as text when no default slot content */
|
|
1170
|
-
label?: string;
|
|
1171
|
-
/** Navigation href — renders an anchor element when set */
|
|
1172
|
-
href?: string;
|
|
1173
|
-
/** Marks this item as the current/active page */
|
|
1174
|
-
active: boolean;
|
|
1175
|
-
/** Prevents interaction */
|
|
1176
|
-
disabled: boolean;
|
|
1177
|
-
/** Shows a chevron and enables dropdown panel */
|
|
1178
|
-
expandable: boolean;
|
|
1179
|
-
/** Controlled open state of the dropdown panel */
|
|
1180
|
-
open: boolean;
|
|
1181
|
-
/** Optional string value forwarded in rel-select / rel-toggle events */
|
|
1182
|
-
value?: string;
|
|
1183
|
-
/** @internal tracks whether dropdown slot has content */
|
|
1184
|
-
private _hasDropdown;
|
|
1185
|
-
static styles: lit.CSSResult;
|
|
1186
|
-
connectedCallback(): void;
|
|
1187
|
-
disconnectedCallback(): void;
|
|
1188
|
-
private _handleOutsideClick;
|
|
1189
|
-
private _handleDocKeydown;
|
|
1190
|
-
private _setOpen;
|
|
1191
|
-
private _handleTriggerClick;
|
|
1192
|
-
private _routeSlots;
|
|
1193
|
-
private _handleDropdownSlotChange;
|
|
1194
|
-
render(): lit_html.TemplateResult<1>;
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
type TopbarProfileType = "avatar" | "carrier";
|
|
1198
|
-
type TopbarRewardTier = "gold" | "silver" | "platinum" | "bronze" | "regular";
|
|
1746
|
+
type OtpSize = "small" | "medium" | "large" | "sm" | "md" | "lg";
|
|
1199
1747
|
/**
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1202
|
-
* @
|
|
1203
|
-
*
|
|
1204
|
-
*
|
|
1205
|
-
*
|
|
1206
|
-
*
|
|
1207
|
-
*/
|
|
1208
|
-
declare class RelTopbarProfile extends LitElement {
|
|
1209
|
-
/** Visual mode */
|
|
1210
|
-
type: TopbarProfileType;
|
|
1211
|
-
/** One or two initials shown in the avatar circle */
|
|
1212
|
-
initials?: string;
|
|
1213
|
-
/** Primary display name */
|
|
1214
|
-
name?: string;
|
|
1215
|
-
/** Secondary line (role, plan, etc.) */
|
|
1216
|
-
subtitle?: string;
|
|
1217
|
-
/** Reward tier — only meaningful when type="carrier" */
|
|
1218
|
-
reward: TopbarRewardTier;
|
|
1219
|
-
/** Compact mode — avatar only, no text */
|
|
1220
|
-
compact: boolean;
|
|
1221
|
-
static styles: lit.CSSResult;
|
|
1222
|
-
render(): lit_html.TemplateResult<1>;
|
|
1223
|
-
private _renderAvatar;
|
|
1224
|
-
private _avatarBg;
|
|
1225
|
-
private _renderCarrier;
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
type OtpType = "numeric" | "alphanumeric";
|
|
1748
|
+
* One-time-password input (Figma "OTP Input"): one single-character cell per position, with auto-advance, smart backspace, paste distribution and optional group separators.
|
|
1749
|
+
* @csspart base - The `role="group"` root container (same element as `root`)
|
|
1750
|
+
* @csspart root - Alias of `base`, kept for existing `::part(root)` selectors
|
|
1751
|
+
* @csspart input - Each single-character cell input (same element as `cell`)
|
|
1752
|
+
* @csspart cell - Alias of `input`, kept for existing `::part(cell)` selectors
|
|
1753
|
+
* @csspart separator - The dash rendered between cell groups
|
|
1754
|
+
* @csspart hidden-input - The hidden form input rendered when `name` is set
|
|
1755
|
+
*/
|
|
1229
1756
|
declare class RelOtp extends LitElement {
|
|
1757
|
+
/** The concatenated code (all cells joined). Set it to fill the cells programmatically; it never exceeds `length` characters. */
|
|
1230
1758
|
value: string;
|
|
1759
|
+
/** Total number of cells (characters in the code). */
|
|
1231
1760
|
length: number;
|
|
1761
|
+
/** Cells per visual group; a separator renders between groups. `0` (or `show-separator` off) renders one ungrouped row. */
|
|
1232
1762
|
groupSize: number;
|
|
1763
|
+
/** Placeholder character shown in every empty cell. */
|
|
1233
1764
|
placeholder: string;
|
|
1765
|
+
/**
|
|
1766
|
+
* Accepted character set (Trello 5). Describes what the field ACCEPTS, not
|
|
1767
|
+
* a semantic input type — hence the name. Explicitly set it wins over the
|
|
1768
|
+
* deprecated `type`; unset (`""`, like the native `inputMode` accessor it
|
|
1769
|
+
* shadows on the host), `type` (default `"numeric"`) applies. Note the
|
|
1770
|
+
* lowercase `inputmode` prop is a different thing: the raw native keyboard
|
|
1771
|
+
* hint forwarded to each cell.
|
|
1772
|
+
*/
|
|
1773
|
+
inputMode: OtpInputMode | "";
|
|
1774
|
+
/** @deprecated Deprecated alias of `inputMode` (attribute `input-mode`); use `input-mode` instead. Kept working in 1.x and logs a one-time console notice. */
|
|
1234
1775
|
type: OtpType;
|
|
1776
|
+
/** Renders the cells as `type="password"` so entered characters are masked. */
|
|
1235
1777
|
mask: boolean;
|
|
1778
|
+
/** Disables every cell and dims the control to 0.6 opacity. */
|
|
1236
1779
|
disabled: boolean;
|
|
1780
|
+
/** Makes every cell read-only: the value is shown but typing, paste and keyboard editing are ignored. */
|
|
1237
1781
|
readonly: boolean;
|
|
1782
|
+
/** Marks the first cell `required` for native form validation. */
|
|
1238
1783
|
required: boolean;
|
|
1784
|
+
/** When set, renders a hidden `<input name="…">` (part `hidden-input`) carrying `value` for native form submission. */
|
|
1239
1785
|
name: string | null;
|
|
1786
|
+
/** Reserved autocomplete hint. Currently every cell always renders `autocomplete="one-time-code"` regardless of this value. */
|
|
1240
1787
|
autocomplete: string;
|
|
1788
|
+
/** Raw native `inputmode` keyboard hint forwarded to every cell. Unset, it follows the accepted character set: `numeric` for numeric, `text` for alphanumeric. */
|
|
1241
1789
|
inputmode: "numeric" | "text" | null;
|
|
1790
|
+
/** Native `pattern` attribute forwarded to every cell (per-character regex for form validation). */
|
|
1242
1791
|
pattern: string | null;
|
|
1792
|
+
/** Accessible name of the whole group; defaults to "One-time password input". Each cell is additionally labelled "Digit/Character N of M". */
|
|
1243
1793
|
ariaLabel: string | null;
|
|
1794
|
+
/** Error styling (danger border on every cell) and `aria-invalid="true"`. */
|
|
1244
1795
|
invalid: boolean;
|
|
1796
|
+
/** Renders the dash separator between groups. Boolean attribute: its presence means true — set the property to `false` to hide separators. */
|
|
1245
1797
|
showSeparator: boolean;
|
|
1246
|
-
size:
|
|
1798
|
+
/** Cell size on the shared field scale (square, border-box): `small` 32px, `medium` 40px, `large` 48px (the Figma OTP Input cell). `sm` / `md` / `lg` are deprecated aliases of the full words. */
|
|
1799
|
+
size: OtpSize;
|
|
1247
1800
|
private cells;
|
|
1248
1801
|
private hiddenInput?;
|
|
1249
1802
|
private isUpdatingFromValue;
|
|
1803
|
+
/** inputMode supersedes the deprecated type. */
|
|
1804
|
+
private get mode();
|
|
1250
1805
|
static styles: lit.CSSResult;
|
|
1251
1806
|
connectedCallback(): void;
|
|
1807
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
1252
1808
|
updated(changedProperties: Map<string, any>): void;
|
|
1253
1809
|
private initializeCells;
|
|
1254
1810
|
private syncCellsFromValue;
|
|
@@ -1264,6 +1820,9 @@ declare class RelOtp extends LitElement {
|
|
|
1264
1820
|
private handleFocus;
|
|
1265
1821
|
private handleBlur;
|
|
1266
1822
|
private focusCell;
|
|
1823
|
+
/** Native `inputmode` hint for the cells (mobile keyboard). The lowercase
|
|
1824
|
+
* `inputmode` prop is a raw passthrough and wins; otherwise it follows
|
|
1825
|
+
* the accepted character set. */
|
|
1267
1826
|
private getInputMode;
|
|
1268
1827
|
private getAriaLabel;
|
|
1269
1828
|
private getGroups;
|
|
@@ -1275,23 +1834,31 @@ declare global {
|
|
|
1275
1834
|
}
|
|
1276
1835
|
}
|
|
1277
1836
|
|
|
1837
|
+
/**
|
|
1838
|
+
* Page navigation (Figma "Pagination"): prev/next ghost buttons with numbered pages, a compact "Page X of Y" readout, or a "1–10 of 50" item-range readout. Use it under tables and lists that load one page of results at a time; it never fetches data itself — listen for `rel-change`.
|
|
1839
|
+
* @csspart base - The `role="navigation"` root of the extended layout (page buttons plus the optional "Viewing page" label).
|
|
1840
|
+
* @csspart label - The `role="navigation"` root row of the count-text layout (item-range text plus prev/next nav).
|
|
1841
|
+
*/
|
|
1278
1842
|
declare class RelPagination extends LitElement {
|
|
1279
|
-
/**
|
|
1843
|
+
/** Figma "Type": `extended` = prev/next + numbered page buttons (auto-collapses to compact under 480px container width), `compact` = prev/next + "Page X of Y", `count-text` = "start–end of total" item range + prev/next around the current page number. */
|
|
1280
1844
|
type: "extended" | "compact" | "count-text";
|
|
1281
|
-
/** Controlled current page */
|
|
1845
|
+
/** Controlled current page (1-based). When set, the element only emits `rel-change` and waits for the parent to update `page`; leave unset for uncontrolled behaviour. */
|
|
1282
1846
|
page?: number;
|
|
1283
|
-
/**
|
|
1847
|
+
/** Starting page for uncontrolled use (ignored when `page` is set). Attribute `defaultPage`, also read once as `default-page` on connect. */
|
|
1284
1848
|
defaultPage: number;
|
|
1285
|
-
/** Total number of pages */
|
|
1849
|
+
/** Total number of pages. `0` (the default) lets `totalItems` / `perPage` compute the page count instead. Attribute `totalPages`, also read once as `total-pages` on connect. */
|
|
1286
1850
|
totalPages: number;
|
|
1287
|
-
/** Total
|
|
1851
|
+
/** Total item count; with `perPage` it computes the page count when `totalPages` is `0` and is the "of N" figure in the count-text readout. Attribute `totalItems`, also read once as `total-items` on connect. */
|
|
1288
1852
|
totalItems: number;
|
|
1289
|
-
/** Items per page
|
|
1853
|
+
/** Items per page, used to compute the page count from `totalItems` and the "start–end" range in the count-text readout. Attribute `perPage`, also read once as `per-page` on connect. */
|
|
1290
1854
|
perPage: number;
|
|
1291
|
-
/**
|
|
1855
|
+
/** Shows a "Viewing page X of Y" caption under the extended layout (ignored by the other types). */
|
|
1292
1856
|
showLabel: boolean;
|
|
1857
|
+
/** Dims the whole control to 50% opacity, shows a `not-allowed` cursor and ignores every page change. */
|
|
1293
1858
|
disabled: boolean;
|
|
1859
|
+
/** Reserved for link-mode pagination. Currently accepted but not rendered: every page control is a `<button>`, so navigate in your `rel-change` handler instead. */
|
|
1294
1860
|
hrefTemplate: string;
|
|
1861
|
+
/** Accessible name of the `role="navigation"` landmark (attribute `ariaLabel`). Set it when a page contains more than one pagination control. */
|
|
1295
1862
|
ariaLabel: string;
|
|
1296
1863
|
private currentPage;
|
|
1297
1864
|
static styles: lit.CSSResult;
|
|
@@ -1315,17 +1882,50 @@ declare class RelPagination extends LitElement {
|
|
|
1315
1882
|
|
|
1316
1883
|
type SideType = "top" | "right" | "bottom" | "left";
|
|
1317
1884
|
type AlignType = "start" | "center" | "end";
|
|
1885
|
+
/**
|
|
1886
|
+
* Click-to-open floating panel anchored to a trigger (Figma "Popover"): the first child is the trigger, the `content` slot is the panel, which is promoted to the browser top layer and positioned in viewport coordinates.
|
|
1887
|
+
* @slot - The trigger: the first slotted element toggles the panel on pointer down / Enter / Space and receives `aria-haspopup`, `aria-expanded` and `aria-controls` (a bare `<div>` / `<span>` also gets `tabindex="0"` and `role="button"`).
|
|
1888
|
+
* @slot content - The panel body, usually a `<rel-popover-content>`; rendered inside the fixed, top-layer wrapper only while open.
|
|
1889
|
+
* @csspart arrow - The 14×14 chevron box rendered on the panel edge facing the trigger when `arrow` is set (absent otherwise).
|
|
1890
|
+
* @cssprop --rel-popover-arrow-bg - Fill of the `arrow` chevron (default `--rel-bg-neutral`, matching `<rel-popover-content>`).
|
|
1891
|
+
* @cssprop --rel-popover-arrow-border - Stroke of the `arrow` chevron's two slanted edges (default `--rel-border-default`).
|
|
1892
|
+
*/
|
|
1318
1893
|
declare class RelPopover extends LitElement {
|
|
1894
|
+
/** Controlled open state. Leave unset for uncontrolled mode; once set (true or false) the component only emits `rel-open-change` and you must update `open` yourself. */
|
|
1319
1895
|
open?: boolean;
|
|
1896
|
+
/** Initial state in uncontrolled mode (attribute `defaultopen`); ignored when `open` is set. */
|
|
1320
1897
|
defaultOpen: boolean;
|
|
1898
|
+
/** Blocks trigger interaction and dims the host to 60% opacity; does not close an already-open panel. */
|
|
1321
1899
|
disabled: boolean;
|
|
1900
|
+
/** Which side of the trigger the panel opens on: `top`, `right`, `bottom` (default) or `left`. The panel is clamped 8px inside the viewport but never flips to another side. */
|
|
1322
1901
|
side: SideType;
|
|
1902
|
+
/** Alignment along the cross axis: `start` (left / top edge of the trigger), `center` (default) or `end` (right / bottom edge). */
|
|
1323
1903
|
align: AlignType;
|
|
1904
|
+
/** Gap between trigger and panel in pixels (attribute `sideoffset`, default 8). With `arrow` the effective gap is at least 13px. */
|
|
1324
1905
|
sideOffset: number;
|
|
1906
|
+
/** Extra shift along the alignment axis in pixels (attribute `alignoffset`, default 0); positive moves right / down. */
|
|
1325
1907
|
alignOffset: number;
|
|
1908
|
+
/** Keep Tab / Shift+Tab cycling inside the panel while open (attribute `trapfocus`); use for forms. */
|
|
1326
1909
|
trapFocus: boolean;
|
|
1910
|
+
/** Close on Escape (attribute `closeonescape`, default true; switch off via the property, e.g. `el.closeOnEscape = false`). */
|
|
1327
1911
|
closeOnEscape: boolean;
|
|
1912
|
+
/** Close on a pointer-down outside the trigger and panel (attribute `closeonoutsideclick`, default true; switch off via the property). Also lets another popover's opening dismiss this one. */
|
|
1328
1913
|
closeOnOutsideClick: boolean;
|
|
1914
|
+
/**
|
|
1915
|
+
* Opt-in pointer (audit 23a): a 14×11 triangle on the panel edge that faces
|
|
1916
|
+
* the trigger — the Figma Popover "Chevron" — following `side` and tracking
|
|
1917
|
+
* the trigger's centre along the cross axis (clamped inside the panel).
|
|
1918
|
+
* It is drawn with the panel's tokens (`--rel-popover-arrow-bg` /
|
|
1919
|
+
* `--rel-popover-arrow-border`, defaulting to rel-popover-content's
|
|
1920
|
+
* background and border). With the arrow on, the panel keeps at least the
|
|
1921
|
+
* arrow's height plus 2px away from the trigger so the tip never overlaps
|
|
1922
|
+
* it; larger `sideOffset` values still apply. Default off — existing
|
|
1923
|
+
* popovers render exactly as before.
|
|
1924
|
+
*/
|
|
1925
|
+
arrow: boolean;
|
|
1926
|
+
/** Figma Popover (6338:563) chevron: 14 wide × 11 tall. */
|
|
1927
|
+
private static readonly ARROW_WIDTH;
|
|
1928
|
+
private static readonly ARROW_HEIGHT;
|
|
1329
1929
|
private internalOpen;
|
|
1330
1930
|
private contentStyle;
|
|
1331
1931
|
private contentWrapper;
|
|
@@ -1344,6 +1944,15 @@ declare class RelPopover extends LitElement {
|
|
|
1344
1944
|
private onHostKeyDown;
|
|
1345
1945
|
private onOpen;
|
|
1346
1946
|
private onClose;
|
|
1947
|
+
/**
|
|
1948
|
+
* Light-dismiss every other open popover that isn't an ancestor of this
|
|
1949
|
+
* one (nested popovers keep their parent open). This is what the outside-
|
|
1950
|
+
* pointerdown listener would do for a click on our trigger — except the
|
|
1951
|
+
* trigger handler stops that pointerdown in the capture phase, and a
|
|
1952
|
+
* keyboard (Enter/Space) or programmatic open never produces one at all.
|
|
1953
|
+
* Honors each popover's own `closeOnOutsideClick` setting.
|
|
1954
|
+
*/
|
|
1955
|
+
private closeOtherPopovers;
|
|
1347
1956
|
private showNativePopover;
|
|
1348
1957
|
private hideNativePopover;
|
|
1349
1958
|
private addGlobalListeners;
|
|
@@ -1365,7 +1974,13 @@ declare global {
|
|
|
1365
1974
|
}
|
|
1366
1975
|
}
|
|
1367
1976
|
|
|
1977
|
+
/**
|
|
1978
|
+
* Styled panel body for `<rel-popover>` (Figma "Popover" surface): neutral background, 1px border, 8px radius, shadow-300, max-width 400px, with heading / paragraph typography for slotted content. Place it in the popover's `content` slot; any other element works there too.
|
|
1979
|
+
* @slot - The panel content (headings, paragraphs, form controls, buttons).
|
|
1980
|
+
* @csspart content - The padded `role="dialog"` box that carries the surface, border, shadow and size padding.
|
|
1981
|
+
*/
|
|
1368
1982
|
declare class RelPopoverContent extends LitElement {
|
|
1983
|
+
/** Accessible name applied to the inner `role="dialog"` box (attribute `aria-label`); describe what the panel is for. */
|
|
1369
1984
|
ariaLabel: string;
|
|
1370
1985
|
/** Figma Size axis (S/M/L): panel padding 12/16/20px. */
|
|
1371
1986
|
size: "sm" | "md" | "lg";
|
|
@@ -1374,13 +1989,23 @@ declare class RelPopoverContent extends LitElement {
|
|
|
1374
1989
|
}
|
|
1375
1990
|
|
|
1376
1991
|
type ProgressMode = "linear-determinate" | "linear-indeterminate" | "circular-determinate" | "circular-indeterminate";
|
|
1992
|
+
/**
|
|
1993
|
+
* Progress indicator (Figma "Progress"): a linear bar or a circular ring, each either value-driven (determinate) or looping (indeterminate).
|
|
1994
|
+
* @csspart track - The linear track `<div>` that carries `role="progressbar"` (linear modes only)
|
|
1995
|
+
* @csspart indicator - The filled / sliding bar inside the linear track (linear modes only)
|
|
1996
|
+
*/
|
|
1377
1997
|
declare class RelProgress extends LitElement {
|
|
1998
|
+
/** Shape and behaviour: `linear-*` is a full-width 6px bar, `circular-*` a 48px ring; `*-determinate` fills to `value`, `*-indeterminate` loops an animation and ignores `value`. */
|
|
1378
1999
|
mode: ProgressMode;
|
|
2000
|
+
/** Completion percentage 0–100 for the determinate modes; out-of-range values are clamped before rendering and before `aria-valuenow`. */
|
|
1379
2001
|
value: number;
|
|
2002
|
+
/** Accessible name of the progressbar (not rendered visually); defaults to "Progress" for determinate and "Loading" for indeterminate modes. */
|
|
2003
|
+
label: string;
|
|
1380
2004
|
private radius;
|
|
1381
2005
|
private circumference;
|
|
1382
2006
|
static styles: lit.CSSResult;
|
|
1383
2007
|
private get safeValue();
|
|
2008
|
+
private get accessibleName();
|
|
1384
2009
|
private renderLinearDeterminate;
|
|
1385
2010
|
private renderLinearIndeterminate;
|
|
1386
2011
|
private renderCircularDeterminate;
|
|
@@ -1388,7 +2013,14 @@ declare class RelProgress extends LitElement {
|
|
|
1388
2013
|
render(): lit_html.TemplateResult<1>;
|
|
1389
2014
|
}
|
|
1390
2015
|
|
|
2016
|
+
/**
|
|
2017
|
+
* Flex container that lays out direct-child `<rel-resizable-panel>`s along one axis and lets the user drag or keyboard-nudge the `<rel-resizable-handle>` between two neighbours to trade percentage width/height between them.
|
|
2018
|
+
* @slot - The panels and handles, as direct children in display order (panel, handle, panel, …)
|
|
2019
|
+
* @fires rel-resize - Fired continuously while a handle is dragged. Detail: `{ direction, sizes: number[] }` with one percentage per panel.
|
|
2020
|
+
* @fires rel-resize-end - Fired once when a drag ends (pointerup) and after every keyboard resize step. Detail: `{ direction, sizes: number[] }` with one percentage per panel.
|
|
2021
|
+
*/
|
|
1391
2022
|
declare class RelResizableGroup extends LitElement {
|
|
2023
|
+
/** Layout axis: `horizontal` places panels side by side and resizes widths, `vertical` stacks them and resizes heights; also pushed to every child handle's `orientation`. */
|
|
1392
2024
|
direction: "horizontal" | "vertical";
|
|
1393
2025
|
private panels;
|
|
1394
2026
|
private handles;
|
|
@@ -1421,11 +2053,18 @@ declare global {
|
|
|
1421
2053
|
}
|
|
1422
2054
|
}
|
|
1423
2055
|
|
|
2056
|
+
/**
|
|
2057
|
+
* One resizable region inside a `<rel-resizable-group>`: a padded, scrollable (`overflow: auto`) flex column whose size along the group axis is a percentage managed by the group.
|
|
2058
|
+
* @slot - The panel's content; slotted `h1`–`h4` get the headings-md role
|
|
2059
|
+
*/
|
|
1424
2060
|
declare class RelResizablePanel extends LitElement {
|
|
2061
|
+
/** Initial size as a percentage of the group; panels without one share whatever is left of 100%, then all sizes are normalised to sum to 100. Attribute is `defaultsize`. */
|
|
1425
2062
|
defaultSize?: number;
|
|
2063
|
+
/** Smallest size (percentage) the panel can be resized to. Attribute is `minsize`. */
|
|
1426
2064
|
minSize: number;
|
|
2065
|
+
/** Largest size (percentage) the panel can be resized to. Attribute is `maxsize`. */
|
|
1427
2066
|
maxSize: number;
|
|
1428
|
-
/** Current
|
|
2067
|
+
/** Current size as a percentage of the group (also written to the host's `flex-basis`); read-only — the parent group updates it on every resize. */
|
|
1429
2068
|
currentSize: number;
|
|
1430
2069
|
static styles: lit.CSSResult;
|
|
1431
2070
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -1436,16 +2075,21 @@ declare global {
|
|
|
1436
2075
|
}
|
|
1437
2076
|
}
|
|
1438
2077
|
|
|
2078
|
+
/**
|
|
2079
|
+
* Focusable `role="separator"` splitter placed between two `<rel-resizable-panel>`s inside a `<rel-resizable-group>`; the group owns the drag and keyboard logic, the handle only renders the grab bar and exposes the split via ARIA.
|
|
2080
|
+
*/
|
|
1439
2081
|
declare class RelResizableHandle extends LitElement {
|
|
2082
|
+
/** Axis the handle separates: `horizontal` = 8px-wide vertical bar with `col-resize` cursor, `vertical` = 8px-tall bar with `row-resize`; set automatically from the parent group's `direction` on first render and mirrored to `aria-orientation`. */
|
|
1440
2083
|
orientation: "horizontal" | "vertical";
|
|
1441
|
-
/** Index of this handle in the parent group */
|
|
2084
|
+
/** @internal Index of this handle in the parent group; assigned by the group on first render. */
|
|
1442
2085
|
handleIndex: number;
|
|
1443
|
-
/** Current split
|
|
2086
|
+
/** Current split of the two neighbouring panels as a percentage 0–100 (share held by the leading panel); read-only — the parent group updates it and mirrors it to `aria-valuenow`. */
|
|
1444
2087
|
splitValue: number;
|
|
1445
2088
|
static styles: lit.CSSResult;
|
|
1446
2089
|
connectedCallback(): void;
|
|
1447
2090
|
updated(changed: Map<string, unknown>): void;
|
|
1448
2091
|
private updateAriaOrientation;
|
|
2092
|
+
/** @internal Called by the parent group after every resize to store `splitValue` and write `aria-valuenow` / `aria-valuemin` / `aria-valuemax`. */
|
|
1449
2093
|
updateAriaValue(value: number): void;
|
|
1450
2094
|
render(): lit_html.TemplateResult<1>;
|
|
1451
2095
|
}
|
|
@@ -1455,18 +2099,33 @@ declare global {
|
|
|
1455
2099
|
}
|
|
1456
2100
|
}
|
|
1457
2101
|
|
|
1458
|
-
type SegmentSize = "small" | "medium";
|
|
2102
|
+
type SegmentSize = "small" | "medium" | "large";
|
|
1459
2103
|
type SegmentAlign = "left" | "middle" | "right";
|
|
1460
2104
|
interface SegmentOption {
|
|
1461
2105
|
label: string;
|
|
1462
2106
|
value: string;
|
|
1463
2107
|
disabled?: boolean;
|
|
2108
|
+
/** `rel-icon` name rendered before the label (Figma "Left Icon"), sized 16 / 18 / 20 with the control. */
|
|
2109
|
+
icon?: string;
|
|
1464
2110
|
}
|
|
2111
|
+
/**
|
|
2112
|
+
* Single-select segmented button group: renders one `<button role="radio">` per entry in `options` on a 2px-inset track (`role="radiogroup"`), with exactly one segment active at a time.
|
|
2113
|
+
* @csspart base - The `role="radiogroup"` track that lays out the segments.
|
|
2114
|
+
* @csspart option - Each segment's native `<button role="radio">`; the active one carries the `active` class and `aria-checked="true"`.
|
|
2115
|
+
* @csspart icon - A segment's optional leading `rel-icon` element.
|
|
2116
|
+
* @csspart label - The wrapper around a segment's label text.
|
|
2117
|
+
*/
|
|
1465
2118
|
declare class RelSegmentedButton extends LitElement {
|
|
2119
|
+
/** The segments in order, each `{ label: string; value: string; disabled?: boolean; icon?: string }`. Set as a property (or a JSON array attribute); a disabled entry is rendered but cannot be selected, and `icon` names a `rel-icon` drawn before the label. */
|
|
1466
2120
|
options: SegmentOption[];
|
|
2121
|
+
/** `value` of the currently selected segment. Updated by the component on click / arrow keys; set it to pre-select a segment (an unknown value selects nothing). */
|
|
1467
2122
|
active: string;
|
|
2123
|
+
/** Control height, matching the TextField ramp: `small` (32px — 28px segments, `action-md` 12px text, 16px icons), `medium` (default, 40px — 36px segments, `action-lg` 14px text, 18px icons) or `large` (48px — 44px segments, `action-xl` 16px text, 20px icons). */
|
|
1468
2124
|
size: SegmentSize;
|
|
2125
|
+
/** `justify-content` of the group's inline-flex container: `left` (default), `middle` or `right`. Only visible when the host is made wider than its content. */
|
|
1469
2126
|
align: SegmentAlign;
|
|
2127
|
+
/** Accessible name for the radiogroup (it renders no visible group label). */
|
|
2128
|
+
fieldAriaLabel?: string;
|
|
1470
2129
|
static styles: lit.CSSResult;
|
|
1471
2130
|
private setActive;
|
|
1472
2131
|
/** APG radio-group navigation: arrows move focus AND select, the group is
|
|
@@ -1489,8 +2148,47 @@ interface SelectOptionObject {
|
|
|
1489
2148
|
icon?: string;
|
|
1490
2149
|
}
|
|
1491
2150
|
type SelectOption = string | SelectOptionObject;
|
|
2151
|
+
/**
|
|
2152
|
+
* `<rel-select>` — combobox-style dropdown (Figma "Dropdown"): single- or multi-select
|
|
2153
|
+
* with an optional in-panel search field and width-adaptive selection chips.
|
|
2154
|
+
* @csspart label - The visible label above the trigger (default label style)
|
|
2155
|
+
* @csspart trigger - The button that opens the panel; styled like a text field
|
|
2156
|
+
* @csspart value - The value area inside the trigger (selected label, placeholder or chips)
|
|
2157
|
+
* @csspart helper - The supporting / error text below the trigger
|
|
2158
|
+
* @csspart panel - The dropdown listbox container (same node as `list`)
|
|
2159
|
+
* @csspart list - Alias of `panel`
|
|
2160
|
+
* @csspart input - The search input inside the panel
|
|
2161
|
+
* @csspart option - A single-select option row
|
|
2162
|
+
* @cssprop --rel-field-label-reserve - Height held for the absent label row under `labelStyle="none"` so the trigger bottom-aligns with labelled siblings; defaults to the label line-height plus the wrapper gap. Set to `0` to collapse the row entirely (toolbars, table cells).
|
|
2163
|
+
* @cssprop --rel-select-bg - Background of the trigger, the floating label, the panel and its sticky header
|
|
2164
|
+
* @cssprop --rel-select-bg-disabled - Trigger background when `state="disabled"`
|
|
2165
|
+
* @cssprop --rel-select-border-default - Trigger border colour at rest
|
|
2166
|
+
* @cssprop --rel-select-border-disabled - Trigger border colour when `state="disabled"`
|
|
2167
|
+
* @cssprop --rel-select-border-focus - Trigger border colour on hover, while focused (where it also thickens to 2px) and while the panel is open
|
|
2168
|
+
* @cssprop --rel-select-border-error - Trigger border colour when `state="error"`
|
|
2169
|
+
* @cssprop --rel-select-radius - Trigger corner radius when `border="rounded"`
|
|
2170
|
+
* @cssprop --rel-select-icon-color - Colour of the trigger icons, the search icon and option prefix icons
|
|
2171
|
+
* @cssprop --rel-select-label-color - Colour of the static label and of the floated label
|
|
2172
|
+
* @cssprop --rel-select-value-color - Colour of the selected value, the search text, option labels and the check mark
|
|
2173
|
+
* @cssprop --rel-select-placeholder-color - Placeholder colour (trigger, resting floating label, search field, empty-list message)
|
|
2174
|
+
* @cssprop --rel-select-placeholder-disabled-color - Placeholder colour when disabled
|
|
2175
|
+
* @cssprop --rel-select-supporting-color - Supporting text colour (non-error)
|
|
2176
|
+
* @cssprop --rel-select-menu-border - Panel border colour. The panel is borderless by design and only draws this on dark surfaces, where its shadow alone can't separate it from the page.
|
|
2177
|
+
* @cssprop --rel-select-menu-radius - Panel corner radius
|
|
2178
|
+
* @cssprop --rel-select-menu-shadow - Panel box-shadow
|
|
2179
|
+
* @cssprop --rel-select-search-border - Border colour of the search field inside the panel
|
|
2180
|
+
* @cssprop --rel-select-divider - Hairline under the search field, the Select-all row and every option row
|
|
2181
|
+
* @cssprop --rel-select-option-hover - Background of the hovered / keyboard-highlighted / selected option and Select-all row
|
|
2182
|
+
* @cssprop --rel-select-option-pressed - Background of an option row while it is being pressed
|
|
2183
|
+
*/
|
|
1492
2184
|
declare class RelSelect extends LitElement {
|
|
2185
|
+
/** Visible label. Rendered above the trigger (`labelStyle="default"`) or floating inside it; omitted under `labelStyle="none"`. */
|
|
1493
2186
|
label: string;
|
|
2187
|
+
/**
|
|
2188
|
+
* Label presentation: `default` static label above the trigger; `floating` label
|
|
2189
|
+
* rests in the value area and floats onto the border when focused, open or filled;
|
|
2190
|
+
* `none` renders no label (supply `fieldAriaLabel` / `fieldAriaLabelledby`).
|
|
2191
|
+
*/
|
|
1494
2192
|
labelStyle: SelectLabelStyle;
|
|
1495
2193
|
/**
|
|
1496
2194
|
* Accessible name for the trigger. Required when `labelStyle="none"`, since no
|
|
@@ -1499,21 +2197,46 @@ declare class RelSelect extends LitElement {
|
|
|
1499
2197
|
fieldAriaLabel?: string;
|
|
1500
2198
|
/** IDREF list of external element(s) naming the trigger. Wins over `fieldAriaLabel`. */
|
|
1501
2199
|
fieldAriaLabelledby?: string;
|
|
2200
|
+
/**
|
|
2201
|
+
* Options to list. Each entry is a plain string (used as both value and label) or
|
|
2202
|
+
* `{ value, label?, supportingText?, icon? }`; `icon` is a `rel-icon` name rendered
|
|
2203
|
+
* before the label, `supportingText` shows only in multi-select rows.
|
|
2204
|
+
*/
|
|
1502
2205
|
options: SelectOption[];
|
|
1503
|
-
/** Enables multi-select: selected values render as removable chips
|
|
2206
|
+
/** Enables multi-select: selected values render as removable chips, options as checkboxes, and a Select-all row appears in the panel. */
|
|
1504
2207
|
multiple: boolean;
|
|
1505
|
-
/** Selected value
|
|
2208
|
+
/** Selected option value in single-select mode. Ignored when `multiple` is set. */
|
|
1506
2209
|
selected: string;
|
|
1507
|
-
/** Selected values
|
|
2210
|
+
/** Selected option values in multi-select mode. Reset to `[]` when `multiple` is turned off. */
|
|
1508
2211
|
selectedValues: string[];
|
|
2212
|
+
/** Visual / interaction state. `error` colours the border and supporting text and clears itself on the next selection; `disabled` blocks interaction and dims the whole field. */
|
|
1509
2213
|
state: SelectState;
|
|
2214
|
+
/** Helper line below the trigger; coloured as an error while `state="error"`. */
|
|
1510
2215
|
supportingText: string;
|
|
2216
|
+
/**
|
|
2217
|
+
* `rel-icon` name shown before the supporting text (16px, 14px at `small`).
|
|
2218
|
+
* Optional: the design pairs the helper line with an icon, but existing
|
|
2219
|
+
* fields without one keep their current single-line look.
|
|
2220
|
+
*/
|
|
2221
|
+
supportingIcon: string;
|
|
2222
|
+
/**
|
|
2223
|
+
* Field height — `small` 32px, `medium` 40px, `large` 48px. The whole component
|
|
2224
|
+
* rides this one axis: label and supporting type, trigger padding, icons
|
|
2225
|
+
* (20 / 18 / 16), selection chips, and the panel's rows, search field and
|
|
2226
|
+
* checkboxes all scale with it.
|
|
2227
|
+
*/
|
|
1511
2228
|
size: SelectSize;
|
|
2229
|
+
/** Trigger corners: `rounded` applies the corner radius, `sharp` renders square corners. */
|
|
1512
2230
|
border: SelectBorder;
|
|
2231
|
+
/** `rel-icon` name rendered at the left edge of the trigger. */
|
|
1513
2232
|
leftIcon: string;
|
|
2233
|
+
/** `rel-icon` name replacing the default chevron at the right edge of the trigger. A custom icon does not rotate when the panel opens. */
|
|
1514
2234
|
rightIcon: string;
|
|
2235
|
+
/** Text shown in the trigger while nothing is selected. */
|
|
1515
2236
|
placeholder: string;
|
|
2237
|
+
/** Placeholder of the in-panel search field (the field is hidden when `noSearch` is set). */
|
|
1516
2238
|
searchPlaceholder: string;
|
|
2239
|
+
/** Label of the Select-all row shown at the top of the panel in multi-select mode. */
|
|
1517
2240
|
selectAllLabel: string;
|
|
1518
2241
|
/**
|
|
1519
2242
|
* Optional hard cap on visible chips. By default (no cap) the visible
|
|
@@ -1539,7 +2262,7 @@ declare class RelSelect extends LitElement {
|
|
|
1539
2262
|
private listboxEl;
|
|
1540
2263
|
private valueEl;
|
|
1541
2264
|
private chipsMeasureEl;
|
|
1542
|
-
/** Must match the `gap` of .select-chips / .select-chips-measure. */
|
|
2265
|
+
/** Must match the `gap` of .select-chips / .select-chips-measure (spacing/xs). */
|
|
1543
2266
|
private static readonly CHIP_GAP;
|
|
1544
2267
|
private chipResizeObserver?;
|
|
1545
2268
|
private uniqueId;
|
|
@@ -1561,10 +2284,19 @@ declare class RelSelect extends LitElement {
|
|
|
1561
2284
|
/** Options matching the current search text (substring match, case-insensitive). */
|
|
1562
2285
|
private get filteredOptions();
|
|
1563
2286
|
private get hasValue();
|
|
1564
|
-
/**
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
2287
|
+
/**
|
|
2288
|
+
* Selection chips ramp with the field: rel-chip's sm / md / lg are already
|
|
2289
|
+
* the 24 / 28 / 32 heights the spec asks the multi-select value area for.
|
|
2290
|
+
*/
|
|
2291
|
+
private get chipSize();
|
|
2292
|
+
/**
|
|
2293
|
+
* Multi-select rows nest the checkbox one step down its own ramp: rel-checkbox
|
|
2294
|
+
* sits a size above the rest of the system (its `large` is body/xl where a
|
|
2295
|
+
* `large` field is body/lg), so large select -> medium checkbox and both
|
|
2296
|
+
* medium and small select -> small checkbox, the smallest it ships. The rows
|
|
2297
|
+
* still land on 48 / 40 / 32 through their own padding and min-height.
|
|
2298
|
+
*/
|
|
2299
|
+
private get optionCheckboxSize();
|
|
1568
2300
|
private get selectAllStatus();
|
|
1569
2301
|
private addGlobalListeners;
|
|
1570
2302
|
private removeGlobalListeners;
|
|
@@ -1609,12 +2341,24 @@ declare global {
|
|
|
1609
2341
|
|
|
1610
2342
|
type SkeletonShape = "line" | "circle" | "block";
|
|
1611
2343
|
type SkeletonAnimation = "pulse" | "shimmer" | "none";
|
|
2344
|
+
/**
|
|
2345
|
+
* Loading placeholder: a neutral block, circle or stack of text lines that pulses or shimmers while real content loads, then hides itself once `loaded` is set. Use it in place of content whose size you already know; use a spinner for indeterminate waits.
|
|
2346
|
+
* @csspart base - Each placeholder surface: the single block/circle, or every bar when `shape="line"`.
|
|
2347
|
+
* @cssprop --rel-skeleton-color - Fill colour of the placeholder (defaults to the elevated-3 neutral background token).
|
|
2348
|
+
* @cssprop --rel-skeleton-highlight - Lighter band that sweeps across the placeholder when `animation="shimmer"` (defaults to the elevated-2 neutral background token).
|
|
2349
|
+
*/
|
|
1612
2350
|
declare class RelSkeleton extends LitElement {
|
|
2351
|
+
/** Placeholder shape: `block` fills the host (min 16px tall), `circle` is a square-aspect disc sized by the host width, `line` renders `lines` 14px text bars with the last one at 65% width. */
|
|
1613
2352
|
shape: SkeletonShape;
|
|
2353
|
+
/** Number of text bars when `shape="line"` (minimum 1, 8px apart); ignored by the other shapes. */
|
|
1614
2354
|
lines: number;
|
|
2355
|
+
/** Any CSS width (e.g. `"240px"`, `"50%"`) applied to the host's inline style. Empty leaves the host at its natural block width. */
|
|
1615
2356
|
width: string;
|
|
2357
|
+
/** Any CSS height (e.g. `"120px"`) applied to the host's inline style. Not needed for `circle`, which derives its height from the width. */
|
|
1616
2358
|
height: string;
|
|
2359
|
+
/** Motion: `pulse` fades opacity between 100% and 40%, `shimmer` sweeps a highlight band left to right, `none` is static. Both animations are disabled under `prefers-reduced-motion: reduce`. */
|
|
1617
2360
|
animation: SkeletonAnimation;
|
|
2361
|
+
/** Set once the real content is ready: hides the skeleton (`display: none`) and removes its `role="status"` / "Loading" label. */
|
|
1618
2362
|
loaded: boolean;
|
|
1619
2363
|
protected updated(changed: Map<string, unknown>): void;
|
|
1620
2364
|
static styles: lit.CSSResult;
|
|
@@ -1627,13 +2371,72 @@ declare global {
|
|
|
1627
2371
|
}
|
|
1628
2372
|
|
|
1629
2373
|
type ModalSide = "top" | "bottom" | "center";
|
|
2374
|
+
type ModalSize = "sm" | "md" | "lg" | "xl" | "fullscreen";
|
|
2375
|
+
/**
|
|
2376
|
+
* `"default"` — the body is a free-form slot (24px padding, your own layout).
|
|
2377
|
+
* `"text"` — the Figma Modal Sheet "Text" slot: a message-only modal whose body
|
|
2378
|
+
* is plain copy (16px vertical / 20px horizontal padding, body-lg type) under
|
|
2379
|
+
* the header divider. Additive, opt-in (audit 20c).
|
|
2380
|
+
*/
|
|
2381
|
+
type ModalVariant = "default" | "text";
|
|
2382
|
+
/**
|
|
2383
|
+
* Modal sheet dialog (Figma "Modal Sheet", 8171:3412) — a centred, top- or
|
|
2384
|
+
* bottom-anchored panel over a scrim with a title/description header, a
|
|
2385
|
+
* scrollable body, an optional footer and a loading state. Lives in the
|
|
2386
|
+
* `rel-sheet` folder and is exported as `RelModal`.
|
|
2387
|
+
* @slot - Body content of the modal
|
|
2388
|
+
* @slot header - Extra header content rendered under the title/description (e.g. a stepper or tabs)
|
|
2389
|
+
* @slot footer - Actions row (right-aligned, 8px gap); the footer only renders when this slot has content
|
|
2390
|
+
* @csspart overlay - The full-viewport scrim behind the panel
|
|
2391
|
+
* @csspart panel - The dialog panel (role="dialog")
|
|
2392
|
+
* @csspart header - Header row holding title, description, header slot and close button
|
|
2393
|
+
* @csspart close-button - The "X" close button
|
|
2394
|
+
* @csspart content - Scrollable body wrapper around the default slot
|
|
2395
|
+
* @csspart footer - Footer wrapper around the `footer` slot
|
|
2396
|
+
* @csspart loading - Spinner overlay shown while `loading` is set
|
|
2397
|
+
* @cssprop --rel-modal-width - Panel width; overrides the `size` scale (md default `clamp(360px, 49vw, 708px)`, sm `min(400px, 100vw - 32px)`, lg `min(900px, 100vw - 48px)`, xl `min(1140px, 100vw - 48px)`). Ignored by `fullscreen` and by the responsive collapse below 480px
|
|
2398
|
+
* @cssprop --rel-modal-transition-duration - Open/close animation duration; default `0.3s`
|
|
2399
|
+
* @cssprop --rel-modal-transition-timing - Open/close animation easing; default `cubic-bezier(0.32, 0.72, 0, 1)`
|
|
2400
|
+
*/
|
|
1630
2401
|
declare class RelModal extends LitElement {
|
|
2402
|
+
/** Whether the modal is shown. Toggle it to open/close; every change fires `rel-open-change`. */
|
|
1631
2403
|
open: boolean;
|
|
2404
|
+
/** Where the panel is anchored: `bottom` (48px above the bottom edge, slides up), `top` (48px below the top edge, slides down) or `center` (fades and scales in). Below 480px with `breakpoint="responsive"` every side collapses to a full-width bottom sheet. */
|
|
1632
2405
|
side: ModalSide;
|
|
2406
|
+
/** Heading text (rendered as an `<h2>`, linked via `aria-labelledby`). The `title` attribute is stripped from the host after it is read so no native tooltip appears. */
|
|
1633
2407
|
title: string;
|
|
2408
|
+
/** Supporting text under the title (linked via `aria-describedby`). */
|
|
1634
2409
|
description: string;
|
|
2410
|
+
/** Alias for `description`; rendered only when `description` is empty. */
|
|
2411
|
+
subtitle: string;
|
|
2412
|
+
/** Coarse dismissal switch. When false the close button is hidden and backdrop clicks / Escape are ignored regardless of the granular `close-on-*` / `show-close-button` props. */
|
|
1635
2413
|
dismissible: boolean;
|
|
2414
|
+
/** Modal mode: renders the scrim, sets `role="dialog"` + `aria-modal`, traps Tab inside the panel and moves focus in on open. When false the panel is a `region` with no scrim and no focus trap. */
|
|
1636
2415
|
modal: boolean;
|
|
2416
|
+
/** Panel width scale. `md` matches the Figma Modal Sheet width; `fullscreen` covers the viewport. */
|
|
2417
|
+
size: ModalSize;
|
|
2418
|
+
/** Body treatment — see `ModalVariant`. `"text"` styles the default slot as
|
|
2419
|
+
* the Figma "Text" message slot; the header (and its divider) render as
|
|
2420
|
+
* usual above it. Default rendering is unchanged. */
|
|
2421
|
+
variant: ModalVariant;
|
|
2422
|
+
/** Close when the scrim is clicked. Only effective while `dismissible` is true; ignored while `disabled` or `loading`. */
|
|
2423
|
+
closeOnBackdropClick: boolean;
|
|
2424
|
+
/** Close on the Escape key. Only effective while `dismissible` is true; ignored while `disabled`. */
|
|
2425
|
+
closeOnEscape: boolean;
|
|
2426
|
+
/** Render the "X" close button in the header. Only effective while `dismissible` is true. */
|
|
2427
|
+
showCloseButton: boolean;
|
|
2428
|
+
/** Move focus into the panel when opened (modal mode only). */
|
|
2429
|
+
autoFocus: boolean;
|
|
2430
|
+
/** Return focus to the opener when closed. */
|
|
2431
|
+
restoreFocus: boolean;
|
|
2432
|
+
/** When false, the body no longer scrolls internally — tall content clips at the panel's max height. */
|
|
2433
|
+
scrollable: boolean;
|
|
2434
|
+
/** Shows a spinner overlay and blocks all interaction inside the panel. */
|
|
2435
|
+
loading: boolean;
|
|
2436
|
+
/** Blocks user-initiated closes (X / backdrop / Escape) and footer actions. */
|
|
2437
|
+
disabled: boolean;
|
|
2438
|
+
/** Stacking order of the whole modal (backdrop + panel). */
|
|
2439
|
+
zIndex: number;
|
|
1637
2440
|
/**
|
|
1638
2441
|
* Figma "Breakpoint" axis. responsive (default) collapses to a full-width
|
|
1639
2442
|
* bottom sheet below 480px; web keeps the fixed desktop panel at every size.
|
|
@@ -1670,20 +2473,46 @@ declare global {
|
|
|
1670
2473
|
*/
|
|
1671
2474
|
type SliderType = "continuous" | "discrete" | "default" | "range";
|
|
1672
2475
|
type TrackStyle = "solid" | "dotted";
|
|
2476
|
+
/**
|
|
2477
|
+
* Slider (Figma "Slider", 6417:1340): a pill track with a stroked round thumb,
|
|
2478
|
+
* optional value tooltip, discrete tick marks and a dual-thumb range mode.
|
|
2479
|
+
* Built on native `<input type="range">` so keyboard and assistive-technology
|
|
2480
|
+
* behaviour come for free.
|
|
2481
|
+
* @csspart track - The rail behind the thumb (the filled portion has no part)
|
|
2482
|
+
* @csspart thumb - The round grab handle (one per thumb in range mode)
|
|
2483
|
+
* @csspart tooltip - The value bubble + chevron above each thumb (only while `showBubble` is on)
|
|
2484
|
+
* @cssprop --rel-slider-track-height - Rail thickness; 6 / 8 / 10px for size sm / md / lg
|
|
2485
|
+
* @cssprop --rel-slider-thumb-size - Thumb diameter; 16 / 20 / 24px for size sm / md / lg
|
|
2486
|
+
* @cssprop --rel-slider-thumb-stroke - Width of the hover / pressed / focus ring around the thumb; default 6px
|
|
2487
|
+
* @cssprop --rel-slider-thumb-halo-color - Colour of the keyboard-focus ring; default `var(--rel-border-default)`
|
|
2488
|
+
* @cssprop --rel-slider-tick-size - Tick-mark diameter in discrete mode; 4 / 5 / 6px for size sm / md / lg
|
|
2489
|
+
* @cssprop --rel-slider-bubble-radius - Corner radius of the value bubble; 8px for size sm, otherwise 10px
|
|
2490
|
+
*/
|
|
1673
2491
|
declare class RelSlider extends LitElement {
|
|
2492
|
+
/** Slider mode: `continuous` (or its alias `default`) accepts any integer value, `discrete` snaps to `step` and draws tick marks, `range` shows two thumbs bounding `value`…`valueEnd`. */
|
|
1674
2493
|
type: SliderType;
|
|
1675
2494
|
/** Figma Size axis (S/M/L): scales track, thumb and ticks. */
|
|
1676
2495
|
size: "sm" | "md" | "lg";
|
|
2496
|
+
/** Lowest selectable value. */
|
|
1677
2497
|
min: number;
|
|
2498
|
+
/** Highest selectable value. */
|
|
1678
2499
|
max: number;
|
|
2500
|
+
/** Increment between values. In `discrete` mode it also spaces the tick marks; in `continuous` mode the native input always moves in steps of 1. */
|
|
1679
2501
|
step: number;
|
|
2502
|
+
/** Disables interaction and dims the track, thumb and ticks; the tooltip is hidden. */
|
|
1680
2503
|
disabled: boolean;
|
|
2504
|
+
/** Style of the filled part of the track: `solid` or a `dotted` pattern. */
|
|
1681
2505
|
track: TrackStyle;
|
|
2506
|
+
/** Print the numeric value under every tick mark. Only has an effect in `discrete` mode. */
|
|
1682
2507
|
showTickLabels: boolean;
|
|
2508
|
+
/** Show the value tooltip above the thumb(s). */
|
|
1683
2509
|
showBubble: boolean;
|
|
2510
|
+
/** Current value (the lower value in `range` mode). */
|
|
1684
2511
|
value: number;
|
|
1685
2512
|
/** Upper value when type="range" (attribute value-end). */
|
|
1686
2513
|
valueEnd: number;
|
|
2514
|
+
/** Accessible name for the native range input. In `range` mode it is suffixed with " minimum" / " maximum" per thumb; without it the two thumbs read "Minimum value" / "Maximum value" and a single slider has no name. */
|
|
2515
|
+
fieldAriaLabel?: string;
|
|
1687
2516
|
private ticks;
|
|
1688
2517
|
private _onChange;
|
|
1689
2518
|
private _onTouched;
|
|
@@ -1706,8 +2535,11 @@ declare class RelSlider extends LitElement {
|
|
|
1706
2535
|
private getTickLeftPct;
|
|
1707
2536
|
private isTickActive;
|
|
1708
2537
|
private onInput;
|
|
2538
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
1709
2539
|
registerOnChange(fn: (value: number) => void): void;
|
|
2540
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
1710
2541
|
registerOnTouched(fn: () => void): void;
|
|
2542
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
1711
2543
|
writeValue(value: number): void;
|
|
1712
2544
|
private updateActiveWidth;
|
|
1713
2545
|
private renderThumbContainer;
|
|
@@ -1717,16 +2549,42 @@ declare class RelSlider extends LitElement {
|
|
|
1717
2549
|
}
|
|
1718
2550
|
|
|
1719
2551
|
type SnackbarLines = "single" | "double";
|
|
2552
|
+
/** Canonical semantic tones (Figma "Tone"): neutral | success | warning | destructive. */
|
|
2553
|
+
type SnackbarTone = "neutral" | "success" | "warning" | "destructive";
|
|
2554
|
+
/** Deprecated spellings: "default" → neutral; "error" | "danger" | "critical" → destructive. */
|
|
2555
|
+
type SnackbarToneAlias = "default" | "error" | "danger" | "critical";
|
|
2556
|
+
type SnackbarToneInput = SnackbarTone | SnackbarToneAlias;
|
|
2557
|
+
/** @deprecated since 1.4.7 — use `SnackbarToneInput`. */
|
|
1720
2558
|
type SnackbarType = "default" | "success" | "error" | "warning";
|
|
2559
|
+
/**
|
|
2560
|
+
* Snackbar (Figma "Snackbar"): a dark, elevated message bar with an optional tone accent and leading status icon, an optional action button and a close icon, shown via `show` and auto-dismissed after `duration` milliseconds. It is not positioned — place it (fixed or in-flow) yourself. Use it for brief feedback with a single follow-up action ("Undo", "Retry"); use `rel-alert` for persistent messages.
|
|
2561
|
+
* @csspart label - The message text container
|
|
2562
|
+
* @csspart action - The action button; rendered only when `action` is set
|
|
2563
|
+
* @csspart close-button - The close icon button; rendered while `iconclose` is true
|
|
2564
|
+
*/
|
|
1721
2565
|
declare class RelSnackbar extends LitElement {
|
|
2566
|
+
/** Message text. Announced to screen readers through the shared live-region announcer when the snackbar is shown and whenever it changes while shown. The default is a placeholder — always set it. */
|
|
1722
2567
|
message: string;
|
|
2568
|
+
/** Label of the optional action button (Figma trailing button, Static / Small); omitted when unset. Clicking it fires `actionClick` and then dismisses the snackbar. */
|
|
1723
2569
|
action?: string;
|
|
2570
|
+
/** Doubles the auto-dismiss delay (`duration * 2`) so the user has time to read and use the action button. Pair it with `lines="double"` for the Figma Type=Longer Action layout. */
|
|
1724
2571
|
longerAction: boolean;
|
|
2572
|
+
/** Shows the trailing close icon button. Defaults to true; because it is a Lit boolean, `iconclose="false"` is still true — set the property to `false` from script to hide the button. */
|
|
1725
2573
|
iconClose: boolean;
|
|
2574
|
+
/** Layout: `"single"` (default) puts the message and the actions on one row; `"double"` stacks the message above the actions, which align to the end (Figma Type=Longer Action). */
|
|
1726
2575
|
lines: SnackbarLines;
|
|
2576
|
+
/** Auto-dismiss delay in milliseconds (doubled by `longerAction`), started when `show` becomes true and restarted when `duration` or `longerAction` changes while shown. `0` (or a negative value) disables auto-dismiss. */
|
|
1727
2577
|
duration: number;
|
|
1728
|
-
|
|
2578
|
+
/**
|
|
2579
|
+
* Semantic tone (Figma "Tone"): `"neutral"` (default: no accent, no icon) | `"success"` | `"warning"` | `"destructive"` — the status tones add a 4px left accent and a leading icon (check-circle / warning / error) in the tone colour. `"default"` is a deprecated alias of `"neutral"`; `"error"`, `"danger"` and `"critical"` are deprecated aliases of `"destructive"`; each logs a one-time console notice. Takes precedence over the deprecated `type` prop.
|
|
2580
|
+
*/
|
|
2581
|
+
tone?: SnackbarToneInput;
|
|
2582
|
+
/** @deprecated Deprecated since 1.4.7 — alias of `tone`; use `tone`. Same values as `tone`; `type="error"` maps to `tone="destructive"` and `type="default"` to `tone="neutral"`. Ignored when `tone` is set. Logs a one-time console notice. */
|
|
2583
|
+
type?: SnackbarToneInput;
|
|
2584
|
+
/** Whether the snackbar is visible. Set it to true to show the snackbar and start the auto-dismiss timer; it is set back to false by the close icon, the action button and the timer. There is no open/close method — toggle this property. */
|
|
1729
2585
|
show: boolean;
|
|
2586
|
+
/** Read-only canonical tone actually rendered: explicit `tone` wins, else `type`, else `"neutral"`; deprecated aliases are resolved to `"neutral"` / `"destructive"`. */
|
|
2587
|
+
get resolvedTone(): SnackbarTone;
|
|
1730
2588
|
private visible;
|
|
1731
2589
|
private _dismissTimer;
|
|
1732
2590
|
static styles: lit.CSSResult;
|
|
@@ -1742,18 +2600,40 @@ declare class RelSnackbar extends LitElement {
|
|
|
1742
2600
|
render(): lit_html.TemplateResult<1>;
|
|
1743
2601
|
}
|
|
1744
2602
|
|
|
2603
|
+
/**
|
|
2604
|
+
* Toggle switch (Figma "Switch", 5917:1174, Type=Line): a 44×20 control with a
|
|
2605
|
+
* thin 10px track and a 20px handle that slides 20px. Wraps a native checkbox
|
|
2606
|
+
* with `role="switch"`, so keyboard and screen-reader behaviour are native.
|
|
2607
|
+
* @csspart base - The `<label>` wrapper around the hidden input and the track
|
|
2608
|
+
* @csspart track - The thin rail; the handle is its `::before` pseudo-element
|
|
2609
|
+
* @cssprop --rel-switch-track-width - Overall control width; default 44px
|
|
2610
|
+
* @cssprop --rel-switch-track-height - Overall control height; default 20px
|
|
2611
|
+
* @cssprop --rel-switch-thumb-size - Handle diameter; default 20px (the handle always travels 20px)
|
|
2612
|
+
* @cssprop --rel-switch-track - Rail colour; default `var(--rel-bg-neutral-elevated-2)`
|
|
2613
|
+
* @cssprop --rel-switch-knob-on - Handle colour when checked; default `var(--rel-bg-neutral-inverse-2)`
|
|
2614
|
+
* @cssprop --rel-switch-knob-off - Handle colour when unchecked; default `var(--rel-text-static-light)`
|
|
2615
|
+
* @cssprop --rel-switch-disabled - Handle colour while disabled; default `var(--rel-bg-neutral-elevated-1)`
|
|
2616
|
+
*/
|
|
1745
2617
|
declare class RelSwitch extends LitElement {
|
|
2618
|
+
/** Whether the switch is on. Set it to control the state programmatically; user toggles update it and fire `rel-change`. */
|
|
1746
2619
|
checked: boolean;
|
|
2620
|
+
/** Disables interaction, dims the control to 50% and removes the handle shadow. */
|
|
1747
2621
|
disabled: boolean;
|
|
2622
|
+
/** Arbitrary string echoed in the `rel-change` event detail — useful when one handler serves several switches. */
|
|
1748
2623
|
value: string;
|
|
2624
|
+
/** Accessible name for the native input. Without it the switch has no label of its own, so pair it with a visible `<label>` or set this. */
|
|
2625
|
+
fieldAriaLabel?: string;
|
|
1749
2626
|
private _onChange;
|
|
1750
2627
|
private _onTouched;
|
|
1751
2628
|
private isFocused;
|
|
1752
2629
|
private isPressed;
|
|
1753
2630
|
static styles: lit.CSSResult;
|
|
1754
2631
|
private toggle;
|
|
2632
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
1755
2633
|
registerOnChange(fn: (value: boolean) => void): void;
|
|
2634
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
1756
2635
|
registerOnTouched(fn: () => void): void;
|
|
2636
|
+
/** @internal Angular ControlValueAccessor bridge. */
|
|
1757
2637
|
writeValue(checked: boolean): void;
|
|
1758
2638
|
private handleFocus;
|
|
1759
2639
|
private handleBlur;
|
|
@@ -1768,20 +2648,54 @@ interface TabItem {
|
|
|
1768
2648
|
badgeDot?: boolean;
|
|
1769
2649
|
disabled?: boolean;
|
|
1770
2650
|
}
|
|
2651
|
+
/**
|
|
2652
|
+
* Tab-strip scale. `sm` / `md` / `lg` are the original names; the full words
|
|
2653
|
+
* `small` / `medium` / `large` are accepted as aliases (Trello 4). Each step
|
|
2654
|
+
* is an explicit item height — 32 / 40 / 48px (Figma Tab Item S/M/L).
|
|
2655
|
+
*/
|
|
2656
|
+
type TabSize = "sm" | "md" | "lg" | "small" | "medium" | "large";
|
|
2657
|
+
/**
|
|
2658
|
+
* Declarative tab definition for `<rel-tab>`. Renders nothing itself — place
|
|
2659
|
+
* it in the parent's `items` slot and the parent reads its properties.
|
|
2660
|
+
*/
|
|
1771
2661
|
declare class RelTabItem extends LitElement {
|
|
2662
|
+
/** Text shown on the tab. */
|
|
1772
2663
|
label: string;
|
|
2664
|
+
/** Optional identifier for the tab. `<rel-tab>` does not read it; look it up from the item at `event.detail` when handling `rel-tab-change`. */
|
|
1773
2665
|
value: string;
|
|
2666
|
+
/** Count shown in a small badge after the label; `0` hides the badge. */
|
|
1774
2667
|
badge: number;
|
|
1775
2668
|
/** Shows a small dot instead of a numbered badge — takes precedence over `badge`. */
|
|
1776
2669
|
badgeDot: boolean;
|
|
2670
|
+
/** Greys the tab out and skips it in click, arrow-key and Home/End navigation. */
|
|
1777
2671
|
disabled: boolean;
|
|
1778
2672
|
render(): lit_html.TemplateResult<1>;
|
|
1779
2673
|
}
|
|
2674
|
+
/**
|
|
2675
|
+
* Underline tab strip (Figma "Tab Item", 6473:1075) with roving-tabindex
|
|
2676
|
+
* keyboard navigation, optional count/dot badges and a single shared tabpanel
|
|
2677
|
+
* below the strip. Tabs come either from the `tabs` array or from slotted
|
|
2678
|
+
* `<rel-tab-item>` elements.
|
|
2679
|
+
* @slot items - `<rel-tab-item>` definitions; when present they take precedence over the `tabs` array
|
|
2680
|
+
* @slot - Content of the single tabpanel rendered under the strip (always visible — swap it yourself on `rel-tab-change`)
|
|
2681
|
+
* @csspart list - The `role="tablist"` row
|
|
2682
|
+
* @csspart item - Each `role="tab"` element
|
|
2683
|
+
* @csspart label - The text span inside each tab
|
|
2684
|
+
* @cssprop --rel-tab-active-color - Underline colour of the active tab; default `var(--rel-bg-brand)`
|
|
2685
|
+
* @cssprop --rel-tab-underline-height - Thickness of the active underline; default 3px
|
|
2686
|
+
* @cssprop --rel-tab-text-default - Label colour of the active tab; default `var(--rel-text-default)`
|
|
2687
|
+
* @cssprop --rel-tab-text-hover - Label colour while hovering an enabled tab; default `var(--rel-text-label)`
|
|
2688
|
+
* @cssprop --rel-tab-text-disabled - Label colour of a disabled tab; default `var(--rel-text-disabled)`
|
|
2689
|
+
* @cssprop --rel-tab-hover-color - Background of an inactive tab on hover; default `var(--rel-bg-neutral-elevated-1)`
|
|
2690
|
+
*/
|
|
1780
2691
|
declare class RelTab extends LitElement {
|
|
2692
|
+
/** Tab definitions as `{ label, badge?, badgeDot?, disabled? }` objects — normally set as a property (as an attribute it must be a JSON string). Assign a new array to update; mutating in place does not re-render. Ignored when `<rel-tab-item>` children are slotted into `items`. */
|
|
1781
2693
|
tabs: TabItem[];
|
|
2694
|
+
/** Zero-based index of the selected tab. Set it to switch tabs programmatically (no event is fired for programmatic changes). */
|
|
1782
2695
|
activeIndex: number;
|
|
1783
|
-
/** Tab size — styled via :host([size]) rules.
|
|
1784
|
-
|
|
2696
|
+
/** Tab size — styled via :host([size]) rules. Explicit item heights
|
|
2697
|
+
* 32 / 40 / 48px (audit 34); `small|medium|large` alias `sm|md|lg`. */
|
|
2698
|
+
size: TabSize;
|
|
1785
2699
|
private _tabItems;
|
|
1786
2700
|
/** Stable id prefix linking tabs to the shared tabpanel. */
|
|
1787
2701
|
private tabsId;
|
|
@@ -1810,14 +2724,31 @@ declare class RelTab extends LitElement {
|
|
|
1810
2724
|
* V1.0, node 8301:3771): fixed panel widths 220/250/280 by size, full-bleed
|
|
1811
2725
|
* columns with 1px dividers, neutral selected state, and a Now / Cancel / OK
|
|
1812
2726
|
* footer whose buttons are always size S.
|
|
2727
|
+
*
|
|
2728
|
+
* @csspart base - Outer wrapper; carries the size / error / readonly classes
|
|
2729
|
+
* @csspart label - The field label above the trigger
|
|
2730
|
+
* @csspart trigger - The field box that anchors the panel (wraps the text input and the icons)
|
|
2731
|
+
* @csspart value - The editable text input showing the formatted time
|
|
2732
|
+
* @csspart icon - The trailing clock icon
|
|
2733
|
+
* @csspart panel - The popover panel (`role="dialog"`)
|
|
2734
|
+
* @csspart shortcuts - The typed-shortcut chip row at the top of the panel (N → Now)
|
|
2735
|
+
* @csspart option - Each hour / minute / second / AM-PM entry button
|
|
2736
|
+
* @csspart footer - The Now / Cancel / OK row
|
|
2737
|
+
* @csspart helper - The helper / error text live region under the field
|
|
2738
|
+
* @fires rel-focus - Fired when the text input receives focus. No detail.
|
|
1813
2739
|
*/
|
|
1814
2740
|
declare class RelTimePicker extends LitElement {
|
|
1815
2741
|
/** Committed time, 24-hour "HH:mm" or "HH:mm:ss" (e.g. "09:30", "17:05:30"). */
|
|
1816
2742
|
value: string | null;
|
|
2743
|
+
/** Placeholder shown in the field while no value is committed and nothing is typed. */
|
|
1817
2744
|
placeholder: string;
|
|
2745
|
+
/** Field label rendered above the trigger; also the input's accessible name (unset → "Select time"). */
|
|
1818
2746
|
label: string | null;
|
|
2747
|
+
/** Disables the field (0.6 opacity, no pointer events); the panel cannot open. */
|
|
1819
2748
|
disabled: boolean;
|
|
2749
|
+
/** Renders the `*` mark after the label and sets `aria-required`; not enforced by the component. */
|
|
1820
2750
|
required: boolean;
|
|
2751
|
+
/** Shows the value but blocks typing and opening the panel. */
|
|
1821
2752
|
readonly: boolean;
|
|
1822
2753
|
/** Display format of the trigger text and hour column. Value stays 24-hour. */
|
|
1823
2754
|
format: "12h" | "24h";
|
|
@@ -1829,23 +2760,42 @@ declare class RelTimePicker extends LitElement {
|
|
|
1829
2760
|
minTime: string | null;
|
|
1830
2761
|
/** Latest selectable time, "HH:mm" (inclusive). */
|
|
1831
2762
|
maxTime: string | null;
|
|
2763
|
+
/** Whether the panel is open. Settable from outside; opening resets the draft from `value` (programmatic changes do not fire `rel-open-change`). */
|
|
1832
2764
|
open: boolean;
|
|
2765
|
+
/** Shows a clear (×) button inside the field while a value is set; clearing commits `null`. */
|
|
1833
2766
|
clearable: boolean;
|
|
2767
|
+
/** Error styling (danger border, `aria-invalid`) and shows `errorMessage` below the field. */
|
|
1834
2768
|
error: boolean;
|
|
1835
2769
|
/** Alias for `error` (requested-API compat); either flag applies error styling. */
|
|
1836
2770
|
invalid: boolean;
|
|
2771
|
+
/** Text shown below the field while `error` / `invalid` is set (falls back to the typed-entry parse error, then `helperText`). */
|
|
1837
2772
|
errorMessage?: string;
|
|
2773
|
+
/** Assistive text shown below the field when not in error. */
|
|
1838
2774
|
helperText?: string;
|
|
2775
|
+
/** When set, renders a hidden `<input name="…">` carrying `value` for native form submission. */
|
|
1839
2776
|
name?: string;
|
|
2777
|
+
/** Trigger height on the shared field scale — small 32 / medium 40 / large 48px border-box; also sets the panel width (220 / 250 / 280px) and option row height (32 / 36 / 40px). Small lowers the trigger min-width from 160 to 128px. */
|
|
1840
2778
|
size: "small" | "medium" | "large";
|
|
2779
|
+
/** Visual style; only `"outlined"` exists today. */
|
|
1841
2780
|
variant: "outlined";
|
|
2781
|
+
/** Fills the parent width (the host is inline-block with intrinsic width otherwise). The attribute is lowercase `fullwidth`. */
|
|
1842
2782
|
fullWidth: boolean;
|
|
1843
2783
|
private draftHour;
|
|
1844
2784
|
private draftMinute;
|
|
1845
2785
|
private draftSecond;
|
|
1846
|
-
/**
|
|
1847
|
-
private
|
|
2786
|
+
/** Uncommitted typed text; null → the input shows the committed value. */
|
|
2787
|
+
private inputText;
|
|
2788
|
+
/** Parse/range error message for the typed text (cleared on next input). */
|
|
2789
|
+
private inputError;
|
|
2790
|
+
/**
|
|
2791
|
+
* Whether the next popover open should move focus into the columns.
|
|
2792
|
+
* Icon-click / ArrowDown / external `open` do (previous behavior); opening
|
|
2793
|
+
* by clicking into the text input must NOT, or typing would be impossible.
|
|
2794
|
+
*/
|
|
2795
|
+
private focusPanelOnOpen;
|
|
2796
|
+
private triggerInput?;
|
|
1848
2797
|
private triggerButton?;
|
|
2798
|
+
private popoverElement?;
|
|
1849
2799
|
private columnsElement?;
|
|
1850
2800
|
static styles: lit.CSSResult;
|
|
1851
2801
|
connectedCallback(): void;
|
|
@@ -1853,8 +2803,12 @@ declare class RelTimePicker extends LitElement {
|
|
|
1853
2803
|
private handleClickOutside;
|
|
1854
2804
|
private handleEscapeKey;
|
|
1855
2805
|
updated(changedProperties: Map<string, any>): void;
|
|
1856
|
-
|
|
1857
|
-
private
|
|
2806
|
+
private showTopLayer;
|
|
2807
|
+
private hideTopLayer;
|
|
2808
|
+
private onReposition;
|
|
2809
|
+
private updatePopoverPosition;
|
|
2810
|
+
/** Focus the selected (or first enabled) option in the columns. */
|
|
2811
|
+
private focusPanelSelection;
|
|
1858
2812
|
private parseTime;
|
|
1859
2813
|
private formatValue;
|
|
1860
2814
|
private formatDisplay;
|
|
@@ -1880,9 +2834,19 @@ declare class RelTimePicker extends LitElement {
|
|
|
1880
2834
|
/** Close discarding the draft (Cancel / Escape / outside click). */
|
|
1881
2835
|
private cancelPopover;
|
|
1882
2836
|
private applySelection;
|
|
2837
|
+
/** Commit a time: set value, reset typed text/error, fire rel-change. */
|
|
2838
|
+
private commitTime;
|
|
1883
2839
|
/** Set the draft to the current time, snapped to the minute step and range. */
|
|
1884
2840
|
private selectNow;
|
|
1885
2841
|
private clearValue;
|
|
2842
|
+
/**
|
|
2843
|
+
* Parse and commit the typed text (Enter / blur). Invalid or out-of-range
|
|
2844
|
+
* text keeps the field in an error state with the text preserved for
|
|
2845
|
+
* correction; the committed value is untouched (Escape reverts the text).
|
|
2846
|
+
*/
|
|
2847
|
+
private commitTypedValue;
|
|
2848
|
+
/** "Now", committed directly (N shortcut / popover chip), clamped to range. */
|
|
2849
|
+
private applyNowShortcut;
|
|
1886
2850
|
private selectHour;
|
|
1887
2851
|
private selectMinute;
|
|
1888
2852
|
private selectSecond;
|
|
@@ -1894,7 +2858,16 @@ declare class RelTimePicker extends LitElement {
|
|
|
1894
2858
|
*/
|
|
1895
2859
|
private scrollOptionInColumn;
|
|
1896
2860
|
private scrollColumnsToSelection;
|
|
1897
|
-
private
|
|
2861
|
+
private handleInputInput;
|
|
2862
|
+
private handleInputKeydown;
|
|
2863
|
+
/** Clicking anywhere on the field opens the popover, keeping focus typed-in. */
|
|
2864
|
+
private handleFieldClick;
|
|
2865
|
+
/** The clock icon toggles the popover with the previous focus behavior. */
|
|
2866
|
+
private handleIconClick;
|
|
2867
|
+
/** Commit typed text when focus leaves the component entirely. */
|
|
2868
|
+
private handleInputBlur;
|
|
2869
|
+
/** N inside the panel (columns/footer focus) applies Now directly. */
|
|
2870
|
+
private handlePanelKeydown;
|
|
1898
2871
|
/**
|
|
1899
2872
|
* Column navigation: Up/Down move within the column (and select), Left/Right
|
|
1900
2873
|
* jump between columns, Home/End go to the first/last option, Enter applies.
|
|
@@ -1909,19 +2882,47 @@ declare global {
|
|
|
1909
2882
|
}
|
|
1910
2883
|
}
|
|
1911
2884
|
|
|
2885
|
+
/** Canonical semantic tones. */
|
|
2886
|
+
type ToastTone = "default" | "destructive";
|
|
2887
|
+
/** Deprecated tone spellings, all mapped to "destructive". */
|
|
2888
|
+
type ToastToneAlias = "error" | "danger" | "critical";
|
|
2889
|
+
type ToastToneInput = ToastTone | ToastToneAlias;
|
|
2890
|
+
/** @deprecated since 1.4.7 — use `ToastToneInput`. */
|
|
1912
2891
|
type ToastType = "default" | "error";
|
|
2892
|
+
/**
|
|
2893
|
+
* Transient bottom-centre notification: a fixed-position dark pill with a message, an optional action button and a dismiss button, shown via `show` / `open()` and hidden again after `duration` milliseconds. Use it for brief, non-blocking confirmations; use `rel-alert` for persistent messages.
|
|
2894
|
+
* @csspart base - The `role="status"` toast container that carries the tone class
|
|
2895
|
+
* @csspart label - The message text span
|
|
2896
|
+
* @csspart action - The action button; rendered only when `actionlabel` is set
|
|
2897
|
+
* @csspart close-button - The dismiss (✕) button
|
|
2898
|
+
* @cssprop --rel-toast-z - `z-index` of the fixed host (default `9000`); raise it when a modal or drawer layer covers the toast
|
|
2899
|
+
* @cssprop --rel-z-toast - Deprecated alias of `--rel-toast-z`, still read as its fallback
|
|
2900
|
+
*/
|
|
1913
2901
|
declare class RelToast extends LitElement {
|
|
2902
|
+
/** Text of the toast. It is also announced to screen readers through the shared live-region announcer each time `show` becomes true. */
|
|
1914
2903
|
message: string;
|
|
1915
|
-
|
|
2904
|
+
/**
|
|
2905
|
+
* Semantic tone: `"default"` (dark neutral pill) | `"destructive"` (danger fill, announced assertively). `"error"`, `"danger"` and `"critical"` are deprecated aliases of `"destructive"` and log a one-time console notice. Takes precedence over the deprecated `type` prop.
|
|
2906
|
+
*/
|
|
2907
|
+
tone?: ToastToneInput;
|
|
2908
|
+
/** @deprecated Deprecated since 1.4.7 — alias of `tone`; use `tone`. Same values as `tone`; `type="error"` maps to `tone="destructive"`. Ignored when `tone` is set. Logs a one-time console notice. */
|
|
2909
|
+
type?: ToastToneInput;
|
|
2910
|
+
/** Read-only canonical tone actually rendered: explicit `tone` wins, else `type`, else `"default"`; deprecated aliases are resolved to `"destructive"`. */
|
|
2911
|
+
get resolvedTone(): ToastTone;
|
|
2912
|
+
/** Label of the optional action button rendered between the message and the dismiss button; the button is omitted when unset. Clicking it fires `action` and then closes the toast. */
|
|
1916
2913
|
actionLabel?: string;
|
|
2914
|
+
/** Auto-dismiss delay in milliseconds, started each time `show` becomes true. `0` (or a negative value) disables auto-dismiss so the toast stays until `close()` or the dismiss button. Changing it while the toast is visible does not restart the running timer. */
|
|
1917
2915
|
duration: number;
|
|
2916
|
+
/** Whether the toast is visible. Set it to true (or call `open()`) to show the toast and start the auto-dismiss timer; it is set back to false by `close()`, the dismiss button, the action button and the timer. */
|
|
1918
2917
|
show: boolean;
|
|
1919
2918
|
private visible;
|
|
1920
2919
|
private _dismissTimer;
|
|
1921
2920
|
static styles: lit.CSSResult;
|
|
1922
2921
|
willUpdate(changed: Map<string, unknown>): void;
|
|
1923
2922
|
disconnectedCallback(): void;
|
|
2923
|
+
/** Shows the toast: sets `show = true`, which starts the auto-dismiss timer and announces `message`. */
|
|
1924
2924
|
open(): void;
|
|
2925
|
+
/** Hides the toast, clears the auto-dismiss timer and fires `dismissed`. It fires `dismissed` even when the toast was already hidden. */
|
|
1925
2926
|
close(): void;
|
|
1926
2927
|
private handleActionClick;
|
|
1927
2928
|
render(): lit_html.TemplateResult<1>;
|
|
@@ -1929,11 +2930,20 @@ declare class RelToast extends LitElement {
|
|
|
1929
2930
|
|
|
1930
2931
|
type TooltipPosition = "above" | "below" | "left" | "right";
|
|
1931
2932
|
type TooltipType = "single-line" | "multi-line";
|
|
2933
|
+
/**
|
|
2934
|
+
* Hover/focus tooltip (Figma "Tooltip"): wraps a trigger element and shows a short inverse-coloured text bubble above, below, left or right of it. Use it for supplementary hints on icons and truncated labels only — the text is not reachable on touch and must never be the only place critical information lives.
|
|
2935
|
+
* @slot - The trigger element (one focusable element such as a button or icon button). It receives `aria-describedby` pointing at the bubble.
|
|
2936
|
+
* @csspart panel - The tooltip bubble (`role="tooltip"`): background, padding, radius, shadow and max-width.
|
|
2937
|
+
* @csspart indicator - The triangular tail pointing at the trigger, rendered only when `show-tail` is set.
|
|
2938
|
+
*/
|
|
1932
2939
|
declare class RelTooltip extends LitElement {
|
|
2940
|
+
/** Plain-text content of the bubble. Empty text still renders an (empty) bubble on hover, so always set it. */
|
|
1933
2941
|
text: string;
|
|
2942
|
+
/** Side of the trigger the bubble appears on, 6px away and centred: `above`, `below`, `left` or `right`. No collision detection — pick a side with room in the viewport. */
|
|
1934
2943
|
position: TooltipPosition;
|
|
2944
|
+
/** Renders the triangular tail (`indicator` part) on the bubble's edge facing the trigger. */
|
|
1935
2945
|
showTail: boolean;
|
|
1936
|
-
/** Figma "Type": single-line
|
|
2946
|
+
/** Figma "Type": `single-line` keeps the text on one line and sizes to content; `multi-line` wraps inside a 220px max-width bubble. */
|
|
1937
2947
|
type: TooltipType;
|
|
1938
2948
|
private uniqueId;
|
|
1939
2949
|
static styles: lit.CSSResult;
|
|
@@ -2010,21 +3020,22 @@ interface UploadState {
|
|
|
2010
3020
|
* `<rel-upload-actions>` so they can sit in `<rel-modal>`'s footer slot and
|
|
2011
3021
|
* stay pinned while this body scrolls.
|
|
2012
3022
|
*
|
|
2013
|
-
*
|
|
2014
|
-
* - `rel-files-added` — `{ added: UploadFile[], rejected: UploadRejection[] }`
|
|
2015
|
-
* - `rel-invalid` — `{ rejected: UploadRejection[] }`
|
|
2016
|
-
* - `rel-change` — selection changed; `{ files: UploadFile[] }`
|
|
2017
|
-
* - `rel-remove` — row removed; `{ id, file }`
|
|
2018
|
-
* - `rel-upload` — Upload pressed; `{ files: UploadFile[] }`
|
|
2019
|
-
* - `rel-retry` — Retry pressed; `{ files: UploadFile[] }`
|
|
2020
|
-
* - `rel-cancel` — Cancel pressed
|
|
2021
|
-
* - `rel-progress` — `{ id, progress, loaded, total }`
|
|
2022
|
-
* - `rel-file-complete`— `{ id, file }`
|
|
2023
|
-
* - `rel-file-error` — `{ id, file, error }`
|
|
2024
|
-
* - `rel-complete` — batch settled; `{ succeeded, failed }`
|
|
2025
|
-
* - `rel-state` — derived snapshot changed; `detail: UploadState`
|
|
3023
|
+
* All events bubble and are composed.
|
|
2026
3024
|
*
|
|
2027
3025
|
* @element rel-upload
|
|
3026
|
+
* @fires rel-files-added - Fired after files are picked or dropped and validated. Detail: `{ added: UploadFile[], rejected: UploadRejection[] }`.
|
|
3027
|
+
* @fires rel-invalid - Fired just before `rel-files-added` when at least one picked file fails `accept` / `max-size`. Detail: `{ rejected: UploadRejection[] }`.
|
|
3028
|
+
* @fires rel-change - Fired whenever the file list changes (files added, a row removed, `reset()`). Detail: `{ files: UploadFile[] }`.
|
|
3029
|
+
* @fires rel-remove - Fired when a row is removed via its delete button or `removeFile()`. Detail: `{ id: string, file?: File }`.
|
|
3030
|
+
* @fires rel-upload - Fired when Upload is pressed (or `upload()` is called) with the rows still `ready`; in controlled mode the app performs the transfer. Detail: `{ files: UploadFile[] }`.
|
|
3031
|
+
* @fires rel-retry - Fired when Retry re-queues the retryable failed rows. Detail: `{ files: UploadFile[] }`.
|
|
3032
|
+
* @fires rel-cancel - Fired when Cancel is pressed (or `cancel()` is called); in-flight transfers are aborted, the list is kept. No detail.
|
|
3033
|
+
* @fires rel-progress - Fired on every progress tick in self-driving mode. Detail: `{ id: string, progress: number (0–100), loaded: number, total: number }` (bytes).
|
|
3034
|
+
* @fires rel-file-complete - Fired when one file finishes uploading in self-driving mode. Detail: `{ id: string, file: File }`.
|
|
3035
|
+
* @fires rel-file-error - Fired when one file's `uploader` rejects in self-driving mode. Detail: `{ id: string, file: File, error: string }`.
|
|
3036
|
+
* @fires rel-complete - Fired when the whole self-driving batch settles without being cancelled. Detail: `{ succeeded: UploadFile[], failed: UploadFile[] }`.
|
|
3037
|
+
* @fires rel-state - Fired when the derived `state` snapshot changes (and once after connecting). Detail: `UploadState`.
|
|
3038
|
+
* @cssprop --rel-upload-browse-hover-bg - Background of the Browse button on hover; falls back to `--rel-action-neutral-outline-hover`, then `--rel-bg-surface-elevated`
|
|
2028
3039
|
*/
|
|
2029
3040
|
declare class RelUpload extends LitElement {
|
|
2030
3041
|
/** Comma-separated accept list, e.g. ".pdf,.png,.jpg" or "image/*". */
|
|
@@ -2046,7 +3057,7 @@ declare class RelUpload extends LitElement {
|
|
|
2046
3057
|
* component also maintains it itself as files are added and removed.
|
|
2047
3058
|
*/
|
|
2048
3059
|
files: UploadFile[];
|
|
2049
|
-
/** Supply to
|
|
3060
|
+
/** Supply an `Uploader` `(file, { file, signal, onProgress }) => Promise<void>` to switch to self-driving mode: the component runs the batch itself with `concurrency`, progress, the delay alert, abort and retry. Unset (default) the component only emits intents. */
|
|
2050
3061
|
uploader?: Uploader;
|
|
2051
3062
|
/** Max files transferred at once in self-driving mode. */
|
|
2052
3063
|
concurrency: number;
|
|
@@ -2058,6 +3069,8 @@ declare class RelUpload extends LitElement {
|
|
|
2058
3069
|
private aborter?;
|
|
2059
3070
|
private delayTimer?;
|
|
2060
3071
|
private lastSignature;
|
|
3072
|
+
private lastHeading;
|
|
3073
|
+
private lastAlertText;
|
|
2061
3074
|
static styles: lit.CSSResult;
|
|
2062
3075
|
/**
|
|
2063
3076
|
* Aggregate state. Read-only; corresponds to the Figma modal variants.
|
|
@@ -2075,6 +3088,7 @@ declare class RelUpload extends LitElement {
|
|
|
2075
3088
|
* rather than re-queueing it blindly.
|
|
2076
3089
|
*/
|
|
2077
3090
|
private get retryable();
|
|
3091
|
+
/** Whether the primary action is enabled: not disabled, nothing in flight, and either `ready` rows exist or (in the failed phase) at least one failed row can be retried. */
|
|
2078
3092
|
get canUpload(): boolean;
|
|
2079
3093
|
/** Footer button label — "Upload", "Upload 3 files" or "Retry upload". */
|
|
2080
3094
|
get primaryLabel(): string;
|
|
@@ -2150,6 +3164,9 @@ declare global {
|
|
|
2150
3164
|
* specific `<rel-upload>` by id when a container holds more than one.
|
|
2151
3165
|
*
|
|
2152
3166
|
* @element rel-upload-actions
|
|
3167
|
+
* @csspart base - The right-aligned flex row holding the buttons
|
|
3168
|
+
* @csspart cancel - The secondary Cancel `rel-button` (absent when `no-cancel` is set)
|
|
3169
|
+
* @csspart primary - The primary Upload / Retry `rel-button`
|
|
2153
3170
|
*/
|
|
2154
3171
|
declare class RelUploadActions extends LitElement {
|
|
2155
3172
|
/** Id of the `<rel-upload>` to control. Omit to auto-discover a sibling. */
|
|
@@ -2238,8 +3255,7 @@ declare class FocusTrap {
|
|
|
2238
3255
|
*
|
|
2239
3256
|
* Shortcut strings are written as "+"-joined tokens, e.g. "mod+b",
|
|
2240
3257
|
* "ctrl+shift+p", "escape". The "mod" token means Cmd on Apple platforms
|
|
2241
|
-
* and Ctrl everywhere else
|
|
2242
|
-
* toggle established). Matching is case-insensitive.
|
|
3258
|
+
* and Ctrl everywhere else. Matching is case-insensitive.
|
|
2243
3259
|
*/
|
|
2244
3260
|
type ShortcutHandler = (e: KeyboardEvent) => void;
|
|
2245
3261
|
interface ParsedShortcut {
|
|
@@ -2282,4 +3298,25 @@ declare function bindShortcut(shortcut: string, handler: ShortcutHandler, option
|
|
|
2282
3298
|
*/
|
|
2283
3299
|
declare function formatShortcutParts(shortcut: string): string[];
|
|
2284
3300
|
|
|
2285
|
-
|
|
3301
|
+
/**
|
|
3302
|
+
* Shared screen-reader announcer.
|
|
3303
|
+
*
|
|
3304
|
+
* Maintains two persistent, visually-hidden live regions on document.body
|
|
3305
|
+
* (one polite, one assertive). Because the regions exist before any message
|
|
3306
|
+
* is written into them, text changes are reliably announced — unlike live
|
|
3307
|
+
* regions that are inserted into the DOM at the same moment as their content,
|
|
3308
|
+
* which most screen reader / browser pairs ignore.
|
|
3309
|
+
*
|
|
3310
|
+
* Messages are written on a short delay after clearing the region so that
|
|
3311
|
+
* repeating the same string (e.g. two identical toasts in a row) is
|
|
3312
|
+
* re-announced instead of deduplicated by the browser's accessibility tree.
|
|
3313
|
+
*/
|
|
3314
|
+
type Politeness = "polite" | "assertive";
|
|
3315
|
+
/**
|
|
3316
|
+
* Announce a message to screen reader users without moving focus.
|
|
3317
|
+
* Use "assertive" only for time-sensitive information (errors); everything
|
|
3318
|
+
* else should be "polite" so it does not interrupt the user mid-word.
|
|
3319
|
+
*/
|
|
3320
|
+
declare function announce(message: string, politeness?: Politeness): void;
|
|
3321
|
+
|
|
3322
|
+
export { type AlertTone, type AlertToneAlias, type AlertToneInput, type AutocompleteFilter, type AutocompleteItem, type AutocompleteSearchFn, type BindShortcutOptions, type BreadcrumbItem, type ButtonTone, type ButtonVariant, type ChipBorder, type ChipSize, type ChipTone, type ChipVariant, type ContainerBackground, type ContainerSurface, type DrawerCloseReason, type DrawerSide, type FieldLabelStyle, FocusTrap, type KbdSize, type LabelPlacement, type MenuItem, type MenuSize, type MenuType, type MenubarType, type ModalSide, type ModalSize, type ModalVariant, type Orientation, type OtpInputMode, type OtpSize, 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, RelOtp, RelPagination, RelPopover, RelPopoverContent, RelProgress, RelRadio, RelRangePicker, RelResizableGroup, RelResizableHandle, RelResizablePanel, RelSegmentedButton, RelSelect, RelSkeleton, RelSlider, RelSnackbar, RelStepper, RelSwitch, RelTab, RelTabItem, RelTextfield, RelTimePicker, RelToast, RelTooltip, 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 SnackbarTone, type SnackbarToneAlias, type SnackbarToneInput, type SnackbarType, type Step, type StepStatus, type StepperSize, type StepperType, type TabItem, type TabSize, type TextAlign, type TextFieldPrefixStyle, type TextFieldSize, type TextFieldState, type TextFieldVariant, type ToastTone, type ToastToneAlias, type ToastToneInput, type ToastType, type TooltipPosition, type TooltipType, type TrackStyle, type UploadFile, type UploadPhase, type UploadRejection, type UploadState, type UploadStatus, type Uploader, type UploaderContext, announce, bindShortcut, formatShortcutParts, getDeepActiveElement, getFocusableElements, isApplePlatform, isEditableTarget, matchesShortcut, parseShortcut, trapTabKey };
|