@radix-ui/react-dialog 0.1.8-rc.1 → 0.1.8-rc.12

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.
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { RemoveScroll } from "react-remove-scroll";
8
8
  export const createDialogScope: import("@radix-ui/react-context").CreateScope;
9
9
  type RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;
10
10
  export interface DialogProps {
11
+ children?: React.ReactNode;
11
12
  open?: boolean;
12
13
  defaultOpen?: boolean;
13
14
  onOpenChange?(open: boolean): void;
@@ -16,7 +17,6 @@ export interface DialogProps {
16
17
  * @see https://github.com/theKashey/react-remove-scroll#usage
17
18
  */
18
19
  allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];
19
- children?: React.ReactNode;
20
20
  }
21
21
  export const Dialog: React.FC<DialogProps>;
22
22
  type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
@@ -1 +1 @@
1
- {"mappings":"A;A;A;A;A;A;A;AA0BA,OAAA,wFAAgF,CAAC;AAiBjF,yBAAyB,MAAM,cAAc,CAAC,mBAAmB,CAAC,CAAC;AACnE;IACE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;A;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;CAC5B;AAED,OAAA,MAAM,QAAQ,MAAM,EAAE,CAAC,WAAW,CAmCjC,CAAC;AAWF,4BAA4B,MAAM,wBAAwB,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC;AACpF,mCAA6B,SAAQ,oBAAoB;CAAG;AAE5D,OAAA,MAAM,2GAkBL,CAA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AAC;AAWF,+BAA+B,MAAM,wBAAwB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAClF,uCAAiC,SAAQ,uBAAuB;CAAG;AAEnE,OAAA,MAAM,sHAML,CAAC;AAWF,iCAA2B,SAAQ,oBAAoB;CAAG;AAE1D,OAAA,MAAM,uGAaL,CAAC;AAYF,OAAA;A;A;A;A;A;A;A;A;CAIE,CAAC;AA8CH,OAAA,MAAM,2BAAa,CAAC;AACpB,OAAA,MAAM,qGAAuB,CAAC;AAC9B,OAAA,MAAM,mCAAqB,CAAC;AAC5B,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,kGAAmB,CAAC;AAC1B,OAAA,MAAM,gHAA+B,CAAC;AACtC,OAAA,MAAM,iGAAmB,CAAC","sources":["./packages/react/dialog/src/packages/react/dialog/src/Dialog.tsx","./packages/react/dialog/src/packages/react/dialog/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"index.d.ts.map"}
1
+ {"mappings":";;;;;;;AA0BA,OAAA,wFAAgF,CAAC;AAiBjF,yBAAyB,MAAM,cAAc,CAAC,mBAAmB,CAAC,CAAC;AACnE;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAED,OAAA,MAAM,QAAQ,MAAM,EAAE,CAAC,WAAW,CAmCjC,CAAC;AAWF,4BAA4B,MAAM,wBAAwB,CAAC,OAAO,UAAU,MAAM,CAAC,CAAC;AACpF,mCAA6B,SAAQ,oBAAoB;CAAG;AAE5D,OAAA,MAAM,2GAkBL,CAAC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B,MAAM,wBAAwB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAClF,uCAAiC,SAAQ,uBAAuB;CAAG;AAEnE,OAAA,MAAM,sHAML,CAAC;AAWF,iCAA2B,SAAQ,oBAAoB;CAAG;AAE1D,OAAA,MAAM,uGAaL,CAAC;AAYF,OAAA;;;;;;;;;CAIE,CAAC;AA8CH,OAAA,MAAM,2BAAa,CAAC;AACpB,OAAA,MAAM,qGAAuB,CAAC;AAC9B,OAAA,MAAM,mCAAqB,CAAC;AAC5B,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,kGAAmB,CAAC;AAC1B,OAAA,MAAM,gHAA+B,CAAC;AACtC,OAAA,MAAM,iGAAmB,CAAC","sources":["packages/react/dialog/src/packages/react/dialog/src/Dialog.tsx","packages/react/dialog/src/packages/react/dialog/src/index.ts","packages/react/dialog/src/index.ts"],"sourcesContent":[null,null,"export * from './Dialog';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
package/dist/index.js CHANGED
@@ -1,2 +1,402 @@
1
- var e,o,t,r=require("@radix-ui/react-slot").Slot,n=require("aria-hidden").hideOthers,a=require("react-remove-scroll").RemoveScroll,i=require("@radix-ui/react-focus-guards").useFocusGuards,l=require("@radix-ui/react-primitive").Primitive,s=require("@radix-ui/react-presence").Presence,c=require("@radix-ui/react-portal").UnstablePortal,u=require("@radix-ui/react-focus-scope").FocusScope,d=require("@radix-ui/react-dismissable-layer").DismissableLayer,p=require("@radix-ui/react-use-controllable-state").useControllableState,g=require("@radix-ui/react-id").useId,f=require("@radix-ui/react-context"),D=f.createContext,m=f.createContextScope,v=require("@radix-ui/react-compose-refs").useComposedRefs,x=require("@radix-ui/primitive").composeEventHandlers,C=(e={},o=require("react"),Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})})),e),_=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const[E,R]=m("Dialog");exports.createDialogScope=R;const[O,b]=E("Dialog"),h=e=>{const{__scopeDialog:o,children:t,open:r,defaultOpen:n,onOpenChange:a,modal:i=!0,allowPinchZoom:l}=e,s=C.useRef(null),c=C.useRef(null),[u=!1,d]=p({prop:r,defaultProp:n,onChange:a});/*#__PURE__*/return C.createElement(O,{scope:o,triggerRef:s,contentRef:c,contentId:g(),titleId:g(),descriptionId:g(),open:u,onOpenChange:d,onOpenToggle:C.useCallback((()=>d((e=>!e))),[d]),modal:i,allowPinchZoom:l},t)};exports.Dialog=h;const P=/*#__PURE__*/C.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,n=b("DialogTrigger",t),a=v(o,n.triggerRef);/*#__PURE__*/return C.createElement(l.button,_({type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":N(n.open)},r,{ref:a,onClick:x(e.onClick,n.onOpenToggle)}))}));exports.DialogTrigger=P;const[q,w]=E("DialogPortal",{forceMount:void 0}),y=e=>{const{__scopeDialog:o,forceMount:t,children:r,container:n}=e,a=b("DialogPortal",o);/*#__PURE__*/return C.createElement(q,{scope:o,forceMount:t},C.Children.map(r,(e=>/*#__PURE__*/C.createElement(s,{present:t||a.open},/*#__PURE__*/C.createElement(c,{asChild:!0,container:n},e)))))};exports.DialogPortal=y;const F=/*#__PURE__*/C.forwardRef(((e,o)=>{const t=w("DialogOverlay",e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,a=b("DialogOverlay",e.__scopeDialog);return a.modal?/*#__PURE__*/C.createElement(s,{present:r||a.open},/*#__PURE__*/C.createElement(I,_({},n,{ref:o}))):null}));exports.DialogOverlay=F;const I=/*#__PURE__*/C.forwardRef(((e,o)=>{const{__scopeDialog:t,...n}=e,i=b("DialogOverlay",t);/*#__PURE__*/return C.createElement(a,{as:r,allowPinchZoom:i.allowPinchZoom,shards:[i.contentRef]},/*#__PURE__*/C.createElement(l.div,_({"data-state":N(i.open)},n,{ref:o,style:{pointerEvents:"auto",...n.style}})))})),M=/*#__PURE__*/C.forwardRef(((e,o)=>{const t=w("DialogContent",e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,a=b("DialogContent",e.__scopeDialog);/*#__PURE__*/return C.createElement(s,{present:r||a.open},a.modal?/*#__PURE__*/C.createElement(T,_({},n,{ref:o})):/*#__PURE__*/C.createElement(A,_({},n,{ref:o})))}));exports.DialogContent=M;const T=/*#__PURE__*/C.forwardRef(((e,o)=>{const t=b("DialogContent",e.__scopeDialog),r=C.useRef(null),a=v(o,t.contentRef,r);return C.useEffect((()=>{const e=r.current;if(e)return n(e)}),[]),/*#__PURE__*/C.createElement(S,_({},e,{ref:a,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,(e=>{var o;e.preventDefault(),null===(o=t.triggerRef.current)||void 0===o||o.focus()})),onPointerDownOutside:x(e.onPointerDownOutside,(e=>{const o=e.detail.originalEvent,t=0===o.button&&!0===o.ctrlKey;(2===o.button||t)&&e.preventDefault()})),onFocusOutside:x(e.onFocusOutside,(e=>e.preventDefault()))}))})),A=/*#__PURE__*/C.forwardRef(((e,o)=>{const t=b("DialogContent",e.__scopeDialog),r=C.useRef(!1);/*#__PURE__*/return C.createElement(S,_({},e,{ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var n,a;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,o),o.defaultPrevented)||(r.current||null===(a=t.triggerRef.current)||void 0===a||a.focus(),o.preventDefault());r.current=!1},onInteractOutside:o=>{var n,a;null===(n=e.onInteractOutside)||void 0===n||n.call(e,o),o.defaultPrevented||(r.current=!0);const i=o.target;(null===(a=t.triggerRef.current)||void 0===a?void 0:a.contains(i))&&o.preventDefault()}}))})),S=/*#__PURE__*/C.forwardRef(((e,o)=>{const{__scopeDialog:t,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,...l}=e,s=b("DialogContent",t),c=C.useRef(null),p=v(o,c);return i(),/*#__PURE__*/C.createElement(C.Fragment,null,/*#__PURE__*/C.createElement(u,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a},/*#__PURE__*/C.createElement(d,_({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":N(s.open)},l,{ref:p,onDismiss:()=>s.onOpenChange(!1)}))),!1)})),k=/*#__PURE__*/C.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,n=b("DialogTitle",t);/*#__PURE__*/return C.createElement(l.h2,_({id:n.titleId},r,{ref:o}))}));exports.DialogTitle=k;const Z=/*#__PURE__*/C.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,n=b("DialogDescription",t);/*#__PURE__*/return C.createElement(l.p,_({id:n.descriptionId},r,{ref:o}))}));exports.DialogDescription=Z;const j=/*#__PURE__*/C.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,n=b("DialogClose",t);/*#__PURE__*/return C.createElement(l.button,_({type:"button"},r,{ref:o,onClick:x(e.onClick,(()=>n.onOpenChange(!1)))}))}));function N(e){return e?"open":"closed"}exports.DialogClose=j;const[U,W]=D("DialogTitleWarning",{contentName:"DialogContent",titleName:"DialogTitle",docsSlug:"dialog"});exports.WarningProvider=U;const G=h;exports.Root=G;const H=P;exports.Trigger=H;const K=y;exports.Portal=K;const L=F;exports.Overlay=L;const z=M;exports.Content=z;const B=k;exports.Title=B;const J=Z;exports.Description=J;const Q=j;exports.Close=Q;
1
+ var $aJCrN$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");
2
+ var $aJCrN$react = require("react");
3
+ var $aJCrN$radixuiprimitive = require("@radix-ui/primitive");
4
+ var $aJCrN$radixuireactcomposerefs = require("@radix-ui/react-compose-refs");
5
+ var $aJCrN$radixuireactcontext = require("@radix-ui/react-context");
6
+ var $aJCrN$radixuireactid = require("@radix-ui/react-id");
7
+ var $aJCrN$radixuireactusecontrollablestate = require("@radix-ui/react-use-controllable-state");
8
+ var $aJCrN$radixuireactdismissablelayer = require("@radix-ui/react-dismissable-layer");
9
+ var $aJCrN$radixuireactfocusscope = require("@radix-ui/react-focus-scope");
10
+ var $aJCrN$radixuireactportal = require("@radix-ui/react-portal");
11
+ var $aJCrN$radixuireactpresence = require("@radix-ui/react-presence");
12
+ var $aJCrN$radixuireactprimitive = require("@radix-ui/react-primitive");
13
+ var $aJCrN$radixuireactfocusguards = require("@radix-ui/react-focus-guards");
14
+ var $aJCrN$reactremovescroll = require("react-remove-scroll");
15
+ var $aJCrN$ariahidden = require("aria-hidden");
16
+ var $aJCrN$radixuireactslot = require("@radix-ui/react-slot");
17
+
18
+ function $parcel$exportWildcard(dest, source) {
19
+ Object.keys(source).forEach(function(key) {
20
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
21
+ return;
22
+ }
23
+
24
+ Object.defineProperty(dest, key, {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return source[key];
28
+ }
29
+ });
30
+ });
31
+
32
+ return dest;
33
+ }
34
+ function $parcel$interopDefault(a) {
35
+ return a && a.__esModule ? a.default : a;
36
+ }
37
+ function $parcel$export(e, n, v, s) {
38
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
39
+ }
40
+ var $f4833395aa1bca1a$exports = {};
41
+
42
+ $parcel$export($f4833395aa1bca1a$exports, "createDialogScope", () => $f4833395aa1bca1a$export$cc702773b8ea3e41);
43
+ $parcel$export($f4833395aa1bca1a$exports, "Dialog", () => $f4833395aa1bca1a$export$3ddf2d174ce01153);
44
+ $parcel$export($f4833395aa1bca1a$exports, "DialogTrigger", () => $f4833395aa1bca1a$export$2e1e1122cf0cba88);
45
+ $parcel$export($f4833395aa1bca1a$exports, "DialogPortal", () => $f4833395aa1bca1a$export$dad7c95542bacce0);
46
+ $parcel$export($f4833395aa1bca1a$exports, "DialogOverlay", () => $f4833395aa1bca1a$export$bd1d06c79be19e17);
47
+ $parcel$export($f4833395aa1bca1a$exports, "DialogContent", () => $f4833395aa1bca1a$export$b6d9565de1e068cf);
48
+ $parcel$export($f4833395aa1bca1a$exports, "DialogTitle", () => $f4833395aa1bca1a$export$16f7638e4a34b909);
49
+ $parcel$export($f4833395aa1bca1a$exports, "DialogDescription", () => $f4833395aa1bca1a$export$94e94c2ec2c954d5);
50
+ $parcel$export($f4833395aa1bca1a$exports, "DialogClose", () => $f4833395aa1bca1a$export$fba2fb7cd781b7ac);
51
+ $parcel$export($f4833395aa1bca1a$exports, "WarningProvider", () => $f4833395aa1bca1a$export$69b62a49393917d6);
52
+ $parcel$export($f4833395aa1bca1a$exports, "Root", () => $f4833395aa1bca1a$export$be92b6f5f03c0fe9);
53
+ $parcel$export($f4833395aa1bca1a$exports, "Trigger", () => $f4833395aa1bca1a$export$41fb9f06171c75f4);
54
+ $parcel$export($f4833395aa1bca1a$exports, "Portal", () => $f4833395aa1bca1a$export$602eac185826482c);
55
+ $parcel$export($f4833395aa1bca1a$exports, "Overlay", () => $f4833395aa1bca1a$export$c6fdb837b070b4ff);
56
+ $parcel$export($f4833395aa1bca1a$exports, "Content", () => $f4833395aa1bca1a$export$7c6e2c02157bb7d2);
57
+ $parcel$export($f4833395aa1bca1a$exports, "Title", () => $f4833395aa1bca1a$export$f99233281efd08a0);
58
+ $parcel$export($f4833395aa1bca1a$exports, "Description", () => $f4833395aa1bca1a$export$393edc798c47379d);
59
+ $parcel$export($f4833395aa1bca1a$exports, "Close", () => $f4833395aa1bca1a$export$f39c2d165cd861fe);
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+ /* -------------------------------------------------------------------------------------------------
77
+ * Dialog
78
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DIALOG_NAME = 'Dialog';
79
+ const [$f4833395aa1bca1a$var$createDialogContext, $f4833395aa1bca1a$export$cc702773b8ea3e41] = $aJCrN$radixuireactcontext.createContextScope($f4833395aa1bca1a$var$DIALOG_NAME);
80
+ const [$f4833395aa1bca1a$var$DialogProvider, $f4833395aa1bca1a$var$useDialogContext] = $f4833395aa1bca1a$var$createDialogContext($f4833395aa1bca1a$var$DIALOG_NAME);
81
+ const $f4833395aa1bca1a$export$3ddf2d174ce01153 = (props)=>{
82
+ const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true , allowPinchZoom: allowPinchZoom } = props;
83
+ const triggerRef = $aJCrN$react.useRef(null);
84
+ const contentRef = $aJCrN$react.useRef(null);
85
+ const [open = false, setOpen] = $aJCrN$radixuireactusecontrollablestate.useControllableState({
86
+ prop: openProp,
87
+ defaultProp: defaultOpen,
88
+ onChange: onOpenChange
89
+ });
90
+ return /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$DialogProvider, {
91
+ scope: __scopeDialog,
92
+ triggerRef: triggerRef,
93
+ contentRef: contentRef,
94
+ contentId: $aJCrN$radixuireactid.useId(),
95
+ titleId: $aJCrN$radixuireactid.useId(),
96
+ descriptionId: $aJCrN$radixuireactid.useId(),
97
+ open: open,
98
+ onOpenChange: setOpen,
99
+ onOpenToggle: $aJCrN$react.useCallback(()=>setOpen((prevOpen)=>!prevOpen
100
+ )
101
+ , [
102
+ setOpen
103
+ ]),
104
+ modal: modal,
105
+ allowPinchZoom: allowPinchZoom
106
+ }, children);
107
+ };
108
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$3ddf2d174ce01153, {
109
+ displayName: $f4833395aa1bca1a$var$DIALOG_NAME
110
+ });
111
+ /* -------------------------------------------------------------------------------------------------
112
+ * DialogTrigger
113
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$TRIGGER_NAME = 'DialogTrigger';
114
+ const $f4833395aa1bca1a$export$2e1e1122cf0cba88 = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
115
+ const { __scopeDialog: __scopeDialog , ...triggerProps } = props;
116
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$TRIGGER_NAME, __scopeDialog);
117
+ const composedTriggerRef = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.triggerRef);
118
+ return /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.button, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({
119
+ type: "button",
120
+ "aria-haspopup": "dialog",
121
+ "aria-expanded": context.open,
122
+ "aria-controls": context.contentId,
123
+ "data-state": $f4833395aa1bca1a$var$getState(context.open)
124
+ }, triggerProps, {
125
+ ref: composedTriggerRef,
126
+ onClick: $aJCrN$radixuiprimitive.composeEventHandlers(props.onClick, context.onOpenToggle)
127
+ }));
128
+ });
129
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$2e1e1122cf0cba88, {
130
+ displayName: $f4833395aa1bca1a$var$TRIGGER_NAME
131
+ });
132
+ /* -------------------------------------------------------------------------------------------------
133
+ * DialogPortal
134
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$PORTAL_NAME = 'DialogPortal';
135
+ const [$f4833395aa1bca1a$var$PortalProvider, $f4833395aa1bca1a$var$usePortalContext] = $f4833395aa1bca1a$var$createDialogContext($f4833395aa1bca1a$var$PORTAL_NAME, {
136
+ forceMount: undefined
137
+ });
138
+ const $f4833395aa1bca1a$export$dad7c95542bacce0 = (props)=>{
139
+ const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
140
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$PORTAL_NAME, __scopeDialog);
141
+ return /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$PortalProvider, {
142
+ scope: __scopeDialog,
143
+ forceMount: forceMount
144
+ }, $aJCrN$react.Children.map(children, (child)=>/*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, {
145
+ present: forceMount || context.open
146
+ }, /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactportal.UnstablePortal, {
147
+ asChild: true,
148
+ container: container
149
+ }, child))
150
+ ));
151
+ };
152
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$dad7c95542bacce0, {
153
+ displayName: $f4833395aa1bca1a$var$PORTAL_NAME
154
+ });
155
+ /* -------------------------------------------------------------------------------------------------
156
+ * DialogOverlay
157
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$OVERLAY_NAME = 'DialogOverlay';
158
+ const $f4833395aa1bca1a$export$bd1d06c79be19e17 = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
159
+ const portalContext = $f4833395aa1bca1a$var$usePortalContext($f4833395aa1bca1a$var$OVERLAY_NAME, props.__scopeDialog);
160
+ const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
161
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$OVERLAY_NAME, props.__scopeDialog);
162
+ return context.modal ? /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, {
163
+ present: forceMount || context.open
164
+ }, /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$DialogOverlayImpl, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({}, overlayProps, {
165
+ ref: forwardedRef
166
+ }))) : null;
167
+ });
168
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$bd1d06c79be19e17, {
169
+ displayName: $f4833395aa1bca1a$var$OVERLAY_NAME
170
+ });
171
+ const $f4833395aa1bca1a$var$DialogOverlayImpl = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
172
+ const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
173
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$OVERLAY_NAME, __scopeDialog);
174
+ return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
175
+ // ie. when `Overlay` and `Content` are siblings
176
+ $aJCrN$react.createElement($aJCrN$reactremovescroll.RemoveScroll, {
177
+ as: $aJCrN$radixuireactslot.Slot,
178
+ allowPinchZoom: context.allowPinchZoom,
179
+ shards: [
180
+ context.contentRef
181
+ ]
182
+ }, /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({
183
+ "data-state": $f4833395aa1bca1a$var$getState(context.open)
184
+ }, overlayProps, {
185
+ ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
186
+ ,
187
+ style: {
188
+ pointerEvents: 'auto',
189
+ ...overlayProps.style
190
+ }
191
+ }))));
192
+ });
193
+ /* -------------------------------------------------------------------------------------------------
194
+ * DialogContent
195
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$CONTENT_NAME = 'DialogContent';
196
+ const $f4833395aa1bca1a$export$b6d9565de1e068cf = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
197
+ const portalContext = $f4833395aa1bca1a$var$usePortalContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog);
198
+ const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
199
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog);
200
+ return /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, {
201
+ present: forceMount || context.open
202
+ }, context.modal ? /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentModal, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({}, contentProps, {
203
+ ref: forwardedRef
204
+ })) : /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentNonModal, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({}, contentProps, {
205
+ ref: forwardedRef
206
+ })));
207
+ });
208
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$b6d9565de1e068cf, {
209
+ displayName: $f4833395aa1bca1a$var$CONTENT_NAME
210
+ });
211
+ /* -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DialogContentModal = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
212
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog);
213
+ const contentRef = $aJCrN$react.useRef(null);
214
+ const composedRefs = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
215
+ $aJCrN$react.useEffect(()=>{
216
+ const content = contentRef.current;
217
+ if (content) return $aJCrN$ariahidden.hideOthers(content);
218
+ }, []);
219
+ return /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentImpl, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({}, props, {
220
+ ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
221
+ ,
222
+ trapFocus: context.open,
223
+ disableOutsidePointerEvents: true,
224
+ onCloseAutoFocus: $aJCrN$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, (event)=>{
225
+ var _context$triggerRef$c;
226
+ event.preventDefault();
227
+ (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
228
+ }),
229
+ onPointerDownOutside: $aJCrN$radixuiprimitive.composeEventHandlers(props.onPointerDownOutside, (event)=>{
230
+ const originalEvent = event.detail.originalEvent;
231
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
232
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
233
+ // it is effectively as if we right-clicked the `Overlay`.
234
+ if (isRightClick) event.preventDefault();
235
+ }) // When focus is trapped, a `focusout` event may still happen.
236
+ ,
237
+ onFocusOutside: $aJCrN$radixuiprimitive.composeEventHandlers(props.onFocusOutside, (event)=>event.preventDefault()
238
+ )
239
+ }));
240
+ });
241
+ /* -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DialogContentNonModal = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
242
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog);
243
+ const hasInteractedOutsideRef = $aJCrN$react.useRef(false);
244
+ return /*#__PURE__*/ $aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentImpl, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({}, props, {
245
+ ref: forwardedRef,
246
+ trapFocus: false,
247
+ disableOutsidePointerEvents: false,
248
+ onCloseAutoFocus: (event)=>{
249
+ var _props$onCloseAutoFoc;
250
+ (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
251
+ if (!event.defaultPrevented) {
252
+ var _context$triggerRef$c2;
253
+ if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
254
+ event.preventDefault();
255
+ }
256
+ hasInteractedOutsideRef.current = false;
257
+ },
258
+ onInteractOutside: (event)=>{
259
+ var _props$onInteractOuts, _context$triggerRef$c3;
260
+ (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
261
+ if (!event.defaultPrevented) hasInteractedOutsideRef.current = true; // Prevent dismissing when clicking the trigger.
262
+ // As the trigger is already setup to close, without doing so would
263
+ // cause it to close and immediately open.
264
+ //
265
+ // We use `onInteractOutside` as some browsers also
266
+ // focus on pointer down, creating the same issue.
267
+ const target = event.target;
268
+ const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
269
+ if (targetIsTrigger) event.preventDefault();
270
+ }
271
+ }));
272
+ });
273
+ /* -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DialogContentImpl = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
274
+ const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
275
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, __scopeDialog);
276
+ const contentRef = $aJCrN$react.useRef(null);
277
+ const composedRefs = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
278
+ // the last element in the DOM (beacuse of the `Portal`)
279
+ $aJCrN$radixuireactfocusguards.useFocusGuards();
280
+ return /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$react.Fragment, null, /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactfocusscope.FocusScope, {
281
+ asChild: true,
282
+ loop: true,
283
+ trapped: trapFocus,
284
+ onMountAutoFocus: onOpenAutoFocus,
285
+ onUnmountAutoFocus: onCloseAutoFocus
286
+ }, /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactdismissablelayer.DismissableLayer, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({
287
+ role: "dialog",
288
+ id: context.contentId,
289
+ "aria-describedby": context.descriptionId,
290
+ "aria-labelledby": context.titleId,
291
+ "data-state": $f4833395aa1bca1a$var$getState(context.open)
292
+ }, contentProps, {
293
+ ref: composedRefs,
294
+ onDismiss: ()=>context.onOpenChange(false)
295
+ }))), false);
296
+ });
297
+ /* -------------------------------------------------------------------------------------------------
298
+ * DialogTitle
299
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$TITLE_NAME = 'DialogTitle';
300
+ const $f4833395aa1bca1a$export$16f7638e4a34b909 = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
301
+ const { __scopeDialog: __scopeDialog , ...titleProps } = props;
302
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$TITLE_NAME, __scopeDialog);
303
+ return /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.h2, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({
304
+ id: context.titleId
305
+ }, titleProps, {
306
+ ref: forwardedRef
307
+ }));
308
+ });
309
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$16f7638e4a34b909, {
310
+ displayName: $f4833395aa1bca1a$var$TITLE_NAME
311
+ });
312
+ /* -------------------------------------------------------------------------------------------------
313
+ * DialogDescription
314
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DESCRIPTION_NAME = 'DialogDescription';
315
+ const $f4833395aa1bca1a$export$94e94c2ec2c954d5 = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
316
+ const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
317
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$DESCRIPTION_NAME, __scopeDialog);
318
+ return /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.p, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({
319
+ id: context.descriptionId
320
+ }, descriptionProps, {
321
+ ref: forwardedRef
322
+ }));
323
+ });
324
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$94e94c2ec2c954d5, {
325
+ displayName: $f4833395aa1bca1a$var$DESCRIPTION_NAME
326
+ });
327
+ /* -------------------------------------------------------------------------------------------------
328
+ * DialogClose
329
+ * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$CLOSE_NAME = 'DialogClose';
330
+ const $f4833395aa1bca1a$export$fba2fb7cd781b7ac = /*#__PURE__*/ $aJCrN$react.forwardRef((props, forwardedRef)=>{
331
+ const { __scopeDialog: __scopeDialog , ...closeProps } = props;
332
+ const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CLOSE_NAME, __scopeDialog);
333
+ return /*#__PURE__*/ $aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.button, ($parcel$interopDefault($aJCrN$babelruntimehelpersextends))({
334
+ type: "button"
335
+ }, closeProps, {
336
+ ref: forwardedRef,
337
+ onClick: $aJCrN$radixuiprimitive.composeEventHandlers(props.onClick, ()=>context.onOpenChange(false)
338
+ )
339
+ }));
340
+ });
341
+ /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$fba2fb7cd781b7ac, {
342
+ displayName: $f4833395aa1bca1a$var$CLOSE_NAME
343
+ });
344
+ /* -----------------------------------------------------------------------------------------------*/ function $f4833395aa1bca1a$var$getState(open) {
345
+ return open ? 'open' : 'closed';
346
+ }
347
+ const $f4833395aa1bca1a$var$TITLE_WARNING_NAME = 'DialogTitleWarning';
348
+ const [$f4833395aa1bca1a$export$69b62a49393917d6, $f4833395aa1bca1a$var$useWarningContext] = $aJCrN$radixuireactcontext.createContext($f4833395aa1bca1a$var$TITLE_WARNING_NAME, {
349
+ contentName: $f4833395aa1bca1a$var$CONTENT_NAME,
350
+ titleName: $f4833395aa1bca1a$var$TITLE_NAME,
351
+ docsSlug: 'dialog'
352
+ });
353
+ const $f4833395aa1bca1a$var$TitleWarning = ({ titleId: titleId })=>{
354
+ const titleWarningContext = $f4833395aa1bca1a$var$useWarningContext($f4833395aa1bca1a$var$TITLE_WARNING_NAME);
355
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
356
+
357
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
358
+
359
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
360
+ $aJCrN$react.useEffect(()=>{
361
+ if (titleId) {
362
+ const hasTitle = document.getElementById(titleId);
363
+ if (!hasTitle) throw new Error(MESSAGE);
364
+ }
365
+ }, [
366
+ MESSAGE,
367
+ titleId
368
+ ]);
369
+ return null;
370
+ };
371
+ const $f4833395aa1bca1a$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';
372
+ const $f4833395aa1bca1a$var$DescriptionWarning = ({ contentRef: contentRef , descriptionId: descriptionId })=>{
373
+ const descriptionWarningContext = $f4833395aa1bca1a$var$useWarningContext($f4833395aa1bca1a$var$DESCRIPTION_WARNING_NAME);
374
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
375
+ $aJCrN$react.useEffect(()=>{
376
+ var _contentRef$current;
377
+ const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined}
378
+ if (descriptionId && describedById) {
379
+ const hasDescription = document.getElementById(descriptionId);
380
+ if (!hasDescription) console.warn(MESSAGE);
381
+ }
382
+ }, [
383
+ MESSAGE,
384
+ contentRef,
385
+ descriptionId
386
+ ]);
387
+ return null;
388
+ };
389
+ const $f4833395aa1bca1a$export$be92b6f5f03c0fe9 = $f4833395aa1bca1a$export$3ddf2d174ce01153;
390
+ const $f4833395aa1bca1a$export$41fb9f06171c75f4 = $f4833395aa1bca1a$export$2e1e1122cf0cba88;
391
+ const $f4833395aa1bca1a$export$602eac185826482c = $f4833395aa1bca1a$export$dad7c95542bacce0;
392
+ const $f4833395aa1bca1a$export$c6fdb837b070b4ff = $f4833395aa1bca1a$export$bd1d06c79be19e17;
393
+ const $f4833395aa1bca1a$export$7c6e2c02157bb7d2 = $f4833395aa1bca1a$export$b6d9565de1e068cf;
394
+ const $f4833395aa1bca1a$export$f99233281efd08a0 = $f4833395aa1bca1a$export$16f7638e4a34b909;
395
+ const $f4833395aa1bca1a$export$393edc798c47379d = $f4833395aa1bca1a$export$94e94c2ec2c954d5;
396
+ const $f4833395aa1bca1a$export$f39c2d165cd861fe = $f4833395aa1bca1a$export$fba2fb7cd781b7ac;
397
+
398
+
399
+ $parcel$exportWildcard(module.exports, $f4833395aa1bca1a$exports);
400
+
401
+
2
402
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":"IAYgCA,EAAMC,EAZNC,2uBAYAF,KAAMC,mBACpCE,OAAOC,KAAKH,GAAQI,SAAQ,SAASC,GACvB,YAARA,GAA6B,eAARA,GAIzBH,OAAOI,eAAeP,EAAMM,EAAK,CAC/BE,YAAY,EACZC,IAAK,WACH,OAAOR,EAAOK,SAKbN,MA1BuBE,8CAClBA,EAAEQ,WAAaR,EAAES,QAAUT,ECsBzC,MAGOU,EAAqBC,GAAqBC,EAH7B,sCAkBpB,MAAOC,EAAgBC,GAAoBJ,EAlBvB,UAiCdK,EAAiCC,IACrC,MAAMC,cACJA,EADIC,SAEJA,EACAC,KAAMC,EAHFC,YAIJA,EAJIC,aAKJA,EALIC,MAMJA,GAAQ,EANJC,eAOJA,GACER,EACES,EAAaC,EAAMC,OAA0B,MAC7CC,EAAaF,EAAMC,OAA6B,OAC/CR,GAAO,EAAOU,GAAWC,EAAqB,CACnDC,KAAMX,EACNY,YAAaX,EACbY,SAAUX,iBAGZ,OACEY,EAAAC,cAACC,EAAD,CACEC,MAAOpB,EACPQ,WAAYA,EACZG,WAAYA,EACZU,UAAWC,IACXC,QAASD,IACTE,cAAeF,IACfpB,KAAMA,EACNG,aAAcO,EACda,aAAchB,EAAMiB,aAAY,IAAMd,GAASe,IAAcA,KAAW,CAACf,IACzEN,MAAOA,EACPC,eAAgBA,GAEfN,qBAWP,MAMM2B,eAAgBnB,EAAMoB,YAC1B,CAAC9B,EAAwC+B,KACvC,MAAM9B,cAAEA,KAAkB+B,GAAiBhC,EACrCiC,EAAUnC,EATC,gBAS8BG,GACzCiC,EAAqBC,EAAgBJ,EAAcE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CMC,EAAOrI,iBACb,MAAMsI,EAAUxG,oBAChB,MAAMyG,EAAStF,mBACf,MAAMuF,EAAU7E,oBAChB,MAAM8E,EAAUlE,oBAChB,MAAMmE,EAAQnB,kBACd,MAAMoB,EAAcjB,wBACpB,MAAMkB,EAAQf","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/react/dialog/src/Dialog.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$reexport(e, n, v) {\n Object.defineProperty(e, n, {get: v, enumerable: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","import * 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 { UnstablePortal } 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 { Slot } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentRef: React.RefObject<DialogContentElement>;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n allowPinchZoom: DialogProps['allowPinchZoom'];\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME);\n\ntype RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;\ninterface DialogProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];\n children?: React.ReactNode;\n}\n\nconst Dialog: React.FC<DialogProps> = (props: ScopedProps<DialogProps>) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n allowPinchZoom,\n } = props;\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const contentRef = React.useRef<DialogContentElement>(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId()}\n titleId={useId()}\n descriptionId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n allowPinchZoom={allowPinchZoom}\n >\n {children}\n </DialogProvider>\n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n (props: ScopedProps<DialogTriggerProps>, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n <Primitive.button\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);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof UnstablePortal>;\ninterface DialogPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n {React.Children.map(children, (child) => (\n <Presence present={forceMount || context.open}>\n <UnstablePortal asChild container={container}>\n {child}\n </UnstablePortal>\n </Presence>\n ))}\n </PortalProvider>\n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef<DialogOverlayElement, DialogOverlayProps>(\n (props: ScopedProps<DialogOverlayProps>, 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 ? (\n <Presence present={forceMount || context.open}>\n <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n </Presence>\n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst DialogOverlayImpl = React.forwardRef<DialogOverlayImplElement, DialogOverlayImplProps>(\n (props: ScopedProps<DialogOverlayImplProps>, 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 <RemoveScroll as={Slot} allowPinchZoom={context.allowPinchZoom} shards={[context.contentRef]}>\n <Primitive.div\n data-state={getState(context.open)}\n {...overlayProps}\n ref={forwardedRef}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n style={{ pointerEvents: 'auto', ...overlayProps.style }}\n />\n </RemoveScroll>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n (props: ScopedProps<DialogContentProps>, 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 (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst DialogContentModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents\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\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true;\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ElementRef<typeof DismissableLayer>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ninterface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef<DialogContentImplElement, DialogContentImplProps>(\n (props: ScopedProps<DialogContentImplProps>, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\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 </FocusScope>\n {process.env.NODE_ENV !== 'production' && (\n <>\n <TitleWarning titleId={context.titleId} />\n <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />\n </>\n )}\n </>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ElementRef<typeof Primitive.h2>;\ntype PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props: ScopedProps<DialogTitleProps>, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return <Primitive.h2 id={context.titleId} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ElementRef<typeof Primitive.p>;\ntype PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return <Primitive.p id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n (props: ScopedProps<DialogCloseProps>, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC<TitleWarningProps> = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\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\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) throw new Error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<DialogContentElement>;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"],"names":["dest","source","a","Object","keys","forEach","key","defineProperty","enumerable","get","__esModule","default","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","allowPinchZoom","triggerRef","React","useRef","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","_react","createElement","$b0496301423b3238f89fb15bee25ad02$var$DialogProvider","scope","contentId","useId","titleId","descriptionId","onOpenToggle","useCallback","prevOpen","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","_babelRuntimeHelpersExtends","type","getState","ref","onClick","composeEventHandlers","PortalProvider","usePortalContext","forceMount","undefined","DialogPortal","container","$b0496301423b3238f89fb15bee25ad02$var$PortalProvider","Children","map","child","Presence","present","UnstablePortal","asChild","DialogOverlay","portalContext","overlayProps","$b0496301423b3238f89fb15bee25ad02$var$DialogOverlayImpl","DialogOverlayImpl","RemoveScroll","as","Slot","shards","div","style","pointerEvents","DialogContent","contentProps","$b0496301423b3238f89fb15bee25ad02$var$DialogContentModal","$b0496301423b3238f89fb15bee25ad02$var$DialogContentNonModal","DialogContentModal","composedRefs","useEffect","content","current","hideOthers","$b0496301423b3238f89fb15bee25ad02$var$DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","_context$triggerRef$c","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","DialogContentNonModal","hasInteractedOutsideRef","_props$onCloseAutoFoc","_context$triggerRef$c2","call","defaultPrevented","onInteractOutside","_props$onInteractOuts","_context$triggerRef$c3","target","contains","DialogContentImpl","onOpenAutoFocus","useFocusGuards","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","DialogTitle","titleProps","h2","DialogDescription","descriptionProps","p","DialogClose","closeProps","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"version":3,"file":"index.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;;ACmBA;;oGAEA,CAEA,MAAMgB,iCAAW,GAAG,QAApB,AAAA;AAGA,MAAM,CAACC,yCAAD,EAAsBC,yCAAtB,CAAA,GAA2Cd,6CAAkB,CAACY,iCAAD,CAAnE,AAAA;AAeA,MAAM,CAACG,oCAAD,EAAiBC,sCAAjB,CAAA,GAAqCH,yCAAmB,CAAqBD,iCAArB,CAA9D,AAAA;AAeA,MAAMK,yCAA6B,GAAIC,CAAAA,KAAD,GAAqC;IACzE,MAAM,E,eACJC,aADI,CAAA,E,UAEJC,QAFI,CAAA,EAGJC,IAAI,EAAEC,QAHF,CAAA,E,aAIJC,WAJI,CAAA,E,cAKJC,YALI,CAAA,SAMJC,KAAK,GAAG,IANJ,G,gBAOJC,cAAAA,CAAAA,EAPI,GAQFR,KARJ,AAAM;IASN,MAAMS,UAAU,GAAG/B,mBAAA,CAAgC,IAAhC,CAAnB,AAAA;IACA,MAAMiC,UAAU,GAAGjC,mBAAA,CAAmC,IAAnC,CAAnB,AAAA;IACA,MAAM,CAACyB,IAAI,GAAG,KAAR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AAiC,kBAAjC,CAAtB,AADoB,EAEpB,wEADA;QAEA,IAAI/B,aAAa,IAAI8B,aAArB,EAAoC;YAClC,MAAME,cAAc,GAAGR,QAAQ,CAACC,cAAT,CAAwBzB,aAAxB,CAAvB,AAAA;YACA,IAAI,CAACgC,cAAL,EAAqBC,OAAO,CAACC,IAAR,CAAaZ,OAAb,CAArB,CAAA;SACD;KANH,EAOG;QAACA,OAAD;QAAUvF,UAAV;QAAsBiE,aAAtB;KAPH,CAOC,CAAA;IAED,OAAO,IAAP,CAAA;CAbF,AAcC;AAED,MAAMmC,yCAAI,GAAGhH,yCAAb,AAAA;AACA,MAAMiH,yCAAO,GAAG7F,yCAAhB,AAAA;AACA,MAAM8F,yCAAM,GAAG/E,yCAAf,AAAA;AACA,MAAMgF,yCAAO,GAAG1E,yCAAhB,AAAA;AACA,MAAM2E,yCAAO,GAAGpE,yCAAhB,AAAA;AACA,MAAMqE,yCAAK,GAAGlC,yCAAd,AAAA;AACA,MAAMmC,yCAAW,GAAGhC,yCAApB,AAAA;AACA,MAAMiC,yCAAK,GAAG9B,yCAAd,AAAA;;ADliBA","sources":["packages/react/dialog/src/index.ts","packages/react/dialog/src/Dialog.tsx"],"sourcesContent":["export * from './Dialog';\n","import * 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 { UnstablePortal } 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 { Slot } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentRef: React.RefObject<DialogContentElement>;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n allowPinchZoom: DialogProps['allowPinchZoom'];\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME);\n\ntype RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];\n}\n\nconst Dialog: React.FC<DialogProps> = (props: ScopedProps<DialogProps>) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n allowPinchZoom,\n } = props;\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const contentRef = React.useRef<DialogContentElement>(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId()}\n titleId={useId()}\n descriptionId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n allowPinchZoom={allowPinchZoom}\n >\n {children}\n </DialogProvider>\n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n (props: ScopedProps<DialogTriggerProps>, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n <Primitive.button\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);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof UnstablePortal>;\ninterface DialogPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n {React.Children.map(children, (child) => (\n <Presence present={forceMount || context.open}>\n <UnstablePortal asChild container={container}>\n {child}\n </UnstablePortal>\n </Presence>\n ))}\n </PortalProvider>\n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef<DialogOverlayElement, DialogOverlayProps>(\n (props: ScopedProps<DialogOverlayProps>, 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 ? (\n <Presence present={forceMount || context.open}>\n <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n </Presence>\n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst DialogOverlayImpl = React.forwardRef<DialogOverlayImplElement, DialogOverlayImplProps>(\n (props: ScopedProps<DialogOverlayImplProps>, 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 <RemoveScroll as={Slot} allowPinchZoom={context.allowPinchZoom} shards={[context.contentRef]}>\n <Primitive.div\n data-state={getState(context.open)}\n {...overlayProps}\n ref={forwardedRef}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n style={{ pointerEvents: 'auto', ...overlayProps.style }}\n />\n </RemoveScroll>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n (props: ScopedProps<DialogContentProps>, 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 (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst DialogContentModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents\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\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true;\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ElementRef<typeof DismissableLayer>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ninterface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef<DialogContentImplElement, DialogContentImplProps>(\n (props: ScopedProps<DialogContentImplProps>, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\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 </FocusScope>\n {process.env.NODE_ENV !== 'production' && (\n <>\n <TitleWarning titleId={context.titleId} />\n <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />\n </>\n )}\n </>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ElementRef<typeof Primitive.h2>;\ntype PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props: ScopedProps<DialogTitleProps>, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return <Primitive.h2 id={context.titleId} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ElementRef<typeof Primitive.p>;\ntype PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return <Primitive.p id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n (props: ScopedProps<DialogCloseProps>, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC<TitleWarningProps> = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\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\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) throw new Error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<DialogContentElement>;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"],"names":["React","composeEventHandlers","useComposedRefs","createContext","createContextScope","useId","useControllableState","DismissableLayer","FocusScope","UnstablePortal","Presence","Primitive","useFocusGuards","RemoveScroll","hideOthers","Slot","DIALOG_NAME","createDialogContext","createDialogScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","allowPinchZoom","triggerRef","useRef","contentRef","setOpen","prop","defaultProp","onChange","useCallback","prevOpen","TRIGGER_NAME","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","contentId","getState","onClick","onOpenToggle","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","undefined","DialogPortal","container","Children","map","child","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","pointerEvents","style","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","composedRefs","useEffect","content","current","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","onFocusOutside","DialogContentNonModal","hasInteractedOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","DialogContentImpl","trapFocus","onOpenAutoFocus","descriptionId","titleId","process","env","NODE_ENV","TITLE_NAME","DialogTitle","titleProps","DESCRIPTION_NAME","DialogDescription","descriptionProps","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","contentName","titleName","docsSlug","TitleWarning","titleWarningContext","MESSAGE","hasTitle","document","getElementById","Error","DESCRIPTION_WARNING_NAME","DescriptionWarning","descriptionWarningContext","describedById","getAttribute","hasDescription","console","warn","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"version":3,"file":"index.js.map"}
@@ -1,2 +1,383 @@
1
- import{Slot as e}from"@radix-ui/react-slot";import{hideOthers as o}from"aria-hidden";import{RemoveScroll as t}from"react-remove-scroll";import{useFocusGuards as r}from"@radix-ui/react-focus-guards";import{Primitive as n}from"@radix-ui/react-primitive";import{Presence as a}from"@radix-ui/react-presence";import{UnstablePortal as i}from"@radix-ui/react-portal";import{FocusScope as l}from"@radix-ui/react-focus-scope";import{DismissableLayer as c}from"@radix-ui/react-dismissable-layer";import{useControllableState as s}from"@radix-ui/react-use-controllable-state";import{useId as u}from"@radix-ui/react-id";import{createContext as p,createContextScope as d}from"@radix-ui/react-context";import{useComposedRefs as f}from"@radix-ui/react-compose-refs";import{composeEventHandlers as g}from"@radix-ui/primitive";import*as m from"react";import D from"@babel/runtime/helpers/esm/extends";const[x,v]=d("Dialog");export{v as createDialogScope};const[C,_]=x("Dialog");export const Dialog=e=>{const{__scopeDialog:o,children:t,open:r,defaultOpen:n,onOpenChange:a,modal:i=!0,allowPinchZoom:l}=e,c=m.useRef(null),p=m.useRef(null),[d=!1,f]=s({prop:r,defaultProp:n,onChange:a});/*#__PURE__*/return m.createElement(C,{scope:o,triggerRef:c,contentRef:p,contentId:u(),titleId:u(),descriptionId:u(),open:d,onOpenChange:f,onOpenToggle:m.useCallback((()=>f((e=>!e))),[f]),modal:i,allowPinchZoom:l},t)};/*#__PURE__*/export const DialogTrigger=/*#__PURE__*/m.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,a=_("DialogTrigger",t),i=f(o,a.triggerRef);/*#__PURE__*/return m.createElement(n.button,D({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":P(a.open)},r,{ref:i,onClick:g(e.onClick,a.onOpenToggle)}))}));/*#__PURE__*/const[E,R]=x("DialogPortal",{forceMount:void 0});export const DialogPortal=e=>{const{__scopeDialog:o,forceMount:t,children:r,container:n}=e,l=_("DialogPortal",o);/*#__PURE__*/return m.createElement(E,{scope:o,forceMount:t},m.Children.map(r,(e=>/*#__PURE__*/m.createElement(a,{present:t||l.open},/*#__PURE__*/m.createElement(i,{asChild:!0,container:n},e)))))};/*#__PURE__*/export const DialogOverlay=/*#__PURE__*/m.forwardRef(((e,o)=>{const t=R("DialogOverlay",e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,i=_("DialogOverlay",e.__scopeDialog);return i.modal?/*#__PURE__*/m.createElement(a,{present:r||i.open},/*#__PURE__*/m.createElement(O,D({},n,{ref:o}))):null}));/*#__PURE__*/const O=/*#__PURE__*/m.forwardRef(((o,r)=>{const{__scopeDialog:a,...i}=o,l=_("DialogOverlay",a);/*#__PURE__*/return m.createElement(t,{as:e,allowPinchZoom:l.allowPinchZoom,shards:[l.contentRef]},/*#__PURE__*/m.createElement(n.div,D({"data-state":P(l.open)},i,{ref:r,style:{pointerEvents:"auto",...i.style}})))}));export const DialogContent=/*#__PURE__*/m.forwardRef(((e,o)=>{const t=R("DialogContent",e.__scopeDialog),{forceMount:r=t.forceMount,...n}=e,i=_("DialogContent",e.__scopeDialog);/*#__PURE__*/return m.createElement(a,{present:r||i.open},i.modal?/*#__PURE__*/m.createElement(h,D({},n,{ref:o})):/*#__PURE__*/m.createElement(b,D({},n,{ref:o})))}));/*#__PURE__*/const h=/*#__PURE__*/m.forwardRef(((e,t)=>{const r=_("DialogContent",e.__scopeDialog),n=m.useRef(null),a=f(t,r.contentRef,n);return m.useEffect((()=>{const e=n.current;if(e)return o(e)}),[]),/*#__PURE__*/m.createElement(w,D({},e,{ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,(e=>{var o;e.preventDefault(),null===(o=r.triggerRef.current)||void 0===o||o.focus()})),onPointerDownOutside:g(e.onPointerDownOutside,(e=>{const o=e.detail.originalEvent,t=0===o.button&&!0===o.ctrlKey;(2===o.button||t)&&e.preventDefault()})),onFocusOutside:g(e.onFocusOutside,(e=>e.preventDefault()))}))})),b=/*#__PURE__*/m.forwardRef(((e,o)=>{const t=_("DialogContent",e.__scopeDialog),r=m.useRef(!1);/*#__PURE__*/return m.createElement(w,D({},e,{ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var n,a;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,o),o.defaultPrevented)||(r.current||null===(a=t.triggerRef.current)||void 0===a||a.focus(),o.preventDefault());r.current=!1},onInteractOutside:o=>{var n,a;null===(n=e.onInteractOutside)||void 0===n||n.call(e,o),o.defaultPrevented||(r.current=!0);const i=o.target;(null===(a=t.triggerRef.current)||void 0===a?void 0:a.contains(i))&&o.preventDefault()}}))})),w=/*#__PURE__*/m.forwardRef(((e,o)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,u=_("DialogContent",t),p=m.useRef(null),d=f(o,p);return r(),/*#__PURE__*/m.createElement(m.Fragment,null,/*#__PURE__*/m.createElement(l,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i},/*#__PURE__*/m.createElement(c,D({role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":P(u.open)},s,{ref:d,onDismiss:()=>u.onOpenChange(!1)}))),!1)}));export const DialogTitle=/*#__PURE__*/m.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,a=_("DialogTitle",t);/*#__PURE__*/return m.createElement(n.h2,D({id:a.titleId},r,{ref:o}))}));/*#__PURE__*/export const DialogDescription=/*#__PURE__*/m.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,a=_("DialogDescription",t);/*#__PURE__*/return m.createElement(n.p,D({id:a.descriptionId},r,{ref:o}))}));/*#__PURE__*/export const DialogClose=/*#__PURE__*/m.forwardRef(((e,o)=>{const{__scopeDialog:t,...r}=e,a=_("DialogClose",t);/*#__PURE__*/return m.createElement(n.button,D({type:"button"},r,{ref:o,onClick:g(e.onClick,(()=>a.onOpenChange(!1)))}))}));/*#__PURE__*/function P(e){return e?"open":"closed"}const[y,F]=p("DialogTitleWarning",{contentName:"DialogContent",titleName:"DialogTitle",docsSlug:"dialog"});export{y as WarningProvider};export const Root=Dialog;export const Trigger=DialogTrigger;export const Portal=DialogPortal;export const Overlay=DialogOverlay;export const Content=DialogContent;export const Title=DialogTitle;export const Description=DialogDescription;export const Close=DialogClose;
1
+ import $67UHm$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
2
+ import {useRef as $67UHm$useRef, createElement as $67UHm$createElement, useCallback as $67UHm$useCallback, forwardRef as $67UHm$forwardRef, Children as $67UHm$Children, useEffect as $67UHm$useEffect, Fragment as $67UHm$Fragment} from "react";
3
+ import {composeEventHandlers as $67UHm$composeEventHandlers} from "@radix-ui/primitive";
4
+ import {useComposedRefs as $67UHm$useComposedRefs} from "@radix-ui/react-compose-refs";
5
+ import {createContextScope as $67UHm$createContextScope, createContext as $67UHm$createContext} from "@radix-ui/react-context";
6
+ import {useId as $67UHm$useId} from "@radix-ui/react-id";
7
+ import {useControllableState as $67UHm$useControllableState} from "@radix-ui/react-use-controllable-state";
8
+ import {DismissableLayer as $67UHm$DismissableLayer} from "@radix-ui/react-dismissable-layer";
9
+ import {FocusScope as $67UHm$FocusScope} from "@radix-ui/react-focus-scope";
10
+ import {UnstablePortal as $67UHm$UnstablePortal} from "@radix-ui/react-portal";
11
+ import {Presence as $67UHm$Presence} from "@radix-ui/react-presence";
12
+ import {Primitive as $67UHm$Primitive} from "@radix-ui/react-primitive";
13
+ import {useFocusGuards as $67UHm$useFocusGuards} from "@radix-ui/react-focus-guards";
14
+ import {RemoveScroll as $67UHm$RemoveScroll} from "react-remove-scroll";
15
+ import {hideOthers as $67UHm$hideOthers} from "aria-hidden";
16
+ import {Slot as $67UHm$Slot} from "@radix-ui/react-slot";
17
+
18
+ function $parcel$export(e, n, v, s) {
19
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
20
+ }
21
+ var $5d3850c4d0b4e6c7$exports = {};
22
+
23
+ $parcel$export($5d3850c4d0b4e6c7$exports, "createDialogScope", () => $5d3850c4d0b4e6c7$export$cc702773b8ea3e41);
24
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Dialog", () => $5d3850c4d0b4e6c7$export$3ddf2d174ce01153);
25
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogTrigger", () => $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88);
26
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogPortal", () => $5d3850c4d0b4e6c7$export$dad7c95542bacce0);
27
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogOverlay", () => $5d3850c4d0b4e6c7$export$bd1d06c79be19e17);
28
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogContent", () => $5d3850c4d0b4e6c7$export$b6d9565de1e068cf);
29
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogTitle", () => $5d3850c4d0b4e6c7$export$16f7638e4a34b909);
30
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogDescription", () => $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5);
31
+ $parcel$export($5d3850c4d0b4e6c7$exports, "DialogClose", () => $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac);
32
+ $parcel$export($5d3850c4d0b4e6c7$exports, "WarningProvider", () => $5d3850c4d0b4e6c7$export$69b62a49393917d6);
33
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Root", () => $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9);
34
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Trigger", () => $5d3850c4d0b4e6c7$export$41fb9f06171c75f4);
35
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Portal", () => $5d3850c4d0b4e6c7$export$602eac185826482c);
36
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Overlay", () => $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff);
37
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Content", () => $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2);
38
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Title", () => $5d3850c4d0b4e6c7$export$f99233281efd08a0);
39
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Description", () => $5d3850c4d0b4e6c7$export$393edc798c47379d);
40
+ $parcel$export($5d3850c4d0b4e6c7$exports, "Close", () => $5d3850c4d0b4e6c7$export$f39c2d165cd861fe);
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+ /* -------------------------------------------------------------------------------------------------
58
+ * Dialog
59
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
60
+ const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $67UHm$createContextScope($5d3850c4d0b4e6c7$var$DIALOG_NAME);
61
+ const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
62
+ const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
63
+ const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true , allowPinchZoom: allowPinchZoom } = props;
64
+ const triggerRef = $67UHm$useRef(null);
65
+ const contentRef = $67UHm$useRef(null);
66
+ const [open = false, setOpen] = $67UHm$useControllableState({
67
+ prop: openProp,
68
+ defaultProp: defaultOpen,
69
+ onChange: onOpenChange
70
+ });
71
+ return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogProvider, {
72
+ scope: __scopeDialog,
73
+ triggerRef: triggerRef,
74
+ contentRef: contentRef,
75
+ contentId: $67UHm$useId(),
76
+ titleId: $67UHm$useId(),
77
+ descriptionId: $67UHm$useId(),
78
+ open: open,
79
+ onOpenChange: setOpen,
80
+ onOpenToggle: $67UHm$useCallback(()=>setOpen((prevOpen)=>!prevOpen
81
+ )
82
+ , [
83
+ setOpen
84
+ ]),
85
+ modal: modal,
86
+ allowPinchZoom: allowPinchZoom
87
+ }, children);
88
+ };
89
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$3ddf2d174ce01153, {
90
+ displayName: $5d3850c4d0b4e6c7$var$DIALOG_NAME
91
+ });
92
+ /* -------------------------------------------------------------------------------------------------
93
+ * DialogTrigger
94
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TRIGGER_NAME = 'DialogTrigger';
95
+ const $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
96
+ const { __scopeDialog: __scopeDialog , ...triggerProps } = props;
97
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TRIGGER_NAME, __scopeDialog);
98
+ const composedTriggerRef = $67UHm$useComposedRefs(forwardedRef, context.triggerRef);
99
+ return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.button, $67UHm$babelruntimehelpersesmextends({
100
+ type: "button",
101
+ "aria-haspopup": "dialog",
102
+ "aria-expanded": context.open,
103
+ "aria-controls": context.contentId,
104
+ "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
105
+ }, triggerProps, {
106
+ ref: composedTriggerRef,
107
+ onClick: $67UHm$composeEventHandlers(props.onClick, context.onOpenToggle)
108
+ }));
109
+ });
110
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$2e1e1122cf0cba88, {
111
+ displayName: $5d3850c4d0b4e6c7$var$TRIGGER_NAME
112
+ });
113
+ /* -------------------------------------------------------------------------------------------------
114
+ * DialogPortal
115
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
116
+ const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
117
+ forceMount: undefined
118
+ });
119
+ const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
120
+ const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
121
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
122
+ return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
123
+ scope: __scopeDialog,
124
+ forceMount: forceMount
125
+ }, $67UHm$Children.map(children, (child)=>/*#__PURE__*/ $67UHm$createElement($67UHm$Presence, {
126
+ present: forceMount || context.open
127
+ }, /*#__PURE__*/ $67UHm$createElement($67UHm$UnstablePortal, {
128
+ asChild: true,
129
+ container: container
130
+ }, child))
131
+ ));
132
+ };
133
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$dad7c95542bacce0, {
134
+ displayName: $5d3850c4d0b4e6c7$var$PORTAL_NAME
135
+ });
136
+ /* -------------------------------------------------------------------------------------------------
137
+ * DialogOverlay
138
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
139
+ const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
140
+ const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
141
+ const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
142
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
143
+ return context.modal ? /*#__PURE__*/ $67UHm$createElement($67UHm$Presence, {
144
+ present: forceMount || context.open
145
+ }, /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, $67UHm$babelruntimehelpersesmextends({}, overlayProps, {
146
+ ref: forwardedRef
147
+ }))) : null;
148
+ });
149
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$bd1d06c79be19e17, {
150
+ displayName: $5d3850c4d0b4e6c7$var$OVERLAY_NAME
151
+ });
152
+ const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
153
+ const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
154
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
155
+ return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
156
+ // ie. when `Overlay` and `Content` are siblings
157
+ $67UHm$createElement($67UHm$RemoveScroll, {
158
+ as: $67UHm$Slot,
159
+ allowPinchZoom: context.allowPinchZoom,
160
+ shards: [
161
+ context.contentRef
162
+ ]
163
+ }, /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.div, $67UHm$babelruntimehelpersesmextends({
164
+ "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
165
+ }, overlayProps, {
166
+ ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
167
+ ,
168
+ style: {
169
+ pointerEvents: 'auto',
170
+ ...overlayProps.style
171
+ }
172
+ }))));
173
+ });
174
+ /* -------------------------------------------------------------------------------------------------
175
+ * DialogContent
176
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
177
+ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
178
+ const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
179
+ const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
180
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
181
+ return /*#__PURE__*/ $67UHm$createElement($67UHm$Presence, {
182
+ present: forceMount || context.open
183
+ }, context.modal ? /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentModal, $67UHm$babelruntimehelpersesmextends({}, contentProps, {
184
+ ref: forwardedRef
185
+ })) : /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, $67UHm$babelruntimehelpersesmextends({}, contentProps, {
186
+ ref: forwardedRef
187
+ })));
188
+ });
189
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$b6d9565de1e068cf, {
190
+ displayName: $5d3850c4d0b4e6c7$var$CONTENT_NAME
191
+ });
192
+ /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
193
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
194
+ const contentRef = $67UHm$useRef(null);
195
+ const composedRefs = $67UHm$useComposedRefs(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
196
+ $67UHm$useEffect(()=>{
197
+ const content = contentRef.current;
198
+ if (content) return $67UHm$hideOthers(content);
199
+ }, []);
200
+ return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, $67UHm$babelruntimehelpersesmextends({}, props, {
201
+ ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
202
+ ,
203
+ trapFocus: context.open,
204
+ disableOutsidePointerEvents: true,
205
+ onCloseAutoFocus: $67UHm$composeEventHandlers(props.onCloseAutoFocus, (event)=>{
206
+ var _context$triggerRef$c;
207
+ event.preventDefault();
208
+ (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
209
+ }),
210
+ onPointerDownOutside: $67UHm$composeEventHandlers(props.onPointerDownOutside, (event)=>{
211
+ const originalEvent = event.detail.originalEvent;
212
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
213
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
214
+ // it is effectively as if we right-clicked the `Overlay`.
215
+ if (isRightClick) event.preventDefault();
216
+ }) // When focus is trapped, a `focusout` event may still happen.
217
+ ,
218
+ onFocusOutside: $67UHm$composeEventHandlers(props.onFocusOutside, (event)=>event.preventDefault()
219
+ )
220
+ }));
221
+ });
222
+ /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
223
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
224
+ const hasInteractedOutsideRef = $67UHm$useRef(false);
225
+ return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, $67UHm$babelruntimehelpersesmextends({}, props, {
226
+ ref: forwardedRef,
227
+ trapFocus: false,
228
+ disableOutsidePointerEvents: false,
229
+ onCloseAutoFocus: (event)=>{
230
+ var _props$onCloseAutoFoc;
231
+ (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
232
+ if (!event.defaultPrevented) {
233
+ var _context$triggerRef$c2;
234
+ if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
235
+ event.preventDefault();
236
+ }
237
+ hasInteractedOutsideRef.current = false;
238
+ },
239
+ onInteractOutside: (event)=>{
240
+ var _props$onInteractOuts, _context$triggerRef$c3;
241
+ (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
242
+ if (!event.defaultPrevented) hasInteractedOutsideRef.current = true; // Prevent dismissing when clicking the trigger.
243
+ // As the trigger is already setup to close, without doing so would
244
+ // cause it to close and immediately open.
245
+ //
246
+ // We use `onInteractOutside` as some browsers also
247
+ // focus on pointer down, creating the same issue.
248
+ const target = event.target;
249
+ const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
250
+ if (targetIsTrigger) event.preventDefault();
251
+ }
252
+ }));
253
+ });
254
+ /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
255
+ const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
256
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
257
+ const contentRef = $67UHm$useRef(null);
258
+ const composedRefs = $67UHm$useComposedRefs(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
259
+ // the last element in the DOM (beacuse of the `Portal`)
260
+ $67UHm$useFocusGuards();
261
+ return /*#__PURE__*/ $67UHm$createElement($67UHm$Fragment, null, /*#__PURE__*/ $67UHm$createElement($67UHm$FocusScope, {
262
+ asChild: true,
263
+ loop: true,
264
+ trapped: trapFocus,
265
+ onMountAutoFocus: onOpenAutoFocus,
266
+ onUnmountAutoFocus: onCloseAutoFocus
267
+ }, /*#__PURE__*/ $67UHm$createElement($67UHm$DismissableLayer, $67UHm$babelruntimehelpersesmextends({
268
+ role: "dialog",
269
+ id: context.contentId,
270
+ "aria-describedby": context.descriptionId,
271
+ "aria-labelledby": context.titleId,
272
+ "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
273
+ }, contentProps, {
274
+ ref: composedRefs,
275
+ onDismiss: ()=>context.onOpenChange(false)
276
+ }))), false);
277
+ });
278
+ /* -------------------------------------------------------------------------------------------------
279
+ * DialogTitle
280
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
281
+ const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
282
+ const { __scopeDialog: __scopeDialog , ...titleProps } = props;
283
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
284
+ return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.h2, $67UHm$babelruntimehelpersesmextends({
285
+ id: context.titleId
286
+ }, titleProps, {
287
+ ref: forwardedRef
288
+ }));
289
+ });
290
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$16f7638e4a34b909, {
291
+ displayName: $5d3850c4d0b4e6c7$var$TITLE_NAME
292
+ });
293
+ /* -------------------------------------------------------------------------------------------------
294
+ * DialogDescription
295
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
296
+ const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
297
+ const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
298
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
299
+ return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.p, $67UHm$babelruntimehelpersesmextends({
300
+ id: context.descriptionId
301
+ }, descriptionProps, {
302
+ ref: forwardedRef
303
+ }));
304
+ });
305
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$94e94c2ec2c954d5, {
306
+ displayName: $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME
307
+ });
308
+ /* -------------------------------------------------------------------------------------------------
309
+ * DialogClose
310
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = 'DialogClose';
311
+ const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
312
+ const { __scopeDialog: __scopeDialog , ...closeProps } = props;
313
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
314
+ return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.button, $67UHm$babelruntimehelpersesmextends({
315
+ type: "button"
316
+ }, closeProps, {
317
+ ref: forwardedRef,
318
+ onClick: $67UHm$composeEventHandlers(props.onClick, ()=>context.onOpenChange(false)
319
+ )
320
+ }));
321
+ });
322
+ /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac, {
323
+ displayName: $5d3850c4d0b4e6c7$var$CLOSE_NAME
324
+ });
325
+ /* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
326
+ return open ? 'open' : 'closed';
327
+ }
328
+ const $5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME = 'DialogTitleWarning';
329
+ const [$5d3850c4d0b4e6c7$export$69b62a49393917d6, $5d3850c4d0b4e6c7$var$useWarningContext] = $67UHm$createContext($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME, {
330
+ contentName: $5d3850c4d0b4e6c7$var$CONTENT_NAME,
331
+ titleName: $5d3850c4d0b4e6c7$var$TITLE_NAME,
332
+ docsSlug: 'dialog'
333
+ });
334
+ const $5d3850c4d0b4e6c7$var$TitleWarning = ({ titleId: titleId })=>{
335
+ const titleWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME);
336
+ const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
337
+
338
+ If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
339
+
340
+ For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
341
+ $67UHm$useEffect(()=>{
342
+ if (titleId) {
343
+ const hasTitle = document.getElementById(titleId);
344
+ if (!hasTitle) throw new Error(MESSAGE);
345
+ }
346
+ }, [
347
+ MESSAGE,
348
+ titleId
349
+ ]);
350
+ return null;
351
+ };
352
+ const $5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';
353
+ const $5d3850c4d0b4e6c7$var$DescriptionWarning = ({ contentRef: contentRef , descriptionId: descriptionId })=>{
354
+ const descriptionWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME);
355
+ const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
356
+ $67UHm$useEffect(()=>{
357
+ var _contentRef$current;
358
+ const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined}
359
+ if (descriptionId && describedById) {
360
+ const hasDescription = document.getElementById(descriptionId);
361
+ if (!hasDescription) console.warn(MESSAGE);
362
+ }
363
+ }, [
364
+ MESSAGE,
365
+ contentRef,
366
+ descriptionId
367
+ ]);
368
+ return null;
369
+ };
370
+ const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
371
+ const $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 = $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88;
372
+ const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
373
+ const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
374
+ const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
375
+ const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f7638e4a34b909;
376
+ const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
377
+ const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
378
+
379
+
380
+
381
+
382
+ export {$5d3850c4d0b4e6c7$export$cc702773b8ea3e41 as createDialogScope, $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 as Dialog, $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 as DialogTrigger, $5d3850c4d0b4e6c7$export$dad7c95542bacce0 as DialogPortal, $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 as DialogOverlay, $5d3850c4d0b4e6c7$export$b6d9565de1e068cf as DialogContent, $5d3850c4d0b4e6c7$export$16f7638e4a34b909 as DialogTitle, $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 as DialogDescription, $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac as DialogClose, $5d3850c4d0b4e6c7$export$69b62a49393917d6 as WarningProvider, $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 as Root, $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 as Trigger, $5d3850c4d0b4e6c7$export$602eac185826482c as Portal, $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff as Overlay, $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 as Content, $5d3850c4d0b4e6c7$export$f99233281efd08a0 as Title, $5d3850c4d0b4e6c7$export$393edc798c47379d as Description, $5d3850c4d0b4e6c7$export$f39c2d165cd861fe as Close};
2
383
  //# sourceMappingURL=index.module.js.map
@@ -1 +1 @@
1
- {"mappings":"m3BAuBA,MAGOA,EAAqBC,GAAqBC,EAH7B,yCAkBpB,MAAOC,EAAgBC,GAAoBJ,EAlBvB,iBAiCpB,MAAMK,OAAiCC,IACrC,MAAMC,cACJA,EADIC,SAEJA,EACAC,KAAMC,EAHFC,YAIJA,EAJIC,aAKJA,EALIC,MAMJA,GAAQ,EANJC,eAOJA,GACER,EACES,EAAaC,EAAMC,OAA0B,MAC7CC,EAAaF,EAAMC,OAA6B,OAC/CR,GAAO,EAAOU,GAAWC,EAAqB,CACnDC,KAAMX,EACNY,YAAaX,EACbY,SAAUX,iBAGZ,OACEY,EAAAC,cAACC,EAAD,CACEC,MAAOpB,EACPQ,WAAYA,EACZG,WAAYA,EACZU,UAAWC,IACXC,QAASD,IACTE,cAAeF,IACfpB,KAAMA,EACNG,aAAcO,EACda,aAAchB,EAAMiB,aAAY,IAAMd,GAASe,IAAcA,KAAW,CAACf,IACzEN,MAAOA,EACPC,eAAgBA,GAEfN,wBAiBP,MAAM2B,2BAAgBnB,EAAMoB,YAC1B,CAAC9B,EAAwC+B,KACvC,MAAM9B,cAAEA,KAAkB+B,GAAiBhC,EACrCiC,EAAUnC,EATC,gBAS8BG,GACzCiC,EAAqBC,EAAgBJ,EAAcE,EAAQxB,yBACjE,OACES,EAAAC,cAACiB,EAAUC,OAAXC,EAAA,CACEC,KAAK,SACL,gBAAc,SACd,gBAAeN,EAAQ9B,KACvB,gBAAe8B,EAAQX,UACvB,aAAYkB,EAASP,EAAQ9B,OACzB6B,EANN,CAOES,IAAKP,EACLQ,QAASC,EAAqB3C,EAAM0C,QAAST,EAAQP,iCAY7D,MA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ent":["import * 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 { UnstablePortal } 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 { Slot } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentRef: React.RefObject<DialogContentElement>;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n allowPinchZoom: DialogProps['allowPinchZoom'];\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME);\n\ntype RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;\ninterface DialogProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];\n children?: React.ReactNode;\n}\n\nconst Dialog: React.FC<DialogProps> = (props: ScopedProps<DialogProps>) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n allowPinchZoom,\n } = props;\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const contentRef = React.useRef<DialogContentElement>(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId()}\n titleId={useId()}\n descriptionId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n allowPinchZoom={allowPinchZoom}\n >\n {children}\n </DialogProvider>\n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n (props: ScopedProps<DialogTriggerProps>, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n <Primitive.button\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);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof UnstablePortal>;\ninterface DialogPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n {React.Children.map(children, (child) => (\n <Presence present={forceMount || context.open}>\n <UnstablePortal asChild container={container}>\n {child}\n </UnstablePortal>\n </Presence>\n ))}\n </PortalProvider>\n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef<DialogOverlayElement, DialogOverlayProps>(\n (props: ScopedProps<DialogOverlayProps>, 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 ? (\n <Presence present={forceMount || context.open}>\n <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n </Presence>\n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst DialogOverlayImpl = React.forwardRef<DialogOverlayImplElement, DialogOverlayImplProps>(\n (props: ScopedProps<DialogOverlayImplProps>, 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 <RemoveScroll as={Slot} allowPinchZoom={context.allowPinchZoom} shards={[context.contentRef]}>\n <Primitive.div\n data-state={getState(context.open)}\n {...overlayProps}\n ref={forwardedRef}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n style={{ pointerEvents: 'auto', ...overlayProps.style }}\n />\n </RemoveScroll>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n (props: ScopedProps<DialogContentProps>, 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 (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst DialogContentModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents\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\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true;\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ElementRef<typeof DismissableLayer>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ninterface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef<DialogContentImplElement, DialogContentImplProps>(\n (props: ScopedProps<DialogContentImplProps>, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\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 </FocusScope>\n {process.env.NODE_ENV !== 'production' && (\n <>\n <TitleWarning titleId={context.titleId} />\n <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />\n </>\n )}\n </>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ElementRef<typeof Primitive.h2>;\ntype PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props: ScopedProps<DialogTitleProps>, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return <Primitive.h2 id={context.titleId} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ElementRef<typeof Primitive.p>;\ntype PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return <Primitive.p id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n (props: ScopedProps<DialogCloseProps>, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC<TitleWarningProps> = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\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\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) throw new Error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<DialogContentElement>;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"],"names":["createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","allowPinchZoom","triggerRef","React","useRef","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","_react","createElement","$da81f3af863821fb8a193d321c41d$var$DialogProvider","scope","contentId","useId","titleId","descriptionId","onOpenToggle","useCallback","prevOpen","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","_babelRuntimeHelpersEsmExtends","type","getState","ref","onClick","composeEventHandlers","PortalProvider","usePortalContext","forceMount","undefined","DialogPortal","container","$da81f3af863821fb8a193d321c41d$var$PortalProvider","Children","map","child","Presence","present","UnstablePortal","asChild","DialogOverlay","portalContext","overlayProps","$da81f3af863821fb8a193d321c41d$var$DialogOverlayImpl","DialogOverlayImpl","RemoveScroll","as","Slot","shards","div","style","pointerEvents","DialogContent","contentProps","$da81f3af863821fb8a193d321c41d$var$DialogContentModal","$da81f3af863821fb8a193d321c41d$var$DialogContentNonModal","DialogContentModal","composedRefs","useEffect","content","current","hideOthers","$da81f3af863821fb8a193d321c41d$var$DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","_context$triggerRef$c","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","DialogContentNonModal","hasInteractedOutsideRef","_props$onCloseAutoFoc","_context$triggerRef$c2","call","defaultPrevented","onInteractOutside","_props$onInteractOuts","_context$triggerRef$c3","target","contains","DialogContentImpl","onOpenAutoFocus","useFocusGuards","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","DialogTitle","titleProps","h2","DialogDescription","descriptionProps","p","DialogClose","closeProps","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"version":3,"file":"index.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A;;;;;;;;;;;;;;;;ACmBA;;oGAEA,CAEA,MAAMgB,iCAAW,GAAG,QAApB,AAAA;AAGA,MAAM,CAACC,yCAAD,EAAsBC,yCAAtB,CAAA,GAA2Cd,yBAAkB,CAACY,iCAAD,CAAnE,AAAA;AAeA,MAAM,CAACG,oCAAD,EAAiBC,sCAAjB,CAAA,GAAqCH,yCAAmB,CAAqBD,iCAArB,CAA9D,AAAA;AAeA,MAAMK,yCAA6B,GAAIC,CAAAA,KAAD,GAAqC;IACzE,MAA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AAD,CAAnD,AAAA;IACA,MAAML,OAAO,GAAI,CAAA,0EAAA,EAA4EO,yBAAyB,CAACZ,WAAY,CAAA,EAAA,CAAnI,AAAA;IAEAnH,gBAAA,CAAgB,IAAM;QAAA,IAAA,mBAAA,AAAA;QACpB,MAAMgI,aAAa,GAAA,AAAA,CAAA,mBAAA,GAAG/F,UAAU,CAAC0C,OAAd,CAAA,KAAA,IAAA,IAAA,mBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAG,mBAAA,CAAoBsD,YAApB,CAAiC,kBAAjC,CAAtB,AADoB,EAEpB,wEADA;QAEA,IAAI/B,aAAa,IAAI8B,aAArB,EAAoC;YAClC,MAAME,cAAc,GAAGR,QAAQ,CAACC,cAAT,CAAwBzB,aAAxB,CAAvB,AAAA;YACA,IAAI,CAACgC,cAAL,EAAqBC,OAAO,CAACC,IAAR,CAAaZ,OAAb,CAArB,CAAA;SACD;KANH,EAOG;QAACA,OAAD;QAAUvF,UAAV;QAAsBiE,aAAtB;KAPH,CAOC,CAAA;IAED,OAAO,IAAP,CAAA;CAbF,AAcC;AAED,MAAMmC,yCAAI,GAAGhH,yCAAb,AAAA;AACA,MAAMiH,yCAAO,GAAG7F,yCAAhB,AAAA;AACA,MAAM8F,yCAAM,GAAG/E,yCAAf,AAAA;AACA,MAAMgF,yCAAO,GAAG1E,yCAAhB,AAAA;AACA,MAAM2E,yCAAO,GAAGpE,yCAAhB,AAAA;AACA,MAAMqE,yCAAK,GAAGlC,yCAAd,AAAA;AACA,MAAMmC,yCAAW,GAAGhC,yCAApB,AAAA;AACA,MAAMiC,yCAAK,GAAG9B,yCAAd,AAAA;;ADliBA","sources":["packages/react/dialog/src/index.ts","packages/react/dialog/src/Dialog.tsx"],"sourcesContent":["export * from './Dialog';\n","import * 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 { UnstablePortal } 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 { Slot } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement>;\n contentRef: React.RefObject<DialogContentElement>;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n allowPinchZoom: DialogProps['allowPinchZoom'];\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME);\n\ntype RemoveScrollProps = React.ComponentProps<typeof RemoveScroll>;\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n /**\n * @see https://github.com/theKashey/react-remove-scroll#usage\n */\n allowPinchZoom?: RemoveScrollProps['allowPinchZoom'];\n}\n\nconst Dialog: React.FC<DialogProps> = (props: ScopedProps<DialogProps>) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n allowPinchZoom,\n } = props;\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const contentRef = React.useRef<DialogContentElement>(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId()}\n titleId={useId()}\n descriptionId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n allowPinchZoom={allowPinchZoom}\n >\n {children}\n </DialogProvider>\n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ElementRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n (props: ScopedProps<DialogTriggerProps>, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n <Primitive.button\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);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof UnstablePortal>;\ninterface DialogPortalProps extends Omit<PortalProps, 'asChild'> {\n children?: React.ReactNode;\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n {React.Children.map(children, (child) => (\n <Presence present={forceMount || context.open}>\n <UnstablePortal asChild container={container}>\n {child}\n </UnstablePortal>\n </Presence>\n ))}\n </PortalProvider>\n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef<DialogOverlayElement, DialogOverlayProps>(\n (props: ScopedProps<DialogOverlayProps>, 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 ? (\n <Presence present={forceMount || context.open}>\n <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n </Presence>\n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst DialogOverlayImpl = React.forwardRef<DialogOverlayImplElement, DialogOverlayImplProps>(\n (props: ScopedProps<DialogOverlayImplProps>, 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 <RemoveScroll as={Slot} allowPinchZoom={context.allowPinchZoom} shards={[context.contentRef]}>\n <Primitive.div\n data-state={getState(context.open)}\n {...overlayProps}\n ref={forwardedRef}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n style={{ pointerEvents: 'auto', ...overlayProps.style }}\n />\n </RemoveScroll>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n (props: ScopedProps<DialogContentProps>, 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 (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst DialogContentModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents\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\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) hasInteractedOutsideRef.current = true;\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n //\n // We use `onInteractOutside` as some browsers also\n // focus on pointer down, creating the same issue.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ElementRef<typeof DismissableLayer>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ninterface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef<DialogContentImplElement, DialogContentImplProps>(\n (props: ScopedProps<DialogContentImplProps>, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (beacuse of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\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 </FocusScope>\n {process.env.NODE_ENV !== 'production' && (\n <>\n <TitleWarning titleId={context.titleId} />\n <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />\n </>\n )}\n </>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ElementRef<typeof Primitive.h2>;\ntype PrimitiveHeading2Props = Radix.ComponentPropsWithoutRef<typeof Primitive.h2>;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props: ScopedProps<DialogTitleProps>, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return <Primitive.h2 id={context.titleId} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ElementRef<typeof Primitive.p>;\ntype PrimitiveParagraphProps = Radix.ComponentPropsWithoutRef<typeof Primitive.p>;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return <Primitive.p id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ElementRef<typeof Primitive.button>;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n (props: ScopedProps<DialogCloseProps>, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC<TitleWarningProps> = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\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\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) throw new Error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<DialogContentElement>;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"],"names":["React","composeEventHandlers","useComposedRefs","createContext","createContextScope","useId","useControllableState","DismissableLayer","FocusScope","UnstablePortal","Presence","Primitive","useFocusGuards","RemoveScroll","hideOthers","Slot","DIALOG_NAME","createDialogContext","createDialogScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","allowPinchZoom","triggerRef","useRef","contentRef","setOpen","prop","defaultProp","onChange","useCallback","prevOpen","TRIGGER_NAME","DialogTrigger","forwardRef","forwardedRef","triggerProps","context","composedTriggerRef","contentId","getState","onClick","onOpenToggle","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","undefined","DialogPortal","container","Children","map","child","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","pointerEvents","style","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","composedRefs","useEffect","content","current","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","button","ctrlKey","isRightClick","onFocusOutside","DialogContentNonModal","hasInteractedOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","DialogContentImpl","trapFocus","onOpenAutoFocus","descriptionId","titleId","process","env","NODE_ENV","TITLE_NAME","DialogTitle","titleProps","DESCRIPTION_NAME","DialogDescription","descriptionProps","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","contentName","titleName","docsSlug","TitleWarning","titleWarningContext","MESSAGE","hasTitle","document","getElementById","Error","DESCRIPTION_WARNING_NAME","DescriptionWarning","descriptionWarningContext","describedById","getAttribute","hasDescription","console","warn","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"version":3,"file":"index.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ui/react-dialog",
3
- "version": "0.1.8-rc.1",
3
+ "version": "0.1.8-rc.12",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -18,23 +18,23 @@
18
18
  "dependencies": {
19
19
  "@babel/runtime": "^7.13.10",
20
20
  "@radix-ui/primitive": "0.1.0",
21
- "@radix-ui/react-compose-refs": "0.1.0",
22
- "@radix-ui/react-context": "0.1.1",
23
- "@radix-ui/react-dismissable-layer": "0.1.5",
24
- "@radix-ui/react-focus-guards": "0.1.0",
25
- "@radix-ui/react-focus-scope": "0.1.4",
26
- "@radix-ui/react-id": "0.1.5",
27
- "@radix-ui/react-portal": "0.1.4",
28
- "@radix-ui/react-presence": "0.1.2",
29
- "@radix-ui/react-primitive": "0.1.4",
30
- "@radix-ui/react-slot": "0.1.2",
31
- "@radix-ui/react-use-controllable-state": "0.1.0",
21
+ "@radix-ui/react-compose-refs": "0.1.1-rc.5",
22
+ "@radix-ui/react-context": "0.1.2-rc.5",
23
+ "@radix-ui/react-dismissable-layer": "0.1.6-rc.5",
24
+ "@radix-ui/react-focus-guards": "0.1.1-rc.5",
25
+ "@radix-ui/react-focus-scope": "0.1.5-rc.5",
26
+ "@radix-ui/react-id": "0.1.6-rc.5",
27
+ "@radix-ui/react-portal": "0.1.5-rc.5",
28
+ "@radix-ui/react-presence": "0.1.3-rc.5",
29
+ "@radix-ui/react-primitive": "0.1.5-rc.5",
30
+ "@radix-ui/react-slot": "0.1.3-rc.5",
31
+ "@radix-ui/react-use-controllable-state": "0.1.1-rc.5",
32
32
  "aria-hidden": "^1.1.1",
33
33
  "react-remove-scroll": "^2.4.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "react": "^16.8 || ^17.0",
37
- "react-dom": "^16.8 || ^17.0"
36
+ "react": "^16.8 || ^17.0 || ^18.0",
37
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
38
38
  },
39
39
  "homepage": "https://radix-ui.com/primitives",
40
40
  "repository": {