@yselimcan/ui 0.0.7 → 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 (233) hide show
  1. package/dist/index100.js +5 -4
  2. package/dist/index101.js +7 -66
  3. package/dist/index102.js +87 -8
  4. package/dist/index103.js +11 -12
  5. package/dist/index104.js +62 -3
  6. package/dist/index105.js +38 -4
  7. package/dist/index106.js +14 -6
  8. package/dist/index107.js +32 -29
  9. package/dist/index108.js +19 -12
  10. package/dist/index109.js +4 -65
  11. package/dist/index110.js +3 -53
  12. package/dist/index111.js +5 -13
  13. package/dist/index112.js +11 -5
  14. package/dist/index113.js +19 -13
  15. package/dist/index114.js +13 -13
  16. package/dist/index115.js +296 -32
  17. package/dist/index116.js +5 -19
  18. package/dist/index117.js +38 -40
  19. package/dist/index118.js +123 -16
  20. package/dist/index119.js +21 -12
  21. package/dist/index120.js +77 -38
  22. package/dist/index121.js +65 -14
  23. package/dist/index122.js +45 -8
  24. package/dist/index123.js +14 -13
  25. package/dist/index124.js +5 -5
  26. package/dist/index125.js +29 -87
  27. package/dist/index126.js +4 -296
  28. package/dist/index127.js +26 -10
  29. package/dist/index128.js +14 -122
  30. package/dist/index129.js +21 -4
  31. package/dist/index130.js +54 -259
  32. package/dist/index131.js +16 -78
  33. package/dist/index132.js +26 -37
  34. package/dist/index133.js +41 -21
  35. package/dist/index134.js +43 -12
  36. package/dist/index135.js +20 -55
  37. package/dist/index136.js +48 -11
  38. package/dist/index137.js +51 -11
  39. package/dist/index138.js +16 -29
  40. package/dist/index139.js +11 -18
  41. package/dist/index140.js +21 -65
  42. package/dist/index141.js +34 -103
  43. package/dist/index142.js +230 -8
  44. package/dist/index143.js +283 -8
  45. package/dist/index144.js +52 -21
  46. package/dist/index145.js +14 -102
  47. package/dist/index146.js +79 -7
  48. package/dist/index147.js +3 -32
  49. package/dist/index148.js +28 -228
  50. package/dist/index149.js +23 -74
  51. package/dist/index150.js +15 -283
  52. package/dist/index151.js +68 -52
  53. package/dist/index152.js +4 -46
  54. package/dist/index153.js +98 -70
  55. package/dist/index154.js +79 -3
  56. package/dist/index155.js +262 -13
  57. package/dist/index156.js +11 -15
  58. package/dist/index157.js +10 -28
  59. package/dist/index158.js +40 -7
  60. package/dist/index159.js +4 -22
  61. package/dist/index160.js +66 -24
  62. package/dist/index161.js +9 -160
  63. package/dist/index162.js +8 -113
  64. package/dist/index163.js +5 -64
  65. package/dist/index164.js +132 -74
  66. package/dist/index165.js +53 -64
  67. package/dist/index166.js +10 -68
  68. package/dist/index167.js +118 -14
  69. package/dist/index168.js +11 -7
  70. package/dist/index169.js +10 -4
  71. package/dist/index17.js +4 -4
  72. package/dist/index170.js +64 -15
  73. package/dist/index171.js +12 -21
  74. package/dist/index172.js +12 -58
  75. package/dist/index173.js +11 -16
  76. package/dist/index174.js +11 -27
  77. package/dist/index175.js +88 -43
  78. package/dist/index176.js +11 -21
  79. package/dist/index177.js +11 -48
  80. package/dist/index178.js +53 -48
  81. package/dist/index179.js +11 -17
  82. package/dist/index18.js +4 -4
  83. package/dist/index180.js +11 -11
  84. package/dist/index181.js +17 -34
  85. package/dist/index182.js +8 -15
  86. package/dist/index183.js +8 -79
  87. package/dist/index184.js +103 -23
  88. package/dist/index185.js +6 -2
  89. package/dist/index186.js +32 -11
  90. package/dist/index187.js +74 -10
  91. package/dist/index188.js +13 -39
  92. package/dist/index189.js +28 -4
  93. package/dist/index19.js +9 -9
  94. package/dist/index190.js +13 -10
  95. package/dist/index191.js +7 -11
  96. package/dist/index192.js +21 -116
  97. package/dist/index193.js +25 -12
  98. package/dist/index194.js +158 -85
  99. package/dist/index195.js +113 -12
  100. package/dist/index196.js +72 -59
  101. package/dist/index197.js +65 -4
  102. package/dist/index198.js +9 -5
  103. package/dist/index199.js +22 -11
  104. package/dist/index20.js +2 -2
  105. package/dist/index201.js +4 -22
  106. package/dist/index202.js +10 -4
  107. package/dist/index203.js +38 -26
  108. package/dist/index204.js +56 -127
  109. package/dist/index205.js +28 -45
  110. package/dist/index206.js +8 -18
  111. package/dist/index207.js +13 -5
  112. package/dist/index208.js +11 -180
  113. package/dist/index209.js +11 -75
  114. package/dist/index21.js +3 -3
  115. package/dist/index210.js +19 -396
  116. package/dist/index211.js +11 -199
  117. package/dist/index212.js +7 -47
  118. package/dist/index213.js +43 -20
  119. package/dist/index214.js +593 -44
  120. package/dist/index215.js +11 -6
  121. package/dist/index216.js +17 -5
  122. package/dist/index217.js +45 -14
  123. package/dist/index218.js +197 -12
  124. package/dist/index219.js +47 -32
  125. package/dist/index22.js +5 -5
  126. package/dist/index220.js +20 -4
  127. package/dist/index221.js +32 -11
  128. package/dist/index222.js +6 -9
  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 -3
  144. package/dist/index237.js +5 -208
  145. package/dist/index238.js +209 -4
  146. package/dist/index239.js +3 -13
  147. package/dist/index24.js +9 -9
  148. package/dist/index240.js +13 -47
  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/index27.js +1 -1
  163. package/dist/index28.js +1 -1
  164. package/dist/index29.js +1 -1
  165. package/dist/index30.js +1 -1
  166. package/dist/index31.js +1 -1
  167. package/dist/index32.js +1 -1
  168. package/dist/index33.js +16 -16
  169. package/dist/index34.js +5 -5
  170. package/dist/index35.js +13 -13
  171. package/dist/index36.js +10 -10
  172. package/dist/index37.js +7 -7
  173. package/dist/index38.js +9 -9
  174. package/dist/index39.js +4 -4
  175. package/dist/index40.js +2 -2
  176. package/dist/index41.js +3 -3
  177. package/dist/index42.js +2 -2
  178. package/dist/index43.js +1 -1
  179. package/dist/index45.js +5 -5
  180. package/dist/index46.js +9 -9
  181. package/dist/index47.js +9 -9
  182. package/dist/index48.js +18 -18
  183. package/dist/index49.js +4 -4
  184. package/dist/index50.js +11 -11
  185. package/dist/index51.js +1 -1
  186. package/dist/index52.js +25 -25
  187. package/dist/index53.js +3 -3
  188. package/dist/index54.js +31 -31
  189. package/dist/index55.js +13 -13
  190. package/dist/index56.js +12 -12
  191. package/dist/index57.js +1 -1
  192. package/dist/index58.js +3 -3
  193. package/dist/index59.js +5 -5
  194. package/dist/index60.js +11 -11
  195. package/dist/index61.js +4 -4
  196. package/dist/index62.js +3 -3
  197. package/dist/index63.js +11 -11
  198. package/dist/index64.js +4 -4
  199. package/dist/index65.js +3 -3
  200. package/dist/index66.js +13 -13
  201. package/dist/index67.js +1 -1
  202. package/dist/index68.js +1 -1
  203. package/dist/index69.js +32 -32
  204. package/dist/index70.js +5 -5
  205. package/dist/index71.js +17 -17
  206. package/dist/index72.js +23 -23
  207. package/dist/index73.js +7 -7
  208. package/dist/index74.js +1 -1
  209. package/dist/index75.js +13 -13
  210. package/dist/index76.js +2 -2
  211. package/dist/index77.js +4 -4
  212. package/dist/index78.js +3 -3
  213. package/dist/index79.js +1 -1
  214. package/dist/index80.js +1 -1
  215. package/dist/index81.js +17 -17
  216. package/dist/index82.js +4 -4
  217. package/dist/index83.js +4 -4
  218. package/dist/index86.js +11 -89
  219. package/dist/index87.js +8 -8
  220. package/dist/index88.js +96 -12
  221. package/dist/index89.js +19 -96
  222. package/dist/index90.js +15 -18
  223. package/dist/index91.js +33 -16
  224. package/dist/index92.js +12 -33
  225. package/dist/index93.js +90 -12
  226. package/dist/index94.js +4 -133
  227. package/dist/index95.js +63 -24
  228. package/dist/index96.js +8 -8
  229. package/dist/index97.js +14 -5
  230. package/dist/index98.js +3 -12
  231. package/dist/index99.js +3 -22
  232. package/dist/styles.css +1 -1
  233. package/package.json +3 -3
package/dist/index89.js CHANGED
@@ -1,98 +1,21 @@
1
- "use client";
2
- import * as p from "react";
3
- import { useStableCallback as x } from "./index95.js";
4
- import { useControlled as L } from "./index107.js";
5
- import { useIsoLayoutEffect as k } from "./index97.js";
6
- import { useFieldRootContext as b } from "./index172.js";
7
- import { useLabelableContext as B } from "./index173.js";
8
- import { useLabelableId as S } from "./index174.js";
9
- import { fieldValidityMapping as U } from "./index184.js";
10
- import { useRenderElement as A } from "./index87.js";
11
- import { useField as K } from "./index177.js";
12
- import { createChangeEventDetails as O } from "./index115.js";
13
- import { none as _ } from "./index116.js";
14
- const j = /* @__PURE__ */ p.forwardRef(function(n, C) {
15
- const {
16
- render: z,
17
- className: G,
18
- id: g,
19
- name: v,
20
- value: o,
21
- disabled: R = !1,
22
- onValueChange: V,
23
- defaultValue: i,
24
- ...F
25
- } = n, {
26
- state: s,
27
- name: y,
28
- disabled: E
29
- } = b(), r = E || R, u = y ?? v, N = p.useMemo(() => ({
30
- ...s,
31
- disabled: r
32
- }), [s, r]), {
33
- setTouched: d,
34
- setDirty: P,
35
- validityData: T,
36
- setFocused: m,
37
- setFilled: l,
38
- validationMode: h,
39
- validation: t
40
- } = b(), {
41
- labelId: D
42
- } = B(), f = S({
43
- id: g
44
- });
45
- k(() => {
46
- const e = o != null;
47
- t.inputRef.current?.value || e && o !== "" ? l(!0) : e && o === "" && l(!1);
48
- }, [t.inputRef, l, o]);
49
- const [c, I] = L({
50
- controlled: o,
51
- default: i,
52
- name: "FieldControl",
53
- state: "value"
54
- }), M = o !== void 0, w = x((e, a) => {
55
- V?.(e, a), !a.isCanceled && I(e);
56
- });
57
- return K({
58
- id: f,
59
- name: u,
60
- commit: t.commit,
61
- value: c,
62
- getValue: () => t.inputRef.current?.value,
63
- controlRef: t.inputRef
64
- }), A("input", n, {
65
- ref: C,
66
- state: N,
67
- props: [{
68
- id: f,
69
- disabled: r,
70
- name: u,
71
- ref: t.inputRef,
72
- "aria-labelledby": D,
73
- ...M ? {
74
- value: c
75
- } : {
76
- defaultValue: i
77
- },
78
- onChange(e) {
79
- const a = e.currentTarget.value;
80
- w(a, O(_, e.nativeEvent)), P(a !== T.initialValue), l(a !== "");
81
- },
82
- onFocus() {
83
- m(!0);
84
- },
85
- onBlur(e) {
86
- d(!0), m(!1), h === "onBlur" && t.commit(e.currentTarget.value);
87
- },
88
- onKeyDown(e) {
89
- e.currentTarget.tagName === "INPUT" && e.key === "Enter" && (d(!0), t.commit(e.currentTarget.value));
90
- }
91
- }, t.getInputValidationProps(), F],
92
- stateAttributesMapping: U
93
- });
94
- });
95
- process.env.NODE_ENV !== "production" && (j.displayName = "FieldControl");
1
+ import { forwardRef as m, createElement as l } from "react";
2
+ import { mergeClasses as d, toKebabCase as f, toPascalCase as r } from "./index90.js";
3
+ import n from "./index91.js";
4
+ const C = (e, t) => {
5
+ const o = m(
6
+ ({ className: a, ...s }, c) => l(n, {
7
+ ref: c,
8
+ iconNode: t,
9
+ className: d(
10
+ `lucide-${f(r(e))}`,
11
+ `lucide-${e}`,
12
+ a
13
+ ),
14
+ ...s
15
+ })
16
+ );
17
+ return o.displayName = r(e), o;
18
+ };
96
19
  export {
97
- j as FieldControl
20
+ C as default
98
21
  };
package/dist/index90.js CHANGED
@@ -1,21 +1,18 @@
1
- import { forwardRef as m, createElement as l } from "react";
2
- import { mergeClasses as d, toKebabCase as f, toPascalCase as r } from "./index91.js";
3
- import n from "./index92.js";
4
- const C = (e, t) => {
5
- const o = m(
6
- ({ className: a, ...s }, c) => l(n, {
7
- ref: c,
8
- iconNode: t,
9
- className: d(
10
- `lucide-${f(r(e))}`,
11
- `lucide-${e}`,
12
- a
13
- ),
14
- ...s
15
- })
16
- );
17
- return o.displayName = r(e), o;
1
+ const s = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), a = (t) => t.replace(
2
+ /^([A-Z])|[\s-_]+(\w)/g,
3
+ (e, o, r) => r ? r.toUpperCase() : o.toLowerCase()
4
+ ), n = (t) => {
5
+ const e = a(t);
6
+ return e.charAt(0).toUpperCase() + e.slice(1);
7
+ }, c = (...t) => t.filter((e, o, r) => !!e && e.trim() !== "" && r.indexOf(e) === o).join(" ").trim(), i = (t) => {
8
+ for (const e in t)
9
+ if (e.startsWith("aria-") || e === "role" || e === "title")
10
+ return !0;
18
11
  };
19
12
  export {
20
- C as default
13
+ i as hasA11yProp,
14
+ c as mergeClasses,
15
+ a as toCamelCase,
16
+ s as toKebabCase,
17
+ n as toPascalCase
21
18
  };
package/dist/index91.js CHANGED
@@ -1,18 +1,35 @@
1
- const s = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), a = (t) => t.replace(
2
- /^([A-Z])|[\s-_]+(\w)/g,
3
- (e, o, r) => r ? r.toUpperCase() : o.toLowerCase()
4
- ), n = (t) => {
5
- const e = a(t);
6
- return e.charAt(0).toUpperCase() + e.slice(1);
7
- }, c = (...t) => t.filter((e, o, r) => !!e && e.trim() !== "" && r.indexOf(e) === o).join(" ").trim(), i = (t) => {
8
- for (const e in t)
9
- if (e.startsWith("aria-") || e === "role" || e === "title")
10
- return !0;
11
- };
1
+ import { forwardRef as l, createElement as o } from "react";
2
+ import A from "./index92.js";
3
+ import { mergeClasses as b, hasA11yProp as c } from "./index90.js";
4
+ const h = l(
5
+ ({
6
+ color: m = "currentColor",
7
+ size: t = 24,
8
+ strokeWidth: e = 2,
9
+ absoluteStrokeWidth: s,
10
+ className: u = "",
11
+ children: r,
12
+ iconNode: f,
13
+ ...a
14
+ }, p) => o(
15
+ "svg",
16
+ {
17
+ ref: p,
18
+ ...A,
19
+ width: t,
20
+ height: t,
21
+ stroke: m,
22
+ strokeWidth: s ? Number(e) * 24 / Number(t) : e,
23
+ className: b("lucide", u),
24
+ ...!r && !c(a) && { "aria-hidden": "true" },
25
+ ...a
26
+ },
27
+ [
28
+ ...f.map(([i, d]) => o(i, d)),
29
+ ...Array.isArray(r) ? r : [r]
30
+ ]
31
+ )
32
+ );
12
33
  export {
13
- i as hasA11yProp,
14
- c as mergeClasses,
15
- a as toCamelCase,
16
- s as toKebabCase,
17
- n as toPascalCase
34
+ h as default
18
35
  };
package/dist/index92.js CHANGED
@@ -1,35 +1,14 @@
1
- import { forwardRef as l, createElement as o } from "react";
2
- import A from "./index93.js";
3
- import { mergeClasses as b, hasA11yProp as c } from "./index91.js";
4
- const h = l(
5
- ({
6
- color: m = "currentColor",
7
- size: t = 24,
8
- strokeWidth: e = 2,
9
- absoluteStrokeWidth: s,
10
- className: u = "",
11
- children: r,
12
- iconNode: f,
13
- ...a
14
- }, p) => o(
15
- "svg",
16
- {
17
- ref: p,
18
- ...A,
19
- width: t,
20
- height: t,
21
- stroke: m,
22
- strokeWidth: s ? Number(e) * 24 / Number(t) : e,
23
- className: b("lucide", u),
24
- ...!r && !c(a) && { "aria-hidden": "true" },
25
- ...a
26
- },
27
- [
28
- ...f.map(([i, d]) => o(i, d)),
29
- ...Array.isArray(r) ? r : [r]
30
- ]
31
- )
32
- );
1
+ var t = {
2
+ xmlns: "http://www.w3.org/2000/svg",
3
+ width: 24,
4
+ height: 24,
5
+ viewBox: "0 0 24 24",
6
+ fill: "none",
7
+ stroke: "currentColor",
8
+ strokeWidth: 2,
9
+ strokeLinecap: "round",
10
+ strokeLinejoin: "round"
11
+ };
33
12
  export {
34
- h as default
13
+ t as default
35
14
  };
package/dist/index93.js CHANGED
@@ -1,14 +1,92 @@
1
- var t = {
2
- xmlns: "http://www.w3.org/2000/svg",
3
- width: 24,
4
- height: 24,
5
- viewBox: "0 0 24 24",
6
- fill: "none",
7
- stroke: "currentColor",
8
- strokeWidth: 2,
9
- strokeLinecap: "round",
10
- strokeLinejoin: "round"
11
- };
1
+ "use client";
2
+ import * as i from "react";
3
+ import { isHTMLElement as K } from "./index164.js";
4
+ import { useStableCallback as d } from "./index127.js";
5
+ import { error as m } from "./index198.js";
6
+ import { useIsoLayoutEffect as N } from "./index126.js";
7
+ import { useCompositeRootContext as O } from "./index190.js";
8
+ import { useFocusableWhenDisabled as T } from "./index199.js";
9
+ import { mergeProps as U, makeEventPreventable as b } from "./index27.js";
10
+ function F(a = {}) {
11
+ const {
12
+ disabled: n = !1,
13
+ focusableWhenDisabled: h,
14
+ tabIndex: D = 0,
15
+ native: o = !0
16
+ } = a, r = i.useRef(null), u = O(!0) !== void 0, f = d(() => {
17
+ const t = r.current;
18
+ return !!(t?.tagName === "A" && t?.href);
19
+ }), {
20
+ props: s
21
+ } = T({
22
+ focusableWhenDisabled: h,
23
+ disabled: n,
24
+ composite: u,
25
+ tabIndex: D,
26
+ isNativeButton: o
27
+ });
28
+ process.env.NODE_ENV !== "production" && i.useEffect(() => {
29
+ if (!r.current)
30
+ return;
31
+ const t = r.current.tagName === "BUTTON";
32
+ o ? t || m("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.") : t && m("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
33
+ }, [o]);
34
+ const l = i.useCallback(() => {
35
+ const t = r.current;
36
+ I(t) && u && n && s.disabled === void 0 && t.disabled && (t.disabled = !1);
37
+ }, [n, s.disabled, u]);
38
+ N(l, [l]);
39
+ const y = i.useCallback((t = {}) => {
40
+ const {
41
+ onClick: c,
42
+ onMouseDown: k,
43
+ onKeyUp: E,
44
+ onKeyDown: g,
45
+ onPointerDown: B,
46
+ ...C
47
+ } = t;
48
+ return U({
49
+ type: o ? "button" : void 0,
50
+ onClick(e) {
51
+ if (n) {
52
+ e.preventDefault();
53
+ return;
54
+ }
55
+ c?.(e);
56
+ },
57
+ onMouseDown(e) {
58
+ n || k?.(e);
59
+ },
60
+ onKeyDown(e) {
61
+ if (n || (b(e), g?.(e)), e.baseUIHandlerPrevented)
62
+ return;
63
+ const P = e.target === e.currentTarget && !o && !f() && !n, p = e.key === "Enter", x = e.key === " ";
64
+ P && ((x || p) && e.preventDefault(), p && c?.(e));
65
+ },
66
+ onKeyUp(e) {
67
+ n || (b(e), E?.(e)), !e.baseUIHandlerPrevented && e.target === e.currentTarget && !o && !n && e.key === " " && c?.(e);
68
+ },
69
+ onPointerDown(e) {
70
+ if (n) {
71
+ e.preventDefault();
72
+ return;
73
+ }
74
+ B?.(e);
75
+ }
76
+ }, o ? void 0 : {
77
+ role: "button"
78
+ }, s, C);
79
+ }, [n, s, o, f]), w = d((t) => {
80
+ r.current = t, l();
81
+ });
82
+ return {
83
+ getButtonProps: y,
84
+ buttonRef: w
85
+ };
86
+ }
87
+ function I(a) {
88
+ return K(a) && a.tagName === "BUTTON";
89
+ }
12
90
  export {
13
- t as default
91
+ F as useButton
14
92
  };
package/dist/index94.js CHANGED
@@ -1,136 +1,7 @@
1
- function c() {
2
- return typeof window < "u";
3
- }
4
- function u(t) {
5
- return p(t) ? (t.nodeName || "").toLowerCase() : "#document";
6
- }
7
- function i(t) {
8
- var e;
9
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
10
- }
11
- function N(t) {
12
- var e;
13
- return (e = (p(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
14
- }
15
- function p(t) {
16
- return c() ? t instanceof Node || t instanceof i(t).Node : !1;
17
- }
18
- function m(t) {
19
- return c() ? t instanceof Element || t instanceof i(t).Element : !1;
20
- }
21
- function w(t) {
22
- return c() ? t instanceof HTMLElement || t instanceof i(t).HTMLElement : !1;
23
- }
24
- function f(t) {
25
- return !c() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof i(t).ShadowRoot;
26
- }
27
- const E = /* @__PURE__ */ new Set(["inline", "contents"]);
28
- function y(t) {
29
- const {
30
- overflow: e,
31
- overflowX: n,
32
- overflowY: o,
33
- display: r
34
- } = S(t);
35
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !E.has(r);
36
- }
37
- const T = /* @__PURE__ */ new Set(["table", "td", "th"]);
38
- function A(t) {
39
- return T.has(u(t));
40
- }
41
- const v = [":popover-open", ":modal"];
42
- function L(t) {
43
- return v.some((e) => {
44
- try {
45
- return t.matches(e);
46
- } catch {
47
- return !1;
48
- }
49
- });
50
- }
51
- const D = ["transform", "translate", "scale", "rotate", "perspective"], C = ["transform", "translate", "scale", "rotate", "perspective", "filter"], k = ["paint", "layout", "strict", "content"];
52
- function V(t) {
53
- const e = O(), n = m(t) ? S(t) : t;
54
- return D.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || C.some((o) => (n.willChange || "").includes(o)) || k.some((o) => (n.contain || "").includes(o));
55
- }
56
- function B(t) {
57
- let e = s(t);
58
- for (; w(e) && !h(e); ) {
59
- if (V(e))
60
- return e;
61
- if (L(e))
62
- return null;
63
- e = s(e);
64
- }
65
- return null;
66
- }
67
- function O() {
68
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
69
- }
70
- const R = /* @__PURE__ */ new Set(["html", "body", "#document"]);
71
- function h(t) {
72
- return R.has(u(t));
73
- }
74
- function S(t) {
75
- return i(t).getComputedStyle(t);
76
- }
77
- function F(t) {
78
- return m(t) ? {
79
- scrollLeft: t.scrollLeft,
80
- scrollTop: t.scrollTop
81
- } : {
82
- scrollLeft: t.scrollX,
83
- scrollTop: t.scrollY
84
- };
85
- }
86
- function s(t) {
87
- if (u(t) === "html")
88
- return t;
89
- const e = (
90
- // Step into the shadow DOM of the parent of a slotted node.
91
- t.assignedSlot || // DOM Element detected.
92
- t.parentNode || // ShadowRoot detected.
93
- f(t) && t.host || // Fallback.
94
- N(t)
95
- );
96
- return f(e) ? e.host : e;
97
- }
98
- function b(t) {
99
- const e = s(t);
100
- return h(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : w(e) && y(e) ? e : b(e);
101
- }
102
- function d(t, e, n) {
103
- var o;
104
- e === void 0 && (e = []), n === void 0 && (n = !0);
105
- const r = b(t), g = r === ((o = t.ownerDocument) == null ? void 0 : o.body), l = i(r);
106
- if (g) {
107
- const a = _(l);
108
- return e.concat(l, l.visualViewport || [], y(r) ? r : [], a && n ? d(a) : []);
109
- }
110
- return e.concat(r, d(r, [], n));
111
- }
112
- function _(t) {
113
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1
+ function o(r, ...a) {
2
+ const e = new URL(`https://base-ui.com/production-error/${r}`);
3
+ return a.forEach((s) => e.searchParams.append("args[]", s)), `Base UI error #${r}; visit ${e} for the full message.`;
114
4
  }
115
5
  export {
116
- S as getComputedStyle,
117
- B as getContainingBlock,
118
- N as getDocumentElement,
119
- _ as getFrameElement,
120
- b as getNearestOverflowAncestor,
121
- u as getNodeName,
122
- F as getNodeScroll,
123
- d as getOverflowAncestors,
124
- s as getParentNode,
125
- i as getWindow,
126
- V as isContainingBlock,
127
- m as isElement,
128
- w as isHTMLElement,
129
- h as isLastTraversableNode,
130
- p as isNode,
131
- y as isOverflowElement,
132
- f as isShadowRoot,
133
- A as isTableElement,
134
- L as isTopLayer,
135
- O as isWebKit
6
+ o as default
136
7
  };
package/dist/index95.js CHANGED
@@ -1,30 +1,69 @@
1
- "use client";
2
- import * as a from "react";
3
- import { useRefWithInit as c } from "./index168.js";
4
- const n = a[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], r = (
5
- // React 17 doesn't have useInsertionEffect.
6
- n && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
7
- n !== a.useLayoutEffect ? n : (e) => e()
8
- );
9
- function f(e) {
10
- const t = c(o).current;
11
- return t.next = e, r(t.effect), t.trampoline;
1
+ import { useRefWithInit as r } from "./index101.js";
2
+ function b(n, e, c, t) {
3
+ const l = r(i).current;
4
+ return s(l, n, e, c, t) && o(l, [n, e, c, t]), l.callback;
12
5
  }
13
- function o() {
14
- const e = {
15
- next: void 0,
16
- callback: l,
17
- trampoline: (...t) => e.callback?.(...t),
18
- effect: () => {
19
- e.callback = e.next;
20
- }
6
+ function h(n) {
7
+ const e = r(i).current;
8
+ return f(e, n) && o(e, n), e.callback;
9
+ }
10
+ function i() {
11
+ return {
12
+ callback: null,
13
+ cleanup: null,
14
+ refs: []
21
15
  };
22
- return e;
23
16
  }
24
- function l() {
25
- if (process.env.NODE_ENV !== "production")
26
- throw new Error("Base UI: Cannot call an event handler while rendering.");
17
+ function s(n, e, c, t, l) {
18
+ return n.refs[0] !== e || n.refs[1] !== c || n.refs[2] !== t || n.refs[3] !== l;
19
+ }
20
+ function f(n, e) {
21
+ return n.refs.length !== e.length || n.refs.some((c, t) => c !== e[t]);
22
+ }
23
+ function o(n, e) {
24
+ if (n.refs = e, e.every((c) => c == null)) {
25
+ n.callback = null;
26
+ return;
27
+ }
28
+ n.callback = (c) => {
29
+ if (n.cleanup && (n.cleanup(), n.cleanup = null), c != null) {
30
+ const t = Array(e.length).fill(null);
31
+ for (let l = 0; l < e.length; l += 1) {
32
+ const u = e[l];
33
+ if (u != null)
34
+ switch (typeof u) {
35
+ case "function": {
36
+ const a = u(c);
37
+ typeof a == "function" && (t[l] = a);
38
+ break;
39
+ }
40
+ case "object": {
41
+ u.current = c;
42
+ break;
43
+ }
44
+ }
45
+ }
46
+ n.cleanup = () => {
47
+ for (let l = 0; l < e.length; l += 1) {
48
+ const u = e[l];
49
+ if (u != null)
50
+ switch (typeof u) {
51
+ case "function": {
52
+ const a = t[l];
53
+ typeof a == "function" ? a() : u(null);
54
+ break;
55
+ }
56
+ case "object": {
57
+ u.current = null;
58
+ break;
59
+ }
60
+ }
61
+ }
62
+ };
63
+ }
64
+ };
27
65
  }
28
66
  export {
29
- f as useStableCallback
67
+ b as useMergedRefs,
68
+ h as useMergedRefsN
30
69
  };
package/dist/index96.js CHANGED
@@ -1,11 +1,11 @@
1
- let o;
2
- process.env.NODE_ENV !== "production" && (o = /* @__PURE__ */ new Set());
3
- function s(...r) {
4
- if (process.env.NODE_ENV !== "production") {
5
- const e = r.join(" ");
6
- o.has(e) || (o.add(e), console.error(`Base UI: ${e}`));
7
- }
1
+ import * as n from "react";
2
+ import { isReactVersionAtLeast as o } from "./index200.js";
3
+ function s(t) {
4
+ if (!/* @__PURE__ */ n.isValidElement(t))
5
+ return null;
6
+ const e = t, r = e.props;
7
+ return (o(19) ? r?.ref : e.ref) ?? null;
8
8
  }
9
9
  export {
10
- s as error
10
+ s as getReactElementRef
11
11
  };
package/dist/index97.js CHANGED
@@ -1,7 +1,16 @@
1
- "use client";
2
- import * as e from "react";
3
- const o = () => {
4
- }, t = typeof document < "u" ? e.useLayoutEffect : o;
1
+ function i(r, n) {
2
+ const o = {};
3
+ for (const t in r) {
4
+ const e = r[t];
5
+ if (n?.hasOwnProperty(t)) {
6
+ const s = n[t](e);
7
+ s != null && Object.assign(o, s);
8
+ continue;
9
+ }
10
+ e === !0 ? o[`data-${t.toLowerCase()}`] = "" : e && (o[`data-${t.toLowerCase()}`] = e.toString());
11
+ }
12
+ return o;
13
+ }
5
14
  export {
6
- t as useIsoLayoutEffect
15
+ i as getStateAttributesProps
7
16
  };
package/dist/index98.js CHANGED
@@ -1,15 +1,6 @@
1
- "use client";
2
- import n from "./index100.js";
3
- import * as t from "react";
4
- const e = /* @__PURE__ */ t.createContext(void 0);
5
- process.env.NODE_ENV !== "production" && (e.displayName = "CompositeRootContext");
6
- function r(s = !1) {
7
- const o = t.useContext(e);
8
- if (o === void 0 && !s)
9
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : n(16));
10
- return o;
1
+ function t(n, o) {
2
+ return typeof n == "function" ? n(o) : n;
11
3
  }
12
4
  export {
13
- e as CompositeRootContext,
14
- r as useCompositeRootContext
5
+ t as resolveClassName
15
6
  };