@nordhealth/components 5.0.0-alpha.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/custom-elements.json +20657 -19988
  2. package/lib/Accordion.js.map +1 -1
  3. package/lib/AccordionHeader.js.map +1 -1
  4. package/lib/AccordionItem.js.map +1 -1
  5. package/lib/AccordionPanel.js.map +1 -1
  6. package/lib/AccordionTrigger.js +1 -1
  7. package/lib/AccordionTrigger.js.map +1 -1
  8. package/lib/Aside.js.map +1 -1
  9. package/lib/AsideDrawer.js.map +1 -1
  10. package/lib/Autocomplete.js +1 -1
  11. package/lib/Autocomplete.js.map +1 -1
  12. package/lib/Avatar.js.map +1 -1
  13. package/lib/Calendar-D47b20IT.js +2 -0
  14. package/lib/Calendar-D47b20IT.js.map +1 -0
  15. package/lib/Calendar.js +1 -1
  16. package/lib/Card.js.map +1 -1
  17. package/lib/Collapsible.js.map +1 -1
  18. package/lib/CollapsiblePanel.js.map +1 -1
  19. package/lib/CollapsibleTrigger.js.map +1 -1
  20. package/lib/Combobox-DBxXlbY7.js +2 -0
  21. package/lib/Combobox-DBxXlbY7.js.map +1 -0
  22. package/lib/Combobox.js +1 -1
  23. package/lib/Combobox.js.map +1 -1
  24. package/lib/ComboboxBase.js +1 -1
  25. package/lib/ComboboxBase.js.map +1 -1
  26. package/lib/CommandMenu.js +1 -1
  27. package/lib/CommandMenu.js.map +1 -1
  28. package/lib/DatePicker.js +1 -1
  29. package/lib/DatePicker.js.map +1 -1
  30. package/lib/DateRangePicker.js +1 -1
  31. package/lib/DateRangePicker.js.map +1 -1
  32. package/lib/Divider.js.map +1 -1
  33. package/lib/Drawer.js.map +1 -1
  34. package/lib/Dropdown.js +1 -1
  35. package/lib/Dropdown.js.map +1 -1
  36. package/lib/DropdownSubmenu.js +1 -1
  37. package/lib/DropdownSubmenu.js.map +1 -1
  38. package/lib/FilterAddButton.js +1 -1
  39. package/lib/FilterAddButton.js.map +1 -1
  40. package/lib/FilterDateRange.js +1 -1
  41. package/lib/FilterDateRange.js.map +1 -1
  42. package/lib/FilterDropdown.js +1 -1
  43. package/lib/FilterDropdown.js.map +1 -1
  44. package/lib/FilterField.js +1 -1
  45. package/lib/FilterField.js.map +1 -1
  46. package/lib/FilterInput.js +1 -1
  47. package/lib/FilterInput.js.map +1 -1
  48. package/lib/FilterResetButton.js +1 -1
  49. package/lib/FilterResetButton.js.map +1 -1
  50. package/lib/Footer.js.map +1 -1
  51. package/lib/Header.js.map +1 -1
  52. package/lib/Icon.js.map +1 -1
  53. package/lib/Kbd.js.map +1 -1
  54. package/lib/KbdGroup.js.map +1 -1
  55. package/lib/KeyboardController.js +1 -1
  56. package/lib/KeyboardController.js.map +1 -1
  57. package/lib/Layout.js +1 -1
  58. package/lib/Layout.js.map +1 -1
  59. package/lib/{LightDismissController-4pH8cdko.js → LightDismissController-wcL1ziJa.js} +2 -2
  60. package/lib/{LightDismissController-4pH8cdko.js.map → LightDismissController-wcL1ziJa.js.map} +1 -1
  61. package/lib/LocalizeController.js +1 -1
  62. package/lib/LocalizeController.js.map +1 -1
  63. package/lib/Message.js +1 -1
  64. package/lib/Message.js.map +1 -1
  65. package/lib/Meter.js +1 -1
  66. package/lib/Meter.js.map +1 -1
  67. package/lib/Modal.js +1 -1
  68. package/lib/Modal.js.map +1 -1
  69. package/lib/ModalController.js +1 -1
  70. package/lib/ModalController.js.map +1 -1
  71. package/lib/NavItem.js +1 -1
  72. package/lib/NavItem.js.map +1 -1
  73. package/lib/NavToggle.js +1 -1
  74. package/lib/Notification.js +1 -1
  75. package/lib/Notification.js.map +1 -1
  76. package/lib/NumberField.js +1 -1
  77. package/lib/NumberField.js.map +1 -1
  78. package/lib/OtpField.js +1 -1
  79. package/lib/OtpField.js.map +1 -1
  80. package/lib/Outline.js +2 -0
  81. package/lib/Outline.js.map +1 -0
  82. package/lib/OutlineItem.js +2 -0
  83. package/lib/OutlineItem.js.map +1 -0
  84. package/lib/Pagination.js +1 -1
  85. package/lib/Pagination.js.map +1 -1
  86. package/lib/{Popout-DpN7PP9h.js → Popout-CFtFoCaA.js} +2 -2
  87. package/lib/{Popout-DpN7PP9h.js.map → Popout-CFtFoCaA.js.map} +1 -1
  88. package/lib/Popout.js +1 -1
  89. package/lib/Qrcode.js.map +1 -1
  90. package/lib/ScrollArea.js.map +1 -1
  91. package/lib/ShortcutController-CV5b0BZl.js +2 -0
  92. package/lib/ShortcutController-CV5b0BZl.js.map +1 -0
  93. package/lib/Stack.js.map +1 -1
  94. package/lib/Tag.js +1 -1
  95. package/lib/Tag.js.map +1 -1
  96. package/lib/TagGroup.js.map +1 -1
  97. package/lib/Textarea.js +1 -1
  98. package/lib/Textarea.js.map +1 -1
  99. package/lib/TimePicker.js +1 -1
  100. package/lib/TimePicker.js.map +1 -1
  101. package/lib/TopBar.js.map +1 -1
  102. package/lib/Truncate.js.map +1 -1
  103. package/lib/VisuallyHidden.js.map +1 -1
  104. package/lib/bundle.js +13 -13
  105. package/lib/bundle.js.map +1 -1
  106. package/lib/en-us.js +1 -1
  107. package/lib/en-us.js.map +1 -1
  108. package/lib/fi-fi.js +1 -1
  109. package/lib/fi-fi.js.map +1 -1
  110. package/lib/index.js +1 -1
  111. package/lib/localization19.js +1 -1
  112. package/lib/localization19.js.map +1 -1
  113. package/lib/localization20.js +1 -1
  114. package/lib/localization20.js.map +1 -1
  115. package/lib/localization21.js +1 -1
  116. package/lib/localization21.js.map +1 -1
  117. package/lib/localization22.js +1 -1
  118. package/lib/localization22.js.map +1 -1
  119. package/lib/localization23.js +2 -0
  120. package/lib/localization23.js.map +1 -0
  121. package/lib/react.d.ts +15 -0
  122. package/lib/src/accordion/Accordion.d.ts +1 -1
  123. package/lib/src/accordion/AccordionHeader.d.ts +1 -1
  124. package/lib/src/accordion/AccordionItem.d.ts +1 -1
  125. package/lib/src/accordion/AccordionPanel.d.ts +1 -1
  126. package/lib/src/accordion/AccordionTrigger.d.ts +4 -3
  127. package/lib/src/aside/Aside.d.ts +1 -1
  128. package/lib/src/aside-drawer/AsideDrawer.d.ts +1 -1
  129. package/lib/src/autocomplete/Autocomplete.d.ts +4 -4
  130. package/lib/src/avatar/Avatar.d.ts +1 -1
  131. package/lib/src/calendar/Calendar.d.ts +1 -1
  132. package/lib/src/card/Card.d.ts +1 -1
  133. package/lib/src/collapsible/Collapsible.d.ts +1 -1
  134. package/lib/src/collapsible/CollapsiblePanel.d.ts +1 -1
  135. package/lib/src/collapsible/CollapsibleTrigger.d.ts +1 -1
  136. package/lib/src/combobox/ComboboxBase.d.ts +7 -7
  137. package/lib/src/common/controllers/ShortcutController.d.ts +5 -5
  138. package/lib/src/divider/Divider.d.ts +1 -1
  139. package/lib/src/drawer/Drawer.d.ts +1 -1
  140. package/lib/src/footer/Footer.d.ts +1 -1
  141. package/lib/src/header/Header.d.ts +1 -1
  142. package/lib/src/icon/Icon.d.ts +1 -1
  143. package/lib/src/index.d.ts +2 -0
  144. package/lib/src/kbd/Kbd.d.ts +1 -1
  145. package/lib/src/kbd/KbdGroup.d.ts +1 -1
  146. package/lib/src/layout/Layout.d.ts +1 -1
  147. package/lib/src/localization/en-us.d.ts +3 -0
  148. package/lib/src/localization/translation.d.ts +3 -0
  149. package/lib/src/otp-field/OtpField.d.ts +11 -0
  150. package/lib/src/outline/Outline.d.ts +111 -0
  151. package/lib/src/outline/OutlineItem.d.ts +42 -0
  152. package/lib/src/outline/localization.d.ts +4 -0
  153. package/lib/src/qrcode/Qrcode.d.ts +1 -1
  154. package/lib/src/scroll-area/ScrollArea.d.ts +1 -1
  155. package/lib/src/stack/Stack.d.ts +1 -1
  156. package/lib/src/tag/Tag.d.ts +1 -1
  157. package/lib/src/tag-group/TagGroup.d.ts +1 -1
  158. package/lib/src/top-bar/TopBar.d.ts +1 -1
  159. package/lib/src/truncate/Truncate.d.ts +1 -1
  160. package/lib/src/visually-hidden/VisuallyHidden.d.ts +1 -1
  161. package/lib/tinykeys-DwvDXsEb.js +2 -0
  162. package/lib/tinykeys-DwvDXsEb.js.map +1 -0
  163. package/lib/translation.js +1 -1
  164. package/lib/translation.js.map +1 -1
  165. package/lib/vue.d.ts +11 -0
  166. package/package.json +5 -5
  167. package/lib/Calendar-C1SxrlzN.js +0 -2
  168. package/lib/Calendar-C1SxrlzN.js.map +0 -1
  169. package/lib/Combobox-By4h1Sp-.js +0 -2
  170. package/lib/Combobox-By4h1Sp-.js.map +0 -1
  171. package/lib/ShortcutController-BIb3WGzH.js +0 -2
  172. package/lib/ShortcutController-BIb3WGzH.js.map +0 -1
  173. package/lib/tinykeys.module-_6MZt7MP.js +0 -2
  174. package/lib/tinykeys.module-_6MZt7MP.js.map +0 -1
@@ -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 {};
@@ -0,0 +1,4 @@
1
+ declare const outlineLocalization: {
2
+ label: string;
3
+ };
4
+ export default outlineLocalization;
@@ -4,7 +4,7 @@ import { LitElement } from 'lit';
4
4
  * to users which they can quickly scan with their smartphone.
5
5
  *
6
6
  * @status ready
7
- * @category image
7
+ * @category content
8
8
  * @displayName QR Code
9
9
  */
10
10
  export default class Qrcode extends LitElement {
@@ -12,7 +12,7 @@ declare const ScrollArea_base: typeof LitElement;
12
12
  * The scroll machinery lives in shadow DOM; slot your content directly inside.
13
13
  *
14
14
  * @status draft
15
- * @category structure
15
+ * @category layout
16
16
  *
17
17
  * @slot - The scrollable content.
18
18
  *
@@ -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 structure
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).
@@ -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 text
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 structure
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 structure
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 text
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
  */
@@ -5,7 +5,7 @@ import { LitElement } from 'lit';
5
5
  * hidden.
6
6
  *
7
7
  * @status ready
8
- * @category text
8
+ * @category content
9
9
  * @slot - The visually hidden content.
10
10
  */
11
11
  export default class VisuallyHidden extends LitElement {
@@ -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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EEY,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]}
@@ -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 u(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,u as resolveTranslation,s as subscribeToDocumentLang,m as subscribeToTranslationRegistration};
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";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
@@ -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":"upBAqBA,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"}
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","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AAM,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.0-alpha.0",
4
+ "version": "5.0.0",
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": "^1.4.0"
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.0-alpha.0",
54
- "@nordhealth/tokens": "^9.0.0-alpha.0",
53
+ "@nordhealth/themes": "^9.1.0",
54
+ "@nordhealth/tokens": "^8.2.0",
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": "d2dc72c154367b3cfd96fef8d316315df2e9f246"
91
+ "gitHead": "2519b8c8f89f72bbb22d4e62528a58ea8c3d9150"
92
92
  }
@@ -1,2 +0,0 @@
1
- import{_ as e}from"./tslib.es6-CmLYFWVC.js";import{css as a,LitElement as n,isServer as t,html as i}from"lit";import{query as r,property as s,state as o,customElement as d}from"lit/decorators.js";import{classMap as l}from"lit/directives/class-map.js";import{repeat as c}from"lit/directives/repeat.js";import{o as h}from"./tinykeys.module-_6MZt7MP.js";import{m as u,c as v}from"./collection-Dvg2XbxV.js";import{D as p}from"./DirectionController-ChvNGESZ.js";import{E as g}from"./EventController-BBOmvfLa.js";import{D as m,k as f,p as y,a as b,d as x,l as w,m as z,n as D,o as k,q as $,b as _,s as S,r as F,t as M,u as T,g as C,v as Y}from"./dates-C-ZvzXaC.js";import{o as j}from"./observe-D0n0zOfU.js";import{c as N}from"./cond-CI1KbneT.js";import{r as R}from"./number-Dg2vCfGd.js";import{s as E}from"./Component-BJ5O5n8k.js";import L from"./Icon.js";import{LocalizeController as O}from"./LocalizeController.js";import{DateRangeSelectEvent as X}from"./DateRangeSelectEvent.js";import{DateSelectEvent as W}from"./DateSelectEvent.js";import"./Button.js";import"./VisuallyHidden.js";var A=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m.100342 6.92903 2.121318-2.12132 7.77818 7.77819 7.77826-7.77828 2.1213 2.12132-8.4853 8.48536c-.7811.7811-2.04743.7811-2.82848 0z" fill="currentColor"/></svg>',tags:"nordicon arrow down small caret pointing triangle chevron",title:"arrow-down-small"});var U=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m13.0712.105225 2.1213 2.121315-7.77816 7.77816 7.77826 7.7783-2.1213 2.1213-8.48539-8.4854c-.78105-.781-.78105-2.04735 0-2.82839z" fill="currentColor"/></svg>',tags:"nordicon arrow left small caret pointing triangle chevron",title:"arrow-left-small"});var H=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m6.92903.100342-2.12132 2.121318 7.77819 7.77818-7.77828 7.77826 2.12132 2.1213 8.48536-8.4853c.7811-.7811.7811-2.04743 0-2.82848z" fill="currentColor"/></svg>',tags:"nordicon arrow right small caret pointing triangle chevron",title:"arrow-right-small"});const I=e=>e.preventDefault();class P{constructor(e,a){this.hadFirstUpdate=!1,this.initialTouchX=0,this.initialTouchY=0,this.handleTouchStart=e=>{const[{pageX:a,pageY:n}]=e.changedTouches;this.initialTouchX=a,this.initialTouchY=n},this.handleTouchEnd=e=>{const[{pageX:a,pageY:n}]=e.changedTouches,{matchesGesture:t,onSwipeEnd:i}=this.options,r=a-this.initialTouchX,s=n-this.initialTouchY,o={initialX:this.initialTouchX,initialY:this.initialTouchY,pageX:a,pageY:n,distX:r,distY:s};t(o)&&(e.preventDefault(),i(o))},e.addController(this),this.events=new g(e),this.options={target:()=>e,...a}}hostUpdated(){if(!this.hadFirstUpdate){this.hadFirstUpdate=!0;const e=this.options.target();this.events.listen(e,"touchstart",this.handleTouchStart),this.events.listen(e,"touchmove",I),this.events.listen(e,"touchend",this.handleTouchEnd)}}hostDisconnected(){this.hadFirstUpdate=!1}}function B({distX:e,distY:a}){return Math.abs(e)>=70&&Math.abs(a)<=70}function q({distX:e,distY:a}){return Math.abs(a)>=70&&Math.abs(e)<=70&&a>0}const V=a`:host{--_n-calendar-box-shadow:var(--n-calendar-box-shadow,var(--n-box-shadow-popout));--_n-calendar-border-radius:var(--n-calendar-border-radius,var(--n-border-radius-s));--_n-calendar-highlight-color:var(--n-calendar-highlight-color,var(--n-color-accent));--_n-calendar-padding-block-start:var(--n-calendar-padding-block,var(--n-space-m));--_n-calendar-padding-block-end:var(--n-calendar-padding-block,var(--n-space-m));--_n-calendar-padding-inline:var(--n-calendar-padding-inline,var(--n-space-m));--_n-calendar-day-size:var(--n-calendar-day-size,var(--n-space-xl));--_n-calendar-day-font-size:var(--n-calendar-day-font-size,var(--n-font-size-m));--_n-calendar-select-label-font-size:var(--n-calendar-select-label-font-size,var(--n-font-size-xl));--_n-calendar-nav-padding-inline:var(--n-calendar-nav-padding-inline,11px);--_n-calendar-nav-gap:var(--n-calendar-nav-gap,var(--n-space-xs));--_n-calendar-header-margin-block-end:var(--n-calendar-header-margin-block-end,var(--n-space-m));--_n-calendar-header-padding-block-end:var(--n-calendar-header-padding-block-end,0);--_n-calendar-header-gap:var(--n-calendar-header-gap,var(--n-space-s));--_n-calendar-inline-size:var(--n-calendar-inline-size,max-content);font-feature-settings:var(--n-font-features-reduced)}:host([size=s]){--_n-calendar-day-size:var(--n-calendar-day-size,calc(var(--n-space-l) + var(--n-space-xs)));--_n-calendar-day-font-size:var(--n-calendar-day-font-size,var(--n-font-size-s));--_n-calendar-select-label-font-size:var(--n-calendar-select-label-font-size,var(--n-font-size-l));--_n-calendar-nav-padding-inline:var(--n-calendar-nav-padding-inline,var(--n-space-s));--_n-calendar-header-margin-block-end:var(--n-calendar-header-margin-block-end,var(--n-space-s));--_n-calendar-header-padding-block-end:var(--n-calendar-header-padding-block-end,var(--n-space-xs))}.n-calendar{background:var(--n-color-surface);border-radius:var(--_n-calendar-border-radius);box-shadow:var(--_n-calendar-box-shadow);inline-size:var(--_n-calendar-inline-size);min-inline-size:min-content;padding-block-end:var(--_n-calendar-padding-block-end);padding-block-start:var(--_n-calendar-padding-block-start);padding-inline-end:var(--_n-calendar-padding-inline);padding-inline-start:var(--_n-calendar-padding-inline);user-select:none}:host([expand]){--_n-calendar-inline-size:var(--n-calendar-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);inline-size:100%;text-align:center}.n-calendar-table-header{font-size:var(--n-font-size-s);font-weight:var(--n-font-weight-active);letter-spacing:1px;padding-block-end:var(--n-space-s);text-decoration:none;text-transform:uppercase}.n-calendar-cell{padding:1px;text-align:center}.n-calendar-day{appearance:none;background:#0000;block-size:var(--_n-calendar-day-size);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-calendar-day-font-size);font-variant-numeric:tabular-nums;font-weight:var(--n-font-weight);inline-size:var(--_n-calendar-day-size);padding:0 0 1px;position:relative;text-align:center;vertical-align:middle}.n-calendar-day[aria-current=date]{box-shadow:0 0 0 1px var(--n-color-text-link);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:#0000;color:var(--n-color-text-weakest)}.n-calendar-day[aria-disabled=true]{color:var(--n-color-text-weaker);cursor:default;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{background:var(--n-color-accent);box-shadow:0 0 5px 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:#0000;box-shadow:none;color:var(--n-color-text-weakest);cursor:default;pointer-events:none}.n-calendar-day.is-outside:before{display:none}:host([range]) .n-calendar-day.is-in-range{background:var(--n-color-active);color:var(--n-color-text)}.n-calendar-day.is-highlighted:after{--_n-calendar-highlight-size:5px;background-color:var(--_n-calendar-highlight-color);block-size:var(--_n-calendar-highlight-size);border-radius:var(--n-border-radius-circle);content:"";inline-size:var(--_n-calendar-highlight-size);inset-block-end:var(--n-space-xs);inset-inline-start:calc(50% - var(--_n-calendar-highlight-size)/2);position:absolute}.n-calendar-day.is-highlighted.is-month:is([aria-pressed=true],:focus):not([aria-disabled=true]):after{background-color:var(--n-color-text-on-accent)}.n-calendar-day.is-highlighted:is(:not(.is-month),.is-outside,[aria-disabled=true]):after{background-color:var(--n-color-text-weakest)}.n-calendar-header{align-items:center;column-gap:var(--_n-calendar-header-gap);display:flex;inline-size:100%;justify-content:space-between;margin-block-end:var(--_n-calendar-header-margin-block-end);padding-block-end:var(--_n-calendar-header-padding-block-end)}.n-calendar-header.is-static{column-gap:var(--n-space-xs)}.n-calendar-title{color:var(--n-color-text);flex:1;font-size:var(--n-font-size-m);font-weight:var(--n-font-weight-heading);margin:0;text-align:center}.n-calendar-header.is-static nord-button.is-hidden{visibility:hidden}.n-calendar.has-multiple-months{align-items:flex-start;display:flex;flex-direction:row;gap:var(--n-space-l)}.n-calendar.has-multiple-months .n-calendar-month{flex:1;min-inline-size:0}.n-calendar-nav{column-gap:var(--_n-calendar-nav-gap);display:flex;white-space:nowrap}.n-calendar-nav nord-button{--_n-button-padding-inline:var(--_n-calendar-nav-padding-inline)}.n-calendar-select{display:inline-flex;line-height:var(--n-line-height);position:relative}.n-calendar-select span{margin-inline-end:var(--n-space-s)}.n-calendar-select select{block-size:100%;cursor:pointer;font-size:var(--n-font-size-l);inline-size:100%;inset-block-start:0;inset-inline-start:0;opacity:0;position:absolute}.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-calendar-select-label-font-size);font-weight:var(--n-font-weight-active);inline-size:100%;padding-block:0;padding-inline-end:var(--n-space-xs);padding-inline-start:var(--n-space-s);pointer-events:none;position:relative}`;function G(e){return a=>{a.preventDefault(),e(a)}}L.registerIcon(H),L.registerIcon(U),L.registerIcon(A);const J=()=>!1,K=()=>!1;function Q(e,a){return null==e||null==a||e.getTime()<=a.getTime()?[e,a]:[a,e]}let Z=class extends n{constructor(){super(...arguments),this.direction=new p(this),this.swipe=new P(this,{matchesGesture:B,onSwipeEnd:({distX:e})=>this.addMonths(e<0?1:-1)}),this.shortcuts=h({ArrowRight:G((()=>this.addDays(this.direction.isLTR?1:-1))),ArrowLeft:G((()=>this.addDays(this.direction.isLTR?-1:1))),ArrowDown:G((()=>this.addDays(7))),ArrowUp:G((()=>this.addDays(-7))),Home:G((()=>this.startOfWeek())),End:G((()=>this.endOfWeek())),PageUp:G((()=>this.addMonths(-1))),PageDown:G((()=>this.addMonths(1))),"Shift+PageUp":G((()=>this.addYears(-1))),"Shift+PageDown":G((()=>this.addYears(1)))}),this.localize=new O(this,{onLangChange:()=>this.handleLangChange()}),this.value="",this.firstDayOfWeek=m.Monday,this.expand=!1,this.size="m",this.isDateDisabled=J,this.isDateHighlighted=K,this.range=!1,this.months=1,this.activeFocus=!1,this.focusedDay=new Date,this.handleDaySelect=e=>{const a=f(e,y(this.min||""),y(this.max||"")),n=!this.isDateDisabled(e);a&&n&&(this.range?this.selectRangeDay(e):(this.value=b(e),this.dispatchEvent(new W("change",e))))},this.handleDayHover=e=>{this.range&&this.pendingRangeStart&&(this.hoveredDay=e)},this.handleMonthSelect=e=>{this.setMonth(Number.parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(Number.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=e=>{const a=e.currentTarget,n=e.relatedTarget;n&&!a.contains(n)&&(this.activeFocus=!1)}}focus(e){var a;const n=null!==(a=null==e?void 0:e.target)&&void 0!==a?a:"day";"day"===n?this.focusedDayNode.focus():"month"===n&&this.monthSelectNode.focus()}render(){var e;const a=this.getToday(),n=y(this.value),r=y(this.rangeStart||""),s=y(this.rangeEnd||""),o=this.pendingRangeStart?null!==(e=this.hoveredDay)&&void 0!==e?e:this.focusedDay:void 0,[d,h]=this.pendingRangeStart?Q(this.pendingRangeStart,o):Q(r,s),p=y(this.min||""),g=y(this.max||""),m=p?x(p):void 0,b=g?w(g):void 0,k=a.getFullYear(),$=p?p.getFullYear():k-100,_=g?g.getFullYear():k+10;t&&this.handleLangChange();const S=Math.max(1,this.months),F=Array.from({length:S},((e,a)=>new Date(this.focusedDay.getFullYear(),this.focusedDay.getMonth()+a,1))),M=S>1,T=null!=p&&F.some((e=>z(p,e))),C=null!=g&&F.some((e=>z(g,e))),j=(e,t)=>{const r=z(e,t);if(M&&!r)return i`<td class="n-calendar-cell" aria-hidden="true"></td>`;const s=!f(e,p,g),o=Y(e,a),c=this.isDateDisabled(e),u=this.isDateHighlighted(e),v=this.dateFormatShort.format(e),m=this.range&&null!=d&&Y(e,d),y=this.range&&null!=h&&Y(e,h),b=this.range&&null!=d&&null!=h&&e>=d&&e<=h,x=this.range?m||y:Y(e,n),w=null!=d&&Y(d,h),D=u&&"string"==typeof u?`${v}, ${u}`:v;return i`<td class="n-calendar-cell"><button type="button" tabindex="${Y(e,this.focusedDay)?0:-1}" class="${l({"n-calendar-day":!0,"is-outside":s,"is-month":r,"is-highlighted":u,"is-in-range":b&&!x,"is-range-start":m&&!w,"is-range-end":y&&!w})}" @click="${()=>this.handleDaySelect(e)}" @mouseenter="${()=>this.handleDayHover(e)}" @keydown="${this.shortcuts}" ?disabled="${s}" aria-disabled="${N(c,"true")}" aria-pressed="${x?"true":"false"}" aria-current="${N(o,"date")}" aria-label="${D}"><span aria-hidden="true">${e.getDate()}</span></button></td>`},E=(e,a,n)=>{const t=e.getMonth(),r=e.getFullYear();if(M){const e=0===a,s=a===S-1;return i`<div class="n-calendar-header is-static"><nord-button class="${l({"n-calendar-prev":!0,"is-hidden":!e})}" size="${this.size}" square variant="plain" @click="${this.handlePreviousMonthClick}" ?disabled="${!e||T}" type="button"><nord-visually-hidden>${this.localize.term("prevMonthLabel")}</nord-visually-hidden><nord-icon name="${this.direction.isLTR?"arrow-left-small":"arrow-right-small"}" size="${"s"===this.size?"xs":"s"}"></nord-icon></nord-button><h2 class="n-calendar-title" id="${n}" aria-live="polite" aria-atomic="true">${this.monthNames[t]} ${r}</h2><nord-button class="${l({"n-calendar-next":!0,"is-hidden":!s})}" size="${this.size}" square variant="plain" @click="${this.handleNextMonthClick}" ?disabled="${!s||C}" type="button"><nord-visually-hidden>${this.localize.term("nextMonthLabel")}</nord-visually-hidden><nord-icon name="${this.direction.isLTR?"arrow-right-small":"arrow-left-small"}" size="${"s"===this.size?"xs":"s"}"></nord-icon></nord-button></div>`}return i`<div class="n-calendar-header"><div><nord-visually-hidden><h2 id="${n}" aria-live="polite" aria-atomic="true">${this.monthNames[t]}, ${r}</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,a)=>i`<option value="${a}" ?selected="${a===t}" ?disabled="${!f(new Date(r,a,1),m,b)}">${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="xxs"></nord-icon></div></div><div class="n-calendar-select"><select aria-label="${this.localize.term("yearSelectLabel")}" class="n-calendar-select-year" @input="${this.handleYearSelect}">${c(R($,_),(e=>e),(e=>i`<option ?selected="${e===r}">${e}</option>`))}</select><div class="n-calendar-select-label" aria-hidden="true"><span>${r}</span><nord-icon color="var(--n-color-icon)" name="arrow-down-small" size="xxs"></nord-icon></div></div></div><div class="n-calendar-nav"><nord-button class="n-calendar-prev" size="${this.size}" square @click="${this.handlePreviousMonthClick}" ?disabled="${z(p,e)}" type="button"><nord-visually-hidden>${this.localize.term("prevMonthLabel")}</nord-visually-hidden><nord-icon name="${this.direction.isLTR?"arrow-left-small":"arrow-right-small"}" size="${"s"===this.size?"xs":"s"}"></nord-icon></nord-button><nord-button class="n-calendar-next" size="${this.size}" square @click="${this.handleNextMonthClick}" ?disabled="${z(g,e)}" type="button"><nord-visually-hidden>${this.localize.term("nextMonthLabel")}</nord-visually-hidden><nord-icon name="${this.direction.isLTR?"arrow-right-small":"arrow-left-small"}" size="${"s"===this.size?"xs":"s"}"></nord-icon></nord-button></div></div>`};return i`<div class="${l({"n-calendar":!0,"has-multiple-months":M})}">${F.map(((e,a)=>{const n=`dialog-header-${a}`;return i`<div class="n-calendar-month">${E(e,a,n)}<table class="n-calendar-table" aria-labelledby="${n}" @focusin="${this.enableActiveFocus}" @focusout="${this.disableActiveFocus}"><thead><tr>${u(this.dayNames,this.firstDayOfWeek,((e,a)=>i`<th class="n-calendar-table-header" scope="col"><span aria-hidden="true">${this.dayNamesShort[a]}</span><nord-visually-hidden>${e}</nord-visually-hidden></th>`))}</tr></thead><tbody>${v(D(e,this.firstDayOfWeek),7).map((a=>i`<tr class="n-calendar-row">${a.map((a=>j(a,e)))}</tr>`))}</tbody></table></div>`}))}</div>`}handleValueChange(){this.range||this.setFocusedDay(y(this.value)||this.getToday())}handleRangeChange(){if(!this.range)return;const e=y(this.rangeStart||""),a=y(this.rangeEnd||"");this.setFocusedDay(e||a||this.getToday())}handleFocusedDayChange(){this.activeFocus&&this.focusedDayNode.focus()}handleLangChange(){const e=this.localize.resolvedLang;this.dateFormatShort=new Intl.DateTimeFormat(e,{day:"numeric",month:"long"}),this.monthNames=k(e,"long"),this.monthNamesShort=k(e,"short"),this.dayNames=$(e,"long"),this.dayNamesShort=$(e,"narrow")}selectRangeDay(e){if(!this.pendingRangeStart)return this.pendingRangeStart=e,this.hoveredDay=e,this.rangeStart=b(e),void(this.rangeEnd=b(e));const[a,n]=Q(this.pendingRangeStart,e);this.pendingRangeStart=void 0,this.hoveredDay=void 0,this.rangeStart=b(a),this.rangeEnd=b(n),this.dispatchEvent(new X("range-change",a,n))}getToday(){return y(this.today||"")||new Date}addDays(e){this.setFocusedDay(_(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(S(this.focusedDay,this.firstDayOfWeek))}endOfWeek(){this.setFocusedDay(F(this.focusedDay,this.firstDayOfWeek))}setMonth(e){const a=M(x(this.focusedDay),e),n=w(a),t=M(this.focusedDay,e);this.setFocusedDay(T(t,a,n))}setYear(e){const a=C(x(this.focusedDay),e),n=w(a),t=C(this.focusedDay,e);this.setFocusedDay(T(t,a,n))}setFocusedDay(e){this.focusedDay=T(e,y(this.min||""),y(this.max||"")),this.dispatchEvent(new W("nord-focus-date",this.focusedDay))}};Z.styles=[E,V],e([r(".n-calendar-select-month",!0)],Z.prototype,"monthSelectNode",void 0),e([r('button[tabindex="0"]')],Z.prototype,"focusedDayNode",void 0),e([s()],Z.prototype,"value",void 0),e([s({reflect:!0,type:Number,attribute:"first-day-of-week"})],Z.prototype,"firstDayOfWeek",void 0),e([s({reflect:!0})],Z.prototype,"min",void 0),e([s({reflect:!0})],Z.prototype,"max",void 0),e([s({reflect:!0})],Z.prototype,"today",void 0),e([s({reflect:!0,type:Boolean})],Z.prototype,"expand",void 0),e([s({reflect:!0})],Z.prototype,"size",void 0),e([s({attribute:!1})],Z.prototype,"isDateDisabled",void 0),e([s({attribute:!1})],Z.prototype,"isDateHighlighted",void 0),e([s({reflect:!0,type:Boolean})],Z.prototype,"range",void 0),e([s({reflect:!0,attribute:"range-start"})],Z.prototype,"rangeStart",void 0),e([s({reflect:!0,attribute:"range-end"})],Z.prototype,"rangeEnd",void 0),e([s({reflect:!0,type:Number})],Z.prototype,"months",void 0),e([o()],Z.prototype,"activeFocus",void 0),e([o()],Z.prototype,"focusedDay",void 0),e([o()],Z.prototype,"pendingRangeStart",void 0),e([o()],Z.prototype,"hoveredDay",void 0),e([j("value")],Z.prototype,"handleValueChange",null),e([j("rangeStart"),j("rangeEnd")],Z.prototype,"handleRangeChange",null),e([j("focusedDay","updated")],Z.prototype,"handleFocusedDayChange",null),Z=e([d("nord-calendar")],Z);var ee=Z;export{ee as C,P as S,q as i};
2
- //# sourceMappingURL=Calendar-C1SxrlzN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Calendar-C1SxrlzN.js","sources":["../../icons/lib/assets/arrow-down-small.js","../../icons/lib/assets/arrow-left-small.js","../../icons/lib/assets/arrow-right-small.js","../src/common/controllers/SwipeController.ts","../src/calendar/Calendar.ts"],"sourcesContent":["export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m.100342 6.92903 2.121318-2.12132 7.77818 7.77819 7.77826-7.77828 2.1213 2.12132-8.4853 8.48536c-.7811.7811-2.04743.7811-2.82848 0z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-down-small\";\nexport const tags = \"nordicon arrow down small caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m13.0712.105225 2.1213 2.121315-7.77816 7.77816 7.77826 7.7783-2.1213 2.1213-8.48539-8.4854c-.78105-.781-.78105-2.04735 0-2.82839z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-left-small\";\nexport const tags = \"nordicon arrow left small caret pointing triangle chevron\";\n","export default '<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m6.92903.100342-2.12132 2.121318 7.77819 7.77818-7.77828 7.77826 2.12132 2.1213 8.48536-8.4853c.7811-.7811.7811-2.04743 0-2.82848z\" fill=\"currentColor\"/></svg>';\nexport const title = \"arrow-right-small\";\nexport const tags =\n \"nordicon arrow right small caret pointing triangle chevron\";\n","import type { ReactiveController, ReactiveElement } from 'lit'\nimport { EventController } from './EventController.js'\n\nexport interface 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] }\ninterface 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 function isHorizontalSwipe({ distX, distY }: SwipeDetails) {\n return Math.abs(distX) >= THRESHOLD && Math.abs(distY) <= THRESHOLD\n}\n\nexport function isDownwardsSwipe({ distX, distY }: SwipeDetails) {\n return Math.abs(distY) >= THRESHOLD && Math.abs(distX) <= THRESHOLD && distY > 0\n}\n","import * as arrowDownIcon from '@nordhealth/icons/lib/assets/arrow-down-small.js'\nimport * as arrowLeftIcon from '@nordhealth/icons/lib/assets/arrow-left-small.js'\nimport * as arrowRightIcon from '@nordhealth/icons/lib/assets/arrow-right-small.js'\nimport { html, isServer, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { createKeybindingsHandler } from 'tinykeys'\n\nimport { chunk, mapWithOffset } from '../common/collection.js'\nimport { DirectionController } from '../common/controllers/DirectionController.js'\nimport { isHorizontalSwipe, SwipeController } from '../common/controllers/SwipeController.js'\n\nimport {\n addDays,\n clamp,\n DaysOfWeek,\n endOfMonth,\n endOfWeek,\n getDayNames,\n getMonthNames,\n getViewOfMonth,\n inRange,\n isEqual,\n isEqualMonth,\n parseISODate,\n printISODate,\n setMonth,\n setYear,\n startOfMonth,\n startOfWeek,\n} from '../common/dates.js'\nimport { observe } from '../common/decorators/observe.js'\nimport { cond } from '../common/directives/cond.js'\nimport { range } from '../common/number.js'\nimport componentStyle from '../common/styles/Component.css'\nimport Icon from '../icon/Icon.js'\nimport { LocalizeController } from '../localization/LocalizeController.js'\nimport style from './Calendar.css'\n\nimport { DateRangeSelectEvent } from './DateRangeSelectEvent.js'\nimport { DateSelectEvent } from './DateSelectEvent.js'\nimport '../button/Button.js'\nimport '../visually-hidden/VisuallyHidden.js'\n\nexport type DatePredicate = (date: Date) => boolean\n\nIcon.registerIcon(arrowRightIcon)\nIcon.registerIcon(arrowLeftIcon)\nIcon.registerIcon(arrowDownIcon)\n\nfunction preventDefault(fn: EventListener) {\n return (e: Event) => {\n e.preventDefault()\n fn(e)\n }\n}\n\nconst isDateDisabled: DatePredicate = () => false\nconst isDateHighlighted = () => false\n\nconst dialogLabelId = 'dialog-header'\n\n/**\n * Orders two (possibly undefined) dates ascending. Returns `[earlier, later]`,\n * preserving `undefined` slots so callers can render a partial range.\n */\nfunction orderDates(a?: Date, b?: Date): [Date | undefined, Date | undefined] {\n if (a == null || b == null) {\n return [a, b]\n }\n return a.getTime() <= b.getTime() ? [a, b] : [b, a]\n}\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 {DateRangeSelectEvent} range-change - Dispatched in `range` mode when a complete range (start and end) has been selected.\n * @fires {DateSelectEvent} nord-focus-date - Dispatched when the calendar's focused date changes.\n *\n * @cssprop [--n-calendar-border-radius=var(--n-border-radius)] - Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).\n * @cssprop [--n-calendar-box-shadow=var(--n-box-shadow-popout)] - Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).\n * @cssprop [--n-calendar-padding-block=var(--n-space-m)] - Controls the block padding of the calendar, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-padding-inline=var(--n-space-m)] - Controls the inline padding of the calendar, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-day-size=var(--n-space-xl)] - Controls the block and inline size of each day cell, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-day-font-size=var(--n-font-size-m)] - Controls the font size of each day cell, using [font size tokens](/tokens/#font-size).\n * @cssprop [--n-calendar-select-label-font-size=var(--n-font-size-xl)] - Controls the font size of the month and year select labels, using [font size tokens](/tokens/#font-size).\n * @cssprop [--n-calendar-nav-padding-inline=11px] - Controls the inline padding of the previous and next month buttons.\n * @cssprop [--n-calendar-nav-gap=var(--n-space-xs)] - Controls the gap between the previous and next month buttons, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-header-margin-block-end=var(--n-space-m)] - Controls the block-end margin of the calendar header, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-header-padding-block-end=0] - Controls the block-end padding of the calendar header, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-header-gap=var(--n-space-s)] - Controls the gap between the month/year selects and the navigation buttons, using [space tokens](/tokens/#space).\n * @cssprop [--n-calendar-inline-size=max-content] - Controls the inline size of the calendar. Defaults to `100%` when the `expand` attribute is set.\n *\n * @localization prevMonthLabel - Accessible label for the previous month button.\n * @localization nextMonthLabel - Accessible label for the next month button.\n * @localization monthSelectLabel - Accessible label for the month select.\n * @localization yearSelectLabel - Accessible label for the year select.\n */\n@customElement('nord-calendar')\nexport default class Calendar extends LitElement {\n static styles = [componentStyle, style]\n\n @query('.n-calendar-select-month', true) private monthSelectNode!: HTMLElement\n @query(`button[tabindex=\"0\"]`) private focusedDayNode!: HTMLButtonElement\n\n private direction = new DirectionController(this)\n private swipe = new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })\n\n private shortcuts = createKeybindingsHandler({\n 'ArrowRight': preventDefault(() => this.addDays(this.direction.isLTR ? 1 : -1)),\n 'ArrowLeft': preventDefault(() => this.addDays(this.direction.isLTR ? -1 : 1)),\n 'ArrowDown': preventDefault(() => this.addDays(7)),\n 'ArrowUp': preventDefault(() => this.addDays(-7)),\n 'Home': preventDefault(() => this.startOfWeek()),\n 'End': preventDefault(() => this.endOfWeek()),\n 'PageUp': preventDefault(() => this.addMonths(-1)),\n 'PageDown': preventDefault(() => this.addMonths(1)),\n 'Shift+PageUp': preventDefault(() => this.addYears(-1)),\n 'Shift+PageDown': preventDefault(() => this.addYears(1)),\n })\n\n private localize = new LocalizeController<'nord-calendar'>(this, {\n onLangChange: () => this.handleLangChange(),\n })\n\n /**\n * Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\n * these are used to format dates exclusively for the benefit of screen readers.\n *\n * We prefer DateTimeFormat over date.toLocaleDateString, as the former has\n * better performance when formatting large number of dates. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance\n */\n private dateFormatShort!: Intl.DateTimeFormat\n private monthNames!: string[]\n private monthNamesShort!: string[]\n private dayNames!: string[]\n private dayNamesShort!: string[]\n\n /**\n * The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.\n */\n @property() value: string = ''\n\n /**\n * Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\n * Default is Monday.\n */\n @property({ reflect: true, type: Number, attribute: 'first-day-of-week' }) firstDayOfWeek: DaysOfWeek\n = 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({ reflect: true }) 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({ reflect: true }) max?: string\n\n /**\n * The date that is considered today. Must be in IS0-8601 format: YYYY-MM-DD.\n * If not set, the current local date of the user is used.\n */\n @property({ reflect: true }) today?: 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 the size of the calendar.\n */\n @property({ reflect: true }) size: 's' | 'm' = 'm'\n\n /**\n * Controls which days are disabled and therefore disallowed.\n * For example, this can be used to disallow selection of weekends.\n */\n @property({ attribute: false }) isDateDisabled: DatePredicate = isDateDisabled\n\n /**\n * Controls which days are highlighted with a small indicator.\n * Returning a \"falsy\" value will not show an indicator.\n * Returning \"truthy\" value will show the indicator, but without an accessible label.\n * Returning a string will show the indicator, and use the string as accessible label.\n * It is recommended to return a string rather than a truthy value whenever possible.\n */\n @property({ attribute: false }) isDateHighlighted: (date: Date) => string | boolean = isDateHighlighted\n\n /**\n * Opt into range selection. When `true`, clicking selects a range start, and\n * the next click selects the end (the two clicks are swapped if the second is\n * earlier than the first). The in-range days are styled, and a hover preview\n * shows the range that would result. A completed range fires `range-change`.\n *\n * This is off by default, so the calendar keeps its single-date behaviour\n * (the `value`/`change` API) unless `range` is set.\n */\n @property({ reflect: true, type: Boolean }) range = false\n\n /**\n * The start of the selected range, in ISO-8601 format: YYYY-MM-DD. Only used\n * when `range` is set. Pair with `rangeEnd` to control the selection.\n */\n @property({ reflect: true, attribute: 'range-start' }) rangeStart?: string\n\n /**\n * The end of the selected range, in ISO-8601 format: YYYY-MM-DD. Only used\n * when `range` is set. Pair with `rangeStart` to control the selection.\n */\n @property({ reflect: true, attribute: 'range-end' }) rangeEnd?: string\n\n /**\n * The number of consecutive months to display side by side, starting from the\n * focused month. Defaults to `1`. Useful with `range` for picking a span that\n * crosses months without paging — the range and its hover preview span every\n * visible month, and the navigation arrows slide the whole window. With more\n * than one month the month/year dropdowns are replaced by static titles.\n */\n @property({ reflect: true, type: Number }) months = 1\n\n @state() private activeFocus = false\n @state() private focusedDay = new Date()\n\n /**\n * While picking a range, the first click is held here until the second click\n * completes the range. `undefined` means no in-progress pick.\n */\n @state() private pendingRangeStart?: Date\n\n /** The day currently hovered while a range pick is in progress (preview). */\n @state() private hoveredDay?: 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 }\n else if (target === 'month') {\n this.monthSelectNode.focus()\n }\n }\n\n render() {\n const today = this.getToday()\n const valueAsDate = parseISODate(this.value)\n\n // Resolve the visible range bounds for `range` mode. While a range pick is\n // in progress, the second bound follows the hovered/focused day so the user\n // sees a live preview of the range that would result.\n const committedStart = parseISODate(this.rangeStart || '')\n const committedEnd = parseISODate(this.rangeEnd || '')\n const previewEnd = this.pendingRangeStart ? (this.hoveredDay ?? this.focusedDay) : undefined\n const [rangeFrom, rangeTo] = this.pendingRangeStart\n ? orderDates(this.pendingRangeStart, previewEnd)\n : orderDates(committedStart, committedEnd)\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 currentYear = today.getFullYear()\n const minYear = minDate ? minDate.getFullYear() : currentYear - 100\n const maxYear = maxDate ? maxDate.getFullYear() : currentYear + 10\n\n if (isServer) {\n // Needed when run on a server, because the `onLangChange` callback does not get triggered, so we need to manually\n // call `handleLangChange` to set the localized values for month and day names, which the `render` method relies on.\n this.handleLangChange()\n }\n\n // Render `months` consecutive month grids, anchored on the focused month.\n // They all read the same range state, so a range (and its hover preview) spans\n // months automatically.\n const count = Math.max(1, this.months)\n const months = Array.from(\n { length: count },\n (_, i) => new Date(this.focusedDay.getFullYear(), this.focusedDay.getMonth() + i, 1),\n )\n const multi = count > 1\n\n // In multi-month mode adjacent months share the same overlap days (the\n // trailing days of one month are the leading days of the next), so rendering\n // the out-of-month days in every grid would emit the same date twice —\n // duplicating `tabindex=\"0\"`, `aria-pressed` and range styling. Disable\n // boundary navigation when ANY visible month already reaches the bound, so\n // the arrows never appear enabled-but-noop.\n const reachesMin = minDate != null && months.some(monthDate => isEqualMonth(minDate, monthDate))\n const reachesMax = maxDate != null && months.some(monthDate => isEqualMonth(maxDate, monthDate))\n\n const dayCell = (day: Date, monthDate: Date) => {\n const isInMonth = isEqualMonth(day, monthDate)\n\n // In multi-month mode the leading/trailing overlap days belong to the\n // adjacent grid, so each date is rendered (and owned) by exactly one\n // month. Render an inert placeholder here instead of a duplicate button.\n if (multi && !isInMonth) {\n return html`<td class=\"n-calendar-cell\" aria-hidden=\"true\"></td>`\n }\n\n const outsideRange = !inRange(day, minDate, maxDate)\n const isToday = isEqual(day, today)\n const isDisabled = this.isDateDisabled(day)\n const isHighlighted = this.isDateHighlighted(day)\n const formattedDate = this.dateFormatShort.format(day)\n\n // In range mode the \"selected\" days are the two range ends; otherwise it is\n // the single `value`.\n const isRangeStart = this.range && rangeFrom != null && isEqual(day, rangeFrom)\n const isRangeEnd = this.range && rangeTo != null && isEqual(day, rangeTo)\n const isInRange = this.range && rangeFrom != null && rangeTo != null && day >= rangeFrom && day <= rangeTo\n const isSelected = this.range ? isRangeStart || isRangeEnd : isEqual(day, valueAsDate)\n const sameDayRange = rangeFrom != null && isEqual(rangeFrom, rangeTo)\n\n const accessibleLabel\n = isHighlighted && typeof isHighlighted === 'string' ? `${formattedDate}, ${isHighlighted}` : formattedDate\n\n return html`\n <td class=\"n-calendar-cell\">\n <button\n type=\"button\"\n tabindex=${isEqual(day, this.focusedDay) ? 0 : -1}\n class=${classMap({\n 'n-calendar-day': true,\n 'is-outside': outsideRange,\n 'is-month': isInMonth,\n 'is-highlighted': isHighlighted,\n 'is-in-range': isInRange && !isSelected,\n 'is-range-start': isRangeStart && !sameDayRange,\n 'is-range-end': isRangeEnd && !sameDayRange,\n })}\n @click=${() => this.handleDaySelect(day)}\n @mouseenter=${() => this.handleDayHover(day)}\n @keydown=${this.shortcuts}\n ?disabled=${outsideRange}\n aria-disabled=${cond(isDisabled, 'true')}\n aria-pressed=${isSelected ? 'true' : 'false'}\n aria-current=${cond(isToday, 'date')}\n aria-label=${accessibleLabel}\n >\n <span aria-hidden=\"true\">${day.getDate()}</span>\n </button>\n </td>\n `\n }\n\n // The rich month/year selects only make sense for a single month. With more\n // than one month, each shows a static title with the prev/next arrows on the\n // first/last month, so navigation slides the whole window of months.\n const header = (monthDate: Date, index: number, labelId: string) => {\n const monthIndex = monthDate.getMonth()\n const monthYear = monthDate.getFullYear()\n if (multi) {\n const isFirst = index === 0\n const isLast = index === count - 1\n return html`\n <div class=\"n-calendar-header is-static\">\n <nord-button\n class=${classMap({ 'n-calendar-prev': true, 'is-hidden': !isFirst })}\n size=${this.size}\n square\n variant=\"plain\"\n @click=${this.handlePreviousMonthClick}\n ?disabled=${!isFirst || reachesMin}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('prevMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-left-small' : 'arrow-right-small'} size=${this.size === 's' ? 'xs' : 's'}></nord-icon>\n </nord-button>\n\n <h2 class=\"n-calendar-title\" id=${labelId} aria-live=\"polite\" aria-atomic=\"true\">\n ${this.monthNames[monthIndex]} ${monthYear}\n </h2>\n\n <nord-button\n class=${classMap({ 'n-calendar-next': true, 'is-hidden': !isLast })}\n size=${this.size}\n square\n variant=\"plain\"\n @click=${this.handleNextMonthClick}\n ?disabled=${!isLast || reachesMax}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('nextMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-right-small' : 'arrow-left-small'} size=${this.size === 's' ? 'xs' : 's'}></nord-icon>\n </nord-button>\n </div>\n `\n }\n return html`\n <div class=\"n-calendar-header\">\n <div>\n <nord-visually-hidden>\n <h2 id=${labelId} aria-live=\"polite\" aria-atomic=\"true\">${this.monthNames[monthIndex]}, ${monthYear}</h2>\n </nord-visually-hidden>\n\n <div class=\"n-calendar-select\">\n <select aria-label=${this.localize.term('monthSelectLabel')} class=\"n-calendar-select-month\" @input=${this.handleMonthSelect}>\n ${this.monthNames.map(\n (month, i) => html`\n <option\n value=${i}\n ?selected=${i === monthIndex}\n ?disabled=${!inRange(new Date(monthYear, 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[monthIndex]}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n\n <div class=\"n-calendar-select\">\n <select aria-label=${this.localize.term('yearSelectLabel')} class=\"n-calendar-select-year\" @input=${this.handleYearSelect}>\n ${repeat(\n range(minYear, maxYear),\n year => year,\n year => html`<option ?selected=${year === monthYear}>${year}</option>`,\n )}\n </select>\n <div class=\"n-calendar-select-label\" aria-hidden=\"true\">\n <span>${monthYear}</span>\n <nord-icon color=\"var(--n-color-icon)\" name=\"arrow-down-small\" size=\"xxs\"></nord-icon>\n </div>\n </div>\n </div>\n\n <div class=\"n-calendar-nav\">\n <nord-button\n class=\"n-calendar-prev\"\n size=${this.size}\n square\n @click=${this.handlePreviousMonthClick}\n ?disabled=${isEqualMonth(minDate, monthDate)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('prevMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-left-small' : 'arrow-right-small'} size=${this.size === 's' ? 'xs' : 's'}></nord-icon>\n </nord-button>\n\n <nord-button\n class=\"n-calendar-next\"\n size=${this.size}\n square\n @click=${this.handleNextMonthClick}\n ?disabled=${isEqualMonth(maxDate, monthDate)}\n type=\"button\"\n >\n <nord-visually-hidden>${this.localize.term('nextMonthLabel')}</nord-visually-hidden>\n <nord-icon name=${this.direction.isLTR ? 'arrow-right-small' : 'arrow-left-small'} size=${this.size === 's' ? 'xs' : 's'}></nord-icon>\n </nord-button>\n </div>\n </div>\n `\n }\n\n return html`\n <div class=${classMap({ 'n-calendar': true, 'has-multiple-months': multi })}>\n ${months.map((monthDate, index) => {\n const labelId = `${dialogLabelId}-${index}`\n return html`\n <div class=\"n-calendar-month\">\n ${header(monthDate, index, labelId)}\n\n <table\n class=\"n-calendar-table\"\n aria-labelledby=${labelId}\n @focusin=${this.enableActiveFocus}\n @focusout=${this.disableActiveFocus}\n >\n <thead>\n <tr>\n ${mapWithOffset(\n this.dayNames,\n this.firstDayOfWeek,\n (dayName, i) => html`\n <th class=\"n-calendar-table-header\" scope=\"col\">\n <span aria-hidden=\"true\">${this.dayNamesShort[i]}</span>\n <nord-visually-hidden>${dayName}</nord-visually-hidden>\n </th>\n `,\n )}\n </tr>\n </thead>\n <tbody>\n ${chunk(getViewOfMonth(monthDate, this.firstDayOfWeek), 7).map(\n week => html`<tr class=\"n-calendar-row\">${week.map(day => dayCell(day, monthDate))}</tr>`,\n )}\n </tbody>\n </table>\n </div>\n `\n })}\n </div>\n `\n }\n\n @observe('value')\n protected handleValueChange() {\n if (this.range) {\n return\n }\n this.setFocusedDay(parseISODate(this.value) || this.getToday())\n }\n\n @observe('rangeStart')\n @observe('rangeEnd')\n protected handleRangeChange() {\n if (!this.range) {\n return\n }\n // Focus the most relevant end of the committed range so the calendar opens\n // showing it, falling back to today when nothing is set.\n const start = parseISODate(this.rangeStart || '')\n const end = parseISODate(this.rangeEnd || '')\n this.setFocusedDay(start || end || this.getToday())\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 isWithinBounds = inRange(day, parseISODate(this.min || ''), parseISODate(this.max || ''))\n const isAllowed = !this.isDateDisabled(day)\n\n if (!isWithinBounds || !isAllowed) {\n return\n }\n\n if (this.range) {\n this.selectRangeDay(day)\n return\n }\n\n this.value = printISODate(day)\n this.dispatchEvent(new DateSelectEvent('change', day))\n }\n\n /**\n * Two-click range selection: the first click starts a pending range, the\n * second completes it. The two ends are swapped if the second click is before\n * the first, so the committed range is always ordered `start <= end`.\n */\n private selectRangeDay(day: Date) {\n if (!this.pendingRangeStart) {\n this.pendingRangeStart = day\n this.hoveredDay = day\n this.rangeStart = printISODate(day)\n this.rangeEnd = printISODate(day)\n return\n }\n\n const [start, end] = orderDates(this.pendingRangeStart, day) as [Date, Date]\n this.pendingRangeStart = undefined\n this.hoveredDay = undefined\n this.rangeStart = printISODate(start)\n this.rangeEnd = printISODate(end)\n this.dispatchEvent(new DateRangeSelectEvent('range-change', start, end))\n }\n\n private handleDayHover = (day: Date) => {\n if (this.range && this.pendingRangeStart) {\n this.hoveredDay = day\n }\n }\n\n private getToday() {\n return parseISODate(this.today || '') || new Date()\n }\n\n private addDays(days: number) {\n this.setFocusedDay(addDays(this.focusedDay, days))\n }\n\n private addMonths(months: number) {\n this.setMonth(this.focusedDay.getMonth() + months)\n }\n\n private addYears(years: number) {\n this.setYear(this.focusedDay.getFullYear() + years)\n }\n\n private startOfWeek() {\n this.setFocusedDay(startOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private endOfWeek() {\n this.setFocusedDay(endOfWeek(this.focusedDay, this.firstDayOfWeek))\n }\n\n private setMonth(month: number) {\n const min = setMonth(startOfMonth(this.focusedDay), month)\n const max = endOfMonth(min)\n const date = setMonth(this.focusedDay, month)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setYear(year: number) {\n const min = setYear(startOfMonth(this.focusedDay), year)\n const max = endOfMonth(min)\n const date = setYear(this.focusedDay, year)\n\n this.setFocusedDay(clamp(date, min, max))\n }\n\n private setFocusedDay(day: Date) {\n this.focusedDay = clamp(day, parseISODate(this.min || ''), parseISODate(this.max || ''))\n this.dispatchEvent(new DateSelectEvent('nord-focus-date', this.focusedDay))\n }\n\n private handleMonthSelect = (e: Event) => {\n this.setMonth(Number.parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleYearSelect = (e: Event) => {\n this.setYear(Number.parseInt((e.target as HTMLSelectElement).value, 10))\n }\n\n private handleNextMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(1)\n }\n\n private handlePreviousMonthClick = (event: MouseEvent) => {\n event.preventDefault()\n this.addMonths(-1)\n }\n\n private enableActiveFocus = () => {\n this.activeFocus = true\n }\n\n private disableActiveFocus = (e: FocusEvent) => {\n const table = e.currentTarget as Node\n const relatedTarget = e.relatedTarget as Node\n\n if (relatedTarget && !table.contains(relatedTarget)) {\n this.activeFocus = false\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nord-calendar': Calendar\n }\n}\n"],"names":["preventDefault","e","SwipeController","constructor","host","options","this","hadFirstUpdate","initialTouchX","initialTouchY","handleTouchStart","event","pageX","pageY","changedTouches","handleTouchEnd","matchesGesture","onSwipeEnd","distX","distY","details","initialX","initialY","addController","events","EventController","target","hostUpdated","listen","hostDisconnected","isHorizontalSwipe","Math","abs","isDownwardsSwipe","fn","Icon","registerIcon","arrowRightIcon","arrowLeftIcon","arrowDownIcon","isDateDisabled","isDateHighlighted","orderDates","a","b","getTime","Calendar","LitElement","direction","DirectionController","swipe","addMonths","shortcuts","createKeybindingsHandler","ArrowRight","addDays","isLTR","ArrowLeft","ArrowDown","ArrowUp","Home","startOfWeek","End","endOfWeek","PageUp","PageDown","addYears","localize","LocalizeController","onLangChange","handleLangChange","value","firstDayOfWeek","DaysOfWeek","Monday","expand","size","range","months","activeFocus","focusedDay","Date","handleDaySelect","day","isWithinBounds","inRange","parseISODate","min","max","isAllowed","selectRangeDay","printISODate","dispatchEvent","DateSelectEvent","handleDayHover","pendingRangeStart","hoveredDay","handleMonthSelect","setMonth","Number","parseInt","handleYearSelect","setYear","handleNextMonthClick","handlePreviousMonthClick","enableActiveFocus","disableActiveFocus","table","currentTarget","relatedTarget","contains","focus","_a","focusedDayNode","monthSelectNode","render","today","getToday","valueAsDate","committedStart","rangeStart","committedEnd","rangeEnd","previewEnd","undefined","rangeFrom","rangeTo","minDate","maxDate","minDateStartOfMonth","startOfMonth","maxDateEndOfMonth","endOfMonth","currentYear","getFullYear","minYear","maxYear","isServer","count","Array","from","length","_","i","getMonth","multi","reachesMin","some","monthDate","isEqualMonth","reachesMax","dayCell","isInMonth","html","outsideRange","isToday","isEqual","isDisabled","isHighlighted","formattedDate","dateFormatShort","format","isRangeStart","isRangeEnd","isInRange","isSelected","sameDayRange","accessibleLabel","classMap","cond","getDate","header","index","labelId","monthIndex","monthYear","isFirst","isLast","term","monthNames","map","month","monthNamesShort","repeat","year","mapWithOffset","dayNames","dayName","dayNamesShort","chunk","getViewOfMonth","week","handleValueChange","setFocusedDay","handleRangeChange","start","end","handleFocusedDayChange","lang","resolvedLang","Intl","DateTimeFormat","getMonthNames","getDayNames","DateRangeSelectEvent","days","years","date","clamp","styles","componentStyle","style","__decorate","query","prototype","property","reflect","type","attribute","Boolean","state","observe","customElement"],"mappings":"mmCAAe,6OAEK,kEADC,iECDN,4OAEK,kEADC,iECDN,4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D,EAAAwK,UAAA,cAAA,GAEpCF,EAAA,CAAhBQ,KAAmC9K,EAAAwK,UAAA,mBAAA,GACnBF,EAAA,CAAhBQ,KAAuC9K,EAAAwK,UAAA,kBAAA,GAMvBF,EAAA,CAAhBQ,KAAwC9K,EAAAwK,UAAA,yBAAA,GAGxBF,EAAA,CAAhBQ,KAAiC9K,EAAAwK,UAAA,kBAAA,GAqRxBF,EAAA,CADTS,EAAQ,UAMR/K,EAAAwK,UAAA,oBAAA,MAISF,EAAA,CAFTS,EAAQ,cACRA,EAAQ,aAUR/K,EAAAwK,UAAA,oBAAA,MAGSF,EAAA,CADTS,EAAQ,aAAc,YAKtB/K,EAAAwK,UAAA,yBAAA,MA1bkBxK,EAAQsK,EAAA,CAD5BU,EAAc,kBACMhL,UAAAA"}
@@ -1,2 +0,0 @@
1
- import{css as o}from"lit";const n=o`nord-combobox,nord-combobox *,nord-combobox :after,nord-combobox :before{box-sizing:border-box}nord-combobox>.n-render-root{display:contents}nord-combobox-group,nord-combobox-option{display:none}nord-combobox{--_n-combobox-background:var(--n-input-background,var(--n-color-surface));--_n-combobox-border-color:var(--n-input-border-color,var(--n-color-border-strong));--_n-combobox-border-radius:var(--n-input-border-radius,var(--n-border-radius-s));--_n-combobox-block-size:var(--n-combobox-block-size,var(--n-space-xl));--_n-combobox-min-content-block-size:calc(var(--n-line-height-form) + var(--n-space-s)/1.6*2 + 2px);--_n-combobox-padding-block:calc(var(--_n-combobox-block-size)/2 - var(--n-line-height-form)/2 - 1px);--_n-combobox-padding-inline:calc(var(--n-space-s) + var(--n-space-xs));--_n-combobox-font-size:var(--n-font-size-m);--_n-combobox-divider-block-size:var(--n-space-m);--_n-combobox-tags-padding:calc(var(--n-space-xs)*0.75);display:block}nord-combobox[size=s]{--_n-combobox-block-size:var(--n-combobox-block-size,calc(var(--n-space-l) + var(--n-space-xs)));--_n-combobox-padding-block:calc(var(--_n-combobox-block-size)/2 - var(--n-line-height-form)/2 - 1px);--_n-combobox-padding-inline:calc(var(--n-space-xs)*1.5);--_n-combobox-divider-block-size:calc(var(--n-space-s) + var(--n-space-xs)/2);--_n-combobox-tags-padding:calc(var(--n-space-xs)/2)}nord-combobox[size=l]{--_n-combobox-border-radius:var(--n-input-border-radius,var(--n-border-radius));--_n-combobox-block-size:max(var(--n-combobox-block-size,calc(var(--n-space-xxl) - var(--n-space-l))),var(--_n-combobox-min-content-block-size));--_n-combobox-padding-block:calc(var(--_n-combobox-block-size)/2 - var(--n-line-height-form)/2 - 1px);--_n-combobox-padding-inline:calc(var(--n-space-s) + var(--n-space-xs));--_n-combobox-divider-block-size:var(--n-space-l)}nord-combobox .n-combobox{inline-size:100%;position:relative}nord-combobox .n-control{align-items:center;background:var(--_n-combobox-background);border:1px solid var(--_n-combobox-border-color);border-radius:var(--_n-combobox-border-radius);cursor:text;display:flex;gap:var(--n-space-s);inline-size:100%;min-block-size:var(--_n-combobox-block-size);padding-inline-end:var(--_n-combobox-padding-inline);padding-inline-start:var(--_n-combobox-padding-inline);transition:border var(--n-transition-quickly),box-shadow var(--n-transition-quickly),background var(--n-transition-quickly)}nord-combobox .n-tags{align-items:center;display:flex;flex:1;flex-wrap:wrap;gap:var(--_n-combobox-tags-padding);min-inline-size:0;padding-block-end:var(--_n-combobox-tags-padding);padding-block-start:var(--_n-combobox-tags-padding)}nord-combobox .n-tags .n-input{padding-block-end:0;padding-block-start:0}nord-combobox .n-control:hover{--_n-combobox-border-color:var(--n-input-border-color,var(--n-color-border-hover))}nord-combobox .n-control:focus-within{--_n-combobox-border-color:var(--n-input-border-color,var(--n-color-accent));box-shadow:0 0 0 1px var(--_n-combobox-border-color)}nord-combobox[disabled] .n-control{--_n-combobox-background:var(--n-input-background-inactive,var(--n-color-active));--_n-combobox-border-color:var(--n-input-border-color,var(--n-color-active));cursor:auto;pointer-events:none}nord-combobox .n-control.is-invalid{--_n-combobox-border-color:var(--n-color-border-danger)}nord-combobox .n-control.is-invalid:focus-within{--_n-combobox-border-color:var(--n-color-status-danger)}nord-combobox .n-slot{align-items:center;color:var(--n-color-icon);display:flex;flex-shrink:0}nord-combobox .n-slot:empty{display:none}nord-combobox[disabled] .n-slot{color:var(--n-color-text-weakest)}nord-combobox .n-slot nord-icon{--_n-icon-size:var(--n-size-icon-s)}nord-combobox .n-input{appearance:none;background:#0000;border:none;color:var(--n-color-text);flex:1;font-family:var(--n-font-family);font-feature-settings:var(--n-font-features);font-size:var(--_n-combobox-font-size);line-height:var(--n-line-height-form);margin:0;min-inline-size:3rem;outline:none;padding-block-end:var(--_n-combobox-padding-block);padding-block-start:var(--_n-combobox-padding-block);padding-inline-end:0;padding-inline-start:0}nord-combobox .n-control input.n-input:focus,nord-combobox .n-control input.n-input:focus-visible,nord-combobox .n-control input.n-input:focus-within{background:#0000;border:none;box-shadow:none;outline:none}nord-combobox .n-input::placeholder{color:var(--n-color-text-weakest);opacity:1}nord-combobox[disabled] .n-input{color:var(--n-color-text-weakest)}nord-combobox .n-divider{background:var(--n-color-border);block-size:var(--_n-combobox-divider-block-size);flex-shrink:0;inline-size:1px}nord-combobox .n-toggle{align-items:center;appearance:none;background:#0000;border:none;color:var(--n-color-icon);cursor:pointer;display:flex;flex-shrink:0;justify-content:center;margin:0;padding:0}nord-combobox .n-toggle nord-icon{--_n-icon-size:var(--n-size-icon-s)}nord-combobox[disabled] .n-toggle{color:var(--n-color-text-weakest);cursor:auto}nord-combobox .n-clear{align-items:center;appearance:none;background:#0000;border:none;border-radius:var(--n-border-radius-s);color:var(--n-color-icon);cursor:pointer;display:flex;flex-shrink:0;justify-content:center;margin:0;padding:0;transition:color var(--n-transition-quickly)}nord-combobox .n-clear:hover{color:var(--n-color-text)}nord-combobox .n-clear:focus-visible{outline:2px solid var(--n-color-accent);outline-offset:2px}nord-combobox .n-clear nord-icon{--_n-icon-size:var(--n-size-icon-xs)}nord-combobox .n-loading{flex-shrink:0}nord-combobox .n-chip{--n-tag-block-size:calc(var(--_n-combobox-block-size) - var(--n-space-s));flex-shrink:0}nord-combobox .n-listbox{inline-size:var(--n-combobox-list-inline-size,var(--_n-combobox-anchor-inline-size,100%));margin:0;max-block-size:calc(var(--n-space-xxl)*4);overflow-y:auto;padding-block-end:var(--n-space-s);padding-block-start:var(--n-space-s);padding-inline:0}nord-combobox .n-virtual-sizer{inline-size:100%;position:relative}nord-combobox .n-virtual-row{inset-block-start:0;inset-inline:0;position:absolute}nord-combobox .n-virtual-row>.n-option{block-size:100%;box-sizing:border-box;min-block-size:0;overflow:hidden}nord-combobox .n-group-label{color:var(--n-color-text-weaker);font-size:var(--n-font-size-xs);font-weight:var(--n-font-weight-heading);line-height:var(--n-line-height-tight);padding-block-end:var(--n-space-s);padding-block-start:var(--n-space-s);padding-inline-end:calc(var(--n-space-s) + var(--n-space-xs)/2);padding-inline-start:calc(var(--n-space-s) + var(--n-space-xs)/2)}nord-combobox [role=group]:not(:first-child):before{border-block-start:1px solid var(--n-color-border);content:"";display:block;margin-block-end:var(--n-space-s);margin-block-start:var(--n-space-s)}nord-combobox .n-option{align-items:center;color:var(--n-color-text);cursor:pointer;display:flex;font-size:var(--_n-combobox-font-size);gap:var(--n-space-s);line-height:var(--n-line-height);padding-block-end:calc(var(--n-space-xs)*1.5);padding-block-start:calc(var(--n-space-xs)*1.5);padding-inline-end:calc(var(--n-space-s) + var(--n-space-xs)/2);padding-inline-start:calc(var(--n-space-s) + var(--n-space-xs)/2);user-select:none}nord-combobox .n-option.is-active{background:var(--n-color-accent);color:var(--n-color-text-on-accent)}nord-combobox .n-option:active{opacity:.8}nord-combobox .n-option.is-disabled{color:var(--n-color-text-weakest);cursor:default;pointer-events:none}nord-combobox .n-option-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}nord-combobox .n-option-check{block-size:var(--n-space-m);color:var(--n-color-text-highlight);display:grid;flex:0 0 var(--n-space-m);inline-size:var(--n-space-m);place-items:center}nord-combobox .n-option.is-active .n-option-check{color:currentColor}nord-combobox .n-create{color:var(--n-color-text-link)}nord-combobox .n-create .n-option-label{font-weight:var(--n-font-weight-active)}nord-combobox .n-create-icon{--_n-icon-size:var(--n-size-icon-s);color:currentColor;flex-shrink:0}nord-combobox .n-create-kbd{flex-shrink:0}nord-combobox .n-empty{align-items:center;color:var(--n-color-text-weaker);display:flex;font-size:var(--_n-combobox-font-size);justify-content:center;padding:var(--n-space-s);text-align:center}`;export{n as s};
2
- //# sourceMappingURL=Combobox-By4h1Sp-.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Combobox-By4h1Sp-.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{i as t}from"./tinykeys.module-_6MZt7MP.js";const s=/Arrow(Up|Down|Left|Right)/g,i=/Escape/g;class n{constructor(t,s,i){this.shortcuts=s,this.target=i,t.addController(this)}hostConnected(){this.shortcuts&&this.bind(this.shortcuts)}hostDisconnected(){this.unbind()}unbind(){var t;null===(t=this.unregister)||void 0===t||t.call(this)}bind(n){var o;this.unbind(),this.shortcuts=n,this.unregister=t(null!==(o=this.target)&&void 0!==o?o:window,function(t){const n={};return Object.keys(t).forEach((o=>{if(n[o]=t[o],s.test(o)){const t=o.replace(s,((t,s)=>s));n[t]=n[o]}if(i.test(o)){const t=o.replace(i,(()=>"Esc"));n[t]=n[o]}})),n}(this.shortcuts))}}export{n as S};
2
- //# sourceMappingURL=ShortcutController-BIb3WGzH.js.map