@reapit/elements 5.0.0-beta.67 → 5.0.0-beta.68

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 (193) hide show
  1. package/dist/js/{anchor-positioning-CmSZkNof.cjs → anchor-positioning-B-1bVP2v.cjs} +7 -7
  2. package/dist/js/{anchor-positioning-B3GGsbFM.js → anchor-positioning-mAfJClCi.js} +39 -36
  3. package/dist/js/{app-switcher-DNyr8R9j.js → app-switcher-B3Gme35H.js} +3 -3
  4. package/dist/js/{app-switcher-Da0jpH_0.cjs → app-switcher-alq1ioRt.cjs} +1 -1
  5. package/dist/js/{at-a-glance-N68VKcxo.cjs → at-a-glance-Bowg_R7J.cjs} +1 -1
  6. package/dist/js/{at-a-glance-B0WukTyX.js → at-a-glance-Bvs_m_s8.js} +1 -1
  7. package/dist/js/{autocomplete-Cbhl4kCC.cjs → autocomplete-BXNYfkuS.cjs} +1 -1
  8. package/dist/js/{autocomplete-Cjqj5b4A.js → autocomplete-BY50e2OI.js} +2 -2
  9. package/dist/js/{autocomplete-control-B1yvpZcw.cjs → autocomplete-control-7AtK271I.cjs} +1 -1
  10. package/dist/js/{autocomplete-control-tyu0N1_5.js → autocomplete-control-D3qPiyZB.js} +1 -1
  11. package/dist/js/{badge-C9eQWVc1.cjs → badge-BvLnt-2S.cjs} +1 -1
  12. package/dist/js/{badge-BH7WvutW.js → badge-C_Za5PMD.js} +1 -1
  13. package/dist/js/{bottom-bar-CiDA0QAt.js → bottom-bar-DIdKkbsi.js} +1 -1
  14. package/dist/js/{bottom-bar-y_VAqgE3.cjs → bottom-bar-DeODIkXt.cjs} +1 -1
  15. package/dist/js/{combobox-BMcjE-Hz.js → combobox-1az8akBD.js} +43 -45
  16. package/dist/js/combobox-DEZrdZM-.cjs +1 -0
  17. package/dist/js/{compact-select-CGGyCX2N.cjs → compact-select-BAqO95r3.cjs} +1 -1
  18. package/dist/js/{compact-select-B-fRAGbk.js → compact-select-Cj_eJ_Gk.js} +3 -3
  19. package/dist/js/core/app-switcher.cjs +1 -1
  20. package/dist/js/core/app-switcher.js +1 -1
  21. package/dist/js/core/at-a-glance.cjs +1 -1
  22. package/dist/js/core/at-a-glance.js +1 -1
  23. package/dist/js/core/autocomplete-control.cjs +1 -1
  24. package/dist/js/core/autocomplete-control.js +1 -1
  25. package/dist/js/core/autocomplete.cjs +1 -1
  26. package/dist/js/core/autocomplete.js +1 -1
  27. package/dist/js/core/badge.cjs +1 -1
  28. package/dist/js/core/badge.js +1 -1
  29. package/dist/js/core/bottom-bar.cjs +1 -1
  30. package/dist/js/core/bottom-bar.js +1 -1
  31. package/dist/js/core/combobox.cjs +1 -1
  32. package/dist/js/core/combobox.js +30 -31
  33. package/dist/js/core/compact-select.cjs +1 -1
  34. package/dist/js/core/compact-select.js +1 -1
  35. package/dist/js/core/dialog.cjs +1 -1
  36. package/dist/js/core/dialog.js +3 -3
  37. package/dist/js/core/drawer.cjs +1 -1
  38. package/dist/js/core/drawer.js +12 -12
  39. package/dist/js/core/features.cjs +1 -1
  40. package/dist/js/core/features.js +1 -1
  41. package/dist/js/core/menu.cjs +1 -1
  42. package/dist/js/core/menu.js +1 -1
  43. package/dist/js/core/office-switcher.cjs +1 -1
  44. package/dist/js/core/office-switcher.js +128 -34
  45. package/dist/js/core/section-message.cjs +1 -1
  46. package/dist/js/core/section-message.js +1 -1
  47. package/dist/js/core/select-control.cjs +1 -1
  48. package/dist/js/core/select-control.js +1 -1
  49. package/dist/js/core/select.cjs +1 -1
  50. package/dist/js/core/select.js +1 -1
  51. package/dist/js/core/side-bar.cjs +1 -1
  52. package/dist/js/core/side-bar.js +1 -1
  53. package/dist/js/core/split-button.cjs +1 -1
  54. package/dist/js/core/split-button.js +1 -1
  55. package/dist/js/core/table.cjs +1 -1
  56. package/dist/js/core/table.js +1 -1
  57. package/dist/js/core/tooltip.cjs +1 -1
  58. package/dist/js/core/tooltip.js +1 -1
  59. package/dist/js/core/top-bar.cjs +1 -1
  60. package/dist/js/core/top-bar.js +1 -1
  61. package/dist/js/dialog-X9q5RTrQ.js +121 -0
  62. package/dist/js/dialog-j6m9UOwL.cjs +1 -0
  63. package/dist/js/drawer-DeMe2YSy.cjs +1 -0
  64. package/dist/js/drawer-n8sZIGeL.js +202 -0
  65. package/dist/js/{features-xa9s_F2X.cjs → features-DDWY0bS-.cjs} +1 -1
  66. package/dist/js/{features-DPy7FK5b.js → features-xSaxyxVa.js} +1 -1
  67. package/dist/js/index.cjs +1 -1
  68. package/dist/js/index.js +473 -472
  69. package/dist/js/lab/select-custom.cjs +1 -1
  70. package/dist/js/lab/select-custom.js +2 -2
  71. package/dist/js/{line-clamp-CcqDlxOD.js → line-clamp-B8Z8vzU2.js} +1 -1
  72. package/dist/js/{line-clamp-BHxcW-g_.cjs → line-clamp-xEX76LvR.cjs} +1 -1
  73. package/dist/js/{listbox-DaqNCLTr.js → listbox-LxpZYH0B.js} +7 -7
  74. package/dist/js/listbox-uSbN6RQG.cjs +1 -0
  75. package/dist/js/{menu-BB1lyDsI.cjs → menu-C5zczNsx.cjs} +1 -1
  76. package/dist/js/{menu-DUQjcwNM.js → menu-CP0Bep1V.js} +1 -1
  77. package/dist/js/popover-Xyg0sgru.cjs +1 -0
  78. package/dist/js/{popover-BWnbK_dO.js → popover-dzUc2bK7.js} +21 -19
  79. package/dist/js/{section-message-79DbPIVf.cjs → section-message-Bn33yi2F.cjs} +1 -1
  80. package/dist/js/{section-message-DhkYCDQk.js → section-message-CEzwuyor.js} +1 -1
  81. package/dist/js/{select-C9m1ujim.js → select-BUeFgouh.js} +2 -2
  82. package/dist/js/{select-C8XEaJmE.cjs → select-BlpaGf5-.cjs} +1 -1
  83. package/dist/js/{select-control-CNKEx3wt.js → select-control-BlU3KNOJ.js} +3 -3
  84. package/dist/js/{select-control-C5inPWYx.cjs → select-control-DlaKfZ3x.cjs} +1 -1
  85. package/dist/js/{side-bar-q0Dapddc.cjs → side-bar-BkE4eONG.cjs} +1 -1
  86. package/dist/js/{side-bar-CsPEFLGc.js → side-bar-D6aRZHCV.js} +1 -1
  87. package/dist/js/{split-button-GzVuhKx-.cjs → split-button-Bnyv8DHF.cjs} +1 -1
  88. package/dist/js/{split-button-DHHUZ-41.js → split-button-CrofNP3Q.js} +1 -1
  89. package/dist/js/style.css +1 -1
  90. package/dist/js/{table-BVLzp-xe.js → table-2CxL0Pev.js} +1 -1
  91. package/dist/js/{table-skEBWgL8.cjs → table-WHyA-HQG.cjs} +1 -1
  92. package/dist/js/{tooltip-9vKZqx5w.cjs → tooltip-BU8hYqZ9.cjs} +1 -1
  93. package/dist/js/{tooltip-C2y49rDB.js → tooltip-Bj7DqYdo.js} +1 -1
  94. package/dist/js/{top-bar-BnR_HVWD.js → top-bar-BvxpBZri.js} +2 -2
  95. package/dist/js/{top-bar-CXJfqax_.cjs → top-bar-CjUR7fhL.cjs} +1 -1
  96. package/dist/js/utils/anchor-positioning.cjs +1 -1
  97. package/dist/js/utils/anchor-positioning.js +1 -1
  98. package/dist/js/utils/dialog.cjs +1 -0
  99. package/dist/js/utils/dialog.js +9 -0
  100. package/dist/js/utils/line-clamp.cjs +1 -1
  101. package/dist/js/utils/line-clamp.js +1 -1
  102. package/dist/js/utils/listbox.cjs +1 -1
  103. package/dist/js/utils/listbox.js +1 -1
  104. package/dist/js/utils/popover.cjs +1 -1
  105. package/dist/js/utils/popover.js +2 -2
  106. package/dist/types/core/combobox/popup-dialog/event-handlers.d.ts +0 -15
  107. package/dist/types/core/combobox/popup-dialog/event-handlers.d.ts.map +1 -1
  108. package/dist/types/core/combobox/popup-dialog/popup-dialog.d.ts.map +1 -1
  109. package/dist/types/core/dialog/dialog.d.ts +13 -18
  110. package/dist/types/core/dialog/dialog.d.ts.map +1 -1
  111. package/dist/types/core/dialog/dialog.stories.d.ts +25 -0
  112. package/dist/types/core/dialog/dialog.stories.d.ts.map +1 -1
  113. package/dist/types/core/dialog/styles.d.ts +1 -6
  114. package/dist/types/core/dialog/styles.d.ts.map +1 -1
  115. package/dist/types/core/drawer/drawer.d.ts +13 -18
  116. package/dist/types/core/drawer/drawer.d.ts.map +1 -1
  117. package/dist/types/core/drawer/drawer.stories.d.ts +25 -0
  118. package/dist/types/core/drawer/drawer.stories.d.ts.map +1 -1
  119. package/dist/types/core/drawer/styles.d.ts +1 -1
  120. package/dist/types/core/drawer/styles.d.ts.map +1 -1
  121. package/dist/types/core/office-switcher/__tests__/office-switcher-select-optgroup.test.d.ts +2 -0
  122. package/dist/types/core/office-switcher/__tests__/office-switcher-select-optgroup.test.d.ts.map +1 -0
  123. package/dist/types/core/office-switcher/__tests__/office-switcher-select-option.test.d.ts +2 -0
  124. package/dist/types/core/office-switcher/__tests__/office-switcher-select-option.test.d.ts.map +1 -0
  125. package/dist/types/core/office-switcher/index.d.ts +4 -0
  126. package/dist/types/core/office-switcher/index.d.ts.map +1 -1
  127. package/dist/types/core/office-switcher/office-group/__tests__/office-group-summary.test.d.ts +2 -0
  128. package/dist/types/core/office-switcher/office-group/__tests__/office-group-summary.test.d.ts.map +1 -0
  129. package/dist/types/core/office-switcher/office-group/__tests__/office-group.test.d.ts +2 -0
  130. package/dist/types/core/office-switcher/office-group/__tests__/office-group.test.d.ts.map +1 -0
  131. package/dist/types/core/office-switcher/office-group/index.d.ts +4 -0
  132. package/dist/types/core/office-switcher/office-group/index.d.ts.map +1 -0
  133. package/dist/types/core/office-switcher/office-group/office-group-summary.d.ts +22 -0
  134. package/dist/types/core/office-switcher/office-group/office-group-summary.d.ts.map +1 -0
  135. package/dist/types/core/office-switcher/office-group/office-group.d.ts +20 -0
  136. package/dist/types/core/office-switcher/office-group/office-group.d.ts.map +1 -0
  137. package/dist/types/core/office-switcher/office-group/office-group.stories.d.ts +20 -0
  138. package/dist/types/core/office-switcher/office-group/office-group.stories.d.ts.map +1 -0
  139. package/dist/types/core/office-switcher/office-group/styles.d.ts +5 -0
  140. package/dist/types/core/office-switcher/office-group/styles.d.ts.map +1 -0
  141. package/dist/types/core/office-switcher/office-item/__tests__/office-item.test.d.ts +2 -0
  142. package/dist/types/core/office-switcher/office-item/__tests__/office-item.test.d.ts.map +1 -0
  143. package/dist/types/core/office-switcher/office-item/index.d.ts +3 -0
  144. package/dist/types/core/office-switcher/office-item/index.d.ts.map +1 -0
  145. package/dist/types/core/office-switcher/office-item/office-item.d.ts +18 -0
  146. package/dist/types/core/office-switcher/office-item/office-item.d.ts.map +1 -0
  147. package/dist/types/core/office-switcher/office-item/office-item.stories.d.ts +42 -0
  148. package/dist/types/core/office-switcher/office-item/office-item.stories.d.ts.map +1 -0
  149. package/dist/types/core/office-switcher/office-item/styles.d.ts +6 -0
  150. package/dist/types/core/office-switcher/office-item/styles.d.ts.map +1 -0
  151. package/dist/types/core/office-switcher/office-switcher-popup.figma.d.ts +2 -0
  152. package/dist/types/core/office-switcher/office-switcher-popup.figma.d.ts.map +1 -0
  153. package/dist/types/core/office-switcher/office-switcher-select-optgroup.d.ts +24 -0
  154. package/dist/types/core/office-switcher/office-switcher-select-optgroup.d.ts.map +1 -0
  155. package/dist/types/core/office-switcher/office-switcher-select-optgroup.figma.d.ts +2 -0
  156. package/dist/types/core/office-switcher/office-switcher-select-optgroup.figma.d.ts.map +1 -0
  157. package/dist/types/core/office-switcher/office-switcher-select-option.d.ts +15 -0
  158. package/dist/types/core/office-switcher/office-switcher-select-option.d.ts.map +1 -0
  159. package/dist/types/core/office-switcher/office-switcher-select-option.figma.d.ts +2 -0
  160. package/dist/types/core/office-switcher/office-switcher-select-option.figma.d.ts.map +1 -0
  161. package/dist/types/core/office-switcher/office-switcher-select.figma.d.ts +2 -0
  162. package/dist/types/core/office-switcher/office-switcher-select.figma.d.ts.map +1 -0
  163. package/dist/types/core/office-switcher/office-switcher.d.ts +23 -3
  164. package/dist/types/core/office-switcher/office-switcher.d.ts.map +1 -1
  165. package/dist/types/core/office-switcher/office-switcher.figma.d.ts +2 -0
  166. package/dist/types/core/office-switcher/office-switcher.figma.d.ts.map +1 -0
  167. package/dist/types/core/office-switcher/office-switcher.stories.d.ts +4 -0
  168. package/dist/types/core/office-switcher/office-switcher.stories.d.ts.map +1 -1
  169. package/dist/types/utils/anchor-positioning/anchor-positioning.d.ts +1 -1
  170. package/dist/types/utils/anchor-positioning/anchor-positioning.d.ts.map +1 -1
  171. package/dist/types/utils/anchor-positioning/anchor-positioning.stories.d.ts.map +1 -1
  172. package/dist/types/utils/anchor-positioning/build-anchor-positioning-css.d.ts +5 -1
  173. package/dist/types/utils/anchor-positioning/build-anchor-positioning-css.d.ts.map +1 -1
  174. package/dist/types/utils/dialog/__tests__/close-on-backdrop-click.test.d.ts +2 -0
  175. package/dist/types/utils/dialog/__tests__/close-on-backdrop-click.test.d.ts.map +1 -0
  176. package/dist/types/utils/dialog/close-on-backdrop-click.d.ts +24 -0
  177. package/dist/types/utils/dialog/close-on-backdrop-click.d.ts.map +1 -0
  178. package/dist/types/utils/dialog/index.d.ts +2 -0
  179. package/dist/types/utils/dialog/index.d.ts.map +1 -0
  180. package/dist/types/utils/index.d.ts +1 -0
  181. package/dist/types/utils/index.d.ts.map +1 -1
  182. package/dist/types/utils/listbox/dom-helpers/selectors.d.ts +8 -2
  183. package/dist/types/utils/listbox/dom-helpers/selectors.d.ts.map +1 -1
  184. package/dist/types/utils/popover/popover.d.ts +6 -2
  185. package/dist/types/utils/popover/popover.d.ts.map +1 -1
  186. package/package.json +1 -1
  187. package/dist/js/combobox-ykwrJ8qP.cjs +0 -1
  188. package/dist/js/dialog-CjN2Nll1.js +0 -116
  189. package/dist/js/dialog-oPE93fe0.cjs +0 -1
  190. package/dist/js/drawer-DcgSXF1g.cjs +0 -1
  191. package/dist/js/drawer-GNG7AmHl.js +0 -197
  192. package/dist/js/listbox-BGrp52Hs.cjs +0 -1
  193. package/dist/js/popover-CA0t-z5e.cjs +0 -1
@@ -1,197 +0,0 @@
1
- import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
- import { s as t } from "./index-AHmiDD3r.js";
3
- import { createContext as A, useContext as v, useCallback as D, useRef as x, useLayoutEffect as C, useState as B, useId as O } from "react";
4
- import "./button-base-BxF98pDk.js";
5
- import { B as T } from "./button-DYIdjjTt.js";
6
- import { CloseIcon as F } from "./icons/close.js";
7
- const N = /* @__PURE__ */ t("article")({
8
- name: "ElDrawerBody",
9
- class: "el-drawer-body",
10
- propsAsIs: !1
11
- });
12
- function m({ children: e, ...r }) {
13
- return /* @__PURE__ */ s(N, { ...r, children: e });
14
- }
15
- m.displayName = "Drawer.Body";
16
- const u = A(null);
17
- function E() {
18
- const e = v(u);
19
- if (!e)
20
- throw new Error("DrawerContext not defined: useDrawerContext can only be used in a child of DrawerContext");
21
- return e;
22
- }
23
- const R = /* @__PURE__ */ t("footer")({
24
- name: "ElDrawerFooter",
25
- class: "el-drawer-footer",
26
- propsAsIs: !1
27
- });
28
- function h({ children: e, ...r }) {
29
- return /* @__PURE__ */ s(R, { ...r, children: e });
30
- }
31
- h.displayName = "Drawer.Footer";
32
- function H() {
33
- return /* @__PURE__ */ s("form", { children: /* @__PURE__ */ s(
34
- T,
35
- {
36
- autoFocus: !0,
37
- "aria-label": "Close",
38
- formMethod: "dialog",
39
- iconLeft: /* @__PURE__ */ s(F, { "aria-hidden": !0 }),
40
- size: "large",
41
- type: "submit",
42
- variant: "tertiary"
43
- }
44
- ) });
45
- }
46
- H.displayName = "Drawer.HeaderCloseButton";
47
- const ee = "drawer-header", S = /* @__PURE__ */ t("header")({
48
- name: "ElDrawerHeader",
49
- class: "el-drawer-header",
50
- propsAsIs: !1
51
- }), _ = /* @__PURE__ */ t("div")({
52
- name: "ElDrawerHeaderTabsContainer",
53
- class: "el-drawer-header-tabs-container",
54
- propsAsIs: !1
55
- }), M = /* @__PURE__ */ t("div")({
56
- name: "ElDrawerHeaderContentContainer",
57
- class: "el-drawer-header-content-container",
58
- propsAsIs: !1
59
- }), P = /* @__PURE__ */ t("div")({
60
- name: "ElDrawerHeaderTitleContainer",
61
- class: "el-drawer-header-title-container",
62
- propsAsIs: !1
63
- }), j = /* @__PURE__ */ t("div")({
64
- name: "ElDrawerHeaderAction",
65
- class: "el-drawer-header-action",
66
- propsAsIs: !1
67
- }), q = /* @__PURE__ */ t("div")({
68
- name: "ElDrawerHeaderOverline",
69
- class: "el-drawer-header-overline",
70
- propsAsIs: !1
71
- }), k = /* @__PURE__ */ t("h2")({
72
- name: "ElDrawerHeaderTitle",
73
- class: "el-drawer-header-title",
74
- propsAsIs: !1
75
- }), W = /* @__PURE__ */ t("div")({
76
- name: "ElDrawerHeaderSupplementaryInfo",
77
- class: "el-drawer-header-supplementary-info",
78
- propsAsIs: !1
79
- });
80
- function i({ action: e, overline: r, children: a, supplementaryInfo: o, tabs: n, ...d }) {
81
- const { titleId: c } = E() ?? {};
82
- return /* @__PURE__ */ s(S, { ...d, children: /* @__PURE__ */ f(M, { children: [
83
- /* @__PURE__ */ f(P, { children: [
84
- e && /* @__PURE__ */ s(j, { children: e }),
85
- r && /* @__PURE__ */ s(q, { children: r }),
86
- /* @__PURE__ */ s(k, { id: c, children: a }),
87
- o && /* @__PURE__ */ s(W, { children: o })
88
- ] }),
89
- n && /* @__PURE__ */ s(_, { children: n })
90
- ] }) });
91
- }
92
- i.displayName = "Drawer.Header";
93
- i.CloseButton = H;
94
- const z = /* @__PURE__ */ t("dialog")({
95
- name: "ElDrawer",
96
- class: "el-drawer",
97
- propsAsIs: !1
98
- });
99
- function L(e) {
100
- return e.closest("dialog");
101
- }
102
- function G(e, r) {
103
- return D(
104
- (a) => {
105
- a.stopPropagation(), e === "none" && a.target === a.currentTarget ? a.preventDefault() : r?.(a);
106
- },
107
- [e, r]
108
- );
109
- }
110
- function J(e) {
111
- const r = x(null);
112
- return C(
113
- function() {
114
- !r.current || e === void 0 || (e ? r.current.showModal() : r.current.close());
115
- },
116
- [e]
117
- ), r;
118
- }
119
- function K(e) {
120
- const [r, a] = B(!1);
121
- return C(() => {
122
- if (!e.current) return;
123
- const o = e.current;
124
- a(o.open);
125
- const n = new MutationObserver(() => {
126
- a(o.open);
127
- });
128
- return n.observe(o, {
129
- attributeFilter: ["open"]
130
- }), () => n.disconnect();
131
- }, [e, a]), r;
132
- }
133
- function Q(e) {
134
- return D(
135
- (r) => {
136
- r.stopPropagation(), e?.(r);
137
- },
138
- [e]
139
- );
140
- }
141
- function l({
142
- "aria-label": e,
143
- "aria-labelledby": r,
144
- children: a,
145
- closedBy: o = "closerequest",
146
- isOpen: n,
147
- onCancel: d,
148
- onClose: c,
149
- ...b
150
- }) {
151
- const p = J(n), g = K(p), w = O(), y = G(o, d), I = Q(c);
152
- return /* @__PURE__ */ s(
153
- z,
154
- {
155
- ...b,
156
- "aria-label": e,
157
- "aria-labelledby": e ? void 0 : r ?? w,
158
- ref: p,
159
- onCancel: y,
160
- onClose: I,
161
- children: /* @__PURE__ */ s(u.Provider, { value: { titleId: w }, children: g && a })
162
- }
163
- );
164
- }
165
- l.Body = m;
166
- l.Footer = h;
167
- l.Header = i;
168
- l.HeaderCloseButton = i.CloseButton;
169
- l.Context = u;
170
- l.useContext = E;
171
- l.getClosestDialogElement = L;
172
- export {
173
- m as D,
174
- N as E,
175
- u as a,
176
- l as b,
177
- h as c,
178
- R as d,
179
- H as e,
180
- i as f,
181
- ee as g,
182
- S as h,
183
- _ as i,
184
- M as j,
185
- P as k,
186
- j as l,
187
- q as m,
188
- k as n,
189
- W as o,
190
- z as p,
191
- L as q,
192
- G as r,
193
- J as s,
194
- K as t,
195
- E as u,
196
- Q as v
197
- };
@@ -1 +0,0 @@
1
- "use strict";const u=require("react/jsx-runtime"),te=require("./divider-D6g_RP0X.cjs"),a=require("react"),ne=require("./index-BAGJrh44.cjs"),oe=require("./handle-arrow-navigation-CKkGc2A5.cjs"),I=require("./use-mutation-observer-BBugqUeF.cjs"),h=a.createContext(null);function w(){const e=a.useContext(h);if(!e)throw new Error("useListboxContext must be used within a Listbox");return e}class b extends Error{constructor(t){super(t),this.name="ListboxError",Error.captureStackTrace&&Error.captureStackTrace(this,b)}}function p(e){let t;if(typeof e=="string"){const n=document.getElementById(e);if(!n)throw new b(`Listbox with id "${e}" does not exist in the document`);t=n}else t=e;const o=t.firstElementChild;if(!(o instanceof HTMLSelectElement)){const n=typeof e=="string"?`Listbox with id "${e}"`:"Listbox element";throw new b(`${n} does not contain a select element as its first child. Found: ${o?.constructor.name??"null"}`)}return o}function se(e,t){const o=Array.from(e.options).find(n=>n.value===t);if(!(o instanceof HTMLOptionElement)){const n=Array.from(e.options).map(s=>s.value).join(", ");throw new b(`Option with value "${t}" does not exist in select element. Available values: [${n}]`)}return o}function V(e){const t=new Event("input",{bubbles:!0,cancelable:!0});e.dispatchEvent(t)}function q(e){const t=p(e),o=t.selectedOptions.length>0;for(const n of Array.from(t.selectedOptions))n.selected=!1;o&&V(t)}function v(e){const t=e instanceof HTMLSelectElement?e:p(e),o=Array.from(t.selectedOptions).map(n=>n.value).filter(n=>n!=="");return t.multiple?o:o[0]??""}const m='button[role="option"]',y=`${m}:is([aria-checked="true"], [aria-selected="true"])`;function F(e){return Array.from(e.querySelectorAll(y)).filter(t=>t instanceof HTMLButtonElement&&t.value!=="")}function R(e,t,o){const n=p(e),s=se(n,t),i=s.selected;s.selected=o(s.selected,n),i!==s.selected&&V(n)}function j(e){return`${e}-select`}const L=a.createContext(null);function O(){const e=a.useContext(L);if(!e)throw new Error("useListboxRenderContext must be used within a Listbox");return e}const ie={auto:(e,t)=>t.multiple?!e:!0,toggle:e=>!e,select:()=>!0};function re(e){return e==="auto"||e==="toggle"||e==="select"}function ce(e){const{listboxId:t,selectAction:o}=e.currentTarget.dataset,n=e.currentTarget.value;!t||typeof n!="string"||re(o)&&R(t,n,ie[o])}function A({as:e,children:t,disabled:o,onClick:n,value:s,...i}){const l=e||"button",c=w(),f=O(),d=c.selectValue.includes(s)||s===""&&c.selectValue.length===0;if(f==="native")return d?null:u.jsx("option",{value:s,children:t});const x=S=>{n?.(S),ce(S)};return u.jsx(l,{...i,"aria-checked":c.multiple?d:void 0,"aria-selected":c.multiple?void 0:d,"data-listbox-id":c.listboxId,"data-select-action":c.selectAction,disabled:c.disabled||o,onClick:x,role:"option",tabIndex:-1,type:"button",value:s,children:t})}A.displayName="Listbox.Option";function M({as:e,children:t,label:o,...n}){return O()==="native"?u.jsx("optgroup",{label:o,children:t}):u.jsx(e,{...n,label:o,role:"group",children:t})}M.displayName="Listbox.Optgroup";const le=ne.styled_default("select")({name:"ElListboxSelect",class:"el-listbox-select",propsAsIs:!1}),B=a.forwardRef(function({children:t,onChange:o,placeholder:n="Select an option",multiple:s,value:i,...l},c){return u.jsxs(le,{...l,hidden:!0,multiple:s,onChange:o,onInput:o,ref:c,value:s?i:i[0]??"",children:[!s&&u.jsx("option",{value:"",children:n}),i.map(f=>u.jsx("option",{value:f,children:f},f)),u.jsx(L.Provider,{value:"native",children:t})]})});function ae(e){const t=e.currentTarget,o=p(t);t.contains(e.relatedTarget)||(t.tabIndex=0,e.isTrusted&&o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,cancelable:!0,relatedTarget:e.relatedTarget})))}function g(e){return e instanceof HTMLButtonElement}function ue(e){return e instanceof HTMLElement&&e.matches(":focus-visible")}function de(e){const t=e.currentTarget,o=p(t),n=t.dataset.selectionFollowsFocus==="true",{relatedTarget:s,target:i}=e,l=ue(i),c=!t.contains(s),f=t.contains(s)&&g(i)&&g(s);if(l&&f&&n){i.click();return}if(c&&(e.isTrusted&&o.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,cancelable:!0,relatedTarget:e.relatedTarget})),l)){t.tabIndex=-1;const d=t.querySelector(y);if(g(d)){d.focus();return}const x=t.querySelector(m);g(x)&&(x.focus(),n&&x.click())}}function N({onKeyDown:e}){return{onBlur:s=>{ae(s)},onFocus:s=>{de(s)},onKeyDown:s=>{e?.(s),oe.handleArrowNavigation(s,{selectors:m})}}}function $(e,t){const o=a.useRef(t);a.useEffect(function(){o.current=t},[t]);const n=a.useCallback(()=>{const s=document.getElementById(e);if(s){const i=v(e),l=F(s);o.current(l,i)}},[e]);a.useEffect(function(){n()},[]),I.useMutationObserver(e,n,fe),I.useMutationObserver(j(e),n,xe)}const fe={attributeFilter:["aria-checked","aria-selected"],subtree:!0},xe={childList:!0};function D({defaultValue:e,multiple:t,onChange:o,value:n}){const[s,i]=a.useState(()=>T(n??e??[])),l=T(n??s);return[t?l:l.slice(0,1),d=>{o?.(d),i(T(v(d.currentTarget)))}]}function T(e){return typeof e=="string"?[e]:e}function H(e){return a.useState(e)}function r({"aria-disabled":e=!1,"aria-multiselectable":t=!1,"aria-orientation":o="vertical","aria-required":n=!1,as:s,children:i,className:l,defaultValue:c,id:f,name:d,onBlur:x,onChange:S,onFocus:P,onKeyDown:_,placeholder:K,selectAction:k="auto",selectRef:z,selectionFollowsFocus:G=!t,style:J,value:Q,...U}){const W=s??"div",X=a.useId(),E=f??X,[C,Y]=D({defaultValue:c,multiple:t,onChange:S,value:Q}),Z=N({onKeyDown:_}),ee=a.useMemo(()=>({disabled:e,listboxId:E,multiple:t,selectAction:k,selectValue:C}),[e,E,t,k,C]);return u.jsx(W,{...U,...Z,"aria-disabled":e,"aria-multiselectable":t,"aria-orientation":o,"aria-required":n,"data-selection-follows-focus":G,className:l,id:E,role:"listbox",style:J,tabIndex:0,children:u.jsxs(h.Provider,{value:ee,children:[u.jsx(B,{disabled:e,id:j(E),multiple:t,name:d,onBlur:x,onChange:Y,onFocus:P,placeholder:K,ref:z,required:n,value:C,children:i}),u.jsx(L.Provider,{value:"custom",children:i})]})})}r.Divider=te.Divider;r.Option=A;r.Optgroup=M;r.Select=B;r.useSelectionObserver=$;r.useState=H;r.Context=h;r.RenderContext=L;r.useContext=w;r.useRenderContext=O;r.clearValue=q;r.getSelectedOptions=F;r.getValue=v;r.setOptionSelectedState=R;exports.Listbox=r;exports.ListboxContext=h;exports.ListboxOptgroup=M;exports.ListboxOption=A;exports.ListboxRenderContext=L;exports.OPTION_SELECTOR=m;exports.SELECTED_OPTION_SELECTOR=y;exports.clearListboxValue=q;exports.getListboxSelectId=j;exports.getListboxSelectedOptions=F;exports.getListboxValue=v;exports.setListboxOptionSelectedState=R;exports.useFocusManagement=N;exports.useListboxContext=w;exports.useListboxRenderContext=O;exports.useListboxSelectState=D;exports.useListboxSelectionObserver=$;exports.useListboxState=H;
@@ -1 +0,0 @@
1
- "use strict";const s=require("react/jsx-runtime"),I=require("./anchor-positioning-CmSZkNof.cjs"),b=require("./index-8ctufnBx.cjs");function i({id:e,popoverTarget:o,popoverTargetAction:r}){return{id:e,popovertarget:o,popovertargetaction:r}}const p="el-popover";function y(e){return e.closest("[popover]")}function t({alignSelf:e,anchorId:o,borderRadius:r,children:c,className:g,bottom:v,elevation:l="none",gap:a,id:n,justifySelf:u,left:P,maxHeight:d,maxWidth:m,minWidth:h,placement:x,positionTryFallbacks:f,popover:E="auto",right:j,style:q,top:T,...C}){return s.jsxs("div",{...C,className:b.cx_default(p,g),"data-elevation":l,id:n,popover:E,style:{...q,"--popover-border-radius":r,"--popover-max-height":d},children:[s.jsx(I.AnchorPositioning,{anchorElementId:o,alignSelf:e,bottom:v,gap:a,justifySelf:u,left:P,maxWidth:m,minWidth:h,placement:x,positionedElementId:n,positionTryFallbacks:f,right:j,top:T}),c]})}t.getTriggerProps=i;t.getClosestPopoverElement=y;exports.Popover=t;exports.elPopover=p;exports.getPopoverTriggerProps=i;