@swell/swell-ui 0.1.0 → 0.1.1
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 +6 -0
- package/README.md +1 -1
- package/custom-elements.json +8274 -0
- package/dist/chunks/badge-Dt6q8Cqa.js +11 -0
- package/dist/chunks/button-C7nCiu-t.js +123 -0
- package/dist/chunks/card-CvSQEug8.js +10 -0
- package/dist/chunks/checkbox-BRI_A1TP.js +99 -0
- package/dist/chunks/chip-BtnufSMG.js +48 -0
- package/dist/chunks/config-C-FYxOaJ.js +588 -0
- package/dist/chunks/define-BlQTa1g4.js +19 -0
- package/dist/chunks/description-BHfQ8meK.js +19 -0
- package/dist/chunks/disclosure-CET8-H6f.js +56 -0
- package/dist/chunks/divider-BfkO0c1j.js +27 -0
- package/dist/chunks/element-B4-_7TLZ.js +138 -0
- package/dist/chunks/input-Uun-ls2_.js +53 -0
- package/dist/chunks/link-8qHFEKQE.js +53 -0
- package/dist/chunks/link-D4NC86oc.js +24 -0
- package/dist/chunks/lookup-5icr_T6o.js +205 -0
- package/dist/chunks/lookup-list-Bw6OJoDS.js +19 -0
- package/dist/chunks/lookup-option-Mn3k8W2M.js +26 -0
- package/dist/chunks/popover-D3Ob6slA.js +92 -0
- package/dist/chunks/popup-Dbh2fchP.js +21 -0
- package/dist/chunks/quantity-h3wqn8tC.js +140 -0
- package/dist/chunks/radio-BhFDL3pO.js +192 -0
- package/dist/chunks/radio-option-hT29S8Zl.js +88 -0
- package/dist/chunks/select-DS1n_htj.js +331 -0
- package/dist/chunks/select-option-DoM9GAe0.js +66 -0
- package/dist/chunks/skeleton-DfPjhls9.js +13 -0
- package/dist/chunks/status-B23JZ5RQ.js +71 -0
- package/dist/chunks/tab-BpjFUbFO.js +107 -0
- package/dist/chunks/tabs-aWKq1Iaz.js +122 -0
- package/dist/chunks/text-ZWPy-iB3.js +26 -0
- package/dist/chunks/text-field-BB_MRt5h.js +158 -0
- package/dist/chunks/textarea-L6_OJ2IN.js +18 -0
- package/dist/chunks/thumbnail-CLe9AsFg.js +21 -0
- package/dist/chunks/toggle-C7-oPgWR.js +22 -0
- package/dist/chunks/ui-HcyMKwzs.js +11 -0
- package/dist/editors/vscode.css-custom-data.json +824 -0
- package/dist/editors/vscode.html-custom-data.json +1156 -0
- package/dist/editors/web-types.json +1706 -0
- package/dist/elements/badge.d.ts +1 -0
- package/dist/elements/badge.js +1 -0
- package/dist/elements/button.d.ts +1 -0
- package/dist/elements/button.js +1 -0
- package/dist/elements/card.d.ts +1 -0
- package/dist/elements/card.js +1 -0
- package/dist/elements/checkbox.d.ts +1 -0
- package/dist/elements/checkbox.js +1 -0
- package/dist/elements/chip.d.ts +1 -0
- package/dist/elements/chip.js +1 -0
- package/dist/elements/disclosure.d.ts +1 -0
- package/dist/elements/disclosure.js +1 -0
- package/dist/elements/divider.d.ts +1 -0
- package/dist/elements/divider.js +1 -0
- package/dist/elements/input.d.ts +1 -0
- package/dist/elements/input.js +1 -0
- package/dist/elements/link.d.ts +1 -0
- package/dist/elements/link.js +1 -0
- package/dist/elements/lookup-list.d.ts +1 -0
- package/dist/elements/lookup-list.js +1 -0
- package/dist/elements/lookup-option.d.ts +1 -0
- package/dist/elements/lookup-option.js +1 -0
- package/dist/elements/lookup.d.ts +1 -0
- package/dist/elements/lookup.js +1 -0
- package/dist/elements/popover.d.ts +1 -0
- package/dist/elements/popover.js +1 -0
- package/dist/elements/quantity.d.ts +1 -0
- package/dist/elements/quantity.js +1 -0
- package/dist/elements/radio-option.d.ts +1 -0
- package/dist/elements/radio-option.js +1 -0
- package/dist/elements/radio.d.ts +1 -0
- package/dist/elements/radio.js +1 -0
- package/dist/elements/select-option.d.ts +1 -0
- package/dist/elements/select-option.js +1 -0
- package/dist/elements/select.d.ts +1 -0
- package/dist/elements/select.js +1 -0
- package/dist/elements/skeleton.d.ts +1 -0
- package/dist/elements/skeleton.js +1 -0
- package/dist/elements/status.d.ts +1 -0
- package/dist/elements/status.js +1 -0
- package/dist/elements/tab.d.ts +1 -0
- package/dist/elements/tab.js +1 -0
- package/dist/elements/tabs.d.ts +1 -0
- package/dist/elements/tabs.js +1 -0
- package/dist/elements/text.d.ts +1 -0
- package/dist/elements/text.js +1 -0
- package/dist/elements/textarea.d.ts +1 -0
- package/dist/elements/textarea.js +1 -0
- package/dist/elements/thumbnail.d.ts +1 -0
- package/dist/elements/thumbnail.js +1 -0
- package/dist/elements/ui.d.ts +1 -0
- package/dist/elements/ui.js +1 -0
- package/dist/frameworks/jsx.d.ts +3589 -0
- package/dist/frameworks/preact.d.ts +9 -0
- package/dist/frameworks/solid.d.ts +7 -0
- package/dist/frameworks/svelte.d.ts +1676 -0
- package/dist/frameworks/vue.d.ts +827 -0
- package/dist/index.js +80 -0
- package/dist/react/badge.d.ts +12 -0
- package/dist/react/badge.js +4 -0
- package/dist/react/button.d.ts +16 -0
- package/dist/react/button.js +4 -0
- package/dist/react/card.d.ts +11 -0
- package/dist/react/card.js +4 -0
- package/dist/react/checkbox.d.ts +14 -0
- package/dist/react/checkbox.js +4 -0
- package/dist/react/chip.d.ts +12 -0
- package/dist/react/chip.js +4 -0
- package/dist/react/create.js +49 -0
- package/dist/react/disclosure.d.ts +11 -0
- package/dist/react/disclosure.js +4 -0
- package/dist/react/divider.d.ts +9 -0
- package/dist/react/divider.js +4 -0
- package/dist/react/index.d.ts +26 -0
- package/dist/react/index.js +26 -0
- package/dist/react/input.d.ts +28 -0
- package/dist/react/input.js +4 -0
- package/dist/react/link.d.ts +15 -0
- package/dist/react/link.js +4 -0
- package/dist/react/lookup-list.d.ts +9 -0
- package/dist/react/lookup-list.js +4 -0
- package/dist/react/lookup-option.d.ts +11 -0
- package/dist/react/lookup-option.js +4 -0
- package/dist/react/lookup.d.ts +28 -0
- package/dist/react/lookup.js +4 -0
- package/dist/react/popover.d.ts +11 -0
- package/dist/react/popover.js +4 -0
- package/dist/react/quantity.d.ts +15 -0
- package/dist/react/quantity.js +4 -0
- package/dist/react/radio-option.d.ts +11 -0
- package/dist/react/radio-option.js +4 -0
- package/dist/react/radio.d.ts +18 -0
- package/dist/react/radio.js +4 -0
- package/dist/react/select-option.d.ts +11 -0
- package/dist/react/select-option.js +4 -0
- package/dist/react/select.d.ts +20 -0
- package/dist/react/select.js +4 -0
- package/dist/react/skeleton.d.ts +11 -0
- package/dist/react/skeleton.js +4 -0
- package/dist/react/status.d.ts +12 -0
- package/dist/react/status.js +4 -0
- package/dist/react/tab.d.ts +10 -0
- package/dist/react/tab.js +4 -0
- package/dist/react/tabs.d.ts +17 -0
- package/dist/react/tabs.js +4 -0
- package/dist/react/text.d.ts +12 -0
- package/dist/react/text.js +4 -0
- package/dist/react/textarea.d.ts +23 -0
- package/dist/react/textarea.js +4 -0
- package/dist/react/thumbnail.d.ts +13 -0
- package/dist/react/thumbnail.js +4 -0
- package/dist/react/ui.d.ts +10 -0
- package/dist/react/ui.js +4 -0
- package/dist/types/components/core/badge/badge.d.ts +25 -0
- package/dist/types/components/core/button/button.d.ts +60 -0
- package/dist/types/components/core/card/card.d.ts +21 -0
- package/dist/types/components/core/checkbox/checkbox.d.ts +46 -0
- package/dist/types/components/core/chip/chip.d.ts +36 -0
- package/dist/types/components/core/disclosure/disclosure.d.ts +37 -0
- package/dist/types/components/core/divider/divider.d.ts +21 -0
- package/dist/types/components/core/index.d.ts +21 -0
- package/dist/types/components/core/input/input.d.ts +57 -0
- package/dist/types/components/core/link/link.d.ts +42 -0
- package/dist/types/components/core/lookup/lookup-list.d.ts +21 -0
- package/dist/types/components/core/lookup/lookup-option.d.ts +27 -0
- package/dist/types/components/core/lookup/lookup.d.ts +32 -0
- package/dist/types/components/core/popover/popover.d.ts +33 -0
- package/dist/types/components/core/quantity/quantity.d.ts +47 -0
- package/dist/types/components/core/radio/radio-option.d.ts +82 -0
- package/dist/types/components/core/radio/radio.d.ts +65 -0
- package/dist/types/components/core/select/select-option.d.ts +69 -0
- package/dist/types/components/core/select/select.d.ts +70 -0
- package/dist/types/components/core/skeleton/skeleton.d.ts +23 -0
- package/dist/types/components/core/status/status.d.ts +38 -0
- package/dist/types/components/core/tabs/tab.d.ts +76 -0
- package/dist/types/components/core/tabs/tabs.d.ts +46 -0
- package/dist/types/components/core/text/text.d.ts +23 -0
- package/dist/types/components/core/textarea/textarea.d.ts +45 -0
- package/dist/types/components/core/thumbnail/thumbnail.d.ts +27 -0
- package/dist/types/components/core/ui/ui.d.ts +16 -0
- package/dist/types/components/elements.d.ts +1 -0
- package/dist/types/react/create.d.ts +8 -0
- package/dist/types/runtime/config.d.ts +25 -0
- package/dist/types/runtime/css.d.ts +12 -0
- package/dist/types/runtime/define.d.ts +4 -0
- package/dist/types/runtime/description.d.ts +12 -0
- package/dist/types/runtime/element.d.ts +61 -0
- package/dist/types/runtime/focus.d.ts +5 -0
- package/dist/types/runtime/form.d.ts +5 -0
- package/dist/types/runtime/index.d.ts +2 -0
- package/dist/types/runtime/link.d.ts +17 -0
- package/dist/types/runtime/loader.d.ts +21 -0
- package/dist/types/runtime/popup.d.ts +8 -0
- package/dist/types/runtime/sheet.d.ts +31 -0
- package/dist/types/runtime/text-field.d.ts +47 -0
- package/dist/types/runtime/toggle.d.ts +8 -0
- package/dist/types/runtime/tokens.generated.d.ts +492 -0
- package/dist/types/runtime/values.d.ts +6 -0
- package/dist/types/runtime/variants.d.ts +4 -0
- package/package.json +2 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* A quantity: a count the shopper changes with − and +, such as the quantity of a cart line or of a product before it goes into the cart.
|
|
4
|
+
* It is a spinbutton with one tab stop: the up and down arrows change the count by `step`, and Home and End move it to `min` and `max`.
|
|
5
|
+
* Name it with `aria-label`, such as `Quantity, House Blend`, or with `aria-labelledby`. It holds the count and takes part in its form.
|
|
6
|
+
* While the cart updates, set `busy` rather than `disabled`: a disabled quantity leaves the tab order, so disabling the focused one drops the focus to the page.
|
|
7
|
+
*
|
|
8
|
+
* @tag swell-quantity
|
|
9
|
+
* @attr {number} value - The starting count, a whole number; `min` by default. A count outside the limits is clamped, and a count the user or a script set stays at the limit that clamped it.
|
|
10
|
+
* @attr {number} min - The least count, a whole number; 1 by default.
|
|
11
|
+
* @attr {number} max - The greatest count, a whole number; no limit by default. A `max` below `min` counts as `min`.
|
|
12
|
+
* @attr {number} step - How much each step changes the count, a whole number above 0; 1 by default.
|
|
13
|
+
* @attr {string} name - The name sent with the form.
|
|
14
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the quantity is: it shares a height with buttons and fields of its size; `medium` by default. A cart line takes `xsmall`.
|
|
15
|
+
* @attr {boolean} disabled - Removes the quantity from the tab order and ignores steps.
|
|
16
|
+
* @attr {boolean} busy - The quantity waits, such as while the cart updates: it keeps the focus, its count and its tab stop, ignores steps, fades and tells screen readers it is busy; a script can still set its count.
|
|
17
|
+
* @fires input - The user changed the count.
|
|
18
|
+
* @fires change - The user changed the count, after `input`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class SwellQuantity extends SwellShadowElement {
|
|
21
|
+
#private;
|
|
22
|
+
static styles: string;
|
|
23
|
+
static template: string;
|
|
24
|
+
static formAssociated: boolean;
|
|
25
|
+
static observedAttributes: string[];
|
|
26
|
+
constructor();
|
|
27
|
+
/** The count now. */
|
|
28
|
+
get value(): number;
|
|
29
|
+
set value(value: number);
|
|
30
|
+
get name(): string;
|
|
31
|
+
set name(value: string);
|
|
32
|
+
get disabled(): boolean;
|
|
33
|
+
set disabled(value: boolean);
|
|
34
|
+
get busy(): boolean;
|
|
35
|
+
set busy(value: boolean);
|
|
36
|
+
get form(): HTMLFormElement | null;
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
formResetCallback(): void;
|
|
39
|
+
formDisabledCallback(disabled: boolean): void;
|
|
40
|
+
formStateRestoreCallback(state: unknown): void;
|
|
41
|
+
protected update(): void;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
"swell-quantity": SwellQuantity;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/** What the group tells each of its options. */
|
|
3
|
+
interface OptionState {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
/** The option is the group's Tab stop. */
|
|
6
|
+
tabbable: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
/** The option's place in its group, from 1. */
|
|
10
|
+
position: number;
|
|
11
|
+
size: number;
|
|
12
|
+
}
|
|
13
|
+
/** What an option asks of its group. */
|
|
14
|
+
interface GroupLink {
|
|
15
|
+
/** The user chose the option. */
|
|
16
|
+
choose(option: SwellRadioOption): void;
|
|
17
|
+
/** The options or their values changed. */
|
|
18
|
+
refresh(): void;
|
|
19
|
+
}
|
|
20
|
+
/** A radio group and its options. */
|
|
21
|
+
export declare const radioGroup: {
|
|
22
|
+
link(group: Element, link: GroupLink): void;
|
|
23
|
+
groupOf(child: Element): Element | undefined;
|
|
24
|
+
linkOf(child: Element): GroupLink | undefined;
|
|
25
|
+
receive(fn: (child: SwellRadioOption, state: OptionState) => void): void;
|
|
26
|
+
sync(child: SwellRadioOption, state: OptionState): void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* One option of a radio group. It lives only as a direct child of `<swell-radio>`, which holds the choice.
|
|
30
|
+
* In a segmented group and as a button an option shows its `start` and its label; its hint, `end` and `details` are not drawn.
|
|
31
|
+
* An option with the `hidden` attribute is left out of its group.
|
|
32
|
+
*
|
|
33
|
+
* @tag swell-radio-option
|
|
34
|
+
* @slot - The label of the option.
|
|
35
|
+
* @slot start - Content before the label, such as an icon or a logo; decoration, left out of the option's name.
|
|
36
|
+
* @slot end - Content at the end of the row, such as a price or logos.
|
|
37
|
+
* @slot details - Content shown while the option is chosen, such as card fields. While hidden it stays in the page and in the form: render it only while the option is chosen, or disable its fields.
|
|
38
|
+
* @attr {string} value - The value the group takes when the option is chosen; `on` by default.
|
|
39
|
+
* @attr {string} hint - Help text under the label.
|
|
40
|
+
* @attr {boolean} disabled - Disables the option.
|
|
41
|
+
* @cssstate plain - The group draws its options plain: the circle and the label.
|
|
42
|
+
* @cssstate outline - The group draws each option in a frame.
|
|
43
|
+
* @cssstate segmented - The group draws its options as segments of one track.
|
|
44
|
+
* @cssstate button - The group draws each option as a button.
|
|
45
|
+
* @cssstate start - The circle sits at the start of the row.
|
|
46
|
+
* @cssstate end - The circle sits at the end of the row.
|
|
47
|
+
* @cssstate checked - The option is chosen.
|
|
48
|
+
* @cssstate disabled - The option or its group is disabled.
|
|
49
|
+
* @cssstate invalid - The group is invalid.
|
|
50
|
+
* @cssstate start-content - The option has content in its `start` slot.
|
|
51
|
+
* @cssstate details - The option has content in its `details` slot.
|
|
52
|
+
* @cssstate focused - The option's radio has the keyboard focus.
|
|
53
|
+
*/
|
|
54
|
+
export declare class SwellRadioOption extends SwellShadowElement {
|
|
55
|
+
#private;
|
|
56
|
+
static group: string;
|
|
57
|
+
static appearance: string;
|
|
58
|
+
static appearances: string[];
|
|
59
|
+
static styles: string;
|
|
60
|
+
static template: string;
|
|
61
|
+
static shadowOptions: ShadowRootInit;
|
|
62
|
+
static observedAttributes: string[];
|
|
63
|
+
constructor();
|
|
64
|
+
/** Whether the option is chosen; the group sets it. */
|
|
65
|
+
get checked(): boolean;
|
|
66
|
+
get value(): string;
|
|
67
|
+
set value(value: string);
|
|
68
|
+
get disabled(): boolean;
|
|
69
|
+
set disabled(value: boolean);
|
|
70
|
+
connectedCallback(): void;
|
|
71
|
+
disconnectedCallback(): void;
|
|
72
|
+
protected appearanceSource(): Element;
|
|
73
|
+
/** The circle's position: the group's `indicator-position`, else the setting. */
|
|
74
|
+
protected extraStates(): string[];
|
|
75
|
+
protected update(name: string): void;
|
|
76
|
+
}
|
|
77
|
+
declare global {
|
|
78
|
+
interface HTMLElementTagNameMap {
|
|
79
|
+
"swell-radio-option": SwellRadioOption;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* A radio group: a question with one answer, chosen from its `<swell-radio-option>` children.
|
|
4
|
+
* It holds the choice and takes part in its form.
|
|
5
|
+
*
|
|
6
|
+
* @tag swell-radio
|
|
7
|
+
* @slot - The options, `<swell-radio-option>` elements.
|
|
8
|
+
* @attr {string} label - The question. Without it, the group takes its name from its own `aria-label`.
|
|
9
|
+
* @attr {string} hint - Help text under the options.
|
|
10
|
+
* @attr {string} error - The error shown while the group is invalid.
|
|
11
|
+
* @attr {boolean} invalid - Marks the group invalid and shows the error.
|
|
12
|
+
* @attr {string} name - The name sent with the form.
|
|
13
|
+
* @attr {string} value - The value of the option chosen by default.
|
|
14
|
+
* @attr {boolean} required - The form can't be sent until an option is chosen.
|
|
15
|
+
* @attr {boolean} disabled - Disables every option.
|
|
16
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the options are: their text, circle and padding follow the text of the size, and a segmented track takes the height of a control; `medium` by default.
|
|
17
|
+
* @attr {"start" | "end"} indicator-position - Where the circle sits in the row of each option; the `radio.indicator.position` setting gives the default. A segmented group draws no circle.
|
|
18
|
+
* @attr {"plain" | "outline" | "segmented" | "button"} appearance - How the options are drawn: the circle and the label, each option in a frame, the options sharing a track like a switch, or each option as a button in equal columns. `segmented` suits two or three short options, `button` short options such as languages or sizes; both are set with this attribute only. The `radio.appearance` setting gives the default.
|
|
19
|
+
* @fires input - The user chose another option.
|
|
20
|
+
* @fires change - The user chose another option, after `input`. Events of fields in the options' details bubble through the group too: the group's own have it as their `target`.
|
|
21
|
+
* @cssstate plain - The options are drawn plain.
|
|
22
|
+
* @cssstate outline - Each option is drawn in a frame.
|
|
23
|
+
* @cssstate segmented - The options share a track.
|
|
24
|
+
* @cssstate button - Each option is drawn as a button.
|
|
25
|
+
*/
|
|
26
|
+
export declare class SwellRadio extends SwellShadowElement {
|
|
27
|
+
#private;
|
|
28
|
+
static group: string;
|
|
29
|
+
static appearance: string;
|
|
30
|
+
static appearances: string[];
|
|
31
|
+
static styles: string;
|
|
32
|
+
static template: string;
|
|
33
|
+
static formAssociated: boolean;
|
|
34
|
+
static observedAttributes: string[];
|
|
35
|
+
constructor();
|
|
36
|
+
/** The value of the chosen option. */
|
|
37
|
+
get value(): string;
|
|
38
|
+
set value(value: string);
|
|
39
|
+
get name(): string;
|
|
40
|
+
set name(value: string);
|
|
41
|
+
get required(): boolean;
|
|
42
|
+
set required(value: boolean);
|
|
43
|
+
get disabled(): boolean;
|
|
44
|
+
set disabled(value: boolean);
|
|
45
|
+
get invalid(): boolean;
|
|
46
|
+
set invalid(value: boolean);
|
|
47
|
+
get form(): HTMLFormElement | null;
|
|
48
|
+
get validity(): ValidityState;
|
|
49
|
+
get validationMessage(): string;
|
|
50
|
+
get willValidate(): boolean;
|
|
51
|
+
checkValidity(): boolean;
|
|
52
|
+
reportValidity(): boolean;
|
|
53
|
+
connectedCallback(): void;
|
|
54
|
+
formResetCallback(): void;
|
|
55
|
+
formDisabledCallback(): void;
|
|
56
|
+
formStateRestoreCallback(state: unknown): void;
|
|
57
|
+
protected update(): void;
|
|
58
|
+
/** Focuses the group's Tab stop, as a Tab into the group does. */
|
|
59
|
+
focus(options?: FocusOptions): void;
|
|
60
|
+
}
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
"swell-radio": SwellRadio;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/** What the select tells each of its options. */
|
|
3
|
+
interface OptionState {
|
|
4
|
+
selected: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
/** The option is the first one on show, which draws no divider above it. */
|
|
7
|
+
first: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** What an option asks of its select. */
|
|
10
|
+
interface SelectLink {
|
|
11
|
+
/** The user chose the option. */
|
|
12
|
+
choose(option: SwellOptionElement): void;
|
|
13
|
+
/** `option` joined or left the select, or its value or state changed. */
|
|
14
|
+
refresh(option: SwellOptionElement): void;
|
|
15
|
+
}
|
|
16
|
+
/** A select, or a lookup's list, and its options. */
|
|
17
|
+
export declare const optionList: {
|
|
18
|
+
link(group: Element, link: SelectLink): void;
|
|
19
|
+
groupOf(child: Element): Element | undefined;
|
|
20
|
+
linkOf(child: Element): SelectLink | undefined;
|
|
21
|
+
receive(fn: (child: SwellOptionElement, state: OptionState) => void): void;
|
|
22
|
+
sync(child: SwellOptionElement, state: OptionState): void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* An option of a list: its label, a `start` before it and a hint under it, with the look of the list's rows.
|
|
26
|
+
* The element that holds the options links itself with `optionList.link` and applies their state with `optionList.sync`; one that shows their labels also watches their content, as a select does.
|
|
27
|
+
*
|
|
28
|
+
* @slot - The label of the option.
|
|
29
|
+
* @slot start - Content before the label, such as an icon or an image; an svg is drawn 1px larger than the text, in the quiet color.
|
|
30
|
+
* @attr {string} hint - A second line under the label.
|
|
31
|
+
* @attr {boolean} disabled - Disables the option.
|
|
32
|
+
* @cssstate disabled - The option is disabled.
|
|
33
|
+
* @cssstate first - The option is the first one on show; it draws no divider above it.
|
|
34
|
+
*/
|
|
35
|
+
export declare abstract class SwellOptionElement extends SwellShadowElement {
|
|
36
|
+
#private;
|
|
37
|
+
static styles: string;
|
|
38
|
+
static template: string;
|
|
39
|
+
static observedAttributes: string[];
|
|
40
|
+
/** Whether the option takes the focus itself; a lookup's options leave it in the field. */
|
|
41
|
+
static focusable: boolean;
|
|
42
|
+
constructor();
|
|
43
|
+
/** Whether the option is chosen; the select sets it. */
|
|
44
|
+
get selected(): boolean;
|
|
45
|
+
/** The text of the option's label: its text and its elements outside a named slot, without the comments a framework leaves. */
|
|
46
|
+
get label(): string;
|
|
47
|
+
get value(): string;
|
|
48
|
+
set value(value: string);
|
|
49
|
+
get disabled(): boolean;
|
|
50
|
+
set disabled(value: boolean);
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
protected update(name: string): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* One option of a select. It lives only as a direct child of `<swell-select>`, which holds the choice.
|
|
57
|
+
*
|
|
58
|
+
* @tag swell-select-option
|
|
59
|
+
* @attr {string} value - The value the select takes when the option is chosen; the option's label by default.
|
|
60
|
+
* @cssstate selected - The option is chosen.
|
|
61
|
+
*/
|
|
62
|
+
export declare class SwellSelectOption extends SwellOptionElement {
|
|
63
|
+
}
|
|
64
|
+
declare global {
|
|
65
|
+
interface HTMLElementTagNameMap {
|
|
66
|
+
"swell-select-option": SwellSelectOption;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* A select: a field that opens a list of its `<swell-select-option>` children and shows the chosen one, with its start content; an svg there is drawn 4px larger than the text, in the quiet color.
|
|
4
|
+
* It holds the choice and takes part in its form.
|
|
5
|
+
* Typing goes to the option whose label starts with the typed text, as on a native select: keys typed within half a second, spaces included, form one search.
|
|
6
|
+
*
|
|
7
|
+
* @tag swell-select
|
|
8
|
+
* @slot - The options, `<swell-select-option>` elements; a hidden one stays out of the list and the choice.
|
|
9
|
+
* @attr {string} label - The label of the field. Without it, the select takes its name from its own `aria-label`.
|
|
10
|
+
* @attr {string} optional - A marker after the label, such as `(optional)`, in the host's language; it joins the select's name.
|
|
11
|
+
* @attr {string} hint - Help text under the field.
|
|
12
|
+
* @attr {string} error - The error shown while the select is invalid.
|
|
13
|
+
* @attr {boolean} invalid - Marks the select invalid and shows the error.
|
|
14
|
+
* @attr {string} name - The name sent with the form.
|
|
15
|
+
* @attr {string} value - The value of the option chosen by default.
|
|
16
|
+
* @attr {string} placeholder - Text shown while nothing is chosen.
|
|
17
|
+
* @attr {boolean} required - The form can't be sent until an option is chosen.
|
|
18
|
+
* @attr {boolean} disabled - Disables the select.
|
|
19
|
+
* @attr {string} autocomplete - The browser's autofill hint, such as `country` or `address-level1`, as on a native select: autofill picks the enabled option whose value or label matches the saved one, which counts as the user's choice and fires `input` and `change`.
|
|
20
|
+
* @attr {"outline" | "filled" | "underline"} appearance - How the field is drawn; the configured setting by default.
|
|
21
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the field is; `medium` by default. At `xsmall` the label sits above the field.
|
|
22
|
+
* @fires input - The user chose another option.
|
|
23
|
+
* @fires change - The user chose another option, after `input`.
|
|
24
|
+
* @cssstate outline - The field has a border on all sides.
|
|
25
|
+
* @cssstate filled - The field has a fill and a bottom border.
|
|
26
|
+
* @cssstate underline - The field has a bottom border.
|
|
27
|
+
* @cssstate above - The label sits above the field.
|
|
28
|
+
* @cssstate floating - The label floats inside the field.
|
|
29
|
+
* @cssstate empty - Nothing is chosen.
|
|
30
|
+
* @cssstate open - The list is open.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SwellSelect extends SwellShadowElement {
|
|
33
|
+
#private;
|
|
34
|
+
static appearance: string;
|
|
35
|
+
static styles: string;
|
|
36
|
+
static template: string;
|
|
37
|
+
static formAssociated: boolean;
|
|
38
|
+
static observedAttributes: string[];
|
|
39
|
+
constructor();
|
|
40
|
+
/** The value of the chosen option. */
|
|
41
|
+
get value(): string;
|
|
42
|
+
set value(value: string);
|
|
43
|
+
get name(): string;
|
|
44
|
+
set name(value: string);
|
|
45
|
+
get required(): boolean;
|
|
46
|
+
set required(value: boolean);
|
|
47
|
+
get disabled(): boolean;
|
|
48
|
+
set disabled(value: boolean);
|
|
49
|
+
get invalid(): boolean;
|
|
50
|
+
set invalid(value: boolean);
|
|
51
|
+
get form(): HTMLFormElement | null;
|
|
52
|
+
get validity(): ValidityState;
|
|
53
|
+
get validationMessage(): string;
|
|
54
|
+
get willValidate(): boolean;
|
|
55
|
+
checkValidity(): boolean;
|
|
56
|
+
reportValidity(): boolean;
|
|
57
|
+
focus(options?: FocusOptions): void;
|
|
58
|
+
connectedCallback(): void;
|
|
59
|
+
disconnectedCallback(): void;
|
|
60
|
+
formResetCallback(): void;
|
|
61
|
+
formDisabledCallback(): void;
|
|
62
|
+
formStateRestoreCallback(state: unknown): void;
|
|
63
|
+
protected update(): void;
|
|
64
|
+
protected extraStates(): string[];
|
|
65
|
+
}
|
|
66
|
+
declare global {
|
|
67
|
+
interface HTMLElementTagNameMap {
|
|
68
|
+
"swell-select": SwellSelect;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* A skeleton: a shimmering bar that stands in for content while it loads, such as a delivery option's name and price.
|
|
4
|
+
* The host sets its width through `style` and marks the region it fills with `aria-busy="true"`; the skeleton itself is hidden from screen readers.
|
|
5
|
+
* Screen readers don't all announce `aria-busy`, so a host can also say what is loading in a polite message, such as a visually hidden `<swell-status>`.
|
|
6
|
+
*
|
|
7
|
+
* @tag swell-skeleton
|
|
8
|
+
* @slot - The bars of a card.
|
|
9
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the skeleton is: a bar is 4px lower than the text of the size, a card as high as a control; `medium` by default. The bars of a card keep their own size, so give them the card's.
|
|
10
|
+
* @attr {"card"} appearance - `card` draws the empty frame of an option card with its bars at its ends; only the attribute sets it. Without it, the skeleton is a bar.
|
|
11
|
+
* @cssstate card - The skeleton is the frame of an option card.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SwellSkeleton extends SwellShadowElement {
|
|
14
|
+
static appearance: string;
|
|
15
|
+
static appearances: string[];
|
|
16
|
+
static styles: string;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
"swell-skeleton": SwellSkeleton;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* A status message: an error, a success or a warning.
|
|
4
|
+
* Screen readers announce it when it is added after the page has loaded and when its text or type changes:
|
|
5
|
+
* each message goes into a fresh visually hidden region, an alert for danger and a status otherwise.
|
|
6
|
+
*
|
|
7
|
+
* @tag swell-status
|
|
8
|
+
* @slot - The message.
|
|
9
|
+
* @slot start - An icon before the message, drawn 4px larger than the text, or 2px larger than the smaller text of a plain message; it replaces the type's icon and is hidden from screen readers.
|
|
10
|
+
* @slot end - An action after the message, such as a `<swell-button size="xsmall">`; it is left out of the announcement.
|
|
11
|
+
* @attr {"danger" | "success" | "warning"} type - What the message means: its color, icon and how it is announced.
|
|
12
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the message is: its text, padding and icon follow the text of the size; `medium` by default.
|
|
13
|
+
* @attr {"filled" | "outline" | "plain" | "quiet"} appearance - How the message is drawn; the configured setting by default. `quiet`, for a note, comes from the attribute only.
|
|
14
|
+
* @csspart message - The message box.
|
|
15
|
+
* @cssstate filled - The message has its background, border and icon.
|
|
16
|
+
* @cssstate outline - The message has its border and icon.
|
|
17
|
+
* @cssstate plain - The message has its icon only and the font of a field error.
|
|
18
|
+
* @cssstate quiet - The message is a note in the quiet palette, without a border or the type's icon.
|
|
19
|
+
* @cssstate end-content - The message has content in its `end` slot: its items are centered.
|
|
20
|
+
* @cssstate typed - The message has a known type and isn't quiet: it takes the colors of its type.
|
|
21
|
+
*/
|
|
22
|
+
export declare class SwellStatus extends SwellShadowElement {
|
|
23
|
+
#private;
|
|
24
|
+
static group: string;
|
|
25
|
+
static appearance: string;
|
|
26
|
+
static appearances: string[];
|
|
27
|
+
static styles: string;
|
|
28
|
+
static template: string;
|
|
29
|
+
constructor();
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
disconnectedCallback(): void;
|
|
32
|
+
protected update(name: string): void;
|
|
33
|
+
}
|
|
34
|
+
declare global {
|
|
35
|
+
interface HTMLElementTagNameMap {
|
|
36
|
+
"swell-status": SwellStatus;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/** What the group tells a tab. */
|
|
3
|
+
interface TabState {
|
|
4
|
+
selected: boolean;
|
|
5
|
+
/** The tab is a step of vertical steps, which draws its own heading. */
|
|
6
|
+
vertical: boolean;
|
|
7
|
+
/** The tab's place in its group, from 1. */
|
|
8
|
+
position: number;
|
|
9
|
+
last: boolean;
|
|
10
|
+
/** The heading level of a vertical step. */
|
|
11
|
+
level: number;
|
|
12
|
+
/** The word that follows the label of a done step for screen readers. */
|
|
13
|
+
doneLabel: string;
|
|
14
|
+
}
|
|
15
|
+
/** What a tab asks of its group. */
|
|
16
|
+
interface TabsLink {
|
|
17
|
+
/** One of the tabs changed. */
|
|
18
|
+
refresh(): void;
|
|
19
|
+
/** A step's button was pressed. */
|
|
20
|
+
choose(tab: SwellTab): void;
|
|
21
|
+
}
|
|
22
|
+
/** A tab group and its tabs. */
|
|
23
|
+
export declare const tabGroup: {
|
|
24
|
+
link(group: Element, link: TabsLink): void;
|
|
25
|
+
groupOf(child: Element): Element | undefined;
|
|
26
|
+
linkOf(child: Element): TabsLink | undefined;
|
|
27
|
+
receive(fn: (child: SwellTab, state: TabState) => void): void;
|
|
28
|
+
sync(child: SwellTab, state: TabState): void;
|
|
29
|
+
};
|
|
30
|
+
export declare const CHECK = "<svg class=\"check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M20 6 9 17l-5-5\"/></svg>";
|
|
31
|
+
/**
|
|
32
|
+
* A tab of a `<swell-tabs>` group: its label and its content, shown while it is chosen.
|
|
33
|
+
* In a tab list the group draws the tab and the element is its panel, named by the label; `role="tabpanel"` and that name count as the kit's.
|
|
34
|
+
* A step of vertical steps draws its own heading at the group's level, holding a button that opens it, tells whether it is open and controls its content under the heading.
|
|
35
|
+
*
|
|
36
|
+
* @tag swell-tab
|
|
37
|
+
* @slot - The content, shown while the tab is chosen.
|
|
38
|
+
* @slot summary - Vertical steps: content under the heading while the step is closed, such as what a done step holds or what a step that isn't open yet will ask.
|
|
39
|
+
* @slot end - Vertical steps: content beside the heading, such as a link that opens a done step or a note.
|
|
40
|
+
* @attr {string} value - The group's value while the tab is chosen; the label by default.
|
|
41
|
+
* @attr {string} label - The text of the tab or of the step's heading.
|
|
42
|
+
* @attr {boolean} done - Marks a step as done: its number becomes a check, and the line to the next step fills.
|
|
43
|
+
* @attr {boolean} disabled - The tab can't be chosen, such as a step that isn't open yet.
|
|
44
|
+
* @cssstate selected - The tab is chosen.
|
|
45
|
+
* @cssstate vertical - The tab is a step of vertical steps.
|
|
46
|
+
* @cssstate last - The tab is the last of its group, so a vertical step draws no line to a next one.
|
|
47
|
+
*/
|
|
48
|
+
export declare class SwellTab extends SwellShadowElement {
|
|
49
|
+
#private;
|
|
50
|
+
static group: string;
|
|
51
|
+
static appearance: string;
|
|
52
|
+
static appearances: string[];
|
|
53
|
+
static styles: string;
|
|
54
|
+
static template: string;
|
|
55
|
+
static observedAttributes: string[];
|
|
56
|
+
constructor();
|
|
57
|
+
get value(): string;
|
|
58
|
+
set value(value: string);
|
|
59
|
+
get label(): string;
|
|
60
|
+
set label(value: string);
|
|
61
|
+
get done(): boolean;
|
|
62
|
+
set done(value: boolean);
|
|
63
|
+
get disabled(): boolean;
|
|
64
|
+
set disabled(value: boolean);
|
|
65
|
+
connectedCallback(): void;
|
|
66
|
+
protected update(): void;
|
|
67
|
+
/** The group's appearance is the tab's. */
|
|
68
|
+
protected appearanceSource(): Element;
|
|
69
|
+
protected extraStates(): string[];
|
|
70
|
+
}
|
|
71
|
+
declare global {
|
|
72
|
+
interface HTMLElementTagNameMap {
|
|
73
|
+
"swell-tab": SwellTab;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* Tabs: a set of `<swell-tab>` children, one of them chosen, with its content shown.
|
|
4
|
+
* The group draws a tab list: a tab per child, named by its label. The arrows move between the tabs and Home and End to the ends; underlined and segmented tabs are chosen as the focus moves, steps with Enter or Space.
|
|
5
|
+
* Vertical steps draw no tab list: each step is a heading with a button that opens it, and Tab moves between the buttons.
|
|
6
|
+
*
|
|
7
|
+
* @tag swell-tabs
|
|
8
|
+
* @slot - The tabs, `<swell-tab>` elements.
|
|
9
|
+
* @attr {string} value - The value of the chosen tab; the first tab that isn't disabled by default.
|
|
10
|
+
* @attr {"underline" | "segmented" | "steps"} appearance - How the tabs are drawn: a line under the chosen tab, a track with a marker under it, or numbered steps joined by lines, each a check once done. `steps` is set with this attribute only; the `tabs.appearance` setting gives the default.
|
|
11
|
+
* @attr {"horizontal" | "vertical"} orientation - How steps line up: in a row above the chosen step's content, by default, or one under another, each a heading with its content under it. Other appearances stay in a row.
|
|
12
|
+
* @attr {number} level - The heading level of vertical steps, 1 to 6; 2 by default.
|
|
13
|
+
* @attr {string} done-label - The word a screen reader hears after the label of a done step, in the host's language, such as `Completed`; the check shows it to the eye.
|
|
14
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the tabs are: they take the height and the text of a control of the size; `medium` by default.
|
|
15
|
+
* @fires {CustomEvent<{ value: string }>} request - The user asks for another tab, by a press or an arrow, with its value in `detail.value`, before the group chooses it; it bubbles. Cancelling it keeps the choice. It fires for a disabled tab too, which stays unchosen, so a host can answer a press on a locked step, such as by checking the open one.
|
|
16
|
+
* @fires change - The user chose another tab. A listener that cancels the click on a tab, also a framework's handler on the page, keeps the choice.
|
|
17
|
+
* @cssstate underline - A line marks the chosen tab.
|
|
18
|
+
* @cssstate segmented - The tabs share a track.
|
|
19
|
+
* @cssstate steps - The tabs are numbered steps.
|
|
20
|
+
* @cssstate vertical - The steps stand one under another.
|
|
21
|
+
*/
|
|
22
|
+
export declare class SwellTabs extends SwellShadowElement {
|
|
23
|
+
#private;
|
|
24
|
+
static group: string;
|
|
25
|
+
static appearance: string;
|
|
26
|
+
static appearances: string[];
|
|
27
|
+
static styles: string;
|
|
28
|
+
static template: string;
|
|
29
|
+
static observedAttributes: string[];
|
|
30
|
+
constructor();
|
|
31
|
+
/** The value of the chosen tab. */
|
|
32
|
+
get value(): string;
|
|
33
|
+
set value(value: string);
|
|
34
|
+
connectedCallback(): void;
|
|
35
|
+
/** The orientation decides whether the group is vertical, a state of its own and of its tabs. */
|
|
36
|
+
protected update(name: string): void;
|
|
37
|
+
/** The tabs take the group's appearance, so they follow it. */
|
|
38
|
+
protected updateStates(): void;
|
|
39
|
+
/** Vertical steps draw no tab list: each step draws its heading. */
|
|
40
|
+
protected extraStates(): string[];
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"swell-tabs": SwellTabs;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* Text: a title, a heading, a subheading, strong text, body text, a caption, a footnote or an eyebrow.
|
|
4
|
+
*
|
|
5
|
+
* @tag swell-text
|
|
6
|
+
* @slot - The text.
|
|
7
|
+
* @attr {string} variant - Which palette of `color` the text takes its color from: `secondary`, quiet text, or a variant of the host's own; without it, the text color.
|
|
8
|
+
* @attr {"title" | "heading" | "subheading" | "strong" | "body" | "caption" | "footnote" | "eyebrow"} type - What the text is; body text by default. An eyebrow is uppercase.
|
|
9
|
+
* @attr {number} level - The heading level, 1 to 6: it makes text of any type a heading. A title, a heading and a subheading are headings of level 1, 2 and 3 by default.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SwellText extends SwellShadowElement {
|
|
12
|
+
#private;
|
|
13
|
+
static group: string;
|
|
14
|
+
static styles: string;
|
|
15
|
+
static observedAttributes: string[];
|
|
16
|
+
connectedCallback(): void;
|
|
17
|
+
protected update(name: string): void;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
"swell-text": SwellText;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SwellTextFieldElement } from "../../../runtime/text-field.js";
|
|
2
|
+
/**
|
|
3
|
+
* A text field for several lines: a native textarea with its label, hint and error, rendered into light DOM.
|
|
4
|
+
* Enter adds a line; the field grows only when the user drags its corner.
|
|
5
|
+
*
|
|
6
|
+
* @tag swell-textarea
|
|
7
|
+
* @attr {string} label - The label of the field.
|
|
8
|
+
* @attr {string} optional - A marker after the label, such as `(optional)`, in the host's language; it joins the field's name.
|
|
9
|
+
* @attr {string} hint - Help text under the field.
|
|
10
|
+
* @slot hint - Help content under the field in place of the `hint` text; it describes the textarea, and hiding it with `hidden` brings the `hint` text back.
|
|
11
|
+
* @attr {string} error - The error shown while the field is invalid.
|
|
12
|
+
* @attr {boolean} invalid - Marks the field invalid and shows the error.
|
|
13
|
+
* @attr {string} value - The default value.
|
|
14
|
+
* @attr {"outline" | "filled" | "underline"} appearance - How the field is drawn; the configured setting by default.
|
|
15
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the field is; `medium` by default. At `xsmall` the label sits above the field.
|
|
16
|
+
* @attr {boolean} disabled - Disables the field.
|
|
17
|
+
* @attr {boolean} readonly - Makes the field read-only.
|
|
18
|
+
* @attr {boolean} required - Makes the field required.
|
|
19
|
+
* @attr {string} name - The name sent with the form.
|
|
20
|
+
* @attr {string} placeholder - Text shown while the field is empty.
|
|
21
|
+
* @attr {string} autocomplete - The autofill hint of the native textarea.
|
|
22
|
+
* @attr {number} minlength - The shortest allowed value.
|
|
23
|
+
* @attr {number} maxlength - The longest allowed value.
|
|
24
|
+
* @attr {number} rows - The visible lines; 2 by default.
|
|
25
|
+
* @csspart frame - The box that draws the field around the native textarea.
|
|
26
|
+
* @fires input - The value changes as the user types; it bubbles from the native textarea.
|
|
27
|
+
* @fires change - The user commits a new value; it bubbles from the native textarea.
|
|
28
|
+
* @cssstate outline - The field has a border on all sides.
|
|
29
|
+
* @cssstate filled - The field has a fill and a bottom border.
|
|
30
|
+
* @cssstate underline - The field has a bottom border.
|
|
31
|
+
* @cssstate above - The label sits above the field.
|
|
32
|
+
* @cssstate floating - The label floats inside the field.
|
|
33
|
+
*/
|
|
34
|
+
export declare class SwellTextarea extends SwellTextFieldElement {
|
|
35
|
+
static styles: string;
|
|
36
|
+
static control: "textarea";
|
|
37
|
+
static prefix: string;
|
|
38
|
+
static passed: string[];
|
|
39
|
+
static observedAttributes: string[];
|
|
40
|
+
}
|
|
41
|
+
declare global {
|
|
42
|
+
interface HTMLElementTagNameMap {
|
|
43
|
+
"swell-textarea": SwellTextarea;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SwellShadowElement } from "../../../runtime/element.js";
|
|
2
|
+
/**
|
|
3
|
+
* A thumbnail: a picture, an icon or initials in a small box, such as the photo of a cart line or a person's avatar.
|
|
4
|
+
* It is decoration, hidden from screen readers, with its badge; with `aria-label` it is an image with that name, which then carries what the badge says, such as the quantity.
|
|
5
|
+
* `aria-hidden="true"` and `role="img"` count as the kit's; any other value is the host's and stays.
|
|
6
|
+
*
|
|
7
|
+
* @tag swell-thumbnail
|
|
8
|
+
* @slot - An `<img>`, which covers the box, an svg icon, or initials.
|
|
9
|
+
* @slot badge - A `<swell-badge>` over the top end corner, such as the quantity of a cart line.
|
|
10
|
+
* @attr {string} variant - Which palette of `color` the box takes its colors from: `secondary`, the quiet colors with a border, as for a product without a photo, or a variant of the host's own; without it, the accent, as for an avatar.
|
|
11
|
+
* @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} size - How large the box is: the height of a control of the size; `medium` by default.
|
|
12
|
+
* @attr {"circle"} shape - Rounds the box fully, as for an avatar.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SwellThumbnail extends SwellShadowElement {
|
|
15
|
+
#private;
|
|
16
|
+
static group: string;
|
|
17
|
+
static styles: string;
|
|
18
|
+
static template: string;
|
|
19
|
+
static observedAttributes: string[];
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
protected update(name: string): void;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
"swell-thumbnail": SwellThumbnail;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An area of the page with token values of its own, such as an order summary in the colors of the brand.
|
|
3
|
+
* The host registers the area's configuration with `configure(config, id)`; its tokens and theme apply to everything inside the element, the host's own markup included, and every value it leaves out comes from the page.
|
|
4
|
+
* The element keeps the layout of its content: it renders nothing of its own.
|
|
5
|
+
*
|
|
6
|
+
* @tag swell-ui
|
|
7
|
+
* @attr {string} config - The id of the area's configuration. An id without a configuration yet applies once the host registers one.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SwellUi extends HTMLElement {
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
"swell-ui": SwellUi;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ELEMENTS: Record<string, () => Promise<unknown>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes } from "react";
|
|
2
|
+
type Props = Record<string, unknown>;
|
|
3
|
+
/**
|
|
4
|
+
* A React component for a custom element, for every React version from 16.8: it sets the element's writable `properties` on it,
|
|
5
|
+
* writes every other prop as an attribute, and listens to the element's events through the props `events` names, such as `{ onToggle: "toggle" }`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createComponent(tag: string, events: Record<string, string>, properties: readonly string[]): ForwardRefExoticComponent<Props & RefAttributes<HTMLElement>>;
|
|
8
|
+
export {};
|