@vritti/quantum-ui 0.2.4 → 0.2.6

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/Button.js +1 -1
  2. package/dist/Button.js.map +1 -1
  3. package/dist/Button2.js +2 -1
  4. package/dist/Button2.js.map +1 -1
  5. package/dist/Checkbox.js +3 -5
  6. package/dist/Checkbox.js.map +1 -1
  7. package/dist/DatePicker.js +416 -139
  8. package/dist/DatePicker.js.map +1 -1
  9. package/dist/Form.js +108 -97
  10. package/dist/Form.js.map +1 -1
  11. package/dist/Label.js +1 -1
  12. package/dist/Label.js.map +1 -1
  13. package/dist/OTPField.js +3 -2
  14. package/dist/OTPField.js.map +1 -1
  15. package/dist/PasswordField.js +3 -3
  16. package/dist/PasswordField.js.map +1 -1
  17. package/dist/PhoneField.js +25 -8
  18. package/dist/PhoneField.js.map +1 -1
  19. package/dist/Spinner.js +1 -1
  20. package/dist/Spinner.js.map +1 -1
  21. package/dist/ThemeToggle.js +2 -2
  22. package/dist/ThemeToggle.js.map +1 -1
  23. package/dist/axios.js +125 -56
  24. package/dist/axios.js.map +1 -1
  25. package/dist/components/Progress.js +61 -2
  26. package/dist/components/Progress.js.map +1 -1
  27. package/dist/createLucideIcon.js +4 -4
  28. package/dist/createLucideIcon.js.map +1 -1
  29. package/dist/field.js +2 -36
  30. package/dist/field.js.map +1 -1
  31. package/dist/index2.js +130 -54
  32. package/dist/index2.js.map +1 -1
  33. package/dist/index3.js +1 -103
  34. package/dist/index3.js.map +1 -1
  35. package/dist/index4.js +36 -35
  36. package/dist/index4.js.map +1 -1
  37. package/dist/index5.js +303 -3
  38. package/dist/index5.js.map +1 -1
  39. package/dist/{components → lib/components}/Button/Button.d.ts +1 -1
  40. package/dist/lib/components/Button/Button.d.ts.map +1 -0
  41. package/dist/lib/components/Button/index.d.ts.map +1 -0
  42. package/dist/lib/components/Card/Card.d.ts.map +1 -0
  43. package/dist/lib/components/Card/index.d.ts.map +1 -0
  44. package/dist/lib/components/Checkbox/Checkbox.d.ts.map +1 -0
  45. package/dist/lib/components/Checkbox/index.d.ts.map +1 -0
  46. package/dist/lib/components/DatePicker/DatePicker.d.ts.map +1 -0
  47. package/dist/lib/components/DatePicker/index.d.ts.map +1 -0
  48. package/dist/lib/components/Field/index.d.ts.map +1 -0
  49. package/dist/lib/components/Form/Form.d.ts.map +1 -0
  50. package/dist/lib/components/Form/index.d.ts.map +1 -0
  51. package/dist/{components → lib/components}/OTPField/OTPField.d.ts +3 -2
  52. package/dist/lib/components/OTPField/OTPField.d.ts.map +1 -0
  53. package/dist/lib/components/OTPField/index.d.ts.map +1 -0
  54. package/dist/lib/components/PasswordField/PasswordField.d.ts.map +1 -0
  55. package/dist/lib/components/PasswordField/index.d.ts.map +1 -0
  56. package/dist/{components → lib/components}/PhoneField/PhoneField.d.ts +2 -1
  57. package/dist/lib/components/PhoneField/PhoneField.d.ts.map +1 -0
  58. package/dist/lib/components/PhoneField/index.d.ts.map +1 -0
  59. package/dist/lib/components/Progress/Progress.d.ts.map +1 -0
  60. package/dist/lib/components/Progress/index.d.ts.map +1 -0
  61. package/dist/lib/components/Skeleton/Skeleton.d.ts.map +1 -0
  62. package/dist/lib/components/Skeleton/index.d.ts.map +1 -0
  63. package/dist/lib/components/Spinner/Spinner.d.ts.map +1 -0
  64. package/dist/lib/components/Spinner/index.d.ts.map +1 -0
  65. package/dist/lib/components/TextArea/TextArea.d.ts.map +1 -0
  66. package/dist/lib/components/TextArea/index.d.ts.map +1 -0
  67. package/dist/lib/components/TextField/TextField.d.ts.map +1 -0
  68. package/dist/lib/components/TextField/index.d.ts.map +1 -0
  69. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts.map +1 -0
  70. package/dist/lib/components/ThemeToggle/index.d.ts.map +1 -0
  71. package/dist/lib/components/Typography/Typography.d.ts.map +1 -0
  72. package/dist/lib/components/Typography/index.d.ts.map +1 -0
  73. package/dist/lib/components/index.d.ts.map +1 -0
  74. package/dist/lib/config/index.d.ts.map +1 -0
  75. package/dist/lib/index.d.ts.map +1 -0
  76. package/dist/lib/utils/axios.d.ts.map +1 -0
  77. package/dist/lib/utils/formHelpers.d.ts.map +1 -0
  78. package/dist/lib/utils/index.d.ts.map +1 -0
  79. package/dist/shadcn/index.d.ts +15 -0
  80. package/dist/shadcn/index.d.ts.map +1 -0
  81. package/dist/shadcn/shadcnButton/Button.d.ts +11 -0
  82. package/dist/shadcn/shadcnButton/Button.d.ts.map +1 -0
  83. package/dist/shadcn/shadcnButton/index.d.ts +2 -0
  84. package/dist/shadcn/shadcnButton/index.d.ts.map +1 -0
  85. package/dist/shadcn/shadcnCalendar/calendar.d.ts +13 -0
  86. package/dist/shadcn/shadcnCalendar/calendar.d.ts.map +1 -0
  87. package/dist/shadcn/shadcnCalendar/index.d.ts +3 -0
  88. package/dist/shadcn/shadcnCalendar/index.d.ts.map +1 -0
  89. package/dist/shadcn/shadcnCard/Card.d.ts +10 -0
  90. package/dist/shadcn/shadcnCard/Card.d.ts.map +1 -0
  91. package/dist/shadcn/shadcnCard/index.d.ts +2 -0
  92. package/dist/shadcn/shadcnCard/index.d.ts.map +1 -0
  93. package/dist/shadcn/shadcnCheckbox/Checkbox.d.ts +5 -0
  94. package/dist/shadcn/shadcnCheckbox/Checkbox.d.ts.map +1 -0
  95. package/dist/shadcn/shadcnCheckbox/index.d.ts +2 -0
  96. package/dist/shadcn/shadcnCheckbox/index.d.ts.map +1 -0
  97. package/dist/shadcn/shadcnDropdownMenu/dropdown-menu.d.ts +28 -0
  98. package/dist/shadcn/shadcnDropdownMenu/dropdown-menu.d.ts.map +1 -0
  99. package/dist/shadcn/shadcnDropdownMenu/index.d.ts +2 -0
  100. package/dist/shadcn/shadcnDropdownMenu/index.d.ts.map +1 -0
  101. package/dist/shadcn/shadcnField/field.d.ts +25 -0
  102. package/dist/shadcn/shadcnField/field.d.ts.map +1 -0
  103. package/dist/shadcn/shadcnField/index.d.ts +2 -0
  104. package/dist/shadcn/shadcnField/index.d.ts.map +1 -0
  105. package/dist/shadcn/shadcnForm/form.d.ts +26 -0
  106. package/dist/shadcn/shadcnForm/form.d.ts.map +1 -0
  107. package/dist/shadcn/shadcnForm/index.d.ts +2 -0
  108. package/dist/shadcn/shadcnForm/index.d.ts.map +1 -0
  109. package/dist/shadcn/shadcnInput/Input.d.ts +4 -0
  110. package/dist/shadcn/shadcnInput/Input.d.ts.map +1 -0
  111. package/dist/shadcn/shadcnInput/index.d.ts +2 -0
  112. package/dist/shadcn/shadcnInput/index.d.ts.map +1 -0
  113. package/dist/shadcn/shadcnInputOTP/InputOTP.d.ts +35 -0
  114. package/dist/shadcn/shadcnInputOTP/InputOTP.d.ts.map +1 -0
  115. package/dist/shadcn/shadcnInputOTP/index.d.ts +2 -0
  116. package/dist/shadcn/shadcnInputOTP/index.d.ts.map +1 -0
  117. package/dist/shadcn/shadcnLabel/Label.d.ts +5 -0
  118. package/dist/shadcn/shadcnLabel/Label.d.ts.map +1 -0
  119. package/dist/shadcn/shadcnLabel/index.d.ts +2 -0
  120. package/dist/shadcn/shadcnLabel/index.d.ts.map +1 -0
  121. package/dist/shadcn/shadcnPopover/index.d.ts +2 -0
  122. package/dist/shadcn/shadcnPopover/index.d.ts.map +1 -0
  123. package/dist/shadcn/shadcnPopover/popover.d.ts +7 -0
  124. package/dist/shadcn/shadcnPopover/popover.d.ts.map +1 -0
  125. package/dist/shadcn/shadcnProgress/Progress.d.ts +5 -0
  126. package/dist/shadcn/shadcnProgress/Progress.d.ts.map +1 -0
  127. package/dist/shadcn/shadcnSelect/index.d.ts +2 -0
  128. package/dist/shadcn/shadcnSelect/index.d.ts.map +1 -0
  129. package/dist/shadcn/shadcnSelect/select.d.ts +16 -0
  130. package/dist/shadcn/shadcnSelect/select.d.ts.map +1 -0
  131. package/dist/shadcn/shadcnSeparator/index.d.ts +2 -0
  132. package/dist/shadcn/shadcnSeparator/index.d.ts.map +1 -0
  133. package/dist/shadcn/shadcnSeparator/separator.d.ts +5 -0
  134. package/dist/shadcn/shadcnSeparator/separator.d.ts.map +1 -0
  135. package/dist/shadcn/shadcnSheet/index.d.ts +2 -0
  136. package/dist/shadcn/shadcnSheet/index.d.ts.map +1 -0
  137. package/dist/shadcn/shadcnSheet/sheet.d.ts +23 -0
  138. package/dist/shadcn/shadcnSheet/sheet.d.ts.map +1 -0
  139. package/dist/shadcn/shadcnSkeleton/index.d.ts +2 -0
  140. package/dist/shadcn/shadcnSkeleton/index.d.ts.map +1 -0
  141. package/dist/shadcn/shadcnSkeleton/skeleton.d.ts +4 -0
  142. package/dist/shadcn/shadcnSkeleton/skeleton.d.ts.map +1 -0
  143. package/dist/shadcn/shadcnSpinner/Spinner.d.ts +3 -0
  144. package/dist/shadcn/shadcnSpinner/Spinner.d.ts.map +1 -0
  145. package/dist/shadcn/shadcnSpinner/index.d.ts +2 -0
  146. package/dist/shadcn/shadcnSpinner/index.d.ts.map +1 -0
  147. package/dist/shadcn/shadcnTable/index.d.ts +2 -0
  148. package/dist/shadcn/shadcnTable/index.d.ts.map +1 -0
  149. package/dist/shadcn/shadcnTable/table.d.ts +11 -0
  150. package/dist/shadcn/shadcnTable/table.d.ts.map +1 -0
  151. package/dist/shadcn/shadcnTextarea/index.d.ts +2 -0
  152. package/dist/shadcn/shadcnTextarea/index.d.ts.map +1 -0
  153. package/dist/shadcn/shadcnTextarea/textarea.d.ts +4 -0
  154. package/dist/shadcn/shadcnTextarea/textarea.d.ts.map +1 -0
  155. package/dist/shadcn/shadcnTooltip/index.d.ts +2 -0
  156. package/dist/shadcn/shadcnTooltip/index.d.ts.map +1 -0
  157. package/dist/shadcn/shadcnTooltip/tooltip.d.ts +8 -0
  158. package/dist/shadcn/shadcnTooltip/tooltip.d.ts.map +1 -0
  159. package/dist/shadcn/utils.d.ts +3 -0
  160. package/dist/shadcn/utils.d.ts.map +1 -0
  161. package/dist/utils.js +229 -150
  162. package/dist/utils.js.map +1 -1
  163. package/package.json +48 -48
  164. package/dist/components/Button/Button.d.ts.map +0 -1
  165. package/dist/components/Button/index.d.ts.map +0 -1
  166. package/dist/components/Card/Card.d.ts.map +0 -1
  167. package/dist/components/Card/index.d.ts.map +0 -1
  168. package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
  169. package/dist/components/Checkbox/index.d.ts.map +0 -1
  170. package/dist/components/DatePicker/DatePicker.d.ts.map +0 -1
  171. package/dist/components/DatePicker/index.d.ts.map +0 -1
  172. package/dist/components/Field/index.d.ts.map +0 -1
  173. package/dist/components/Form/Form.d.ts.map +0 -1
  174. package/dist/components/Form/index.d.ts.map +0 -1
  175. package/dist/components/OTPField/OTPField.d.ts.map +0 -1
  176. package/dist/components/OTPField/index.d.ts.map +0 -1
  177. package/dist/components/PasswordField/PasswordField.d.ts.map +0 -1
  178. package/dist/components/PasswordField/index.d.ts.map +0 -1
  179. package/dist/components/PhoneField/PhoneField.d.ts.map +0 -1
  180. package/dist/components/PhoneField/index.d.ts.map +0 -1
  181. package/dist/components/Progress/Progress.d.ts.map +0 -1
  182. package/dist/components/Progress/index.d.ts.map +0 -1
  183. package/dist/components/Skeleton/Skeleton.d.ts.map +0 -1
  184. package/dist/components/Skeleton/index.d.ts.map +0 -1
  185. package/dist/components/Spinner/Spinner.d.ts.map +0 -1
  186. package/dist/components/Spinner/index.d.ts.map +0 -1
  187. package/dist/components/TextArea/TextArea.d.ts.map +0 -1
  188. package/dist/components/TextArea/index.d.ts.map +0 -1
  189. package/dist/components/TextField/TextField.d.ts.map +0 -1
  190. package/dist/components/TextField/index.d.ts.map +0 -1
  191. package/dist/components/ThemeToggle/ThemeToggle.d.ts.map +0 -1
  192. package/dist/components/ThemeToggle/index.d.ts.map +0 -1
  193. package/dist/components/Typography/Typography.d.ts.map +0 -1
  194. package/dist/components/Typography/index.d.ts.map +0 -1
  195. package/dist/components/index.d.ts.map +0 -1
  196. package/dist/config/index.d.ts.map +0 -1
  197. package/dist/index.d.ts.map +0 -1
  198. package/dist/index6.js +0 -246
  199. package/dist/index6.js.map +0 -1
  200. package/dist/utils/axios.d.ts.map +0 -1
  201. package/dist/utils/formHelpers.d.ts.map +0 -1
  202. package/dist/utils/index.d.ts.map +0 -1
  203. /package/dist/{components → lib/components}/Button/index.d.ts +0 -0
  204. /package/dist/{components → lib/components}/Card/Card.d.ts +0 -0
  205. /package/dist/{components → lib/components}/Card/index.d.ts +0 -0
  206. /package/dist/{components → lib/components}/Checkbox/Checkbox.d.ts +0 -0
  207. /package/dist/{components → lib/components}/Checkbox/index.d.ts +0 -0
  208. /package/dist/{components → lib/components}/DatePicker/DatePicker.d.ts +0 -0
  209. /package/dist/{components → lib/components}/DatePicker/index.d.ts +0 -0
  210. /package/dist/{components → lib/components}/Field/index.d.ts +0 -0
  211. /package/dist/{components → lib/components}/Form/Form.d.ts +0 -0
  212. /package/dist/{components → lib/components}/Form/index.d.ts +0 -0
  213. /package/dist/{components → lib/components}/OTPField/index.d.ts +0 -0
  214. /package/dist/{components → lib/components}/PasswordField/PasswordField.d.ts +0 -0
  215. /package/dist/{components → lib/components}/PasswordField/index.d.ts +0 -0
  216. /package/dist/{components → lib/components}/PhoneField/index.d.ts +0 -0
  217. /package/dist/{components → lib/components}/Progress/Progress.d.ts +0 -0
  218. /package/dist/{components → lib/components}/Progress/index.d.ts +0 -0
  219. /package/dist/{components → lib/components}/Skeleton/Skeleton.d.ts +0 -0
  220. /package/dist/{components → lib/components}/Skeleton/index.d.ts +0 -0
  221. /package/dist/{components → lib/components}/Spinner/Spinner.d.ts +0 -0
  222. /package/dist/{components → lib/components}/Spinner/index.d.ts +0 -0
  223. /package/dist/{components → lib/components}/TextArea/TextArea.d.ts +0 -0
  224. /package/dist/{components → lib/components}/TextArea/index.d.ts +0 -0
  225. /package/dist/{components → lib/components}/TextField/TextField.d.ts +0 -0
  226. /package/dist/{components → lib/components}/TextField/index.d.ts +0 -0
  227. /package/dist/{components → lib/components}/ThemeToggle/ThemeToggle.d.ts +0 -0
  228. /package/dist/{components → lib/components}/ThemeToggle/index.d.ts +0 -0
  229. /package/dist/{components → lib/components}/Typography/Typography.d.ts +0 -0
  230. /package/dist/{components → lib/components}/Typography/index.d.ts +0 -0
  231. /package/dist/{components → lib/components}/index.d.ts +0 -0
  232. /package/dist/{config → lib/config}/index.d.ts +0 -0
  233. /package/dist/{index.d.ts → lib/index.d.ts} +0 -0
  234. /package/dist/{utils → lib/utils}/axios.d.ts +0 -0
  235. /package/dist/{utils → lib/utils}/formHelpers.d.ts +0 -0
  236. /package/dist/{utils → lib/utils}/index.d.ts +0 -0
package/dist/index3.js CHANGED
@@ -1,107 +1,5 @@
1
- import * as React from 'react';
2
- import { c as composeRefs } from './index4.js';
3
- import { jsx } from 'react/jsx-runtime';
4
1
  import { a as clsx } from './utils.js';
5
2
 
6
- // src/slot.tsx
7
- var REACT_LAZY_TYPE = Symbol.for("react.lazy");
8
- var use = React[" use ".trim().toString()];
9
- function isPromiseLike(value) {
10
- return typeof value === "object" && value !== null && "then" in value;
11
- }
12
- function isLazyComponent(element) {
13
- return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
14
- }
15
- // @__NO_SIDE_EFFECTS__
16
- function createSlot(ownerName) {
17
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
18
- const Slot2 = React.forwardRef((props, forwardedRef) => {
19
- let { children, ...slotProps } = props;
20
- if (isLazyComponent(children) && typeof use === "function") {
21
- children = use(children._payload);
22
- }
23
- const childrenArray = React.Children.toArray(children);
24
- const slottable = childrenArray.find(isSlottable);
25
- if (slottable) {
26
- const newElement = slottable.props.children;
27
- const newChildren = childrenArray.map((child) => {
28
- if (child === slottable) {
29
- if (React.Children.count(newElement) > 1) return React.Children.only(null);
30
- return React.isValidElement(newElement) ? newElement.props.children : null;
31
- } else {
32
- return child;
33
- }
34
- });
35
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
36
- }
37
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
38
- });
39
- Slot2.displayName = `${ownerName}.Slot`;
40
- return Slot2;
41
- }
42
- var Slot = /* @__PURE__ */ createSlot("Slot");
43
- // @__NO_SIDE_EFFECTS__
44
- function createSlotClone(ownerName) {
45
- const SlotClone = React.forwardRef((props, forwardedRef) => {
46
- let { children, ...slotProps } = props;
47
- if (isLazyComponent(children) && typeof use === "function") {
48
- children = use(children._payload);
49
- }
50
- if (React.isValidElement(children)) {
51
- const childrenRef = getElementRef(children);
52
- const props2 = mergeProps(slotProps, children.props);
53
- if (children.type !== React.Fragment) {
54
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
55
- }
56
- return React.cloneElement(children, props2);
57
- }
58
- return React.Children.count(children) > 1 ? React.Children.only(null) : null;
59
- });
60
- SlotClone.displayName = `${ownerName}.SlotClone`;
61
- return SlotClone;
62
- }
63
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
64
- function isSlottable(child) {
65
- return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
66
- }
67
- function mergeProps(slotProps, childProps) {
68
- const overrideProps = { ...childProps };
69
- for (const propName in childProps) {
70
- const slotPropValue = slotProps[propName];
71
- const childPropValue = childProps[propName];
72
- const isHandler = /^on[A-Z]/.test(propName);
73
- if (isHandler) {
74
- if (slotPropValue && childPropValue) {
75
- overrideProps[propName] = (...args) => {
76
- const result = childPropValue(...args);
77
- slotPropValue(...args);
78
- return result;
79
- };
80
- } else if (slotPropValue) {
81
- overrideProps[propName] = slotPropValue;
82
- }
83
- } else if (propName === "style") {
84
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
85
- } else if (propName === "className") {
86
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
87
- }
88
- }
89
- return { ...slotProps, ...overrideProps };
90
- }
91
- function getElementRef(element) {
92
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
93
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
94
- if (mayWarn) {
95
- return element.ref;
96
- }
97
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
98
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
99
- if (mayWarn) {
100
- return element.props.ref;
101
- }
102
- return element.props.ref || element.ref;
103
- }
104
-
105
3
  const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
106
4
  const cx = clsx;
107
5
  const cva = (base, config)=>(props)=>{
@@ -143,5 +41,5 @@ const cva = (base, config)=>(props)=>{
143
41
  return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
144
42
  };
145
43
 
146
- export { Slot as S, createSlot as a, cva as c };
44
+ export { cva as c };
147
45
  //# sourceMappingURL=index3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index3.js","sources":["../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.1.6_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n"],"names":[],"mappings":";;;;;AAAA;AAIA,IAAI,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AAC9C,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC1C,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,EAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK;AACvE;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KAAK,KAAK;AACjC,YAAY,CAAC,CAAC,GAAG;AACjB,gBAAgB,GAAG,GAAG;AACtB,gBAAgB,OAAO;AACvB,gBAAgB;AAChB,aAAa,GAAG,GAAG;AACnB,QAAQ,CAAC,EAAE,EAAE,CAAC;AACd,QAAQ,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;AACrM,IAAI;;;;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"index3.js","sources":["../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs"],"sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n"],"names":[],"mappings":";;AAeA,MAAM,aAAa,GAAG,CAAC,KAAK,GAAG,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,KAAK;AAC3F,MAAM,EAAE,GAAG,IAAI;AACV,MAAC,GAAG,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,KAAK,GAAG;AAC5C,QAAQ,IAAI,wBAAwB;AACpC,QAAQ,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAA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,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,GAAG;AAC3P,YAAY,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,sBAAsB,EAAE,GAAG,KAAK;AAC7F,YAAY,OAAO,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG;AACzE,gBAAgB,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK;AACxC,gBAAgB,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC;AAC7D,oBAAoB,GAAG,eAAe;AACtC,oBAAoB,GAAG;AACvB,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;AAC3B,oBAAoB,GAAG,eAAe;AACtC,oBAAoB,GAAG;AACvB,iBAAiB,EAAE,GAAG,CAAC,KAAK,KAAK;AACjC,YAAY,CAAC,CAAC,GAAG;AACjB,gBAAgB,GAAG,GAAG;AACtB,gBAAgB,OAAO;AACvB,gBAAgB;AAChB,aAAa,GAAG,GAAG;AACnB,QAAQ,CAAC,EAAE,EAAE,CAAC;AACd,QAAQ,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;AACrM,IAAI;;;;","x_google_ignoreList":[0]}
package/dist/index4.js CHANGED
@@ -1,40 +1,41 @@
1
1
  import * as React from 'react';
2
+ import 'react-dom';
3
+ import { c as createSlot } from './index2.js';
4
+ import { jsx } from 'react/jsx-runtime';
2
5
 
3
- // packages/react/compose-refs/src/compose-refs.tsx
4
- function setRef(ref, value) {
5
- if (typeof ref === "function") {
6
- return ref(value);
7
- } else if (ref !== null && ref !== void 0) {
8
- ref.current = value;
9
- }
10
- }
11
- function composeRefs(...refs) {
12
- return (node) => {
13
- let hasCleanup = false;
14
- const cleanups = refs.map((ref) => {
15
- const cleanup = setRef(ref, node);
16
- if (!hasCleanup && typeof cleanup == "function") {
17
- hasCleanup = true;
18
- }
19
- return cleanup;
20
- });
21
- if (hasCleanup) {
22
- return () => {
23
- for (let i = 0; i < cleanups.length; i++) {
24
- const cleanup = cleanups[i];
25
- if (typeof cleanup == "function") {
26
- cleanup();
27
- } else {
28
- setRef(refs[i], null);
29
- }
30
- }
31
- };
6
+ // src/primitive.tsx
7
+ var NODES = [
8
+ "a",
9
+ "button",
10
+ "div",
11
+ "form",
12
+ "h2",
13
+ "h3",
14
+ "img",
15
+ "input",
16
+ "label",
17
+ "li",
18
+ "nav",
19
+ "ol",
20
+ "p",
21
+ "select",
22
+ "span",
23
+ "svg",
24
+ "ul"
25
+ ];
26
+ var Primitive = NODES.reduce((primitive, node) => {
27
+ const Slot = createSlot(`Primitive.${node}`);
28
+ const Node = React.forwardRef((props, forwardedRef) => {
29
+ const { asChild, ...primitiveProps } = props;
30
+ const Comp = asChild ? Slot : node;
31
+ if (typeof window !== "undefined") {
32
+ window[Symbol.for("radix-ui")] = true;
32
33
  }
33
- };
34
- }
35
- function useComposedRefs(...refs) {
36
- return React.useCallback(composeRefs(...refs), refs);
37
- }
34
+ return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
35
+ });
36
+ Node.displayName = `Primitive.${node}`;
37
+ return { ...primitive, [node]: Node };
38
+ }, {});
38
39
 
39
- export { composeRefs as c, useComposedRefs as u };
40
+ export { Primitive as P };
40
41
  //# sourceMappingURL=index4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index4.js","sources":["../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.6_react@19.1.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA;AAEA,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;AAC5B,EAAE,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AACjC,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC;AACrB,EAAE,CAAC,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE;AAC7C,IAAI,GAAG,CAAC,OAAO,GAAG,KAAK;AACvB,EAAE;AACF;AACA,SAAS,WAAW,CAAC,GAAG,IAAI,EAAE;AAC9B,EAAE,OAAO,CAAC,IAAI,KAAK;AACnB,IAAI,IAAI,UAAU,GAAG,KAAK;AAC1B,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AACvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;AACvC,MAAM,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AACvD,QAAQ,UAAU,GAAG,IAAI;AACzB,MAAM;AACN,MAAM,OAAO,OAAO;AACpB,IAAI,CAAC,CAAC;AACN,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,OAAO,MAAM;AACnB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,UAAU,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AACrC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AAC5C,YAAY,OAAO,EAAE;AACrB,UAAU,CAAC,MAAM;AACjB,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACjC,UAAU;AACV,QAAQ;AACR,MAAM,CAAC;AACP,IAAI;AACJ,EAAE,CAAC;AACH;AACA,SAAS,eAAe,CAAC,GAAG,IAAI,EAAE;AAClC,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC;AACtD;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index4.js","sources":["../node_modules/.pnpm/@radix-ui+react-primitive@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.9__@types+rea_80b0e86615c8e72f2e6ad5b837a6e15c/node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;;AAAA;AAKA,IAAI,KAAK,GAAG;AACZ,EAAE,GAAG;AACL,EAAE,QAAQ;AACV,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,IAAI;AACN,EAAE,KAAK;AACP,EAAE,OAAO;AACT,EAAE,OAAO;AACT,EAAE,IAAI;AACN,EAAE,KAAK;AACP,EAAE,IAAI;AACN,EAAE,GAAG;AACL,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,KAAK;AACP,EAAE;AACF,CAAC;AACE,IAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,IAAI,KAAK;AAClD,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9C,EAAE,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK;AACzD,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,GAAG,KAAK;AAChD,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI;AACtC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI;AAC3C,IAAI;AACJ,IAAI,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAC9E,EAAE,CAAC,CAAC;AACJ,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACxC,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC,IAAI,GAAG,IAAI,EAAE;AACvC,CAAC,EAAE,EAAE;;;;","x_google_ignoreList":[0]}
package/dist/index5.js CHANGED
@@ -1,7 +1,307 @@
1
1
  import * as React from 'react';
2
- import * as ReactDOM from 'react-dom';
3
- import { c as composeRefs } from './index4.js';
4
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { u as useComposedRefs, a as composeRefs } from './index2.js';
4
+ import * as ReactDOM from 'react-dom';
5
+
6
+ // packages/react/context/src/create-context.tsx
7
+ function createContextScope(scopeName, createContextScopeDeps = []) {
8
+ let defaultContexts = [];
9
+ function createContext3(rootComponentName, defaultContext) {
10
+ const BaseContext = React.createContext(defaultContext);
11
+ const index = defaultContexts.length;
12
+ defaultContexts = [...defaultContexts, defaultContext];
13
+ const Provider = (props) => {
14
+ const { scope, children, ...context } = props;
15
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
16
+ const value = React.useMemo(() => context, Object.values(context));
17
+ return /* @__PURE__ */ jsx(Context.Provider, { value, children });
18
+ };
19
+ Provider.displayName = rootComponentName + "Provider";
20
+ function useContext2(consumerName, scope) {
21
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
22
+ const context = React.useContext(Context);
23
+ if (context) return context;
24
+ if (defaultContext !== void 0) return defaultContext;
25
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
26
+ }
27
+ return [Provider, useContext2];
28
+ }
29
+ const createScope = () => {
30
+ const scopeContexts = defaultContexts.map((defaultContext) => {
31
+ return React.createContext(defaultContext);
32
+ });
33
+ return function useScope(scope) {
34
+ const contexts = scope?.[scopeName] || scopeContexts;
35
+ return React.useMemo(
36
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
37
+ [scope, contexts]
38
+ );
39
+ };
40
+ };
41
+ createScope.scopeName = scopeName;
42
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
43
+ }
44
+ function composeContextScopes(...scopes) {
45
+ const baseScope = scopes[0];
46
+ if (scopes.length === 1) return baseScope;
47
+ const createScope = () => {
48
+ const scopeHooks = scopes.map((createScope2) => ({
49
+ useScope: createScope2(),
50
+ scopeName: createScope2.scopeName
51
+ }));
52
+ return function useComposedScopes(overrideScopes) {
53
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
54
+ const scopeProps = useScope(overrideScopes);
55
+ const currentScope = scopeProps[`__scope${scopeName}`];
56
+ return { ...nextScopes2, ...currentScope };
57
+ }, {});
58
+ return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
59
+ };
60
+ };
61
+ createScope.scopeName = baseScope.scopeName;
62
+ return createScope;
63
+ }
64
+
65
+ // src/primitive.tsx
66
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
67
+ return function handleEvent(event) {
68
+ originalEventHandler?.(event);
69
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
70
+ return ourEventHandler?.(event);
71
+ }
72
+ };
73
+ }
74
+
75
+ // packages/react/use-layout-effect/src/use-layout-effect.tsx
76
+ var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
77
+ };
78
+
79
+ // src/use-controllable-state.tsx
80
+ var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
81
+ function useControllableState({
82
+ prop,
83
+ defaultProp,
84
+ onChange = () => {
85
+ },
86
+ caller
87
+ }) {
88
+ const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
89
+ defaultProp,
90
+ onChange
91
+ });
92
+ const isControlled = prop !== void 0;
93
+ const value = isControlled ? prop : uncontrolledProp;
94
+ {
95
+ const isControlledRef = React.useRef(prop !== void 0);
96
+ React.useEffect(() => {
97
+ const wasControlled = isControlledRef.current;
98
+ if (wasControlled !== isControlled) {
99
+ const from = wasControlled ? "controlled" : "uncontrolled";
100
+ const to = isControlled ? "controlled" : "uncontrolled";
101
+ console.warn(
102
+ `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
103
+ );
104
+ }
105
+ isControlledRef.current = isControlled;
106
+ }, [isControlled, caller]);
107
+ }
108
+ const setValue = React.useCallback(
109
+ (nextValue) => {
110
+ if (isControlled) {
111
+ const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
112
+ if (value2 !== prop) {
113
+ onChangeRef.current?.(value2);
114
+ }
115
+ } else {
116
+ setUncontrolledProp(nextValue);
117
+ }
118
+ },
119
+ [isControlled, prop, setUncontrolledProp, onChangeRef]
120
+ );
121
+ return [value, setValue];
122
+ }
123
+ function useUncontrolledState({
124
+ defaultProp,
125
+ onChange
126
+ }) {
127
+ const [value, setValue] = React.useState(defaultProp);
128
+ const prevValueRef = React.useRef(value);
129
+ const onChangeRef = React.useRef(onChange);
130
+ useInsertionEffect(() => {
131
+ onChangeRef.current = onChange;
132
+ }, [onChange]);
133
+ React.useEffect(() => {
134
+ if (prevValueRef.current !== value) {
135
+ onChangeRef.current?.(value);
136
+ prevValueRef.current = value;
137
+ }
138
+ }, [value, prevValueRef]);
139
+ return [value, setValue, onChangeRef];
140
+ }
141
+ function isFunction(value) {
142
+ return typeof value === "function";
143
+ }
144
+
145
+ // packages/react/use-size/src/use-size.tsx
146
+ function useSize(element) {
147
+ const [size, setSize] = React.useState(void 0);
148
+ useLayoutEffect2(() => {
149
+ if (element) {
150
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
151
+ const resizeObserver = new ResizeObserver((entries) => {
152
+ if (!Array.isArray(entries)) {
153
+ return;
154
+ }
155
+ if (!entries.length) {
156
+ return;
157
+ }
158
+ const entry = entries[0];
159
+ let width;
160
+ let height;
161
+ if ("borderBoxSize" in entry) {
162
+ const borderSizeEntry = entry["borderBoxSize"];
163
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
164
+ width = borderSize["inlineSize"];
165
+ height = borderSize["blockSize"];
166
+ } else {
167
+ width = element.offsetWidth;
168
+ height = element.offsetHeight;
169
+ }
170
+ setSize({ width, height });
171
+ });
172
+ resizeObserver.observe(element, { box: "border-box" });
173
+ return () => resizeObserver.unobserve(element);
174
+ } else {
175
+ setSize(void 0);
176
+ }
177
+ }, [element]);
178
+ return size;
179
+ }
180
+
181
+ function useStateMachine(initialState, machine) {
182
+ return React.useReducer((state, event) => {
183
+ const nextState = machine[state][event];
184
+ return nextState ?? state;
185
+ }, initialState);
186
+ }
187
+
188
+ // src/presence.tsx
189
+ var Presence = (props) => {
190
+ const { present, children } = props;
191
+ const presence = usePresence(present);
192
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
193
+ const ref = useComposedRefs(presence.ref, getElementRef$1(child));
194
+ const forceMount = typeof children === "function";
195
+ return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
196
+ };
197
+ Presence.displayName = "Presence";
198
+ function usePresence(present) {
199
+ const [node, setNode] = React.useState();
200
+ const stylesRef = React.useRef(null);
201
+ const prevPresentRef = React.useRef(present);
202
+ const prevAnimationNameRef = React.useRef("none");
203
+ const initialState = present ? "mounted" : "unmounted";
204
+ const [state, send] = useStateMachine(initialState, {
205
+ mounted: {
206
+ UNMOUNT: "unmounted",
207
+ ANIMATION_OUT: "unmountSuspended"
208
+ },
209
+ unmountSuspended: {
210
+ MOUNT: "mounted",
211
+ ANIMATION_END: "unmounted"
212
+ },
213
+ unmounted: {
214
+ MOUNT: "mounted"
215
+ }
216
+ });
217
+ React.useEffect(() => {
218
+ const currentAnimationName = getAnimationName(stylesRef.current);
219
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
220
+ }, [state]);
221
+ useLayoutEffect2(() => {
222
+ const styles = stylesRef.current;
223
+ const wasPresent = prevPresentRef.current;
224
+ const hasPresentChanged = wasPresent !== present;
225
+ if (hasPresentChanged) {
226
+ const prevAnimationName = prevAnimationNameRef.current;
227
+ const currentAnimationName = getAnimationName(styles);
228
+ if (present) {
229
+ send("MOUNT");
230
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
231
+ send("UNMOUNT");
232
+ } else {
233
+ const isAnimating = prevAnimationName !== currentAnimationName;
234
+ if (wasPresent && isAnimating) {
235
+ send("ANIMATION_OUT");
236
+ } else {
237
+ send("UNMOUNT");
238
+ }
239
+ }
240
+ prevPresentRef.current = present;
241
+ }
242
+ }, [present, send]);
243
+ useLayoutEffect2(() => {
244
+ if (node) {
245
+ let timeoutId;
246
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
247
+ const handleAnimationEnd = (event) => {
248
+ const currentAnimationName = getAnimationName(stylesRef.current);
249
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
250
+ if (event.target === node && isCurrentAnimation) {
251
+ send("ANIMATION_END");
252
+ if (!prevPresentRef.current) {
253
+ const currentFillMode = node.style.animationFillMode;
254
+ node.style.animationFillMode = "forwards";
255
+ timeoutId = ownerWindow.setTimeout(() => {
256
+ if (node.style.animationFillMode === "forwards") {
257
+ node.style.animationFillMode = currentFillMode;
258
+ }
259
+ });
260
+ }
261
+ }
262
+ };
263
+ const handleAnimationStart = (event) => {
264
+ if (event.target === node) {
265
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
266
+ }
267
+ };
268
+ node.addEventListener("animationstart", handleAnimationStart);
269
+ node.addEventListener("animationcancel", handleAnimationEnd);
270
+ node.addEventListener("animationend", handleAnimationEnd);
271
+ return () => {
272
+ ownerWindow.clearTimeout(timeoutId);
273
+ node.removeEventListener("animationstart", handleAnimationStart);
274
+ node.removeEventListener("animationcancel", handleAnimationEnd);
275
+ node.removeEventListener("animationend", handleAnimationEnd);
276
+ };
277
+ } else {
278
+ send("ANIMATION_END");
279
+ }
280
+ }, [node, send]);
281
+ return {
282
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
283
+ ref: React.useCallback((node2) => {
284
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
285
+ setNode(node2);
286
+ }, [])
287
+ };
288
+ }
289
+ function getAnimationName(styles) {
290
+ return styles?.animationName || "none";
291
+ }
292
+ function getElementRef$1(element) {
293
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
294
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
295
+ if (mayWarn) {
296
+ return element.ref;
297
+ }
298
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
299
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
300
+ if (mayWarn) {
301
+ return element.props.ref;
302
+ }
303
+ return element.props.ref || element.ref;
304
+ }
5
305
 
6
306
  // src/slot.tsx
7
307
  // @__NO_SIDE_EFFECTS__
@@ -124,5 +424,5 @@ function dispatchDiscreteCustomEvent(target, event) {
124
424
  if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
125
425
  }
126
426
 
127
- export { Primitive as P, createSlot as c, dispatchDiscreteCustomEvent as d };
427
+ export { Presence as P, Primitive as a, composeEventHandlers as b, createContextScope as c, useSize as d, dispatchDiscreteCustomEvent as e, useLayoutEffect2 as f, createSlot as g, useControllableState as u };
128
428
  //# sourceMappingURL=index5.js.map