@servicetitan/anvil2 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/{Alert-49d915aa.js → Alert-012e475c.js} +22 -22
  2. package/Alert-012e475c.js.map +1 -0
  3. package/Alert-066f00f2.cjs +2 -0
  4. package/Alert-066f00f2.cjs.map +1 -0
  5. package/Alert.cjs +1 -1
  6. package/Alert.js +1 -1
  7. package/Announcement-cd9602ed.cjs +2 -0
  8. package/Announcement-cd9602ed.cjs.map +1 -0
  9. package/{Announcement-eb5fd003.js → Announcement-f9b09ba3.js} +5 -5
  10. package/Announcement-f9b09ba3.js.map +1 -0
  11. package/Announcement.cjs +1 -1
  12. package/Announcement.js +1 -1
  13. package/AnvilProvider.cjs +1 -1
  14. package/AnvilProvider.js +1 -1
  15. package/Avatar.cjs +1 -1
  16. package/Avatar.js +1 -1
  17. package/Button.cjs +1 -1
  18. package/Button.cjs.map +1 -1
  19. package/Button.js +19 -26
  20. package/Button.js.map +1 -1
  21. package/ButtonCompound.cjs +1 -1
  22. package/ButtonCompound.cjs.map +1 -1
  23. package/ButtonCompound.js +19 -26
  24. package/ButtonCompound.js.map +1 -1
  25. package/ButtonLink.cjs +1 -1
  26. package/ButtonLink.cjs.map +1 -1
  27. package/ButtonLink.js +19 -26
  28. package/ButtonLink.js.map +1 -1
  29. package/ButtonToggle.cjs +1 -1
  30. package/ButtonToggle.cjs.map +1 -1
  31. package/ButtonToggle.js +19 -26
  32. package/ButtonToggle.js.map +1 -1
  33. package/{Calendar-6af49637.js → Calendar-31bcb381.js} +2 -2
  34. package/{Calendar-6af49637.js.map → Calendar-31bcb381.js.map} +1 -1
  35. package/Calendar-d0baf4b1.cjs +2 -0
  36. package/{Calendar-21727a1d.cjs.map → Calendar-d0baf4b1.cjs.map} +1 -1
  37. package/Calendar.cjs +1 -1
  38. package/Calendar.js +1 -1
  39. package/Checkbox.cjs +1 -1
  40. package/Checkbox.cjs.map +1 -1
  41. package/Checkbox.js +49 -22
  42. package/Checkbox.js.map +1 -1
  43. package/{Chip-de78e3f6.cjs → Chip-5b63e48c.cjs} +2 -2
  44. package/{Chip-de78e3f6.cjs.map → Chip-5b63e48c.cjs.map} +1 -1
  45. package/{Chip-6dbdbc2e.js → Chip-6dde28bc.js} +3 -3
  46. package/{Chip-6dbdbc2e.js.map → Chip-6dde28bc.js.map} +1 -1
  47. package/Chip.cjs +1 -1
  48. package/Chip.js +1 -1
  49. package/Combobox.cjs +1 -1
  50. package/Combobox.cjs.map +1 -1
  51. package/Combobox.js +31 -38
  52. package/Combobox.js.map +1 -1
  53. package/Details.cjs +1 -1
  54. package/Details.cjs.map +1 -1
  55. package/Details.js +22 -29
  56. package/Details.js.map +1 -1
  57. package/Dialog.cjs +1 -1
  58. package/Dialog.cjs.map +1 -1
  59. package/Dialog.js +35 -42
  60. package/Dialog.js.map +1 -1
  61. package/Drawer.cjs +1 -1
  62. package/Drawer.cjs.map +1 -1
  63. package/Drawer.js +63 -36
  64. package/Drawer.js.map +1 -1
  65. package/Link.cjs +1 -1
  66. package/Link.cjs.map +1 -1
  67. package/Link.js +24 -31
  68. package/Link.js.map +1 -1
  69. package/ListView-3b1adecb.js +557 -0
  70. package/ListView-3b1adecb.js.map +1 -0
  71. package/ListView-88e49b19.cjs +2 -0
  72. package/ListView-88e49b19.cjs.map +1 -0
  73. package/ListView.cjs +1 -1
  74. package/ListView.css +1 -1
  75. package/ListView.js +1 -1
  76. package/{Listbox-030b2993.js → Listbox-60fbdaa1.js} +2 -2
  77. package/{Listbox-030b2993.js.map → Listbox-60fbdaa1.js.map} +1 -1
  78. package/Listbox.js +1 -1
  79. package/Menu.cjs +1 -1
  80. package/Menu.cjs.map +1 -1
  81. package/Menu.js +52 -25
  82. package/Menu.js.map +1 -1
  83. package/Overflow.cjs +1 -1
  84. package/Overflow.cjs.map +1 -1
  85. package/Overflow.js +26 -33
  86. package/Overflow.js.map +1 -1
  87. package/Page.cjs +1 -1
  88. package/Page.js +2 -2
  89. package/Popover.cjs +1 -1
  90. package/Popover.cjs.map +1 -1
  91. package/Popover.js +28 -35
  92. package/Popover.js.map +1 -1
  93. package/ProgressBar-c1b5c7c3.js +516 -0
  94. package/ProgressBar-c1b5c7c3.js.map +1 -0
  95. package/ProgressBar-fa511478.cjs +2 -0
  96. package/ProgressBar-fa511478.cjs.map +1 -0
  97. package/ProgressBar.cjs +1 -1
  98. package/ProgressBar.css +1 -1
  99. package/ProgressBar.js +1 -1
  100. package/Radio.cjs +1 -1
  101. package/Radio.cjs.map +1 -1
  102. package/Radio.js +50 -23
  103. package/Radio.js.map +1 -1
  104. package/SegmentedControl.cjs +1 -1
  105. package/SegmentedControl.cjs.map +1 -1
  106. package/SegmentedControl.d.ts +9 -5
  107. package/SegmentedControl.js +72 -12
  108. package/SegmentedControl.js.map +1 -1
  109. package/{SideNav-80e5ce2f.js → SideNav-33a404ec.js} +2 -2
  110. package/{SideNav-80e5ce2f.js.map → SideNav-33a404ec.js.map} +1 -1
  111. package/SideNav.js +1 -1
  112. package/{Stepper-85a93af9.js → Stepper-7e3a130c.js} +79 -79
  113. package/Stepper-7e3a130c.js.map +1 -0
  114. package/Stepper-8675700c.cjs +2 -0
  115. package/Stepper-8675700c.cjs.map +1 -0
  116. package/Stepper.cjs +1 -1
  117. package/Stepper.js +1 -1
  118. package/Switch.cjs +1 -1
  119. package/Switch.cjs.map +1 -1
  120. package/Switch.js +44 -17
  121. package/Switch.js.map +1 -1
  122. package/{Tab-68267c78.js → Tab-dd4ab045.js} +2 -2
  123. package/{Tab-68267c78.js.map → Tab-dd4ab045.js.map} +1 -1
  124. package/Tab.js +1 -1
  125. package/TextField.cjs +1 -1
  126. package/TextField.cjs.map +1 -1
  127. package/TextField.js +23 -30
  128. package/TextField.js.map +1 -1
  129. package/Textarea.cjs +1 -1
  130. package/Textarea.cjs.map +1 -1
  131. package/Textarea.js +23 -30
  132. package/Textarea.js.map +1 -1
  133. package/ThemeProvider.cjs +1 -1
  134. package/ThemeProvider.js +1 -1
  135. package/Toast-32a4ab22.cjs +9 -0
  136. package/Toast-32a4ab22.cjs.map +1 -0
  137. package/{Toast-330e28fb.js → Toast-6cd7d2e1.js} +58 -58
  138. package/Toast-6cd7d2e1.js.map +1 -0
  139. package/Toast.cjs +1 -1
  140. package/Toast.js +1 -1
  141. package/Tooltip.cjs +1 -1
  142. package/Tooltip.cjs.map +1 -1
  143. package/Tooltip.js +19 -26
  144. package/Tooltip.js.map +1 -1
  145. package/anvil2.cjs +1 -1
  146. package/anvil2.d.ts +5 -5
  147. package/anvil2.js +171 -178
  148. package/anvil2.js.map +1 -1
  149. package/{floating-ui.react-8d61182d.js → floating-ui.react-51a3fa68.js} +26 -26
  150. package/{floating-ui.react-8d61182d.js.map → floating-ui.react-51a3fa68.js.map} +1 -1
  151. package/{Button-855c7b85.js → index-3a4e28a9-3d7ba14f.js} +90 -90
  152. package/index-3a4e28a9-3d7ba14f.js.map +1 -0
  153. package/index-3a4e28a9-b649e635.cjs +2 -0
  154. package/index-3a4e28a9-b649e635.cjs.map +1 -0
  155. package/{index-439b5871.js → index-3f218083.js} +9 -9
  156. package/{index-439b5871.js.map → index-3f218083.js.map} +1 -1
  157. package/{index-f6c22572.cjs → index-63e13299.cjs} +2 -2
  158. package/{index-f6c22572.cjs.map → index-63e13299.cjs.map} +1 -1
  159. package/index-c41dc41a.js +4972 -0
  160. package/index-c41dc41a.js.map +1 -0
  161. package/index-ca7c66ae.cjs +23 -0
  162. package/index-ca7c66ae.cjs.map +1 -0
  163. package/index-d46fa8de-c02f7a12.cjs +2 -0
  164. package/index-d46fa8de-c02f7a12.cjs.map +1 -0
  165. package/index-d46fa8de-f8bf17b6.js +540 -0
  166. package/index-d46fa8de-f8bf17b6.js.map +1 -0
  167. package/{index-f7658447-d8b2b888.js → index-f7658447-1cfbda8f.js} +8 -9
  168. package/{index-f7658447-d8b2b888.js.map → index-f7658447-1cfbda8f.js.map} +1 -1
  169. package/index-f7658447-f447ade8.cjs +2 -0
  170. package/{index-f7658447-d9ca2747.cjs.map → index-f7658447-f447ade8.cjs.map} +1 -1
  171. package/index3.css +1 -1
  172. package/package.json +2 -2
  173. package/useAccessibleColor.cjs +1 -1
  174. package/useAccessibleColor.js +19 -26
  175. package/useAccessibleColor.js.map +1 -1
  176. package/useLinkStyles.cjs +1 -1
  177. package/useLinkStyles.js +18 -25
  178. package/useLinkStyles.js.map +1 -1
  179. package/useMergeRefs.cjs +1 -1
  180. package/useMergeRefs.js +19 -26
  181. package/useMergeRefs.js.map +1 -1
  182. package/usePrefersColorScheme.cjs +1 -1
  183. package/usePrefersColorScheme.js +19 -26
  184. package/usePrefersColorScheme.js.map +1 -1
  185. package/useSwipe.cjs +1 -1
  186. package/useSwipe.js +19 -26
  187. package/useSwipe.js.map +1 -1
  188. package/Alert-49d915aa.js.map +0 -1
  189. package/Alert-e48c196e.cjs +0 -2
  190. package/Alert-e48c196e.cjs.map +0 -1
  191. package/Announcement-d598ea11.cjs +0 -2
  192. package/Announcement-d598ea11.cjs.map +0 -1
  193. package/Announcement-eb5fd003.js.map +0 -1
  194. package/Button-855c7b85.js.map +0 -1
  195. package/Button-8fe1ed7f.cjs +0 -2
  196. package/Button-8fe1ed7f.cjs.map +0 -1
  197. package/Calendar-21727a1d.cjs +0 -2
  198. package/Checkbox-28412a96.cjs +0 -2
  199. package/Checkbox-28412a96.cjs.map +0 -1
  200. package/Checkbox-54ecbd70.js +0 -163
  201. package/Checkbox-54ecbd70.js.map +0 -1
  202. package/Checkbox.css +0 -1
  203. package/Drawer-45208baf.cjs +0 -2
  204. package/Drawer-45208baf.cjs.map +0 -1
  205. package/Drawer-f95784bb.js +0 -209
  206. package/Drawer-f95784bb.js.map +0 -1
  207. package/Drawer.css +0 -1
  208. package/ListView-ad64a337.js +0 -403
  209. package/ListView-ad64a337.js.map +0 -1
  210. package/ListView-fcd88dd1.cjs +0 -2
  211. package/ListView-fcd88dd1.cjs.map +0 -1
  212. package/ProgressBar-0c2b3852.cjs +0 -2
  213. package/ProgressBar-0c2b3852.cjs.map +0 -1
  214. package/ProgressBar-f54440d6.js +0 -301
  215. package/ProgressBar-f54440d6.js.map +0 -1
  216. package/Radio-845d1fe6.cjs +0 -2
  217. package/Radio-845d1fe6.cjs.map +0 -1
  218. package/Radio-8f8e771e.js +0 -124
  219. package/Radio-8f8e771e.js.map +0 -1
  220. package/Radio.css +0 -1
  221. package/SegmentedControl-d223643c.js +0 -108
  222. package/SegmentedControl-d223643c.js.map +0 -1
  223. package/SegmentedControl-e5e48c23.cjs +0 -2
  224. package/SegmentedControl-e5e48c23.cjs.map +0 -1
  225. package/SegmentedControl.css +0 -1
  226. package/Stepper-51ada533.cjs +0 -2
  227. package/Stepper-51ada533.cjs.map +0 -1
  228. package/Stepper-85a93af9.js.map +0 -1
  229. package/Switch-7bfb6be6.cjs +0 -2
  230. package/Switch-7bfb6be6.cjs.map +0 -1
  231. package/Switch-917c699a.js +0 -54
  232. package/Switch-917c699a.js.map +0 -1
  233. package/Switch.css +0 -1
  234. package/Toast-330e28fb.js.map +0 -1
  235. package/Toast-f154bebc.cjs +0 -9
  236. package/Toast-f154bebc.cjs.map +0 -1
  237. package/getKeyboardFocusableElements-ea0e208d-58a00025.js +0 -14
  238. package/getKeyboardFocusableElements-ea0e208d-58a00025.js.map +0 -1
  239. package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs +0 -2
  240. package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs.map +0 -1
  241. package/index-06c0bdf0.js +0 -480
  242. package/index-06c0bdf0.js.map +0 -1
  243. package/index-09cb022c-28ca3469.js +0 -520
  244. package/index-09cb022c-28ca3469.js.map +0 -1
  245. package/index-09cb022c-f4ddfd52.cjs +0 -2
  246. package/index-09cb022c-f4ddfd52.cjs.map +0 -1
  247. package/index-09cb022c.css +0 -1
  248. package/index-671f29a9.cjs +0 -23
  249. package/index-671f29a9.cjs.map +0 -1
  250. package/index-6ad2779a.js +0 -4227
  251. package/index-6ad2779a.js.map +0 -1
  252. package/index-a53df036.cjs +0 -2
  253. package/index-a53df036.cjs.map +0 -1
  254. package/index-d46fa8de-08092573.cjs +0 -2
  255. package/index-d46fa8de-08092573.cjs.map +0 -1
  256. package/index-d46fa8de-8695742b.js +0 -62
  257. package/index-d46fa8de-8695742b.js.map +0 -1
  258. package/index-f7658447-d9ca2747.cjs +0 -2
  259. /package/{Button.css → index-3a4e28a9.css} +0 -0
@@ -1,209 +0,0 @@
1
- import "./Drawer.css";
2
- import { f as a } from "./jsx-runtime-944c88e2-e73fa629.js";
3
- import { forwardRef as w, createContext as G, useRef as g, useState as X, useId as J, useEffect as O, useMemo as Q, useContext as U } from "react";
4
- import { c as y } from "./index-e0f6271a.js";
5
- import "./index-06c0bdf0.js";
6
- import { a as V } from "./getKeyboardFocusableElements-ea0e208d-58a00025.js";
7
- import "./useLayoutPropsUtil-e307abc7-cbe2fb6d.js";
8
- import { u as W } from "./floating-ui.react-8d61182d.js";
9
- import { a as Y } from "./close-064c8acc-7e0b4df7.js";
10
- import { $ as Z } from "./Text-465104f6.js";
11
- import { B as ee } from "./Button-855c7b85.js";
12
- const re = "_drawer_1pnmb_4", ne = "_container_1pnmb_28", te = "_content_1pnmb_41", ae = "_header_1pnmb_46", oe = "_footer_1pnmb_68", se = "_remove_1pnmb_86", le = "_large_1pnmb_95", ce = "_sticky_1pnmb_98", o = {
13
- drawer: re,
14
- "close-drawer": "_close-drawer_1pnmb_1",
15
- "open-drawer": "_open-drawer_1pnmb_1",
16
- "open-backdrop": "_open-backdrop_1pnmb_1",
17
- container: ne,
18
- content: te,
19
- header: ae,
20
- "close-container": "_close-container_1pnmb_61",
21
- footer: oe,
22
- remove: se,
23
- "close-backdrop": "_close-backdrop_1pnmb_1",
24
- large: le,
25
- sticky: ce,
26
- "close-button": "_close-button_1pnmb_104"
27
- }, K = w((n, s) => {
28
- const { onClick: t, ...i } = n, { close: d } = ie(), p = (l) => {
29
- d(), t == null || t(l);
30
- };
31
- return /* @__PURE__ */ a.jsx(
32
- ee,
33
- {
34
- "aria-label": "Close drawer",
35
- "data-anv": "drawer-cancel-button",
36
- onClick: p,
37
- ref: s,
38
- ...i
39
- }
40
- );
41
- });
42
- K.displayName = "DrawerCancelButton";
43
- const B = w(
44
- (n, s) => {
45
- const { children: t } = n;
46
- return /* @__PURE__ */ a.jsxs("header", { className: o.header, "data-anv": "drawer-header", ref: s, children: [
47
- /* @__PURE__ */ a.jsx(Z, { variant: "headline", el: "h1", children: t }),
48
- /* @__PURE__ */ a.jsx("span", { className: o["close-container"], children: /* @__PURE__ */ a.jsx(
49
- K,
50
- {
51
- className: o["close-button"],
52
- size: "small",
53
- appearance: "ghost",
54
- "aria-label": "Close dialog",
55
- icon: Y
56
- }
57
- ) })
58
- ] });
59
- }
60
- );
61
- B.displayName = "DrawerHeader";
62
- const E = w(
63
- (n, s) => {
64
- const { children: t, sticky: i = !1, ...d } = n, p = y(o.footer, {
65
- [o.sticky]: i
66
- });
67
- return /* @__PURE__ */ a.jsx(
68
- "footer",
69
- {
70
- className: p,
71
- "data-anv": "drawer-footer",
72
- ref: s,
73
- ...d,
74
- children: t
75
- }
76
- );
77
- }
78
- );
79
- E.displayName = "DrawerFooter";
80
- const M = w(
81
- (n, s) => {
82
- const { children: t, ...i } = n, d = y(o.content, {});
83
- return /* @__PURE__ */ a.jsx(
84
- "div",
85
- {
86
- className: d,
87
- "data-anv": "drawer-content",
88
- ref: s,
89
- ...i,
90
- children: t
91
- }
92
- );
93
- }
94
- );
95
- M.displayName = "DrawerContent";
96
- const T = G(null), z = w(
97
- (n, s) => {
98
- const {
99
- className: t,
100
- open: i = !1,
101
- children: d,
102
- onOpen: p,
103
- onClose: l,
104
- onCancel: ue,
105
- onClick: j,
106
- onKeyDown: k,
107
- disableCloseOnEscape: F = !1,
108
- disableCloseOnClickOutside: H = !1,
109
- size: L = "medium",
110
- ...P
111
- } = n, m = g(null), D = g(null), r = g(null), [R, b] = X(!1), h = J(), S = y([o.drawer], t, {
112
- [o.remove]: R,
113
- [o.large]: L === "large"
114
- }), v = V(m.current), f = v[0], C = v[v.length - 1], x = () => {
115
- var e;
116
- if (r.current) {
117
- const u = (r.current.dataset.drawersOpen ? r.current.dataset.drawersOpen.split(" ") : []).filter((_) => _ !== h);
118
- u.length === 0 ? (r.current.removeAttribute("data-drawers-open"), (e = r.current) == null || e.classList.remove("drawer-open")) : r.current.dataset.drawersOpen = u.join(" ");
119
- }
120
- };
121
- O(() => {
122
- var e, u, _, N;
123
- if (i) {
124
- if (p == null || p(), (e = m.current) == null || e.showModal(), !r.current) {
125
- const c = (u = m.current) == null ? void 0 : u.closest("body");
126
- c && (r.current = c);
127
- }
128
- if (!((_ = m.current) != null && _.querySelector(":focus")) && (f == null || f.focus()), (N = r.current) == null || N.classList.add("drawer-open"), r.current) {
129
- const c = r.current.dataset.drawersOpen ? r.current.dataset.drawersOpen.split(" ") : [];
130
- if (c.includes(h))
131
- return;
132
- c.push(h), r.current.dataset.drawersOpen = c.join(" ");
133
- }
134
- return;
135
- }
136
- b(!0), setTimeout(() => {
137
- var c;
138
- (c = m.current) == null || c.close(), x(), b(!1);
139
- }, 200);
140
- }, [f, p, i]), O(() => () => x(), []);
141
- const $ = (e) => {
142
- e.preventDefault(), !F && (l == null || l());
143
- }, q = (e) => {
144
- var u;
145
- j == null || j(e);
146
- const _ = e.target;
147
- if (!((u = D.current) != null && u.contains(_))) {
148
- if (e.preventDefault(), H)
149
- return;
150
- l == null || l();
151
- }
152
- }, A = (e) => {
153
- if (k == null || k(e), e.code === "Tab") {
154
- if (e.shiftKey && e.target === f) {
155
- e.preventDefault(), C == null || C.focus();
156
- return;
157
- }
158
- if (e.target === C && !e.shiftKey) {
159
- e.preventDefault(), f == null || f.focus();
160
- return;
161
- }
162
- }
163
- }, I = Q(() => ({ close: () => {
164
- b(!0), setTimeout(() => {
165
- var e;
166
- x(), (e = m.current) == null || e.close(), l == null || l();
167
- }, 200);
168
- } }), [l]);
169
- return (
170
- // dialog element does seem to be interactive on MDN guideline
171
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
172
- /* @__PURE__ */ a.jsx(
173
- "dialog",
174
- {
175
- className: S,
176
- "data-anv": "drawer",
177
- ref: W([s, m]),
178
- onCancel: $,
179
- onClick: q,
180
- onKeyDown: A,
181
- ...P,
182
- children: /* @__PURE__ */ a.jsx(T.Provider, { value: I, children: /* @__PURE__ */ a.jsx("section", { ref: D, className: o.container, children: d }) })
183
- }
184
- )
185
- );
186
- }
187
- );
188
- function ie() {
189
- const n = U(T);
190
- if (!n)
191
- throw new Error(
192
- "useDrawerContext must be used within a DrawerContextProvider"
193
- );
194
- return n;
195
- }
196
- z.displayName = "Drawer";
197
- const ge = Object.assign(z, {
198
- Header: B,
199
- Footer: E,
200
- Content: M
201
- });
202
- export {
203
- E as B,
204
- B as E,
205
- K as H,
206
- M as K,
207
- ge as g
208
- };
209
- //# sourceMappingURL=Drawer-f95784bb.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Drawer-f95784bb.js","sources":["../node_modules/@servicetitan/hammer-react/dist/Drawer.js"],"sourcesContent":["import \"./index14.css\";\nimport { j as a } from \"./jsx-runtime-944c88e2.js\";\nimport { forwardRef as _, createContext as J, useRef as N, useState as Q, useId as U, useEffect as R, useMemo as V, useContext as W } from \"react\";\nimport O from \"classnames\";\nimport \"@servicetitan/hammer-token\";\nimport \"lodash.merge\";\nimport { g as Y } from \"./getKeyboardFocusableElements-ea0e208d.js\";\nimport \"tinycolor2\";\nimport { useMergeRefs as Z } from \"@floating-ui/react\";\nimport { S as $ } from \"./close-064c8acc.js\";\nimport { Text as ee } from \"./Text.js\";\nimport { Button as re } from \"./Button.js\";\nconst te = \"_drawer_1pnmb_4\", ne = \"_container_1pnmb_28\", oe = \"_content_1pnmb_41\", ae = \"_header_1pnmb_46\", se = \"_footer_1pnmb_68\", ce = \"_remove_1pnmb_86\", le = \"_large_1pnmb_95\", de = \"_sticky_1pnmb_98\", s = {\n drawer: te,\n \"close-drawer\": \"_close-drawer_1pnmb_1\",\n \"open-drawer\": \"_open-drawer_1pnmb_1\",\n \"open-backdrop\": \"_open-backdrop_1pnmb_1\",\n container: ne,\n content: oe,\n header: ae,\n \"close-container\": \"_close-container_1pnmb_61\",\n footer: se,\n remove: ce,\n \"close-backdrop\": \"_close-backdrop_1pnmb_1\",\n large: le,\n sticky: de,\n \"close-button\": \"_close-button_1pnmb_104\"\n}, H = _((t, c) => {\n const { onClick: o, ...l } = t, { close: p } = ie(), d = (n) => {\n p(), o == null || o(n);\n };\n return /* @__PURE__ */ a.jsx(\n re,\n {\n \"aria-label\": \"Close drawer\",\n \"data-anv\": \"drawer-cancel-button\",\n onClick: d,\n ref: c,\n ...l\n }\n );\n});\nH.displayName = \"DrawerCancelButton\";\nconst E = _(\n (t, c) => {\n const { children: o } = t;\n return /* @__PURE__ */ a.jsxs(\"header\", { className: s.header, \"data-anv\": \"drawer-header\", ref: c, children: [\n /* @__PURE__ */ a.jsx(ee, { variant: \"headline\", el: \"h1\", children: o }),\n /* @__PURE__ */ a.jsx(\"span\", { className: s[\"close-container\"], children: /* @__PURE__ */ a.jsx(\n H,\n {\n className: s[\"close-button\"],\n size: \"small\",\n appearance: \"ghost\",\n \"aria-label\": \"Close dialog\",\n icon: $\n }\n ) })\n ] });\n }\n);\nE.displayName = \"DrawerHeader\";\nconst B = _(\n (t, c) => {\n const { children: o, sticky: l = !1, ...p } = t, d = O(s.footer, {\n [s.sticky]: l\n });\n return /* @__PURE__ */ a.jsx(\n \"footer\",\n {\n className: d,\n \"data-anv\": \"drawer-footer\",\n ref: c,\n ...p,\n children: o\n }\n );\n }\n);\nB.displayName = \"DrawerFooter\";\nconst K = _(\n (t, c) => {\n const { children: o, ...l } = t, p = O(s.content, {});\n return /* @__PURE__ */ a.jsx(\n \"div\",\n {\n className: p,\n \"data-anv\": \"drawer-content\",\n ref: c,\n ...l,\n children: o\n }\n );\n }\n);\nK.displayName = \"DrawerContent\";\nconst S = J(null), T = _(\n (t, c) => {\n const {\n className: o,\n open: l = !1,\n children: p,\n onOpen: d,\n onClose: n,\n onCancel: ue,\n onClick: v,\n onKeyDown: D,\n disableCloseOnEscape: F = !1,\n disableCloseOnClickOutside: M = !1,\n size: z = \"medium\",\n ...L\n } = t, f = N(null), k = N(null), r = N(null), [P, x] = Q(!1), C = U(), X = O([s.drawer], o, {\n [s.remove]: P,\n [s.large]: z === \"large\"\n }), y = Y(f.current), i = y[0], b = y[y.length - 1], g = () => {\n var e;\n if (r.current) {\n const m = (r.current.dataset.drawersOpen ? r.current.dataset.drawersOpen.split(\" \") : []).filter((h) => h !== C);\n m.length === 0 ? (r.current.removeAttribute(\"data-drawers-open\"), (e = r.current) == null || e.classList.remove(\"drawer-open\")) : r.current.dataset.drawersOpen = m.join(\" \");\n }\n };\n R(() => {\n var e, u, m, h;\n if (l) {\n if (d == null || d(), (e = f.current) == null || e.showModal(), !r.current) {\n const w = (u = f.current) == null ? void 0 : u.closest(\"body\");\n w && (r.current = w);\n }\n if (!((m = f.current) == null ? void 0 : m.querySelector(\":focus\")) && (i == null || i.focus()), (h = r.current) == null || h.classList.add(\"drawer-open\"), r.current) {\n const w = r.current.dataset.drawersOpen ? r.current.dataset.drawersOpen.split(\" \") : [];\n if (w.includes(C))\n return;\n w.push(C), r.current.dataset.drawersOpen = w.join(\" \");\n }\n return;\n }\n x(!0), setTimeout(() => {\n var j;\n (j = f.current) == null || j.close(), g(), x(!1);\n }, 200);\n }, [i, d, l]), R(() => () => g(), []);\n const q = (e) => {\n e.preventDefault(), !F && (n == null || n());\n }, A = (e) => {\n var m;\n v == null || v(e);\n const u = e.target;\n if (!((m = k.current) != null && m.contains(u))) {\n if (e.preventDefault(), M)\n return;\n n == null || n();\n }\n }, I = (e) => {\n if (D == null || D(e), e.code === \"Tab\") {\n if (e.shiftKey && e.target === i) {\n e.preventDefault(), b == null || b.focus();\n return;\n }\n if (e.target === b && !e.shiftKey) {\n e.preventDefault(), i == null || i.focus();\n return;\n }\n }\n }, G = V(() => ({ close: () => {\n x(!0), setTimeout(() => {\n var u;\n g(), (u = f.current) == null || u.close(), n == null || n();\n }, 200);\n } }), [n]);\n return (\n // dialog element does seem to be interactive on MDN guideline\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n /* @__PURE__ */ a.jsx(\n \"dialog\",\n {\n className: X,\n \"data-anv\": \"drawer\",\n ref: Z([c, f]),\n onCancel: q,\n onClick: A,\n onKeyDown: I,\n ...L,\n children: /* @__PURE__ */ a.jsx(S.Provider, { value: G, children: /* @__PURE__ */ a.jsx(\"section\", { ref: k, className: s.container, children: p }) })\n }\n )\n );\n }\n);\nfunction ie() {\n const t = W(S);\n if (!t)\n throw new Error(\n \"useDrawerContext must be used within a DrawerContextProvider\"\n );\n return t;\n}\nT.displayName = \"Drawer\";\nconst ge = Object.assign(T, {\n Header: E,\n Footer: B,\n Content: K\n});\nexport {\n ge as Drawer,\n H as DrawerCancelButton,\n K as DrawerContent,\n B as DrawerFooter,\n E as DrawerHeader\n};\n//# sourceMappingURL=Drawer.js.map\n"],"names":["te","oe","se","ce","de","s","H","forwardRef","t","c","o","l","p","d","n","fr","B$1","E","$","a","B","cx","K","S","createContext","T","v","D","M","z","L","f","useRef","k","P","x","useState","C","useId","X","y","a$1","i","b","g","m","h","useEffect","w","j","q","A","u","I","G","useMemo","useMergeRefs","useContext"],"mappings":";;;;;;;;;;;AAYK,MAAAA,KAAA,mBAAA,KAAA,uBAAAC,KAAA,qBAAA,KAAA,oBAAAC,KAAA,oBAAAC,KAAA,oBAAA,KAAA,mBAAAC,KAAA,oBAAAC,IAAA;AAAA,EACL,QAAAL;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAAC;AAAA,EACA,QAAA;AAAA,EACA,mBAAA;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAA;AAAA,EACA,OAAA;AAAA,EAC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AAA;AAAA,UACA,UAAAmB;AAAA,UACA,SAAAC;AAAA,UACA,WAAAE;AAAA,UACA,GAAAvB;AAAA,UACA,UAAA,gBAAAf,EAAA,IAAAQ,EAAA,UAAA,EAAA,OAAA+B,GAAA,UAAA,gBAAAvC,EAAA,IAAA,WAAA,EAAA,KAAAkB,GAAA,WAAA5B,EAAA,WAAA,UAAAO,EAAA,CAAA,EAAA,CAAA;AAAA,QACA;AAAA,MACA;AAAA;AAAA,EAEA;AACA;AACA,SAAA,KAAA;AACA,QAAAJ,IAAAiD,EAAAlC,CAAA;AACA,MAAA,CAAAf;AACA,UAAA,IAAA;AAAA,MACA;AAAA,IACA;AACA,SAAAA;AACA;AACAiB,EAAA,cAAA;AACK,MAAA,KAAA,OAAA,OAAAA,GAAA;AAAA,EACL,QAAAR;AAAA,EACA,QAAAG;AAAA,EACA,SAAAE;AACA,CAAA;","x_google_ignoreList":[0]}
package/Drawer.css DELETED
@@ -1 +0,0 @@
1
- @import"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400;1,6..12,600;1,6..12,700&display=swap";@layer starter,reset,base,state,application;@layer base{._drawer_1pnmb_4{border:none;background:transparent;padding-block:0;padding-inline:0;outline:none;animation:_close-drawer_1pnmb_1 2s forwards;transition:width .2s;width:35rem;height:100%;max-width:100%;background-color:var(--background-color, #ffffff);margin-block-start:0;margin-block-end:0;max-height:100dvh;margin-inline-end:0;--xpos: 10rem}._drawer_1pnmb_4[open]{animation:_open-drawer_1pnmb_1 .3s forwards}._drawer_1pnmb_4[open]::backdrop{animation:_open-backdrop_1pnmb_1 .2s forwards}._drawer_1pnmb_4 ._container_1pnmb_28{font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color, #141414);display:flex;box-sizing:border-box;padding-block:1.5rem;padding-inline:1.5rem;flex-direction:column;background-color:inherit;gap:1.5rem;min-height:100%}._drawer_1pnmb_4 ._container_1pnmb_28 ._content_1pnmb_41{flex-grow:1;padding-block-start:.25rem;padding-block-end:.25rem}._header_1pnmb_46{position:sticky;inset-block-start:0;display:flex;justify-content:space-between;padding-block:1.5rem;padding-inline:1.5rem;margin-block:-1.5rem;margin-inline:-1.5rem;background-color:inherit}._header_1pnmb_46 h1{margin-block:0;margin-inline:0}._header_1pnmb_46 ._close-container_1pnmb_61{display:flex;justify-content:center;align-items:center;width:1.5625rem;height:1.5625rem}._footer_1pnmb_68{display:flex;gap:.75rem;justify-content:flex-end;padding-block:1.5rem;padding-inline:1.5rem;margin-block:-1.5rem;margin-inline:-1.5rem;background-color:inherit;flex-wrap:wrap}}@layer state{@media (prefers-reduced-motion: reduce){._drawer_1pnmb_4{--xpos: 0}}._drawer_1pnmb_4._remove_1pnmb_86[open]{animation:_close-drawer_1pnmb_1 .3s forwards}._drawer_1pnmb_4._remove_1pnmb_86[open]::backdrop{animation:_close-backdrop_1pnmb_1 .2s forwards}._drawer_1pnmb_4::backdrop{background:var(--background-color-inverted, #2d2e31)}._drawer_1pnmb_4._large_1pnmb_95{width:48rem}._drawer_1pnmb_4 ._footer_1pnmb_68._sticky_1pnmb_98{position:sticky;inset-block-end:0}}@layer application{._drawer_1pnmb_4 ._header_1pnmb_46 ._close-button_1pnmb_104{color:var(--foreground-color, #141414)}}.drawer-open{overflow:hidden}@keyframes _open-drawer_1pnmb_1{0%{opacity:0;transform:translate(var(--xpos))}to{opacity:1;transform:translate(0)}}@keyframes _close-drawer_1pnmb_1{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(var(--xpos))}}@keyframes _open-backdrop_1pnmb_1{0%{opacity:0}to{opacity:.6}}@keyframes _close-backdrop_1pnmb_1{0%{opacity:.6}to{opacity:0}}
@@ -1,403 +0,0 @@
1
- import "./ListView.css";
2
- import { f as m } from "./jsx-runtime-944c88e2-e73fa629.js";
3
- import { forwardRef as z, useRef as S, useId as T, useState as L, useEffect as J, createContext as X, useContext as ee } from "react";
4
- import { c as q } from "./index-e0f6271a.js";
5
- import { J as te } from "./useLayoutPropsUtil-e307abc7-cbe2fb6d.js";
6
- import { u as W } from "./floating-ui.react-8d61182d.js";
7
- import { r as U } from "./Checkbox-54ecbd70.js";
8
- import "./Helper-74a1f07f-092263c4.js";
9
- /* empty css */const le = "_listview_19l88_4", ie = "_cell_19l88_61", V = {
10
- listview: le,
11
- "listview-option": "_listview-option_19l88_17",
12
- cell: ie,
13
- "cell-children": "_cell-children_19l88_92"
14
- };
15
- function G(r, t, e) {
16
- return r.sort(function(u, s) {
17
- const f = u[e], i = s[e];
18
- return t.indexOf(f) > t.indexOf(i) ? 1 : -1;
19
- }), r;
20
- }
21
- const oe = (r, t, e, u, s, f) => {
22
- if (t)
23
- switch (r.code) {
24
- case "Enter":
25
- case "Space":
26
- t[e.row].focusables[e.col].click(), document.activeElement.click(), r.preventDefault();
27
- break;
28
- case "ArrowDown":
29
- if (s == null || s.focus(), t[e.row].focusables[e.col].removeAttribute(
30
- "data-interactive"
31
- ), e.row === t.length - 1) {
32
- t[0].focusables[e.col].setAttribute(
33
- "data-interactive",
34
- "focus-visible"
35
- ), f(t[0].focusables[e.col].id), u((i) => ({ ...i, row: 0 }));
36
- break;
37
- }
38
- t[e.row + 1].focusables[e.col].setAttribute(
39
- "data-interactive",
40
- "focus-visible"
41
- ), f(
42
- t[e.row + 1].focusables[e.col].id
43
- ), u((i) => ({ ...i, row: e.row + 1 }));
44
- break;
45
- case "ArrowUp":
46
- if (s == null || s.focus(), t[e.row].focusables[e.col].removeAttribute(
47
- "data-interactive"
48
- ), e.row === 0) {
49
- t[t.length - 1].focusables[e.col].setAttribute(
50
- "data-interactive",
51
- "focus-visible"
52
- ), f(
53
- t[t.length - 1].focusables[e.col].id
54
- ), u((i) => ({ ...i, row: t.length - 1 }));
55
- break;
56
- }
57
- t[e.row - 1].focusables[e.col].setAttribute(
58
- "data-interactive",
59
- "focus-visible"
60
- ), f(
61
- t[e.row - 1].focusables[e.col].id
62
- ), u((i) => ({ ...i, row: e.row - 1 }));
63
- break;
64
- case "ArrowRight":
65
- if (s == null || s.focus(), t[e.row].focusables[e.col].removeAttribute(
66
- "data-interactive"
67
- ), e.col === t[e.row].focusables.length - 1) {
68
- t[e.row].focusables[0].setAttribute(
69
- "data-interactive",
70
- "focus-visible"
71
- ), f(t[e.row].focusables[0].id), u((i) => ({
72
- ...i,
73
- col: 0
74
- }));
75
- break;
76
- }
77
- t[e.row].focusables[e.col + 1].setAttribute(
78
- "data-interactive",
79
- "focus-visible"
80
- ), f(
81
- t[e.row].focusables[e.col + 1].id
82
- ), u((i) => ({ ...i, col: e.col + 1 }));
83
- break;
84
- case "ArrowLeft":
85
- if (s == null || s.focus(), t[e.row].focusables[e.col].removeAttribute(
86
- "data-interactive"
87
- ), e.col === 0) {
88
- t[e.row].focusables[t[e.row].focusables.length - 1].setAttribute("data-interactive", "focus-visible"), f(
89
- t[e.row].focusables[t[e.row].focusables.length - 1].id
90
- ), u((i) => ({
91
- ...i,
92
- col: t[e.row].focusables.length - 1
93
- }));
94
- break;
95
- }
96
- t[e.row].focusables[e.col - 1].setAttribute(
97
- "data-interactive",
98
- "focus-visible"
99
- ), f(
100
- t[e.row].focusables[e.col - 1].id
101
- ), u((i) => ({ ...i, col: e.col - 1 }));
102
- break;
103
- }
104
- }, Y = z(
105
- (r, t) => {
106
- const {
107
- className: e,
108
- children: u,
109
- onClick: s,
110
- onKeyDown: f,
111
- onKeyUp: i,
112
- onBlur: F,
113
- onChange: K,
114
- style: C,
115
- disabled: y,
116
- id: A,
117
- ...a
118
- } = r, N = S(null), o = W([t, N]), P = S(), j = S(null), R = T(), [p, h] = L(!1), { selectedItems: v, setSelectedItems: g, controlled: O } = ae(), x = "item" in a ? y || a.item.disabled : y;
119
- J(() => {
120
- var l;
121
- const b = (l = N.current) == null ? void 0 : l.querySelectorAll(
122
- "button:not(:disabled):not([aria-disabled='true']), input:not(:disabled):not([aria-disabled='true']), [tabindex='0']:not(:disabled):not([aria-disabled='true'])"
123
- );
124
- b == null || b.forEach((I, $) => {
125
- I.setAttribute("tabindex", "-1"), !I.hasAttribute("id") && I.setAttribute("id", `${R}-${$}`);
126
- });
127
- }, [R]), J(() => {
128
- if ("item" in a) {
129
- const l = v.some((b) => b.label === a.item.label);
130
- h(l);
131
- } else {
132
- const l = v.includes(
133
- a.label
134
- );
135
- h(l);
136
- }
137
- }, [O, a, v]);
138
- const _ = (l) => {
139
- K == null || K(l, { checked: p });
140
- }, D = () => {
141
- O || E();
142
- };
143
- function E() {
144
- "item" in a ? v.some((l) => l.label === a.item.label) ? (g(
145
- (l) => l.filter(
146
- (b) => (b == null ? void 0 : b.label) !== a.item.label
147
- )
148
- ), h(!1)) : (g((l) => [...l, a.item]), h(!0)) : v.some((l) => l === a.label) ? (g(
149
- (l) => l.filter((b) => b !== a.label)
150
- ), h(!1)) : (g((l) => [...l, a.label]), h(!0));
151
- }
152
- if ("item" in a) {
153
- P.current = a.item;
154
- const { item: l, ...b } = a;
155
- return /* @__PURE__ */ m.jsxs(
156
- "div",
157
- {
158
- className: q([V["listview-option"]], e),
159
- "data-anv": "listview-option",
160
- style: C,
161
- ref: o,
162
- "aria-disabled": x,
163
- "aria-selected": p,
164
- "aria-label": l.label,
165
- role: "row",
166
- ...b,
167
- children: [
168
- /* @__PURE__ */ m.jsx("div", { className: V.cell, ref: j, role: "gridcell", children: /* @__PURE__ */ m.jsx(
169
- U,
170
- {
171
- disabled: x,
172
- checked: p,
173
- "aria-label": l.label,
174
- onChange: _,
175
- onClick: D
176
- }
177
- ) }),
178
- u
179
- ]
180
- }
181
- );
182
- }
183
- return /* @__PURE__ */ m.jsxs(
184
- "div",
185
- {
186
- className: q([V["listview-option"]], e),
187
- "data-anv": "listview-option",
188
- style: C,
189
- ref: o,
190
- "aria-disabled": x,
191
- "aria-selected": p,
192
- "aria-label": "label" in r ? r.label : "Select",
193
- role: "row",
194
- ...a,
195
- children: [
196
- /* @__PURE__ */ m.jsx("div", { className: V.cell, ref: j, role: "gridcell", children: /* @__PURE__ */ m.jsx(
197
- U,
198
- {
199
- disabled: x,
200
- checked: p,
201
- "aria-label": "label" in r ? r.label : "Select",
202
- onChange: _,
203
- onClick: D
204
- }
205
- ) }),
206
- u
207
- ]
208
- }
209
- );
210
- }
211
- );
212
- Y.displayName = "ListViewOption";
213
- const Z = z((r, t) => {
214
- const { ...e } = r;
215
- return /* @__PURE__ */ m.jsx("div", { role: "gridcell", "data-anv": "listview-option-cell", ...e, ref: t });
216
- });
217
- Z.displayName = "ListViewOptionCell";
218
- const B = X(null), re = (r) => r.querySelectorAll(
219
- "button:not(:disabled):not([aria-disabled='true']), input:not(:disabled):not([aria-disabled='true']), [tabindex='0']:not(:disabled):not([aria-disabled='true'])"
220
- ), H = function(r, t) {
221
- const { layoutStyles: e, componentProps: u } = te(r), {
222
- onSelectionChange: s,
223
- className: f,
224
- selected: i,
225
- defaultSelected: F,
226
- style: K,
227
- onKeyDown: C,
228
- ...y
229
- } = u, A = S(null), a = S(!0), N = W([t, A]), [o, P] = L(), [j, R] = L(), [p, h] = L(
230
- i ?? F ?? []
231
- ), [v, g] = L({
232
- row: 0,
233
- col: 0
234
- }), O = {
235
- ...K,
236
- ...e
237
- }, x = (n) => {
238
- a.current && o && o[v.row].focusables[v.col].setAttribute(
239
- "data-interactive",
240
- "focus-visible"
241
- );
242
- }, _ = () => {
243
- var n;
244
- o && ((n = o[v.row].focusables[v.col]) == null || n.removeAttribute(
245
- "data-interactive"
246
- ));
247
- }, D = (n) => {
248
- C == null || C(n), o && (a.current = !0, oe(
249
- n,
250
- o,
251
- v,
252
- g,
253
- A.current,
254
- (d) => R(d)
255
- ));
256
- }, E = (n) => {
257
- var d;
258
- if (a.current = !1, o && A.current) {
259
- (d = o[v.row].focusables[v.col]) == null || d.removeAttribute(
260
- "data-interactive"
261
- );
262
- const c = n.target.closest(
263
- "button:not(:disabled):not([aria-disabled='true']), input:not(:disabled):not([aria-disabled='true']), [data-anv='checkbox']"
264
- ), w = n.target.closest(
265
- '[data-anv="listview-option"]'
266
- );
267
- if (!w || w.ariaDisabled)
268
- return;
269
- const k = o.findIndex((Q) => Q.node === w);
270
- if (!c) {
271
- o[k].focusables[0].click();
272
- return;
273
- }
274
- const M = Array.prototype.indexOf.call(
275
- o[k].focusables,
276
- (c == null ? void 0 : c.getAttribute("data-anv")) === "checkbox" ? c.children[0] : c
277
- );
278
- g({ row: k, col: M });
279
- }
280
- };
281
- J(() => {
282
- if (!A.current)
283
- return;
284
- const n = A.current.querySelectorAll(
285
- "div[data-anv='listview-option']:not([aria-disabled='true'])"
286
- ), d = Array.from(n).map((c) => {
287
- const w = re(c);
288
- return {
289
- node: c,
290
- focusables: w
291
- };
292
- });
293
- P(d);
294
- }, [r.children]);
295
- const l = S();
296
- J(() => {
297
- if (!o)
298
- return;
299
- const n = o.map((c) => c.node.ariaLabel), d = G(p, n, "label");
300
- JSON.stringify(l.current) !== JSON.stringify(d) && (s == null || s(d), l.current = d);
301
- }, [s, o, p]), J(() => {
302
- if (!i)
303
- return;
304
- const n = i.reduce(
305
- (w, k) => w.find((M) => M.label === k.label) ? w : w.concat([k]),
306
- []
307
- );
308
- if (!o)
309
- return;
310
- const d = o.map((w) => w.node.ariaLabel), c = G(n, d, "label");
311
- JSON.stringify(l.current) !== JSON.stringify(c) && (s == null || s(c), h(c), l.current = c);
312
- }, [s, o, i]);
313
- const b = q([V.listview], f);
314
- if ("items" in y) {
315
- const { children: n, items: d, ...c } = y;
316
- return /* @__PURE__ */ m.jsx(
317
- B.Provider,
318
- {
319
- value: {
320
- options: o,
321
- onSelectionChange: s,
322
- selectedItems: p,
323
- setSelectedItems: h,
324
- items: d,
325
- controlled: !!i
326
- },
327
- children: /* @__PURE__ */ m.jsx(
328
- "div",
329
- {
330
- ref: N,
331
- className: b,
332
- style: O,
333
- "data-anv": "listview",
334
- role: "grid",
335
- "aria-multiselectable": "true",
336
- onFocus: x,
337
- onBlur: _,
338
- onKeyDown: D,
339
- onMouseDown: E,
340
- "aria-activedescendant": j,
341
- tabIndex: 0,
342
- ...c,
343
- children: n == null ? void 0 : n({
344
- items: d.map((w) => w)
345
- })
346
- }
347
- )
348
- }
349
- );
350
- }
351
- const { children: I, ...$ } = y;
352
- return /* @__PURE__ */ m.jsx(
353
- B.Provider,
354
- {
355
- value: {
356
- options: o,
357
- onSelectionChange: s,
358
- selectedItems: p,
359
- setSelectedItems: h,
360
- controlled: !!i
361
- },
362
- children: /* @__PURE__ */ m.jsx(
363
- "div",
364
- {
365
- ref: N,
366
- className: b,
367
- style: O,
368
- "data-anv": "listview",
369
- role: "grid",
370
- onFocus: x,
371
- onBlur: _,
372
- onKeyDown: D,
373
- onMouseDown: E,
374
- "aria-activedescendant": j,
375
- tabIndex: 0,
376
- ...$,
377
- children: I
378
- }
379
- )
380
- }
381
- );
382
- };
383
- function ae() {
384
- const r = ee(B);
385
- if (r == null)
386
- throw new Error("useListView must be wrapped in <ListView />");
387
- return r;
388
- }
389
- H.displayName = "ListView";
390
- const me = Object.assign(
391
- z(H),
392
- {
393
- Option: Y,
394
- OptionCell: Z
395
- }
396
- );
397
- export {
398
- me as A,
399
- Y,
400
- Z,
401
- V as t
402
- };
403
- //# sourceMappingURL=ListView-ad64a337.js.map