@nordhealth/components 2.13.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2733 -2507
- 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/{Calendar-9d3d6d01.js → Calendar-82dc5980.js} +1 -1
- package/lib/Calendar-82dc5980.js.map +1 -0
- package/lib/Calendar.js +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/DatePicker.js +1 -1
- package/lib/DatePicker.js.map +1 -1
- package/lib/DateSelectEvent.js +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/Dropdown.js.map +1 -1
- package/lib/{FormAssociatedMixin-f4da77a8.js → FormAssociatedMixin-dc7ee1d9.js} +2 -2
- package/lib/{FormAssociatedMixin-f4da77a8.js.map → FormAssociatedMixin-dc7ee1d9.js.map} +1 -1
- package/lib/Icon.js +2 -2
- package/lib/Icon.js.map +1 -1
- package/lib/IconManager.js +2 -0
- package/lib/IconManager.js.map +1 -0
- package/lib/Input.js +1 -1
- package/lib/Input.js.map +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/LocalizeController.js +1 -1
- package/lib/LocalizeController.js.map +1 -1
- package/lib/Modal.js +1 -1
- package/lib/Modal.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.js +1 -1
- package/lib/NavToggle.js.map +1 -1
- package/lib/Navigation.js +1 -1
- package/lib/Navigation.js.map +1 -1
- package/lib/Popout-4584e406.js +2 -0
- package/lib/Popout-4584e406.js.map +1 -0
- package/lib/Popout.js +1 -1
- package/lib/Radio.js +1 -1
- package/lib/Range.js +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/SelectEvent.js +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/Toggle.js +1 -1
- package/lib/bundle.js +8 -8
- package/lib/bundle.js.map +1 -1
- package/lib/events-5337a6d7.js +2 -0
- package/lib/events-5337a6d7.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/localization.js +1 -1
- package/lib/localization.js.map +1 -1
- package/lib/src/button/Button.d.ts +10 -3
- package/lib/src/calendar/Calendar.d.ts +5 -0
- package/lib/src/command-menu/CommandMenu.d.ts +9 -0
- package/lib/src/common/events.d.ts +2 -0
- package/lib/src/date-picker/DatePicker.d.ts +5 -0
- package/lib/src/dropdown/Dropdown.d.ts +6 -2
- package/lib/src/icon/Icon.d.ts +2 -3
- package/lib/src/icon/IconManager.d.ts +11 -0
- package/lib/src/layout/Layout.d.ts +7 -1
- package/lib/src/localization/translation.d.ts +39 -6
- package/lib/src/modal/Modal.d.ts +2 -0
- package/lib/src/nav-item/NavItem.d.ts +4 -0
- package/lib/src/nav-toggle/NavToggle.d.ts +2 -0
- package/lib/src/navigation/Navigation.test.d.ts +1 -0
- package/lib/src/popout/Popout.d.ts +8 -5
- package/lib/src/select/Select.d.ts +2 -0
- package/lib/src/textarea/Textarea.d.ts +3 -1
- package/lib/translation.js +1 -1
- package/lib/translation.js.map +1 -1
- package/package.json +2 -2
- package/lib/Calendar-9d3d6d01.js.map +0 -1
- package/lib/Popout-dae54e30.js +0 -2
- package/lib/Popout-dae54e30.js.map +0 -1
- package/lib/events-731d0007.js +0 -2
- package/lib/events-731d0007.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
class e extends Event{constructor(e,n){super(e,{bubbles:!0,composed:!0,...n})}}function n(e,n){return new Promise((t=>{e.addEventListener(n,(e=>t(e)),{once:!0})}))}function t(e){return Promise.race([n(e,"transitionend"),n(e,"transitioncancel")])}export{e as N,t};
|
|
2
|
+
//# sourceMappingURL=events-5337a6d7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-5337a6d7.js","sources":["../src/common/events.ts"],"sourcesContent":["/**\n * A base class for events which defaults to bubbling and composed\n */\nexport class NordEvent extends Event {\n constructor(type: string, eventInitDict?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n })\n }\n}\n\nexport function oneEvent<K extends keyof GlobalEventHandlersEventMap>(element: HTMLElement, type: K) {\n return new Promise<GlobalEventHandlersEventMap[K]>(resolve => {\n element.addEventListener(type, e => resolve(e), { once: true })\n })\n}\n\nexport function transition(element: HTMLElement) {\n return Promise.race([oneEvent(element, \"transitionend\"), oneEvent(element, \"transitioncancel\")])\n}\n"],"names":["NordEvent","Event","constructor","type","eventInitDict","super","bubbles","composed","oneEvent","element","Promise","resolve","addEventListener","e","once","transition","race"],"mappings":"AAGM,MAAOA,UAAkBC,MAC7BC,YAAYC,EAAcC,GACxBC,MAAMF,EAAM,CACVG,SAAS,EACTC,UAAU,KACPH,GAEN,EAGa,SAAAI,EAAsDC,EAAsBN,GAC1F,OAAO,IAAIO,SAAwCC,IACjDF,EAAQG,iBAAiBT,GAAMU,GAAKF,EAAQE,IAAI,CAAEC,MAAM,GAAO,GAEnE,CAEM,SAAUC,EAAWN,GACzB,OAAOC,QAAQM,KAAK,CAACR,EAASC,EAAS,iBAAkBD,EAASC,EAAS,qBAC7E"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{default as Icon}from"./Icon.js";export{default as CommandMenu}from"./CommandMenu.js";export{default as CommandMenuAction}from"./CommandMenuAction.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";export{C as Calendar}from"./Calendar-
|
|
1
|
+
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{default as Icon}from"./Icon.js";export{default as CommandMenu}from"./CommandMenu.js";export{default as CommandMenuAction}from"./CommandMenuAction.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";export{C as Calendar}from"./Calendar-82dc5980.js";export{default as DatePicker}from"./DatePicker.js";export{default as Checkbox}from"./Checkbox.js";export{default as Tooltip}from"./Tooltip.js";export{default as Fieldset}from"./Fieldset.js";export{default as Radio}from"./Radio.js";export{default as Header}from"./Header.js";export{default as NavGroup}from"./NavGroup.js";export{default as NavItem}from"./NavItem.js";export{default as Navigation}from"./Navigation.js";export{default as Layout}from"./Layout.js";export{default as EmptyState}from"./EmptyState.js";export{default as Banner}from"./Banner.js";export{default as Avatar}from"./Avatar.js";export{default as ProgressBar}from"./ProgressBar.js";export{P as Popout}from"./Popout-4584e406.js";export{default as Dropdown}from"./Dropdown.js";export{default as DropdownItem}from"./DropdownItem.js";export{default as DropdownGroup}from"./DropdownGroup.js";export{isTranslationRegistered,registerTranslation}from"./translation.js";export{default as TabGroup}from"./TabGroup.js";export{default as Tab}from"./Tab.js";export{default as TabPanel}from"./TabPanel.js";export{default as Toggle}from"./Toggle.js";export{default as Modal}from"./Modal.js";export{default as Skeleton}from"./Skeleton.js";export{default as Toast}from"./Toast.js";export{default as ToastGroup}from"./ToastGroup.js";export{default as Divider}from"./Divider.js";export{default as Qrcode}from"./Qrcode.js";export{default as Drawer}from"./Drawer.js";export{default as NavToggle}from"./NavToggle.js";export{default as Range}from"./Range.js";export{default as ButtonGroup}from"./ButtonGroup.js";import"./query-assigned-elements-cf502539.js";import"./property-03f59dce.js";import"./Component-449e40fb.js";import"./ref-c44e9f3c.js";import"./directive-de55b00a.js";import"./EventController-d99ebeef.js";import"./LightDomController-052f446a.js";import"./cond-2da54107.js";import"./FocusableMixin-32631bff.js";import"./InputMixin-7fa755e1.js";import"./SlotController-d733c575.js";import"./if-defined-720964c0.js";import"./class-map-21152cee.js";import"./FormAssociatedMixin-dc7ee1d9.js";import"./events-5337a6d7.js";import"./TextField-ca819c35.js";import"./AutocompleteMixin-5163f8db.js";import"./SizeMixin-4d04817d.js";import"./FormField-413f22f5.js";import"./DirectionController-8b298382.js";import"./state-70f38ceb.js";import"./IconManager.js";import"./observe-a9c6dfb6.js";import"./collection-7eee4e72.js";import"./number-c3ab3e95.js";import"./LightDismissController-a2645ae6.js";import"./ShortcutController-87615e31.js";import"./tinykeys.module-84e6cc41.js";import"./KeyboardController.js";import"./SelectEvent.js";import"./LocalizeController.js";import"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./query-2d22378e.js";import"./dates-5b651fbe.js";import"./DateSelectEvent.js";import"./interface-close-small-44ababc3.js";import"./date-adapter.js";import"./positioning-3bbd3548.js";import"./fsm-50373df9.js";import"./style-map-2e8fcab6.js";import"./Sticky-c4cf185e.js";import"./ScrollbarController-773c79f4.js";import"./ModalController.js";import"./DraftComponentMixin-9e4b7b34.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/localization.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={instructions:"Press 'Enter' to confirm your input or 'Escape' to cancel",inputLabel:"Type the name of a command to run.",footerArrowKeys:"Navigate",footerEnterKey:"Select",footerEscapeKey:"Esc to dismiss",footerBackspaceKey:"Move to parent",noResults:e=>`No results for “${e}”`,tip:"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase."};export{e as default};
|
|
1
|
+
const e={instructions:"Press 'Enter' to confirm your input or 'Escape' to cancel",inputLabel:"Type the name of a command to run.",footerArrowKeys:"Navigate",footerEnterKey:"Select",footerEscapeKey:"Esc to dismiss",footerBackspaceKey:"Move to parent",noResults:e=>`No results for “${e}”`,tip:"Search tips: some search terms require an exact match. Try typing the entire command name, or use a different word or phrase."};export{e as default};
|
|
2
2
|
//# sourceMappingURL=localization.js.map
|
package/lib/localization.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.js","sources":["../src/command-menu/localization.ts"],"sourcesContent":["const commandMenuLocalization = {\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}\n\nexport default commandMenuLocalization\n"],"names":["commandMenuLocalization","instructions","inputLabel","footerArrowKeys","footerEnterKey","footerEscapeKey","footerBackspaceKey","noResults","searchTerm","tip"],"mappings":"AAAA,MAAMA,EAA0B,CAC9BC,aAAc,4DACdC,WAAY,qCACZC,gBAAiB,WACjBC,eAAgB,SAChBC,gBAAiB,iBACjBC,mBAAoB,iBACpBC,UAAYC,GAAuB,mBAAmBA,KACtDC,IAAK"}
|
|
1
|
+
{"version":3,"file":"localization.js","sources":["../src/command-menu/localization.ts"],"sourcesContent":["const commandMenuLocalization = {\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require an exact match. Try typing the entire command name, or use a different word or phrase.\",\n}\n\nexport default commandMenuLocalization\n"],"names":["commandMenuLocalization","instructions","inputLabel","footerArrowKeys","footerEnterKey","footerEscapeKey","footerBackspaceKey","noResults","searchTerm","tip"],"mappings":"AAAA,MAAMA,EAA0B,CAC9BC,aAAc,4DACdC,WAAY,qCACZC,gBAAiB,WACjBC,eAAgB,SAChBC,gBAAiB,iBACjBC,mBAAoB,iBACpBC,UAAYC,GAAuB,mBAAmBA,KACtDC,IAAK"}
|
|
@@ -15,10 +15,15 @@ declare const Button_base: (new (...args: any[]) => import("../common/mixins/Inp
|
|
|
15
15
|
* @cssprop [--n-button-border-radius=var(--n-border-radius-s)] - Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).
|
|
16
16
|
* @cssprop [--n-button-gap=var(--n-space-s)] - Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).
|
|
17
17
|
* @cssprop [--n-button-gradient=linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))] - Controls the overlayed gradient background on the button.
|
|
18
|
-
* @cssprop [--n-button-background-color=var(--n-color-button)] - Controls the background color of the button, using [color tokens](/tokens/#color).
|
|
19
|
-
* @cssprop [--n-button-border-color=var(--n-color-border-strong)] - Controls the border color of the button, using [color tokens](/tokens/#color).
|
|
18
|
+
* @cssprop [--n-button-background-color=var(--n-color-button)] - Controls the background color of the button, using our [color tokens](/tokens/#color).
|
|
19
|
+
* @cssprop [--n-button-border-color=var(--n-color-border-strong)] - Controls the border color of the button, using our [color tokens](/tokens/#color).
|
|
20
20
|
* @cssprop [--n-button-text-align=center] - Controls the text alignment for the text in the button.
|
|
21
|
-
* @cssprop [--n-button-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).
|
|
21
|
+
* @cssprop [--n-button-box-shadow=var(--n-box-shadow)] - Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).
|
|
22
|
+
* @cssprop [--n-button-color=var(--n-color-text)] - Controls the color of the text within the button, using our [color tokens](/tokens/#color).
|
|
23
|
+
* @cssprop [--n-button-padding-inline=calc(var(--n-space-m) / 1.2)] - Controls the inline, or left and right, padding of the button.
|
|
24
|
+
* @cssprop [--n-button-font-size=var(--n-font-size-m)] - Controls the size of the text within the button, using our [font tokens](/tokens/#font).
|
|
25
|
+
* @cssprop [--n-button-font-weight=var(--n-font-weight)] - Controls the weight of the text within the button, using our [font tokens](/tokens/#font).
|
|
26
|
+
* @cssprop [--n-button-min-block-size=var(--n-space-xl)] - Controls the minimum block size, or height, of the button using our [spacing tokens](/tokens/#space).
|
|
22
27
|
*/
|
|
23
28
|
export default class Button extends Button_base {
|
|
24
29
|
static styles: import("lit").CSSResult[];
|
|
@@ -28,6 +33,8 @@ export default class Button extends Button_base {
|
|
|
28
33
|
private lightDom;
|
|
29
34
|
/**
|
|
30
35
|
* The style variant of the button.
|
|
36
|
+
*
|
|
37
|
+
* **Variant `switch` has been deprecated.**
|
|
31
38
|
*/
|
|
32
39
|
variant: "default" | "primary" | "dashed" | "plain" | "danger" | "switch";
|
|
33
40
|
/**
|
|
@@ -15,6 +15,11 @@ export declare type DatePredicate = (date: Date) => boolean;
|
|
|
15
15
|
*
|
|
16
16
|
* @cssprop [--n-calendar-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
17
17
|
* @cssprop [--n-calendar-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).
|
|
18
|
+
*
|
|
19
|
+
* @localization prevMonthLabel - Accessible label for the previous month button.
|
|
20
|
+
* @localization nextMonthLabel - Accessible label for the next month button.
|
|
21
|
+
* @localization monthSelectLabel - Accessible label for the month select.
|
|
22
|
+
* @localization yearSelectLabel - Accessible label for the year select.
|
|
18
23
|
*/
|
|
19
24
|
export default class Calendar extends LitElement {
|
|
20
25
|
static styles: import("lit").CSSResult[];
|
|
@@ -17,6 +17,15 @@ import { ICommandMenuAction } from "./ICommandMenuAction.js";
|
|
|
17
17
|
* @cssprop [--n-command-menu-inline-size=640px] - Controls the max inline size, or width, of the command menu.
|
|
18
18
|
* @cssprop [--n-command-menu-block-size=290px] - Controls the max block size, or height, of the command menu.
|
|
19
19
|
* @cssprop [--n-command-menu-block-start=16%] - Controls the command menu offset from the block start, or top, of the screen.
|
|
20
|
+
*
|
|
21
|
+
* @localization instructions - Instructions that offer guidance on how to use the command menu.
|
|
22
|
+
* @localization inputLabel - Accessible label given to the command menu's input.
|
|
23
|
+
* @localization footerArrowKeys - Describes what the arrow keys do.
|
|
24
|
+
* @localization footerEnterKey - Describes what the enter key does.
|
|
25
|
+
* @localization footerEscapeKey - Describes what the escape key does.
|
|
26
|
+
* @localization footerBackspaceKey - Describes what the backspace key does.
|
|
27
|
+
* @localization noResults - A message shown when there are no matching results.
|
|
28
|
+
* @localization tip - A hint tip that describes some approaches to find a command when there are no matching results.
|
|
20
29
|
*/
|
|
21
30
|
export default class CommandMenu extends LitElement {
|
|
22
31
|
static styles: import("lit").CSSResult[];
|
|
@@ -4,3 +4,5 @@
|
|
|
4
4
|
export declare class NordEvent extends Event {
|
|
5
5
|
constructor(type: string, eventInitDict?: EventInit);
|
|
6
6
|
}
|
|
7
|
+
export declare function oneEvent<K extends keyof GlobalEventHandlersEventMap>(element: HTMLElement, type: K): Promise<GlobalEventHandlersEventMap[K]>;
|
|
8
|
+
export declare function transition(element: HTMLElement): Promise<TransitionEvent>;
|
|
@@ -17,6 +17,11 @@ declare const DatePicker_base: (new (...args: any[]) => import("../common/mixins
|
|
|
17
17
|
*
|
|
18
18
|
* @status ready
|
|
19
19
|
* @category form
|
|
20
|
+
*
|
|
21
|
+
* @localization modalHeading - Heading for the date picker's modal.
|
|
22
|
+
* @localization closeLabel - Accessible label for the close button.
|
|
23
|
+
* @localization buttonLabel - Accessible label for the toggle button that opens the date picker modal.
|
|
24
|
+
* @localization selectedDateMessage - Describes the selected date. This message is appended to the toggle button label when a date is selected.
|
|
20
25
|
*/
|
|
21
26
|
export default class DatePicker extends DatePicker_base {
|
|
22
27
|
static styles: import("lit").CSSResult[];
|
|
@@ -43,13 +43,17 @@ export default class Dropdown extends Dropdown_base {
|
|
|
43
43
|
private handleClose;
|
|
44
44
|
/**
|
|
45
45
|
* Hide the dropdown programmatically.
|
|
46
|
+
* This method delegates to the Dropdown's internal Popout component.
|
|
47
|
+
* See [Popout's hide() method](/components/popout#methods-hide) for more details.
|
|
46
48
|
* @param moveFocusToButton A boolean option to move the focus to the original button that opens the dropdown.
|
|
47
49
|
*/
|
|
48
|
-
hide(moveFocusToButton?: boolean): void
|
|
50
|
+
hide(moveFocusToButton?: boolean): Promise<TransitionEvent | void>;
|
|
49
51
|
/**
|
|
50
52
|
* Show the dropdown programmatically.
|
|
53
|
+
* This method delegates to the Dropdown's internal Popout component.
|
|
54
|
+
* See [Popout's show() method](/components/popout#methods-hide) for more details.
|
|
51
55
|
*/
|
|
52
|
-
show(): void
|
|
56
|
+
show(): Promise<TransitionEvent | void>;
|
|
53
57
|
}
|
|
54
58
|
declare global {
|
|
55
59
|
interface HTMLElementTagNameMap {
|
package/lib/src/icon/Icon.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
|
|
2
|
+
import { IconResolver } from "./IconManager.js";
|
|
3
3
|
/**
|
|
4
4
|
* Icons are used to provide additional meaning or in places where text label doesn’t fit.
|
|
5
5
|
* Icon component allows you to display an icon from the Nordicons library.
|
|
@@ -10,8 +10,7 @@ export declare type IconResolver = (iconName: string) => Promise<string>;
|
|
|
10
10
|
*/
|
|
11
11
|
export default class Icon extends LitElement {
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
private static
|
|
14
|
-
private static registeredIcons;
|
|
13
|
+
private static manager;
|
|
15
14
|
/**
|
|
16
15
|
* Register a custom icon resolver, which accepts the icon name as an parameter, and returns an SVG string.
|
|
17
16
|
* Can return a string synchronously, or a promise of a string.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare type IconResolver = (iconName: string) => Promise<string>;
|
|
2
|
+
export declare class IconManager {
|
|
3
|
+
private cache;
|
|
4
|
+
resolver: IconResolver;
|
|
5
|
+
resolve(name: string, onResolved: (svg: string) => void): void;
|
|
6
|
+
registerIcon(iconOrName: string | {
|
|
7
|
+
title: string;
|
|
8
|
+
default: string;
|
|
9
|
+
}, icon?: string): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
@@ -57,6 +57,11 @@ export default class Layout extends LitElement {
|
|
|
57
57
|
* Controls whether the layout's header has sticky positioning.
|
|
58
58
|
*/
|
|
59
59
|
sticky: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* A getter whose values reflects whether the layout component considers the viewport to be narrow or not.
|
|
62
|
+
* A narrow viewport is considered to be less than 768px wide.
|
|
63
|
+
*/
|
|
64
|
+
get isNarrow(): boolean;
|
|
60
65
|
connectedCallback(): void;
|
|
61
66
|
disconnectedCallback(): void;
|
|
62
67
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -66,7 +71,8 @@ export default class Layout extends LitElement {
|
|
|
66
71
|
protected handleNavStateChange(prev: NavState): void;
|
|
67
72
|
protected handleOpenChange(): void;
|
|
68
73
|
private navTransition;
|
|
69
|
-
private
|
|
74
|
+
private handleNavClick;
|
|
75
|
+
private handleMainClick;
|
|
70
76
|
private handleDropdownOpen;
|
|
71
77
|
private handleDropdownClose;
|
|
72
78
|
private handleMediaQueryChange;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import en from "./en-us.js";
|
|
2
|
-
declare type PickStartsWith<
|
|
3
|
-
[Property in keyof Type]: Property extends `${Prefix}${string}` ? Property : never;
|
|
4
|
-
}[keyof Type];
|
|
2
|
+
declare type PickStartsWith<T, Prefix extends string> = T extends `${Prefix}${string}` ? T : never;
|
|
5
3
|
export declare type Translation = typeof en;
|
|
6
|
-
export declare type WellKnownKeys = PickStartsWith<Translation, "$">;
|
|
4
|
+
export declare type WellKnownKeys = PickStartsWith<keyof Translation, "$">;
|
|
7
5
|
/**
|
|
8
6
|
* Removes all registered translations
|
|
9
7
|
*/
|
|
@@ -27,5 +25,40 @@ export declare function isTranslationRegistered(lang: string): boolean;
|
|
|
27
25
|
* Picks the most appropriate translation for the given language, from most specific to least specific.
|
|
28
26
|
* First tries lang + region, then lang only, then fallback.
|
|
29
27
|
*/
|
|
30
|
-
export declare function resolveTranslation(langCode: string):
|
|
31
|
-
|
|
28
|
+
export declare function resolveTranslation(langCode: string): {
|
|
29
|
+
$lang: string;
|
|
30
|
+
$name: string;
|
|
31
|
+
$dir: "ltr" | "rtl";
|
|
32
|
+
"nord-command-menu": {
|
|
33
|
+
instructions: string;
|
|
34
|
+
inputLabel: string;
|
|
35
|
+
footerArrowKeys: string;
|
|
36
|
+
footerEnterKey: string;
|
|
37
|
+
footerEscapeKey: string;
|
|
38
|
+
footerBackspaceKey: string;
|
|
39
|
+
noResults: (searchTerm: string) => string;
|
|
40
|
+
tip: string;
|
|
41
|
+
};
|
|
42
|
+
"nord-calendar": {
|
|
43
|
+
prevMonthLabel: string;
|
|
44
|
+
nextMonthLabel: string;
|
|
45
|
+
monthSelectLabel: string;
|
|
46
|
+
yearSelectLabel: string;
|
|
47
|
+
};
|
|
48
|
+
"nord-date-picker": {
|
|
49
|
+
modalHeading: string;
|
|
50
|
+
closeLabel: string;
|
|
51
|
+
buttonLabel: string;
|
|
52
|
+
selectedDateMessage: string;
|
|
53
|
+
};
|
|
54
|
+
"nord-modal": {
|
|
55
|
+
closeLabel: string;
|
|
56
|
+
};
|
|
57
|
+
"nord-nav-toggle": {
|
|
58
|
+
label: string;
|
|
59
|
+
};
|
|
60
|
+
"nord-textarea": {
|
|
61
|
+
remainingCharacters: (remainder: number) => string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export { en as fallback };
|
package/lib/src/modal/Modal.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ import { LitElement } from "lit";
|
|
|
15
15
|
* @cssprop [--n-modal-padding-inline=var(--n-space-m)] - Controls the padding on the sides of the modal, using our [spacing tokens](/tokens/#space).
|
|
16
16
|
* @cssprop [--n-modal-padding-block=var(--n-space-m)] - Controls the padding above and below the modal, using our [spacing tokens](/tokens/#space).
|
|
17
17
|
* @cssprop [--n-modal-max-inline-size=620px] - Controls the width of the modal.
|
|
18
|
+
*
|
|
19
|
+
* @localization closeLabel - Accessible label for the close button.
|
|
18
20
|
*/
|
|
19
21
|
export default class Modal extends LitElement {
|
|
20
22
|
static styles: import("lit").CSSResult[];
|
|
@@ -37,6 +37,10 @@ export default class NavItem extends NavItem_base {
|
|
|
37
37
|
* Note: this is only used if you have nested navigation using the "subnav" slot.
|
|
38
38
|
*/
|
|
39
39
|
open: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
get hasSubNav(): boolean;
|
|
40
44
|
connectedCallback(): void;
|
|
41
45
|
render(): TemplateResult<1>;
|
|
42
46
|
private renderLink;
|
|
@@ -9,6 +9,8 @@ declare const NavToggle_base: (new (...args: any[]) => import("../common/mixins/
|
|
|
9
9
|
*
|
|
10
10
|
* @status new
|
|
11
11
|
* @category action
|
|
12
|
+
*
|
|
13
|
+
* @localization label - Accessible label for the nav toggle button.
|
|
12
14
|
*/
|
|
13
15
|
export default class NavToggle extends NavToggle_base {
|
|
14
16
|
static styles: import("lit").CSSResult[];
|
|
@@ -31,15 +31,18 @@ export default class Popout extends Popout_base {
|
|
|
31
31
|
*/
|
|
32
32
|
anchor?: string;
|
|
33
33
|
/**
|
|
34
|
-
* Show the popout
|
|
34
|
+
* Show the popout.
|
|
35
|
+
* A promise that resolves to a `TransitionEvent` when the popout's show animation ends or is cancelled.
|
|
36
|
+
* If the popout is already open, the promise resolves immediately with `undefined`.
|
|
35
37
|
*/
|
|
36
|
-
show(): void
|
|
38
|
+
show(): Promise<TransitionEvent | void>;
|
|
37
39
|
/**
|
|
38
40
|
* Hide the popout.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
+
* Returns a promise that resolves to a `TransitionEvent` when the popout's hide animation ends or is cancelled.
|
|
42
|
+
* If the popout is already closed, the promise resolves immediately with `undefined`.
|
|
43
|
+
* @param {boolean} moveFocusToButton prevent focus returning to the target button. Default is true.
|
|
41
44
|
*/
|
|
42
|
-
hide(moveFocusToButton?: boolean): void
|
|
45
|
+
hide(moveFocusToButton?: boolean): Promise<TransitionEvent | void>;
|
|
43
46
|
/**
|
|
44
47
|
* Position the popout on load.
|
|
45
48
|
*/
|
|
@@ -11,6 +11,8 @@ declare const Select_base: (new (...args: any[]) => import("../common/mixins/Siz
|
|
|
11
11
|
* @slot label - Use when a label requires more than plain text.
|
|
12
12
|
* @slot hint - Use when a hint requires more than plain text.
|
|
13
13
|
* @slot error - Optional slot that holds error text for the input.
|
|
14
|
+
*
|
|
15
|
+
* @cssprop [--n-select-block-size=var(--n-space-xl)] - Controls the block size, or height, of the select using our [spacing tokens](/tokens/#space).
|
|
14
16
|
*/
|
|
15
17
|
export default class Select extends Select_base {
|
|
16
18
|
static styles: import("lit").CSSResult[];
|
|
@@ -12,11 +12,13 @@ declare const Textarea_base: (new (...args: any[]) => import("../common/mixins/S
|
|
|
12
12
|
* @slot error - Optional slot that holds error text for the textarea.
|
|
13
13
|
*
|
|
14
14
|
* @cssprop [--n-textarea-inline-size=240px] - Controls the inline size, or width, of the textarea.
|
|
15
|
-
* @cssprop [--n-textarea-block-size=76px] - Controls the block size, or height,
|
|
15
|
+
* @cssprop [--n-textarea-block-size=76px] - Controls the block size, or height, of the textarea.
|
|
16
16
|
* @cssprop [--n-textarea-background=var(--n-color-active)] - Controls the background of the textarea, using our [color tokens](/tokens/#color).
|
|
17
17
|
* @cssprop [--n-textarea-color=var(--n-color-text)] - Controls the text color of the textarea, using our [color tokens](/tokens/#color).
|
|
18
18
|
* @cssprop [--n-textarea-border-color=var(--n-color-border-strong)] - Controls the border color of the textarea, using our [color tokens](/tokens/#color).
|
|
19
19
|
* @cssprop [--n-textarea-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
20
|
+
*
|
|
21
|
+
* @localization remainingCharacters - A function which receives the number of remaining characters and returns a string to be used as the aria-live message.
|
|
20
22
|
*/
|
|
21
23
|
export default class Textarea extends Textarea_base {
|
|
22
24
|
static styles: import("lit").CSSResult[];
|
package/lib/translation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";const o=new Set,n=new Map;function e(){for(const t of o)t()}function i(){n.clear()}function
|
|
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";const o=new Set,n=new Map;function e(){for(const t of o)t()}function i(){n.clear()}function a(...t){t.forEach((t=>{const o=t.$lang.toLowerCase();n.set(o,t)})),e()}function r(t){return o.add(t),()=>o.delete(t)}function s(t){return n.has(t)}function l(o){const e=o.toLowerCase(),[i]=e.split("-");return n.get(e)||n.get(i)||t}new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});export{i as clearTranslations,s as isTranslationRegistered,a as registerTranslation,l 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<
|
|
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":"uOAQA,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": "2.
|
|
3
|
+
"version": "2.14.1",
|
|
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",
|
|
@@ -180,5 +180,5 @@
|
|
|
180
180
|
}
|
|
181
181
|
]
|
|
182
182
|
},
|
|
183
|
-
"gitHead": "
|
|
183
|
+
"gitHead": "f9aed508f2716e75f6d5701890bb2ce9b5fcd7b7"
|
|
184
184
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar-9d3d6d01.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 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M105 57.4 47.6 2.8a10.566 10.566 0 1 0-14.56 15.316l51.968 49.35a3.486 3.486 0 0 1 0 5.068l-51.968 49.35a10.502 10.502 0 0 0 14.462 15.232l57.638-54.74A17.584 17.584 0 0 0 105 57.4z\"/></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 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M99.736 140a10.486 10.486 0 0 1-7.238-2.884L35 82.6a17.598 17.598 0 0 1-.14-24.976l57.638-54.74a10.502 10.502 0 1 1 14.462 15.232l-51.968 49.35a3.486 3.486 0 0 0 0 5.068l51.968 49.35A10.5 10.5 0 0 1 99.736 140z\"/></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 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M70 110.236a17.332 17.332 0 0 1-12.306-5.096L2.884 47.502A10.502 10.502 0 1 1 18.116 33.04l49.35 51.968a3.486 3.486 0 0 0 5.068 0l49.35-51.968a10.502 10.502 0 1 1 15.232 14.462L82.6 105a17.766 17.766 0 0 1-12.6 5.236z\"/></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@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, { 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","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","getMonthNames","getDayNames","days","months","years","date","clamp","styles","componentStyle","style","__decorate","query","prototype","property","type","Number","reflect","Boolean","attribute","state","observe","customElement"],"mappings":"6+BAAe,kSACM,yBACD,2GCFL,+TACM,wBACD,0GCFL,sUACM,wBACD,8DCUpB,MAAMA,EAAkBC,GAAaA,EAAED,uBAS1BE,EAQXC,YAAYC,EAAuBC,GAN3BC,KAAcC,gBAAG,EAEjBD,KAAaE,cAAW,EACxBF,KAAaG,cAAW,EA4BxBH,KAAAI,iBAAoBC,IAC1B,OAAOC,MAAEA,EAAKC,MAAEA,IAAWF,EAAMG,eACjCR,KAAKE,cAAgBI,EACrBN,KAAKG,cAAgBI,CAAK,EAGpBP,KAAAS,eAAkBJ,IACxB,OAAOC,MAAEA,EAAKC,MAAEA,IAAWF,EAAMG,gBAC3BE,eAAEA,EAAcC,WAAEA,GAAeX,KAAKD,QAEtCa,EAAQN,EAAQN,KAAKE,cACrBW,EAAQN,EAAQP,KAAKG,cACrBW,EAAU,CAAEC,SAAUf,KAAKE,cAAec,SAAUhB,KAAKG,cAAeG,QAAOC,QAAOK,QAAOC,SAE/FH,EAAeI,KACjBT,EAAMX,iBACNiB,EAAWG,GACZ,EAzCDhB,EAAKmB,cAAcjB,MACnBA,KAAKkB,OAAS,IAAIC,EAAgBrB,GAElCE,KAAKD,QAAU,CACbqB,OAAQ,IAAMtB,KACXC,EAEN,CAEDsB,cACE,IAAKrB,KAAKC,eAAgB,CACxBD,KAAKC,gBAAiB,EAEtB,MAAMmB,EAASpB,KAAKD,QAAQqB,SAC5BpB,KAAKkB,OAAOI,OAAOF,EAAQ,aAAcpB,KAAKI,kBAC9CJ,KAAKkB,OAAOI,OAAOF,EAAQ,YAAa1B,GACxCM,K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AXG,KAA2BhI,EAAA+H,UAAA,WAAA,GAMhBF,EAAA,CAAXG,KAA2BhI,EAAA+H,UAAA,WAAA,GAKgBF,EAAA,CAA3CG,EAAS,CAAEG,SAAS,EAAMF,KAAMG,WAAyBpI,EAAA+H,UAAA,cAAA,GAM1BF,EAAA,CAA/BG,EAAS,CAAEK,WAAW,KAAuDrI,EAAA+H,UAAA,sBAAA,GAS9CF,EAAA,CAA/BG,EAAS,CAAEK,WAAW,KAAgFrI,EAAA+H,UAAA,yBAAA,GAE9FF,EAAA,CAARS,KAAmCtI,EAAA+H,UAAA,mBAAA,GAC3BF,EAAA,CAARS,KAAuCtI,EAAA+H,UAAA,kBAAA,GAsLxCF,EAAA,CADCU,EAAQ,UAGRvI,EAAA+H,UAAA,oBAAA,MAGDF,EAAA,CADCU,EAAQ,aAAc,YAKtBvI,EAAA+H,UAAA,yBAAA,MAtRkB/H,EAAQ6H,EAAA,CAD5BW,EAAc,kBACMxI,SAAAA"}
|
package/lib/Popout-dae54e30.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as t,i as o,y as e,e as i,s}from"./query-assigned-elements-cf502539.js";import{e as n}from"./property-03f59dce.js";import{t as r}from"./state-70f38ceb.js";import{i as a}from"./query-2d22378e.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-3bbd3548.js";import{L as f}from"./LightDismissController-a2645ae6.js";import{S as v}from"./ScrollbarController-773c79f4.js";import{N as g}from"./events-731d0007.js";import{s as b}from"./Component-449e40fb.js";import{D as y}from"./DirectionController-8b298382.js";import{o as w}from"./observe-a9c6dfb6.js";import{E as x}from"./EventController-d99ebeef.js";function E(o){class e extends o{constructor(){super(...arguments),this.open=!1,this.align="start",this.position="block-end"}}return t([n({type:Boolean,reflect:!0})],e.prototype,"open",void 0),t([n({reflect:!0})],e.prototype,"align",void 0),t([n({reflect:!0})],e.prototype,"position",void 0),e}const k=o`: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}`,C=matchMedia("(max-width: 35.9375em)");let S=class extends(E(s)){constructor(){super(...arguments),this.scrollBar=new v(this),this.dismiss=new f(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 y(this),this.smallViewport=C.matches,this.id="",this.enableScroll=()=>{this.open||this.scrollBar.unlockScroll()},this.updatePosition=async()=>{var t;const{x:o,y:e,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",`${o}px`),this.style.setProperty("--_n-popout-position-y",`${e}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=C.matches,null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),!this.smallViewport&&this.open?(this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition),this.scrollBar.unlockScroll()):this.open&&this.scrollBar.lockScroll()}}show(){this.open||(this.open=!0,this.updateComplete.then((()=>{this.dispatchEvent(new g("open"))})))}hide(t=!0){var o;this.open&&(this.open=!1,null===(o=this.cleanupAutoUpdate)||void 0===o||o.call(this),this.dispatchEvent(new g("close")),t&&this.targetElement.focus({preventScroll:!0}))}firstUpdated(){this.smallViewport||this.updatePosition()}connectedCallback(){super.connectedCallback(),this.targetElement=this.getToggle(),this.anchorElement=this.anchor?this.getAnchor():this.targetElement,this.events.listen(this.targetElement,"click",this.toggleOpen),this.events.listen(C,"change",this.handleMediaQueryChange)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this),this.targetElement.removeAttribute("aria-expanded")}render(){return e`<div class="n-popout ${this.computedPosition} is-${this.direction.dir}" aria-hidden="${this.open?"false":"true"}" @transitionend="${this.enableScroll}"><slot></slot></div>`}handleIdChange(){this.id||console.warn("NORD: popout requires an id attribute and value")}handleOpenChange(){var t;this.targetElement.setAttribute("aria-expanded",`${this.open}`),this.open?this.smallViewport?this.scrollBar.lockScroll():this.cleanupAutoUpdate=u(this.anchorElement,this,this.updatePosition):null===(t=this.cleanupAutoUpdate)||void 0===t||t.call(this)}getToggle(){const t=this.getRootNode().querySelector(`[aria-controls='${this.id}']`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}getAnchor(){const t=this.getRootNode().querySelector(`#${this.anchor}`);return t instanceof HTMLSlotElement?t.assignedElements()[0]:t}};S.styles=[b,k],t([a(".n-popout",!0)],S.prototype,"popout",void 0),t([r()],S.prototype,"computedPosition",void 0),t([r()],S.prototype,"smallViewport",void 0),t([n({reflect:!0})],S.prototype,"id",void 0),t([n({reflect:!0})],S.prototype,"anchor",void 0),t([w("id")],S.prototype,"handleIdChange",null),t([w("open")],S.prototype,"handleOpenChange",null),S=t([i("nord-popout")],S);var j=S;export{E as F,j as P};
|
|
2
|
-
//# sourceMappingURL=Popout-dae54e30.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popout-dae54e30.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 } 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!: Element\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 @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, moving focus to the calendar inside.\n */\n show() {\n if (this.open) {\n return\n }\n\n this.open = true\n\n // we should only focus once the popout is visible after render is complete\n this.updateComplete.then(() => {\n /**\n * Dispatched when the popout is opened.\n */\n this.dispatchEvent(new NordEvent(\"open\"))\n })\n }\n\n /**\n * Hide the popout.\n * @param {boolean} moveFocusToButton prevent focus returning to the target\n * button. Default is true.\n */\n hide(moveFocusToButton = true) {\n if (!this.open) {\n return\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\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\n this.targetElement = this.getToggle()\n this.anchorElement = this.anchor ? this.getAnchor() : this.targetElement\n\n this.events.listen(this.targetElement, \"click\", this.toggleOpen)\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 if (!this.id) {\n // eslint-disable-next-line no-console\n console.warn(\"NORD: popout requires an id attribute and value\")\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 {\n this.cleanupAutoUpdate = autoUpdate(this.anchorElement, this, this.updatePosition)\n }\n } else {\n this.cleanupAutoUpdate?.()\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 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 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) {\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","x","y","placement","middlewareData","computePosition","anchorElement","strategy","logicalToPhysical","dir","middleware","offset","flip","shift","padding","computedPosition","style","setProperty","_a","referenceHidden","toggleOpen","preventDefault","show","then","handleMediaQueryChange","cleanupAutoUpdate","call","autoUpdate","lockScroll","updateComplete","dispatchEvent","NordEvent","moveFocusToButton","focus","preventScroll","firstUpdated","connectedCallback","super","getToggle","anchor","getAnchor","listen","disconnectedCallback","removeAttribute","render","html","handleIdChange","console","warn","handleOpenChange","setAttribute","toggle","getRootNode","querySelector","HTMLSlotElement","assignedElements","styles","componentStyle","query","state","observe","customElement"],"mappings":"0nBAcM,SAAUA,EACdC,GAEA,MAAMC,UAAwBD,EAA9BE,kCAI8CC,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,0BAU9B,IAAqBC,EAArB,cAAoChB,EAAciB,IAAlDd,kCASUC,KAAAc,UAAY,IAAIC,EAAoBf,MAKpCA,KAAAgB,QAAU,IAAIC,EAAuBjB,KAAM,CACjDkB,OAAQ,IAAMlB,KAAKC,KACnBkB,UAAWC,GAAKp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AA,EAAAQ,KAAA9D,KAEzB,CAwDO0E,YACN,MACMa,EADWvF,KAAKwF,cACeC,cAAc,mBAAmBzF,KAAKgC,QAE3E,OAAIuD,aAAkBG,gBACbH,EAAOI,mBAAmB,GAG5BJ,CACR,CAEOX,YACN,MACMD,EADW3E,KAAKwF,cACeC,cAAc,IAAIzF,KAAK2E,UAE5D,OAAIA,aAAkBe,gBACbf,EAAOgB,mBAAmB,GAG5BhB,CACR,GAvNM/D,EAAAgF,OAAS,CAACC,EAAgBzC,GAMPhD,EAAA,CAAzB0F,EAAM,aAAa,IAAqClF,EAAAH,UAAA,cAAA,GAgBhDL,EAAA,CAAR2F,KAA4CnF,EAAAH,UAAA,wBAAA,GAEpCL,EAAA,CAAR2F,KAAkDnF,EAAAH,UAAA,qBAAA,GAKtBL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAAuBI,EAAAH,UAAA,UAAA,GAKfL,EAAA,CAA5BC,EAAS,CAAEG,SAAS,KAAuBI,EAAAH,UAAA,cAAA,GAoF5CL,EAAA,CADC4F,EAAQ,OAMRpF,EAAAH,UAAA,iBAAA,MAGDL,EAAA,CADC4F,EAAQ,SAcRpF,EAAAH,UAAA,mBAAA,MA5IkBG,EAAMR,EAAA,CAD1B6F,EAAc,gBACMrF,SAAAA"}
|
package/lib/events-731d0007.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events-731d0007.js","sources":["../src/common/events.ts"],"sourcesContent":["/**\n * A base class for events which defaults to bubbling and composed\n */\nexport class NordEvent extends Event {\n constructor(type: string, eventInitDict?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n })\n }\n}\n"],"names":["NordEvent","Event","constructor","type","eventInitDict","super","bubbles","composed"],"mappings":"AAGM,MAAOA,UAAkBC,MAC7BC,YAAYC,EAAcC,GACxBC,MAAMF,EAAM,CACVG,SAAS,EACTC,UAAU,KACPH,GAEN"}
|