nve-designsystem 3.2.0 → 3.3.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 (197) hide show
  1. package/chunks/chunk.2PCBEMQZ.js +163 -226
  2. package/chunks/chunk.36O46B5H.js +15 -15
  3. package/chunks/chunk.4TUIT776.js +78 -96
  4. package/chunks/chunk.5JY5FUCG.js +965 -1245
  5. package/chunks/chunk.5P45LHIX.js +668 -96
  6. package/chunks/chunk.6CTB5ZDJ.js +107 -100
  7. package/chunks/chunk.B4BZKR24.js +29 -39
  8. package/chunks/chunk.D5YQDJ7X.js +122 -166
  9. package/chunks/chunk.EA437WHD.js +5 -5
  10. package/chunks/chunk.GI7VDIWX.js +14 -15
  11. package/chunks/chunk.GMYPQTFK.js +18 -20
  12. package/chunks/chunk.HVTXQL7M.js +191 -215
  13. package/chunks/chunk.IKV4VH3T.js +18 -16
  14. package/chunks/chunk.IVVHNXMC.js +26 -27
  15. package/chunks/chunk.JHOXTQXA.js +65 -74
  16. package/chunks/chunk.JXOKFADN.js +63 -90
  17. package/chunks/chunk.K7JGTRV7.js +24 -23
  18. package/chunks/chunk.KPLQLAWP.js +132 -147
  19. package/chunks/chunk.LD4M4QGE.js +61 -74
  20. package/chunks/chunk.MSKEYBDI.js +53 -71
  21. package/chunks/chunk.NYIIDP5N.js +39 -45
  22. package/chunks/chunk.RWUUFNUL.js +91 -114
  23. package/chunks/chunk.SAPQLUO4.js +249 -228
  24. package/chunks/chunk.SI4ACBFK.js +139 -5
  25. package/chunks/chunk.TP2GB2HO.js +361 -460
  26. package/chunks/chunk.UDWRA64J.js +185 -223
  27. package/chunks/chunk.URTPIBTY.js +119 -151
  28. package/chunks/chunk.VESXC477.js +63 -66
  29. package/chunks/chunk.XA43ZQPC.js +198 -313
  30. package/chunks/chunk.XQ2OKYYA.js +25 -26
  31. package/chunks/chunk.XZNBUGX7.js +6 -6
  32. package/chunks/chunk.YHLNUJ7P.js +93 -116
  33. package/chunks/chunk.ZH2AND3P.js +340 -399
  34. package/chunks/chunk.ZL53POKZ.js +61 -156
  35. package/chunks/chunk.js +20 -0
  36. package/chunks/class-map.js +49 -45
  37. package/chunks/decorate.js +105 -0
  38. package/chunks/directive-helpers.js +5 -7
  39. package/chunks/if-defined.js +5 -5
  40. package/chunks/lit.js +525 -0
  41. package/chunks/live.js +24 -24
  42. package/chunks/nve-alert.component.js +163 -0
  43. package/chunks/nve-carousel-item.component.js +36 -0
  44. package/chunks/nve-carousel.component.js +41 -0
  45. package/chunks/nve-checkbox-group.component.js +114 -0
  46. package/chunks/nve-checkbox.component.js +28 -0
  47. package/chunks/nve-dialog.component.js +39 -0
  48. package/chunks/nve-divider.component.js +23 -0
  49. package/chunks/nve-drawer.component.js +40 -0
  50. package/chunks/nve-dropdown.component.js +83 -0
  51. package/chunks/nve-input.component.js +80 -0
  52. package/chunks/nve-label.component.js +89 -0
  53. package/chunks/nve-menu-item.component.js +35 -0
  54. package/chunks/nve-menu.component.js +17 -0
  55. package/chunks/nve-option.component.js +27 -0
  56. package/chunks/nve-popup.component.js +15 -0
  57. package/chunks/nve-radio-button.component.js +20 -0
  58. package/chunks/nve-radio-group.component.js +78 -0
  59. package/chunks/nve-radio.component.js +18 -0
  60. package/chunks/nve-select.component.js +58 -0
  61. package/chunks/nve-skeleton.component.js +20 -0
  62. package/chunks/nve-spinner.component.js +23 -0
  63. package/chunks/nve-tooltip.component.js +20 -0
  64. package/chunks/nve-warning-level.component.js +57 -0
  65. package/chunks/ref.js +75 -84
  66. package/chunks/shoelace.js +10006 -0
  67. package/chunks/static-html.js +27 -0
  68. package/chunks/unsafe-html.js +24 -20
  69. package/chunks/updateInvalidProperty.js +7 -7
  70. package/chunks/watch.js +20 -20
  71. package/components/nve-accordion/nve-accordion.component.js +24 -30
  72. package/components/nve-accordion-item/nve-accordion-item.component.js +30 -64
  73. package/components/nve-accordion-item/nve-accordion-item.styles.js +5 -5
  74. package/components/nve-alert/nve-alert.component.js +2 -227
  75. package/components/nve-alert/nve-alert.styles.js +45 -27
  76. package/components/nve-badge/nve-badge.component.js +41 -45
  77. package/components/nve-badge/nve-badge.styles.js +33 -31
  78. package/components/nve-button/nve-button.component.d.ts +110 -10
  79. package/components/nve-button/nve-button.component.js +146 -39
  80. package/components/nve-button/nve-button.styles.js +214 -157
  81. package/components/nve-carousel/nve-carousel.component.js +2 -47
  82. package/components/nve-carousel/nve-carousel.styles.js +6 -6
  83. package/components/nve-carousel-item/nve-carousel-item.component.js +2 -40
  84. package/components/nve-carousel-item/nve-carousel-item.styles.js +5 -5
  85. package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.component.js +44 -54
  86. package/components/nve-carousel-thumbnail/nve-carousel-thumbnail.styles.js +5 -5
  87. package/components/nve-checkbox/nve-checkbox.component.js +2 -34
  88. package/components/nve-checkbox/nve-checkbox.styles.js +7 -7
  89. package/components/nve-checkbox-group/nve-checkbox-group.component.js +2 -152
  90. package/components/nve-checkbox-group/nve-checkbox-group.styles.js +5 -5
  91. package/components/nve-combobox/nve-combobox.component.js +222 -440
  92. package/components/nve-combobox/nve-combobox.styles.js +6 -6
  93. package/components/nve-darkmode-switch/nve-darkmode-switch.component.js +32 -38
  94. package/components/nve-dialog/nve-dialog-styles.js +6 -6
  95. package/components/nve-dialog/nve-dialog.component.js +2 -54
  96. package/components/nve-divider/nve-divider.component.js +2 -30
  97. package/components/nve-drawer/nve-drawer.component.js +2 -44
  98. package/components/nve-drawer/nve-drawer.styles.js +6 -6
  99. package/components/nve-dropdown/nve-dropdown.component.js +2 -79
  100. package/components/nve-dropdown/nve-dropdown.styles.js +5 -5
  101. package/components/nve-heading/nve-heading.component.d.ts +29 -0
  102. package/components/nve-heading/nve-heading.component.js +45 -0
  103. package/components/nve-heading/nve-heading.styles.d.ts +2 -0
  104. package/components/nve-heading/nve-heading.styles.js +41 -0
  105. package/components/nve-icon/nve-icon.component.js +145 -164
  106. package/components/nve-icon/nve-icon.styles.js +11 -6
  107. package/components/nve-icon/offline-icons.js +16 -13
  108. package/components/nve-input/nve-input.component.js +2 -100
  109. package/components/nve-input/nve-input.styles.js +5 -5
  110. package/components/nve-label/nve-label.component.js +2 -115
  111. package/components/nve-label/nve-label.styles.js +5 -5
  112. package/components/nve-link-card/nve-link-card.component.d.ts +5 -2
  113. package/components/nve-link-card/nve-link-card.component.js +44 -80
  114. package/components/nve-link-card/nve-link-card.styles.js +71 -66
  115. package/components/nve-menu/nve-menu.component.js +2 -22
  116. package/components/nve-menu/nve-menu.styles.js +5 -5
  117. package/components/nve-menu-item/nve-menu-item.component.js +2 -43
  118. package/components/nve-menu-item/nve-menu-item.styles.js +7 -7
  119. package/components/nve-message-card/nve-message-card.component.js +61 -91
  120. package/components/nve-message-card/nve-message-card.styles.js +24 -27
  121. package/components/nve-navigation-card/nve-navigation-card.component.d.ts +52 -0
  122. package/components/nve-navigation-card/nve-navigation-card.component.js +60 -0
  123. package/components/nve-navigation-card/nve-navigation-card.styles.d.ts +2 -0
  124. package/components/nve-navigation-card/nve-navigation-card.styles.js +112 -0
  125. package/components/nve-option/nve-option.component.js +2 -41
  126. package/components/nve-option/nve-option.styles.js +5 -5
  127. package/components/nve-paragraph/nve-paragraph.component.d.ts +26 -0
  128. package/components/nve-paragraph/nve-paragraph.component.js +26 -0
  129. package/components/nve-paragraph/nve-paragraph.styles.d.ts +2 -0
  130. package/components/nve-paragraph/nve-paragraph.styles.js +105 -0
  131. package/components/nve-popup/nve-popup.component.js +2 -22
  132. package/components/nve-radio/nve-radio.component.js +2 -23
  133. package/components/nve-radio/nve-radio.styles.js +5 -5
  134. package/components/nve-radio-button/nve-radio-button.component.js +2 -25
  135. package/components/nve-radio-button/nve-radio-button.styles.js +5 -5
  136. package/components/nve-radio-group/nve-radio-group.component.js +2 -119
  137. package/components/nve-radio-group/nve-radio-group.styles.js +5 -5
  138. package/components/nve-relative-time/nve-relative-time.component.js +21 -56
  139. package/components/nve-relative-time/nve-relative-time.styles.js +5 -5
  140. package/components/nve-select/nve-select.component.js +2 -80
  141. package/components/nve-select/nve-select.styles.js +5 -5
  142. package/components/nve-skeleton/nve-skeleton.component.js +2 -27
  143. package/components/nve-skeleton/nve-skeleton.styles.js +5 -5
  144. package/components/nve-spinner/nve-spinner.component.js +2 -31
  145. package/components/nve-stepper/nve-step/nve-step.component.js +113 -173
  146. package/components/nve-stepper/nve-step/nve-step.styles.js +12 -12
  147. package/components/nve-stepper/nve-stepper-mobile.component.js +37 -49
  148. package/components/nve-stepper/nve-stepper-mobile.styles.js +7 -7
  149. package/components/nve-stepper/nve-stepper.component.js +94 -139
  150. package/components/nve-stepper/nve-stepper.styles.js +5 -5
  151. package/components/nve-switch/nve-switch.component.js +75 -107
  152. package/components/nve-switch/nve-switch.styles.js +7 -7
  153. package/components/nve-tab/nve-tab.component.js +30 -42
  154. package/components/nve-tab/nve-tab.styles.js +7 -7
  155. package/components/nve-tab-group/nve-tab-group.component.js +180 -260
  156. package/components/nve-tab-group/nve-tab-group.styles.js +5 -5
  157. package/components/nve-tab-panel/nve-tab-panel.component.js +21 -31
  158. package/components/nve-tab-panel/nve-tab-panel.styles.js +5 -5
  159. package/components/nve-tag/nve-tag.component.d.ts +3 -3
  160. package/components/nve-tag/nve-tag.component.js +71 -72
  161. package/components/nve-tag/nve-tag.styles.js +23 -22
  162. package/components/nve-textarea/nve-textarea.component.d.ts +3 -1
  163. package/components/nve-textarea/nve-textarea.component.js +112 -173
  164. package/components/nve-textarea/nve-textarea.styles.js +10 -5
  165. package/components/nve-tooltip/nve-tooltip.component.js +2 -30
  166. package/components/nve-tooltip/nve-tooltip.styles.js +5 -5
  167. package/components/nve-warning-level/nve-warning-level.component.js +2 -78
  168. package/components/nve-warning-level/nve-warning-level.styles.js +7 -7
  169. package/css/global.css +13 -55
  170. package/css/nve.css +1048 -393
  171. package/css/nve_dark.css +406 -305
  172. package/css/rme.css +1050 -395
  173. package/css/rme_dark.css +408 -307
  174. package/css/shoelace-styles.css +539 -0
  175. package/css/varsom.css +1046 -391
  176. package/css/varsom_dark.css +404 -303
  177. package/custom-elements.json +2905 -12389
  178. package/fonts/LICENSE.txt +37 -0
  179. package/fonts/SourceSans3-VariableFont_wght.woff2 +0 -0
  180. package/interfaces/NveComponent.interface.js +0 -1
  181. package/nve-designsystem.d.ts +5 -0
  182. package/nve-designsystem.js +46 -86
  183. package/package.json +26 -8
  184. package/registerIcons/systemLibraryCustomization.js +23 -91
  185. package/vite-env.d.js +0 -1
  186. package/chunks/chunk.3RPBFEDE.js +0 -162
  187. package/chunks/chunk.JCXLDPQF.js +0 -225
  188. package/chunks/chunk.JQBT7BOV.js +0 -8446
  189. package/chunks/chunk.MAQXLKQ7.js +0 -598
  190. package/chunks/lit-element.js +0 -508
  191. package/chunks/property.js +0 -37
  192. package/chunks/query.js +0 -13
  193. package/chunks/state.js +0 -7
  194. package/chunks/static.js +0 -26
  195. package/nve-designsystem.css +0 -1
  196. package/vscode.css-custom-data.json +0 -621
  197. package/vscode.html-custom-data.json +0 -2354
@@ -1,16 +1,16 @@
1
- import { i as f, x as w } from "./lit-element.js";
2
- import { g as y, c as v } from "./chunk.VESXC477.js";
3
- import { S as b } from "./chunk.5JY5FUCG.js";
4
- import { s as g, g as h } from "./chunk.K7JGTRV7.js";
5
- import { w as c, s as u, a as m } from "./chunk.B4BZKR24.js";
6
- import { L as k } from "./chunk.6CTB5ZDJ.js";
7
- import { w as E } from "./chunk.GMYPQTFK.js";
8
- import { c as _, d as o, S as C } from "./chunk.4TUIT776.js";
9
- import { e as D } from "./class-map.js";
10
- import { o as T } from "./if-defined.js";
11
- import { n as a } from "./property.js";
12
- import { e as p } from "./query.js";
13
- var L = f`
1
+ import { a as e, u as t } from "./lit.js";
2
+ import { o as n, r } from "./decorate.js";
3
+ import { n as i, r as a, t as o } from "./chunk.4TUIT776.js";
4
+ import { t as s } from "./chunk.GMYPQTFK.js";
5
+ import { t as c } from "./class-map.js";
6
+ import { t as l } from "./if-defined.js";
7
+ import { t as u } from "./chunk.6CTB5ZDJ.js";
8
+ import { n as d, t as f } from "./chunk.K7JGTRV7.js";
9
+ import { n as p, o as m, t as h } from "./chunk.B4BZKR24.js";
10
+ import { t as g } from "./chunk.5JY5FUCG.js";
11
+ import { n as _, r as v } from "./chunk.VESXC477.js";
12
+ //#region .pnpm/@shoelace-style+shoelace@2.20.1_@floating-ui+utils@0.2.11_@types+react@19.2.15/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LXP7GVU3.js
13
+ var y = t`
14
14
  :host {
15
15
  display: inline-block;
16
16
  }
@@ -58,150 +58,132 @@ var L = f`
58
58
  max-width: var(--auto-size-available-width) !important;
59
59
  max-height: var(--auto-size-available-height) !important;
60
60
  }
61
- `, s = class extends C {
62
- constructor() {
63
- super(...arguments), this.localize = new k(this), this.open = !1, this.placement = "bottom-start", this.disabled = !1, this.stayOpenOnSelect = !1, this.distance = 0, this.skidding = 0, this.hoist = !1, this.sync = void 0, this.handleKeyDown = (e) => {
64
- this.open && e.key === "Escape" && (e.stopPropagation(), this.hide(), this.focusOnTrigger());
65
- }, this.handleDocumentKeyDown = (e) => {
66
- var t;
67
- if (e.key === "Escape" && this.open && !this.closeWatcher) {
68
- e.stopPropagation(), this.focusOnTrigger(), this.hide();
69
- return;
70
- }
71
- if (e.key === "Tab") {
72
- if (this.open && ((t = document.activeElement) == null ? void 0 : t.tagName.toLowerCase()) === "sl-menu-item") {
73
- e.preventDefault(), this.hide(), this.focusOnTrigger();
74
- return;
75
- }
76
- const i = (n, r) => {
77
- if (!n) return null;
78
- const l = n.closest(r);
79
- if (l) return l;
80
- const d = n.getRootNode();
81
- return d instanceof ShadowRoot ? i(d.host, r) : null;
82
- };
83
- setTimeout(() => {
84
- var n;
85
- const r = ((n = this.containingElement) == null ? void 0 : n.getRootNode()) instanceof ShadowRoot ? y() : document.activeElement;
86
- (!this.containingElement || i(r, this.containingElement.tagName.toLowerCase()) !== this.containingElement) && this.hide();
87
- });
88
- }
89
- }, this.handleDocumentMouseDown = (e) => {
90
- const t = e.composedPath();
91
- this.containingElement && !t.includes(this.containingElement) && this.hide();
92
- }, this.handlePanelSelect = (e) => {
93
- const t = e.target;
94
- !this.stayOpenOnSelect && t.tagName.toLowerCase() === "sl-menu" && (this.hide(), this.focusOnTrigger());
95
- };
96
- }
97
- connectedCallback() {
98
- super.connectedCallback(), this.containingElement || (this.containingElement = this);
99
- }
100
- firstUpdated() {
101
- this.panel.hidden = !this.open, this.open && (this.addOpenListeners(), this.popup.active = !0);
102
- }
103
- disconnectedCallback() {
104
- super.disconnectedCallback(), this.removeOpenListeners(), this.hide();
105
- }
106
- focusOnTrigger() {
107
- const e = this.trigger.assignedElements({ flatten: !0 })[0];
108
- typeof e?.focus == "function" && e.focus();
109
- }
110
- getMenu() {
111
- return this.panel.assignedElements({ flatten: !0 }).find((e) => e.tagName.toLowerCase() === "sl-menu");
112
- }
113
- handleTriggerClick() {
114
- this.open ? this.hide() : (this.show(), this.focusOnTrigger());
115
- }
116
- async handleTriggerKeyDown(e) {
117
- if ([" ", "Enter"].includes(e.key)) {
118
- e.preventDefault(), this.handleTriggerClick();
119
- return;
120
- }
121
- const t = this.getMenu();
122
- if (t) {
123
- const i = t.getAllItems(), n = i[0], r = i[i.length - 1];
124
- ["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key) && (e.preventDefault(), this.open || (this.show(), await this.updateComplete), i.length > 0 && this.updateComplete.then(() => {
125
- (e.key === "ArrowDown" || e.key === "Home") && (t.setCurrentItem(n), n.focus()), (e.key === "ArrowUp" || e.key === "End") && (t.setCurrentItem(r), r.focus());
126
- }));
127
- }
128
- }
129
- handleTriggerKeyUp(e) {
130
- e.key === " " && e.preventDefault();
131
- }
132
- handleTriggerSlotChange() {
133
- this.updateAccessibleTrigger();
134
- }
135
- //
136
- // Slotted triggers can be arbitrary content, but we need to link them to the dropdown panel with `aria-haspopup` and
137
- // `aria-expanded`. These must be applied to the "accessible trigger" (the tabbable portion of the trigger element
138
- // that gets slotted in) so screen readers will understand them. The accessible trigger could be the slotted element,
139
- // a child of the slotted element, or an element in the slotted element's shadow root.
140
- //
141
- // For example, the accessible trigger of an <sl-button> is a <button> located inside its shadow root.
142
- //
143
- // To determine this, we assume the first tabbable element in the trigger slot is the "accessible trigger."
144
- //
145
- updateAccessibleTrigger() {
146
- const t = this.trigger.assignedElements({ flatten: !0 }).find((n) => v(n).start);
147
- let i;
148
- if (t) {
149
- switch (t.tagName.toLowerCase()) {
150
- // Shoelace buttons have to update the internal button so it's announced correctly by screen readers
151
- case "sl-button":
152
- case "sl-icon-button":
153
- i = t.button;
154
- break;
155
- default:
156
- i = t;
157
- }
158
- i.setAttribute("aria-haspopup", "true"), i.setAttribute("aria-expanded", this.open ? "true" : "false");
159
- }
160
- }
161
- /** Shows the dropdown panel. */
162
- async show() {
163
- if (!this.open)
164
- return this.open = !0, c(this, "sl-after-show");
165
- }
166
- /** Hides the dropdown panel */
167
- async hide() {
168
- if (this.open)
169
- return this.open = !1, c(this, "sl-after-hide");
170
- }
171
- /**
172
- * Instructs the dropdown menu to reposition. Useful when the position or size of the trigger changes when the menu
173
- * is activated.
174
- */
175
- reposition() {
176
- this.popup.reposition();
177
- }
178
- addOpenListeners() {
179
- var e;
180
- this.panel.addEventListener("sl-select", this.handlePanelSelect), "CloseWatcher" in window ? ((e = this.closeWatcher) == null || e.destroy(), this.closeWatcher = new CloseWatcher(), this.closeWatcher.onclose = () => {
181
- this.hide(), this.focusOnTrigger();
182
- }) : this.panel.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keydown", this.handleDocumentKeyDown), document.addEventListener("mousedown", this.handleDocumentMouseDown);
183
- }
184
- removeOpenListeners() {
185
- var e;
186
- this.panel && (this.panel.removeEventListener("sl-select", this.handlePanelSelect), this.panel.removeEventListener("keydown", this.handleKeyDown)), document.removeEventListener("keydown", this.handleDocumentKeyDown), document.removeEventListener("mousedown", this.handleDocumentMouseDown), (e = this.closeWatcher) == null || e.destroy();
187
- }
188
- async handleOpenChange() {
189
- if (this.disabled) {
190
- this.open = !1;
191
- return;
192
- }
193
- if (this.updateAccessibleTrigger(), this.open) {
194
- this.emit("sl-show"), this.addOpenListeners(), await u(this), this.panel.hidden = !1, this.popup.active = !0;
195
- const { keyframes: e, options: t } = h(this, "dropdown.show", { dir: this.localize.dir() });
196
- await m(this.popup.popup, e, t), this.emit("sl-after-show");
197
- } else {
198
- this.emit("sl-hide"), this.removeOpenListeners(), await u(this);
199
- const { keyframes: e, options: t } = h(this, "dropdown.hide", { dir: this.localize.dir() });
200
- await m(this.popup.popup, e, t), this.panel.hidden = !0, this.popup.active = !1, this.emit("sl-after-hide");
201
- }
202
- }
203
- render() {
204
- return w`
61
+ `, b = class extends o {
62
+ constructor() {
63
+ super(...arguments), this.localize = new u(this), this.open = !1, this.placement = "bottom-start", this.disabled = !1, this.stayOpenOnSelect = !1, this.distance = 0, this.skidding = 0, this.hoist = !1, this.sync = void 0, this.handleKeyDown = (e) => {
64
+ this.open && e.key === "Escape" && (e.stopPropagation(), this.hide(), this.focusOnTrigger());
65
+ }, this.handleDocumentKeyDown = (e) => {
66
+ if (e.key === "Escape" && this.open && !this.closeWatcher) {
67
+ e.stopPropagation(), this.focusOnTrigger(), this.hide();
68
+ return;
69
+ }
70
+ if (e.key === "Tab") {
71
+ if (this.open && document.activeElement?.tagName.toLowerCase() === "sl-menu-item") {
72
+ e.preventDefault(), this.hide(), this.focusOnTrigger();
73
+ return;
74
+ }
75
+ let t = (e, n) => {
76
+ if (!e) return null;
77
+ let r = e.closest(n);
78
+ if (r) return r;
79
+ let i = e.getRootNode();
80
+ return i instanceof ShadowRoot ? t(i.host, n) : null;
81
+ };
82
+ setTimeout(() => {
83
+ let e = this.containingElement?.getRootNode() instanceof ShadowRoot ? _() : document.activeElement;
84
+ (!this.containingElement || t(e, this.containingElement.tagName.toLowerCase()) !== this.containingElement) && this.hide();
85
+ });
86
+ }
87
+ }, this.handleDocumentMouseDown = (e) => {
88
+ let t = e.composedPath();
89
+ this.containingElement && !t.includes(this.containingElement) && this.hide();
90
+ }, this.handlePanelSelect = (e) => {
91
+ let t = e.target;
92
+ !this.stayOpenOnSelect && t.tagName.toLowerCase() === "sl-menu" && (this.hide(), this.focusOnTrigger());
93
+ };
94
+ }
95
+ connectedCallback() {
96
+ super.connectedCallback(), this.containingElement ||= this;
97
+ }
98
+ firstUpdated() {
99
+ this.panel.hidden = !this.open, this.open && (this.addOpenListeners(), this.popup.active = !0);
100
+ }
101
+ disconnectedCallback() {
102
+ super.disconnectedCallback(), this.removeOpenListeners(), this.hide();
103
+ }
104
+ focusOnTrigger() {
105
+ let e = this.trigger.assignedElements({ flatten: !0 })[0];
106
+ typeof e?.focus == "function" && e.focus();
107
+ }
108
+ getMenu() {
109
+ return this.panel.assignedElements({ flatten: !0 }).find((e) => e.tagName.toLowerCase() === "sl-menu");
110
+ }
111
+ handleTriggerClick() {
112
+ this.open ? this.hide() : (this.show(), this.focusOnTrigger());
113
+ }
114
+ async handleTriggerKeyDown(e) {
115
+ if ([" ", "Enter"].includes(e.key)) {
116
+ e.preventDefault(), this.handleTriggerClick();
117
+ return;
118
+ }
119
+ let t = this.getMenu();
120
+ if (t) {
121
+ let n = t.getAllItems(), r = n[0], i = n[n.length - 1];
122
+ [
123
+ "ArrowDown",
124
+ "ArrowUp",
125
+ "Home",
126
+ "End"
127
+ ].includes(e.key) && (e.preventDefault(), this.open || (this.show(), await this.updateComplete), n.length > 0 && this.updateComplete.then(() => {
128
+ (e.key === "ArrowDown" || e.key === "Home") && (t.setCurrentItem(r), r.focus()), (e.key === "ArrowUp" || e.key === "End") && (t.setCurrentItem(i), i.focus());
129
+ }));
130
+ }
131
+ }
132
+ handleTriggerKeyUp(e) {
133
+ e.key === " " && e.preventDefault();
134
+ }
135
+ handleTriggerSlotChange() {
136
+ this.updateAccessibleTrigger();
137
+ }
138
+ updateAccessibleTrigger() {
139
+ let e = this.trigger.assignedElements({ flatten: !0 }).find((e) => v(e).start), t;
140
+ if (e) {
141
+ switch (e.tagName.toLowerCase()) {
142
+ case "sl-button":
143
+ case "sl-icon-button":
144
+ t = e.button;
145
+ break;
146
+ default: t = e;
147
+ }
148
+ t.setAttribute("aria-haspopup", "true"), t.setAttribute("aria-expanded", this.open ? "true" : "false");
149
+ }
150
+ }
151
+ async show() {
152
+ if (!this.open) return this.open = !0, h(this, "sl-after-show");
153
+ }
154
+ async hide() {
155
+ if (this.open) return this.open = !1, h(this, "sl-after-hide");
156
+ }
157
+ reposition() {
158
+ this.popup.reposition();
159
+ }
160
+ addOpenListeners() {
161
+ var e;
162
+ this.panel.addEventListener("sl-select", this.handlePanelSelect), "CloseWatcher" in window ? ((e = this.closeWatcher) == null || e.destroy(), this.closeWatcher = new CloseWatcher(), this.closeWatcher.onclose = () => {
163
+ this.hide(), this.focusOnTrigger();
164
+ }) : this.panel.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keydown", this.handleDocumentKeyDown), document.addEventListener("mousedown", this.handleDocumentMouseDown);
165
+ }
166
+ removeOpenListeners() {
167
+ var e;
168
+ this.panel && (this.panel.removeEventListener("sl-select", this.handlePanelSelect), this.panel.removeEventListener("keydown", this.handleKeyDown)), document.removeEventListener("keydown", this.handleDocumentKeyDown), document.removeEventListener("mousedown", this.handleDocumentMouseDown), (e = this.closeWatcher) == null || e.destroy();
169
+ }
170
+ async handleOpenChange() {
171
+ if (this.disabled) {
172
+ this.open = !1;
173
+ return;
174
+ }
175
+ if (this.updateAccessibleTrigger(), this.open) {
176
+ this.emit("sl-show"), this.addOpenListeners(), await m(this), this.panel.hidden = !1, this.popup.active = !0;
177
+ let { keyframes: e, options: t } = f(this, "dropdown.show", { dir: this.localize.dir() });
178
+ await p(this.popup.popup, e, t), this.emit("sl-after-show");
179
+ } else {
180
+ this.emit("sl-hide"), this.removeOpenListeners(), await m(this);
181
+ let { keyframes: e, options: t } = f(this, "dropdown.hide", { dir: this.localize.dir() });
182
+ await p(this.popup.popup, e, t), this.panel.hidden = !0, this.popup.active = !1, this.emit("sl-after-hide");
183
+ }
184
+ }
185
+ render() {
186
+ return e`
205
187
  <sl-popup
206
188
  part="base"
207
189
  exportparts="popup:base__popup"
@@ -214,11 +196,11 @@ var L = f`
214
196
  shift
215
197
  auto-size="vertical"
216
198
  auto-size-padding="10"
217
- sync=${T(this.sync ? this.sync : void 0)}
218
- class=${D({
219
- dropdown: !0,
220
- "dropdown--open": this.open
221
- })}
199
+ sync=${l(this.sync ? this.sync : void 0)}
200
+ class=${c({
201
+ dropdown: !0,
202
+ "dropdown--open": this.open
203
+ })}
222
204
  >
223
205
  <slot
224
206
  name="trigger"
@@ -236,66 +218,46 @@ var L = f`
236
218
  </div>
237
219
  </sl-popup>
238
220
  `;
239
- }
221
+ }
240
222
  };
241
- s.styles = [_, L];
242
- s.dependencies = { "sl-popup": b };
243
- o([
244
- p(".dropdown")
245
- ], s.prototype, "popup", 2);
246
- o([
247
- p(".dropdown__trigger")
248
- ], s.prototype, "trigger", 2);
249
- o([
250
- p(".dropdown__panel")
251
- ], s.prototype, "panel", 2);
252
- o([
253
- a({ type: Boolean, reflect: !0 })
254
- ], s.prototype, "open", 2);
255
- o([
256
- a({ reflect: !0 })
257
- ], s.prototype, "placement", 2);
258
- o([
259
- a({ type: Boolean, reflect: !0 })
260
- ], s.prototype, "disabled", 2);
261
- o([
262
- a({ attribute: "stay-open-on-select", type: Boolean, reflect: !0 })
263
- ], s.prototype, "stayOpenOnSelect", 2);
264
- o([
265
- a({ attribute: !1 })
266
- ], s.prototype, "containingElement", 2);
267
- o([
268
- a({ type: Number })
269
- ], s.prototype, "distance", 2);
270
- o([
271
- a({ type: Number })
272
- ], s.prototype, "skidding", 2);
273
- o([
274
- a({ type: Boolean })
275
- ], s.prototype, "hoist", 2);
276
- o([
277
- a({ reflect: !0 })
278
- ], s.prototype, "sync", 2);
279
- o([
280
- E("open", { waitUntilFirstUpdate: !0 })
281
- ], s.prototype, "handleOpenChange", 1);
282
- g("dropdown.show", {
283
- keyframes: [
284
- { opacity: 0, scale: 0.9 },
285
- { opacity: 1, scale: 1 }
286
- ],
287
- options: { duration: 100, easing: "ease" }
223
+ b.styles = [i, y], b.dependencies = { "sl-popup": g }, a([r(".dropdown")], b.prototype, "popup", 2), a([r(".dropdown__trigger")], b.prototype, "trigger", 2), a([r(".dropdown__panel")], b.prototype, "panel", 2), a([n({
224
+ type: Boolean,
225
+ reflect: !0
226
+ })], b.prototype, "open", 2), a([n({ reflect: !0 })], b.prototype, "placement", 2), a([n({
227
+ type: Boolean,
228
+ reflect: !0
229
+ })], b.prototype, "disabled", 2), a([n({
230
+ attribute: "stay-open-on-select",
231
+ type: Boolean,
232
+ reflect: !0
233
+ })], b.prototype, "stayOpenOnSelect", 2), a([n({ attribute: !1 })], b.prototype, "containingElement", 2), a([n({ type: Number })], b.prototype, "distance", 2), a([n({ type: Number })], b.prototype, "skidding", 2), a([n({ type: Boolean })], b.prototype, "hoist", 2), a([n({ reflect: !0 })], b.prototype, "sync", 2), a([s("open", { waitUntilFirstUpdate: !0 })], b.prototype, "handleOpenChange", 1), d("dropdown.show", {
234
+ keyframes: [{
235
+ opacity: 0,
236
+ scale: .9
237
+ }, {
238
+ opacity: 1,
239
+ scale: 1
240
+ }],
241
+ options: {
242
+ duration: 100,
243
+ easing: "ease"
244
+ }
245
+ }), d("dropdown.hide", {
246
+ keyframes: [{
247
+ opacity: 1,
248
+ scale: 1
249
+ }, {
250
+ opacity: 0,
251
+ scale: .9
252
+ }],
253
+ options: {
254
+ duration: 100,
255
+ easing: "ease"
256
+ }
288
257
  });
289
- g("dropdown.hide", {
290
- keyframes: [
291
- { opacity: 1, scale: 1 },
292
- { opacity: 0, scale: 0.9 }
293
- ],
294
- options: { duration: 100, easing: "ease" }
295
- });
296
- var I = s;
297
- s.define("sl-dropdown");
298
- export {
299
- s as S,
300
- I as d
301
- };
258
+ //#endregion
259
+ //#region .pnpm/@shoelace-style+shoelace@2.20.1_@floating-ui+utils@0.2.11_@types+react@19.2.15/node_modules/@shoelace-style/shoelace/dist/chunks/chunk.UDWRA64J.js
260
+ var x = b;
261
+ b.define("sl-dropdown");
262
+ //#endregion
263
+ export { b as n, x as t };