@serendie/ui 2.1.3 → 2.2.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 (122) hide show
  1. package/dist/client.js +79 -74
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Avatar/Avatar.d.ts +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +2 -2
  7. package/dist/components/Button/Button.js +22 -21
  8. package/dist/components/DatePicker/DatePicker.d.ts +13 -0
  9. package/dist/components/DatePicker/DatePicker.js +203 -0
  10. package/dist/components/DatePicker/index.d.ts +2 -0
  11. package/dist/components/DatePicker/index.js +6 -0
  12. package/dist/components/DatePicker/parseDate.d.ts +1 -0
  13. package/dist/components/DatePicker/styles.d.ts +1 -0
  14. package/dist/components/DatePicker/styles.js +224 -0
  15. package/dist/components/IconButton/IconButton.d.ts +3 -3
  16. package/dist/components/List/ListItem.d.ts +1 -1
  17. package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
  18. package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
  19. package/dist/components/Pagination/Pagination.d.ts +1 -1
  20. package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
  21. package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
  22. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
  23. package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
  24. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
  25. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
  26. package/dist/components/ProgressIndicator/index.d.ts +4 -1
  27. package/dist/components/ProgressIndicator/index.js +3 -2
  28. package/dist/components/ProgressIndicator/util.d.ts +1 -0
  29. package/dist/components/ProgressIndicator/util.js +13 -0
  30. package/dist/components/Search/Search.d.ts +1 -1
  31. package/dist/components/Select/Select.d.ts +1 -1
  32. package/dist/components/Switch/Switch.d.ts +1 -1
  33. package/dist/components/Tabs/Tabs.d.ts +1 -1
  34. package/dist/components/TextField/TextField.js +59 -156
  35. package/dist/components/Toast/Toast.d.ts +1 -1
  36. package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +80 -75
  39. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
  40. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
  41. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
  42. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
  43. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
  44. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
  45. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
  47. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
  48. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
  49. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
  50. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
  51. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
  52. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
  53. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
  54. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
  55. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
  56. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
  57. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
  58. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
  59. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
  60. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
  61. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
  62. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
  63. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
  64. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
  65. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
  66. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
  67. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
  68. package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
  69. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
  70. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
  71. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
  72. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
  73. package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
  74. package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
  75. package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
  76. package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
  77. package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
  78. package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
  79. package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
  80. package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
  81. package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
  82. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
  83. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
  84. package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
  85. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
  86. package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
  87. package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
  88. package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
  89. package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
  90. package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
  91. package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
  92. package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
  93. package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
  94. package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
  98. package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
  99. package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
  100. package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
  101. package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
  102. package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
  103. package/dist/preset.d.ts +11 -1
  104. package/dist/recipes/index.d.ts +3 -2
  105. package/dist/recipes/index.js +5 -2
  106. package/dist/recipes/textFieldRecipe.d.ts +6 -0
  107. package/dist/recipes/textFieldRecipe.js +107 -0
  108. package/dist/styled-system/css/cva.js +43 -38
  109. package/dist/styled-system/recipes/create-recipe.js +37 -0
  110. package/dist/styled-system/recipes/text-field-recipe.js +61 -0
  111. package/dist/styles.css +1 -1
  112. package/dist/tokens/keyframes/index.d.ts +8 -0
  113. package/dist/tokens/keyframes/index.js +6 -2
  114. package/package.json +3 -3
  115. package/styled-system/recipes/create-recipe.js +82 -0
  116. package/styled-system/recipes/index.d.ts +2 -0
  117. package/styled-system/recipes/index.js +1 -0
  118. package/styled-system/recipes/text-field-recipe.d.ts +28 -0
  119. package/styled-system/recipes/text-field-recipe.js +72 -0
  120. package/styled-system/types/prop-type.d.ts +1 -1
  121. package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
  122. package/dist/node_modules/proxy-compare/dist/index.js +0 -7
@@ -0,0 +1,202 @@
1
+ import { fromAbsolute as p, toCalendar as m, toCalendarDate as x } from "./conversion.js";
2
+ import { weekStartData as y } from "./weekStartData.js";
3
+ function i(e, a) {
4
+ return a = m(a, e.calendar), e.era === a.era && e.year === a.year && e.month === a.month && e.day === a.day;
5
+ }
6
+ function W(e, a) {
7
+ return D(e.calendar, a.calendar) && i(e, a);
8
+ }
9
+ function D(e, a) {
10
+ var t, n, f, r;
11
+ return (r = (f = (t = e.isEqual) === null || t === void 0 ? void 0 : t.call(e, a)) !== null && f !== void 0 ? f : (n = a.isEqual) === null || n === void 0 ? void 0 : n.call(a, e)) !== null && r !== void 0 ? r : e.identifier === a.identifier;
12
+ }
13
+ function A(e, a) {
14
+ return i(e, b(a));
15
+ }
16
+ const h = {
17
+ sun: 0,
18
+ mon: 1,
19
+ tue: 2,
20
+ wed: 3,
21
+ thu: 4,
22
+ fri: 5,
23
+ sat: 6
24
+ };
25
+ function u(e, a, t) {
26
+ let n = e.calendar.toJulianDay(e), f = t ? h[t] : M(a), r = Math.ceil(n + 1 - f) % 7;
27
+ return r < 0 && (r += 7), r;
28
+ }
29
+ function v(e) {
30
+ return p(Date.now(), e);
31
+ }
32
+ function b(e) {
33
+ return x(v(e));
34
+ }
35
+ function _(e, a) {
36
+ return e.calendar.toJulianDay(e) - a.calendar.toJulianDay(a);
37
+ }
38
+ function w(e, a) {
39
+ return o(e) - o(a);
40
+ }
41
+ function o(e) {
42
+ return e.hour * 36e5 + e.minute * 6e4 + e.second * 1e3 + e.millisecond;
43
+ }
44
+ let c = null;
45
+ function q() {
46
+ return c == null && (c = new Intl.DateTimeFormat().resolvedOptions().timeZone), c;
47
+ }
48
+ function d(e) {
49
+ return e.subtract({
50
+ days: e.day - 1
51
+ });
52
+ }
53
+ function g(e) {
54
+ return e.add({
55
+ days: e.calendar.getDaysInMonth(e) - e.day
56
+ });
57
+ }
58
+ function S(e) {
59
+ return d(e.subtract({
60
+ months: e.month - 1
61
+ }));
62
+ }
63
+ function T(e) {
64
+ return g(e.add({
65
+ months: e.calendar.getMonthsInYear(e) - e.month
66
+ }));
67
+ }
68
+ function E(e, a, t) {
69
+ let n = u(e, a, t);
70
+ return e.subtract({
71
+ days: n
72
+ });
73
+ }
74
+ function Y(e, a, t) {
75
+ return E(e, a, t).add({
76
+ days: 6
77
+ });
78
+ }
79
+ const $ = /* @__PURE__ */ new Map();
80
+ function l(e) {
81
+ if (Intl.Locale) {
82
+ let t = $.get(e);
83
+ return t || (t = new Intl.Locale(e).maximize().region, t && $.set(e, t)), t;
84
+ }
85
+ let a = e.split("-")[1];
86
+ return a === "u" ? void 0 : a;
87
+ }
88
+ function M(e) {
89
+ let a = l(e);
90
+ return a && y[a] || 0;
91
+ }
92
+ function J(e, a, t) {
93
+ let n = e.calendar.getDaysInMonth(e);
94
+ return Math.ceil((u(d(e), a, t) + n) / 7);
95
+ }
96
+ function L(e, a) {
97
+ return e && a ? e.compare(a) <= 0 ? e : a : e || a;
98
+ }
99
+ function Z(e, a) {
100
+ return e && a ? e.compare(a) >= 0 ? e : a : e || a;
101
+ }
102
+ const O = {
103
+ AF: [
104
+ 4,
105
+ 5
106
+ ],
107
+ AE: [
108
+ 5,
109
+ 6
110
+ ],
111
+ BH: [
112
+ 5,
113
+ 6
114
+ ],
115
+ DZ: [
116
+ 5,
117
+ 6
118
+ ],
119
+ EG: [
120
+ 5,
121
+ 6
122
+ ],
123
+ IL: [
124
+ 5,
125
+ 6
126
+ ],
127
+ IQ: [
128
+ 5,
129
+ 6
130
+ ],
131
+ IR: [
132
+ 5,
133
+ 5
134
+ ],
135
+ JO: [
136
+ 5,
137
+ 6
138
+ ],
139
+ KW: [
140
+ 5,
141
+ 6
142
+ ],
143
+ LY: [
144
+ 5,
145
+ 6
146
+ ],
147
+ OM: [
148
+ 5,
149
+ 6
150
+ ],
151
+ QA: [
152
+ 5,
153
+ 6
154
+ ],
155
+ SA: [
156
+ 5,
157
+ 6
158
+ ],
159
+ SD: [
160
+ 5,
161
+ 6
162
+ ],
163
+ SY: [
164
+ 5,
165
+ 6
166
+ ],
167
+ YE: [
168
+ 5,
169
+ 6
170
+ ]
171
+ };
172
+ function C(e, a) {
173
+ let t = e.calendar.toJulianDay(e), n = Math.ceil(t + 1) % 7;
174
+ n < 0 && (n += 7);
175
+ let f = l(a), [r, s] = O[f] || [
176
+ 6,
177
+ 0
178
+ ];
179
+ return n === r || n === s;
180
+ }
181
+ export {
182
+ _ as compareDate,
183
+ w as compareTime,
184
+ g as endOfMonth,
185
+ Y as endOfWeek,
186
+ T as endOfYear,
187
+ u as getDayOfWeek,
188
+ q as getLocalTimeZone,
189
+ J as getWeeksInMonth,
190
+ D as isEqualCalendar,
191
+ W as isEqualDay,
192
+ i as isSameDay,
193
+ A as isToday,
194
+ C as isWeekend,
195
+ Z as maxDate,
196
+ L as minDate,
197
+ v as now,
198
+ d as startOfMonth,
199
+ E as startOfWeek,
200
+ S as startOfYear,
201
+ b as today
202
+ };
@@ -0,0 +1,41 @@
1
+ import { CalendarDate as $ } from "./CalendarDate.js";
2
+ import { toCalendar as o } from "./conversion.js";
3
+ import { GregorianCalendar as c } from "./GregorianCalendar.js";
4
+ const f = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;
5
+ function u(a) {
6
+ let r = a.match(f);
7
+ if (!r) throw new Error("Invalid ISO 8601 date string: " + a);
8
+ let t = new $(n(r[1], 0, 9999), n(r[2], 1, 12), 1);
9
+ return t.day = n(r[3], 1, t.calendar.getDaysInMonth(t)), t;
10
+ }
11
+ function n(a, r, t) {
12
+ let e = Number(a);
13
+ if (e < r || e > t) throw new RangeError(`Value out of range: ${r} <= ${e} <= ${t}`);
14
+ return e;
15
+ }
16
+ function i(a) {
17
+ return `${String(a.hour).padStart(2, "0")}:${String(a.minute).padStart(2, "0")}:${String(a.second).padStart(2, "0")}${a.millisecond ? String(a.millisecond / 1e3).slice(1) : ""}`;
18
+ }
19
+ function d(a) {
20
+ let r = o(a, new c()), t;
21
+ return r.era === "BC" ? t = r.year === 1 ? "0000" : "-" + String(Math.abs(1 - r.year)).padStart(6, "00") : t = String(r.year).padStart(4, "0"), `${t}-${String(r.month).padStart(2, "0")}-${String(r.day).padStart(2, "0")}`;
22
+ }
23
+ function S(a) {
24
+ return `${d(a)}T${i(a)}`;
25
+ }
26
+ function g(a) {
27
+ let r = Math.sign(a) < 0 ? "-" : "+";
28
+ a = Math.abs(a);
29
+ let t = Math.floor(a / 36e5), e = a % 36e5 / 6e4;
30
+ return `${r}${String(t).padStart(2, "0")}:${String(e).padStart(2, "0")}`;
31
+ }
32
+ function b(a) {
33
+ return `${S(a)}${g(a.offset)}[${a.timeZone}]`;
34
+ }
35
+ export {
36
+ S as dateTimeToString,
37
+ d as dateToString,
38
+ u as parseDate,
39
+ i as timeToString,
40
+ b as zonedDateTimeToString
41
+ };
@@ -0,0 +1,6 @@
1
+ function d(f, a) {
2
+ return f - a * Math.floor(f / a);
3
+ }
4
+ export {
5
+ d as mod
6
+ };
@@ -0,0 +1,100 @@
1
+ const A = {
2
+ "001": 1,
3
+ AD: 1,
4
+ AE: 6,
5
+ AF: 6,
6
+ AI: 1,
7
+ AL: 1,
8
+ AM: 1,
9
+ AN: 1,
10
+ AR: 1,
11
+ AT: 1,
12
+ AU: 1,
13
+ AX: 1,
14
+ AZ: 1,
15
+ BA: 1,
16
+ BE: 1,
17
+ BG: 1,
18
+ BH: 6,
19
+ BM: 1,
20
+ BN: 1,
21
+ BY: 1,
22
+ CH: 1,
23
+ CL: 1,
24
+ CM: 1,
25
+ CN: 1,
26
+ CR: 1,
27
+ CY: 1,
28
+ CZ: 1,
29
+ DE: 1,
30
+ DJ: 6,
31
+ DK: 1,
32
+ DZ: 6,
33
+ EC: 1,
34
+ EE: 1,
35
+ EG: 6,
36
+ ES: 1,
37
+ FI: 1,
38
+ FJ: 1,
39
+ FO: 1,
40
+ FR: 1,
41
+ GB: 1,
42
+ GE: 1,
43
+ GF: 1,
44
+ GP: 1,
45
+ GR: 1,
46
+ HR: 1,
47
+ HU: 1,
48
+ IE: 1,
49
+ IQ: 6,
50
+ IR: 6,
51
+ IS: 1,
52
+ IT: 1,
53
+ JO: 6,
54
+ KG: 1,
55
+ KW: 6,
56
+ KZ: 1,
57
+ LB: 1,
58
+ LI: 1,
59
+ LK: 1,
60
+ LT: 1,
61
+ LU: 1,
62
+ LV: 1,
63
+ LY: 6,
64
+ MC: 1,
65
+ MD: 1,
66
+ ME: 1,
67
+ MK: 1,
68
+ MN: 1,
69
+ MQ: 1,
70
+ MV: 5,
71
+ MY: 1,
72
+ NL: 1,
73
+ NO: 1,
74
+ NZ: 1,
75
+ OM: 6,
76
+ PL: 1,
77
+ QA: 6,
78
+ RE: 1,
79
+ RO: 1,
80
+ RS: 1,
81
+ RU: 1,
82
+ SD: 6,
83
+ SE: 1,
84
+ SI: 1,
85
+ SK: 1,
86
+ SM: 1,
87
+ SY: 6,
88
+ TJ: 1,
89
+ TM: 1,
90
+ TR: 1,
91
+ UA: 1,
92
+ UY: 1,
93
+ UZ: 1,
94
+ VA: 1,
95
+ VN: 1,
96
+ XK: 1
97
+ };
98
+ export {
99
+ A as weekStartData
100
+ };
@@ -0,0 +1,7 @@
1
+ function a(e, t) {
2
+ if (t.has(e))
3
+ throw new TypeError("Cannot initialize the same private elements twice on an object");
4
+ }
5
+ export {
6
+ a as _
7
+ };
@@ -0,0 +1,7 @@
1
+ import { _ as t } from "./_check_private_redeclaration.js";
2
+ function a(_, e, i) {
3
+ t(_, e), e.set(_, i);
4
+ }
5
+ export {
6
+ a as _
7
+ };
@@ -1,25 +1,26 @@
1
- var c = (e, o = []) => ({
2
- parts: (...a) => {
3
- if (d(o))
4
- return c(e, a);
1
+ var c = (e, a = []) => ({
2
+ parts: (...t) => {
3
+ if (d(a))
4
+ return c(e, t);
5
5
  throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?");
6
6
  },
7
- extendWith: (...a) => c(e, [...o, ...a]),
8
- rename: (a) => c(a, o),
9
- keys: () => o,
10
- build: () => [...new Set(o)].reduce(
11
- (a, r) => Object.assign(a, {
12
- [r]: {
7
+ extendWith: (...t) => c(e, [...a, ...t]),
8
+ omit: (...t) => c(e, a.filter((o) => !t.includes(o))),
9
+ rename: (t) => c(t, a),
10
+ keys: () => a,
11
+ build: () => [...new Set(a)].reduce(
12
+ (t, o) => Object.assign(t, {
13
+ [o]: {
13
14
  selector: [
14
- `&[data-scope="${t(e)}"][data-part="${t(r)}"]`,
15
- `& [data-scope="${t(e)}"][data-part="${t(r)}"]`
15
+ `&[data-scope="${r(e)}"][data-part="${r(o)}"]`,
16
+ `& [data-scope="${r(e)}"][data-part="${r(o)}"]`
16
17
  ].join(", "),
17
- attrs: { "data-scope": t(e), "data-part": t(r) }
18
+ attrs: { "data-scope": r(e), "data-part": r(o) }
18
19
  }
19
20
  }),
20
21
  {}
21
22
  )
22
- }), t = (e) => e.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), d = (e) => e.length === 0;
23
+ }), r = (e) => e.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), d = (e) => e.length === 0;
23
24
  export {
24
25
  c as createAnatomy
25
26
  };
@@ -1,37 +1,37 @@
1
- var i = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = {}, m = 0, b = (t) => t && (t.host || b(t.parentNode)), M = (t, n) => n.map((a) => {
1
+ var i = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = {}, m = 0, y = (t) => t && (t.host || y(t.parentNode)), M = (t, n) => n.map((a) => {
2
2
  if (t.contains(a)) return a;
3
- const s = b(a);
3
+ const s = y(a);
4
4
  return s && t.contains(s) ? s : (console.error("[zag-js > ariaHidden] target", a, "in not contained inside", t, ". Doing nothing"), null);
5
- }).filter((a) => !!a), W = (t) => t.localName === "next-route-announcer" || t.localName === "script" || t.hasAttribute("aria-live") ? !0 : t.matches("[data-live-announcer]"), g = (t, n) => {
6
- const { parentNode: a, markerName: s, controlAttribute: o } = n, c = M(a, Array.isArray(t) ? t : [t]);
5
+ }).filter((a) => !!a), g = /* @__PURE__ */ new Set(["script", "output", "status", "next-route-announcer"]), W = (t) => g.has(t.localName) || t.role === "status" || t.hasAttribute("aria-live") ? !0 : t.matches("[data-live-announcer]"), H = (t, n) => {
6
+ const { parentNode: a, markerName: s, controlAttribute: u } = n, o = M(a, Array.isArray(t) ? t : [t]);
7
7
  p[s] || (p[s] = /* @__PURE__ */ new WeakMap());
8
- const u = p[s], v = [], f = /* @__PURE__ */ new Set(), N = new Set(c), A = (e) => {
9
- !e || f.has(e) || (f.add(e), A(e.parentNode));
8
+ const c = p[s], v = [], f = /* @__PURE__ */ new Set(), N = new Set(o), d = (e) => {
9
+ !e || f.has(e) || (f.add(e), d(e.parentNode));
10
10
  };
11
- c.forEach(A);
12
- const d = (e) => {
11
+ o.forEach(d);
12
+ const A = (e) => {
13
13
  !e || N.has(e) || Array.prototype.forEach.call(e.children, (r) => {
14
14
  if (f.has(r))
15
- d(r);
15
+ A(r);
16
16
  else
17
17
  try {
18
18
  if (W(r)) return;
19
- const k = r.getAttribute(o) === "true", w = (i.get(r) || 0) + 1, y = (u.get(r) || 0) + 1;
20
- i.set(r, w), u.set(r, y), v.push(r), w === 1 && k && h.set(r, !0), y === 1 && r.setAttribute(s, ""), k || r.setAttribute(o, "true");
19
+ const k = r.getAttribute(u) === "true", w = (i.get(r) || 0) + 1, b = (c.get(r) || 0) + 1;
20
+ i.set(r, w), c.set(r, b), v.push(r), w === 1 && k && h.set(r, !0), b === 1 && r.setAttribute(s, ""), k || r.setAttribute(u, "true");
21
21
  } catch (l) {
22
22
  console.error("[zag-js > ariaHidden] cannot operate on ", r, l);
23
23
  }
24
24
  });
25
25
  };
26
- return d(a), f.clear(), m++, () => {
26
+ return A(a), f.clear(), m++, () => {
27
27
  v.forEach((e) => {
28
- const r = i.get(e) - 1, l = u.get(e) - 1;
29
- i.set(e, r), u.set(e, l), r || (h.has(e) || e.removeAttribute(o), h.delete(e)), l || e.removeAttribute(s);
28
+ const r = i.get(e) - 1, l = c.get(e) - 1;
29
+ i.set(e, r), c.set(e, l), r || (h.has(e) || e.removeAttribute(u), h.delete(e)), l || e.removeAttribute(s);
30
30
  }), m--, m || (i = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = {});
31
31
  };
32
- }, H = (t) => (Array.isArray(t) ? t[0] : t).ownerDocument.body, E = (t, n = H(t), a = "data-aria-hidden") => {
32
+ }, E = (t) => (Array.isArray(t) ? t[0] : t).ownerDocument.body, S = (t, n = E(t), a = "data-aria-hidden") => {
33
33
  if (n)
34
- return g(t, {
34
+ return H(t, {
35
35
  parentNode: n,
36
36
  markerName: a,
37
37
  controlAttribute: "aria-hidden"
@@ -40,17 +40,17 @@ var i = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = {}
40
40
  const n = requestAnimationFrame(() => t());
41
41
  return () => cancelAnimationFrame(n);
42
42
  };
43
- function S(t, n = {}) {
44
- const { defer: a = !0 } = n, s = a ? V : (c) => c(), o = [];
45
- return o.push(
43
+ function j(t, n = {}) {
44
+ const { defer: a = !0 } = n, s = a ? V : (o) => o(), u = [];
45
+ return u.push(
46
46
  s(() => {
47
- const u = (typeof t == "function" ? t() : t).filter(Boolean);
48
- u.length !== 0 && o.push(E(u));
47
+ const c = (typeof t == "function" ? t() : t).filter(Boolean);
48
+ c.length !== 0 && u.push(S(c));
49
49
  })
50
50
  ), () => {
51
- o.forEach((c) => c == null ? void 0 : c());
51
+ u.forEach((o) => o == null ? void 0 : o());
52
52
  };
53
53
  }
54
54
  export {
55
- S as ariaHidden
55
+ j as ariaHidden
56
56
  };