@atomic-ui/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -2
- package/dist/base/FieldElement.d.ts +95 -0
- package/dist/base/ImpktElement.d.ts +21 -0
- package/dist/base/styles.d.ts +42 -0
- package/dist/base/tokens.d.ts +68 -0
- package/dist/chunk-26CSJMXY.js +122 -0
- package/dist/chunk-26CSJMXY.js.map +1 -0
- package/dist/chunk-3LFXWUOU.js +86 -0
- package/dist/chunk-3LFXWUOU.js.map +1 -0
- package/dist/chunk-43V4RFK4.js +94 -0
- package/dist/chunk-43V4RFK4.js.map +1 -0
- package/dist/chunk-4P3FLJZG.js +77 -0
- package/dist/chunk-4P3FLJZG.js.map +1 -0
- package/dist/chunk-5NBYZ5UC.js +164 -0
- package/dist/chunk-5NBYZ5UC.js.map +1 -0
- package/dist/chunk-BM73FVQ4.js +153 -0
- package/dist/chunk-BM73FVQ4.js.map +1 -0
- package/dist/chunk-CNFIYRPA.js +67 -0
- package/dist/chunk-CNFIYRPA.js.map +1 -0
- package/dist/chunk-G6X62CFC.js +713 -0
- package/dist/chunk-G6X62CFC.js.map +1 -0
- package/dist/chunk-M3WQZDWU.js +138 -0
- package/dist/chunk-M3WQZDWU.js.map +1 -0
- package/dist/chunk-O72RTRIJ.js +132 -0
- package/dist/chunk-O72RTRIJ.js.map +1 -0
- package/dist/chunk-OZNQ4GAR.js +159 -0
- package/dist/chunk-OZNQ4GAR.js.map +1 -0
- package/dist/chunk-PV4GMCP6.js +90 -0
- package/dist/chunk-PV4GMCP6.js.map +1 -0
- package/dist/chunk-QAKFGIOO.js +104 -0
- package/dist/chunk-QAKFGIOO.js.map +1 -0
- package/dist/chunk-RYJQKKJ4.js +133 -0
- package/dist/chunk-RYJQKKJ4.js.map +1 -0
- package/dist/chunk-SHGQMQXS.js +97 -0
- package/dist/chunk-SHGQMQXS.js.map +1 -0
- package/dist/chunk-TWCXYY4Z.js +83 -0
- package/dist/chunk-TWCXYY4Z.js.map +1 -0
- package/dist/chunk-UTL446G6.js +107 -0
- package/dist/chunk-UTL446G6.js.map +1 -0
- package/dist/chunk-VF6PNIPS.js +164 -0
- package/dist/chunk-VF6PNIPS.js.map +1 -0
- package/dist/chunk-VKQGLSDT.js +124 -0
- package/dist/chunk-VKQGLSDT.js.map +1 -0
- package/dist/chunk-WAB4TRB2.js +141 -0
- package/dist/chunk-WAB4TRB2.js.map +1 -0
- package/dist/chunk-WC5KO6KZ.js +44 -0
- package/dist/chunk-WC5KO6KZ.js.map +1 -0
- package/dist/chunk-YXHT3ZJU.js +81 -0
- package/dist/chunk-YXHT3ZJU.js.map +1 -0
- package/dist/components/accordion.d.ts +66 -0
- package/dist/components/accordion.js +8 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert.d.ts +49 -0
- package/dist/components/alert.js +8 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/button.d.ts +70 -0
- package/dist/components/button.js +8 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/checkbox-group.d.ts +79 -0
- package/dist/components/checkbox-group.js +9 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +64 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/date-input.d.ts +95 -0
- package/dist/components/date-input.js +9 -0
- package/dist/components/date-input.js.map +1 -0
- package/dist/components/dialog.d.ts +61 -0
- package/dist/components/dialog.js +8 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/grid.d.ts +34 -0
- package/dist/components/grid.js +8 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/help.d.ts +103 -0
- package/dist/components/help.js +8 -0
- package/dist/components/help.js.map +1 -0
- package/dist/components/layout.d.ts +100 -0
- package/dist/components/layout.js +14 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/link.d.ts +46 -0
- package/dist/components/link.js +8 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/media.d.ts +164 -0
- package/dist/components/media.js +12 -0
- package/dist/components/media.js.map +1 -0
- package/dist/components/price.d.ts +67 -0
- package/dist/components/price.js +8 -0
- package/dist/components/price.js.map +1 -0
- package/dist/components/progress.d.ts +50 -0
- package/dist/components/progress.js +8 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +82 -0
- package/dist/components/radio-group.js +9 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/select.d.ts +74 -0
- package/dist/components/select.js +9 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/summary-list.d.ts +47 -0
- package/dist/components/summary-list.js +8 -0
- package/dist/components/summary-list.js.map +1 -0
- package/dist/components/table.d.ts +49 -0
- package/dist/components/table.js +8 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/text-input.d.ts +80 -0
- package/dist/components/text-input.js +9 -0
- package/dist/components/text-input.js.map +1 -0
- package/dist/components/textarea.d.ts +59 -0
- package/dist/components/textarea.js +9 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +113 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -4
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { ImpktElement } from '../base/ImpktElement';
|
|
3
|
+
export interface AccordionItem {
|
|
4
|
+
id: string;
|
|
5
|
+
heading: string;
|
|
6
|
+
body: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Disclosure sections — frequently asked questions, "what does this mean?".
|
|
10
|
+
*
|
|
11
|
+
* **Each header is a button inside a heading.** The heading is what lets a
|
|
12
|
+
* screen-reader user jump between sections without tabbing through every
|
|
13
|
+
* paragraph; the button is what makes the section openable. One without the
|
|
14
|
+
* other is a common half-implementation: all-headings cannot be operated,
|
|
15
|
+
* all-buttons cannot be navigated.
|
|
16
|
+
*
|
|
17
|
+
* `headingLevel` is a property because the right level depends on what is
|
|
18
|
+
* above the accordion on the page, and guessing produces exactly the skipped
|
|
19
|
+
* levels that 1.3.1 is about.
|
|
20
|
+
*
|
|
21
|
+
* **Panels are hidden, not unmounted.** `hidden` keeps the content in the
|
|
22
|
+
* accessibility tree's structure and lets in-page search find it when opened,
|
|
23
|
+
* and it means `aria-controls` always points at an element that exists.
|
|
24
|
+
*
|
|
25
|
+
* **A panel can hold more than words.** `body` is plain text, which is what a
|
|
26
|
+
* composition can author safely. Content rendered elsewhere, such as an FAQ
|
|
27
|
+
* answer with links and a list, is slotted instead: a child with
|
|
28
|
+
* `slot="panel-<item id>"` replaces that item's body. The slot sits inside the
|
|
29
|
+
* panel, so the region, its label and its `hidden` state are unchanged, and a
|
|
30
|
+
* panel with nothing slotted still shows its body.
|
|
31
|
+
*
|
|
32
|
+
* @category content
|
|
33
|
+
* @icon accordion
|
|
34
|
+
*/
|
|
35
|
+
export declare class ImpktAccordion extends ImpktElement {
|
|
36
|
+
static properties: {
|
|
37
|
+
items: {
|
|
38
|
+
type: ArrayConstructor;
|
|
39
|
+
};
|
|
40
|
+
headingLevel: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
attribute: string;
|
|
43
|
+
};
|
|
44
|
+
open: {
|
|
45
|
+
type: ArrayConstructor;
|
|
46
|
+
};
|
|
47
|
+
multiple: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
items: AccordionItem[];
|
|
52
|
+
headingLevel: number;
|
|
53
|
+
/** Ids currently expanded. */
|
|
54
|
+
open: string[];
|
|
55
|
+
/** When false, opening one closes the others. */
|
|
56
|
+
multiple: boolean;
|
|
57
|
+
constructor();
|
|
58
|
+
static styles: import("lit").CSSResult[];
|
|
59
|
+
private toggle;
|
|
60
|
+
render(): TemplateResult;
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'impkt-accordion': ImpktAccordion;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { ImpktElement } from '../base/ImpktElement';
|
|
3
|
+
export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
|
|
4
|
+
/**
|
|
5
|
+
* A notice.
|
|
6
|
+
*
|
|
7
|
+
* **The role depends on the tone, and that is a real distinction.** `alert`
|
|
8
|
+
* interrupts whatever a screen reader is saying; `status` waits for a pause.
|
|
9
|
+
* A failed payment earns the interruption. "Your basket has been saved" does
|
|
10
|
+
* not, and using `alert` for it is how users learn to tune the live region
|
|
11
|
+
* out — at which point the one that mattered is also lost.
|
|
12
|
+
*
|
|
13
|
+
* **The tone is never carried by colour alone.** Each tone ships a word, in
|
|
14
|
+
* the accessible name, because 1.4.1 Use of Colour says a red border is not a
|
|
15
|
+
* message and because a red border is invisible in forced-colours mode.
|
|
16
|
+
|
|
17
|
+
*
|
|
18
|
+
* @category feedback
|
|
19
|
+
* @icon alert
|
|
20
|
+
* @slot - The body of the notice.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ImpktAlert extends ImpktElement {
|
|
23
|
+
static properties: {
|
|
24
|
+
tone: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
reflect: boolean;
|
|
27
|
+
};
|
|
28
|
+
heading: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
};
|
|
31
|
+
toneLabel: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
attribute: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
tone: AlertTone;
|
|
37
|
+
heading: string;
|
|
38
|
+
/** Overrides the default word for the tone, for translation. */
|
|
39
|
+
toneLabel: string;
|
|
40
|
+
constructor();
|
|
41
|
+
private static readonly TONE_WORDS;
|
|
42
|
+
static styles: import("lit").CSSResult[];
|
|
43
|
+
render(): TemplateResult;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface HTMLElementTagNameMap {
|
|
47
|
+
'impkt-alert': ImpktAlert;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { ImpktElement } from '../base/ImpktElement';
|
|
3
|
+
/**
|
|
4
|
+
* A button.
|
|
5
|
+
*
|
|
6
|
+
* Two decisions carry the accessibility weight here.
|
|
7
|
+
*
|
|
8
|
+
* **A busy button is not a disabled button.** While an action is in flight the
|
|
9
|
+
* control keeps its place in the tab order and reports `aria-disabled`, rather
|
|
10
|
+
* than taking the native `disabled` attribute. A natively disabled element is
|
|
11
|
+
* removed from the tab order, so a keyboard user who had just activated it
|
|
12
|
+
* loses their focus position to the top of the document — at precisely the
|
|
13
|
+
* moment something is happening that they need to be told about. Activation is
|
|
14
|
+
* blocked in the handler instead.
|
|
15
|
+
*
|
|
16
|
+
* **It renders a real `<button>`.** A `<div role="button">` needs Enter and
|
|
17
|
+
* Space handling, a tabindex, and a disabled story, and it will still not
|
|
18
|
+
* submit a form. The native element already has all of that, correctly, in
|
|
19
|
+
* every browser and every assistive technology.
|
|
20
|
+
|
|
21
|
+
*
|
|
22
|
+
* @category action
|
|
23
|
+
* @icon button
|
|
24
|
+
* @slot - The button label.
|
|
25
|
+
*/
|
|
26
|
+
export declare class ImpktButton extends ImpktElement {
|
|
27
|
+
static formAssociated: boolean;
|
|
28
|
+
static properties: {
|
|
29
|
+
variant: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
reflect: boolean;
|
|
32
|
+
};
|
|
33
|
+
type: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
};
|
|
36
|
+
disabled: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
reflect: boolean;
|
|
39
|
+
};
|
|
40
|
+
busy: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
reflect: boolean;
|
|
43
|
+
};
|
|
44
|
+
busyLabel: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
attribute: string;
|
|
47
|
+
};
|
|
48
|
+
full: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
reflect: boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
variant: 'primary' | 'secondary' | 'ghost';
|
|
54
|
+
type: 'button' | 'submit' | 'reset';
|
|
55
|
+
disabled: boolean;
|
|
56
|
+
busy: boolean;
|
|
57
|
+
/** Announced when the button becomes busy. Says what is happening, not that something is. */
|
|
58
|
+
busyLabel: string;
|
|
59
|
+
full: boolean;
|
|
60
|
+
private internals;
|
|
61
|
+
constructor();
|
|
62
|
+
static styles: import("lit").CSSResult[];
|
|
63
|
+
private onClick;
|
|
64
|
+
render(): TemplateResult;
|
|
65
|
+
}
|
|
66
|
+
declare global {
|
|
67
|
+
interface HTMLElementTagNameMap {
|
|
68
|
+
'impkt-button': ImpktButton;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { FieldElement } from '../base/FieldElement';
|
|
3
|
+
export interface CheckboxOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A choose-several group — the multi-select question type.
|
|
10
|
+
*
|
|
11
|
+
* Same shape as the radio group and for the same reasons: a `<fieldset>` with
|
|
12
|
+
* a `<legend>`, because the question is asked of the set and `label for` names
|
|
13
|
+
* one control.
|
|
14
|
+
*
|
|
15
|
+
* It differs from radios in one way that matters. Checkboxes have no roving
|
|
16
|
+
* tabindex — every box is its own tab stop, which is correct, because each is
|
|
17
|
+
* an independent yes or no rather than one choice among several. Nothing needs
|
|
18
|
+
* to be implemented for that; it is what the platform does, and it is worth
|
|
19
|
+
* knowing it is deliberate rather than missing.
|
|
20
|
+
|
|
21
|
+
*
|
|
22
|
+
* @category form
|
|
23
|
+
* @icon checkbox
|
|
24
|
+
*/
|
|
25
|
+
export declare class ImpktCheckboxGroup extends FieldElement {
|
|
26
|
+
static properties: {
|
|
27
|
+
options: {
|
|
28
|
+
type: ArrayConstructor;
|
|
29
|
+
};
|
|
30
|
+
values: {
|
|
31
|
+
type: ArrayConstructor;
|
|
32
|
+
};
|
|
33
|
+
label: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
};
|
|
36
|
+
name: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
};
|
|
39
|
+
value: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
};
|
|
42
|
+
description: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
error: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
};
|
|
48
|
+
required: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
reflect: boolean;
|
|
51
|
+
};
|
|
52
|
+
disabled: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
reflect: boolean;
|
|
55
|
+
};
|
|
56
|
+
readonly: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
reflect: boolean;
|
|
59
|
+
};
|
|
60
|
+
requiredText: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
attribute: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
options: CheckboxOption[];
|
|
66
|
+
values: string[];
|
|
67
|
+
constructor();
|
|
68
|
+
static styles: import("lit").CSSResult[];
|
|
69
|
+
protected renderLabel(): TemplateResult;
|
|
70
|
+
private onToggle;
|
|
71
|
+
protected renderControl(): TemplateResult;
|
|
72
|
+
render(): TemplateResult;
|
|
73
|
+
updated(changed: Map<string, unknown>): void;
|
|
74
|
+
}
|
|
75
|
+
declare global {
|
|
76
|
+
interface HTMLElementTagNameMap {
|
|
77
|
+
'impkt-checkbox-group': ImpktCheckboxGroup;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { FieldElement } from '../base/FieldElement';
|
|
3
|
+
/**
|
|
4
|
+
* A single checkbox — a consent, an opt-in, a confirmation.
|
|
5
|
+
*
|
|
6
|
+
* The label sits beside the box rather than above it, so this overrides the
|
|
7
|
+
* base layout. The whole `<label>` is the hit area: a 20px box is legal under
|
|
8
|
+
* 2.5.8 and still unkind, and the row costs nothing.
|
|
9
|
+
|
|
10
|
+
*
|
|
11
|
+
* @category form
|
|
12
|
+
* @icon checkbox
|
|
13
|
+
*/
|
|
14
|
+
export declare class ImpktCheckbox extends FieldElement {
|
|
15
|
+
static properties: {
|
|
16
|
+
checked: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
reflect: boolean;
|
|
19
|
+
};
|
|
20
|
+
label: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
};
|
|
23
|
+
name: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
26
|
+
value: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
};
|
|
29
|
+
description: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
};
|
|
32
|
+
error: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
};
|
|
35
|
+
required: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
reflect: boolean;
|
|
38
|
+
};
|
|
39
|
+
disabled: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
reflect: boolean;
|
|
42
|
+
};
|
|
43
|
+
readonly: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
reflect: boolean;
|
|
46
|
+
};
|
|
47
|
+
requiredText: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
attribute: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
checked: boolean;
|
|
53
|
+
constructor();
|
|
54
|
+
static styles: import("lit").CSSResult[];
|
|
55
|
+
protected renderControl(): TemplateResult;
|
|
56
|
+
/** The label is inside the control here, so the base class's is suppressed. */
|
|
57
|
+
protected renderLabel(): TemplateResult;
|
|
58
|
+
updated(changed: Map<string, unknown>): void;
|
|
59
|
+
}
|
|
60
|
+
declare global {
|
|
61
|
+
interface HTMLElementTagNameMap {
|
|
62
|
+
'impkt-checkbox': ImpktCheckbox;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { FieldElement } from '../base/FieldElement';
|
|
3
|
+
/**
|
|
4
|
+
* A date, as three fields.
|
|
5
|
+
*
|
|
6
|
+
* **Why not `<input type="date">`.** The native control is excellent for
|
|
7
|
+
* picking a date near today — an appointment, a start date — and poor for a
|
|
8
|
+
* date of birth, which is the date this product asks for most. Its picker
|
|
9
|
+
* opens on the current month and makes a user born in 1958 navigate eight
|
|
10
|
+
* hundred steps back, its text entry expects a locale-specific format the
|
|
11
|
+
* field does not state, and its rendering differs enough between browsers that
|
|
12
|
+
* no single hint is correct everywhere.
|
|
13
|
+
*
|
|
14
|
+
* Three fields is the pattern government services converged on after testing
|
|
15
|
+
* it on exactly this problem. Each part is typed directly, in any order, with
|
|
16
|
+
* no picker to fight.
|
|
17
|
+
*
|
|
18
|
+
* **The accessibility shape.** A `<fieldset>` and `<legend>` ask the question
|
|
19
|
+
* once; each part has its own visible label, so "Month" is announced rather
|
|
20
|
+
* than "second field"; `inputmode="numeric"` brings up a number pad without
|
|
21
|
+
* `type="number"`, which on a date part gives spinners, scroll-wheel surprises
|
|
22
|
+
* and silent stripping of a leading zero. The parts carry `autocomplete`
|
|
23
|
+
* tokens so autofill still works, which is 1.3.5.
|
|
24
|
+
|
|
25
|
+
*
|
|
26
|
+
* @category form
|
|
27
|
+
* @icon calendar
|
|
28
|
+
*/
|
|
29
|
+
export declare class ImpktDateInput extends FieldElement {
|
|
30
|
+
static properties: {
|
|
31
|
+
day: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
34
|
+
month: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
};
|
|
37
|
+
year: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
};
|
|
40
|
+
autocompleteSection: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
attribute: string;
|
|
43
|
+
};
|
|
44
|
+
label: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
};
|
|
47
|
+
name: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
50
|
+
value: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
};
|
|
53
|
+
description: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
};
|
|
56
|
+
error: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
};
|
|
59
|
+
required: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
reflect: boolean;
|
|
62
|
+
};
|
|
63
|
+
disabled: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
reflect: boolean;
|
|
66
|
+
};
|
|
67
|
+
readonly: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
reflect: boolean;
|
|
70
|
+
};
|
|
71
|
+
requiredText: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
attribute: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
day: string;
|
|
77
|
+
month: string;
|
|
78
|
+
year: string;
|
|
79
|
+
/** "bday" fills a date of birth. Empty disables autofill for this field. */
|
|
80
|
+
autocompleteSection: string;
|
|
81
|
+
constructor();
|
|
82
|
+
static styles: import("lit").CSSResult[];
|
|
83
|
+
protected renderLabel(): TemplateResult;
|
|
84
|
+
private datePart;
|
|
85
|
+
/** ISO, or empty while incomplete. Partial dates are not half-valid. */
|
|
86
|
+
private emit;
|
|
87
|
+
protected renderControl(): TemplateResult;
|
|
88
|
+
render(): TemplateResult;
|
|
89
|
+
updated(changed: Map<string, unknown>): void;
|
|
90
|
+
}
|
|
91
|
+
declare global {
|
|
92
|
+
interface HTMLElementTagNameMap {
|
|
93
|
+
'impkt-date-input': ImpktDateInput;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { ImpktElement } from '../base/ImpktElement';
|
|
3
|
+
/**
|
|
4
|
+
* A modal dialog — "are you sure you want to leave this order?".
|
|
5
|
+
*
|
|
6
|
+
* **It is a native `<dialog>` opened with `showModal()`, and that is the whole
|
|
7
|
+
* design.** The platform then provides, correctly and in every browser: a
|
|
8
|
+
* focus trap, Escape to close, the rest of the page made inert so a screen
|
|
9
|
+
* reader cannot wander out of the dialog, rendering in the top layer so no
|
|
10
|
+
* `z-index` can cover it, and focus returned to whatever opened it when it
|
|
11
|
+
* closes.
|
|
12
|
+
*
|
|
13
|
+
* Every one of those is a thing hand-rolled modals get wrong. The focus trap
|
|
14
|
+
* is the famous one, but inertness is the worse failure: a dialog that traps
|
|
15
|
+
* the Tab key but leaves the background in the accessibility tree lets a
|
|
16
|
+
* screen-reader user read straight past it into a page they cannot interact
|
|
17
|
+
* with, and nothing on screen tells them that is what happened.
|
|
18
|
+
*
|
|
19
|
+
* What is left to get right is the labelling. `aria-labelledby` points at the
|
|
20
|
+
* dialog's own heading, so it is announced by name on open rather than as
|
|
21
|
+
* "dialog".
|
|
22
|
+
|
|
23
|
+
*
|
|
24
|
+
* @category feedback
|
|
25
|
+
* @icon dialog
|
|
26
|
+
* @slot - The body of the dialog.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ImpktDialog extends ImpktElement {
|
|
29
|
+
static properties: {
|
|
30
|
+
open: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
reflect: boolean;
|
|
33
|
+
};
|
|
34
|
+
heading: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
};
|
|
37
|
+
closeLabel: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
attribute: string;
|
|
40
|
+
};
|
|
41
|
+
dismissible: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
open: boolean;
|
|
46
|
+
heading: string;
|
|
47
|
+
closeLabel: string;
|
|
48
|
+
/** When false, Escape and the backdrop do not close it — a decision must be made. */
|
|
49
|
+
dismissible: boolean;
|
|
50
|
+
constructor();
|
|
51
|
+
static styles: import("lit").CSSResult[];
|
|
52
|
+
private get dialog();
|
|
53
|
+
updated(changed: Map<string, unknown>): void;
|
|
54
|
+
private close;
|
|
55
|
+
render(): TemplateResult;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
'impkt-dialog': ImpktDialog;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ImpktElement } from '../base/ImpktElement';
|
|
2
|
+
/**
|
|
3
|
+
* A responsive row with named column slots. Child order stays inside each
|
|
4
|
+
* column; changing a page's visual grid never reorders its reading sequence.
|
|
5
|
+
*
|
|
6
|
+
* @category layout
|
|
7
|
+
* @icon columns
|
|
8
|
+
* @slot column-1 - First column.
|
|
9
|
+
* @slot column-2 - Second column.
|
|
10
|
+
* @slot column-3 - Third column.
|
|
11
|
+
* @slot column-4 - Fourth column.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ImpktGrid extends ImpktElement {
|
|
14
|
+
static properties: {
|
|
15
|
+
columns: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
reflect: boolean;
|
|
18
|
+
};
|
|
19
|
+
gap: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
reflect: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
columns: 'one' | 'two' | 'three' | 'four' | 'sidebar-left' | 'sidebar-right';
|
|
25
|
+
gap: 'sm' | 'md' | 'lg';
|
|
26
|
+
constructor();
|
|
27
|
+
static styles: import("lit").CSSResult[];
|
|
28
|
+
render(): import("lit").TemplateResult<1>;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'impkt-grid': ImpktGrid;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|