@vritti/quantum-ui 0.4.0 → 0.4.1

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 (98) hide show
  1. package/dist/Avatar.js +5 -5
  2. package/dist/Checkbox.js +16 -11
  3. package/dist/Checkbox.js.map +1 -1
  4. package/dist/Checkbox2.js +4 -5
  5. package/dist/Checkbox2.js.map +1 -1
  6. package/dist/Combination.js +1 -1
  7. package/dist/Dialog.js +1 -1
  8. package/dist/Progress.js +2 -2
  9. package/dist/RadioGroup.js +4 -5
  10. package/dist/RadioGroup.js.map +1 -1
  11. package/dist/Sidebar.js +1 -1
  12. package/dist/Sonner.js +1 -1
  13. package/dist/Switch.js +19 -14
  14. package/dist/Switch.js.map +1 -1
  15. package/dist/TabsSkeleton.js +1 -1
  16. package/dist/Toggle.js +1 -1
  17. package/dist/assets/quantum-ui.css +1 -1
  18. package/dist/components/RichTextEditor.js +1 -1
  19. package/dist/components/TreeView.js +2 -3
  20. package/dist/components/TreeView.js.map +1 -1
  21. package/dist/disabledTip.js +13 -0
  22. package/dist/disabledTip.js.map +1 -0
  23. package/dist/dropdown-menu.js +5 -7
  24. package/dist/dropdown-menu.js.map +1 -1
  25. package/dist/image-component.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index13.js +4 -6
  28. package/dist/index13.js.map +1 -1
  29. package/dist/index14.js +3 -5
  30. package/dist/index14.js.map +1 -1
  31. package/dist/index15.js +8 -9
  32. package/dist/index15.js.map +1 -1
  33. package/dist/index16.js +1 -1
  34. package/dist/index17.js +1 -1
  35. package/dist/index19.js +2 -4
  36. package/dist/index19.js.map +1 -1
  37. package/dist/index20.js +1 -1
  38. package/dist/index21.js +139 -1
  39. package/dist/index21.js.map +1 -1
  40. package/dist/index22.js +3 -4
  41. package/dist/index22.js.map +1 -1
  42. package/dist/index23.js +70 -122
  43. package/dist/index23.js.map +1 -1
  44. package/dist/index24.js +1128 -70
  45. package/dist/index24.js.map +1 -1
  46. package/dist/index25.js +231 -11
  47. package/dist/index25.js.map +1 -1
  48. package/dist/index26.js +2509 -1106
  49. package/dist/index26.js.map +1 -1
  50. package/dist/index27.js +23 -223
  51. package/dist/index27.js.map +1 -1
  52. package/dist/index28.js +3 -2535
  53. package/dist/index28.js.map +1 -1
  54. package/dist/index29.js +36 -31
  55. package/dist/index29.js.map +1 -1
  56. package/dist/index30.js +308 -3
  57. package/dist/index30.js.map +1 -1
  58. package/dist/index31.js +8 -36
  59. package/dist/index31.js.map +1 -1
  60. package/dist/index32.js +25 -305
  61. package/dist/index32.js.map +1 -1
  62. package/dist/index33.js +60 -8
  63. package/dist/index33.js.map +1 -1
  64. package/dist/index34.js +11 -30
  65. package/dist/index34.js.map +1 -1
  66. package/dist/index35.js +35 -59
  67. package/dist/index35.js.map +1 -1
  68. package/dist/index36.js +35348 -9
  69. package/dist/index36.js.map +1 -1
  70. package/dist/index37.js +79 -36
  71. package/dist/index37.js.map +1 -1
  72. package/dist/index38.js +184 -35341
  73. package/dist/index38.js.map +1 -1
  74. package/dist/index5.js +2 -4
  75. package/dist/index5.js.map +1 -1
  76. package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -0
  77. package/dist/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  78. package/dist/lib/components/Switch/Switch.d.ts +4 -1
  79. package/dist/lib/components/Switch/Switch.d.ts.map +1 -1
  80. package/dist/lib/selects/permission-group/PermissionGroupSelector.d.ts +4 -0
  81. package/dist/lib/selects/permission-group/PermissionGroupSelector.d.ts.map +1 -0
  82. package/dist/lib/selects/permission-group/index.d.ts +2 -0
  83. package/dist/lib/selects/permission-group/index.d.ts.map +1 -0
  84. package/dist/lib/types/catalog-resolver.d.ts +18 -6
  85. package/dist/lib/types/catalog-resolver.d.ts.map +1 -1
  86. package/dist/lib/utils/disabledTip.d.ts +3 -0
  87. package/dist/lib/utils/disabledTip.d.ts.map +1 -0
  88. package/dist/selects/permission-group.js +21 -0
  89. package/dist/selects/permission-group.js.map +1 -0
  90. package/dist/types/catalog-resolver.js +1 -1
  91. package/dist/types/catalog-resolver.js.map +1 -1
  92. package/dist/utils/motion.js +2 -2
  93. package/dist/value.js +1 -1
  94. package/package.json +5 -1
  95. package/dist/index39.js +0 -84
  96. package/dist/index39.js.map +0 -1
  97. package/dist/index40.js +0 -199
  98. package/dist/index40.js.map +0 -1
package/dist/index30.js CHANGED
@@ -1,8 +1,313 @@
1
1
  import * as React from 'react';
2
+ import { u as useControllableState, P as Primitive, c as composeEventHandlers, b as createSlot } from './index20.js';
3
+ import { u as useComposedRefs } from './index12.js';
4
+ import { u as useId, P as Presence, c as createContextScope, a as createContext2 } from './index21.js';
5
+ import { P as Portal$1, D as DismissableLayer } from './index25.js';
6
+ import { h as hideOthers, R as ReactRemoveScroll, u as useFocusGuards, F as FocusScope } from './Combination.js';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
8
 
3
- // packages/react/use-layout-effect/src/use-layout-effect.tsx
4
- var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
9
+ var DIALOG_NAME = "Dialog";
10
+ var [createDialogContext] = createContextScope(DIALOG_NAME);
11
+ var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
12
+ var Dialog = (props) => {
13
+ const {
14
+ __scopeDialog,
15
+ children,
16
+ open: openProp,
17
+ defaultOpen,
18
+ onOpenChange,
19
+ modal = true
20
+ } = props;
21
+ const triggerRef = React.useRef(null);
22
+ const contentRef = React.useRef(null);
23
+ const [open, setOpen] = useControllableState({
24
+ prop: openProp,
25
+ defaultProp: defaultOpen ?? false,
26
+ onChange: onOpenChange,
27
+ caller: DIALOG_NAME
28
+ });
29
+ return /* @__PURE__ */ jsx(
30
+ DialogProvider,
31
+ {
32
+ scope: __scopeDialog,
33
+ triggerRef,
34
+ contentRef,
35
+ contentId: useId(),
36
+ titleId: useId(),
37
+ descriptionId: useId(),
38
+ open,
39
+ onOpenChange: setOpen,
40
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
41
+ modal,
42
+ children
43
+ }
44
+ );
5
45
  };
46
+ Dialog.displayName = DIALOG_NAME;
47
+ var TRIGGER_NAME = "DialogTrigger";
48
+ var DialogTrigger = React.forwardRef(
49
+ (props, forwardedRef) => {
50
+ const { __scopeDialog, ...triggerProps } = props;
51
+ const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
52
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
53
+ return /* @__PURE__ */ jsx(
54
+ Primitive.button,
55
+ {
56
+ type: "button",
57
+ "aria-haspopup": "dialog",
58
+ "aria-expanded": context.open,
59
+ "aria-controls": context.contentId,
60
+ "data-state": getState(context.open),
61
+ ...triggerProps,
62
+ ref: composedTriggerRef,
63
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
64
+ }
65
+ );
66
+ }
67
+ );
68
+ DialogTrigger.displayName = TRIGGER_NAME;
69
+ var PORTAL_NAME = "DialogPortal";
70
+ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
71
+ forceMount: void 0
72
+ });
73
+ var DialogPortal = (props) => {
74
+ const { __scopeDialog, forceMount, children, container } = props;
75
+ const context = useDialogContext(PORTAL_NAME, __scopeDialog);
76
+ return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$1, { asChild: true, container, children: child }) })) });
77
+ };
78
+ DialogPortal.displayName = PORTAL_NAME;
79
+ var OVERLAY_NAME = "DialogOverlay";
80
+ var DialogOverlay = React.forwardRef(
81
+ (props, forwardedRef) => {
82
+ const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
83
+ const { forceMount = portalContext.forceMount, ...overlayProps } = props;
84
+ const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
85
+ return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
86
+ }
87
+ );
88
+ DialogOverlay.displayName = OVERLAY_NAME;
89
+ var Slot = createSlot("DialogOverlay.RemoveScroll");
90
+ var DialogOverlayImpl = React.forwardRef(
91
+ (props, forwardedRef) => {
92
+ const { __scopeDialog, ...overlayProps } = props;
93
+ const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
94
+ return (
95
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
96
+ // ie. when `Overlay` and `Content` are siblings
97
+ /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
98
+ Primitive.div,
99
+ {
100
+ "data-state": getState(context.open),
101
+ ...overlayProps,
102
+ ref: forwardedRef,
103
+ style: { pointerEvents: "auto", ...overlayProps.style }
104
+ }
105
+ ) })
106
+ );
107
+ }
108
+ );
109
+ var CONTENT_NAME = "DialogContent";
110
+ var DialogContent = React.forwardRef(
111
+ (props, forwardedRef) => {
112
+ const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
113
+ const { forceMount = portalContext.forceMount, ...contentProps } = props;
114
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
115
+ return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
116
+ }
117
+ );
118
+ DialogContent.displayName = CONTENT_NAME;
119
+ var DialogContentModal = React.forwardRef(
120
+ (props, forwardedRef) => {
121
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
122
+ const contentRef = React.useRef(null);
123
+ const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
124
+ React.useEffect(() => {
125
+ const content = contentRef.current;
126
+ if (content) return hideOthers(content);
127
+ }, []);
128
+ return /* @__PURE__ */ jsx(
129
+ DialogContentImpl,
130
+ {
131
+ ...props,
132
+ ref: composedRefs,
133
+ trapFocus: context.open,
134
+ disableOutsidePointerEvents: true,
135
+ onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
136
+ event.preventDefault();
137
+ context.triggerRef.current?.focus();
138
+ }),
139
+ onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
140
+ const originalEvent = event.detail.originalEvent;
141
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
142
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
143
+ if (isRightClick) event.preventDefault();
144
+ }),
145
+ onFocusOutside: composeEventHandlers(
146
+ props.onFocusOutside,
147
+ (event) => event.preventDefault()
148
+ )
149
+ }
150
+ );
151
+ }
152
+ );
153
+ var DialogContentNonModal = React.forwardRef(
154
+ (props, forwardedRef) => {
155
+ const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
156
+ const hasInteractedOutsideRef = React.useRef(false);
157
+ const hasPointerDownOutsideRef = React.useRef(false);
158
+ return /* @__PURE__ */ jsx(
159
+ DialogContentImpl,
160
+ {
161
+ ...props,
162
+ ref: forwardedRef,
163
+ trapFocus: false,
164
+ disableOutsidePointerEvents: false,
165
+ onCloseAutoFocus: (event) => {
166
+ props.onCloseAutoFocus?.(event);
167
+ if (!event.defaultPrevented) {
168
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
169
+ event.preventDefault();
170
+ }
171
+ hasInteractedOutsideRef.current = false;
172
+ hasPointerDownOutsideRef.current = false;
173
+ },
174
+ onInteractOutside: (event) => {
175
+ props.onInteractOutside?.(event);
176
+ if (!event.defaultPrevented) {
177
+ hasInteractedOutsideRef.current = true;
178
+ if (event.detail.originalEvent.type === "pointerdown") {
179
+ hasPointerDownOutsideRef.current = true;
180
+ }
181
+ }
182
+ const target = event.target;
183
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
184
+ if (targetIsTrigger) event.preventDefault();
185
+ if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
186
+ event.preventDefault();
187
+ }
188
+ }
189
+ }
190
+ );
191
+ }
192
+ );
193
+ var DialogContentImpl = React.forwardRef(
194
+ (props, forwardedRef) => {
195
+ const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
196
+ const context = useDialogContext(CONTENT_NAME, __scopeDialog);
197
+ const contentRef = React.useRef(null);
198
+ const composedRefs = useComposedRefs(forwardedRef, contentRef);
199
+ useFocusGuards();
200
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
201
+ /* @__PURE__ */ jsx(
202
+ FocusScope,
203
+ {
204
+ asChild: true,
205
+ loop: true,
206
+ trapped: trapFocus,
207
+ onMountAutoFocus: onOpenAutoFocus,
208
+ onUnmountAutoFocus: onCloseAutoFocus,
209
+ children: /* @__PURE__ */ jsx(
210
+ DismissableLayer,
211
+ {
212
+ role: "dialog",
213
+ id: context.contentId,
214
+ "aria-describedby": context.descriptionId,
215
+ "aria-labelledby": context.titleId,
216
+ "data-state": getState(context.open),
217
+ ...contentProps,
218
+ ref: composedRefs,
219
+ onDismiss: () => context.onOpenChange(false)
220
+ }
221
+ )
222
+ }
223
+ ),
224
+ /* @__PURE__ */ jsxs(Fragment, { children: [
225
+ /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),
226
+ /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
227
+ ] })
228
+ ] });
229
+ }
230
+ );
231
+ var TITLE_NAME = "DialogTitle";
232
+ var DialogTitle = React.forwardRef(
233
+ (props, forwardedRef) => {
234
+ const { __scopeDialog, ...titleProps } = props;
235
+ const context = useDialogContext(TITLE_NAME, __scopeDialog);
236
+ return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
237
+ }
238
+ );
239
+ DialogTitle.displayName = TITLE_NAME;
240
+ var DESCRIPTION_NAME = "DialogDescription";
241
+ var DialogDescription = React.forwardRef(
242
+ (props, forwardedRef) => {
243
+ const { __scopeDialog, ...descriptionProps } = props;
244
+ const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
245
+ return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
246
+ }
247
+ );
248
+ DialogDescription.displayName = DESCRIPTION_NAME;
249
+ var CLOSE_NAME = "DialogClose";
250
+ var DialogClose = React.forwardRef(
251
+ (props, forwardedRef) => {
252
+ const { __scopeDialog, ...closeProps } = props;
253
+ const context = useDialogContext(CLOSE_NAME, __scopeDialog);
254
+ return /* @__PURE__ */ jsx(
255
+ Primitive.button,
256
+ {
257
+ type: "button",
258
+ ...closeProps,
259
+ ref: forwardedRef,
260
+ onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
261
+ }
262
+ );
263
+ }
264
+ );
265
+ DialogClose.displayName = CLOSE_NAME;
266
+ function getState(open) {
267
+ return open ? "open" : "closed";
268
+ }
269
+ var TITLE_WARNING_NAME = "DialogTitleWarning";
270
+ var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
271
+ contentName: CONTENT_NAME,
272
+ titleName: TITLE_NAME,
273
+ docsSlug: "dialog"
274
+ });
275
+ var TitleWarning = ({ titleId }) => {
276
+ const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
277
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
278
+
279
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
280
+
281
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
282
+ React.useEffect(() => {
283
+ if (titleId) {
284
+ const hasTitle = document.getElementById(titleId);
285
+ if (!hasTitle) console.error(MESSAGE);
286
+ }
287
+ }, [MESSAGE, titleId]);
288
+ return null;
289
+ };
290
+ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
291
+ var DescriptionWarning = ({ contentRef, descriptionId }) => {
292
+ const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
293
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
294
+ React.useEffect(() => {
295
+ const describedById = contentRef.current?.getAttribute("aria-describedby");
296
+ if (descriptionId && describedById) {
297
+ const hasDescription = document.getElementById(descriptionId);
298
+ if (!hasDescription) console.warn(MESSAGE);
299
+ }
300
+ }, [MESSAGE, contentRef, descriptionId]);
301
+ return null;
302
+ };
303
+ var Root = Dialog;
304
+ var Trigger = DialogTrigger;
305
+ var Portal = DialogPortal;
306
+ var Overlay = DialogOverlay;
307
+ var Content = DialogContent;
308
+ var Title = DialogTitle;
309
+ var Description = DialogDescription;
310
+ var Close = DialogClose;
6
311
 
7
- export { useLayoutEffect2 as u };
312
+ export { Content as C, Description as D, Overlay as O, Portal as P, Root as R, Trigger as T, Close as a, Title as b };
8
313
  //# sourceMappingURL=index30.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index30.js","sources":["../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs"],"sourcesContent":["// packages/react/use-layout-effect/src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA;AAEG,IAAC,gBAAgB,GAAG,UAAU,EAAE,QAAQ,GAAG,KAAK,CAAC,eAAe,GAAG,MAAM;AAC5E;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index30.js","sources":["../node_modules/.pnpm/@radix-ui+react-dialog@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.14__@types+reac_759603dcb12523e99413fb21d5cebc08/node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PortalPrimitive","RemoveScroll","createContext"],"mappings":";;;;;;;;AAmBA,IAAI,WAAW,GAAG,QAAQ;AAC1B,IAAI,CAAC,mBAAsC,CAAC,GAAG,kBAAkB,CAAC,WAAW,CAAC;AAC9E,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,mBAAmB,CAAC,WAAW,CAAC;AACzE,IAAI,MAAM,GAAG,CAAC,KAAK,KAA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nE,MAAM,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;AAChD,IAAI;AACJ,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;AAC1C,EAAE,OAAO,IAAI;AACb,CAAC;AACE,IAAC,IAAI,GAAG;AACR,IAAC,OAAO,GAAG;AACX,IAAC,MAAM,GAAG;AACV,IAAC,OAAO,GAAG;AACX,IAAC,OAAO,GAAG;AACX,IAAC,KAAK,GAAG;AACT,IAAC,WAAW,GAAG;AACf,IAAC,KAAK,GAAG;;;;","x_google_ignoreList":[0]}
package/dist/index31.js CHANGED
@@ -1,41 +1,13 @@
1
1
  import * as React from 'react';
2
- import 'react-dom';
3
- import { c as createSlot } from './index10.js';
4
- import { jsx } from 'react/jsx-runtime';
5
2
 
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;
33
- }
34
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
3
+ // packages/react/use-callback-ref/src/use-callback-ref.tsx
4
+ function useCallbackRef(callback) {
5
+ const callbackRef = React.useRef(callback);
6
+ React.useEffect(() => {
7
+ callbackRef.current = callback;
35
8
  });
36
- Node.displayName = `Primitive.${node}`;
37
- return { ...primitive, [node]: Node };
38
- }, {});
9
+ return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
10
+ }
39
11
 
40
- export { Primitive as P };
12
+ export { useCallbackRef as u };
41
13
  //# sourceMappingURL=index31.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index31.js","sources":["../node_modules/.pnpm/@radix-ui+react-primitive@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_e693d0774db9e4b0810d0a29698def24/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]}
1
+ {"version":3,"file":"index31.js","sources":["../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/react/use-callback-ref/src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA;AAEA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5C,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,WAAW,CAAC,OAAO,GAAG,QAAQ;AAClC,EAAE,CAAC,CAAC;AACJ,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,WAAW,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC7E;;;;","x_google_ignoreList":[0]}