@reliability-design/web 1.4.2 → 1.4.3
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 +27 -0
- package/dist/components/rel-autocomplete/README.md +3 -1
- package/dist/components/rel-autocomplete/rel-autocomplete.ts +24 -2
- package/dist/components/rel-button/rel-button.ts +2 -2
- package/dist/components/rel-radio/README.md +16 -1
- package/dist/components/rel-radio/rel-radio.ts +52 -1
- package/dist/components/rel-select/README.md +6 -0
- package/dist/components/rel-select/rel-select.ts +58 -7
- package/dist/components/rel-textfield/README.md +16 -0
- package/dist/components/rel-textfield/rel-textfield.ts +104 -6
- package/dist/components/rel-time-picker/README.md +199 -0
- package/dist/components/rel-time-picker/rel-time-picker.ts +994 -0
- package/dist/index.d.mts +187 -38
- package/dist/index.d.ts +187 -38
- package/dist/index.js +1195 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1195 -90
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -34,6 +34,15 @@ declare class RelAlert extends LitElement {
|
|
|
34
34
|
type TextFieldState = "default" | "error" | "disabled";
|
|
35
35
|
type TextFieldSize = "small" | "medium" | "large";
|
|
36
36
|
type TextFieldVariant = "default" | "underline" | "legend";
|
|
37
|
+
/**
|
|
38
|
+
* How a field presents its label. Shared by `<rel-textfield>`, `<rel-select>`
|
|
39
|
+
* and `<rel-autocomplete>` so the three stay in step.
|
|
40
|
+
* - `"default"` — static label above the control
|
|
41
|
+
* - `"floating"` — label rests over the placeholder, animates onto the border
|
|
42
|
+
* - `"none"` — no label renders; supply `fieldAriaLabel` /
|
|
43
|
+
* `fieldAriaLabelledby` to keep an accessible name
|
|
44
|
+
*/
|
|
45
|
+
type FieldLabelStyle = "default" | "floating" | "none";
|
|
37
46
|
declare class RelTextfield extends LitElement {
|
|
38
47
|
label?: string;
|
|
39
48
|
placeholder: string;
|
|
@@ -49,7 +58,22 @@ declare class RelTextfield extends LitElement {
|
|
|
49
58
|
supportingText?: string;
|
|
50
59
|
state: TextFieldState;
|
|
51
60
|
size: TextFieldSize;
|
|
61
|
+
/**
|
|
62
|
+
* Label presentation. Left `undefined` the deprecated `floatingLabel` boolean
|
|
63
|
+
* decides, so existing markup keeps working; set explicitly and it wins.
|
|
64
|
+
* Declares `attribute` because Lit would otherwise only listen for the
|
|
65
|
+
* all-lowercase `labelstyle`.
|
|
66
|
+
*/
|
|
67
|
+
labelStyle?: FieldLabelStyle;
|
|
68
|
+
/** @deprecated Use `labelStyle="floating"`. Kept permanently as an alias. */
|
|
52
69
|
floatingLabel: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Accessible name for the input. Required when `labelStyle="none"`, since no
|
|
72
|
+
* `<label>` renders and a placeholder is not a valid naming mechanism.
|
|
73
|
+
*/
|
|
74
|
+
fieldAriaLabel?: string;
|
|
75
|
+
/** IDREF list of external element(s) naming the input. Wins over `fieldAriaLabel`. */
|
|
76
|
+
fieldAriaLabelledby?: string;
|
|
53
77
|
variant: TextFieldVariant;
|
|
54
78
|
disabled: boolean;
|
|
55
79
|
required: boolean;
|
|
@@ -71,8 +95,15 @@ declare class RelTextfield extends LitElement {
|
|
|
71
95
|
private get isError();
|
|
72
96
|
private get leadingIcon();
|
|
73
97
|
private get helper();
|
|
98
|
+
/** labelStyle supersedes the deprecated floatingLabel boolean. */
|
|
99
|
+
private get resolvedLabelStyle();
|
|
100
|
+
/** True when no visible label renders and the input needs an ARIA name. */
|
|
101
|
+
private get labelHidden();
|
|
74
102
|
static styles: lit.CSSResult;
|
|
75
103
|
connectedCallback(): void;
|
|
104
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
105
|
+
private _warnedNoName;
|
|
106
|
+
updated(): void;
|
|
76
107
|
/** Focuses the inner input/textarea (the host itself is not focusable). */
|
|
77
108
|
focus(options?: FocusOptions): void;
|
|
78
109
|
private handleFocus;
|
|
@@ -131,7 +162,14 @@ declare class RelAutocomplete extends LitElement {
|
|
|
131
162
|
placeholder: string;
|
|
132
163
|
size: TextFieldSize;
|
|
133
164
|
variant: TextFieldVariant;
|
|
165
|
+
/** See `FieldLabelStyle`. Left `undefined` the deprecated `floatingLabel` decides. */
|
|
166
|
+
labelStyle?: FieldLabelStyle;
|
|
167
|
+
/** @deprecated Use `labelStyle="floating"`. Kept permanently as an alias. */
|
|
134
168
|
floatingLabel: boolean;
|
|
169
|
+
/** Accessible name for the input. Required when `labelStyle="none"`. */
|
|
170
|
+
fieldAriaLabel?: string;
|
|
171
|
+
/** IDREF list of external element(s) naming the input. Wins over `fieldAriaLabel`. */
|
|
172
|
+
fieldAriaLabelledby?: string;
|
|
135
173
|
prefixIcon?: string;
|
|
136
174
|
disabled: boolean;
|
|
137
175
|
readonly: boolean;
|
|
@@ -156,6 +194,9 @@ declare class RelAutocomplete extends LitElement {
|
|
|
156
194
|
/** Set while a selection/clear updates `value` internally, so willUpdate
|
|
157
195
|
* doesn't overwrite the input text the way it does for external writes. */
|
|
158
196
|
private internalValueWrite;
|
|
197
|
+
/** Name used for the suggestion panel — the visible label, or fieldAriaLabel
|
|
198
|
+
* once labelStyle="none" hides it. Mirrors rel-textfield's own resolution. */
|
|
199
|
+
private get accessibleName();
|
|
159
200
|
static styles: lit.CSSResult;
|
|
160
201
|
disconnectedCallback(): void;
|
|
161
202
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
@@ -706,6 +747,42 @@ declare class RelLayout extends LitElement {
|
|
|
706
747
|
render(): lit_html.TemplateResult<1>;
|
|
707
748
|
}
|
|
708
749
|
|
|
750
|
+
type StepStatus = "done" | "progress" | "disabled";
|
|
751
|
+
type TextAlign = "right" | "below";
|
|
752
|
+
type Orientation = "horizontal" | "vertical";
|
|
753
|
+
type StepperSize = "small" | "large";
|
|
754
|
+
/** Figma "Type": indicator content — default (number, check when done), dot, number, icon. */
|
|
755
|
+
type StepperType = "default" | "dot" | "number" | "icon";
|
|
756
|
+
/** Figma "Typel": label placement relative to the indicator. */
|
|
757
|
+
type LabelPlacement = "top" | "centered" | "inverted";
|
|
758
|
+
interface Step {
|
|
759
|
+
title: string;
|
|
760
|
+
status: StepStatus;
|
|
761
|
+
}
|
|
762
|
+
declare class RelStepper extends LitElement {
|
|
763
|
+
steps: Step[];
|
|
764
|
+
textAlign: TextAlign;
|
|
765
|
+
orientation: Orientation;
|
|
766
|
+
size: StepperSize;
|
|
767
|
+
type: StepperType;
|
|
768
|
+
/**
|
|
769
|
+
* Figma Typel axis: top = label top-aligned beside the indicator,
|
|
770
|
+
* centered = label vertically centered beside it, inverted = indicator above
|
|
771
|
+
* the label. When unset, the legacy textAlign prop drives the layout
|
|
772
|
+
* (below ≈ inverted, right ≈ centered). Note Figma marks Top+Horizontal
|
|
773
|
+
* as an unsupported combination.
|
|
774
|
+
*/
|
|
775
|
+
labelPlacement?: LabelPlacement;
|
|
776
|
+
static styles: lit.CSSResult;
|
|
777
|
+
private isDone;
|
|
778
|
+
private isProgress;
|
|
779
|
+
private isDisabled;
|
|
780
|
+
private getStepClasses;
|
|
781
|
+
private onStepClick;
|
|
782
|
+
private renderIndicator;
|
|
783
|
+
render(): lit_html.TemplateResult<1>;
|
|
784
|
+
}
|
|
785
|
+
|
|
709
786
|
interface RadioOption {
|
|
710
787
|
value: string;
|
|
711
788
|
label: string;
|
|
@@ -715,6 +792,12 @@ interface RadioOption {
|
|
|
715
792
|
declare class RelRadio extends LitElement {
|
|
716
793
|
options: RadioOption[];
|
|
717
794
|
name: string;
|
|
795
|
+
/** Layout axis of the option list. `"vertical"` (default) stacks options in
|
|
796
|
+
* a column; `"horizontal"` lays them out in a wrapping row. */
|
|
797
|
+
orientation: Orientation;
|
|
798
|
+
/** Control scale. `"medium"` (default) = 20px circle with body-lg labels;
|
|
799
|
+
* `"small"` = 16px circle with body-md labels. */
|
|
800
|
+
size: "small" | "medium";
|
|
718
801
|
selectedValue: string | null;
|
|
719
802
|
disabled: boolean;
|
|
720
803
|
error: boolean;
|
|
@@ -1301,7 +1384,8 @@ declare class RelSegmentedButton extends LitElement {
|
|
|
1301
1384
|
type SelectState = "default" | "error" | "disabled";
|
|
1302
1385
|
type SelectSize = "small" | "medium" | "large";
|
|
1303
1386
|
type SelectBorder = "rounded" | "sharp";
|
|
1304
|
-
type
|
|
1387
|
+
/** Alias of the shared field type — kept so existing imports keep resolving. */
|
|
1388
|
+
type SelectLabelStyle = FieldLabelStyle;
|
|
1305
1389
|
interface SelectOptionObject {
|
|
1306
1390
|
value: string;
|
|
1307
1391
|
label?: string;
|
|
@@ -1313,6 +1397,13 @@ type SelectOption = string | SelectOptionObject;
|
|
|
1313
1397
|
declare class RelSelect extends LitElement {
|
|
1314
1398
|
label: string;
|
|
1315
1399
|
labelStyle: SelectLabelStyle;
|
|
1400
|
+
/**
|
|
1401
|
+
* Accessible name for the trigger. Required when `labelStyle="none"`, since no
|
|
1402
|
+
* `<label>` renders and a placeholder is not a valid naming mechanism.
|
|
1403
|
+
*/
|
|
1404
|
+
fieldAriaLabel?: string;
|
|
1405
|
+
/** IDREF list of external element(s) naming the trigger. Wins over `fieldAriaLabel`. */
|
|
1406
|
+
fieldAriaLabelledby?: string;
|
|
1316
1407
|
options: SelectOption[];
|
|
1317
1408
|
/** Enables multi-select: selected values render as removable chips and options as checkboxes. */
|
|
1318
1409
|
multiple: boolean;
|
|
@@ -1358,6 +1449,7 @@ declare class RelSelect extends LitElement {
|
|
|
1358
1449
|
disconnectedCallback(): void;
|
|
1359
1450
|
protected firstUpdated(): void;
|
|
1360
1451
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
1452
|
+
private _warnedNoName;
|
|
1361
1453
|
protected updated(changed: PropertyValues<this>): void;
|
|
1362
1454
|
/**
|
|
1363
1455
|
* Width-adaptive chip collapsing: measures every selected chip in the
|
|
@@ -1542,42 +1634,6 @@ declare class RelSnackbar extends LitElement {
|
|
|
1542
1634
|
render(): lit_html.TemplateResult<1>;
|
|
1543
1635
|
}
|
|
1544
1636
|
|
|
1545
|
-
type StepStatus = "done" | "progress" | "disabled";
|
|
1546
|
-
type TextAlign = "right" | "below";
|
|
1547
|
-
type Orientation = "horizontal" | "vertical";
|
|
1548
|
-
type StepperSize = "small" | "large";
|
|
1549
|
-
/** Figma "Type": indicator content — default (number, check when done), dot, number, icon. */
|
|
1550
|
-
type StepperType = "default" | "dot" | "number" | "icon";
|
|
1551
|
-
/** Figma "Typel": label placement relative to the indicator. */
|
|
1552
|
-
type LabelPlacement = "top" | "centered" | "inverted";
|
|
1553
|
-
interface Step {
|
|
1554
|
-
title: string;
|
|
1555
|
-
status: StepStatus;
|
|
1556
|
-
}
|
|
1557
|
-
declare class RelStepper extends LitElement {
|
|
1558
|
-
steps: Step[];
|
|
1559
|
-
textAlign: TextAlign;
|
|
1560
|
-
orientation: Orientation;
|
|
1561
|
-
size: StepperSize;
|
|
1562
|
-
type: StepperType;
|
|
1563
|
-
/**
|
|
1564
|
-
* Figma Typel axis: top = label top-aligned beside the indicator,
|
|
1565
|
-
* centered = label vertically centered beside it, inverted = indicator above
|
|
1566
|
-
* the label. When unset, the legacy textAlign prop drives the layout
|
|
1567
|
-
* (below ≈ inverted, right ≈ centered). Note Figma marks Top+Horizontal
|
|
1568
|
-
* as an unsupported combination.
|
|
1569
|
-
*/
|
|
1570
|
-
labelPlacement?: LabelPlacement;
|
|
1571
|
-
static styles: lit.CSSResult;
|
|
1572
|
-
private isDone;
|
|
1573
|
-
private isProgress;
|
|
1574
|
-
private isDisabled;
|
|
1575
|
-
private getStepClasses;
|
|
1576
|
-
private onStepClick;
|
|
1577
|
-
private renderIndicator;
|
|
1578
|
-
render(): lit_html.TemplateResult<1>;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
1637
|
declare class RelSwitch extends LitElement {
|
|
1582
1638
|
checked: boolean;
|
|
1583
1639
|
disabled: boolean;
|
|
@@ -1627,6 +1683,99 @@ declare class RelTab extends LitElement {
|
|
|
1627
1683
|
render(): lit_html.TemplateResult<1>;
|
|
1628
1684
|
}
|
|
1629
1685
|
|
|
1686
|
+
/**
|
|
1687
|
+
* `<rel-time-picker>` — time selection field.
|
|
1688
|
+
*
|
|
1689
|
+
* Follows the rel-date-picker trigger/field conventions (label, helper/error
|
|
1690
|
+
* text, sizes, fullWidth, clearable) and the rel-range-picker draft model:
|
|
1691
|
+
* column selections are held in draft state until Apply is clicked; Cancel,
|
|
1692
|
+
* Escape, or an outside click discards the draft.
|
|
1693
|
+
*
|
|
1694
|
+
* The committed `value` is ALWAYS 24-hour "HH:mm" regardless of the display
|
|
1695
|
+
* `format`, so consumers get a consistent machine-readable string.
|
|
1696
|
+
*/
|
|
1697
|
+
declare class RelTimePicker extends LitElement {
|
|
1698
|
+
/** Committed time, 24-hour "HH:mm" (e.g. "09:30", "17:05"). */
|
|
1699
|
+
value: string | null;
|
|
1700
|
+
placeholder: string;
|
|
1701
|
+
label: string | null;
|
|
1702
|
+
disabled: boolean;
|
|
1703
|
+
required: boolean;
|
|
1704
|
+
readonly: boolean;
|
|
1705
|
+
/** Display format of the trigger text and hour column. Value stays "HH:mm". */
|
|
1706
|
+
format: "12h" | "24h";
|
|
1707
|
+
/** Minute granularity of the minutes column (1, 5, 10, 15, 30, …). */
|
|
1708
|
+
minuteStep: number;
|
|
1709
|
+
/** Earliest selectable time, "HH:mm" (inclusive). */
|
|
1710
|
+
minTime: string | null;
|
|
1711
|
+
/** Latest selectable time, "HH:mm" (inclusive). */
|
|
1712
|
+
maxTime: string | null;
|
|
1713
|
+
open: boolean;
|
|
1714
|
+
clearable: boolean;
|
|
1715
|
+
error: boolean;
|
|
1716
|
+
/** Alias for `error` (requested-API compat); either flag applies error styling. */
|
|
1717
|
+
invalid: boolean;
|
|
1718
|
+
errorMessage?: string;
|
|
1719
|
+
helperText?: string;
|
|
1720
|
+
name?: string;
|
|
1721
|
+
size: "small" | "medium" | "large";
|
|
1722
|
+
variant: "outlined";
|
|
1723
|
+
fullWidth: boolean;
|
|
1724
|
+
private draftHour;
|
|
1725
|
+
private draftMinute;
|
|
1726
|
+
private triggerButton?;
|
|
1727
|
+
private columnsElement?;
|
|
1728
|
+
static styles: lit.CSSResult;
|
|
1729
|
+
connectedCallback(): void;
|
|
1730
|
+
disconnectedCallback(): void;
|
|
1731
|
+
private handleClickOutside;
|
|
1732
|
+
private handleEscapeKey;
|
|
1733
|
+
updated(changedProperties: Map<string, any>): void;
|
|
1734
|
+
private parseTime;
|
|
1735
|
+
private formatValue;
|
|
1736
|
+
private formatDisplay;
|
|
1737
|
+
private toMinutes;
|
|
1738
|
+
private get minuteStepSafe();
|
|
1739
|
+
private get minBoundMinutes();
|
|
1740
|
+
private get maxBoundMinutes();
|
|
1741
|
+
private isTimeInRange;
|
|
1742
|
+
/** Minutes shown in the minutes column (respecting minuteStep). */
|
|
1743
|
+
private getMinuteOptions;
|
|
1744
|
+
/** An hour is enabled if at least one of its step minutes is in range. */
|
|
1745
|
+
private isHourEnabled;
|
|
1746
|
+
private isPeriodEnabled;
|
|
1747
|
+
/** Hour column entries: display label + the 0–23 hour it maps to. */
|
|
1748
|
+
private getHourOptions;
|
|
1749
|
+
private get draftPeriod();
|
|
1750
|
+
private resetDraftFromValue;
|
|
1751
|
+
/** Snap the draft minute to the nearest valid step minute for the hour. */
|
|
1752
|
+
private clampDraftToRange;
|
|
1753
|
+
private toggleTimePopover;
|
|
1754
|
+
/** Close discarding the draft (Cancel / Escape / outside click). */
|
|
1755
|
+
private cancelPopover;
|
|
1756
|
+
private applySelection;
|
|
1757
|
+
/** Set the draft to the current time, snapped to the minute step and range. */
|
|
1758
|
+
private selectNow;
|
|
1759
|
+
private clearValue;
|
|
1760
|
+
private selectHour;
|
|
1761
|
+
private selectMinute;
|
|
1762
|
+
private selectPeriod;
|
|
1763
|
+
private scrollColumnsToSelection;
|
|
1764
|
+
private handleTriggerKeydown;
|
|
1765
|
+
/**
|
|
1766
|
+
* Column navigation: Up/Down move within the column (and select), Left/Right
|
|
1767
|
+
* jump between columns, Home/End go to the first/last option, Enter applies.
|
|
1768
|
+
*/
|
|
1769
|
+
private handleOptionKeydown;
|
|
1770
|
+
private focusAdjacentColumn;
|
|
1771
|
+
render(): lit_html.TemplateResult<1>;
|
|
1772
|
+
}
|
|
1773
|
+
declare global {
|
|
1774
|
+
interface HTMLElementTagNameMap {
|
|
1775
|
+
"rel-time-picker": RelTimePicker;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1630
1779
|
type ToastType = "default" | "error";
|
|
1631
1780
|
declare class RelToast extends LitElement {
|
|
1632
1781
|
message: string;
|
|
@@ -1660,4 +1809,4 @@ declare class RelTooltip extends LitElement {
|
|
|
1660
1809
|
render(): lit_html.TemplateResult<1>;
|
|
1661
1810
|
}
|
|
1662
1811
|
|
|
1663
|
-
export { type AutocompleteFilter, type AutocompleteItem, type AutocompleteSearchFn, type BreadcrumbItem, type ButtonTone, type ButtonVariant, type ChipBorder, type ChipSize, type ChipTone, type ChipVariant, type DrawerCloseReason, type DrawerSide, type LabelPlacement, type MenuItem, type MenuType, type ModalSide, type Orientation, type OtpType, type ProgressMode, type RadioOption, RelAccordion, RelAlert, RelAutocomplete, RelAvatar, RelBadge, RelBreadcrumbs, RelButton, RelCalendar, RelCard, RelCardMedia, RelCarousel, RelCheckbox, RelChip, RelContainer, RelDatePicker, RelDivider, RelDrawer, RelDrawerFooter, RelKbd, RelKbdGroup, RelLayout, RelMenu, RelMenuItem, RelMenubar, RelMenubarMenu, RelModal, RelNavbar, RelOtp, RelPagination, RelPopover, RelPopoverContent, RelProgress, RelRadio, RelRangePicker, RelResizableGroup, RelResizableHandle, RelResizablePanel, RelSegmentedButton, RelSelect, RelSkeleton, RelSlider, RelSnackbar, RelStepper, RelSwitch, RelTab, RelTabItem, RelTextfield, RelToast, RelTooltip, RelTopbar, RelTopbarActions, RelTopbarBrand, RelTopbarDropdown, RelTopbarDropdownItem, RelTopbarItem, RelTopbarMobilePanel, RelTopbarProfile, RelTopbarUtilities, type SegmentAlign, type SegmentOption, type SegmentSize, type SelectBorder, type SelectLabelStyle, type SelectOption, type SelectOptionObject, type SelectSize, type SelectState, type SkeletonAnimation, type SkeletonShape, type SliderType, type SnackbarLines, type SnackbarType, type Step, type StepStatus, type StepperSize, type StepperType, type TabItem, type TextAlign, type TextFieldSize, type TextFieldState, type TextFieldVariant, type ToastType, type TooltipPosition, type TooltipType, type TopbarForceLayout, type TopbarProfileType, type TopbarRewardTier, type TopbarVariant, type TrackStyle };
|
|
1812
|
+
export { type AutocompleteFilter, type AutocompleteItem, type AutocompleteSearchFn, type BreadcrumbItem, type ButtonTone, type ButtonVariant, type ChipBorder, type ChipSize, type ChipTone, type ChipVariant, type DrawerCloseReason, type DrawerSide, type FieldLabelStyle, type LabelPlacement, type MenuItem, type MenuType, type ModalSide, type Orientation, type OtpType, type ProgressMode, type RadioOption, RelAccordion, RelAlert, RelAutocomplete, RelAvatar, RelBadge, RelBreadcrumbs, RelButton, RelCalendar, RelCard, RelCardMedia, RelCarousel, RelCheckbox, RelChip, RelContainer, RelDatePicker, RelDivider, RelDrawer, RelDrawerFooter, RelKbd, RelKbdGroup, RelLayout, RelMenu, RelMenuItem, RelMenubar, RelMenubarMenu, RelModal, RelNavbar, RelOtp, RelPagination, RelPopover, RelPopoverContent, RelProgress, RelRadio, RelRangePicker, RelResizableGroup, RelResizableHandle, RelResizablePanel, RelSegmentedButton, RelSelect, RelSkeleton, RelSlider, RelSnackbar, RelStepper, RelSwitch, RelTab, RelTabItem, RelTextfield, RelTimePicker, RelToast, RelTooltip, RelTopbar, RelTopbarActions, RelTopbarBrand, RelTopbarDropdown, RelTopbarDropdownItem, RelTopbarItem, RelTopbarMobilePanel, RelTopbarProfile, RelTopbarUtilities, type SegmentAlign, type SegmentOption, type SegmentSize, type SelectBorder, type SelectLabelStyle, type SelectOption, type SelectOptionObject, type SelectSize, type SelectState, type SkeletonAnimation, type SkeletonShape, type SliderType, type SnackbarLines, type SnackbarType, type Step, type StepStatus, type StepperSize, type StepperType, type TabItem, type TextAlign, type TextFieldSize, type TextFieldState, type TextFieldVariant, type ToastType, type TooltipPosition, type TooltipType, type TopbarForceLayout, type TopbarProfileType, type TopbarRewardTier, type TopbarVariant, type TrackStyle };
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,15 @@ declare class RelAlert extends LitElement {
|
|
|
34
34
|
type TextFieldState = "default" | "error" | "disabled";
|
|
35
35
|
type TextFieldSize = "small" | "medium" | "large";
|
|
36
36
|
type TextFieldVariant = "default" | "underline" | "legend";
|
|
37
|
+
/**
|
|
38
|
+
* How a field presents its label. Shared by `<rel-textfield>`, `<rel-select>`
|
|
39
|
+
* and `<rel-autocomplete>` so the three stay in step.
|
|
40
|
+
* - `"default"` — static label above the control
|
|
41
|
+
* - `"floating"` — label rests over the placeholder, animates onto the border
|
|
42
|
+
* - `"none"` — no label renders; supply `fieldAriaLabel` /
|
|
43
|
+
* `fieldAriaLabelledby` to keep an accessible name
|
|
44
|
+
*/
|
|
45
|
+
type FieldLabelStyle = "default" | "floating" | "none";
|
|
37
46
|
declare class RelTextfield extends LitElement {
|
|
38
47
|
label?: string;
|
|
39
48
|
placeholder: string;
|
|
@@ -49,7 +58,22 @@ declare class RelTextfield extends LitElement {
|
|
|
49
58
|
supportingText?: string;
|
|
50
59
|
state: TextFieldState;
|
|
51
60
|
size: TextFieldSize;
|
|
61
|
+
/**
|
|
62
|
+
* Label presentation. Left `undefined` the deprecated `floatingLabel` boolean
|
|
63
|
+
* decides, so existing markup keeps working; set explicitly and it wins.
|
|
64
|
+
* Declares `attribute` because Lit would otherwise only listen for the
|
|
65
|
+
* all-lowercase `labelstyle`.
|
|
66
|
+
*/
|
|
67
|
+
labelStyle?: FieldLabelStyle;
|
|
68
|
+
/** @deprecated Use `labelStyle="floating"`. Kept permanently as an alias. */
|
|
52
69
|
floatingLabel: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Accessible name for the input. Required when `labelStyle="none"`, since no
|
|
72
|
+
* `<label>` renders and a placeholder is not a valid naming mechanism.
|
|
73
|
+
*/
|
|
74
|
+
fieldAriaLabel?: string;
|
|
75
|
+
/** IDREF list of external element(s) naming the input. Wins over `fieldAriaLabel`. */
|
|
76
|
+
fieldAriaLabelledby?: string;
|
|
53
77
|
variant: TextFieldVariant;
|
|
54
78
|
disabled: boolean;
|
|
55
79
|
required: boolean;
|
|
@@ -71,8 +95,15 @@ declare class RelTextfield extends LitElement {
|
|
|
71
95
|
private get isError();
|
|
72
96
|
private get leadingIcon();
|
|
73
97
|
private get helper();
|
|
98
|
+
/** labelStyle supersedes the deprecated floatingLabel boolean. */
|
|
99
|
+
private get resolvedLabelStyle();
|
|
100
|
+
/** True when no visible label renders and the input needs an ARIA name. */
|
|
101
|
+
private get labelHidden();
|
|
74
102
|
static styles: lit.CSSResult;
|
|
75
103
|
connectedCallback(): void;
|
|
104
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
105
|
+
private _warnedNoName;
|
|
106
|
+
updated(): void;
|
|
76
107
|
/** Focuses the inner input/textarea (the host itself is not focusable). */
|
|
77
108
|
focus(options?: FocusOptions): void;
|
|
78
109
|
private handleFocus;
|
|
@@ -131,7 +162,14 @@ declare class RelAutocomplete extends LitElement {
|
|
|
131
162
|
placeholder: string;
|
|
132
163
|
size: TextFieldSize;
|
|
133
164
|
variant: TextFieldVariant;
|
|
165
|
+
/** See `FieldLabelStyle`. Left `undefined` the deprecated `floatingLabel` decides. */
|
|
166
|
+
labelStyle?: FieldLabelStyle;
|
|
167
|
+
/** @deprecated Use `labelStyle="floating"`. Kept permanently as an alias. */
|
|
134
168
|
floatingLabel: boolean;
|
|
169
|
+
/** Accessible name for the input. Required when `labelStyle="none"`. */
|
|
170
|
+
fieldAriaLabel?: string;
|
|
171
|
+
/** IDREF list of external element(s) naming the input. Wins over `fieldAriaLabel`. */
|
|
172
|
+
fieldAriaLabelledby?: string;
|
|
135
173
|
prefixIcon?: string;
|
|
136
174
|
disabled: boolean;
|
|
137
175
|
readonly: boolean;
|
|
@@ -156,6 +194,9 @@ declare class RelAutocomplete extends LitElement {
|
|
|
156
194
|
/** Set while a selection/clear updates `value` internally, so willUpdate
|
|
157
195
|
* doesn't overwrite the input text the way it does for external writes. */
|
|
158
196
|
private internalValueWrite;
|
|
197
|
+
/** Name used for the suggestion panel — the visible label, or fieldAriaLabel
|
|
198
|
+
* once labelStyle="none" hides it. Mirrors rel-textfield's own resolution. */
|
|
199
|
+
private get accessibleName();
|
|
159
200
|
static styles: lit.CSSResult;
|
|
160
201
|
disconnectedCallback(): void;
|
|
161
202
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
@@ -706,6 +747,42 @@ declare class RelLayout extends LitElement {
|
|
|
706
747
|
render(): lit_html.TemplateResult<1>;
|
|
707
748
|
}
|
|
708
749
|
|
|
750
|
+
type StepStatus = "done" | "progress" | "disabled";
|
|
751
|
+
type TextAlign = "right" | "below";
|
|
752
|
+
type Orientation = "horizontal" | "vertical";
|
|
753
|
+
type StepperSize = "small" | "large";
|
|
754
|
+
/** Figma "Type": indicator content — default (number, check when done), dot, number, icon. */
|
|
755
|
+
type StepperType = "default" | "dot" | "number" | "icon";
|
|
756
|
+
/** Figma "Typel": label placement relative to the indicator. */
|
|
757
|
+
type LabelPlacement = "top" | "centered" | "inverted";
|
|
758
|
+
interface Step {
|
|
759
|
+
title: string;
|
|
760
|
+
status: StepStatus;
|
|
761
|
+
}
|
|
762
|
+
declare class RelStepper extends LitElement {
|
|
763
|
+
steps: Step[];
|
|
764
|
+
textAlign: TextAlign;
|
|
765
|
+
orientation: Orientation;
|
|
766
|
+
size: StepperSize;
|
|
767
|
+
type: StepperType;
|
|
768
|
+
/**
|
|
769
|
+
* Figma Typel axis: top = label top-aligned beside the indicator,
|
|
770
|
+
* centered = label vertically centered beside it, inverted = indicator above
|
|
771
|
+
* the label. When unset, the legacy textAlign prop drives the layout
|
|
772
|
+
* (below ≈ inverted, right ≈ centered). Note Figma marks Top+Horizontal
|
|
773
|
+
* as an unsupported combination.
|
|
774
|
+
*/
|
|
775
|
+
labelPlacement?: LabelPlacement;
|
|
776
|
+
static styles: lit.CSSResult;
|
|
777
|
+
private isDone;
|
|
778
|
+
private isProgress;
|
|
779
|
+
private isDisabled;
|
|
780
|
+
private getStepClasses;
|
|
781
|
+
private onStepClick;
|
|
782
|
+
private renderIndicator;
|
|
783
|
+
render(): lit_html.TemplateResult<1>;
|
|
784
|
+
}
|
|
785
|
+
|
|
709
786
|
interface RadioOption {
|
|
710
787
|
value: string;
|
|
711
788
|
label: string;
|
|
@@ -715,6 +792,12 @@ interface RadioOption {
|
|
|
715
792
|
declare class RelRadio extends LitElement {
|
|
716
793
|
options: RadioOption[];
|
|
717
794
|
name: string;
|
|
795
|
+
/** Layout axis of the option list. `"vertical"` (default) stacks options in
|
|
796
|
+
* a column; `"horizontal"` lays them out in a wrapping row. */
|
|
797
|
+
orientation: Orientation;
|
|
798
|
+
/** Control scale. `"medium"` (default) = 20px circle with body-lg labels;
|
|
799
|
+
* `"small"` = 16px circle with body-md labels. */
|
|
800
|
+
size: "small" | "medium";
|
|
718
801
|
selectedValue: string | null;
|
|
719
802
|
disabled: boolean;
|
|
720
803
|
error: boolean;
|
|
@@ -1301,7 +1384,8 @@ declare class RelSegmentedButton extends LitElement {
|
|
|
1301
1384
|
type SelectState = "default" | "error" | "disabled";
|
|
1302
1385
|
type SelectSize = "small" | "medium" | "large";
|
|
1303
1386
|
type SelectBorder = "rounded" | "sharp";
|
|
1304
|
-
type
|
|
1387
|
+
/** Alias of the shared field type — kept so existing imports keep resolving. */
|
|
1388
|
+
type SelectLabelStyle = FieldLabelStyle;
|
|
1305
1389
|
interface SelectOptionObject {
|
|
1306
1390
|
value: string;
|
|
1307
1391
|
label?: string;
|
|
@@ -1313,6 +1397,13 @@ type SelectOption = string | SelectOptionObject;
|
|
|
1313
1397
|
declare class RelSelect extends LitElement {
|
|
1314
1398
|
label: string;
|
|
1315
1399
|
labelStyle: SelectLabelStyle;
|
|
1400
|
+
/**
|
|
1401
|
+
* Accessible name for the trigger. Required when `labelStyle="none"`, since no
|
|
1402
|
+
* `<label>` renders and a placeholder is not a valid naming mechanism.
|
|
1403
|
+
*/
|
|
1404
|
+
fieldAriaLabel?: string;
|
|
1405
|
+
/** IDREF list of external element(s) naming the trigger. Wins over `fieldAriaLabel`. */
|
|
1406
|
+
fieldAriaLabelledby?: string;
|
|
1316
1407
|
options: SelectOption[];
|
|
1317
1408
|
/** Enables multi-select: selected values render as removable chips and options as checkboxes. */
|
|
1318
1409
|
multiple: boolean;
|
|
@@ -1358,6 +1449,7 @@ declare class RelSelect extends LitElement {
|
|
|
1358
1449
|
disconnectedCallback(): void;
|
|
1359
1450
|
protected firstUpdated(): void;
|
|
1360
1451
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
1452
|
+
private _warnedNoName;
|
|
1361
1453
|
protected updated(changed: PropertyValues<this>): void;
|
|
1362
1454
|
/**
|
|
1363
1455
|
* Width-adaptive chip collapsing: measures every selected chip in the
|
|
@@ -1542,42 +1634,6 @@ declare class RelSnackbar extends LitElement {
|
|
|
1542
1634
|
render(): lit_html.TemplateResult<1>;
|
|
1543
1635
|
}
|
|
1544
1636
|
|
|
1545
|
-
type StepStatus = "done" | "progress" | "disabled";
|
|
1546
|
-
type TextAlign = "right" | "below";
|
|
1547
|
-
type Orientation = "horizontal" | "vertical";
|
|
1548
|
-
type StepperSize = "small" | "large";
|
|
1549
|
-
/** Figma "Type": indicator content — default (number, check when done), dot, number, icon. */
|
|
1550
|
-
type StepperType = "default" | "dot" | "number" | "icon";
|
|
1551
|
-
/** Figma "Typel": label placement relative to the indicator. */
|
|
1552
|
-
type LabelPlacement = "top" | "centered" | "inverted";
|
|
1553
|
-
interface Step {
|
|
1554
|
-
title: string;
|
|
1555
|
-
status: StepStatus;
|
|
1556
|
-
}
|
|
1557
|
-
declare class RelStepper extends LitElement {
|
|
1558
|
-
steps: Step[];
|
|
1559
|
-
textAlign: TextAlign;
|
|
1560
|
-
orientation: Orientation;
|
|
1561
|
-
size: StepperSize;
|
|
1562
|
-
type: StepperType;
|
|
1563
|
-
/**
|
|
1564
|
-
* Figma Typel axis: top = label top-aligned beside the indicator,
|
|
1565
|
-
* centered = label vertically centered beside it, inverted = indicator above
|
|
1566
|
-
* the label. When unset, the legacy textAlign prop drives the layout
|
|
1567
|
-
* (below ≈ inverted, right ≈ centered). Note Figma marks Top+Horizontal
|
|
1568
|
-
* as an unsupported combination.
|
|
1569
|
-
*/
|
|
1570
|
-
labelPlacement?: LabelPlacement;
|
|
1571
|
-
static styles: lit.CSSResult;
|
|
1572
|
-
private isDone;
|
|
1573
|
-
private isProgress;
|
|
1574
|
-
private isDisabled;
|
|
1575
|
-
private getStepClasses;
|
|
1576
|
-
private onStepClick;
|
|
1577
|
-
private renderIndicator;
|
|
1578
|
-
render(): lit_html.TemplateResult<1>;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
1637
|
declare class RelSwitch extends LitElement {
|
|
1582
1638
|
checked: boolean;
|
|
1583
1639
|
disabled: boolean;
|
|
@@ -1627,6 +1683,99 @@ declare class RelTab extends LitElement {
|
|
|
1627
1683
|
render(): lit_html.TemplateResult<1>;
|
|
1628
1684
|
}
|
|
1629
1685
|
|
|
1686
|
+
/**
|
|
1687
|
+
* `<rel-time-picker>` — time selection field.
|
|
1688
|
+
*
|
|
1689
|
+
* Follows the rel-date-picker trigger/field conventions (label, helper/error
|
|
1690
|
+
* text, sizes, fullWidth, clearable) and the rel-range-picker draft model:
|
|
1691
|
+
* column selections are held in draft state until Apply is clicked; Cancel,
|
|
1692
|
+
* Escape, or an outside click discards the draft.
|
|
1693
|
+
*
|
|
1694
|
+
* The committed `value` is ALWAYS 24-hour "HH:mm" regardless of the display
|
|
1695
|
+
* `format`, so consumers get a consistent machine-readable string.
|
|
1696
|
+
*/
|
|
1697
|
+
declare class RelTimePicker extends LitElement {
|
|
1698
|
+
/** Committed time, 24-hour "HH:mm" (e.g. "09:30", "17:05"). */
|
|
1699
|
+
value: string | null;
|
|
1700
|
+
placeholder: string;
|
|
1701
|
+
label: string | null;
|
|
1702
|
+
disabled: boolean;
|
|
1703
|
+
required: boolean;
|
|
1704
|
+
readonly: boolean;
|
|
1705
|
+
/** Display format of the trigger text and hour column. Value stays "HH:mm". */
|
|
1706
|
+
format: "12h" | "24h";
|
|
1707
|
+
/** Minute granularity of the minutes column (1, 5, 10, 15, 30, …). */
|
|
1708
|
+
minuteStep: number;
|
|
1709
|
+
/** Earliest selectable time, "HH:mm" (inclusive). */
|
|
1710
|
+
minTime: string | null;
|
|
1711
|
+
/** Latest selectable time, "HH:mm" (inclusive). */
|
|
1712
|
+
maxTime: string | null;
|
|
1713
|
+
open: boolean;
|
|
1714
|
+
clearable: boolean;
|
|
1715
|
+
error: boolean;
|
|
1716
|
+
/** Alias for `error` (requested-API compat); either flag applies error styling. */
|
|
1717
|
+
invalid: boolean;
|
|
1718
|
+
errorMessage?: string;
|
|
1719
|
+
helperText?: string;
|
|
1720
|
+
name?: string;
|
|
1721
|
+
size: "small" | "medium" | "large";
|
|
1722
|
+
variant: "outlined";
|
|
1723
|
+
fullWidth: boolean;
|
|
1724
|
+
private draftHour;
|
|
1725
|
+
private draftMinute;
|
|
1726
|
+
private triggerButton?;
|
|
1727
|
+
private columnsElement?;
|
|
1728
|
+
static styles: lit.CSSResult;
|
|
1729
|
+
connectedCallback(): void;
|
|
1730
|
+
disconnectedCallback(): void;
|
|
1731
|
+
private handleClickOutside;
|
|
1732
|
+
private handleEscapeKey;
|
|
1733
|
+
updated(changedProperties: Map<string, any>): void;
|
|
1734
|
+
private parseTime;
|
|
1735
|
+
private formatValue;
|
|
1736
|
+
private formatDisplay;
|
|
1737
|
+
private toMinutes;
|
|
1738
|
+
private get minuteStepSafe();
|
|
1739
|
+
private get minBoundMinutes();
|
|
1740
|
+
private get maxBoundMinutes();
|
|
1741
|
+
private isTimeInRange;
|
|
1742
|
+
/** Minutes shown in the minutes column (respecting minuteStep). */
|
|
1743
|
+
private getMinuteOptions;
|
|
1744
|
+
/** An hour is enabled if at least one of its step minutes is in range. */
|
|
1745
|
+
private isHourEnabled;
|
|
1746
|
+
private isPeriodEnabled;
|
|
1747
|
+
/** Hour column entries: display label + the 0–23 hour it maps to. */
|
|
1748
|
+
private getHourOptions;
|
|
1749
|
+
private get draftPeriod();
|
|
1750
|
+
private resetDraftFromValue;
|
|
1751
|
+
/** Snap the draft minute to the nearest valid step minute for the hour. */
|
|
1752
|
+
private clampDraftToRange;
|
|
1753
|
+
private toggleTimePopover;
|
|
1754
|
+
/** Close discarding the draft (Cancel / Escape / outside click). */
|
|
1755
|
+
private cancelPopover;
|
|
1756
|
+
private applySelection;
|
|
1757
|
+
/** Set the draft to the current time, snapped to the minute step and range. */
|
|
1758
|
+
private selectNow;
|
|
1759
|
+
private clearValue;
|
|
1760
|
+
private selectHour;
|
|
1761
|
+
private selectMinute;
|
|
1762
|
+
private selectPeriod;
|
|
1763
|
+
private scrollColumnsToSelection;
|
|
1764
|
+
private handleTriggerKeydown;
|
|
1765
|
+
/**
|
|
1766
|
+
* Column navigation: Up/Down move within the column (and select), Left/Right
|
|
1767
|
+
* jump between columns, Home/End go to the first/last option, Enter applies.
|
|
1768
|
+
*/
|
|
1769
|
+
private handleOptionKeydown;
|
|
1770
|
+
private focusAdjacentColumn;
|
|
1771
|
+
render(): lit_html.TemplateResult<1>;
|
|
1772
|
+
}
|
|
1773
|
+
declare global {
|
|
1774
|
+
interface HTMLElementTagNameMap {
|
|
1775
|
+
"rel-time-picker": RelTimePicker;
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1630
1779
|
type ToastType = "default" | "error";
|
|
1631
1780
|
declare class RelToast extends LitElement {
|
|
1632
1781
|
message: string;
|
|
@@ -1660,4 +1809,4 @@ declare class RelTooltip extends LitElement {
|
|
|
1660
1809
|
render(): lit_html.TemplateResult<1>;
|
|
1661
1810
|
}
|
|
1662
1811
|
|
|
1663
|
-
export { type AutocompleteFilter, type AutocompleteItem, type AutocompleteSearchFn, type BreadcrumbItem, type ButtonTone, type ButtonVariant, type ChipBorder, type ChipSize, type ChipTone, type ChipVariant, type DrawerCloseReason, type DrawerSide, type LabelPlacement, type MenuItem, type MenuType, type ModalSide, type Orientation, type OtpType, type ProgressMode, type RadioOption, RelAccordion, RelAlert, RelAutocomplete, RelAvatar, RelBadge, RelBreadcrumbs, RelButton, RelCalendar, RelCard, RelCardMedia, RelCarousel, RelCheckbox, RelChip, RelContainer, RelDatePicker, RelDivider, RelDrawer, RelDrawerFooter, RelKbd, RelKbdGroup, RelLayout, RelMenu, RelMenuItem, RelMenubar, RelMenubarMenu, RelModal, RelNavbar, RelOtp, RelPagination, RelPopover, RelPopoverContent, RelProgress, RelRadio, RelRangePicker, RelResizableGroup, RelResizableHandle, RelResizablePanel, RelSegmentedButton, RelSelect, RelSkeleton, RelSlider, RelSnackbar, RelStepper, RelSwitch, RelTab, RelTabItem, RelTextfield, RelToast, RelTooltip, RelTopbar, RelTopbarActions, RelTopbarBrand, RelTopbarDropdown, RelTopbarDropdownItem, RelTopbarItem, RelTopbarMobilePanel, RelTopbarProfile, RelTopbarUtilities, type SegmentAlign, type SegmentOption, type SegmentSize, type SelectBorder, type SelectLabelStyle, type SelectOption, type SelectOptionObject, type SelectSize, type SelectState, type SkeletonAnimation, type SkeletonShape, type SliderType, type SnackbarLines, type SnackbarType, type Step, type StepStatus, type StepperSize, type StepperType, type TabItem, type TextAlign, type TextFieldSize, type TextFieldState, type TextFieldVariant, type ToastType, type TooltipPosition, type TooltipType, type TopbarForceLayout, type TopbarProfileType, type TopbarRewardTier, type TopbarVariant, type TrackStyle };
|
|
1812
|
+
export { type AutocompleteFilter, type AutocompleteItem, type AutocompleteSearchFn, type BreadcrumbItem, type ButtonTone, type ButtonVariant, type ChipBorder, type ChipSize, type ChipTone, type ChipVariant, type DrawerCloseReason, type DrawerSide, type FieldLabelStyle, type LabelPlacement, type MenuItem, type MenuType, type ModalSide, type Orientation, type OtpType, type ProgressMode, type RadioOption, RelAccordion, RelAlert, RelAutocomplete, RelAvatar, RelBadge, RelBreadcrumbs, RelButton, RelCalendar, RelCard, RelCardMedia, RelCarousel, RelCheckbox, RelChip, RelContainer, RelDatePicker, RelDivider, RelDrawer, RelDrawerFooter, RelKbd, RelKbdGroup, RelLayout, RelMenu, RelMenuItem, RelMenubar, RelMenubarMenu, RelModal, RelNavbar, RelOtp, RelPagination, RelPopover, RelPopoverContent, RelProgress, RelRadio, RelRangePicker, RelResizableGroup, RelResizableHandle, RelResizablePanel, RelSegmentedButton, RelSelect, RelSkeleton, RelSlider, RelSnackbar, RelStepper, RelSwitch, RelTab, RelTabItem, RelTextfield, RelTimePicker, RelToast, RelTooltip, RelTopbar, RelTopbarActions, RelTopbarBrand, RelTopbarDropdown, RelTopbarDropdownItem, RelTopbarItem, RelTopbarMobilePanel, RelTopbarProfile, RelTopbarUtilities, type SegmentAlign, type SegmentOption, type SegmentSize, type SelectBorder, type SelectLabelStyle, type SelectOption, type SelectOptionObject, type SelectSize, type SelectState, type SkeletonAnimation, type SkeletonShape, type SliderType, type SnackbarLines, type SnackbarType, type Step, type StepStatus, type StepperSize, type StepperType, type TabItem, type TextAlign, type TextFieldSize, type TextFieldState, type TextFieldVariant, type ToastType, type TooltipPosition, type TooltipType, type TopbarForceLayout, type TopbarProfileType, type TopbarRewardTier, type TopbarVariant, type TrackStyle };
|