@nordhealth/components 1.14.3 → 2.0.2
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 +1389 -1161
- 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/Calendar-8aa523a7.js +2 -0
- package/lib/Calendar-8aa523a7.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/DatePicker.js +1 -1
- package/lib/DatePicker.js.map +1 -1
- package/lib/Divider.js +1 -1
- package/lib/Divider.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.js +1 -1
- package/lib/DropdownItem.js.map +1 -1
- 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/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/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/Popout.js +1 -1
- package/lib/Popout.js.map +1 -1
- package/lib/ProgressBar.js +1 -1
- package/lib/ProgressBar.js.map +1 -1
- package/lib/Radio.js +1 -1
- package/lib/Radio.js.map +1 -1
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/Skeleton.js +1 -1
- package/lib/Skeleton.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/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/Table.js +1 -1
- package/lib/Table.js.map +1 -1
- package/lib/TextField-2df7c697.js +2 -0
- package/lib/{TextField-c34519d4.js.map → TextField-2df7c697.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/bundle.js +23 -23
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/avatar/Avatar.d.ts +3 -1
- package/lib/src/badge/Badge.d.ts +10 -3
- package/lib/src/badge/Badge.test.d.ts +4 -0
- package/lib/src/banner/Banner.d.ts +3 -0
- package/lib/src/button/Button.d.ts +6 -0
- package/lib/src/calendar/Calendar.d.ts +3 -0
- package/lib/src/card/Card.d.ts +5 -0
- package/lib/src/command-menu/CommandMenu.d.ts +4 -0
- package/lib/src/divider/Divider.d.ts +3 -0
- package/lib/src/dropdown/Dropdown.d.ts +2 -0
- package/lib/src/input/Input.d.ts +6 -0
- package/lib/src/layout/Layout.d.ts +3 -1
- package/lib/src/modal/Modal.d.ts +4 -0
- package/lib/src/progress-bar/ProgressBar.d.ts +4 -0
- package/lib/src/skeleton/Skeleton.d.ts +6 -4
- package/lib/src/stack/Stack.d.ts +2 -0
- package/lib/src/tab/Tab.d.ts +3 -0
- package/lib/src/tab/Tab.test.d.ts +1 -1
- package/lib/src/tab-group/TabGroup.d.ts +2 -0
- package/lib/src/table/Table.d.ts +3 -0
- package/lib/src/textarea/Textarea.d.ts +8 -0
- package/lib/src/toast/Toast.d.ts +2 -4
- package/lib/src/toast-group/ToastGroup.d.ts +2 -3
- package/package.json +6 -6
- package/lib/Calendar-df35e1cd.js +0 -2
- package/lib/Calendar-df35e1cd.js.map +0 -1
- package/lib/DraftComponentMixin-9e4b7b34.js +0 -2
- package/lib/DraftComponentMixin-9e4b7b34.js.map +0 -1
- package/lib/TextField-c34519d4.js +0 -2
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-8aa523a7.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{default as Popout}from"./Popout.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";import"./query-assigned-elements-e6cbac30.js";import"./lit-element-79bc2e0e.js";import"./property-03f59dce.js";import"./Component-49a41387.js";import"./ref-697b28b5.js";import"./directive-de55b00a.js";import"./EventController-d99ebeef.js";import"./LightDomController-9a6e398f.js";import"./cond-0a8d4554.js";import"./FocusableMixin-99db12c1.js";import"./InputMixin-158f63fb.js";import"./SlotController-ea6eff46.js";import"./if-defined-f43b1487.js";import"./class-map-cd6c8cbd.js";import"./unsafe-html-be8023cd.js";import"./FormAssociatedMixin-f6e5b3cd.js";import"./events-731d0007.js";import"./TextField-2df7c697.js";import"./AutocompleteMixin-370de2be.js";import"./FormField-72062bf1.js";import"./state-70f38ceb.js";import"./observe-a9c6dfb6.js";import"./repeat-e7acc0bd.js";import"./collection-800f5002.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"./DirectionController-8b298382.js";import"./query-2d22378e.js";import"./dates-a8de5b83.js";import"./month-view.js";import"./DateSelectEvent.js";import"./interface-close-small-44ababc3.js";import"./date-adapter.js";import"./positioning-3bbd3548.js";import"./fsm-50373df9.js";import"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,6 +5,8 @@ import { LitElement, nothing } from "lit";
|
|
|
5
5
|
*
|
|
6
6
|
* @status ready
|
|
7
7
|
* @category image
|
|
8
|
+
*
|
|
9
|
+
* @cssprop [--n-avatar-size=var(--n-size-icon-l)] - Controls the size of the avatar, using [icon sizing tokens](/tokens/#size).
|
|
8
10
|
*/
|
|
9
11
|
export default class Avatar extends LitElement {
|
|
10
12
|
static styles: import("lit").CSSResult[];
|
|
@@ -23,7 +25,7 @@ export default class Avatar extends LitElement {
|
|
|
23
25
|
name: string;
|
|
24
26
|
render(): import("lit-html").TemplateResult<1>;
|
|
25
27
|
protected handleSrcChange(): void;
|
|
26
|
-
protected renderImage(): import("lit-html").TemplateResult<1
|
|
28
|
+
protected renderImage(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
27
29
|
protected renderFallback(): import("lit-html").TemplateResult<1>;
|
|
28
30
|
private handleLoad;
|
|
29
31
|
private handleError;
|
package/lib/src/badge/Badge.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
/**
|
|
3
|
-
* Badges are used to inform users of the status of an object
|
|
3
|
+
* Badges are used to inform users of the status of an object
|
|
4
|
+
* or of an action that’s been taken. Commonly used in tabular
|
|
5
|
+
* data to indicate status.
|
|
4
6
|
*
|
|
5
7
|
* @status ready
|
|
6
8
|
* @category text
|
|
@@ -10,9 +12,14 @@ export default class Badge extends LitElement {
|
|
|
10
12
|
static styles: import("lit").CSSResult[];
|
|
11
13
|
/**
|
|
12
14
|
* The type of badge.
|
|
13
|
-
* Determines the color of the
|
|
15
|
+
* Determines the background color of the badge.
|
|
14
16
|
*/
|
|
15
|
-
type?: "warning" | "success" | "danger" | "highlight" | "info";
|
|
17
|
+
type?: "warning" | "success" | "danger" | "highlight" | "info" | "neutral" | "progress";
|
|
18
|
+
/**
|
|
19
|
+
* The progress of the badge. Displays a progress
|
|
20
|
+
* indicator next to the label.
|
|
21
|
+
*/
|
|
22
|
+
progress?: "cancelled" | "complete" | "incomplete" | "partially-complete";
|
|
16
23
|
render(): import("lit-html").TemplateResult<1>;
|
|
17
24
|
}
|
|
18
25
|
declare global {
|
|
@@ -7,6 +7,9 @@ import { LitElement } from "lit";
|
|
|
7
7
|
* @status ready
|
|
8
8
|
* @category feedback
|
|
9
9
|
* @slot - default slot
|
|
10
|
+
*
|
|
11
|
+
* @cssprop [--n-banner-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
12
|
+
* @cssprop [--n-banner-box-shadow=var(--n-box-shadow-card)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).
|
|
10
13
|
*/
|
|
11
14
|
export default class Banner extends LitElement {
|
|
12
15
|
static styles: import("lit").CSSResult[];
|
|
@@ -11,6 +11,12 @@ declare const Button_base: (new (...args: any[]) => import("../common/mixins/Inp
|
|
|
11
11
|
* @slot - The button content
|
|
12
12
|
* @slot start - Used to place content at the start of button text. Typically used for icons.
|
|
13
13
|
* @slot end - Used to place content at the end of button text. Typically used for icons.
|
|
14
|
+
*
|
|
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
|
+
* @cssprop [--n-button-gap=var(--n-space-s)] - Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).
|
|
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-border-color=var(--n-color-border-strong)] - Controls the border color of the button, using [color tokens](/tokens/#color).
|
|
19
|
+
* @cssprop [--n-button-text-align=center] - Controls the text alignment for the text in the button.
|
|
14
20
|
*/
|
|
15
21
|
export default class Button extends Button_base {
|
|
16
22
|
static styles: import("lit").CSSResult[];
|
|
@@ -12,6 +12,9 @@ export declare type DateDisabledPredicate = (date: Date) => boolean;
|
|
|
12
12
|
* @category list
|
|
13
13
|
* @fires {DateSelectEvent} change - Dispatched when a date is selected and the value changes.
|
|
14
14
|
* @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.
|
|
15
|
+
*
|
|
16
|
+
* @cssprop [--n-calendar-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
17
|
+
* @cssprop [--n-calendar-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).
|
|
15
18
|
*/
|
|
16
19
|
export default class Calendar extends LitElement {
|
|
17
20
|
static styles: import("lit").CSSResult[];
|
package/lib/src/card/Card.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ import { LitElement } from "lit";
|
|
|
10
10
|
* @slot header - Optional slot that holds a header for the card.
|
|
11
11
|
* @slot header-end - Optional slot that positions content at the end of the header. Useful for actions or additional info.
|
|
12
12
|
* @slot footer - Optional slot that holds footer content for the card.
|
|
13
|
+
*
|
|
14
|
+
* @cssprop [--n-card-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
15
|
+
* @cssprop [--n-card-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).
|
|
16
|
+
* @cssprop [--n-card-padding=var(--n-space-m)] - Controls the padding on all sides of the card.
|
|
17
|
+
* @cssprop [--n-card-slot-padding=var(--n-space-m)] - Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.
|
|
13
18
|
*/
|
|
14
19
|
export default class Card extends LitElement {
|
|
15
20
|
static styles: import("lit").CSSResult[];
|
|
@@ -13,6 +13,10 @@ import { ICommandMenuAction } from "./ICommandMenuAction.js";
|
|
|
13
13
|
* @fires open - The command menu was opened.
|
|
14
14
|
* @fires close - The command menu was closed.
|
|
15
15
|
* @fires {SelectEvent} nord-select - User selected a command from the menu.
|
|
16
|
+
*
|
|
17
|
+
* @cssprop [--n-command-menu-inline-size=640px] - Controls the max inline size, or width, of the command menu.
|
|
18
|
+
* @cssprop [--n-command-menu-block-size=290px] - Controls the max block size, or height, of the command menu.
|
|
19
|
+
* @cssprop [--n-command-menu-block-start=16%] - Controls the command menu offset from the block start, or top, of the screen.
|
|
16
20
|
*/
|
|
17
21
|
export default class CommandMenu extends LitElement {
|
|
18
22
|
static styles: import("lit").CSSResult[];
|
|
@@ -6,6 +6,9 @@ import { LitElement } from "lit";
|
|
|
6
6
|
*
|
|
7
7
|
* @status new
|
|
8
8
|
* @category structure
|
|
9
|
+
*
|
|
10
|
+
* @cssprop [--n-divider-color=var(--n-color-border)] - Controls the color of the divider, using our [color tokens](/tokens/#color).
|
|
11
|
+
* @cssprop [--n-divider-size=1px] - Controls the size, or thickness, of the divider.
|
|
9
12
|
*/
|
|
10
13
|
export default class Divider extends LitElement {
|
|
11
14
|
static styles: import("lit").CSSResult[];
|
|
@@ -10,6 +10,8 @@ import "../popout/Popout.js";
|
|
|
10
10
|
* @category action
|
|
11
11
|
* @slot - The dropdown content.
|
|
12
12
|
* @slot toggle - Used to place the toggle for dropdown.
|
|
13
|
+
*
|
|
14
|
+
* @cssprop [--n-dropdown-size=250px] - Controls the inline size, or width, of the dropdown. Will resize up to 1.5 times to account for larger content.
|
|
13
15
|
*/
|
|
14
16
|
export default class Dropdown extends LitElement implements Pick<Popout, "hide" | "show"> {
|
|
15
17
|
static styles: import("lit").CSSResult[];
|
package/lib/src/input/Input.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ declare const Input_base: (new (...args: any[]) => import("../common/mixins/Form
|
|
|
11
11
|
* @slot error - Optional slot that holds error text for the input.
|
|
12
12
|
* @slot start - Optional slot used to place an icon or prefix at the start of the input.
|
|
13
13
|
* @slot end - Optional slot used to place an icon or suffix at the end of the input.
|
|
14
|
+
*
|
|
15
|
+
* @cssprop [--n-input-inline-size=240px] - Controls the inline size, or width, of the input.
|
|
16
|
+
* @cssprop [--n-input-background=var(--n-color-active)] - Controls the background of the input, using our [color tokens](/tokens/#color).
|
|
17
|
+
* @cssprop [--n-input-color=var(--n-color-text)] - Controls the text color of the input, using our [color tokens](/tokens/#color).
|
|
18
|
+
* @cssprop [--n-input-border-color=var(--n-color-border-strong)] - Controls the border color of the input, using our [color tokens](/tokens/#color).
|
|
19
|
+
* @cssprop [--n-input-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
14
20
|
*/
|
|
15
21
|
export default class Input extends Input_base {
|
|
16
22
|
static styles: import("lit").CSSResult[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import { States } from "../common/fsm.js";
|
|
3
3
|
declare const navMachine: {
|
|
4
|
-
transition(currentState: "closed" | "opened" | "peek" | "unpeek" | "wait" | "blocked", event: "click" | "close" | "focusin" | "focusout" | "pointerenter" | "pointerleave" | "toggle" | "transitionend" | "
|
|
4
|
+
transition(currentState: "closed" | "opened" | "peek" | "unpeek" | "wait" | "blocked", event: "click" | "open" | "close" | "focusin" | "focusout" | "pointerenter" | "pointerleave" | "toggle" | "transitionend" | "timeout" | "dropdownOpen" | "dropdownClose"): "closed" | "opened" | "peek" | "unpeek" | "wait" | "blocked";
|
|
5
5
|
};
|
|
6
6
|
declare type NavState = States<typeof navMachine>;
|
|
7
7
|
/**
|
|
@@ -13,6 +13,8 @@ declare type NavState = States<typeof navMachine>;
|
|
|
13
13
|
* @slot - The default main section content.
|
|
14
14
|
* @slot nav - Used to place content inside the navigation sidebar.
|
|
15
15
|
* @slot header - Used to place content inside the header section.
|
|
16
|
+
*
|
|
17
|
+
* @cssprop [--n-layout-padding=var(--n-space-l)] - Controls the padding around the main layout area (the main slot), using our [spacing tokens](/tokens/#space).
|
|
16
18
|
*/
|
|
17
19
|
export default class Layout extends LitElement {
|
|
18
20
|
static styles: import("lit").CSSResult[];
|
package/lib/src/modal/Modal.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ import { LitElement } from "lit";
|
|
|
11
11
|
* @slot footer - Slot which is typically used to hold call to action buttons, but can also be used to build custom footers.
|
|
12
12
|
* @fires cancel - Dispatched before the modal has closed when a user attempts to dismiss a modal. Call `preventDefault()` on the event to prevent the modal closing.
|
|
13
13
|
* @fires close - Dispatched when a modal is closed for any reason.
|
|
14
|
+
*
|
|
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
|
+
* @cssprop [--n-modal-padding-block=var(--n-space-m)] - Controls the padding above and below the modal, using our [spacing tokens](/tokens/#space).
|
|
17
|
+
* @cssprop [--n-modal-max-inline-size=620px] - Controls the width of the modal.
|
|
14
18
|
*/
|
|
15
19
|
export default class Modal extends LitElement {
|
|
16
20
|
static styles: import("lit").CSSResult[];
|
|
@@ -7,6 +7,10 @@ declare const ProgressBar_base: (new (...args: any[]) => import("../common/mixin
|
|
|
7
7
|
*
|
|
8
8
|
* @status ready
|
|
9
9
|
* @category feedback
|
|
10
|
+
*
|
|
11
|
+
* @cssprop [--n-progress-size=var(--n-space-s)] - Controls the thickness of the progress bar, using our [spacing tokens](/tokens/#space).
|
|
12
|
+
* @cssprop [--n-progress-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
13
|
+
* @cssprop [--n-progress-color=var(--n-color-accent)] - Controls the color of the progress bar, using [color tokens](/tokens/#color).
|
|
10
14
|
*/
|
|
11
15
|
export default class ProgressBar extends ProgressBar_base {
|
|
12
16
|
static styles: import("lit").CSSResult[];
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare const Skeleton_base: typeof LitElement;
|
|
3
2
|
/**
|
|
4
3
|
* Skeletons are used to provide a low fidelity representation of content
|
|
5
4
|
* before it appears in a view. This improves the perceived loading time
|
|
6
5
|
* for our users.
|
|
7
6
|
*
|
|
8
|
-
* @status
|
|
7
|
+
* @status new
|
|
9
8
|
* @category feedback
|
|
9
|
+
*
|
|
10
|
+
* @cssprop [--n-skeleton-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
11
|
+
* @cssprop [--n-skeleton-color=var(--n-color-border)] - Controls the main color of the skeleton, using our [color tokens](/tokens/#color).
|
|
12
|
+
* @cssprop [--n-skeleton-sheen-color=var(--n-color-border-strong)] - Controls the sheen color of the skeleton, using our [color tokens](/tokens/#color).
|
|
10
13
|
*/
|
|
11
|
-
export default class Skeleton extends
|
|
14
|
+
export default class Skeleton extends LitElement {
|
|
12
15
|
static styles: import("lit").CSSResult[];
|
|
13
16
|
/**
|
|
14
17
|
* Determines which animation effect the skeleton will use.
|
|
@@ -21,4 +24,3 @@ declare global {
|
|
|
21
24
|
"nord-skeleton": Skeleton;
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
|
-
export {};
|
package/lib/src/stack/Stack.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { LitElement } from "lit";
|
|
|
6
6
|
* @status ready
|
|
7
7
|
* @category structure
|
|
8
8
|
* @slot - The stack content.
|
|
9
|
+
*
|
|
10
|
+
* @cssprop [--n-stack-gap=var(--n-space-m)] - Controls the spacing between items, using our [spacing tokens](/tokens/#space).
|
|
9
11
|
*/
|
|
10
12
|
export default class Stack extends LitElement {
|
|
11
13
|
static styles: import("lit").CSSResult[];
|
package/lib/src/tab/Tab.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { LitElement } from "lit";
|
|
|
5
5
|
* @status new
|
|
6
6
|
* @category navigation
|
|
7
7
|
* @slot - The tab button content.
|
|
8
|
+
*
|
|
9
|
+
* @cssprop [--n-tab-color=var(--n-color-text-weak)] - Controls the text color of the tab, using our [color tokens](/tokens/#color).
|
|
10
|
+
* @cssprop [--n-tab-font-weight=var(--n-font-weight)] - Controls the font weight of the tab, using our [font tokens](/tokens/#font).
|
|
8
11
|
*/
|
|
9
12
|
export default class Tab extends LitElement {
|
|
10
13
|
static styles: import("lit").CSSResult[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../tab-group/TabGroup.js";
|
|
@@ -7,6 +7,8 @@ import { LitElement } from "lit";
|
|
|
7
7
|
* @category navigation
|
|
8
8
|
* @slot - The element which contains the content to be revealed.
|
|
9
9
|
* @slot tab - The element which contains all tabs to reveal tabbed content.
|
|
10
|
+
*
|
|
11
|
+
* @cssprop [--n-tab-group-padding=0] - Controls the padding around the tab group (including the tab list), using our [spacing tokens](/tokens/#space).
|
|
10
12
|
*/
|
|
11
13
|
export default class TabGroup extends LitElement {
|
|
12
14
|
static styles: import("lit").CSSResult[];
|
package/lib/src/table/Table.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { LitElement } from "lit";
|
|
|
7
7
|
* @status ready
|
|
8
8
|
* @category list
|
|
9
9
|
* @slot - Default slot which holds the HTML `<table>` element.
|
|
10
|
+
*
|
|
11
|
+
* @cssprop [--n-table-td-padding=calc(var(--n-space-m) * 0.95)] - Controls the padding around the table cells.
|
|
12
|
+
* @cssprop [--n-table-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
10
13
|
*/
|
|
11
14
|
export default class Table extends LitElement {
|
|
12
15
|
/**
|
|
@@ -10,6 +10,14 @@ declare const Textarea_base: (new (...args: any[]) => import("../common/mixins/F
|
|
|
10
10
|
* @slot label - Use when a label requires more than plain text.
|
|
11
11
|
* @slot hint - Optional slot that holds hint text for the textarea.
|
|
12
12
|
* @slot error - Optional slot that holds error text for the textarea.
|
|
13
|
+
*
|
|
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, or the textarea.
|
|
16
|
+
* @cssprop [--n-textarea-background=var(--n-color-active)] - Controls the background of the textarea, using our [color tokens](/tokens/#color).
|
|
17
|
+
* @cssprop [--n-textarea-color=var(--n-color-text)] - Controls the text color of the textarea, using our [color tokens](/tokens/#color).
|
|
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
|
+
* @cssprop [--n-textarea-border-radius=var(--n-border-radius-s)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).
|
|
20
|
+
|
|
13
21
|
*/
|
|
14
22
|
export default class Textarea extends Textarea_base {
|
|
15
23
|
static styles: import("lit").CSSResult[];
|
package/lib/src/toast/Toast.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
-
declare const Toast_base: typeof LitElement;
|
|
3
2
|
/**
|
|
4
3
|
* Toasts are non-disruptive messages that appear in the interface
|
|
5
4
|
* to provide quick, at-a-glance feedback on the outcome of an action.
|
|
6
5
|
*
|
|
7
|
-
* @status
|
|
6
|
+
* @status new
|
|
8
7
|
* @category feedback
|
|
9
8
|
* @slot - Default slot used for the toast text/message.
|
|
10
9
|
* @fires dismiss - Fired when the toast is dismissed (via user action or auto-dismiss), and its exit animation has completed. This event should be used to remove the dismissed toast from the DOM.
|
|
11
10
|
*/
|
|
12
|
-
export default class Toast extends
|
|
11
|
+
export default class Toast extends LitElement {
|
|
13
12
|
static styles: import("lit").CSSResult[];
|
|
14
13
|
private timeoutId?;
|
|
15
14
|
private events;
|
|
@@ -37,4 +36,3 @@ declare global {
|
|
|
37
36
|
"nord-toast": Toast;
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
|
-
export {};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import Toast from "../toast/Toast.js";
|
|
3
3
|
declare type ToastOptions = Partial<Pick<Toast, "variant" | "autoDismiss">>;
|
|
4
|
-
declare const ToastGroup_base: typeof LitElement;
|
|
5
4
|
/**
|
|
6
5
|
* Toast group is used to position and style a group of toasts, whilst ensuring they are announced by screen readers.
|
|
7
6
|
*
|
|
8
|
-
* @status
|
|
7
|
+
* @status new
|
|
9
8
|
* @category feedback
|
|
10
9
|
* @slot - Default slot in which to place toasts.
|
|
11
10
|
*/
|
|
12
|
-
export default class ToastGroup extends
|
|
11
|
+
export default class ToastGroup extends LitElement {
|
|
13
12
|
static styles: import("lit").CSSResult[];
|
|
14
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
15
14
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordhealth/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
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",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@floating-ui/dom": "1.0.1",
|
|
35
|
-
"@nordhealth/icons": "^1.
|
|
35
|
+
"@nordhealth/icons": "^1.6.0",
|
|
36
36
|
"lit": "2.3.0",
|
|
37
37
|
"qr-creator": "1.0.0",
|
|
38
38
|
"tinykeys": "1.4.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@custom-elements-manifest/analyzer": "0.6.4",
|
|
42
|
-
"@nordhealth/css": "^1.
|
|
42
|
+
"@nordhealth/css": "^2.1.0",
|
|
43
43
|
"@nordhealth/fonts": "^2.0.15",
|
|
44
|
-
"@nordhealth/themes": "^
|
|
45
|
-
"@nordhealth/tokens": "^
|
|
44
|
+
"@nordhealth/themes": "^7.0.0",
|
|
45
|
+
"@nordhealth/tokens": "^6.0.0",
|
|
46
46
|
"@open-wc/eslint-config": "8.0.2",
|
|
47
47
|
"@open-wc/testing": "3.1.6",
|
|
48
48
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
@@ -182,5 +182,5 @@
|
|
|
182
182
|
}
|
|
183
183
|
]
|
|
184
184
|
},
|
|
185
|
-
"gitHead": "
|
|
185
|
+
"gitHead": "90d1b9583bba037dccbbfa9d5ae360084cd7899a"
|
|
186
186
|
}
|
package/lib/Calendar-df35e1cd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,e as t}from"./query-assigned-elements-e6cbac30.js";import{i as a,s as n,y as o}from"./lit-element-79bc2e0e.js";import{e as s}from"./property-03f59dce.js";import{t as i}from"./state-70f38ceb.js";import{i as r}from"./query-2d22378e.js";import{c as l}from"./repeat-e7acc0bd.js";import{o as d}from"./tinykeys.module-84e6cc41.js";import"./Button.js";import"./VisuallyHidden.js";import c from"./Icon.js";import{E as h}from"./EventController-d99ebeef.js";import{D as u}from"./DirectionController-8b298382.js";import{LocalizeController as p}from"./LocalizeController.js";import{r as v}from"./number-c3ab3e95.js";import{i as m,p as f,a as g,s as y,e as b,b as x,g as w,c as D,d as k,f as z,h as F,j as M,k as S,l as Y}from"./dates-a8de5b83.js";import{o as $}from"./observe-a9c6dfb6.js";import{monthView as j}from"./month-view.js";import{DateSelectEvent as C}from"./DateSelectEvent.js";import{s as L}from"./Component-49a41387.js";var N=Object.freeze({__proto__:null,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>',title:"arrow-right-small",tags:"nordicon arrow right small caret pointing triangle chevron"});var T=Object.freeze({__proto__:null,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>',title:"arrow-left-small",tags:"nordicon arrow left small caret pointing triangle chevron"});var O=Object.freeze({__proto__:null,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>',title:"arrow-down-small",tags:"nordicon arrow down small caret pointing triangle chevron"});const _=e=>e.preventDefault();class I{constructor(e,t){this.hadFirstUpdate=!1,this.initialTouchX=0,this.initialTouchY=0,this.handleTouchStart=e=>{const[{pageX:t,pageY:a}]=e.changedTouches;this.initialTouchX=t,this.initialTouchY=a},this.handleTouchEnd=e=>{const[{pageX:t,pageY:a}]=e.changedTouches,{matchesGesture:n,onSwipeEnd:o}=this.options,s=t-this.initialTouchX,i=a-this.initialTouchY,r={initialX:this.initialTouchX,initialY:this.initialTouchY,pageX:t,pageY:a,distX:s,distY:i};n(r)&&(e.preventDefault(),o(r))},e.addController(this),this.events=new h(e),this.options={target:()=>e,...t}}hostUpdated(){if(!this.hadFirstUpdate){this.hadFirstUpdate=!0;const e=this.options.target();this.events.listen(e,"touchstart",this.handleTouchStart),this.events.listen(e,"touchmove",_),this.events.listen(e,"touchend",this.handleTouchEnd)}}hostDisconnected(){this.hadFirstUpdate=!1}}const X=({distX:e,distY:t})=>Math.abs(e)>=70&&Math.abs(t)<=70,A=({distX:e,distY:t})=>Math.abs(t)>=70&&Math.abs(e)<=70&&t>0,E=a`:host{font-feature-settings:var(--n-font-features-reduced)}.n-calendar{-webkit-user-select:none;user-select:none;background:var(--n-color-surface);box-shadow:var(--n-calendar-box-shadow,var(--n-box-shadow-popout));border-radius:var(--n-border-radius-s);max-inline-size:310px;min-inline-size:290px;padding:var(--n-calendar-padding,16px 16px 20px)}:host([expand]) .n-calendar{max-inline-size:100%;inline-size:100%}@media (max-width:35.9375em){.n-calendar{max-inline-size:100%}}.n-calendar-table{border-collapse:collapse;border-spacing:0;color:var(--n-color-text);font-size:var(--n-font-size-m);font-weight:var(--n-font-weight);line-height:var(--n-date-picker-line-height);text-align:center;inline-size:100%}.n-calendar-table-header{font-size:var(--n-font-size-s);font-weight:var(--n-font-weight-active);letter-spacing:1px;line-height:var(--n-date-picker-line-height);padding-block-end:8px;text-decoration:none;text-transform:uppercase}.n-calendar-cell{text-align:center}.n-calendar-day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:0 0;border:0;border-radius:var(--n-border-radius-s);color:var(--n-color-text);cursor:pointer;display:inline-block;font-family:var(--n-font-family);font-size:var(--n-font-size-m);font-variant-numeric:tabular-nums;font-weight:var(--n-font-weight);block-size:36px;padding:0 0 1px;position:relative;text-align:center;vertical-align:middle;inline-size:36px}.n-calendar-day[aria-current=date]{box-shadow:0 0 0 1px var(--n-color-accent);color:var(--n-color-text-link);position:relative}.n-calendar-day:hover{background:var(--n-color-active)}.n-calendar-day:focus,.n-calendar-day[aria-pressed=true]{background:var(--n-color-accent);box-shadow:none;color:var(--n-color-text-on-accent);outline:0}.n-calendar-day:active{background:var(--n-color-accent);box-shadow:none!important;color:var(--n-color-text-on-accent)}.n-calendar-day:focus{box-shadow:0 0 5px var(--n-color-accent)}.n-calendar-day:not(.is-month){box-shadow:none}.n-calendar-day:not(.is-month),.n-calendar-day[aria-disabled=true]{background:0 0;color:var(--n-color-text-weakest);cursor:default}.n-calendar-day[aria-disabled=true]{color:var(--n-color-text-weaker);text-decoration:line-through}.n-calendar-day:not(.is-month)[aria-disabled=true]{color:var(--n-color-text-weakest);text-decoration:none}.n-calendar-day[aria-disabled=true][aria-current=date]{box-shadow:0 0 0 1px var(--n-color-accent);color:var(--n-color-text-link)}.n-calendar-day[aria-disabled=true][aria-current=date]:focus{box-shadow:0 0 5px var(--n-color-accent);background:var(--n-color-accent);color:var(--n-color-text-on-accent)}.n-calendar-day[aria-disabled=true]:not([aria-current=date])::before{display:none}.n-calendar-day.is-outside{background:0 0;box-shadow:none;color:var(--n-color-text-weakest);cursor:default;pointer-events:none}.n-calendar-day.is-outside::before{display:none}.n-calendar-header{align-items:start;display:flex;justify-content:space-between;margin-block-end:16px;inline-size:100%}.n-calendar-nav{white-space:nowrap}.n-calendar-nav nord-button{--n-button-padding-x:11px;margin-inline-start:calc(var(--n-space-s)/ 2)}.n-calendar-select{display:inline-flex;margin-block-start:4px;position:relative;line-height:var(--n-line-height)}.n-calendar-select span{margin-inline-end:var(--n-space-s)}.n-calendar-select select{cursor:pointer;font-size:var(--n-font-size-l);block-size:100%;inset-inline-start:0;opacity:0;position:absolute;inset-block-start:0;inline-size:100%}.n-calendar-select select:focus+.n-calendar-select-label{box-shadow:0 0 0 2px var(--n-color-accent)}.n-calendar-select-label{align-items:center;border-radius:var(--n-border-radius-s);color:var(--n-color-text);display:flex;font-size:var(--n-font-size-xl);font-weight:var(--n-font-weight-active);line-height:var(--n-date-picker-line-height);padding:0 4px 0 8px;pointer-events:none;position:relative;inline-size:100%;text-transform:capitalize}`;c.registerIcon(N),c.registerIcon(T),c.registerIcon(O);const W=e=>t=>{t.preventDefault(),e(t)},U=()=>!1;let B=class extends n{constructor(){super(...arguments),this.dialogLabelId="dialog-header",this.direction=new u(this),this.swipe=new I(this,{matchesGesture:X,onSwipeEnd:({distX:e})=>this.addMonths(e<0?1:-1)}),this.shortcuts=d({ArrowRight:W((()=>this.addDays(this.direction.isLTR?1:-1))),ArrowLeft:W((()=>this.addDays(this.direction.isLTR?-1:1))),ArrowDown:W((()=>this.addDays(7))),ArrowUp:W((()=>this.addDays(-7))),Home:W((()=>this.startOfWeek())),End:W((()=>this.endOfWeek())),PageUp:W((()=>this.addMonths(-1))),PageDown:W((()=>this.addMonths(1))),"Shift+PageUp":W((()=>this.addYears(-1))),"Shift+PageDown":W((()=>this.addYears(1)))}),this.localize=new p(this,{onLangChange:()=>this.handleLangChange()}),this.value="",this.firstDayOfWeek=1,this.min="",this.max="",this.expand=!1,this.isDateDisabled=U,this.activeFocus=!1,this.focusedDay=new Date,this.handleDaySelect=e=>{const t=m(e,f(this.min),f(this.max)),a=!this.isDateDisabled(e);t&&a&&(this.value=g(e),this.dispatchEvent(new C("change",e)))},this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))},this.handleNextMonthClick=e=>{e.preventDefault(),this.addMonths(1)},this.handlePreviousMonthClick=e=>{e.preventDefault(),this.addMonths(-1)},this.enableActiveFocus=()=>{this.activeFocus=!0},this.disableActiveFocus=()=>{this.activeFocus=!1}}focus(e){var t;const a=null!==(t=null==e?void 0:e.target)&&void 0!==t?t:"day";"day"===a?this.focusedDayNode.focus():"month"===a&&this.monthSelectNode.focus()}render(){const e=f(this.value),t=this.focusedDay.getMonth(),a=this.focusedDay.getFullYear(),n=f(this.min),s=f(this.max),i=n?y(n):void 0,r=s?b(s):void 0,d=(e||this.focusedDay).getFullYear(),c=n?n.getFullYear():d-10,h=s?s.getFullYear():d+10;return o`<div class="n-calendar"><div class="n-calendar-header"><div><nord-visually-hidden><h2 id="${this.dialogLabelId}" aria-live="polite" aria-atomic="true">${this.monthNames[t]}, ${this.focusedDay.getFullYear()}</h2></nord-visually-hidden><div class="n-calendar-select"><select aria-label="${this.localize.term("monthSelectLabel")}" class="n-calendar-select-month" @input="${this.handleMonthSelect}">${this.monthNames.map(((e,n)=>o`<option value="${n}" ?selected="${n===t}" ?disabled="${!m(new Date(a,n,1),i,r)}">${e}</option>`))}</select><div class="n-calendar-select-label" aria-hidden="true"><span>${this.monthNamesShort[t]}</span><nord-icon color="var(--n-color-icon)" name="arrow-down-small" size="xs"></nord-icon></div></div><div class="n-calendar-select"><select aria-label="${this.localize.term("yearSelectLabel")}" class="n-calendar-select-year" @input="${this.handleYearSelect}">${l(v(c,h),(e=>e),(e=>o`<option ?selected="${e===a}">${e}</option>`))}</select><div class="n-calendar-select-label" aria-hidden="true"><span>${this.focusedDay.getFullYear()}</span><nord-icon color="var(--n-color-icon)" name="arrow-down-small" size="xs"></nord-icon></div></div></div><div class="n-calendar-nav"><nord-button class="n-calendar-prev" @click="${this.handlePreviousMonthClick}" ?disabled="${x(n,this.focusedDay)}" type="button"><nord-visually-hidden>${this.localize.term("prevMonthLabel")}</nord-visually-hidden><nord-icon color="var(--n-color-icon)" name="${this.direction.isLTR?"arrow-left-small":"arrow-right-small"}" size="s"></nord-icon></nord-button><nord-button class="n-calendar-next" @click="${this.handleNextMonthClick}" ?disabled="${x(s,this.focusedDay)}" type="button"><nord-visually-hidden>${this.localize.term("nextMonthLabel")}</nord-visually-hidden><nord-icon color="var(--n-color-icon)" name="${this.direction.isLTR?"arrow-right-small":"arrow-left-small"}" size="s"></nord-icon></nord-button></div></div>${j({onFocusOut:this.disableActiveFocus,onFocusIn:this.enableActiveFocus,dateFormatter:this.dateFormatShort,selectedDate:e,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.shortcuts,labelledById:this.dialogLabelId,dayNames:this.dayNames,dayNamesShort:this.dayNamesShort,firstDayOfWeek:this.firstDayOfWeek,min:n,max:s,isDateDisabled:this.isDateDisabled})}</div>`}handleValueChange(){this.setFocusedDay(f(this.value)||new Date)}handleFocusedDayChange(){this.activeFocus&&this.focusedDayNode.focus()}handleLangChange(){const e=this.localize.resolvedLang;this.dateFormatShort=new Intl.DateTimeFormat(e,{day:"numeric",month:"long"}),this.monthNames=w(e,"long"),this.monthNamesShort=w(e,"short"),this.dayNames=D(e,"long"),this.dayNamesShort=D(e,"narrow")}addDays(e){this.setFocusedDay(k(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(z(this.focusedDay,this.firstDayOfWeek))}endOfWeek(){this.setFocusedDay(F(this.focusedDay,this.firstDayOfWeek))}setMonth(e){const t=M(y(this.focusedDay),e),a=b(t),n=M(this.focusedDay,e);this.setFocusedDay(S(n,t,a))}setYear(e){const t=Y(y(this.focusedDay),e),a=b(t),n=Y(this.focusedDay,e);this.setFocusedDay(S(n,t,a))}setFocusedDay(e){this.focusedDay=S(e,f(this.min),f(this.max)),this.dispatchEvent(new C("nord-focus-date",this.focusedDay))}};B.styles=[L,E],e([r(".n-calendar-select-month",!0)],B.prototype,"monthSelectNode",void 0),e([r('button[tabindex="0"]')],B.prototype,"focusedDayNode",void 0),e([s()],B.prototype,"value",void 0),e([s({type:Number})],B.prototype,"firstDayOfWeek",void 0),e([s()],B.prototype,"min",void 0),e([s()],B.prototype,"max",void 0),e([s({reflect:!0,type:Boolean})],B.prototype,"expand",void 0),e([s({attribute:!1})],B.prototype,"isDateDisabled",void 0),e([i()],B.prototype,"activeFocus",void 0),e([i()],B.prototype,"focusedDay",void 0),e([$("value")],B.prototype,"handleValueChange",null),e([$("focusedDay","updated")],B.prototype,"handleFocusedDayChange",null),B=e([t("nord-calendar")],B);var P=B;export{P as C,I as S,A as i};
|
|
2
|
-
//# sourceMappingURL=Calendar-df35e1cd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar-df35e1cd.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 { 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\"\n\nimport { range } from \"../common/number.js\"\nimport {\n addDays,\n clamp,\n DaysOfWeek,\n endOfMonth,\n endOfWeek,\n getDayNames,\n getMonthNames,\n inRange,\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 { monthView } from \"./month-view.js\"\nimport { DateSelectEvent } from \"./DateSelectEvent.js\"\nimport componentStyle from \"../common/styles/Component.css\"\nimport style from \"./Calendar.css\"\n\nexport type DateDisabledPredicate = (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: DateDisabledPredicate = () => false\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@customElement(\"nord-calendar\")\nexport default class Calendar extends LitElement {\n static styles = [componentStyle, style]\n\n private dialogLabelId = \"dialog-header\"\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: DateDisabledPredicate = isDateDisabled\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 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=${this.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=\"xs\"></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=\"xs\"></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\n color=\"var(--n-color-icon)\"\n name=${this.direction.isLTR ? \"arrow-left-small\" : \"arrow-right-small\"}\n size=\"s\"\n ></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\n color=\"var(--n-color-icon)\"\n name=${this.direction.isLTR ? \"arrow-right-small\" : \"arrow-left-small\"}\n size=\"s\"\n ></nord-icon>\n </nord-button>\n </div>\n </div>\n\n ${monthView({\n onFocusOut: this.disableActiveFocus,\n onFocusIn: this.enableActiveFocus,\n dateFormatter: this.dateFormatShort,\n selectedDate: valueAsDate,\n focusedDate: this.focusedDay,\n onDateSelect: this.handleDaySelect,\n onKeyboardNavigation: this.shortcuts,\n labelledById: this.dialogLabelId,\n dayNames: this.dayNames,\n dayNamesShort: this.dayNamesShort,\n firstDayOfWeek: this.firstDayOfWeek,\n min: minDate,\n max: maxDate,\n isDateDisabled: this.isDateDisabled,\n })}\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: any) => {\n this.setMonth(parseInt(e.target.value, 10))\n }\n\n private handleYearSelect = (e: any) => {\n this.setYear(parseInt(e.target.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 = () => {\n this.activeFocus = false\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","Calendar","LitElement","dialogLabelId","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","focus","_a","focusedDayNode","monthSelectNode","render","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","monthView","onFocusOut","onFocusIn","dateFormatter","dateFormatShort","selectedDate","focusedDate","onDateSelect","onKeyboardNavigation","labelledById","dayNames","dayNamesShort","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":"k9BAAe,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,KAAKkB,OAAOI,OAAOF,EAAQ,WAAYpB,KAAKS,eAC7C,CACF,CAEDc,mBACEvB,KAAKC,gBAAiB,CACvB,EAuBH,MAEauB,EAAoB,EAAGZ,QAAOC,WACzCY,KAAKC,IAAId,IAHO,IAGgBa,KAAKC,IAAIb,IAHzB,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AIC,EAAgB,kBAAmB7E,KAAKmE,YAChE,GA5RMhC,EAAA6G,OAAS,CAACC,EAAgBC,GAIQC,EAAA,CAAxCC,EAAM,4BAA4B,IAA2CjH,EAAAkH,UAAA,uBAAA,GAC/CF,EAAA,CAA9BC,EAAM,yBAAkEjH,EAAAkH,UAAA,sBAAA,GA0C7DF,EAAA,CAAXG,KAA6BnH,EAAAkH,UAAA,aAAA,GAMFF,EAAA,CAA3BG,EAAS,CAAEC,KAAMC,UAAwDrH,EAAAkH,UAAA,sBAAA,GAM9DF,EAAA,CAAXG,KAA2BnH,EAAAkH,UAAA,WAAA,GAMhBF,EAAA,CAAXG,KAA2BnH,EAAAkH,UAAA,WAAA,GAKgBF,EAAA,CAA3CG,EAAS,CAAEG,SAAS,EAAMF,KAAMG,WAAyBvH,EAAAkH,UAAA,cAAA,GAM1BF,EAAA,CAA/BG,EAAS,CAAEK,WAAW,KAA+DxH,EAAAkH,UAAA,sBAAA,GAE7EF,EAAA,CAARS,KAAmCzH,EAAAkH,UAAA,mBAAA,GAC3BF,EAAA,CAARS,KAAuCzH,EAAAkH,UAAA,kBAAA,GAwIxCF,EAAA,CADCU,EAAQ,UAGR1H,EAAAkH,UAAA,oBAAA,MAGDF,EAAA,CADCU,EAAQ,aAAc,YAKtB1H,EAAAkH,UAAA,yBAAA,MAjOkBlH,EAAQgH,EAAA,CAD5BW,EAAc,kBACM3H,SAAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function n(n){class e extends n{connectedCallback(){super.connectedCallback(),e._warningLogged||(console.warn(`NORD: %c${this.localName}%c should not be used in production, as it is in draft status.`,"font-weight:bold","font-weight:normal"),e._warningLogged=!0)}}return e._warningLogged=!1,e}export{n as D};
|
|
2
|
-
//# sourceMappingURL=DraftComponentMixin-9e4b7b34.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DraftComponentMixin-9e4b7b34.js","sources":["../src/common/mixins/DraftComponentMixin.ts"],"sourcesContent":["import { LitElement } from \"lit\"\n\ntype Constructable<T = Record<string, unknown>> = new (...args: any[]) => T\n\nexport function DraftComponentMixin<T extends Constructable<LitElement>>(superClass: T) {\n class DraftComponent extends superClass {\n private static _warningLogged = false\n\n connectedCallback() {\n super.connectedCallback()\n\n if (process.env.NODE_ENV !== \"development\" && !DraftComponent._warningLogged) {\n // eslint-disable-next-line no-console\n console.warn(\n `NORD: %c${this.localName}%c should not be used in production, as it is in draft status.`,\n \"font-weight:bold\",\n \"font-weight:normal\"\n )\n DraftComponent._warningLogged = true\n }\n }\n }\n\n return DraftComponent as T\n}\n"],"names":["DraftComponentMixin","superClass","DraftComponent","connectedCallback","super","_warningLogged","console","warn","this","localName"],"mappings":"AAIM,SAAUA,EAAyDC,GACvE,MAAMC,UAAuBD,EAG3BE,oBACEC,MAAMD,oBAEyCD,EAAeG,iBAE5DC,QAAQC,KACN,WAAWC,KAAKC,0EAChB,mBACA,sBAEFP,EAAeG,gBAAiB,EAEnC,EAGH,OAjBiBH,EAAcG,gBAAG,EAiB3BH,CACT"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as n}from"./query-assigned-elements-e6cbac30.js";import{e as r}from"./property-03f59dce.js";import{i as o}from"./lit-element-79bc2e0e.js";function e(o){class e extends o{constructor(){super(...arguments),this.readonly=!1}}return n([r({type:Boolean,reflect:!0})],e.prototype,"readonly",void 0),e}const t=o`.n-input-container{position:relative;inline-size:var(--n-input-width,240px)}.n-input{background:var(--n-input-backgroud,var(--n-color-active));color:var(--n-input-color,var(--n-color-text));padding-block-start:calc(var(--n-space-s) - 1px);padding-block-end:calc(var(--n-space-s) - 1px);padding-inline-start:calc(var(--n-space-s) * 1.6);padding-inline-end:calc(var(--n-space-s) * 1.6);border-radius:var(--n-border-radius-s);border:1px solid var(--n-input-border-color,var(--n-color-border-strong));font-family:var(--n-font-family);font-size:var(--n-font-size-m);line-height:var(--n-line-height-form);inline-size:100%;transition:border var(--n-transition-slowly),box-shadow var(--n-transition-slowly),background var(--n-transition-slowly)}@media (max-width:480px){.n-input{font-size:var(--n-font-size-l)}}:host([expand]){--n-input-width:100%;inline-size:100%}.n-input:hover,.n-label-container:hover+.n-input-container .n-input{--n-input-border-color:var(--n-color-border-hover)}.n-input:focus{--n-input-border-color:var(--n-color-accent);--n-input-background:var(--n-color-surface);outline:0;box-shadow:0 0 0 1px var(--n-input-border-color)}.n-input::placeholder{color:var(--n-color-text-weakest)}.n-input:disabled,.n-label-container:hover+.n-input-container .n-input:disabled{--n-input-border-color:var(--n-color-active);--n-input-color:var(--n-color-text-weakest)}.n-input[aria-invalid=true]{--n-input-border-color:var(--n-color-status-danger)!important}.n-input[readonly],.n-label-container:hover+.n-input-container .n-input[readonly]{--n-input-border-color:var(--n-color-active);--n-input-color:var(--n-color-text-weak)}.n-input[readonly]:focus{--n-input-border-color:var(--n-color-accent)}`;export{e as R,t as s};
|
|
2
|
-
//# sourceMappingURL=TextField-c34519d4.js.map
|