@nordhealth/components 3.9.0 → 3.10.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/custom-elements.json +3938 -3411
- package/lib/AutocompleteMixin-3cf61f49.js +2 -0
- package/lib/{AutocompleteMixin-5a7e10b2.js.map → AutocompleteMixin-3cf61f49.js.map} +1 -1
- package/lib/Avatar.js +1 -1
- package/lib/Avatar.js.map +1 -1
- package/lib/Badge.js +1 -1
- package/lib/Badge.js.map +1 -1
- package/lib/Banner.js +1 -1
- package/lib/Banner.js.map +1 -1
- package/lib/Button.js +1 -1
- package/lib/Button.js.map +1 -1
- package/lib/ButtonGroup.js +1 -1
- package/lib/ButtonGroup.js.map +1 -1
- package/lib/{Calendar-3170b9d4.js → Calendar-dc74855f.js} +2 -2
- package/lib/Calendar-dc74855f.js.map +1 -0
- package/lib/Calendar.js +1 -1
- package/lib/Card.js +1 -1
- package/lib/Card.js.map +1 -1
- package/lib/Checkbox.js +1 -1
- package/lib/Checkbox.js.map +1 -1
- package/lib/CommandMenu.js +1 -1
- package/lib/CommandMenu.js.map +1 -1
- package/lib/CommandMenuAction.js +1 -1
- package/lib/CommandMenuAction.js.map +1 -1
- package/lib/{Component-2253424f.js → Component-420bbc41.js} +2 -2
- package/lib/Component-420bbc41.js.map +1 -0
- package/lib/DatePicker.js +1 -1
- package/lib/DatePicker.js.map +1 -1
- package/lib/DateSelectEvent.js.map +1 -1
- package/lib/DirectionController-f35f5476.js.map +1 -1
- package/lib/Divider.js +1 -1
- package/lib/Divider.js.map +1 -1
- package/lib/Drawer.js +1 -1
- package/lib/Drawer.js.map +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/Dropdown.js.map +1 -1
- package/lib/DropdownGroup.js +1 -1
- package/lib/DropdownGroup.js.map +1 -1
- package/lib/{DropdownItem-588f5a6b.js → DropdownItem-caa387e2.js} +2 -2
- package/lib/DropdownItem-caa387e2.js.map +1 -0
- package/lib/DropdownItem.js +1 -1
- package/lib/DropdownItem.js.map +1 -1
- package/lib/EmptyState.js +1 -1
- package/lib/EmptyState.js.map +1 -1
- package/lib/EventController-d99ebeef.js.map +1 -1
- package/lib/Fieldset.js +1 -1
- package/lib/Fieldset.js.map +1 -1
- package/lib/{FocusableMixin-d30213b4.js → FocusableMixin-4300e44e.js} +2 -2
- package/lib/{FocusableMixin-d30213b4.js.map → FocusableMixin-4300e44e.js.map} +1 -1
- package/lib/Footer.js +1 -1
- package/lib/Footer.js.map +1 -1
- package/lib/FormAssociatedMixin-6f1c13ac.js +2 -0
- package/lib/FormAssociatedMixin-6f1c13ac.js.map +1 -0
- package/lib/FormDataController-592ff3dd.js +2 -0
- package/lib/FormDataController-592ff3dd.js.map +1 -0
- package/lib/{FormField-87551be2.js → FormField-cbfebb3f.js} +2 -2
- package/lib/FormField-cbfebb3f.js.map +1 -0
- package/lib/Header.js +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/Icon.js +1 -1
- package/lib/Icon.js.map +1 -1
- package/lib/IconManager.js.map +1 -1
- package/lib/Input.js +1 -1
- package/lib/Input.js.map +1 -1
- package/lib/{InputMixin-83b5bd46.js → InputMixin-f9fb4034.js} +2 -2
- package/lib/{InputMixin-83b5bd46.js.map → InputMixin-f9fb4034.js.map} +1 -1
- package/lib/KeyboardController.js.map +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/LightDismissController-11ae4745.js +2 -0
- package/lib/LightDismissController-11ae4745.js.map +1 -0
- package/lib/{LightDomController-5388d84c.js → LightDomController-3d3edb76.js} +2 -2
- package/lib/{LightDomController-5388d84c.js.map → LightDomController-3d3edb76.js.map} +1 -1
- package/lib/LocalizeController.js +1 -1
- package/lib/LocalizeController.js.map +1 -1
- package/lib/Message.js +1 -1
- package/lib/Message.js.map +1 -1
- package/lib/Modal.js +1 -1
- package/lib/Modal.js.map +1 -1
- package/lib/ModalController.js +1 -1
- package/lib/ModalController.js.map +1 -1
- package/lib/NavGroup.js +1 -1
- package/lib/NavGroup.js.map +1 -1
- package/lib/NavItem.js +1 -1
- package/lib/NavItem.js.map +1 -1
- package/lib/{NavToggle-cb2c3648.js → NavToggle-9a4439da.js} +2 -2
- package/lib/{NavToggle-cb2c3648.js.map → NavToggle-9a4439da.js.map} +1 -1
- package/lib/NavToggle.js +1 -1
- package/lib/Navigation.js +1 -1
- package/lib/Navigation.js.map +1 -1
- package/lib/Notification.js +1 -1
- package/lib/Notification.js.map +1 -1
- package/lib/NotificationGroup.js +1 -1
- package/lib/NotificationGroup.js.map +1 -1
- package/lib/{NotificationMixin-207f1f56.js → NotificationMixin-c06bb631.js} +2 -2
- package/lib/{NotificationMixin-207f1f56.js.map → NotificationMixin-c06bb631.js.map} +1 -1
- package/lib/Popout-e5584f6a.js +2 -0
- package/lib/Popout-e5584f6a.js.map +1 -0
- package/lib/Popout.js +1 -1
- package/lib/ProgressBar.js +1 -1
- package/lib/ProgressBar.js.map +1 -1
- package/lib/Qrcode.js +1 -1
- package/lib/Qrcode.js.map +1 -1
- package/lib/Radio.js +1 -1
- package/lib/Radio.js.map +1 -1
- package/lib/Range.js +1 -1
- package/lib/Range.js.map +1 -1
- package/lib/ScrollbarController-773c79f4.js.map +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/SelectEvent.js.map +1 -1
- package/lib/ShortcutController-87615e31.js.map +1 -1
- package/lib/SizeMixin-fb379434.js +2 -0
- package/lib/{SizeMixin-ab074eff.js.map → SizeMixin-fb379434.js.map} +1 -1
- package/lib/Skeleton.js +1 -1
- package/lib/Skeleton.js.map +1 -1
- package/lib/SlotController-d733c575.js.map +1 -1
- package/lib/Spinner.js +1 -1
- package/lib/Spinner.js.map +1 -1
- package/lib/Stack.js +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/{Sticky-c34c9b12.js → Sticky-acc92284.js} +2 -2
- package/lib/Sticky-acc92284.js.map +1 -0
- package/lib/Tab.js +1 -1
- package/lib/Tab.js.map +1 -1
- package/lib/TabGroup.js +1 -1
- package/lib/TabGroup.js.map +1 -1
- package/lib/TabPanel.js +1 -1
- package/lib/TabPanel.js.map +1 -1
- package/lib/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/Tag.js +2 -0
- package/lib/Tag.js.map +1 -0
- package/lib/{TextField-2d778949.js → TextField-8b226327.js} +2 -2
- package/lib/{TextField-2d778949.js.map → TextField-8b226327.js.map} +1 -1
- package/lib/Textarea.js +1 -1
- package/lib/Textarea.js.map +1 -1
- package/lib/Toast.js +1 -1
- package/lib/Toast.js.map +1 -1
- package/lib/ToastGroup.js +1 -1
- package/lib/ToastGroup.js.map +1 -1
- package/lib/Toggle.js +1 -1
- package/lib/Toggle.js.map +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.js.map +1 -1
- package/lib/TopBar.js +1 -1
- package/lib/TopBar.js.map +1 -1
- package/lib/VisuallyHidden.js +1 -1
- package/lib/VisuallyHidden.js.map +1 -1
- package/lib/bundle.js +18 -35
- package/lib/bundle.js.map +1 -1
- package/lib/{class-map-512f0bc1.js → class-map-cb77ead2.js} +2 -2
- package/lib/class-map-cb77ead2.js.map +1 -0
- package/lib/collection-2f8e38bd.js +7 -0
- package/lib/collection-2f8e38bd.js.map +1 -0
- package/lib/cond-44672025.js +2 -0
- package/lib/{cond-bb9ee891.js.map → cond-44672025.js.map} +1 -1
- package/lib/{directive-e9ce14b4.js → directive-de55b00a.js} +1 -1
- package/lib/directive-de55b00a.js.map +1 -0
- package/lib/en-us.js +1 -1
- package/lib/en-us.js.map +1 -1
- package/lib/events-d9666e88.js.map +1 -1
- package/lib/fi-fi.js +1 -1
- package/lib/fi-fi.js.map +1 -1
- package/lib/{if-defined-cccde88f.js → if-defined-9b177db4.js} +2 -2
- package/lib/if-defined-9b177db4.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/interface-checked-small-07292940.js +2 -0
- package/lib/interface-checked-small-07292940.js.map +1 -0
- package/lib/localization9.js +2 -0
- package/lib/localization9.js.map +1 -0
- package/lib/observe-a9c6dfb6.js.map +1 -1
- package/lib/positioning-a572d126.js +2 -0
- package/lib/positioning-a572d126.js.map +1 -0
- package/lib/{property-c78323b1.js → property-03f59dce.js} +2 -2
- package/lib/property-03f59dce.js.map +1 -0
- package/lib/{query-36bfe0e4.js → query-2d22378e.js} +1 -1
- package/lib/query-2d22378e.js.map +1 -0
- package/lib/query-assigned-elements-15485e3d.js +34 -0
- package/lib/query-assigned-elements-15485e3d.js.map +1 -0
- package/lib/{ref-99418ab4.js → ref-5526fb07.js} +4 -4
- package/lib/ref-5526fb07.js.map +1 -0
- package/lib/src/avatar/Avatar.d.ts +4 -4
- package/lib/src/badge/Badge.d.ts +1 -1
- package/lib/src/banner/Banner.d.ts +1 -1
- package/lib/src/button-group/ButtonGroup.d.ts +1 -1
- package/lib/src/calendar/Calendar.d.ts +3 -3
- package/lib/src/card/Card.d.ts +1 -1
- package/lib/src/checkbox/Checkbox.d.ts +1 -1
- package/lib/src/command-menu/CommandMenu.d.ts +1 -1
- package/lib/src/command-menu/CommandMenuAction.d.ts +1 -1
- package/lib/src/common/controllers/FocusTrapController.d.ts +2 -8
- package/lib/src/common/controllers/LightDismissController.d.ts +3 -1
- package/lib/src/common/inert.d.ts +1 -0
- package/lib/src/date-picker/DatePicker.d.ts +3 -3
- package/lib/src/drawer/Drawer.d.ts +1 -1
- package/lib/src/dropdown/Dropdown.d.ts +1 -2
- package/lib/src/dropdown-group/DropdownGroup.d.ts +1 -1
- package/lib/src/empty-state/EmptyState.d.ts +1 -1
- package/lib/src/fieldset/Fieldset.d.ts +1 -1
- package/lib/src/footer/Footer.d.ts +1 -1
- package/lib/src/header/Header.d.ts +1 -1
- package/lib/src/icon/Icon.d.ts +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/input/Input.d.ts +1 -1
- package/lib/src/layout/Layout.d.ts +1 -1
- package/lib/src/localization/en-us.d.ts +3 -0
- package/lib/src/localization/translation.d.ts +3 -0
- package/lib/src/modal/Modal.d.ts +1 -14
- package/lib/src/nav-group/NavGroup.d.ts +1 -1
- package/lib/src/nav-toggle/NavToggle.d.ts +1 -1
- package/lib/src/navigation/Navigation.d.ts +1 -1
- package/lib/src/notification/Notification.d.ts +1 -1
- package/lib/src/notification-group/NotificationGroup.d.ts +1 -1
- package/lib/src/popout/Popout.d.ts +1 -1
- package/lib/src/progress-bar/ProgressBar.d.ts +1 -1
- package/lib/src/qrcode/Qrcode.d.ts +1 -1
- package/lib/src/radio/Radio.d.ts +1 -1
- package/lib/src/range/Range.d.ts +1 -1
- package/lib/src/select/Select.d.ts +1 -1
- package/lib/src/skeleton/Skeleton.d.ts +1 -1
- package/lib/src/spinner/Spinner.d.ts +1 -1
- package/lib/src/stack/Stack.d.ts +1 -1
- package/lib/src/tab/Tab.d.ts +1 -1
- package/lib/src/tab-group/TabGroup.d.ts +1 -1
- package/lib/src/tab-panel/TabPanel.d.ts +1 -1
- package/lib/src/tag/Tag.d.ts +44 -0
- package/lib/src/tag/Tag.test.d.ts +6 -0
- package/lib/src/tag/localization.d.ts +4 -0
- package/lib/src/textarea/Textarea.d.ts +1 -1
- package/lib/src/toast/Toast.d.ts +1 -1
- package/lib/src/toast-group/ToastGroup.d.ts +1 -1
- package/lib/src/toggle/Toggle.d.ts +1 -1
- package/lib/src/tooltip/Tooltip.d.ts +1 -1
- package/lib/src/top-bar/TopBar.d.ts +1 -1
- package/lib/src/visually-hidden/VisuallyHidden.d.ts +1 -1
- package/lib/{state-d31c6912.js → state-70f38ceb.js} +2 -2
- package/lib/state-70f38ceb.js.map +1 -0
- package/lib/style-map-ed7e6cc6.js +7 -0
- package/lib/style-map-ed7e6cc6.js.map +1 -0
- package/lib/translation.js +1 -1
- package/lib/translation.js.map +1 -1
- package/package.json +2 -2
- package/lib/AutocompleteMixin-5a7e10b2.js +0 -2
- package/lib/Calendar-3170b9d4.js.map +0 -1
- package/lib/Component-2253424f.js.map +0 -1
- package/lib/DropdownItem-588f5a6b.js.map +0 -1
- package/lib/FormAssociatedMixin-a278fda4.js +0 -2
- package/lib/FormAssociatedMixin-a278fda4.js.map +0 -1
- package/lib/FormField-87551be2.js.map +0 -1
- package/lib/LightDismissController-a2645ae6.js +0 -2
- package/lib/LightDismissController-a2645ae6.js.map +0 -1
- package/lib/Popout-2220e77b.js +0 -2
- package/lib/Popout-2220e77b.js.map +0 -1
- package/lib/SizeMixin-ab074eff.js +0 -2
- package/lib/Sticky-c34c9b12.js.map +0 -1
- package/lib/class-map-512f0bc1.js.map +0 -1
- package/lib/collection-511dcfac.js +0 -7
- package/lib/collection-511dcfac.js.map +0 -1
- package/lib/cond-bb9ee891.js +0 -2
- package/lib/directive-e9ce14b4.js.map +0 -1
- package/lib/if-defined-cccde88f.js.map +0 -1
- package/lib/positioning-2346bdd6.js +0 -2
- package/lib/positioning-2346bdd6.js.map +0 -1
- package/lib/property-c78323b1.js.map +0 -1
- package/lib/query-36bfe0e4.js.map +0 -1
- package/lib/query-assigned-elements-92ce7494.js +0 -51
- package/lib/query-assigned-elements-92ce7494.js.map +0 -1
- package/lib/ref-99418ab4.js.map +0 -1
- package/lib/state-d31c6912.js.map +0 -1
- package/lib/style-map-f8a1c8d5.js +0 -7
- package/lib/style-map-f8a1c8d5.js.map +0 -1
|
@@ -14,7 +14,7 @@ export default class NavGroup extends LitElement {
|
|
|
14
14
|
* Heading and accessible label for the nav group
|
|
15
15
|
*/
|
|
16
16
|
heading?: string;
|
|
17
|
-
render(): import("lit").TemplateResult<1>;
|
|
17
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
18
18
|
}
|
|
19
19
|
declare global {
|
|
20
20
|
interface HTMLElementTagNameMap {
|
|
@@ -16,7 +16,7 @@ export default class NavToggle extends NavToggle_base {
|
|
|
16
16
|
static styles: import("lit").CSSResult[];
|
|
17
17
|
private direction;
|
|
18
18
|
private localization;
|
|
19
|
-
render(): import("lit").TemplateResult<1>;
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
20
|
}
|
|
21
21
|
declare global {
|
|
22
22
|
interface HTMLElementTagNameMap {
|
|
@@ -18,7 +18,7 @@ export default class Navigation extends LitElement {
|
|
|
18
18
|
private events;
|
|
19
19
|
private allowItemsToRemainOpen;
|
|
20
20
|
connectedCallback(): void;
|
|
21
|
-
render(): import("lit").TemplateResult<1>;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
22
|
private handleActivate;
|
|
23
23
|
}
|
|
24
24
|
declare global {
|
|
@@ -16,7 +16,7 @@ declare const Notification_base: (new (...args: any[]) => import("../common/mixi
|
|
|
16
16
|
export default class Notification extends Notification_base {
|
|
17
17
|
static styles: import("lit").CSSResult[];
|
|
18
18
|
private localize;
|
|
19
|
-
render(): import("lit").TemplateResult<1>;
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
20
|
}
|
|
21
21
|
declare global {
|
|
22
22
|
interface HTMLElementTagNameMap {
|
|
@@ -8,7 +8,7 @@ import { LitElement } from "lit";
|
|
|
8
8
|
*/
|
|
9
9
|
export default class NotificationGroup extends LitElement {
|
|
10
10
|
static styles: import("lit").CSSResult[];
|
|
11
|
-
render(): import("lit").TemplateResult<1>;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
}
|
|
13
13
|
declare global {
|
|
14
14
|
interface HTMLElementTagNameMap {
|
|
@@ -49,7 +49,7 @@ export default class Popout extends Popout_base {
|
|
|
49
49
|
firstUpdated(): void;
|
|
50
50
|
connectedCallback(): void;
|
|
51
51
|
disconnectedCallback(): void;
|
|
52
|
-
render(): import("lit").TemplateResult<1>;
|
|
52
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
53
53
|
protected handleIdChange(): void;
|
|
54
54
|
protected handleOpenChange(): void;
|
|
55
55
|
protected handleAnchorChange(): void;
|
|
@@ -32,7 +32,7 @@ export default class ProgressBar extends ProgressBar_base {
|
|
|
32
32
|
* for assistive technology.
|
|
33
33
|
*/
|
|
34
34
|
label: string;
|
|
35
|
-
render(): import("lit").TemplateResult<1>;
|
|
35
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
36
36
|
}
|
|
37
37
|
declare global {
|
|
38
38
|
interface HTMLElementTagNameMap {
|
|
@@ -42,7 +42,7 @@ export default class Qrcode extends LitElement {
|
|
|
42
42
|
correction: "L" | "M" | "Q" | "H";
|
|
43
43
|
firstUpdated(): void;
|
|
44
44
|
private generate;
|
|
45
|
-
render(): import("lit").TemplateResult<1>;
|
|
45
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
46
46
|
}
|
|
47
47
|
declare global {
|
|
48
48
|
interface HTMLElementTagNameMap {
|
package/lib/src/radio/Radio.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export default class Radio extends Radio_base {
|
|
|
29
29
|
* Controls whether the checkbox is checked or not.
|
|
30
30
|
*/
|
|
31
31
|
checked: boolean;
|
|
32
|
-
render(): import("lit").TemplateResult<1>;
|
|
32
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
33
33
|
protected handleCheckedChange(previousChecked: boolean): void;
|
|
34
34
|
private uncheckSiblings;
|
|
35
35
|
protected handleChange(e: Event): void;
|
package/lib/src/range/Range.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export default class Range extends Range_base {
|
|
|
34
34
|
* Controls whether the input expands to fill the width of its container.
|
|
35
35
|
*/
|
|
36
36
|
expand: boolean;
|
|
37
|
-
render(): import("lit").TemplateResult<1>;
|
|
37
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
38
38
|
protected handleInput(e: Event): void;
|
|
39
39
|
}
|
|
40
40
|
declare global {
|
|
@@ -24,7 +24,7 @@ export default class Select extends Select_base {
|
|
|
24
24
|
* Controls whether the select expands to fill the width of its container.
|
|
25
25
|
*/
|
|
26
26
|
expand: boolean;
|
|
27
|
-
render(): import("lit").TemplateResult<1>;
|
|
27
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
28
28
|
private get options();
|
|
29
29
|
private getButtonText;
|
|
30
30
|
private renderOption;
|
|
@@ -18,7 +18,7 @@ export default class Skeleton extends LitElement {
|
|
|
18
18
|
* The default is no animation.
|
|
19
19
|
*/
|
|
20
20
|
effect?: "pulse" | "sheen";
|
|
21
|
-
render(): import("lit").TemplateResult<1>;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
22
|
}
|
|
23
23
|
declare global {
|
|
24
24
|
interface HTMLElementTagNameMap {
|
|
@@ -25,7 +25,7 @@ export default class Spinner extends LitElement {
|
|
|
25
25
|
* If no label is supplied, the spinner is hidden from assistive technology.
|
|
26
26
|
*/
|
|
27
27
|
label?: string;
|
|
28
|
-
render(): import("lit").TemplateResult<1>;
|
|
28
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
29
29
|
}
|
|
30
30
|
declare global {
|
|
31
31
|
interface HTMLElementTagNameMap {
|
package/lib/src/stack/Stack.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export default class Stack extends LitElement {
|
|
|
32
32
|
* How to justify the child items inside the stack.
|
|
33
33
|
*/
|
|
34
34
|
justifyContent?: "center" | "start" | "end" | "baseline" | "space-between" | "space-around" | "space-evenly";
|
|
35
|
-
render(): import("lit").TemplateResult<1>;
|
|
35
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
36
36
|
}
|
|
37
37
|
declare global {
|
|
38
38
|
interface HTMLElementTagNameMap {
|
package/lib/src/tab/Tab.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export default class Tab extends LitElement {
|
|
|
16
16
|
* Whether the tab item is selected
|
|
17
17
|
*/
|
|
18
18
|
selected: boolean;
|
|
19
|
-
render(): import("lit").TemplateResult<1>;
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
20
|
/**
|
|
21
21
|
* Apply accessible attributes and values to the tab button.
|
|
22
22
|
* Observe the selected property if it changes
|
|
@@ -35,7 +35,7 @@ export default class TabGroup extends LitElement {
|
|
|
35
35
|
* The current tab node selected in the tab group.
|
|
36
36
|
*/
|
|
37
37
|
private selectedTab;
|
|
38
|
-
render(): import("lit").TemplateResult<1>;
|
|
38
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
39
39
|
connectedCallback(): void;
|
|
40
40
|
private updateSlots;
|
|
41
41
|
firstUpdated(): void;
|
|
@@ -9,7 +9,7 @@ import { LitElement } from "lit";
|
|
|
9
9
|
*/
|
|
10
10
|
export default class TabPanel extends LitElement {
|
|
11
11
|
static styles: import("lit").CSSResult[];
|
|
12
|
-
render(): import("lit").TemplateResult<1>;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
13
|
connectedCallback(): void;
|
|
14
14
|
}
|
|
15
15
|
declare global {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { FormDataController } from "../common/controllers/FormDataController.js";
|
|
3
|
+
declare const Tag_base: (new (...args: any[]) => import("../common/mixins/InputMixin.js").InputMixinInterface) & (new (...args: any[]) => import("../common/mixins/FocusableMixin.js").FocusableMixinInterface) & typeof LitElement;
|
|
4
|
+
/**
|
|
5
|
+
* Tags represent a set of keywords that help label, categorize,
|
|
6
|
+
* and organize objects. Commonly used to signify the attributes of an object.
|
|
7
|
+
*
|
|
8
|
+
* @status draft
|
|
9
|
+
* @category text
|
|
10
|
+
* @slot - The tag content.
|
|
11
|
+
*
|
|
12
|
+
* @localization removeLabel - Accessible label for the remove button.
|
|
13
|
+
*/
|
|
14
|
+
export default class Tag extends Tag_base {
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
private localize;
|
|
17
|
+
protected formData: FormDataController;
|
|
18
|
+
protected get formValue(): string | undefined;
|
|
19
|
+
protected inputId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The behavioral variant of the tag.
|
|
22
|
+
*/
|
|
23
|
+
variant: "default" | "removable" | "selectable";
|
|
24
|
+
/**
|
|
25
|
+
* Controls whether the tag is checked or not (only relevant when variant is set to `selectable`).
|
|
26
|
+
*/
|
|
27
|
+
checked: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The size of the tag. This affects the font-size.
|
|
30
|
+
*/
|
|
31
|
+
size: "s" | "m";
|
|
32
|
+
protected handleChange(e: Event): void;
|
|
33
|
+
protected handleRemove(): void;
|
|
34
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
35
|
+
private renderStaticTag;
|
|
36
|
+
private renderRemovableTag;
|
|
37
|
+
private renderSelectableTag;
|
|
38
|
+
}
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
"nord-tag": Tag;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -44,7 +44,7 @@ export default class Textarea extends Textarea_base {
|
|
|
44
44
|
* When combined with `maxlength`, both the count and the max length are shown.
|
|
45
45
|
*/
|
|
46
46
|
characterCounter: boolean;
|
|
47
|
-
render(): import("lit").TemplateResult<1>;
|
|
47
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
48
48
|
private renderCharacterCounter;
|
|
49
49
|
private handleLangChange;
|
|
50
50
|
protected resizeToFitContent(): void;
|
package/lib/src/toast/Toast.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default class Toast extends Toast_base {
|
|
|
26
26
|
* The returned promise resolves when toast's exit animation is complete.
|
|
27
27
|
*/
|
|
28
28
|
dismiss(): Promise<void>;
|
|
29
|
-
render(): import("lit").TemplateResult<1>;
|
|
29
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
30
30
|
protected handleAutoDismissChange(): void;
|
|
31
31
|
}
|
|
32
32
|
declare global {
|
|
@@ -10,7 +10,7 @@ type ToastOptions = Partial<Pick<Toast, "variant" | "autoDismiss">>;
|
|
|
10
10
|
*/
|
|
11
11
|
export default class ToastGroup extends LitElement {
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
render(): import("lit").TemplateResult<1>;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
14
|
/**
|
|
15
15
|
* Convenience method for creating and adding a toast to the group.
|
|
16
16
|
* @param {string} text - The text/message of the toast.
|
|
@@ -27,7 +27,7 @@ export default class Toggle extends Toggle_base {
|
|
|
27
27
|
* The size of the toggle switch.
|
|
28
28
|
*/
|
|
29
29
|
size: "s" | "m" | "l";
|
|
30
|
-
render(): import("lit").TemplateResult<1>;
|
|
30
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
31
31
|
protected handleChange(e: Event): void;
|
|
32
32
|
}
|
|
33
33
|
declare global {
|
|
@@ -52,7 +52,7 @@ export default class Tooltip extends LitElement {
|
|
|
52
52
|
* Apply all event listeners
|
|
53
53
|
*/
|
|
54
54
|
connectedCallback(): void;
|
|
55
|
-
render(): import("lit").TemplateResult<1>;
|
|
55
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
56
56
|
protected handleIdChange(): void;
|
|
57
57
|
private handleStateChange;
|
|
58
58
|
/**
|
|
@@ -8,7 +8,7 @@ import { LitElement } from "lit";
|
|
|
8
8
|
*/
|
|
9
9
|
export default class TopBar extends LitElement {
|
|
10
10
|
static styles: import("lit").CSSResult[];
|
|
11
|
-
render(): import("lit").TemplateResult<1>;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
}
|
|
13
13
|
declare global {
|
|
14
14
|
interface HTMLElementTagNameMap {
|
|
@@ -10,7 +10,7 @@ import { LitElement } from "lit";
|
|
|
10
10
|
*/
|
|
11
11
|
export default class VisuallyHidden extends LitElement {
|
|
12
12
|
static styles: import("lit").CSSResult;
|
|
13
|
-
render(): import("lit").TemplateResult<1>;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
14
|
}
|
|
15
15
|
declare global {
|
|
16
16
|
interface HTMLElementTagNameMap {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as r}from"./property-03f59dce.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/function t(t){return r({...t,state:!0})}export{t};
|
|
7
|
-
//# sourceMappingURL=state-
|
|
7
|
+
//# sourceMappingURL=state-70f38ceb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-70f38ceb.js","sources":["../node_modules/@lit/reactive-element/decorators/state.js"],"sourcesContent":["import{property as r}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function t(t){return r({...t,state:!0})}export{t as state};\n//# sourceMappingURL=state.js.map\n"],"names":["t","r","state"],"mappings":";;;;;GAKG,SAASA,EAAEA,GAAG,OAAOC,EAAE,IAAID,EAAEE,OAAM,GAAI"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{T as t}from"./query-assigned-elements-15485e3d.js";import{e,i as r,t as s}from"./directive-de55b00a.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2018 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/const n="important",i=" !"+n,o=e(class extends r{constructor(t){var e;if(super(t),t.type!==s.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ut){this.ut=new Set;for(const t in r)this.ut.add(t);return this.render(r)}this.ut.forEach((t=>{null==r[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in r){const e=r[t];if(null!=e){this.ut.add(t);const r="string"==typeof e&&e.endsWith(i);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:""):s[t]=e}}return t}});export{o};
|
|
7
|
+
//# sourceMappingURL=style-map-ed7e6cc6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-map-ed7e6cc6.js","sources":["../node_modules/lit-html/directives/style-map.js"],"sourcesContent":["import{noChange as t}from\"../lit-html.js\";import{directive as e,Directive as r,PartType as s}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const i=\"important\",n=\" !\"+i,o=e(class extends r{constructor(t){var e;if(super(t),t.type!==s.ATTRIBUTE||\"style\"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error(\"The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.\")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,\"-$&\").toLowerCase()}:${s};`}),\"\")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ut){this.ut=new Set;for(const t in r)this.ut.add(t);return this.render(r)}this.ut.forEach((t=>{null==r[t]&&(this.ut.delete(t),t.includes(\"-\")?s.removeProperty(t):s[t]=\"\")}));for(const t in r){const e=r[t];if(null!=e){this.ut.add(t);const r=\"string\"==typeof e&&e.endsWith(n);t.includes(\"-\")||r?s.setProperty(t,r?e.slice(0,-11):e,r?i:\"\"):s[t]=e}}return t}});export{o as styleMap};\n//# sourceMappingURL=style-map.js.map\n"],"names":["i","n","o","e","r","constructor","t","super","type","s","ATTRIBUTE","name","strings","length","Error","render","Object","keys","reduce","replace","toLowerCase","update","style","element","this","ut","Set","add","forEach","delete","includes","removeProperty","endsWith","setProperty","slice"],"mappings":";;;;;GAKQ,MAACA,EAAE,YAAYC,EAAE,KAAKD,EAAEE,EAAEC,EAAE,cAAcC,EAAEC,YAAYC,GAAG,IAAIH,EAAE,GAAGI,MAAMD,GAAGA,EAAEE,OAAOC,EAAEC,WAAW,UAAUJ,EAAEK,OAAO,QAAQR,EAAEG,EAAEM,eAAU,IAAST,OAAE,EAAOA,EAAEU,QAAQ,EAAE,MAAMC,MAAM,6GAA6G,CAACC,OAAOT,GAAG,OAAOU,OAAOC,KAAKX,GAAGY,QAAM,CAAGf,EAAEC,KAAK,MAAMK,EAAEH,EAAEF,GAAG,OAAO,MAAMK,EAAEN,EAAEA,EAAE,GAAGC,EAAEA,EAAEe,QAAQ,oCAAoC,OAAOC,iBAAiBX,IAAK,GAAE,GAAG,CAACY,OAAOlB,GAAGC,IAAI,MAAMkB,MAAMb,GAAGN,EAAEoB,QAAQ,QAAG,IAASC,KAAKC,GAAG,CAACD,KAAKC,GAAG,IAAIC,IAAI,IAAI,MAAMpB,KAAKF,EAAEoB,KAAKC,GAAGE,IAAIrB,GAAG,OAAOkB,KAAKT,OAAOX,EAAE,CAACoB,KAAKC,GAAGG,SAAStB,IAAI,MAAMF,EAAEE,KAAKkB,KAAKC,GAAGI,OAAOvB,GAAGA,EAAEwB,SAAS,KAAKrB,EAAEsB,eAAezB,GAAGG,EAAEH,GAAG,GAAI,IAAG,IAAI,MAAMA,KAAKF,EAAE,CAAC,MAAMD,EAAEC,EAAEE,GAAG,GAAG,MAAMH,EAAE,CAACqB,KAAKC,GAAGE,IAAIrB,GAAG,MAAMF,EAAE,iBAAiBD,GAAGA,EAAE6B,SAAS/B,GAAGK,EAAEwB,SAAS,MAAM1B,EAAEK,EAAEwB,YAAY3B,EAAEF,EAAED,EAAE+B,MAAM,GAAG,IAAI/B,EAAEC,EAAEJ,EAAE,IAAIS,EAAEH,GAAGH,CAAC,CAAC,CAAC,OAAOG,CAAC"}
|
package/lib/translation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./en-us.js";export{default as fallback}from"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./localization7.js";import"./localization8.js";const o=new Set,
|
|
1
|
+
import t from"./en-us.js";export{default as fallback}from"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./localization7.js";import"./localization8.js";import"./localization9.js";const o=new Set,i=new Map;function n(){for(const t of o)t()}function a(){i.clear()}function e(...t){t.forEach((t=>{const o=t.$lang.toLowerCase();i.set(o,t)})),n()}function r(t){return o.add(t),()=>o.delete(t)}function l(t){return i.has(t)}function s(o){const n=o.toLowerCase(),[a]=n.split("-");return i.get(n)||i.get(a)||t}new MutationObserver(n).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});export{a as clearTranslations,l as isTranslationRegistered,e as registerTranslation,s as resolveTranslation,r as subscribe};
|
|
2
2
|
//# sourceMappingURL=translation.js.map
|
package/lib/translation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sources":["../src/localization/translation.ts"],"sourcesContent":["import en from \"./en-us.js\"\n\n// gets list of properties beginning prefix\ntype PickStartsWith<T, Prefix extends string> = T extends `${Prefix}${string}` ? T : never\n\nexport type Translation = typeof en\nexport type WellKnownKeys = PickStartsWith<keyof Translation, \"$\">\n\nconst subscribers = new Set<() => void>()\nconst translations = new Map<string, Translation>()\n\nfunction update() {\n for (const subscriber of subscribers) {\n subscriber()\n }\n}\n\n// observe changes to the document's lang\nconst observer = new MutationObserver(update)\nobserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"lang\"],\n})\n\n/**\n * Removes all registered translations\n */\nexport function clearTranslations() {\n translations.clear()\n}\n\n/**\n * Registers one or more translations\n */\nexport function registerTranslation(...translation: Translation[]) {\n translation.forEach(t => {\n const lang = t.$lang.toLowerCase()\n translations.set(lang, t)\n })\n\n update()\n}\n\n/**\n * subscribe to language changes\n * @param onChange callback for when either `lang` attr changes, or a new language is registered.\n * @returns cleanup function\n */\nexport function subscribe(onChange: () => void): () => void {\n subscribers.add(onChange)\n return () => subscribers.delete(onChange)\n}\n\n/**\n * Check whether there is a translation registered for the given lang\n * @param lang the lang code e.g. \"en\" or \"en-GB\"\n */\nexport function isTranslationRegistered(lang: string) {\n return translations.has(lang)\n}\n\n/**\n * Picks the most appropriate translation for the given language, from most specific to least specific.\n * First tries lang + region, then lang only, then fallback.\n */\nexport function resolveTranslation(langCode: string) {\n const lang = langCode.toLowerCase()\n const [langOnly] = lang.split(\"-\")\n\n return translations.get(lang) || translations.get(langOnly) || en\n}\n\nexport { en as fallback }\n"],"names":["subscribers","Set","translations","Map","update","subscriber","clearTranslations","clear","registerTranslation","translation","forEach","t","lang","$lang","toLowerCase","set","subscribe","onChange","add","delete","isTranslationRegistered","has","resolveTranslation","langCode","langOnly","split","get","en","MutationObserver","observe","document","documentElement","attributes","attributeFilter"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation.js","sources":["../src/localization/translation.ts"],"sourcesContent":["import en from \"./en-us.js\"\n\n// gets list of properties beginning prefix\ntype PickStartsWith<T, Prefix extends string> = T extends `${Prefix}${string}` ? T : never\n\nexport type Translation = typeof en\nexport type WellKnownKeys = PickStartsWith<keyof Translation, \"$\">\n\nconst subscribers = new Set<() => void>()\nconst translations = new Map<string, Translation>()\n\nfunction update() {\n for (const subscriber of subscribers) {\n subscriber()\n }\n}\n\n// observe changes to the document's lang\nconst observer = new MutationObserver(update)\nobserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"lang\"],\n})\n\n/**\n * Removes all registered translations\n */\nexport function clearTranslations() {\n translations.clear()\n}\n\n/**\n * Registers one or more translations\n */\nexport function registerTranslation(...translation: Translation[]) {\n translation.forEach(t => {\n const lang = t.$lang.toLowerCase()\n translations.set(lang, t)\n })\n\n update()\n}\n\n/**\n * subscribe to language changes\n * @param onChange callback for when either `lang` attr changes, or a new language is registered.\n * @returns cleanup function\n */\nexport function subscribe(onChange: () => void): () => void {\n subscribers.add(onChange)\n return () => subscribers.delete(onChange)\n}\n\n/**\n * Check whether there is a translation registered for the given lang\n * @param lang the lang code e.g. \"en\" or \"en-GB\"\n */\nexport function isTranslationRegistered(lang: string) {\n return translations.has(lang)\n}\n\n/**\n * Picks the most appropriate translation for the given language, from most specific to least specific.\n * First tries lang + region, then lang only, then fallback.\n */\nexport function resolveTranslation(langCode: string) {\n const lang = langCode.toLowerCase()\n const [langOnly] = lang.split(\"-\")\n\n return translations.get(lang) || translations.get(langOnly) || en\n}\n\nexport { en as fallback }\n"],"names":["subscribers","Set","translations","Map","update","subscriber","clearTranslations","clear","registerTranslation","translation","forEach","t","lang","$lang","toLowerCase","set","subscribe","onChange","add","delete","isTranslationRegistered","has","resolveTranslation","langCode","langOnly","split","get","en","MutationObserver","observe","document","documentElement","attributes","attributeFilter"],"mappings":"wTAQA,MAAMA,EAAc,IAAIC,IAClBC,EAAe,IAAIC,IAEzB,SAASC,IACP,IAAK,MAAMC,KAAcL,EACvBK,GAEJ,UAYgBC,IACdJ,EAAaK,OACf,CAKgB,SAAAC,KAAuBC,GACrCA,EAAYC,SAAQC,IAClB,MAAMC,EAAOD,EAAEE,MAAMC,cACrBZ,EAAaa,IAAIH,EAAMD,EAAE,IAG3BP,GACF,CAOM,SAAUY,EAAUC,GAExB,OADAjB,EAAYkB,IAAID,GACT,IAAMjB,EAAYmB,OAAOF,EAClC,CAMM,SAAUG,EAAwBR,GACtC,OAAOV,EAAamB,IAAIT,EAC1B,CAMM,SAAUU,EAAmBC,GACjC,MAAMX,EAAOW,EAAST,eACfU,GAAYZ,EAAKa,MAAM,KAE9B,OAAOvB,EAAawB,IAAId,IAASV,EAAawB,IAAIF,IAAaG,CACjE,CApDiB,IAAIC,iBAAiBxB,GAC7ByB,QAAQC,SAASC,gBAAiB,CACzCC,YAAY,EACZC,gBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordhealth/components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "This package includes Nord Design System Web Components",
|
|
5
5
|
"author": "Nordhealth <support@nordhealth.design>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -184,5 +184,5 @@
|
|
|
184
184
|
}
|
|
185
185
|
]
|
|
186
186
|
},
|
|
187
|
-
"gitHead": "
|
|
187
|
+
"gitHead": "b0809f6fb370174be4c67e46472ddd18f882b2c1"
|
|
188
188
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./query-assigned-elements-92ce7494.js";import{n as o}from"./property-c78323b1.js";function t(t){class r extends t{constructor(){super(...arguments),this.autocomplete="off"}}return e([o()],r.prototype,"autocomplete",void 0),r}export{t as A};
|
|
2
|
-
//# sourceMappingURL=AutocompleteMixin-5a7e10b2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar-3170b9d4.js","sources":["../../icons/lib/assets/arrow-right-small.js","../../icons/lib/assets/arrow-left-small.js","../../icons/lib/assets/arrow-down-small.js","../src/common/controllers/SwipeController.ts","../src/calendar/Calendar.ts"],"sourcesContent":["export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m6.92903.100342-2.12132 2.121318 7.77819 7.77818-7.77828 7.77826 2.12132 2.1213 8.48536-8.4853c.7811-.7811.7811-2.04743 0-2.82848z\" fill=\"currentColor\"/></svg>'\nexport const title = \"arrow-right-small\"\nexport const tags = \"nordicon arrow right small caret pointing triangle chevron\"\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.0712.105225 2.1213 2.121315-7.77816 7.77816 7.77826 7.7783-2.1213 2.1213-8.48539-8.4854c-.78105-.781-.78105-2.04735 0-2.82839z\" fill=\"currentColor\"/></svg>'\nexport const title = \"arrow-left-small\"\nexport const tags = \"nordicon arrow left small caret pointing triangle chevron\"\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m.100342 6.92903 2.121318-2.12132 7.77818 7.77819 7.77826-7.77828 2.1213 2.12132-8.4853 8.48536c-.7811.7811-2.04743.7811-2.82848 0z\" fill=\"currentColor\"/></svg>'\nexport const title = \"arrow-down-small\"\nexport const tags = \"nordicon arrow down small caret pointing triangle chevron\"\n","import { ReactiveController, ReactiveElement } from \"lit\"\nimport { EventController } from \"./EventController.js\"\n\nexport type SwipeDetails = {\n initialX: number\n initialY: number\n pageX: number\n pageY: number\n distX: number\n distY: number\n}\n\nconst preventDefault = (e: Event) => e.preventDefault()\n\ntype SetRequired<T, K extends keyof T> = T & { [Property in K]-?: T[K] }\ntype SwipeControllerOptions = {\n target?: () => HTMLElement\n matchesGesture: (details: SwipeDetails) => boolean\n onSwipeEnd: (details: SwipeDetails) => void\n}\n\nexport class SwipeController implements ReactiveController {\n private events: EventController\n private hadFirstUpdate = false\n\n private initialTouchX: number = 0\n private initialTouchY: number = 0\n private options: SetRequired<SwipeControllerOptions, \"target\">\n\n constructor(host: ReactiveElement, options: SwipeControllerOptions) {\n host.addController(this)\n this.events = new EventController(host)\n\n this.options = {\n target: () => host,\n ...options,\n }\n }\n\n hostUpdated() {\n if (!this.hadFirstUpdate) {\n this.hadFirstUpdate = true\n\n const target = this.options.target()\n this.events.listen(target, \"touchstart\", this.handleTouchStart)\n this.events.listen(target, \"touchmove\", preventDefault)\n this.events.listen(target, \"touchend\", this.handleTouchEnd)\n }\n }\n\n hostDisconnected() {\n this.hadFirstUpdate = false\n }\n\n private handleTouchStart = (event: TouchEvent) => {\n const [{ pageX, pageY }] = event.changedTouches\n this.initialTouchX = pageX\n this.initialTouchY = pageY\n }\n\n private handleTouchEnd = (event: TouchEvent) => {\n const [{ pageX, pageY }] = event.changedTouches\n const { matchesGesture, onSwipeEnd } = this.options\n\n const distX = pageX - this.initialTouchX\n const distY = pageY - this.initialTouchY\n const details = { initialX: this.initialTouchX, initialY: this.initialTouchY, pageX, pageY, distX, distY }\n\n if (matchesGesture(details)) {\n event.preventDefault()\n onSwipeEnd(details)\n }\n }\n}\n\nconst THRESHOLD = 70\n\nexport const isHorizontalSwipe = ({ distX, distY }: SwipeDetails) =>\n Math.abs(distX) >= THRESHOLD && Math.abs(distY) <= THRESHOLD\n\nexport const isDownwardsSwipe = ({ distX, distY }: SwipeDetails) =>\n Math.abs(distY) >= THRESHOLD && Math.abs(distX) <= THRESHOLD && distY > 0\n","import { html, LitElement } from \"lit\"\nimport { customElement, property, query, state } from \"lit/decorators.js\"\nimport { classMap } from \"lit/directives/class-map.js\"\nimport { repeat } from \"lit/directives/repeat.js\"\nimport { createKeybindingsHandler } from \"tinykeys\"\nimport * as arrowRightIcon from \"@nordhealth/icons/lib/assets/arrow-right-small.js\"\nimport * as arrowLeftIcon from \"@nordhealth/icons/lib/assets/arrow-left-small.js\"\nimport * as arrowDownIcon from \"@nordhealth/icons/lib/assets/arrow-down-small.js\"\n\nimport \"../button/Button.js\"\nimport \"../visually-hidden/VisuallyHidden.js\"\nimport Icon from \"../icon/Icon.js\"\n\nimport { isHorizontalSwipe, SwipeController } from \"../common/controllers/SwipeController.js\"\nimport { DirectionController } from \"../common/controllers/DirectionController.js\"\nimport { LocalizeController } from \"../localization/LocalizeController.js\"\nimport { chunk, mapWithOffset } from \"../common/collection.js\"\nimport { cond } from \"../common/directives/cond.js\"\nimport { range } from \"../common/number.js\"\nimport {\n addDays,\n clamp,\n DaysOfWeek,\n endOfMonth,\n endOfWeek,\n getDayNames,\n getMonthNames,\n getViewOfMonth,\n inRange,\n isEqual,\n isEqualMonth,\n parseISODate,\n printISODate,\n setMonth,\n setYear,\n startOfMonth,\n startOfWeek,\n} from \"../common/dates.js\"\nimport { observe } from \"../common/decorators/observe.js\"\n\nimport { DateSelectEvent } from \"./DateSelectEvent.js\"\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Calendar.css\"\n\nexport type DatePredicate = (date: Date) => boolean\n\nIcon.registerIcon(arrowRightIcon)\nIcon.registerIcon(arrowLeftIcon)\nIcon.registerIcon(arrowDownIcon)\n\nconst preventDefault = (fn: EventListener) => (e: Event) => {\n e.preventDefault()\n fn(e)\n}\n\nconst isDateDisabled: DatePredicate = () => false\nconst isDateHighlighted = () => false\n\nconst dialogLabelId = \"dialog-header\"\n\n/**\n * Calendar allows user to pick a date. It comes with built-in\n * functionality that allows you to set a minimum and a maximum allowed date.\n * Please note that the date must be passed in ISO-8601 format.\n *\n * @status ready\n * @category list\n * @fires {DateSelectEvent} change - Dispatched when a date is selected and the value changes.\n * @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.\n *\n * @cssprop [--n-calendar-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-calendar-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n *\n * @localization prevMonthLabel - Accessible label for the previous month button.\n * @localization nextMonthLabel - Accessible label for the next month button.\n * @localization monthSelectLabel - Accessible label for the month select.\n * @localization yearSelectLabel - Accessible label for the year select.\n */\n@customElement(\"nord-calendar\")\nexport default class Calendar extends LitElement {\n static styles = [componentStyle, style]\n\n @query(\".n-calendar-select-month\", true) private monthSelectNode!: HTMLElement\n @query(`button[tabindex=\"0\"]`) private focusedDayNode!: HTMLButtonElement\n\n private direction = new DirectionController(this)\n private swipe = new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })\n\n private shortcuts = createKeybindingsHandler({\n ArrowRight: preventDefault(() => this.addDays(this.direction.isLTR ? 1 : -1)),\n ArrowLeft: preventDefault(() => this.addDays(this.direction.isLTR ? -1 : 1)),\n ArrowDown: preventDefault(() => this.addDays(7)),\n ArrowUp: preventDefault(() => this.addDays(-7)),\n Home: preventDefault(() => this.startOfWeek()),\n End: preventDefault(() => this.endOfWeek()),\n PageUp: preventDefault(() => this.addMonths(-1)),\n PageDown: preventDefault(() => this.addMonths(1)),\n \"Shift+PageUp\": preventDefault(() => this.addYears(-1)),\n \"Shift+PageDown\": preventDefault(() => this.addYears(1)),\n })\n\n private localize = new LocalizeController<\"nord-calendar\">(this, {\n onLangChange: () => this.handleLangChange(),\n })\n\n /**\n * Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\n * these are used to format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatShort!: Intl.DateTimeFormat\n private monthNames!: string[]\n private monthNamesShort!: string[]\n private dayNames!: string[]\n private dayNamesShort!: string[]\n\n /**\n * The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @property() value: string = \"\"\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @property({ type: Number }) firstDayOfWeek: DaysOfWeek = DaysOfWeek.Monday\n\n /**\n * Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the max property.\n */\n @property() min: string = \"\"\n\n /**\n * Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\n * This setting can be used alone or together with the min property.\n */\n @property() max: string = \"\"\n\n /**\n * Controls whether the calendar expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @property({ attribute: false }) isDateDisabled: DatePredicate = isDateDisabled\n\n /**\n * Controls which days are highlighted with a small indicator.\n * Returning a \"falsy\" value will not show an indicator.\n * Returning \"truthy\" value will show the indicator, but without an accessible label.\n * Returning a string will show the indicator, and use the string as accessible label.\n * It is recommended to return a string rather than a truthy value whenever possible.\n */\n @property({ attribute: false }) isDateHighlighted: (date: Date) => string | boolean = isDateHighlighted\n\n @state() private activeFocus = false\n @state() private focusedDay = new Date()\n\n /**\n * Programmatically move focus to the calendar.\n * @param options An object which controls aspects of the focusing process.\n */\n focus(options?: FocusOptions & { target: \"day\" | \"month\" }) {\n const target = options?.target ?? \"day\"\n\n if (target === \"day\") {\n this.focusedDayNode.focus()\n } else if (target === \"month\") {\n this.monthSelectNode.focus()\n }\n }\n\n render() {\n const today = new Date()\n const valueAsDate = parseISODate(this.value)\n const focusedMonth = this.focusedDay.getMonth()\n const focusedYear = this.focusedDay.getFullYear()\n\n const minDate = parseISODate(this.min)\n const maxDate = parseISODate(this.max)\n const minDateStartOfMonth = minDate ? startOfMonth(minDate) : undefined\n const maxDateEndOfMonth = maxDate ? endOfMonth(maxDate) : undefined\n\n const selectedYear = (valueAsDate || this.focusedDay).getFullYear()\n const minYear = minDate ? minDate.getFullYear() : selectedYear - 10\n const maxYear = maxDate ? maxDate.getFullYear() : selectedYear + 10\n\n return html`\n <div class=\"n-calendar\">\n <div class=\"n-calendar-header\">\n <div>\n <nord-visually-hidden>\n <h2 id=${dialogLabelId} aria-live=\"polite\" aria-atomic=\"true\">\n ${this.monthNames[focusedMonth]}, ${this.focusedDay.getFullYear()}\n </h2>\n </nord-visually-hidden>\n\n <div class=\"n-calendar-select\">\n <select\n aria-label=${this.localize.term(\"monthSelectLabel\")}\n class=\"n-calendar-select-month\"\n @input=${this.handleMonthSelect}\n >\n ${this.monthNames.map(\n (month, i) =>\n html`\n <option\n value=${i}\n ?selected=${i === focusedMonth}\n ?disabled=${!inRange(new Date(focusedYear, i, 1), minDateStartOfMonth, maxDateEndOfMonth)}\n >\n ${month}\n </option>\n `\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${this.monthNamesShort[focusedMonth]}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n\n <div class=\"n-calendar-select\">\n <select\n aria-label=${this.localize.term(\"yearSelectLabel\")}\n class=\"n-calendar-select-year\"\n @input=${this.handleYearSelect}\n >\n ${repeat(\n range(minYear, maxYear),\n year => year,\n year => html`<option ?selected=${year === focusedYear}>${year}</option>`\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${this.focusedDay.getFullYear()}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n </div>\n\n <div class=\"n-calendar-nav\">\n <nord-button\n class=\"n-calendar-prev\"\n @click=${this.handlePreviousMonthClick}\n ?disabled=${isEqualMonth(minDate, this.focusedDay)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term(\"prevMonthLabel\")}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? \"arrow-left-small\" : \"arrow-right-small\"} size=\"s\"></nord-icon>\n </nord-button>\n\n <nord-button\n class=\"n-calendar-next\"\n @click=${this.handleNextMonthClick}\n ?disabled=${isEqualMonth(maxDate, this.focusedDay)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term(\"nextMonthLabel\")}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? \"arrow-right-small\" : \"arrow-left-small\"} size=\"s\"></nord-icon>\n </nord-button>\n </div>\n </div>\n\n <table\n class=\"n-calendar-table\"\n aria-labelledby=${dialogLabelId}\n @focusin=${this.enableActiveFocus}\n @focusout=${this.disableActiveFocus}\n >\n <thead>\n <tr>\n ${mapWithOffset(\n this.dayNames,\n this.firstDayOfWeek,\n (dayName, i) =>\n html`\n <th class=\"n-calendar-table-header\" scope=\"col\">\n <span aria-hidden=\"true\">${this.dayNamesShort[i]}</span>\n <nord-visually-hidden>${dayName}</nord-visually-hidden>\n </th>\n `\n )}\n </tr>\n </thead>\n <tbody>\n ${chunk(getViewOfMonth(this.focusedDay, this.firstDayOfWeek), 7).map(\n week =>\n html`\n <tr class=\"n-calendar-row\">\n ${week.map(day => {\n const outsideRange = !inRange(day, minDate, maxDate)\n const isToday = isEqual(day, today)\n const isDisabled = this.isDateDisabled(day)\n const isSelected = isEqual(day, valueAsDate)\n const isInMonth = isEqualMonth(day, this.focusedDay)\n const isHighlighted = this.isDateHighlighted(day)\n const formattedDate = this.dateFormatShort.format(day)\n\n const accessibleLabel =\n isHighlighted && typeof isHighlighted === \"string\"\n ? `${formattedDate}, ${isHighlighted}`\n : formattedDate\n\n return html`\n <td class=\"n-calendar-cell\">\n <button\n type=\"button\"\n tabindex=${isEqual(day, this.focusedDay) ? 0 : -1}\n class=${classMap({\n \"n-calendar-day\": true,\n \"is-outside\": outsideRange,\n \"is-month\": isInMonth,\n \"is-highlighted\": isHighlighted,\n })}\n @click=${() => this.handleDaySelect(day)}\n @keydown=${this.shortcuts}\n ?disabled=${outsideRange}\n aria-disabled=${cond(isDisabled, \"true\")}\n aria-pressed=${isSelected ? \"true\" : \"false\"}\n aria-current=${cond(isToday, \"date\")}\n aria-label=${accessibleLabel}\n >\n <span aria-hidden=\"true\">${day.getDate()}</span>\n </button>\n </td>\n `\n })}\n </tr>\n `\n )}\n </tbody>\n </table>\n </div>\n `\n }\n\n @observe(\"value\")\n protected handleValueChange() {\n this.setFocusedDay(parseISODate(this.value) || new Date())\n }\n\n @observe(\"focusedDay\", \"updated\")\n protected handleFocusedDayChange() {\n if (this.activeFocus) {\n this.focusedDayNode.focus()\n }\n }\n\n private handleLangChange() {\n const lang = this.localize.resolvedLang\n this.dateFormatShort = new Intl.DateTimeFormat(lang, { timeZone: \"UTC\", day: \"numeric\", month: \"long\" })\n this.monthNames = getMonthNames(lang, \"long\")\n this.monthNamesShort = getMonthNames(lang, \"short\")\n this.dayNames = getDayNames(lang, \"long\")\n this.dayNamesShort = getDayNames(lang, \"narrow\")\n }\n\n private handleDaySelect = (day: Date) => {\n const isInRange = inRange(day, parseISODate(this.min), parseISODate(this.max))\n const isAllowed = !this.isDateDisabled(day)\n\n if (isInRange && isAllowed) {\n this.value = printISODate(day)\n this.dispatchEvent(new DateSelectEvent(\"change\", day))\n }\n }\n\n private addDays(days: number) {\n this.setFocusedDay(addDays(this.focusedDay, days))\n }\n\n private addMonths(months: number) {\n this.setMonth(this.focusedDay.getMonth() + months)\n }\n\n private addYears(years: number) {\n this.setYear(this.focusedDay.getFullYear() + years)\n }\n\n private startOfWeek() {\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private endOfWeek() {\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private setMonth(month: number) {\n const min = setMonth(startOfMonth(this.focusedDay), month)\n const max = endOfMonth(min)\n const date = setMonth(this.focusedDay, month)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setYear(year: number) {\n const min = setYear(startOfMonth(this.focusedDay), year)\n const max = endOfMonth(min)\n const date = setYear(this.focusedDay, year)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setFocusedDay(day: Date) {\n this.focusedDay = clamp(day, parseISODate(this.min), parseISODate(this.max))\n this.dispatchEvent(new DateSelectEvent(\"nord-focus-date\", this.focusedDay))\n }\n\n private handleMonthSelect = (e: Event) => {\n this.setMonth(parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleYearSelect = (e: Event) => {\n this.setYear(parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleNextMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(1)\n }\n\n private handlePreviousMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(-1)\n }\n\n private enableActiveFocus = () => {\n this.activeFocus = true\n }\n\n private disableActiveFocus = (e: FocusEvent) => {\n const table = e.currentTarget as Node\n const relatedTarget = e.relatedTarget as Node\n\n if (relatedTarget && !table.contains(relatedTarget)) {\n this.activeFocus = false\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-calendar\": Calendar\n }\n}\n"],"names":["preventDefault","e","SwipeController","constructor","host","options","this","hadFirstUpdate","initialTouchX","initialTouchY","handleTouchStart","event","pageX","pageY","changedTouches","handleTouchEnd","matchesGesture","onSwipeEnd","distX","distY","details","initialX","initialY","addController","events","EventController","target","hostUpdated","listen","hostDisconnected","isHorizontalSwipe","Math","abs","isDownwardsSwipe","Icon","registerIcon","arrowRightIcon","arrowLeftIcon","arrowDownIcon","fn","isDateDisabled","isDateHighlighted","dialogLabelId","Calendar","LitElement","direction","DirectionController","swipe","addMonths","shortcuts","createKeybindingsHandler","ArrowRight","addDays","isLTR","ArrowLeft","ArrowDown","ArrowUp","Home","startOfWeek","End","endOfWeek","PageUp","PageDown","addYears","localize","LocalizeController","onLangChange","handleLangChange","value","firstDayOfWeek","min","max","expand","activeFocus","focusedDay","Date","handleDaySelect","day","isInRange","inRange","parseISODate","isAllowed","printISODate","dispatchEvent","DateSelectEvent","handleMonthSelect","setMonth","parseInt","handleYearSelect","setYear","handleNextMonthClick","handlePreviousMonthClick","enableActiveFocus","disableActiveFocus","table","currentTarget","relatedTarget","contains","focus","_a","focusedDayNode","monthSelectNode","render","today","valueAsDate","focusedMonth","getMonth","focusedYear","getFullYear","minDate","maxDate","minDateStartOfMonth","startOfMonth","undefined","maxDateEndOfMonth","endOfMonth","selectedYear","minYear","maxYear","html","monthNames","term","map","month","i","monthNamesShort","repeat","range","year","isEqualMonth","mapWithOffset","dayNames","dayName","dayNamesShort","chunk","getViewOfMonth","week","outsideRange","isToday","isEqual","isDisabled","isSelected","isInMonth","isHighlighted","formattedDate","dateFormatShort","format","accessibleLabel","classMap","cond","getDate","handleValueChange","setFocusedDay","handleFocusedDayChange","lang","resolvedLang","Intl","DateTimeFormat","timeZone","getMonthNames","getDayNames","days","months","years","date","clamp","styles","componentStyle","style","__decorate","query","prototype","property","type","Number","reflect","Boolean","attribute","state","observe","customElement"],"mappings":"k/BAAe,6OACM,yBACD,2GCFL,6OACM,wBACD,0GCFL,8OACM,wBACD,8DCUpB,MAAMA,EAAkBC,GAAaA,EAAED,uBAS1BE,EAQX,WAAAC,CAAYC,EAAuBC,GAN3BC,KAAcC,gBAAG,EAEjBD,KAAaE,cAAW,EACxBF,KAAaG,cAAW,EA4BxBH,KAAAI,iBAAoBC,IAC1B,OAAOC,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ACnBF,EAAA,CAAhBS,KAAuCvI,EAAAgI,UAAA,kBAAA,GAsL9BF,EAAA,CADTU,EAAQ,UAGRxI,EAAAgI,UAAA,oBAAA,MAGSF,EAAA,CADTU,EAAQ,aAAc,YAKtBxI,EAAAgI,UAAA,yBAAA,MAtRkBhI,EAAQ8H,EAAA,CAD5BW,EAAc,kBACMzI,SAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Component-2253424f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem-588f5a6b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,x as e}from"./query-assigned-elements-92ce7494.js";import{n as r}from"./property-c78323b1.js";import{S as i}from"./SlotController-d733c575.js";import{N as o}from"./events-d9666e88.js";import"./VisuallyHidden.js";class s{constructor(t,e){this.host=t,this.options=e,this._form=null,this.handleFormData=t=>{const{disabled:e,name:r}=this.host;if(e)return;if(!r)return;const i=this.options.value();null!=i&&t.formData.append(r,i)},t.addController(this)}hostConnected(){this.listen(this.host.form)}hostUpdated(){this.listen(this.host.form)}hostDisconnected(){this.cleanup()}listen(t){var e;this._form!==t&&(this.cleanup(),this._form=t,null===(e=this._form)||void 0===e||e.addEventListener("formdata",this.handleFormData))}cleanup(){var t;null===(t=this._form)||void 0===t||t.removeEventListener("formdata",this.handleFormData),this._form=null}}function n(n){class h extends n{constructor(){super(...arguments),this.labelSlot=new i(this,"label"),this.errorSlot=new i(this,"error"),this.hintSlot=new i(this,"hint"),this.formData=new s(this,{value:()=>this.formValue}),this.inputId="input",this.errorId="error",this.hintId="hint",this.label="",this.hideLabel=!1,this.required=!1,this.hideRequired=!1}get formValue(){return this.value}handleInput(t){t.stopPropagation();const e=t.target;this.value=e.value,this.dispatchEvent(new o("input"))}handleChange(t){t.stopPropagation(),this.dispatchEvent(new o("change"))}renderLabel(t){const r=e`<label for="${this.inputId}"><slot name="label">${this.label}</slot><span ?hidden="${!this.required||this.hideRequired}" aria-hidden="true" class="n-required">*</span> ${t}</label><div class="n-caption n-hint" id="${this.hintId}" ?hidden="${!this.hasHint}"><slot name="hint">${this.hint}</slot></div>`;return this.hideLabel?e`<nord-visually-hidden>${r}</nord-visually-hidden>`:e`<div class="n-label-container">${r}</div>`}renderError(){return e`<div class="n-caption n-error" id="${this.errorId}" role="alert" ?hidden="${!this.hasError}"><slot name="error">${this.error}</slot></div>`}getDescribedBy(){const{hasHint:t,hasError:e}=this;return t&&e?`${this.hintId} ${this.errorId}`:t?this.hintId:e?this.errorId:void 0}getInvalid(){return this.hasError?"true":void 0}get hasHint(){return Boolean(this.hint)||this.hintSlot.hasContent}get hasError(){return Boolean(this.error)||this.errorSlot.hasContent}}return t([r()],h.prototype,"label",void 0),t([r()],h.prototype,"hint",void 0),t([r({type:Boolean,attribute:"hide-label"})],h.prototype,"hideLabel",void 0),t([r()],h.prototype,"placeholder",void 0),t([r()],h.prototype,"error",void 0),t([r({type:Boolean})],h.prototype,"required",void 0),t([r({type:Boolean,attribute:"hide-required"})],h.prototype,"hideRequired",void 0),h}export{n as F};
|
|
2
|
-
//# sourceMappingURL=FormAssociatedMixin-a278fda4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormAssociatedMixin-a278fda4.js","sources":["../src/common/controllers/FormDataController.ts","../src/common/mixins/FormAssociatedMixin.ts"],"sourcesContent":["import { ReactiveController, ReactiveControllerHost } from \"lit\"\nimport { InputMixinInterface } from \"../mixins/InputMixin.js\"\n\ntype FormDataOptions = {\n value: () => string | undefined\n}\n\nexport class FormDataController implements ReactiveController {\n private _form: HTMLFormElement | null = null\n\n constructor(private host: ReactiveControllerHost & InputMixinInterface, private options: FormDataOptions) {\n host.addController(this)\n }\n\n hostConnected() {\n this.listen(this.host.form)\n }\n\n hostUpdated() {\n this.listen(this.host.form)\n }\n\n hostDisconnected() {\n this.cleanup()\n }\n\n private listen(form: HTMLFormElement | null) {\n if (this._form !== form) {\n this.cleanup()\n this._form = form\n this._form?.addEventListener(\"formdata\", this.handleFormData)\n }\n }\n\n private cleanup() {\n this._form?.removeEventListener(\"formdata\", this.handleFormData)\n this._form = null\n }\n\n private handleFormData = (e: FormDataEvent) => {\n const { disabled, name } = this.host\n\n if (disabled) {\n return\n }\n if (!name) {\n return\n }\n\n const value = this.options.value()\n if (value != null) {\n e.formData.append(name, value)\n }\n }\n}\n","/* eslint-disable max-classes-per-file */\nimport { html, LitElement, TemplateResult } from \"lit\"\nimport { property } from \"lit/decorators.js\"\nimport { FormDataController } from \"../controllers/FormDataController.js\"\nimport { SlotController } from \"../controllers/SlotController.js\"\nimport { NordEvent } from \"../events.js\"\nimport { InputMixinInterface } from \"./InputMixin.js\"\nimport \"../../visually-hidden/VisuallyHidden.js\"\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\ntype NativeInputElement = HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement\n\nexport declare class FormAssociatedMixinInterface {\n label: string\n required: boolean\n hideRequired: boolean\n hint?: string\n hideLabel: boolean\n placeholder?: string\n error?: string\n\n protected inputId: string\n protected errorId: string\n protected hintId: string\n protected labelSlot: SlotController\n protected hintSlot: SlotController\n protected errorSlot: SlotController\n protected formData: FormDataController\n\n protected get formValue(): string | undefined\n protected get hasError(): boolean\n protected get hasHint(): boolean\n\n protected handleChange(e: Event): void\n protected handleInput(e: Event): void\n protected renderLabel(additionalContent?: TemplateResult): TemplateResult\n protected renderError(): TemplateResult\n protected getDescribedBy(): string | undefined\n protected getInvalid(): \"true\" | undefined\n}\n\nexport function FormAssociatedMixin<T extends Constructor<InputMixinInterface & LitElement>>(superClass: T) {\n // TODO: would be nice if custom elements analyzer could pick up the slot docs from the mixin\n\n /**\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Use when a hint requires more than plain text.\n * @slot error - Optional slot that holds error text for the input.\n */\n class FormAssociatedElement extends superClass {\n protected labelSlot = new SlotController(this, \"label\")\n protected errorSlot = new SlotController(this, \"error\")\n protected hintSlot = new SlotController(this, \"hint\")\n protected formData = new FormDataController(this, { value: () => this.formValue })\n\n protected get formValue() {\n return this.value\n }\n\n protected inputId = \"input\"\n protected errorId = \"error\"\n protected hintId = \"hint\"\n\n /**\n * Label for the input.\n */\n @property() label: string = \"\"\n\n /**\n * Optional hint text to be displayed with the input. Alternatively use the hint slot.\n */\n @property() hint?: string\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @property({ type: Boolean, attribute: \"hide-label\" }) hideLabel = false\n\n /**\n * Placeholder text to display within the input.\n */\n @property() placeholder?: string\n\n /**\n * Optional error to be shown with the input. Alternatively use the error slot.\n */\n @property() error?: string\n\n /**\n * Determines whether the input is required or not.\n * An input marked as required will be announced as such to users of assistive technology.\n * When using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.\n */\n @property({ type: Boolean }) required = false\n\n /**\n * Visually hide the required indicator, but still show\n * required attribute to assistive technologies like screen readers.\n */\n @property({ type: Boolean, attribute: \"hide-required\" }) hideRequired = false\n\n protected handleInput(e: Event) {\n e.stopPropagation()\n const target = e.target as NativeInputElement\n this.value = target.value\n\n /**\n * Fired as the user types into the input.\n */\n this.dispatchEvent(new NordEvent(\"input\"))\n }\n\n protected handleChange(e: Event) {\n e.stopPropagation()\n\n /**\n * Fired whenever the input's value is changed via user interaction.\n */\n this.dispatchEvent(new NordEvent(\"change\"))\n }\n\n protected renderLabel(additionalContent?: TemplateResult) {\n const label = html`\n <label for=${this.inputId}>\n <slot name=\"label\">${this.label}</slot\n ><span ?hidden=${!this.required || this.hideRequired} aria-hidden=\"true\" class=\"n-required\">*</span>\n ${additionalContent}\n </label>\n\n <div class=\"n-caption n-hint\" id=${this.hintId} ?hidden=${!this.hasHint}>\n <slot name=\"hint\">${this.hint}</slot>\n </div>\n `\n\n return this.hideLabel\n ? html`<nord-visually-hidden>${label}</nord-visually-hidden>`\n : html`<div class=\"n-label-container\">${label}</div>`\n }\n\n protected renderError() {\n return html`\n <div class=\"n-caption n-error\" id=${this.errorId} role=\"alert\" ?hidden=${!this.hasError}>\n <slot name=\"error\">${this.error}</slot>\n </div>\n `\n }\n\n protected getDescribedBy() {\n const { hasHint, hasError } = this\n\n if (hasHint && hasError) {\n return `${this.hintId} ${this.errorId}`\n }\n if (hasHint) {\n return this.hintId\n }\n if (hasError) {\n return this.errorId\n }\n\n return undefined\n }\n\n protected getInvalid() {\n return this.hasError ? \"true\" : undefined\n }\n\n protected get hasHint() {\n return Boolean(this.hint) || this.hintSlot.hasContent\n }\n\n protected get hasError() {\n return Boolean(this.error) || this.errorSlot.hasContent\n }\n }\n\n return FormAssociatedElement as unknown as Constructor<FormAssociatedMixinInterface> & T\n}\n"],"names":["FormDataController","constructor","host","options","this","_form","handleFormData","e","disabled","name","value","formData","append","addController","hostConnected","listen","form","hostUpdated","hostDisconnected","cleanup","_a","addEventListener","removeEventListener","FormAssociatedMixin","superClass","FormAssociatedElement","labelSlot","SlotController","errorSlot","hintSlot","formValue","inputId","errorId","hintId","label","hideLabel","required","hideRequired","handleInput","stopPropagation","target","dispatchEvent","NordEvent","handleChange","renderLabel","additionalContent","html","hasHint","hint","renderError","hasError","error","getDescribedBy","getInvalid","undefined","Boolean","hasContent","__decorate","property","prototype","type","attribute"],"mappings":"wOAOaA,EAGX,WAAAC,CAAoBC,EAA4DC,GAA5DC,KAAIF,KAAJA,EAA4DE,KAAOD,QAAPA,EAFxEC,KAAKC,MAA2B,KA+BhCD,KAAAE,eAAkBC,IACxB,MAAMC,SAAEA,EAAQC,KAAEA,GAASL,KAAKF,KAEhC,GAAIM,EACF,OAEF,IAAKC,EACH,OAGF,MAAMC,EAAQN,KAAKD,QAAQO,QACd,MAATA,GACFH,EAAEI,SAASC,OAAOH,EAAMC,EACzB,EAzCDR,EAAKW,cAAcT,KACpB,CAED,aAAAU,GACEV,KAAKW,OAAOX,KAAKF,KA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,8BAC1C3C,KAAK4C,oBAI7B,OAAO5C,KAAK+B,UACRW,CAAI,yBAAyBZ,2BAC7BY,CAAI,kCAAkCZ,SAC3C,CAES,WAAAe,GACR,OAAOH,CAAI,sCAC2B1C,KAAK4B,mCAAiC5B,KAAK8C,gCACxD9C,KAAK+C,oBAG/B,CAES,cAAAC,GACR,MAAML,QAAEA,EAAOG,SAAEA,GAAa9C,KAE9B,OAAI2C,GAAWG,EACN,GAAG9C,KAAK6B,UAAU7B,KAAK4B,UAE5Be,EACK3C,KAAK6B,OAEViB,EACK9C,KAAK4B,aADd,CAKD,CAES,UAAAqB,GACR,OAAOjD,KAAK8C,SAAW,YAASI,CACjC,CAED,WAAcP,GACZ,OAAOQ,QAAQnD,KAAK4C,OAAS5C,KAAKyB,SAAS2B,UAC5C,CAED,YAAcN,GACZ,OAAOK,QAAQnD,KAAK+C,QAAU/C,KAAKwB,UAAU4B,UAC9C,EAGH,OA9GcC,EAAA,CAAXC,KAA6BjC,EAAAkC,UAAA,aAAA,GAKlBF,EAAA,CAAXC,KAAwBjC,EAAAkC,UAAA,YAAA,GAK6BF,EAAA,CAArDC,EAAS,CAAEE,KAAML,QAASM,UAAW,gBAAiCpC,EAAAkC,UAAA,iBAAA,GAK3DF,EAAA,CAAXC,KAA+BjC,EAAAkC,UAAA,mBAAA,GAKpBF,EAAA,CAAXC,KAAyBjC,EAAAkC,UAAA,aAAA,GAOGF,EAAA,CAA5BC,EAAS,CAAEE,KAAML,WAA2B9B,EAAAkC,UAAA,gBAAA,GAMYF,EAAA,CAAxDC,EAAS,CAAEE,KAAML,QAASM,UAAW,mBAAuCpC,EAAAkC,UAAA,oBAAA,GA6ExElC,CACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormField-87551be2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as s}from"./EventController-d99ebeef.js";import{S as t}from"./ShortcutController-87615e31.js";class i{constructor(i,o){this.host=i,this.options=o,this.handleEsc=s=>{this.options.isOpen()&&this.options.onDismiss(s)},this.handleClickOut=s=>{var t;if(!this.options.isOpen())return;const i=null!==(t=this.options.isDismissible)&&void 0!==t?t:s=>s!==this.host;s.composedPath().every(i)&&this.options.onDismiss(s)},i.addController(this),this.shortcut=new t(i,{Escape:this.handleEsc}),this.events=new s(i)}hostConnected(){this.events.listen(document,"click",this.handleClickOut,!0)}}export{i as L};
|
|
2
|
-
//# sourceMappingURL=LightDismissController-a2645ae6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LightDismissController-a2645ae6.js","sources":["../src/common/controllers/LightDismissController.ts"],"sourcesContent":["import { ReactiveController, ReactiveControllerHost } from \"lit\"\nimport { EventController } from \"./EventController.js\"\nimport { ShortcutController } from \"./ShortcutController.js\"\n\nexport type LightDismissOptions = {\n isOpen: () => boolean\n onDismiss: EventListener\n isDismissible?: (node: EventTarget) => boolean\n}\n\nexport class LightDismissController implements ReactiveController {\n private shortcut: ShortcutController\n private events: EventController\n\n constructor(private host: ReactiveControllerHost & Element, private options: LightDismissOptions) {\n host.addController(this)\n this.shortcut = new ShortcutController(host, { Escape: this.handleEsc })\n this.events = new EventController(host)\n }\n\n hostConnected() {\n this.events.listen(document, \"click\", this.handleClickOut, true)\n }\n\n private handleEsc = (e: KeyboardEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n this.options.onDismiss(e)\n }\n\n private handleClickOut = (e: MouseEvent) => {\n if (!this.options.isOpen()) {\n return\n }\n\n const predicate: LightDismissOptions[\"isDismissible\"] = this.options.isDismissible ?? (node => node !== this.host)\n const isClickOutside = e.composedPath().every(predicate)\n\n if (isClickOutside) {\n this.options.onDismiss(e)\n }\n }\n}\n"],"names":["LightDismissController","constructor","host","options","this","handleEsc","e","isOpen","onDismiss","handleClickOut","predicate","_a","isDismissible","node","composedPath","every","addController","shortcut","ShortcutController","Escape","events","EventController","hostConnected","listen","document"],"mappings":"6GAUaA,EAIX,WAAAC,CAAoBC,EAAgDC,GAAhDC,KAAIF,KAAJA,EAAgDE,KAAOD,QAAPA,EAU5DC,KAAAC,UAAaC,IACdF,KAAKD,QAAQI,UAIlBH,KAAKD,QAAQK,UAAUF,EAAE,EAGnBF,KAAAK,eAAkBH,UACxB,IAAKF,KAAKD,QAAQI,SAChB,OAGF,MAAMG,EAAgF,QAA9BC,EAAAP,KAAKD,QAAQS,qBAAiB,IAAAD,EAAAA,EAACE,GAAQA,IAAST,KAAKF,KACtFI,EAAEQ,eAAeC,MAAML,IAG5CN,KAAKD,QAAQK,UAAUF,EACxB,EA3BDJ,EAAKc,cAAcZ,MACnBA,KAAKa,SAAW,IAAIC,EAAmBhB,EAAM,CAAEiB,OAAQf,KAAKC,YAC5DD,KAAKgB,OAAS,IAAIC,EAAgBnB,EACnC,CAED,aAAAoB,GACElB,KAAKgB,OAAOG,OAAOC,SAAU,QAASpB,KAAKK,gBAAgB,EAC5D"}
|
package/lib/Popout-2220e77b.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,i as e,x as o,e as i,s}from"./query-assigned-elements-92ce7494.js";import{n}from"./property-c78323b1.js";import{t as r}from"./state-d31c6912.js";import{i as a}from"./query-36bfe0e4.js";import{c as l,l as p,o as h,f as d,s as c,h as m,a as u}from"./positioning-2346bdd6.js";import{L as v}from"./LightDismissController-a2645ae6.js";import{S as f}from"./ScrollbarController-773c79f4.js";import{N as g,t as y}from"./events-d9666e88.js";import{s as b}from"./Component-2253424f.js";import{D as w}from"./DirectionController-f35f5476.js";import{o as E}from"./observe-a9c6dfb6.js";import{E as x}from"./EventController-d99ebeef.js";function C(e){class o extends e{constructor(){super(...arguments),this.open=!1,this.align="start",this.position="block-end"}}return t([n({type:Boolean,reflect:!0})],o.prototype,"open",void 0),t([n({reflect:!0})],o.prototype,"align",void 0),t([n({reflect:!0})],o.prototype,"position",void 0),o}const k=e`:host{position:fixed;pointer-events:none;z-index:var(--n-index-popout);left:var(--_n-popout-position-x);top:var(--_n-popout-position-y);color:var(--n-color-text);opacity:0;transition:opacity var(--n-transition-slowly)}.n-popout{pointer-events:none;transform:translateY(-10px) scale(.97);visibility:hidden;transition:transform var(--n-transition-slowly),visibility var(--n-transition-slowly);transform-origin:top left;will-change:transform,opacity,visibility;background:var(--n-color-surface);box-shadow:var(--n-box-shadow-popout);border-radius:var(--n-border-radius-s)}:host([open]){opacity:1}:host([open]) .n-popout{transition-property:transform;visibility:visible;pointer-events:auto;transform:translateY(0) translateX(0) scale(1)}@media (max-width:35.9375em){:host{position:fixed;inset:0;overflow-y:auto;opacity:1;background:0 0;transition:background var(--n-transition-mobile)}:host([open]){pointer-events:auto;background:var(--n-color-overlay)}:host .n-popout{position:fixed;inset:0;inset-block-start:auto;transform:translateY(100%);transition:transform var(--n-transition-mobile),visibility var(--n-transition-mobile);transform-origin:bottom center;border-radius:0}}.top-end,.top-start{transform:translateY(10px) scale(.97)}.left-end,.left-start{transform:translateX(10px) scale(.97)}.right-end,.right-start{transform:translateX(-10px) scale(.97)}.bottom-start.is-rtl,.left-end,.top-end{transform-origin:bottom right}.bottom-end,.left-start,.top-start.is-rtl{transform-origin:top right}.bottom-end.is-rtl,.right-end,.right-start{transform-origin:bottom left}.right-start,.top-end.is-rtl{transform-origin:top left}`,A=matchMedia("(max-width: 35.9375em)");let P=class extends(C(s)){constructor(){super(...arguments),this.scrollBar=new f(this),this.dismiss=new v(this,{isOpen:()=>this.open,onDismiss:t=>this.hide("click"!==t.type),isDismissible:t=>t!==this.popout&&t!==this.targetElement}),this.events=new x(this),this.direction=new w(this),this.smallViewport=A.matches,this.id="",this.enableScroll=()=>{this.open||this.scrollBar.unlockScroll()},this.updatePosition=async()=>{var t;if(!this.anchorElement)return;const{x:e,y:o,placement:i,middlewareData:s}=await l(this.anchorElement,this,{strategy:"fixed",placement:p(this.position,this.align,this.direction.dir),middleware:[h(8),d(),c({padding:8}),m()]});this.computedPosition=i,this.style.setProperty("--_n-popout-position-x",`${e}px`),this.style.setProperty("--_n-popout-position-y",`${o}px`),(null===(t=s.hide)||void 0===t?void 0:t.referenceHidden)&&this.hide()},this.toggleOpen=t=>{t.preventDefault(),this.open?this.hide(!1):this.smallViewport?this.show():this.updatePosition().then((()=>this.show()))},this.handleMediaQueryChange=()=>{var t;this.smallViewport=A.matches,null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),!this.smallViewport&&this.open&&this.anchorElement?(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition),this.scrollBar.unlockScroll()):this.open&&this.scrollBar.lockScroll()}}async show(){return this.open?Promise.resolve():(this.open=!0,await this.updateComplete,this.dispatchEvent(new g("open")),y(this.popout))}async hide(t=!0){var e,o;return this.open?(this.open=!1,null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this),this.dispatchEvent(new g("close")),t&&(null===(o=this.targetElement)||void 0===o||o.focus({preventScroll:!0})),y(this.popout)):Promise.resolve()}firstUpdated(){this.smallViewport||this.updatePosition()}connectedCallback(){super.connectedCallback(),this.events.listen(A,"change",this.handleMediaQueryChange)}disconnectedCallback(){var t,e;super.disconnectedCallback(),null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),null===(e=this.targetElement)||void 0===e||e.removeAttribute("aria-expanded")}render(){return o`<div class="n-popout ${this.computedPosition} is-${this.direction.dir}" aria-hidden="${this.open?"false":"true"}" @transitionend="${this.enableScroll}"><slot></slot></div>`}handleIdChange(){var t;null===(t=this.targetElement)||void 0===t||t.removeEventListener("click",this.toggleOpen),this.id?(this.targetElement=this.getToggle(),this.anchorElement=this.getAnchor(),this.events.listen(this.targetElement,"click",this.toggleOpen)):console.warn("NORD: popout requires an id attribute and value")}handleOpenChange(){var t,e;null===(t=this.targetElement)||void 0===t||t.setAttribute("aria-expanded",`${this.open}`),this.open?this.smallViewport?this.scrollBar.lockScroll():this.anchorElement&&(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition)):null===(e=this.cleanupAutoUpdate)||void 0===e||e.call(this)}handleAnchorChange(){var t;null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),this.anchorElement=this.getAnchor(),this.open&&!this.smallViewport&&this.anchorElement&&(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition))}getToggle(){const t=this.getRootNode().querySelector(`[aria-controls='${this.id}']`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}getAnchor(){if(!this.anchor)return this.targetElement;const t=this.getRootNode().querySelector(`#${this.anchor}`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}};P.styles=[b,k],t([a(".n-popout",!0)],P.prototype,"popout",void 0),t([r()],P.prototype,"computedPosition",void 0),t([r()],P.prototype,"smallViewport",void 0),t([n({reflect:!0})],P.prototype,"id",void 0),t([n({reflect:!0})],P.prototype,"anchor",void 0),t([E("id")],P.prototype,"handleIdChange",null),t([E("open")],P.prototype,"handleOpenChange",null),t([E("anchor")],P.prototype,"handleAnchorChange",null),P=t([i("nord-popout")],P);var S=P;export{C as F,S as P};
|
|
2
|
-
//# sourceMappingURL=Popout-2220e77b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popout-2220e77b.js","sources":["../src/common/mixins/FloatingComponentMixin.ts","../src/popout/Popout.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { LitElement } from \"lit\"\nimport { property } from \"lit/decorators.js\"\nimport { Alignment } from \"@floating-ui/dom\"\nimport { LogicalSide } from \"../positioning.js\"\n\ntype Constructor<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport declare class FloatingMixinInterface {\n open: boolean\n align: Alignment\n position: LogicalSide\n}\n\nexport function FloatingMixin<T extends Constructor<LitElement>>(\n superClass: T\n): Constructor<FloatingMixinInterface> & T {\n class FloatingElement extends superClass {\n /**\n * Controls whether the component is open or not.\n */\n @property({ type: Boolean, reflect: true }) open = false\n\n /**\n * Set the alignment in relation to the toggle (or anchor) depending on the position.\n * `start` will align it to the left of the toggle (or anchor).\n * `end` will align it to the right of the toggle (or anchor).\n * Setting the `position` to `inline-start` or `inline-end` will switch\n * `start` and `end` to the top and bottom respectively.\n */\n @property({ reflect: true }) align: \"start\" | \"end\" = \"start\"\n\n /**\n * Set the position in relation to the toggle (or anchor).\n * Options follow logical properties.\n * `block-start` and `block-end` referring to top and bottom respectively,\n * `inline-start` and `inline-end` referring to left and right respectively.\n */\n @property({ reflect: true }) position: \"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" = \"block-end\"\n }\n\n return FloatingElement\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property, query, state } from \"lit/decorators.js\"\nimport { computePosition, shift, offset, flip, hide, autoUpdate, Placement } from \"@floating-ui/dom\"\nimport { LightDismissController } from \"../common/controllers/LightDismissController.js\"\nimport { ScrollbarController } from \"../common/controllers/ScrollbarController.js\"\nimport { NordEvent, transition } from \"../common/events.js\"\nimport { FloatingMixin } from \"../common/mixins/FloatingComponentMixin.js\"\n\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Popout.css\"\nimport { logicalToPhysical } from \"../common/positioning.js\"\nimport { DirectionController } from \"../common/controllers/DirectionController.js\"\nimport { observe } from \"../common/decorators/observe.js\"\nimport { EventController } from \"../common/controllers/EventController.js\"\n\n/*\n * The breakpoint width to switch between \"sheet\" design and floating design\n */\nconst mediaQuery = matchMedia(\"(max-width: 35.9375em)\")\n\n/**\n * Popouts are small overlays that open on demand. They let users access additional content and actions without cluttering the page.\n *\n * @status ready\n * @category overlay\n * @slot - The popout content.\n */\n@customElement(\"nord-popout\")\nexport default class Popout extends FloatingMixin(LitElement) {\n static styles = [componentStyle, style]\n\n private targetElement?: HTMLElement\n private anchorElement?: HTMLElement\n private cleanupAutoUpdate?: ReturnType<typeof autoUpdate>\n\n @query(\".n-popout\", true) private popout!: HTMLDivElement\n\n private scrollBar = new ScrollbarController(this)\n\n /**\n * Handle dismissal of the popout, clicking outside the target button and popout.\n */\n private dismiss = new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: e => this.hide(e.type !== \"click\"),\n isDismissible: node => node !== this.popout && node !== this.targetElement,\n })\n\n private events = new EventController(this)\n private direction = new DirectionController(this)\n\n @state() private computedPosition?: Placement\n\n @state() private smallViewport = mediaQuery.matches\n\n /**\n * The id for the active element to reference via aria-controls.\n */\n // eslint-disable-next-line lit/no-native-attributes\n @property({ reflect: true }) id: string = \"\"\n\n /**\n * Set an optional anchor element to align against, replacing the triggering element.\n */\n @property({ reflect: true }) anchor?: string\n\n /**\n * Show the popout.\n * A promise that resolves to a `TransitionEvent` when the popout's show animation ends or is cancelled.\n * If the popout is already open, the promise resolves immediately with `undefined`.\n */\n async show(): Promise<TransitionEvent | void> {\n if (this.open) {\n return Promise.resolve()\n }\n\n this.open = true\n\n // we should only focus once the popout is visible after render is complete\n await this.updateComplete\n\n /**\n * Dispatched when the popout is opened.\n */\n this.dispatchEvent(new NordEvent(\"open\"))\n\n return transition(this.popout)\n }\n\n /**\n * Hide the popout.\n * Returns a promise that resolves to a `TransitionEvent` when the popout's hide animation ends or is cancelled.\n * If the popout is already closed, the promise resolves immediately with `undefined`.\n * @param {boolean} moveFocusToButton prevent focus returning to the target button. Default is true.\n */\n async hide(moveFocusToButton: boolean = true): Promise<TransitionEvent | void> {\n if (!this.open) {\n return Promise.resolve()\n }\n\n this.open = false\n\n this.cleanupAutoUpdate?.()\n\n /**\n * Dispatched when the popout is closed.\n */\n this.dispatchEvent(new NordEvent(\"close\"))\n\n if (moveFocusToButton) {\n this.targetElement?.focus({ preventScroll: true })\n }\n\n return transition(this.popout)\n }\n\n /**\n * Position the popout on load.\n */\n firstUpdated() {\n if (!this.smallViewport) {\n this.updatePosition()\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.events.listen(mediaQuery, \"change\", this.handleMediaQueryChange)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.cleanupAutoUpdate?.()\n this.targetElement?.removeAttribute(\"aria-expanded\")\n }\n\n render() {\n return html`\n <div\n class=\"n-popout ${this.computedPosition} is-${this.direction.dir}\"\n aria-hidden=${this.open ? \"false\" : \"true\"}\n @transitionend=${this.enableScroll}\n >\n <slot></slot>\n </div>\n `\n }\n\n @observe(\"id\")\n protected handleIdChange() {\n // clean up any old listeners\n this.targetElement?.removeEventListener(\"click\", this.toggleOpen)\n\n if (!this.id) {\n // eslint-disable-next-line no-console\n console.warn(\"NORD: popout requires an id attribute and value\")\n } else {\n this.targetElement = this.getToggle()\n this.anchorElement = this.getAnchor()\n\n this.events.listen(this.targetElement, \"click\", this.toggleOpen)\n }\n }\n\n @observe(\"open\")\n protected handleOpenChange() {\n this.targetElement?.setAttribute(\"aria-expanded\", `${this.open}`)\n\n if (this.open) {\n if (this.smallViewport) {\n // hide scrollbar and prevent scroll on body\n this.scrollBar.lockScroll()\n } else if (this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n } else {\n this.cleanupAutoUpdate?.()\n }\n }\n\n @observe(\"anchor\")\n protected handleAnchorChange() {\n this.cleanupAutoUpdate?.()\n this.anchorElement = this.getAnchor()\n\n // if the popout is already open when the anchor changes, we should update its position\n if (this.open && !this.smallViewport && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n }\n\n private enableScroll = () => {\n // scrollbar should only be restored when the backdrop has transitioned\n // that way we avoid awkward double scrollbars.\n if (!this.open) {\n this.scrollBar.unlockScroll()\n }\n }\n\n /**\n * Get the position of the element toggling the popout\n * and position the popout underneath it, taking into account the optional placement.\n */\n private updatePosition = async () => {\n if (!this.anchorElement) {\n return\n }\n\n const { x, y, placement, middlewareData } = await computePosition(this.anchorElement, this, {\n strategy: \"fixed\",\n placement: logicalToPhysical(this.position, this.align, this.direction.dir),\n middleware: [\n offset(8),\n flip(),\n shift({\n padding: 8,\n }),\n hide(),\n ],\n })\n\n this.computedPosition = placement\n\n // use physical properties here since floating-ui\n // works exclusively in physical dimensions\n // we do all the mapping in logicalToPhysical\n this.style.setProperty(\"--_n-popout-position-x\", `${x}px`)\n this.style.setProperty(\"--_n-popout-position-y\", `${y}px`)\n\n if (middlewareData.hide?.referenceHidden) {\n this.hide()\n }\n }\n\n /**\n * Toggle the popout open or closed using state.\n * Updating the position to underneath the target button before the popout is opened.\n */\n private toggleOpen = (e: Event) => {\n e.preventDefault()\n if (this.open) {\n this.hide(false)\n } else if (!this.smallViewport) {\n this.updatePosition().then(() => this.show())\n } else {\n this.show()\n }\n }\n\n private getToggle() {\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const toggle = <HTMLElement>rootNode.querySelector(`[aria-controls='${this.id}']`)\n\n if (toggle instanceof HTMLSlotElement) {\n return toggle.assignedElements()[0] as HTMLElement\n }\n\n return toggle\n }\n\n private getAnchor() {\n if (!this.anchor) {\n return this.targetElement\n }\n\n const rootNode = this.getRootNode() as Document | ShadowRoot\n const anchor = <HTMLElement>rootNode.querySelector(`#${this.anchor}`)\n\n if (anchor instanceof HTMLSlotElement) {\n return anchor.assignedElements()[0] as HTMLElement\n }\n\n return anchor\n }\n\n /**\n * Update the smallViewport flag to switch between \"sheet\" and \"floating\".\n * autoUpdate is needed when a viewport gets larger and the popout is open.\n */\n private handleMediaQueryChange = () => {\n this.smallViewport = mediaQuery.matches\n\n this.cleanupAutoUpdate?.()\n\n if (!this.smallViewport && this.open && this.anchorElement) {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n this.scrollBar.unlockScroll()\n } else if (this.open) {\n this.scrollBar.lockScroll()\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-popout\": Popout\n }\n}\n"],"names":["FloatingMixin","superClass","FloatingElement","constructor","this","open","align","position","__decorate","property","type","Boolean","reflect","prototype","mediaQuery","matchMedia","Popout","LitElement","scrollBar","ScrollbarController","dismiss","LightDismissController","isOpen","onDismiss","e","hide","isDismissible","node","popout","targetElement","events","EventController","direction","DirectionController","smallViewport","matches","id","enableScroll","unlockScroll","updatePosition","async","anchorElement","x","y","placement","middlewareData","computePosition","strategy","logicalToPhysical","dir","middleware","offset","flip","shift","padding","computedPosition","style","setProperty","_a","referenceHidden","toggleOpen","preventDefault","show","then","handleMediaQueryChange","cleanupAutoUpdate","call","autoUpdate","lockScroll","Promise","resolve","updateComplete","dispatchEvent","NordEvent","transition","moveFocusToButton","_b","focus","preventScroll","firstUpdated","connectedCallback","super","listen","disconnectedCallback","removeAttribute","render","html","handleIdChange","removeEventListener","getToggle","getAnchor","console","warn","handleOpenChange","setAttribute","handleAnchorChange","toggle","getRootNode","querySelector","HTMLSlotElement","assignedElements","anchor","styles","componentStyle","query","state","observe","customElement"],"mappings":"4nBAcM,SAAUA,EACdC,GAEA,MAAMC,UAAwBD,EAA9B,WAAAE,uBAI8CC,KAAIC,MAAG,EAStBD,KAAKE,MAAoB,QAQzBF,KAAQG,SAAgE,WACtG,EAED,OApB8CC,EAAA,CAA3CC,EAAS,CAAEC,KAAMC,QAASC,SAAS,KAAoBV,EAAAW,UAAA,YAAA,GAS3BL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAAwCV,EAAAW,UAAA,aAAA,GAQhCL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAA2FV,EAAAW,UAAA,gBAAA,GAG3GX,CACT,gmDCxBMY,EAAaC,WAAW,0BAUf,IAAMC,EAAN,cAAqBhB,EAAciB,IAAnC,WAAAd,uBASLC,KAAAc,UAAY,IAAIC,EAAoBf,MAKpCA,KAAAgB,QAAU,IAAIC,EAAuBjB,KAAM,CACjDkB,OAAQ,IAAMlB,KAAKC,KACnBkB,UAAWC,GAAKpB,KAAKqB,KAAgB,UAAXD,EAAEd,MAC5BgB,cAAeC,GAAQA,IAASvB,KAAKwB,QAAUD,IAASvB,KAAKyB,gBAGvDzB,KAAA0B,OAAS,IAAIC,EAAgB3B,MAC7BA,KAAA4B,UAAY,IAAIC,EAAoB7B,MAI3BA,KAAA8B,cAAgBpB,EAAWqB,QAMf/B,KAA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