@nordhealth/components 5.0.0-alpha.0 → 5.0.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 +26353 -25540
- package/lib/Accordion.js.map +1 -1
- package/lib/AccordionHeader.js.map +1 -1
- package/lib/AccordionItem.js.map +1 -1
- package/lib/AccordionPanel.js.map +1 -1
- package/lib/AccordionTrigger.js +1 -1
- package/lib/AccordionTrigger.js.map +1 -1
- package/lib/Aside.js.map +1 -1
- package/lib/AsideDrawer.js.map +1 -1
- package/lib/Autocomplete.js +1 -1
- package/lib/Autocomplete.js.map +1 -1
- package/lib/Avatar.js.map +1 -1
- package/lib/Button.js +1 -1
- package/lib/Button.js.map +1 -1
- package/lib/Calendar-D47b20IT.js +2 -0
- package/lib/Calendar-D47b20IT.js.map +1 -0
- package/lib/Calendar.js +1 -1
- package/lib/Card.js.map +1 -1
- package/lib/Collapsible.js.map +1 -1
- package/lib/CollapsiblePanel.js.map +1 -1
- package/lib/CollapsibleTrigger.js.map +1 -1
- package/lib/Combobox-DBxXlbY7.js +2 -0
- package/lib/Combobox-DBxXlbY7.js.map +1 -0
- package/lib/Combobox.js +1 -1
- package/lib/Combobox.js.map +1 -1
- package/lib/ComboboxBase.js +1 -1
- package/lib/ComboboxBase.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/DateRangePicker.js +1 -1
- package/lib/DateRangePicker.js.map +1 -1
- package/lib/Divider.js.map +1 -1
- package/lib/Drawer.js.map +1 -1
- package/lib/Dropdown.js +1 -1
- package/lib/Dropdown.js.map +1 -1
- package/lib/DropdownSubmenu.js +1 -1
- package/lib/DropdownSubmenu.js.map +1 -1
- package/lib/FilterAddButton.js +1 -1
- package/lib/FilterAddButton.js.map +1 -1
- package/lib/FilterDateRange.js +1 -1
- package/lib/FilterDateRange.js.map +1 -1
- package/lib/FilterDropdown.js +1 -1
- package/lib/FilterDropdown.js.map +1 -1
- package/lib/FilterField.js +1 -1
- package/lib/FilterField.js.map +1 -1
- package/lib/FilterInput.js +1 -1
- package/lib/FilterInput.js.map +1 -1
- package/lib/FilterResetButton.js +1 -1
- package/lib/FilterResetButton.js.map +1 -1
- package/lib/Footer.js.map +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/Icon.js.map +1 -1
- package/lib/Item.js +1 -1
- package/lib/Item.js.map +1 -1
- package/lib/Kbd.js.map +1 -1
- package/lib/KbdGroup.js.map +1 -1
- package/lib/KeyboardController.js +1 -1
- package/lib/KeyboardController.js.map +1 -1
- package/lib/Layout.js +1 -1
- package/lib/Layout.js.map +1 -1
- package/lib/{LightDismissController-4pH8cdko.js → LightDismissController-wcL1ziJa.js} +2 -2
- package/lib/{LightDismissController-4pH8cdko.js.map → LightDismissController-wcL1ziJa.js.map} +1 -1
- package/lib/LocalizeController.js +1 -1
- package/lib/LocalizeController.js.map +1 -1
- package/lib/Message.js +1 -1
- package/lib/Message.js.map +1 -1
- package/lib/Meter.js +1 -1
- package/lib/Meter.js.map +1 -1
- package/lib/Modal.js +1 -1
- package/lib/Modal.js.map +1 -1
- package/lib/ModalController.js +1 -1
- package/lib/ModalController.js.map +1 -1
- package/lib/NavGroup.js +1 -1
- package/lib/NavGroup.js.map +1 -1
- package/lib/NavItem.js +1 -1
- package/lib/NavItem.js.map +1 -1
- package/lib/NavToggle-ROsuaJkW.js +2 -0
- package/lib/{NavToggle-BY83xpx0.js.map → NavToggle-ROsuaJkW.js.map} +1 -1
- package/lib/NavToggle.js +1 -1
- package/lib/Notification.js +1 -1
- package/lib/Notification.js.map +1 -1
- package/lib/NumberField.js +1 -1
- package/lib/NumberField.js.map +1 -1
- package/lib/OtpField.js +1 -1
- package/lib/OtpField.js.map +1 -1
- package/lib/Outline.js +2 -0
- package/lib/Outline.js.map +1 -0
- package/lib/OutlineItem.js +2 -0
- package/lib/OutlineItem.js.map +1 -0
- package/lib/Pagination.js +1 -1
- package/lib/Pagination.js.map +1 -1
- package/lib/Popout-B6Hirj3y.js +2 -0
- package/lib/{Popout-DpN7PP9h.js.map → Popout-B6Hirj3y.js.map} +1 -1
- package/lib/Popout.js +1 -1
- package/lib/Qrcode.js.map +1 -1
- package/lib/ScrollArea.js.map +1 -1
- package/lib/ShortcutController-CV5b0BZl.js +2 -0
- package/lib/ShortcutController-CV5b0BZl.js.map +1 -0
- package/lib/Stack.js.map +1 -1
- package/lib/Tag.js +1 -1
- package/lib/Tag.js.map +1 -1
- package/lib/TagGroup.js.map +1 -1
- package/lib/Textarea.js +1 -1
- package/lib/Textarea.js.map +1 -1
- package/lib/TimePicker.js +1 -1
- package/lib/TimePicker.js.map +1 -1
- package/lib/TopBar.js.map +1 -1
- package/lib/Truncate.js.map +1 -1
- package/lib/VisuallyHidden.js.map +1 -1
- package/lib/bundle.js +13 -13
- package/lib/bundle.js.map +1 -1
- package/lib/en-us.js +1 -1
- package/lib/en-us.js.map +1 -1
- package/lib/fi-fi.js +1 -1
- package/lib/fi-fi.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/localization13.js +1 -1
- package/lib/localization13.js.map +1 -1
- package/lib/localization14.js +1 -1
- package/lib/localization14.js.map +1 -1
- package/lib/localization15.js +1 -1
- package/lib/localization15.js.map +1 -1
- package/lib/localization16.js +1 -1
- package/lib/localization16.js.map +1 -1
- package/lib/localization17.js +1 -1
- package/lib/localization17.js.map +1 -1
- package/lib/localization18.js +1 -1
- package/lib/localization18.js.map +1 -1
- package/lib/localization19.js +1 -1
- package/lib/localization19.js.map +1 -1
- package/lib/localization20.js +1 -1
- package/lib/localization20.js.map +1 -1
- package/lib/localization21.js +1 -1
- package/lib/localization21.js.map +1 -1
- package/lib/localization22.js +1 -1
- package/lib/localization22.js.map +1 -1
- package/lib/localization23.js +2 -0
- package/lib/localization23.js.map +1 -0
- package/lib/localization24.js +2 -0
- package/lib/localization24.js.map +1 -0
- package/lib/nav-context.js +2 -0
- package/lib/nav-context.js.map +1 -0
- package/lib/react.d.ts +15 -0
- package/lib/src/accordion/Accordion.d.ts +1 -1
- package/lib/src/accordion/AccordionHeader.d.ts +1 -1
- package/lib/src/accordion/AccordionItem.d.ts +1 -1
- package/lib/src/accordion/AccordionPanel.d.ts +1 -1
- package/lib/src/accordion/AccordionTrigger.d.ts +4 -3
- package/lib/src/aside/Aside.d.ts +1 -1
- package/lib/src/aside-drawer/AsideDrawer.d.ts +1 -1
- package/lib/src/autocomplete/Autocomplete.d.ts +4 -4
- package/lib/src/avatar/Avatar.d.ts +1 -1
- package/lib/src/button/Button.d.ts +1 -0
- package/lib/src/calendar/Calendar.d.ts +1 -1
- package/lib/src/card/Card.d.ts +1 -1
- package/lib/src/collapsible/Collapsible.d.ts +1 -1
- package/lib/src/collapsible/CollapsiblePanel.d.ts +1 -1
- package/lib/src/collapsible/CollapsibleTrigger.d.ts +1 -1
- package/lib/src/combobox/ComboboxBase.d.ts +7 -7
- package/lib/src/common/controllers/ShortcutController.d.ts +5 -5
- package/lib/src/divider/Divider.d.ts +1 -1
- package/lib/src/drawer/Drawer.d.ts +1 -1
- package/lib/src/dropdown/Dropdown.d.ts +3 -0
- package/lib/src/footer/Footer.d.ts +1 -1
- package/lib/src/header/Header.d.ts +1 -1
- package/lib/src/icon/Icon.d.ts +1 -1
- package/lib/src/index.d.ts +2 -0
- package/lib/src/kbd/Kbd.d.ts +1 -1
- package/lib/src/kbd/KbdGroup.d.ts +1 -1
- package/lib/src/layout/Layout.d.ts +13 -1
- package/lib/src/layout/localization.d.ts +5 -0
- package/lib/src/localization/en-us.d.ts +7 -0
- package/lib/src/localization/translation.d.ts +7 -0
- package/lib/src/nav-group/NavGroup.d.ts +1 -0
- package/lib/src/nav-group/nav-context.d.ts +11 -0
- package/lib/src/nav-item/NavItem.d.ts +23 -0
- package/lib/src/otp-field/OtpField.d.ts +11 -0
- package/lib/src/outline/Outline.d.ts +111 -0
- package/lib/src/outline/OutlineItem.d.ts +42 -0
- package/lib/src/outline/localization.d.ts +4 -0
- package/lib/src/qrcode/Qrcode.d.ts +1 -1
- package/lib/src/scroll-area/ScrollArea.d.ts +1 -1
- package/lib/src/stack/Stack.d.ts +1 -1
- package/lib/src/tag/Tag.d.ts +1 -1
- package/lib/src/tag-group/TagGroup.d.ts +1 -1
- package/lib/src/top-bar/TopBar.d.ts +1 -1
- package/lib/src/truncate/Truncate.d.ts +1 -1
- package/lib/src/visually-hidden/VisuallyHidden.d.ts +1 -1
- package/lib/tinykeys-DwvDXsEb.js +2 -0
- package/lib/tinykeys-DwvDXsEb.js.map +1 -0
- package/lib/translation.js +1 -1
- package/lib/translation.js.map +1 -1
- package/lib/vue.d.ts +11 -0
- package/package.json +5 -5
- package/lib/Calendar-C1SxrlzN.js +0 -2
- package/lib/Calendar-C1SxrlzN.js.map +0 -1
- package/lib/Combobox-By4h1Sp-.js +0 -2
- package/lib/Combobox-By4h1Sp-.js.map +0 -1
- package/lib/NavToggle-BY83xpx0.js +0 -2
- package/lib/Popout-DpN7PP9h.js +0 -2
- package/lib/ShortcutController-BIb3WGzH.js +0 -2
- package/lib/ShortcutController-BIb3WGzH.js.map +0 -1
- package/lib/tinykeys.module-_6MZt7MP.js +0 -2
- package/lib/tinykeys.module-_6MZt7MP.js.map +0 -1
|
@@ -5,7 +5,7 @@ import '../footer/Footer.js';
|
|
|
5
5
|
* Drawer doesn’t block users from completing their task, like a modal would.
|
|
6
6
|
*
|
|
7
7
|
* @status new
|
|
8
|
-
* @category
|
|
8
|
+
* @category layout
|
|
9
9
|
* @slot header - Optional slot that holds a header for the drawer.
|
|
10
10
|
* @slot - Default slot.
|
|
11
11
|
* @slot footer - Optional slot that holds footer content for the drawer.
|
|
@@ -53,6 +53,9 @@ export default class Dropdown extends Dropdown_base {
|
|
|
53
53
|
get deepestSubmenu(): DropdownSubmenu | undefined;
|
|
54
54
|
/**
|
|
55
55
|
* Controls whether the toggle slot expands to fill the width of its container.
|
|
56
|
+
* Note that this only stretches the slot itself — the slotted toggle must
|
|
57
|
+
* also expand to fill it, e.g. a `<nord-button slot="toggle">` needs its own
|
|
58
|
+
* `expand` attribute as well.
|
|
56
59
|
*/
|
|
57
60
|
expand: boolean;
|
|
58
61
|
/**
|
|
@@ -3,7 +3,7 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
* The footer is a block of designated space for providing additional information or actions that are positioned below the main content.
|
|
4
4
|
*
|
|
5
5
|
* @status new
|
|
6
|
-
* @category
|
|
6
|
+
* @category layout
|
|
7
7
|
* @slot - The footer content.
|
|
8
8
|
*
|
|
9
9
|
* @cssprop [--n-footer-padding-inline=var(--n-space-l)] - Controls the inline padding around the footer’s main slot, using [spacing tokens](/tokens/#space).
|
package/lib/src/icon/Icon.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { LitElement } from 'lit';
|
|
|
5
5
|
* Icon component allows you to display an icon from the Nordicons library.
|
|
6
6
|
*
|
|
7
7
|
* @status ready
|
|
8
|
-
* @category
|
|
8
|
+
* @category content
|
|
9
9
|
* @slot - The default slot used for placing a custom SVG icon.
|
|
10
10
|
*/
|
|
11
11
|
export default class Icon extends LitElement {
|
package/lib/src/index.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export { default as Notification } from './notification/Notification.js';
|
|
|
86
86
|
export { getCurrencySymbol, resolveCurrencyPlacement } from './number-field/currency.js';
|
|
87
87
|
export { default as NumberField, NumberFieldChangeEvent } from './number-field/NumberField.js';
|
|
88
88
|
export { default as OtpField, OtpFieldCompleteEvent, OtpFieldInvalidEvent } from './otp-field/OtpField.js';
|
|
89
|
+
export { NordOutlineChangeEvent, default as Outline } from './outline/Outline.js';
|
|
90
|
+
export { default as OutlineItem } from './outline/OutlineItem.js';
|
|
89
91
|
export { ELLIPSIS, paginate, type PaginationToken } from './pagination/paginate.js';
|
|
90
92
|
export { default as Pagination } from './pagination/Pagination.js';
|
|
91
93
|
export { default as PaginationContent } from './pagination/PaginationContent.js';
|
package/lib/src/kbd/Kbd.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const Kbd_base: typeof LitElement;
|
|
|
5
5
|
* should press. Group related keys together with [Kbd Group](/components/kbd-group/).
|
|
6
6
|
*
|
|
7
7
|
* @status draft
|
|
8
|
-
* @category
|
|
8
|
+
* @category content
|
|
9
9
|
* @lightDom true
|
|
10
10
|
*
|
|
11
11
|
* @slot - Default slot for the key label (text or an icon).
|
|
@@ -5,7 +5,7 @@ declare const KbdGroup_base: typeof LitElement;
|
|
|
5
5
|
* to represent a multi-key shortcut such as <kbd>Ctrl</kbd> <kbd>K</kbd>.
|
|
6
6
|
*
|
|
7
7
|
* @status draft
|
|
8
|
-
* @category
|
|
8
|
+
* @category content
|
|
9
9
|
* @lightDom true
|
|
10
10
|
*
|
|
11
11
|
* @slot - Default slot for [Kbd](/components/kbd/) elements.
|
|
@@ -11,7 +11,7 @@ type NavState = States<typeof navMachine>;
|
|
|
11
11
|
* currently comes with one main configuration: two-column.
|
|
12
12
|
*
|
|
13
13
|
* @status ready
|
|
14
|
-
* @category
|
|
14
|
+
* @category layout
|
|
15
15
|
* @slot - The default main section content.
|
|
16
16
|
* @slot nav - Used to place content inside the navigation sidebar.
|
|
17
17
|
* @slot top-bar - Used to place the [Top Bar](/components/top-bar/) component.
|
|
@@ -36,6 +36,9 @@ type NavState = States<typeof navMachine>;
|
|
|
36
36
|
* @cssprop [--n-layout-drawer-box-shadow-wide=var(--n-box-shadow-header)] - Controls the box-shadow applied to the drawer (aside) on wide viewports (≥1240px).
|
|
37
37
|
* @cssprop [--n-layout-drawer-border-inline-start-width=1px] - Controls the inline-start border width of the drawer on wide viewports.
|
|
38
38
|
* @cssprop [--n-layout-drawer-border-inline-start-color=var(--n-color-border)] - Controls the inline-start border color of the drawer on wide viewports.
|
|
39
|
+
*
|
|
40
|
+
* @localization resizeNavigation - Accessible label for the nav resize separator.
|
|
41
|
+
* @localization navigationCollapsed - Announced by the nav resize separator (`aria-valuetext`) while the navigation is collapsed.
|
|
39
42
|
*/
|
|
40
43
|
export default class Layout extends LitElement {
|
|
41
44
|
static styles: import("lit").CSSResult[];
|
|
@@ -49,6 +52,7 @@ export default class Layout extends LitElement {
|
|
|
49
52
|
private dividerTooltipSlot;
|
|
50
53
|
private direction;
|
|
51
54
|
private events;
|
|
55
|
+
private localization;
|
|
52
56
|
private lightDismiss;
|
|
53
57
|
private applyingRemote;
|
|
54
58
|
private broadcast;
|
|
@@ -174,6 +178,14 @@ export default class Layout extends LitElement {
|
|
|
174
178
|
private handleMouseEnter;
|
|
175
179
|
private handleMouseLeave;
|
|
176
180
|
private handleTransitionEnd;
|
|
181
|
+
/**
|
|
182
|
+
* `aria-valuenow` for the focusable resize separator (ARIA window splitter
|
|
183
|
+
* pattern): the current nav width in pixels, bounded by the `min-nav-width`
|
|
184
|
+
* / `max-nav-width` props exposed as `aria-valuemin` / `aria-valuemax`.
|
|
185
|
+
* While the nav is collapsed the value must stay within those bounds, so it
|
|
186
|
+
* reports the minimum and `aria-valuetext` announces the collapsed state.
|
|
187
|
+
*/
|
|
188
|
+
private get resizeValueNow();
|
|
177
189
|
private handleKeyboardResize;
|
|
178
190
|
private setNavWidth;
|
|
179
191
|
private dragStartX;
|
|
@@ -64,6 +64,10 @@ declare const en: {
|
|
|
64
64
|
presetCurrentYear: string;
|
|
65
65
|
presetQuarter: (quarter: number, year: number) => string;
|
|
66
66
|
};
|
|
67
|
+
'nord-layout': {
|
|
68
|
+
resizeNavigation: string;
|
|
69
|
+
navigationCollapsed: string;
|
|
70
|
+
};
|
|
67
71
|
'nord-modal': {
|
|
68
72
|
closeLabel: string;
|
|
69
73
|
};
|
|
@@ -90,6 +94,9 @@ declare const en: {
|
|
|
90
94
|
'nord-otp-field': {
|
|
91
95
|
characterLabel: (position: number, total: number) => string;
|
|
92
96
|
};
|
|
97
|
+
'nord-outline': {
|
|
98
|
+
label: string;
|
|
99
|
+
};
|
|
93
100
|
'nord-pagination': {
|
|
94
101
|
label: string;
|
|
95
102
|
};
|
|
@@ -107,6 +107,10 @@ export declare function resolveTranslation(langCode: string): {
|
|
|
107
107
|
presetCurrentYear: string;
|
|
108
108
|
presetQuarter: (quarter: number, year: number) => string;
|
|
109
109
|
};
|
|
110
|
+
'nord-layout': {
|
|
111
|
+
resizeNavigation: string;
|
|
112
|
+
navigationCollapsed: string;
|
|
113
|
+
};
|
|
110
114
|
'nord-modal': {
|
|
111
115
|
closeLabel: string;
|
|
112
116
|
};
|
|
@@ -133,6 +137,9 @@ export declare function resolveTranslation(langCode: string): {
|
|
|
133
137
|
'nord-otp-field': {
|
|
134
138
|
characterLabel: (position: number, total: number) => string;
|
|
135
139
|
};
|
|
140
|
+
'nord-outline': {
|
|
141
|
+
label: string;
|
|
142
|
+
};
|
|
136
143
|
'nord-pagination': {
|
|
137
144
|
label: string;
|
|
138
145
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signals to a [NavItem](/components/nav-item/) that it is rendered inside a
|
|
3
|
+
* [NavGroup](/components/nav-group/), which exposes `role="list"`. The nav-item
|
|
4
|
+
* consumes this to decide whether to emit `role="listitem"`: a `listitem`
|
|
5
|
+
* without a `list` ancestor is an accessibility violation
|
|
6
|
+
* (`aria-required-parent`), so standalone nav-items (e.g. directly in
|
|
7
|
+
* `nord-navigation` or used as a `nord-dropdown` toggle) omit the role instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare const navListContext: {
|
|
10
|
+
__context__: boolean;
|
|
11
|
+
};
|
|
@@ -72,6 +72,15 @@ export default class NavItem extends NavItem_base {
|
|
|
72
72
|
* @internal
|
|
73
73
|
*/
|
|
74
74
|
private railCollapsed;
|
|
75
|
+
/**
|
|
76
|
+
* Whether this item is inside a `nord-nav-group` (which exposes `role="list"`).
|
|
77
|
+
* Only then may it emit `role="listitem"` — a listitem without a list ancestor
|
|
78
|
+
* fails the `aria-required-parent` accessibility check. Standalone items (e.g.
|
|
79
|
+
* directly in `nord-navigation` or used as a `nord-dropdown` toggle) omit the role.
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
private inList;
|
|
83
|
+
private listConsumer;
|
|
75
84
|
/**
|
|
76
85
|
* Used for indicating the current page. This gives a prominent background to the nav item,
|
|
77
86
|
* and marks the item as the current page for assistive technology.
|
|
@@ -95,6 +104,20 @@ export default class NavItem extends NavItem_base {
|
|
|
95
104
|
* Note: this is only used if you have nested navigation using the "subnav" slot.
|
|
96
105
|
*/
|
|
97
106
|
open: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Distance in pixels between the rail-mode tooltip and the item, forwarded
|
|
109
|
+
* to the internal [Tooltip](/components/tooltip/)'s `side-offset` (the
|
|
110
|
+
* Floating UI `offset` main axis). When unset, the tooltip's own default
|
|
111
|
+
* (`8`) applies. Useful for lining up rail-item tooltips with neighbouring
|
|
112
|
+
* standalone tooltips.
|
|
113
|
+
*/
|
|
114
|
+
sideOffset?: number;
|
|
115
|
+
/**
|
|
116
|
+
* Offset in pixels along the alignment axis for the rail-mode tooltip,
|
|
117
|
+
* forwarded to the internal [Tooltip](/components/tooltip/)'s
|
|
118
|
+
* `align-offset`. When unset, the tooltip's own default (`0`) applies.
|
|
119
|
+
*/
|
|
120
|
+
alignOffset?: number;
|
|
98
121
|
/**
|
|
99
122
|
* @internal
|
|
100
123
|
*/
|
|
@@ -108,6 +108,17 @@ export default class OtpField extends OtpField_base {
|
|
|
108
108
|
*/
|
|
109
109
|
get value(): string;
|
|
110
110
|
set value(next: string);
|
|
111
|
+
/**
|
|
112
|
+
* Function that normalizes the value after whitespace and `type` filtering —
|
|
113
|
+
* e.g. `el.normalizeValue = v => v.toUpperCase()`. It runs whenever the field
|
|
114
|
+
* normalizes a value (initial, programmatic, and user edits), inside the
|
|
115
|
+
* component's own pipeline, so live normalization never fights the per-cell
|
|
116
|
+
* focus handling. The result is filtered by `type` again, then clamped to
|
|
117
|
+
* `length`; it should be idempotent since the same value may be normalized
|
|
118
|
+
* more than once. Characters rejected while normalizing are reported through
|
|
119
|
+
* `value-invalid`. Mirrors Base UI's `normalizeValue`.
|
|
120
|
+
*/
|
|
121
|
+
normalizeValue?: (value: string) => string;
|
|
111
122
|
/** The validation config for the current `type`. */
|
|
112
123
|
private get config();
|
|
113
124
|
/** Whether `length` is a usable positive integer. */
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { NordEvent } from '../common/events.js';
|
|
3
|
+
import { LocalizeController } from '../localization/LocalizeController.js';
|
|
4
|
+
import './OutlineItem.js';
|
|
5
|
+
/**
|
|
6
|
+
* Event dispatched when the active section of an Outline changes, either via the
|
|
7
|
+
* built-in scroll-spy, a click on one of its items, or a programmatic change.
|
|
8
|
+
* The event's `activeId` is the id of the newly active heading.
|
|
9
|
+
*/
|
|
10
|
+
export declare class NordOutlineChangeEvent extends NordEvent {
|
|
11
|
+
activeId: string;
|
|
12
|
+
constructor(activeId: string);
|
|
13
|
+
}
|
|
14
|
+
declare const Outline_base: typeof LitElement;
|
|
15
|
+
/**
|
|
16
|
+
* Outline is an in-page table of contents that lists a page's headings and
|
|
17
|
+
* highlights the section currently in view as you scroll.
|
|
18
|
+
*
|
|
19
|
+
* Provide [Outline Item](/components/outline-item/) children, or point `for` at
|
|
20
|
+
* a container to build the list from its headings.
|
|
21
|
+
*
|
|
22
|
+
* @status draft
|
|
23
|
+
* @category navigation
|
|
24
|
+
*
|
|
25
|
+
* @slot - The default slot for [Outline Item](/components/outline-item/) children.
|
|
26
|
+
* @slot header - Custom header content shown above the list. Overrides the default localized "On this page" heading. Set `hide-header` to remove the header entirely.
|
|
27
|
+
*
|
|
28
|
+
* @fires {NordOutlineChangeEvent} change - Dispatched when the active section changes. Includes an `activeId` property.
|
|
29
|
+
*
|
|
30
|
+
* @localization label - Accessible label for the outline navigation landmark, and the default header text.
|
|
31
|
+
*
|
|
32
|
+
* @cssprop [--n-outline-indicator-color=var(--n-color-accent)] - Color of the sliding active indicator.
|
|
33
|
+
* @cssprop [--n-outline-track-color=var(--n-color-border)] - Color of the static track behind the indicator.
|
|
34
|
+
* @cssprop [--n-outline-indicator-width=2px] - Thickness of the track and indicator.
|
|
35
|
+
* @cssprop [--n-outline-indent=var(--n-space-m)] - Indentation step applied per heading level.
|
|
36
|
+
* @cssprop [--n-outline-header-color=var(--n-color-text-weaker)] - Color of the default header text.
|
|
37
|
+
* @cssprop [--n-outline-header-font-size=var(--n-font-size-s)] - Font size of the default header text.
|
|
38
|
+
*/
|
|
39
|
+
export default class Outline extends Outline_base {
|
|
40
|
+
static styles: import("lit").CSSResult[];
|
|
41
|
+
protected localize: LocalizeController<"nord-outline">;
|
|
42
|
+
private headerSlot;
|
|
43
|
+
/**
|
|
44
|
+
* The id of the active heading. Setting this puts the Outline in controlled
|
|
45
|
+
* mode and disables the built-in scroll-spy, so your own logic owns the
|
|
46
|
+
* highlight (mirrors providing `activeId` in other libraries).
|
|
47
|
+
*/
|
|
48
|
+
active?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Tightens spacing for dense sidebars where vertical space is at a premium.
|
|
51
|
+
*/
|
|
52
|
+
density: 'default' | 'compact';
|
|
53
|
+
/**
|
|
54
|
+
* DOM-scan mode: the id (or any CSS selector) of the content container whose
|
|
55
|
+
* headings should populate the outline. When set, slotted children are
|
|
56
|
+
* ignored and items are generated from the matched headings.
|
|
57
|
+
*/
|
|
58
|
+
for?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The selector used to find headings when `for` is set.
|
|
61
|
+
*/
|
|
62
|
+
headingSelector: string;
|
|
63
|
+
/**
|
|
64
|
+
* CSS selector for the element that scrolls the content, used as the
|
|
65
|
+
* scroll-spy `IntersectionObserver` root. Point this at your scroll container
|
|
66
|
+
* when the page scrolls inside an element rather than the window — otherwise
|
|
67
|
+
* the observer watches the window and never sees the headings move. If the
|
|
68
|
+
* selector resolves to a `nord-scroll-area`, its scroll viewport is used.
|
|
69
|
+
*
|
|
70
|
+
* When unset, the nearest ancestor `nord-scroll-area` of the scanned content
|
|
71
|
+
* is detected automatically, falling back to the window.
|
|
72
|
+
*/
|
|
73
|
+
scrollContainer?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Hides the header. By default Outline shows a localized "On this page"
|
|
76
|
+
* heading (or the `header` slot's content) above the list.
|
|
77
|
+
*/
|
|
78
|
+
hideHeader: boolean;
|
|
79
|
+
private scanned;
|
|
80
|
+
private containerEl?;
|
|
81
|
+
private indicatorEl?;
|
|
82
|
+
private controlled;
|
|
83
|
+
private observer?;
|
|
84
|
+
private resizeObserver?;
|
|
85
|
+
private mutationObserver?;
|
|
86
|
+
private readonly intersecting;
|
|
87
|
+
connectedCallback(): void;
|
|
88
|
+
disconnectedCallback(): void;
|
|
89
|
+
protected firstUpdated(): void;
|
|
90
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
91
|
+
/** Re-derive entries, restart scroll-spy and reposition the indicator. */
|
|
92
|
+
private refresh;
|
|
93
|
+
/** The ordered list of items, normalised across slotted and scan modes. */
|
|
94
|
+
private get entries();
|
|
95
|
+
private scanContent;
|
|
96
|
+
private observeTargets;
|
|
97
|
+
private handleIntersect;
|
|
98
|
+
private setActive;
|
|
99
|
+
private applyActiveToItems;
|
|
100
|
+
private updateIndicator;
|
|
101
|
+
private handleClick;
|
|
102
|
+
private handleSlotChange;
|
|
103
|
+
private renderHeader;
|
|
104
|
+
render(): import("lit").TemplateResult<1>;
|
|
105
|
+
}
|
|
106
|
+
declare global {
|
|
107
|
+
interface HTMLElementTagNameMap {
|
|
108
|
+
'nord-outline': Outline;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
declare const OutlineItem_base: typeof LitElement;
|
|
3
|
+
/**
|
|
4
|
+
* Outline Item is a single link within an [Outline](/components/outline/). It
|
|
5
|
+
* points at an in-page heading via its `href` and indents according to its
|
|
6
|
+
* `level`. Its `active` state is managed by the parent Outline — you normally
|
|
7
|
+
* don't set it yourself.
|
|
8
|
+
*
|
|
9
|
+
* @status draft
|
|
10
|
+
* @category navigation
|
|
11
|
+
*
|
|
12
|
+
* @slot - The label text for the heading this item links to.
|
|
13
|
+
*
|
|
14
|
+
* @cssprop [--n-outline-item-color=var(--n-color-text-weak)] - Text color in the default state.
|
|
15
|
+
* @cssprop [--n-outline-item-color-hover=var(--n-color-text)] - Text color on hover.
|
|
16
|
+
* @cssprop [--n-outline-item-color-active=var(--n-color-text-link)] - Text color when the item is active.
|
|
17
|
+
*
|
|
18
|
+
* @parent Outline
|
|
19
|
+
*/
|
|
20
|
+
export default class OutlineItem extends OutlineItem_base {
|
|
21
|
+
static styles: import("lit").CSSResult[];
|
|
22
|
+
/**
|
|
23
|
+
* The URL fragment of the heading this item links to, e.g. `#installation`.
|
|
24
|
+
*/
|
|
25
|
+
href: string;
|
|
26
|
+
/**
|
|
27
|
+
* Heading depth from 1 to 4. Controls how far the item is indented.
|
|
28
|
+
*/
|
|
29
|
+
level: 1 | 2 | 3 | 4;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this item represents the currently active section. Managed by the
|
|
32
|
+
* parent [Outline](/components/outline/) via its scroll-spy or `active` property.
|
|
33
|
+
*/
|
|
34
|
+
active: boolean;
|
|
35
|
+
render(): import("lit").TemplateResult<1>;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
'nord-outline-item': OutlineItem;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export {};
|
package/lib/src/stack/Stack.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { LitElement } from 'lit';
|
|
|
4
4
|
* vertical or horizontal axis with optional spacing between each child.
|
|
5
5
|
*
|
|
6
6
|
* @status ready
|
|
7
|
-
* @category
|
|
7
|
+
* @category layout
|
|
8
8
|
* @slot - The stack content.
|
|
9
9
|
*
|
|
10
10
|
* @cssprop [--n-stack-gap=var(--n-space-m)] - Controls the spacing between items, using our [spacing tokens](/tokens/#space).
|
package/lib/src/tag/Tag.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const Tag_base: (new (...args: any[]) => import("../common/mixins/InputM
|
|
|
6
6
|
* and organize objects. Commonly used to signify the attributes of an object.
|
|
7
7
|
*
|
|
8
8
|
* @status new
|
|
9
|
-
* @category
|
|
9
|
+
* @category content
|
|
10
10
|
* @slot - The tag content.
|
|
11
11
|
*
|
|
12
12
|
* @localization removeLabel - Accessible label for the remove button.
|
|
@@ -3,7 +3,7 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
* Tag groups are designed to bring together selectable tags that are of a similar nature. For example categories you can filter by.
|
|
4
4
|
*
|
|
5
5
|
* @status new
|
|
6
|
-
* @category
|
|
6
|
+
* @category content
|
|
7
7
|
* @slot - The tag group content
|
|
8
8
|
*
|
|
9
9
|
* @fires {NordEvent} change - Fired whenever a tag has been checked or unchecked via user interaction.
|
|
@@ -3,7 +3,7 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
* Top bar is a header component that is always visible at the top of the interface. Top bar allows functionality such as search and contextual menus to be placed at the top of the interface.
|
|
4
4
|
*
|
|
5
5
|
* @status ready
|
|
6
|
-
* @category
|
|
6
|
+
* @category layout
|
|
7
7
|
* @slot - Used for the main content of the top bar. We recommend placing your application’s global search functionality into this slot.
|
|
8
8
|
* @slot end - Optional slot for menus, buttons, toggles, etc.
|
|
9
9
|
*/
|
|
@@ -5,7 +5,7 @@ import '../tooltip/Tooltip.js';
|
|
|
5
5
|
* Truncate clips text with a single- or multi-line ellipsis and reveals a tooltip with the full text when the content overflows.
|
|
6
6
|
*
|
|
7
7
|
* @status ready
|
|
8
|
-
* @category
|
|
8
|
+
* @category content
|
|
9
9
|
* @slot - The full text content. Plain text is recommended; rich markup is
|
|
10
10
|
* not supported (only `textContent` is read for truncation).
|
|
11
11
|
*/
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=["Shift","Meta","Alt","Control"],t=1e3,n="object"==typeof navigator?navigator.platform:"",o=/Mac|iPod|iPhone|iPad/.test(n)?"Meta":"Control",r="Win32"===n?["Control","Alt"]:["Alt"];function i(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches("[contenteditable],input,select,textarea")}function a(e,t){return"function"==typeof e.getModifierState&&(e.getModifierState(t)||r.includes(t)&&e.getModifierState("AltGraph"))}function l(t,[n,o,i]){const l=n.includes("AltGraph");return!((i instanceof RegExp?!i.test(t.key)&&!i.test(t.code):i.toUpperCase()!==t.key.toUpperCase()&&i!==t.code)||n.find((e=>!a(t,e)))||e.find((e=>!n.includes(e)&&!o.includes(e)&&i!==e&&a(t,e)&&!(l&&r.includes(e)))))}function c(e,n={}){let r=n.timeout??t,c=n.ignore??i,s=Object.keys(e).map((t=>{return[t,(n=t,n.trim().split(" ").map((e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?new RegExp(`^(?:${r[1]})$`,"iv"):n,a=[],l=[];for(const e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n="$mod"===n?o:n,t?l.push(n):a.push(n)}return[a,l,i]}))),e[t]];var n})),u=new Map,f=null;return e=>{if(!function(e){return!!(e.key&&e.code&&e.getModifierState)}(e)||c(e))return;let t=[];for(let[n,o,r]of s){let i=u.get(n),[c,...s]=i||o;if(l(e,c))if(s.length>0)u.set(n,s),t.push(n);else{if(u.delete(n),!t.length){r(e);break}console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t)}else a(e,e.key)||u.delete(n)}f&&clearTimeout(f),f=setTimeout((()=>u.clear()),r)}}function s(e,t,n={}){let o=n.event??"keydown",r=c(t,n);return e.addEventListener(o,r,n.capture),()=>{e.removeEventListener(o,r,n.capture)}}export{c,s as t};
|
|
2
|
+
//# sourceMappingURL=tinykeys-DwvDXsEb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tinykeys-DwvDXsEb.js","sources":["../../../node_modules/.pnpm/tinykeys@4.0.0/node_modules/tinykeys/dist/tinykeys.mjs"],"sourcesContent":["//#region src/tinykeys.ts\n/**\n* These are the modifier keys that change the meaning of keybindings.\n*\n* Note: Ignoring \"AltGraph\" because it is covered by the others.\n*/\nlet KEYBINDING_MODIFIER_KEYS = [\n\t\"Shift\",\n\t\"Meta\",\n\t\"Alt\",\n\t\"Control\"\n];\n/**\n* Keybinding sequences should timeout if individual key presses are more than\n* 1s apart by default.\n*/\nlet DEFAULT_TIMEOUT = 1e3;\n/**\n* Keybinding sequences should bind to this event by default.\n*/\nlet DEFAULT_EVENT = \"keydown\";\n/**\n* Platform detection code.\n* @see https://github.com/jamiebuilds/tinykeys/issues/184\n*/\nlet PLATFORM = typeof navigator === \"object\" ? navigator.platform : \"\";\n/**\n* An alias for creating platform-specific keybinding aliases.\n*/\nlet MOD = /Mac|iPod|iPhone|iPad/.test(PLATFORM) ? \"Meta\" : \"Control\";\n/**\n* Meaning of `AltGraph`, from MDN:\n* - Windows: Both Alt and Ctrl keys are pressed, or AltGr key is pressed\n* - Mac: ⌥ Option key pressed\n* - Linux: Level 3 Shift key (or Level 5 Shift key) pressed\n* - Android: Not supported\n* @see https://github.com/jamiebuilds/tinykeys/issues/185\n*/\nlet ALT_GRAPH_ALIASES = PLATFORM === \"Win32\" ? [\"Control\", \"Alt\"] : [\"Alt\"];\n/**\n* Ensure and stop any event that isn't a full keyboard event.\n* Autocomplete option navigation and selection would fire an Event,\n* instead of the expected KeyboardEvent\n*/\nfunction isKeyboardEvent(event) {\n\treturn !!(event.key && event.code && event.getModifierState);\n}\n/**\n* Ignores keyboard events from contenteditable and form elements unless they\n* are the current target.\n*/\nfunction defaultKeybindingsHandlerIgnore(event) {\n\tlet target = event.target;\n\treturn event.repeat || event.isComposing || target !== event.currentTarget && target.matches(\"[contenteditable],input,select,textarea\");\n}\n/**\n* There's a bug in Chrome that causes event.getModifierState not to exist on\n* KeyboardEvent's for F1/F2/etc keys.\n*/\nfunction getModifierState(event, mod) {\n\treturn typeof event.getModifierState === \"function\" ? event.getModifierState(mod) || ALT_GRAPH_ALIASES.includes(mod) && event.getModifierState(\"AltGraph\") : false;\n}\n/**\n* Parses a keybinding string into its parts.\n*\n* ```\n* grammar = `<sequence>`\n* <sequence> = `<press> <press> <press> ...`\n* <press> = `<key>` or `<mods>+<key>`\n* <mods> = `<mod>+<mod>+...`\n* <mod> = `<modifier>` (required) or `[<modifier>]` (optional)\n* <key> = `<KeyboardEvent.key>` or `<KeyboardEvent.code>` (case-insensitive)\n* <key> = `(<regex>)` -> `/^(?:<regex>)$/iy` (case-insensitive)\n* ```\n*/\nfunction parseKeybinding(str) {\n\treturn str.trim().split(\" \").map((press) => {\n\t\tlet parts = press.split(/(?<=\\w|\\])\\+/);\n\t\tlet last = parts.pop();\n\t\tlet regex = last.match(/^\\((.+)\\)$/);\n\t\tlet key = regex ? new RegExp(`^(?:${regex[1]})$`, \"iv\") : last;\n\t\tlet requiredModifiers = [];\n\t\tlet optionalModifiers = [];\n\t\tfor (const part of parts) {\n\t\t\tlet optional = part.match(/^\\[(.*)\\]$/);\n\t\t\tlet mod = optional?.[1] ?? part;\n\t\t\tmod = mod === \"$mod\" ? MOD : mod;\n\t\t\tif (optional) optionalModifiers.push(mod);\n\t\t\telse requiredModifiers.push(mod);\n\t\t}\n\t\treturn [\n\t\t\trequiredModifiers,\n\t\t\toptionalModifiers,\n\t\t\tkey\n\t\t];\n\t});\n}\n/**\n* This tells us if a single keyboard event matches a single keybinding press.\n*/\nfunction matchKeybindingPress(event, [requiredModifiers, optionalModifiers, key]) {\n\tconst hasAltGraph = requiredModifiers.includes(\"AltGraph\");\n\treturn !((key instanceof RegExp ? !(key.test(event.key) || key.test(event.code)) : key.toUpperCase() !== event.key.toUpperCase() && key !== event.code) || requiredModifiers.find((mod) => {\n\t\treturn !getModifierState(event, mod);\n\t}) || KEYBINDING_MODIFIER_KEYS.find((mod) => {\n\t\treturn !requiredModifiers.includes(mod) && !optionalModifiers.includes(mod) && key !== mod && getModifierState(event, mod) && !(hasAltGraph && ALT_GRAPH_ALIASES.includes(mod));\n\t}));\n}\n/**\n* Creates an event listener for handling keybindings.\n*\n* @example\n* ```js\n* import { createKeybindingsHandler } from \"../src/keybindings\"\n*\n* let handler = createKeybindingsHandler({\n* \t\"Shift+d\": () => {\n* \t\talert(\"The 'Shift' and 'd' keys were pressed at the same time\")\n* \t},\n* \t\"y e e t\": () => {\n* \t\talert(\"The keys 'y', 'e', 'e', and 't' were pressed in order\")\n* \t},\n* \t\"$mod+d\": () => {\n* \t\talert(\"Either 'Control+d' or 'Meta+d' were pressed\")\n* \t},\n* })\n*\n* window.addEventListener(\"keydown\", handler)\n* ```\n*/\nfunction createKeybindingsHandler(keybindingsMap, options = {}) {\n\tlet timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\tlet ignore = options.ignore ?? defaultKeybindingsHandlerIgnore;\n\tlet keybindings = Object.keys(keybindingsMap).map((input) => {\n\t\treturn [\n\t\t\tinput,\n\t\t\tparseKeybinding(input),\n\t\t\tkeybindingsMap[input]\n\t\t];\n\t});\n\tlet pending = /* @__PURE__ */ new Map();\n\tlet timer = null;\n\treturn (event) => {\n\t\tif (!isKeyboardEvent(event) || ignore(event)) return;\n\t\tlet conflicts = [];\n\t\tfor (let [input, sequence, handler] of keybindings) {\n\t\t\tlet prev = pending.get(input);\n\t\t\tlet [current, ...rest] = prev ? prev : sequence;\n\t\t\tif (!matchKeybindingPress(event, current)) {\n\t\t\t\tif (!getModifierState(event, event.key)) pending.delete(input);\n\t\t\t} else if (rest.length > 0) {\n\t\t\t\tpending.set(input, rest);\n\t\t\t\tconflicts.push(input);\n\t\t\t} else {\n\t\t\t\tpending.delete(input);\n\t\t\t\tif (conflicts.length) console.warn(`tinykeys: Conflict found, \"${input}\" did not fire, waiting for:`, conflicts);\n\t\t\t\telse {\n\t\t\t\t\thandler(event);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (timer) clearTimeout(timer);\n\t\ttimer = setTimeout(() => pending.clear(), timeout);\n\t};\n}\n/**\n* Subscribes to keybindings.\n*\n* Returns an unsubscribe method.\n*\n* @example\n* ```js\n* import { tinykeys } from \"../src/tinykeys\"\n*\n* tinykeys(window, {\n* \t\"Shift+d\": () => {\n* \t\talert(\"The 'Shift' and 'd' keys were pressed at the same time\")\n* \t},\n* \t\"y e e t\": () => {\n* \t\talert(\"The keys 'y', 'e', 'e', and 't' were pressed in order\")\n* \t},\n* \t\"$mod+d\": () => {\n* \t\talert(\"Either 'Control+d' or 'Meta+d' were pressed\")\n* \t},\n* })\n* ```\n*/\nfunction tinykeys(target, keybindingMap, options = {}) {\n\tlet event = options.event ?? DEFAULT_EVENT;\n\tlet onKeyEvent = createKeybindingsHandler(keybindingMap, options);\n\ttarget.addEventListener(event, onKeyEvent, options.capture);\n\treturn () => {\n\t\ttarget.removeEventListener(event, onKeyEvent, options.capture);\n\t};\n}\n//#endregion\nexport { createKeybindingsHandler, defaultKeybindingsHandlerIgnore, matchKeybindingPress, parseKeybinding, tinykeys };\n\n//# sourceMappingURL=tinykeys.mjs.map"],"names":["KEYBINDING_MODIFIER_KEYS","DEFAULT_TIMEOUT","PLATFORM","navigator","platform","MOD","test","ALT_GRAPH_ALIASES","defaultKeybindingsHandlerIgnore","event","target","repeat","isComposing","currentTarget","matches","getModifierState","mod","includes","matchKeybindingPress","requiredModifiers","optionalModifiers","key","hasAltGraph","RegExp","code","toUpperCase","find","createKeybindingsHandler","keybindingsMap","options","timeout","ignore","keybindings","Object","keys","map","input","str","trim","split","press","parts","last","pop","regex","match","part","optional","push","pending","Map","timer","isKeyboardEvent","conflicts","sequence","handler","prev","get","current","rest","length","set","delete","console","warn","clearTimeout","setTimeout","clear","tinykeys","keybindingMap","onKeyEvent","addEventListener","capture","removeEventListener"],"mappings":"AAMA,IAAIA,EAA2B,CAC9B,QACA,OACA,MACA,WAMGC,EAAkB,IASlBC,EAAgC,iBAAdC,UAAyBA,UAAUC,SAAW,GAIhEC,EAAM,uBAAuBC,KAAKJ,GAAY,OAAS,UASvDK,EAAiC,UAAbL,EAAuB,CAAC,UAAW,OAAS,CAAC,OAarE,SAASM,EAAgCC,GACxC,IAAIC,EAASD,EAAMC,OACnB,OAAOD,EAAME,QAAUF,EAAMG,aAAeF,IAAWD,EAAMI,eAAiBH,EAAOI,QAAQ,0CAC9F,CAKA,SAASC,EAAiBN,EAAOO,GAChC,MAAyC,mBAA3BP,EAAMM,mBAAkCN,EAAMM,iBAAiBC,IAAQT,EAAkBU,SAASD,IAAQP,EAAMM,iBAAiB,YAChJ,CAuCA,SAASG,EAAqBT,GAAQU,EAAmBC,EAAmBC,IAC3E,MAAMC,EAAcH,EAAkBF,SAAS,YAC/C,SAAUI,aAAeE,QAAWF,EAAIf,KAAKG,EAAMY,OAAQA,EAAIf,KAAKG,EAAMe,MAASH,EAAII,gBAAkBhB,EAAMY,IAAII,eAAiBJ,IAAQZ,EAAMe,OAASL,EAAkBO,MAAMV,IAC1KD,EAAiBN,EAAOO,MAC3BhB,EAAyB0B,MAAMV,IAC5BG,EAAkBF,SAASD,KAASI,EAAkBH,SAASD,IAAQK,IAAQL,GAAOD,EAAiBN,EAAOO,MAAUM,GAAef,EAAkBU,SAASD,MAE5K,CAuBA,SAASW,EAAyBC,EAAgBC,EAAU,IAC3D,IAAIC,EAAUD,EAAQC,SAAW7B,EAC7B8B,EAASF,EAAQE,QAAUvB,EAC3BwB,EAAcC,OAAOC,KAAKN,GAAgBO,KAAKC,IAClD,MAAO,CACNA,GA5DsBC,EA6DND,EA5DXC,EAAIC,OAAOC,MAAM,KAAKJ,KAAKK,IACjC,IAAIC,EAAQD,EAAMD,MAAM,gBACpBG,EAAOD,EAAME,MACbC,EAAQF,EAAKG,MAAM,cACnBxB,EAAMuB,EAAQ,IAAIrB,OAAO,OAAOqB,EAAM,OAAQ,MAAQF,EACtDvB,EAAoB,GACpBC,EAAoB,GACxB,IAAK,MAAM0B,KAAQL,EAAO,CACzB,IAAIM,EAAWD,EAAKD,MAAM,cACtB7B,EAAM+B,IAAW,IAAMD,EAC3B9B,EAAc,SAARA,EAAiBX,EAAMW,EACzB+B,EAAU3B,EAAkB4B,KAAKhC,GAChCG,EAAkB6B,KAAKhC,EAC5B,CACD,MAAO,CACNG,EACAC,EACAC,EACA,KA2CAO,EAAeQ,IA9DlB,IAAyBC,CA+DtB,IAEEY,EAA0B,IAAIC,IAC9BC,EAAQ,KACZ,OAAQ1C,IACP,IAnGF,SAAyBA,GACxB,SAAUA,EAAMY,KAAOZ,EAAMe,MAAQf,EAAMM,iBAC5C,CAiGOqC,CAAgB3C,IAAUsB,EAAOtB,GAAQ,OAC9C,IAAI4C,EAAY,GAChB,IAAK,IAAKjB,EAAOkB,EAAUC,KAAYvB,EAAa,CACnD,IAAIwB,EAAOP,EAAQQ,IAAIrB,IAClBsB,KAAYC,GAAQH,GAAcF,EACvC,GAAKpC,EAAqBT,EAAOiD,GAE1B,GAAIC,EAAKC,OAAS,EACxBX,EAAQY,IAAIzB,EAAOuB,GACnBN,EAAUL,KAAKZ,OACT,CAEN,GADAa,EAAQa,OAAO1B,IACXiB,EAAUO,OACT,CACJL,EAAQ9C,GACR,KACA,CAJqBsD,QAAQC,KAAK,8BAA8B5B,gCAAqCiB,EAKtG,MAXKtC,EAAiBN,EAAOA,EAAMY,MAAM4B,EAAQa,OAAO1B,EAYzD,CACGe,GAAOc,aAAad,GACxBA,EAAQe,YAAW,IAAMjB,EAAQkB,SAASrC,EAAQ,CAEpD,CAuBA,SAASsC,EAAS1D,EAAQ2D,EAAexC,EAAU,CAAA,GAClD,IAAIpB,EAAQoB,EAAQpB,OAzKD,UA0Kf6D,EAAa3C,EAAyB0C,EAAexC,GAEzD,OADAnB,EAAO6D,iBAAiB9D,EAAO6D,EAAYzC,EAAQ2C,SAC5C,KACN9D,EAAO+D,oBAAoBhE,EAAO6D,EAAYzC,EAAQ2C,QAAQ,CAEhE","x_google_ignoreList":[0]}
|
package/lib/translation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isServer as o}from"lit";import t from"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./localization7.js";import"./localization8.js";import"./localization9.js";import"./localization10.js";import"./localization11.js";import"./localization12.js";import"./localization13.js";import"./localization14.js";import"./localization15.js";import"./localization16.js";import"./localization17.js";import"./localization18.js";import"./localization19.js";import"./localization20.js";import"./localization21.js";import"./localization22.js";const i=new Set,n=new Set,a=new Map;function r(o,t){if(!l(t))return t;if(!l(o))return t;const i={...o};for(const o in t){const n=t[o],a=i[o];l(n)&&l(a)?i[o]=r(a,n):i[o]=n}return i}function l(o){return null!==o&&"object"==typeof o&&!Array.isArray(o)}if(!o){new MutationObserver((function(){for(const o of i)o()})).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]})}function c(){a.clear()}function e(...o){o.forEach((o=>{const t=o.$lang.toLowerCase(),i=a.get(t),n=i?r(i,o):o;a.set(t,n)})),function(){for(const o of n)o()}()}function s(o){return i.add(o),()=>i.delete(o)}function m(o){return n.add(o),()=>n.delete(o)}function p(o){return a.has(o)}function
|
|
1
|
+
import{isServer as o}from"lit";import t from"./en-us.js";import"./localization.js";import"./localization2.js";import"./localization3.js";import"./localization4.js";import"./localization5.js";import"./localization6.js";import"./localization7.js";import"./localization8.js";import"./localization9.js";import"./localization10.js";import"./localization11.js";import"./localization12.js";import"./localization13.js";import"./localization14.js";import"./localization15.js";import"./localization16.js";import"./localization17.js";import"./localization18.js";import"./localization19.js";import"./localization20.js";import"./localization21.js";import"./localization22.js";import"./localization23.js";import"./localization24.js";const i=new Set,n=new Set,a=new Map;function r(o,t){if(!l(t))return t;if(!l(o))return t;const i={...o};for(const o in t){const n=t[o],a=i[o];l(n)&&l(a)?i[o]=r(a,n):i[o]=n}return i}function l(o){return null!==o&&"object"==typeof o&&!Array.isArray(o)}if(!o){new MutationObserver((function(){for(const o of i)o()})).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]})}function c(){a.clear()}function e(...o){o.forEach((o=>{const t=o.$lang.toLowerCase(),i=a.get(t),n=i?r(i,o):o;a.set(t,n)})),function(){for(const o of n)o()}()}function s(o){return i.add(o),()=>i.delete(o)}function m(o){return n.add(o),()=>n.delete(o)}function p(o){return a.has(o)}function j(o){const i=o.toLowerCase(),[n]=i.split("-");return a.get(i)||a.get(n)||t}export{c as clearTranslations,t as fallback,p as isTranslationRegistered,e as registerTranslation,j as resolveTranslation,s as subscribeToDocumentLang,m as subscribeToTranslationRegistration};
|
|
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 { isServer } from 'lit'\nimport 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\n// Recursively make all properties optional\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\nexport type Translation = typeof en\nexport type PartialTranslation = {\n $lang: string\n $name?: string\n $dir?: 'ltr' | 'rtl'\n} & DeepPartial<Omit<Translation, '$lang' | '$name' | '$dir'>>\nexport type WellKnownKeys = PickStartsWith<keyof Translation, '$'>\n\nconst documentLangSubscribers = new Set<() => void>()\nconst translationRegistrationSubscribers = new Set<() => void>()\nconst translations = new Map<string, Translation>()\n\nfunction notifyDocumentLangChange() {\n for (const subscriber of documentLangSubscribers) {\n subscriber()\n }\n}\n\nfunction notifyTranslationRegistration() {\n for (const subscriber of translationRegistrationSubscribers) {\n subscriber()\n }\n}\n\nfunction deepMerge(target: unknown, source: unknown): unknown {\n if (!isObject(source))\n return source\n\n if (!isObject(target))\n return source\n\n const result = { ...target }\n\n for (const key in source) {\n const sourceValue = (source as Record<string, unknown>)[key]\n const targetValue = result[key]\n\n if (isObject(sourceValue) && isObject(targetValue)) {\n result[key] = deepMerge(targetValue, sourceValue)\n }\n else {\n result[key] = sourceValue\n }\n }\n\n return result\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\n// observe changes to the document's lang\nif (!isServer) {\n const observer = new MutationObserver(notifyDocumentLangChange)\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['lang'],\n })\n}\n\n/**\n * Removes all registered translations\n */\nexport function clearTranslations() {\n translations.clear()\n}\n\n/**\n * Registers one or more translations. If a translation for the same language\n * already exists, the new translation will be deep-merged with the existing one.\n * Translations can be partial — only the fields you provide will override existing values.\n */\nexport function registerTranslation(...translation: (Translation | PartialTranslation)[]) {\n translation.forEach((t) => {\n const lang = t.$lang.toLowerCase()\n const existing = translations.get(lang)\n\n // Deep merge: keep existing keys, override with new ones\n const merged = existing ? (deepMerge(existing, t) as Translation) : (t as Translation)\n translations.set(lang, merged)\n })\n\n notifyTranslationRegistration()\n}\n\n/**\n * subscribe to document language changes\n * @param onChange callback for when document `lang` attr changes\n * @returns cleanup function\n */\nexport function subscribeToDocumentLang(onChange: () => void): () => void {\n documentLangSubscribers.add(onChange)\n return () => documentLangSubscribers.delete(onChange)\n}\n\n/**\n * subscribe to translation registration changes\n * @param onChange callback for when new translations are registered\n * @returns cleanup function\n */\nexport function subscribeToTranslationRegistration(onChange: () => void): () => void {\n translationRegistrationSubscribers.add(onChange)\n return () => translationRegistrationSubscribers.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":["documentLangSubscribers","Set","translationRegistrationSubscribers","translations","Map","deepMerge","target","source","isObject","result","key","sourceValue","targetValue","value","Array","isArray","isServer","MutationObserver","subscriber","observe","document","documentElement","attributes","attributeFilter","clearTranslations","clear","registerTranslation","translation","forEach","t","lang","$lang","toLowerCase","existing","get","merged","set","notifyTranslationRegistration","subscribeToDocumentLang","onChange","add","delete","subscribeToTranslationRegistration","isTranslationRegistered","has","resolveTranslation","langCode","langOnly","split","en"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation.js","sources":["../src/localization/translation.ts"],"sourcesContent":["import { isServer } from 'lit'\nimport 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\n// Recursively make all properties optional\ntype DeepPartial<T> = T extends object\n ? {\n [P in keyof T]?: DeepPartial<T[P]>\n }\n : T\n\nexport type Translation = typeof en\nexport type PartialTranslation = {\n $lang: string\n $name?: string\n $dir?: 'ltr' | 'rtl'\n} & DeepPartial<Omit<Translation, '$lang' | '$name' | '$dir'>>\nexport type WellKnownKeys = PickStartsWith<keyof Translation, '$'>\n\nconst documentLangSubscribers = new Set<() => void>()\nconst translationRegistrationSubscribers = new Set<() => void>()\nconst translations = new Map<string, Translation>()\n\nfunction notifyDocumentLangChange() {\n for (const subscriber of documentLangSubscribers) {\n subscriber()\n }\n}\n\nfunction notifyTranslationRegistration() {\n for (const subscriber of translationRegistrationSubscribers) {\n subscriber()\n }\n}\n\nfunction deepMerge(target: unknown, source: unknown): unknown {\n if (!isObject(source))\n return source\n\n if (!isObject(target))\n return source\n\n const result = { ...target }\n\n for (const key in source) {\n const sourceValue = (source as Record<string, unknown>)[key]\n const targetValue = result[key]\n\n if (isObject(sourceValue) && isObject(targetValue)) {\n result[key] = deepMerge(targetValue, sourceValue)\n }\n else {\n result[key] = sourceValue\n }\n }\n\n return result\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\n// observe changes to the document's lang\nif (!isServer) {\n const observer = new MutationObserver(notifyDocumentLangChange)\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['lang'],\n })\n}\n\n/**\n * Removes all registered translations\n */\nexport function clearTranslations() {\n translations.clear()\n}\n\n/**\n * Registers one or more translations. If a translation for the same language\n * already exists, the new translation will be deep-merged with the existing one.\n * Translations can be partial — only the fields you provide will override existing values.\n */\nexport function registerTranslation(...translation: (Translation | PartialTranslation)[]) {\n translation.forEach((t) => {\n const lang = t.$lang.toLowerCase()\n const existing = translations.get(lang)\n\n // Deep merge: keep existing keys, override with new ones\n const merged = existing ? (deepMerge(existing, t) as Translation) : (t as Translation)\n translations.set(lang, merged)\n })\n\n notifyTranslationRegistration()\n}\n\n/**\n * subscribe to document language changes\n * @param onChange callback for when document `lang` attr changes\n * @returns cleanup function\n */\nexport function subscribeToDocumentLang(onChange: () => void): () => void {\n documentLangSubscribers.add(onChange)\n return () => documentLangSubscribers.delete(onChange)\n}\n\n/**\n * subscribe to translation registration changes\n * @param onChange callback for when new translations are registered\n * @returns cleanup function\n */\nexport function subscribeToTranslationRegistration(onChange: () => void): () => void {\n translationRegistrationSubscribers.add(onChange)\n return () => translationRegistrationSubscribers.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":["documentLangSubscribers","Set","translationRegistrationSubscribers","translations","Map","deepMerge","target","source","isObject","result","key","sourceValue","targetValue","value","Array","isArray","isServer","MutationObserver","subscriber","observe","document","documentElement","attributes","attributeFilter","clearTranslations","clear","registerTranslation","translation","forEach","t","lang","$lang","toLowerCase","existing","get","merged","set","notifyTranslationRegistration","subscribeToDocumentLang","onChange","add","delete","subscribeToTranslationRegistration","isTranslationRegistered","has","resolveTranslation","langCode","langOnly","split","en"],"mappings":"+sBAqBA,MAAMA,EAA0B,IAAIC,IAC9BC,EAAqC,IAAID,IACzCE,EAAe,IAAIC,IAczB,SAASC,EAAUC,EAAiBC,GAClC,IAAKC,EAASD,GACZ,OAAOA,EAET,IAAKC,EAASF,GACZ,OAAOC,EAET,MAAME,EAAS,IAAKH,GAEpB,IAAK,MAAMI,KAAOH,EAAQ,CACxB,MAAMI,EAAeJ,EAAmCG,GAClDE,EAAcH,EAAOC,GAEvBF,EAASG,IAAgBH,EAASI,GACpCH,EAAOC,GAAOL,EAAUO,EAAaD,GAGrCF,EAAOC,GAAOC,CAEjB,CAED,OAAOF,CACT,CAEA,SAASD,EAASK,GAChB,OAAiB,OAAVA,GAAmC,iBAAVA,IAAuBC,MAAMC,QAAQF,EACvE,CAGA,IAAKG,EAAU,CACI,IAAIC,kBA1CvB,WACE,IAAK,MAAMC,KAAclB,EACvBkB,GAEJ,IAwCWC,QAAQC,SAASC,gBAAiB,CACzCC,YAAY,EACZC,gBAAiB,CAAC,SAEtB,UAKgBC,IACdrB,EAAasB,OACf,CAOgB,SAAAC,KAAuBC,GACrCA,EAAYC,SAASC,IACnB,MAAMC,EAAOD,EAAEE,MAAMC,cACfC,EAAW9B,EAAa+B,IAAIJ,GAG5BK,EAASF,EAAY5B,EAAU4B,EAAUJ,GAAsBA,EACrE1B,EAAaiC,IAAIN,EAAMK,EAAO,IA/DlC,WACE,IAAK,MAAMjB,KAAchB,EACvBgB,GAEJ,CA8DEmB,EACF,CAOM,SAAUC,EAAwBC,GAEtC,OADAvC,EAAwBwC,IAAID,GACrB,IAAMvC,EAAwByC,OAAOF,EAC9C,CAOM,SAAUG,EAAmCH,GAEjD,OADArC,EAAmCsC,IAAID,GAChC,IAAMrC,EAAmCuC,OAAOF,EACzD,CAMM,SAAUI,EAAwBb,GACtC,OAAO3B,EAAayC,IAAId,EAC1B,CAMM,SAAUe,EAAmBC,GACjC,MAAMhB,EAAOgB,EAASd,eACfe,GAAYjB,EAAKkB,MAAM,KAE9B,OAAO7C,EAAa+B,IAAIJ,IAAS3B,EAAa+B,IAAIa,IAAaE,CACjE"}
|
package/lib/vue.d.ts
CHANGED
|
@@ -685,6 +685,17 @@ interface NordComponents {
|
|
|
685
685
|
}
|
|
686
686
|
>;
|
|
687
687
|
|
|
688
|
+
"nord-outline": DefineComponent<
|
|
689
|
+
WCProps<Components.Outline> & {
|
|
690
|
+
/**
|
|
691
|
+
* Dispatched when the active section changes. Includes an `activeId` property.
|
|
692
|
+
*/
|
|
693
|
+
onChange?: (event: Event) => void;
|
|
694
|
+
}
|
|
695
|
+
>;
|
|
696
|
+
|
|
697
|
+
"nord-outline-item": DefineComponent<WCProps<Components.OutlineItem> & {}>;
|
|
698
|
+
|
|
688
699
|
"nord-pagination": DefineComponent<WCProps<Components.Pagination> & {}>;
|
|
689
700
|
|
|
690
701
|
"nord-pagination-content": DefineComponent<
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordhealth/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.1",
|
|
5
5
|
"description": "This package includes Nord Design System Web Components",
|
|
6
6
|
"author": "Nordhealth <support@nordhealth.design>",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"@tanstack/virtual-core": "3.17.1",
|
|
45
45
|
"lit": "^3.3.2",
|
|
46
46
|
"qr": "^0.4.2",
|
|
47
|
-
"tinykeys": "^
|
|
47
|
+
"tinykeys": "^4.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@custom-elements-manifest/analyzer": "^0.10.10",
|
|
51
51
|
"@nordhealth/css": "^4.4.1",
|
|
52
52
|
"@nordhealth/fonts": "^3.0.4",
|
|
53
|
-
"@nordhealth/themes": "^10.0.
|
|
54
|
-
"@nordhealth/tokens": "^9.0.
|
|
53
|
+
"@nordhealth/themes": "^10.0.1",
|
|
54
|
+
"@nordhealth/tokens": "^9.0.1",
|
|
55
55
|
"@open-wc/testing-helpers": "^3.0.1",
|
|
56
56
|
"@playwright/test": "1.58.0",
|
|
57
57
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"rollup": "~4.21.3"
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "9499a03daba4b5ffa56d49bf43d163edf119a372"
|
|
92
92
|
}
|