@yselimcan/ui 0.0.6 → 0.0.8

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 (236) hide show
  1. package/dist/index100.js +5 -32
  2. package/dist/index101.js +8 -19
  3. package/dist/index102.js +86 -4
  4. package/dist/index103.js +13 -4
  5. package/dist/index104.js +63 -5
  6. package/dist/index105.js +38 -12
  7. package/dist/index106.js +14 -19
  8. package/dist/index107.js +33 -13
  9. package/dist/index108.js +19 -297
  10. package/dist/index109.js +5 -4
  11. package/dist/index110.js +4 -39
  12. package/dist/index111.js +5 -126
  13. package/dist/index112.js +11 -4
  14. package/dist/index113.js +19 -21
  15. package/dist/index114.js +13 -77
  16. package/dist/index115.js +291 -59
  17. package/dist/index116.js +4 -45
  18. package/dist/index117.js +37 -65
  19. package/dist/index118.js +125 -8
  20. package/dist/index119.js +20 -13
  21. package/dist/index120.js +76 -3
  22. package/dist/index121.js +64 -3
  23. package/dist/index122.js +45 -5
  24. package/dist/index123.js +14 -134
  25. package/dist/index124.js +5 -27
  26. package/dist/index125.js +27 -6
  27. package/dist/index127.js +26 -11
  28. package/dist/index128.js +15 -20
  29. package/dist/index129.js +22 -14
  30. package/dist/index130.js +58 -5
  31. package/dist/index131.js +16 -28
  32. package/dist/index132.js +25 -15
  33. package/dist/index133.js +40 -21
  34. package/dist/index134.js +43 -59
  35. package/dist/index135.js +19 -15
  36. package/dist/index136.js +47 -26
  37. package/dist/index137.js +49 -38
  38. package/dist/index138.js +18 -43
  39. package/dist/index139.js +11 -21
  40. package/dist/index140.js +22 -48
  41. package/dist/index141.js +34 -50
  42. package/dist/index142.js +229 -16
  43. package/dist/index143.js +283 -11
  44. package/dist/index144.js +52 -21
  45. package/dist/index145.js +15 -35
  46. package/dist/index146.js +74 -225
  47. package/dist/index147.js +3 -283
  48. package/dist/index148.js +30 -53
  49. package/dist/index149.js +24 -16
  50. package/dist/index150.js +15 -79
  51. package/dist/index151.js +69 -3
  52. package/dist/index152.js +4 -31
  53. package/dist/index153.js +103 -22
  54. package/dist/index154.js +79 -15
  55. package/dist/index155.js +259 -65
  56. package/dist/index156.js +12 -4
  57. package/dist/index157.js +11 -105
  58. package/dist/index158.js +37 -76
  59. package/dist/index159.js +4 -263
  60. package/dist/index160.js +66 -11
  61. package/dist/index161.js +9 -10
  62. package/dist/index162.js +8 -40
  63. package/dist/index163.js +5 -4
  64. package/dist/index164.js +129 -62
  65. package/dist/index165.js +54 -10
  66. package/dist/index166.js +11 -8
  67. package/dist/index167.js +118 -6
  68. package/dist/index168.js +11 -53
  69. package/dist/index169.js +6 -6
  70. package/dist/index17.js +4 -4
  71. package/dist/index170.js +63 -114
  72. package/dist/index171.js +8 -7
  73. package/dist/index172.js +13 -12
  74. package/dist/index173.js +11 -65
  75. package/dist/index174.js +10 -11
  76. package/dist/index175.js +87 -12
  77. package/dist/index176.js +7 -8
  78. package/dist/index177.js +11 -11
  79. package/dist/index178.js +52 -83
  80. package/dist/index179.js +11 -11
  81. package/dist/index18.js +4 -4
  82. package/dist/index180.js +11 -11
  83. package/dist/index181.js +16 -54
  84. package/dist/index182.js +8 -11
  85. package/dist/index183.js +7 -10
  86. package/dist/index184.js +102 -17
  87. package/dist/index185.js +7 -8
  88. package/dist/index186.js +32 -8
  89. package/dist/index187.js +73 -102
  90. package/dist/index188.js +14 -7
  91. package/dist/index189.js +27 -31
  92. package/dist/index19.js +9 -9
  93. package/dist/index190.js +12 -74
  94. package/dist/index191.js +7 -14
  95. package/dist/index192.js +21 -27
  96. package/dist/index193.js +25 -8
  97. package/dist/index194.js +159 -21
  98. package/dist/index195.js +114 -25
  99. package/dist/index196.js +67 -152
  100. package/dist/index197.js +62 -111
  101. package/dist/index198.js +8 -75
  102. package/dist/index199.js +22 -64
  103. package/dist/index20.js +2 -2
  104. package/dist/index200.js +5 -47
  105. package/dist/index201.js +4 -200
  106. package/dist/index202.js +9 -47
  107. package/dist/index203.js +39 -20
  108. package/dist/index204.js +57 -27
  109. package/dist/index205.js +27 -5
  110. package/dist/index206.js +7 -9
  111. package/dist/index207.js +12 -11
  112. package/dist/index208.js +11 -16
  113. package/dist/index209.js +11 -6
  114. package/dist/index21.js +3 -3
  115. package/dist/index210.js +22 -4
  116. package/dist/index211.js +11 -21
  117. package/dist/index212.js +7 -127
  118. package/dist/index213.js +43 -45
  119. package/dist/index214.js +595 -16
  120. package/dist/index215.js +12 -5
  121. package/dist/index216.js +15 -179
  122. package/dist/index217.js +47 -75
  123. package/dist/index218.js +186 -385
  124. package/dist/index219.js +48 -4
  125. package/dist/index22.js +5 -5
  126. package/dist/index220.js +19 -4
  127. package/dist/index221.js +30 -12
  128. package/dist/index222.js +5 -31
  129. package/dist/index223.js +26 -38
  130. package/dist/index224.js +12 -57
  131. package/dist/index225.js +21 -27
  132. package/dist/index226.js +127 -7
  133. package/dist/index227.js +45 -13
  134. package/dist/index228.js +18 -12
  135. package/dist/index229.js +5 -12
  136. package/dist/index23.js +2 -2
  137. package/dist/index230.js +178 -19
  138. package/dist/index231.js +75 -11
  139. package/dist/index232.js +398 -7
  140. package/dist/index233.js +4 -43
  141. package/dist/index234.js +5 -597
  142. package/dist/index235.js +14 -11
  143. package/dist/index236.js +20 -208
  144. package/dist/index237.js +6 -4
  145. package/dist/index238.js +208 -13
  146. package/dist/index239.js +3 -47
  147. package/dist/index24.js +9 -9
  148. package/dist/index240.js +13 -3
  149. package/dist/index241.js +45 -10
  150. package/dist/index242.js +3 -57
  151. package/dist/index243.js +11 -28
  152. package/dist/index244.js +56 -12
  153. package/dist/index245.js +30 -9
  154. package/dist/index246.js +12 -205
  155. package/dist/index247.js +9 -15
  156. package/dist/index248.js +189 -304
  157. package/dist/index249.js +15 -3
  158. package/dist/index250.js +322 -3
  159. package/dist/index251.js +3 -21
  160. package/dist/index252.js +3 -6
  161. package/dist/index253.js +1 -1
  162. package/dist/index256.js +1 -1
  163. package/dist/index257.js +1 -1
  164. package/dist/index260.js +1 -1
  165. package/dist/index261.js +1 -1
  166. package/dist/index262.js +2 -2
  167. package/dist/index264.js +2 -2
  168. package/dist/index28.js +1 -1
  169. package/dist/index29.js +1 -1
  170. package/dist/index30.js +1 -1
  171. package/dist/index31.js +1 -1
  172. package/dist/index32.js +1 -1
  173. package/dist/index33.js +16 -16
  174. package/dist/index34.js +5 -5
  175. package/dist/index35.js +12 -12
  176. package/dist/index36.js +10 -10
  177. package/dist/index37.js +7 -7
  178. package/dist/index38.js +8 -8
  179. package/dist/index39.js +4 -4
  180. package/dist/index40.js +2 -2
  181. package/dist/index41.js +2 -2
  182. package/dist/index42.js +2 -2
  183. package/dist/index43.js +1 -1
  184. package/dist/index45.js +5 -5
  185. package/dist/index46.js +9 -9
  186. package/dist/index47.js +9 -9
  187. package/dist/index48.js +18 -18
  188. package/dist/index49.js +4 -4
  189. package/dist/index50.js +11 -11
  190. package/dist/index51.js +1 -1
  191. package/dist/index52.js +24 -24
  192. package/dist/index53.js +3 -3
  193. package/dist/index54.js +30 -30
  194. package/dist/index55.js +13 -13
  195. package/dist/index56.js +12 -12
  196. package/dist/index57.js +1 -1
  197. package/dist/index58.js +2 -2
  198. package/dist/index59.js +5 -5
  199. package/dist/index60.js +11 -11
  200. package/dist/index61.js +4 -4
  201. package/dist/index62.js +3 -3
  202. package/dist/index63.js +11 -11
  203. package/dist/index64.js +4 -4
  204. package/dist/index65.js +3 -3
  205. package/dist/index66.js +13 -13
  206. package/dist/index68.js +1 -1
  207. package/dist/index69.js +31 -31
  208. package/dist/index70.js +5 -5
  209. package/dist/index71.js +16 -16
  210. package/dist/index72.js +22 -22
  211. package/dist/index73.js +7 -7
  212. package/dist/index74.js +1 -1
  213. package/dist/index75.js +12 -12
  214. package/dist/index76.js +2 -2
  215. package/dist/index77.js +4 -4
  216. package/dist/index78.js +2 -2
  217. package/dist/index79.js +1 -1
  218. package/dist/index80.js +1 -1
  219. package/dist/index81.js +17 -17
  220. package/dist/index82.js +4 -4
  221. package/dist/index83.js +4 -4
  222. package/dist/index87.js +7 -7
  223. package/dist/index88.js +9 -9
  224. package/dist/index89.js +19 -90
  225. package/dist/index90.js +15 -18
  226. package/dist/index91.js +33 -16
  227. package/dist/index92.js +12 -33
  228. package/dist/index93.js +90 -12
  229. package/dist/index94.js +4 -7
  230. package/dist/index95.js +65 -86
  231. package/dist/index96.js +8 -12
  232. package/dist/index97.js +12 -61
  233. package/dist/index98.js +4 -38
  234. package/dist/index99.js +4 -14
  235. package/dist/styles.css +1 -1
  236. package/package.json +7 -4
package/dist/index220.js CHANGED
@@ -1,7 +1,22 @@
1
- import * as t from "react";
2
- const a = {
3
- ...t
1
+ import t from "./index94.js";
2
+ import { createSelectorCreator as s, lruMemoize as i } from "./index250.js";
3
+ s({
4
+ memoize: i,
5
+ memoizeOptions: {
6
+ maxSize: 1,
7
+ equalityCheck: Object.is
8
+ }
9
+ });
10
+ const u = (e, m, c, n, l, p, ...o) => {
11
+ if (o.length > 0)
12
+ throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of selectors" : t(1));
13
+ let r;
14
+ if (e)
15
+ r = e;
16
+ else
17
+ throw new Error("Missing arguments");
18
+ return r;
4
19
  };
5
20
  export {
6
- a as SafeReact
21
+ u as createSelector
7
22
  };
package/dist/index221.js CHANGED
@@ -1,17 +1,35 @@
1
- function o() {
2
- const t = /* @__PURE__ */ new Map();
1
+ "use client";
2
+ import * as r from "react";
3
+ import { useMergedRefs as p } from "./index95.js";
4
+ import { useCompositeRootContext as h } from "./index190.js";
5
+ import { useCompositeListItem as g } from "./index165.js";
6
+ function I(m = {}) {
7
+ const {
8
+ highlightItemOnHover: s,
9
+ highlightedIndex: c,
10
+ onHighlightedIndexChange: i
11
+ } = h(), {
12
+ ref: u,
13
+ index: e
14
+ } = g(m), t = c === e, n = r.useRef(null), d = p(u, n);
3
15
  return {
4
- emit(e, a) {
5
- t.get(e)?.forEach((n) => n(a));
6
- },
7
- on(e, a) {
8
- t.has(e) || t.set(e, /* @__PURE__ */ new Set()), t.get(e).add(a);
9
- },
10
- off(e, a) {
11
- t.get(e)?.delete(a);
12
- }
16
+ compositeProps: r.useMemo(() => ({
17
+ tabIndex: t ? 0 : -1,
18
+ onFocus() {
19
+ i(e);
20
+ },
21
+ onMouseMove() {
22
+ const o = n.current;
23
+ if (!s || !o)
24
+ return;
25
+ const f = o.hasAttribute("disabled") || o.ariaDisabled === "true";
26
+ !t && !f && o.focus();
27
+ }
28
+ }), [t, i, e, s]),
29
+ compositeRef: d,
30
+ index: e
13
31
  };
14
32
  }
15
33
  export {
16
- o as createEventEmitter
34
+ I as useCompositeItem
17
35
  };
package/dist/index222.js CHANGED
@@ -1,35 +1,9 @@
1
1
  "use client";
2
- import * as r from "react";
3
- import { useMergedRefs as p } from "./index117.js";
4
- import { useCompositeRootContext as h } from "./index127.js";
5
- import { useCompositeListItem as g } from "./index168.js";
6
- function I(m = {}) {
7
- const {
8
- highlightItemOnHover: s,
9
- highlightedIndex: c,
10
- onHighlightedIndexChange: i
11
- } = h(), {
12
- ref: u,
13
- index: e
14
- } = g(m), t = c === e, n = r.useRef(null), d = p(u, n);
15
- return {
16
- compositeProps: r.useMemo(() => ({
17
- tabIndex: t ? 0 : -1,
18
- onFocus() {
19
- i(e);
20
- },
21
- onMouseMove() {
22
- const o = n.current;
23
- if (!s || !o)
24
- return;
25
- const f = o.hasAttribute("disabled") || o.ariaDisabled === "true";
26
- !t && !f && o.focus();
27
- }
28
- }), [t, i, e, s]),
29
- compositeRef: d,
30
- index: e
31
- };
2
+ import * as e from "react";
3
+ const n = [];
4
+ function o(t) {
5
+ e.useEffect(t, n);
32
6
  }
33
7
  export {
34
- I as useCompositeItem
8
+ o as useOnMount
35
9
  };
package/dist/index223.js CHANGED
@@ -1,41 +1,29 @@
1
- import e from "./index112.js";
2
- import * as t from "react";
3
- const n = /* @__PURE__ */ t.createContext(void 0);
4
- process.env.NODE_ENV !== "production" && (n.displayName = "ComboboxRootContext");
5
- const s = /* @__PURE__ */ t.createContext(void 0);
6
- process.env.NODE_ENV !== "production" && (s.displayName = "ComboboxFloatingContext");
7
- const r = /* @__PURE__ */ t.createContext(void 0);
8
- process.env.NODE_ENV !== "production" && (r.displayName = "ComboboxDerivedItemsContext");
9
- const i = /* @__PURE__ */ t.createContext("");
10
- process.env.NODE_ENV !== "production" && (i.displayName = "ComboboxInputValueContext");
11
- function b() {
12
- const o = t.useContext(n);
13
- if (!o)
14
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>." : e(22));
15
- return o;
16
- }
17
- function C() {
18
- const o = t.useContext(s);
19
- if (!o)
20
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>." : e(23));
21
- return o;
22
- }
23
- function m() {
24
- const o = t.useContext(r);
25
- if (!o)
26
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>." : e(24));
27
- return o;
28
- }
29
- function c() {
30
- return t.useContext(i);
1
+ "use client";
2
+ import * as l from "react-dom";
3
+ import { useAnimationFrame as m } from "./index160.js";
4
+ import { useStableCallback as u } from "./index127.js";
5
+ import { resolveRef as c } from "./index242.js";
6
+ function S(s, f = !1, a = !0) {
7
+ const i = m();
8
+ return u((r, t = null) => {
9
+ i.cancel();
10
+ const e = c(s);
11
+ e != null && (typeof e.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED ? r() : i.request(() => {
12
+ function o() {
13
+ e && Promise.all(e.getAnimations().map((n) => n.finished)).then(() => {
14
+ t != null && t.aborted || l.flushSync(r);
15
+ }).catch(() => {
16
+ if (a) {
17
+ if (t != null && t.aborted)
18
+ return;
19
+ l.flushSync(r);
20
+ } else e.getAnimations().length > 0 && e.getAnimations().some((n) => n.pending || n.playState !== "finished") && o();
21
+ });
22
+ }
23
+ f ? i.request(o) : o();
24
+ }));
25
+ });
31
26
  }
32
27
  export {
33
- r as ComboboxDerivedItemsContext,
34
- s as ComboboxFloatingContext,
35
- i as ComboboxInputValueContext,
36
- n as ComboboxRootContext,
37
- m as useComboboxDerivedItemsContext,
38
- C as useComboboxFloatingContext,
39
- c as useComboboxInputValueContext,
40
- b as useComboboxRootContext
28
+ S as useAnimationsFinished
41
29
  };
package/dist/index224.js CHANGED
@@ -1,59 +1,14 @@
1
- import { compareItemEquality as l } from "./index142.js";
2
- import { createSelector as t } from "./index203.js";
3
- const u = {
4
- id: t((e) => e.id),
5
- query: t((e) => e.query),
6
- items: t((e) => e.items),
7
- selectedValue: t((e) => e.selectedValue),
8
- open: t((e) => e.open),
9
- mounted: t((e) => e.mounted),
10
- forceMounted: t((e) => e.forceMounted),
11
- inline: t((e) => e.inline),
12
- activeIndex: t((e) => e.activeIndex),
13
- selectedIndex: t((e) => e.selectedIndex),
14
- isActive: t((e, i) => e.activeIndex === i),
15
- isSelected: t((e, i) => {
16
- const n = e.isItemEqualToValue, o = e.selectedValue;
17
- return Array.isArray(o) ? o.some((p) => l(p, i, n)) : l(o, i, n);
18
- }),
19
- transitionStatus: t((e) => e.transitionStatus),
20
- popupProps: t((e) => e.popupProps),
21
- inputProps: t((e) => e.inputProps),
22
- triggerProps: t((e) => e.triggerProps),
23
- getItemProps: t((e) => e.getItemProps),
24
- positionerElement: t((e) => e.positionerElement),
25
- listElement: t((e) => e.listElement),
26
- triggerElement: t((e) => e.triggerElement),
27
- inputElement: t((e) => e.inputElement),
28
- popupSide: t((e) => e.popupSide),
29
- openMethod: t((e) => e.openMethod),
30
- inputInsidePopup: t((e) => e.inputInsidePopup),
31
- selectionMode: t((e) => e.selectionMode),
32
- listRef: t((e) => e.listRef),
33
- labelsRef: t((e) => e.labelsRef),
34
- popupRef: t((e) => e.popupRef),
35
- emptyRef: t((e) => e.emptyRef),
36
- inputRef: t((e) => e.inputRef),
37
- keyboardActiveRef: t((e) => e.keyboardActiveRef),
38
- chipsContainerRef: t((e) => e.chipsContainerRef),
39
- clearRef: t((e) => e.clearRef),
40
- valuesRef: t((e) => e.valuesRef),
41
- allValuesRef: t((e) => e.allValuesRef),
42
- name: t((e) => e.name),
43
- disabled: t((e) => e.disabled),
44
- readOnly: t((e) => e.readOnly),
45
- required: t((e) => e.required),
46
- grid: t((e) => e.grid),
47
- isGrouped: t((e) => e.isGrouped),
48
- virtualized: t((e) => e.virtualized),
49
- onOpenChangeComplete: t((e) => e.onOpenChangeComplete),
50
- openOnInputClick: t((e) => e.openOnInputClick),
51
- itemToStringLabel: t((e) => e.itemToStringLabel),
52
- isItemEqualToValue: t((e) => e.isItemEqualToValue),
53
- modal: t((e) => e.modal),
54
- autoHighlight: t((e) => e.autoHighlight),
55
- submitOnItemClick: t((e) => e.submitOnItemClick)
56
- };
1
+ function t(r) {
2
+ if (r == null)
3
+ return "";
4
+ if (typeof r == "string")
5
+ return r;
6
+ try {
7
+ return JSON.stringify(r);
8
+ } catch {
9
+ return String(r);
10
+ }
11
+ }
57
12
  export {
58
- u as selectors
13
+ t as serializeValue
59
14
  };
package/dist/index225.js CHANGED
@@ -1,30 +1,24 @@
1
- import { isAndroid as r, isJSDOM as o } from "./index162.js";
2
- function s(i) {
3
- i.preventDefault(), i.stopPropagation();
4
- }
5
- function e(i) {
6
- return "nativeEvent" in i;
7
- }
8
- function p(i) {
9
- return i.mozInputSource === 0 && i.isTrusted ? !0 : r && i.pointerType ? i.type === "click" && i.buttons === 1 : i.detail === 0 && !i.pointerType;
10
- }
11
- function c(i) {
12
- return o ? !1 : !r && i.width === 0 && i.height === 0 || r && i.width === 1 && i.height === 1 && i.pressure === 0 && i.detail === 0 && i.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
13
- i.width < 1 && i.height < 1 && i.pressure === 0 && i.detail === 0 && i.pointerType === "touch";
14
- }
15
- function d(i, t) {
16
- const u = ["mouse", "pen"];
17
- return t || u.push("", void 0), u.includes(i);
18
- }
19
- function f(i) {
20
- const t = i.type;
21
- return t === "click" || t === "mousedown" || t === "keydown" || t === "keyup";
1
+ "use client";
2
+ import * as e from "react";
3
+ const t = /* @__PURE__ */ e.createContext({
4
+ register: () => {
5
+ },
6
+ unregister: () => {
7
+ },
8
+ subscribeMapChange: () => () => {
9
+ },
10
+ elementsRef: {
11
+ current: []
12
+ },
13
+ nextIndexRef: {
14
+ current: 0
15
+ }
16
+ });
17
+ process.env.NODE_ENV !== "production" && (t.displayName = "CompositeListContext");
18
+ function n() {
19
+ return e.useContext(t);
22
20
  }
23
21
  export {
24
- f as isClickLikeEvent,
25
- d as isMouseLikePointerType,
26
- e as isReactEvent,
27
- p as isVirtualClick,
28
- c as isVirtualPointerEvent,
29
- s as stopEvent
22
+ t as CompositeListContext,
23
+ n as useCompositeListContext
30
24
  };
package/dist/index226.js CHANGED
@@ -1,10 +1,130 @@
1
- import * as o from "react";
2
- const t = /* @__PURE__ */ o.createContext(void 0);
3
- process.env.NODE_ENV !== "production" && (t.displayName = "ComboboxChipsContext");
4
- function e() {
5
- return o.useContext(t);
1
+ const j = ["top", "right", "bottom", "left"], m = Math.min, p = Math.max, C = Math.round, L = Math.floor, E = (t) => ({
2
+ x: t,
3
+ y: t
4
+ }), h = {
5
+ left: "right",
6
+ right: "left",
7
+ bottom: "top",
8
+ top: "bottom"
9
+ }, x = {
10
+ start: "end",
11
+ end: "start"
12
+ };
13
+ function R(t, e, n) {
14
+ return p(t, m(e, n));
15
+ }
16
+ function T(t, e) {
17
+ return typeof t == "function" ? t(e) : t;
18
+ }
19
+ function g(t) {
20
+ return t.split("-")[0];
21
+ }
22
+ function a(t) {
23
+ return t.split("-")[1];
24
+ }
25
+ function b(t) {
26
+ return t === "x" ? "y" : "x";
27
+ }
28
+ function d(t) {
29
+ return t === "y" ? "height" : "width";
30
+ }
31
+ const A = /* @__PURE__ */ new Set(["top", "bottom"]);
32
+ function P(t) {
33
+ return A.has(g(t)) ? "y" : "x";
34
+ }
35
+ function y(t) {
36
+ return b(P(t));
37
+ }
38
+ function k(t, e, n) {
39
+ n === void 0 && (n = !1);
40
+ const r = a(t), i = y(t), o = d(i);
41
+ let c = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
42
+ return e.reference[o] > e.floating[o] && (c = f(c)), [c, f(c)];
43
+ }
44
+ function q(t) {
45
+ const e = f(t);
46
+ return [s(t), e, s(e)];
47
+ }
48
+ function s(t) {
49
+ return t.replace(/start|end/g, (e) => x[e]);
50
+ }
51
+ const u = ["left", "right"], l = ["right", "left"], M = ["top", "bottom"], O = ["bottom", "top"];
52
+ function S(t, e, n) {
53
+ switch (t) {
54
+ case "top":
55
+ case "bottom":
56
+ return n ? e ? l : u : e ? u : l;
57
+ case "left":
58
+ case "right":
59
+ return e ? M : O;
60
+ default:
61
+ return [];
62
+ }
63
+ }
64
+ function z(t, e, n, r) {
65
+ const i = a(t);
66
+ let o = S(g(t), n === "start", r);
67
+ return i && (o = o.map((c) => c + "-" + i), e && (o = o.concat(o.map(s)))), o;
68
+ }
69
+ function f(t) {
70
+ return t.replace(/left|right|bottom|top/g, (e) => h[e]);
71
+ }
72
+ function w(t) {
73
+ return {
74
+ top: 0,
75
+ right: 0,
76
+ bottom: 0,
77
+ left: 0,
78
+ ...t
79
+ };
80
+ }
81
+ function B(t) {
82
+ return typeof t != "number" ? w(t) : {
83
+ top: t,
84
+ right: t,
85
+ bottom: t,
86
+ left: t
87
+ };
88
+ }
89
+ function D(t) {
90
+ const {
91
+ x: e,
92
+ y: n,
93
+ width: r,
94
+ height: i
95
+ } = t;
96
+ return {
97
+ width: r,
98
+ height: i,
99
+ top: n,
100
+ left: e,
101
+ right: e + r,
102
+ bottom: n + i,
103
+ x: e,
104
+ y: n
105
+ };
6
106
  }
7
107
  export {
8
- t as ComboboxChipsContext,
9
- e as useComboboxChipsContext
108
+ R as clamp,
109
+ E as createCoords,
110
+ T as evaluate,
111
+ w as expandPaddingObject,
112
+ L as floor,
113
+ a as getAlignment,
114
+ y as getAlignmentAxis,
115
+ k as getAlignmentSides,
116
+ d as getAxisLength,
117
+ q as getExpandedPlacements,
118
+ s as getOppositeAlignmentPlacement,
119
+ b as getOppositeAxis,
120
+ z as getOppositeAxisPlacements,
121
+ f as getOppositePlacement,
122
+ B as getPaddingObject,
123
+ g as getSide,
124
+ P as getSideAxis,
125
+ p as max,
126
+ m as min,
127
+ D as rectToClientRect,
128
+ C as round,
129
+ j as sides
10
130
  };
package/dist/index227.js CHANGED
@@ -1,15 +1,47 @@
1
- "use client";
2
- import r from "./index112.js";
3
- import * as e from "react";
4
- const t = /* @__PURE__ */ e.createContext(void 0);
5
- process.env.NODE_ENV !== "production" && (t.displayName = "ComboboxPositionerContext");
6
- function s(n) {
7
- const o = e.useContext(t);
8
- if (o === void 0 && !n)
9
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component" : r(21));
10
- return o;
11
- }
1
+ import { evaluate as W, getPaddingObject as Y, getAlignmentAxis as k, getAlignment as q, clamp as B, getAxisLength as C } from "./index226.js";
2
+ const F = (s) => ({
3
+ name: "arrow",
4
+ options: s,
5
+ async fn(i) {
6
+ const {
7
+ x: y,
8
+ y: j,
9
+ placement: x,
10
+ rects: n,
11
+ platform: f,
12
+ elements: l,
13
+ middlewareData: M
14
+ } = i, {
15
+ element: g,
16
+ padding: v = 0,
17
+ offsetParent: z = "real"
18
+ } = W(s, i) || {};
19
+ if (g == null)
20
+ return {};
21
+ const h = Y(v), m = {
22
+ x: y,
23
+ y: j
24
+ }, t = k(x), e = C(t), r = await f.getDimensions(g), d = t === "y", E = d ? "top" : "left", H = d ? "bottom" : "right", A = d ? "clientHeight" : "clientWidth", L = n.reference[e] + n.reference[t] - m[t] - n.floating[e], R = m[t] - n.reference[t], S = z === "real" ? await f.getOffsetParent?.(g) : l.floating;
25
+ let a = l.floating[A] || n.floating[e];
26
+ (!a || !await f.isElement?.(S)) && (a = l.floating[A] || n.floating[e]);
27
+ const T = L / 2 - R / 2, O = a / 2 - r[e] / 2 - 1, u = Math.min(h[E], O), b = Math.min(h[H], O), c = u, D = a - r[e] - b, o = a / 2 - r[e] / 2 + T, P = B(c, o, D), p = !M.arrow && q(x) != null && o !== P && n.reference[e] / 2 - (o < c ? u : b) - r[e] / 2 < 0, w = p ? o < c ? o - c : o - D : 0;
28
+ return {
29
+ [t]: m[t] + w,
30
+ data: {
31
+ [t]: P,
32
+ centerOffset: o - P - w,
33
+ ...p && {
34
+ alignmentOffset: w
35
+ }
36
+ },
37
+ reset: p
38
+ };
39
+ }
40
+ }), I = (s, i) => ({
41
+ ...F(s),
42
+ options: [s, i]
43
+ });
12
44
  export {
13
- t as ComboboxPositionerContext,
14
- s as useComboboxPositionerContext
45
+ I as arrow,
46
+ F as baseArrow
15
47
  };
package/dist/index228.js CHANGED
@@ -1,14 +1,20 @@
1
- import r from "./index112.js";
2
- import * as t from "react";
3
- const e = /* @__PURE__ */ t.createContext(void 0);
4
- process.env.NODE_ENV !== "production" && (e.displayName = "ComboboxPortalContext");
5
- function s() {
6
- const o = t.useContext(e);
7
- if (o === void 0)
8
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Combobox.Portal> is missing." : r(20));
9
- return o;
10
- }
1
+ import { hide as a } from "./index230.js";
2
+ const o = {
3
+ name: "hide",
4
+ async fn(e) {
5
+ const {
6
+ width: n,
7
+ height: d,
8
+ x: i,
9
+ y: t
10
+ } = e.rects.reference, r = n === 0 && d === 0 && i === 0 && t === 0;
11
+ return {
12
+ data: {
13
+ referenceHidden: (await a().fn(e)).data?.referenceHidden || r
14
+ }
15
+ };
16
+ }
17
+ };
11
18
  export {
12
- e as ComboboxPortalContext,
13
- s as useComboboxPortalContext
19
+ o as hide
14
20
  };
package/dist/index229.js CHANGED
@@ -1,14 +1,7 @@
1
- import r from "./index112.js";
2
- import * as t from "react";
3
- const e = /* @__PURE__ */ t.createContext(void 0);
4
- process.env.NODE_ENV !== "production" && (e.displayName = "ComboboxGroupContext");
5
- function s() {
6
- const o = t.useContext(e);
7
- if (o === void 0)
8
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>." : r(18));
9
- return o;
10
- }
1
+ const e = {
2
+ sideX: "left",
3
+ sideY: "top"
4
+ };
11
5
  export {
12
- e as ComboboxGroupContext,
13
- s as useComboboxGroupContext
6
+ e as DEFAULT_SIDES
14
7
  };
package/dist/index23.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import * as l from "react";
3
- import { useDialogRootContext as n } from "./index96.js";
3
+ import { useDialogRootContext as n } from "./index103.js";
4
4
  import { useRenderElement as a } from "./index87.js";
5
- import { useBaseUiId as m } from "./index102.js";
5
+ import { useBaseUiId as m } from "./index109.js";
6
6
  const d = /* @__PURE__ */ l.forwardRef(function(e, t) {
7
7
  const {
8
8
  render: c,