react-aria-components 3.0.0-nightly-148fcf175-250407 → 3.0.0-nightly-ad4681f74-250408

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.
@@ -78,6 +78,8 @@ const $85ae22f3b2559b04$export$aec8299548648839 = /*#__PURE__*/ (0, $k1tmY$react
78
78
  const $85ae22f3b2559b04$export$aaae3dd1f909c692 = /*#__PURE__*/ (0, $k1tmY$react.forwardRef)(function ColorWheelTrack(props, ref) {
79
79
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $85ae22f3b2559b04$export$aec8299548648839);
80
80
  let state = (0, $k1tmY$react.useContext)($85ae22f3b2559b04$export$f5327df9fc840d47);
81
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
82
+ let { className: className, style: style, ...rest } = props;
81
83
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
82
84
  ...props,
83
85
  defaultClassName: 'react-aria-ColorWheelTrack',
@@ -86,9 +88,8 @@ const $85ae22f3b2559b04$export$aaae3dd1f909c692 = /*#__PURE__*/ (0, $k1tmY$react
86
88
  state: state
87
89
  }
88
90
  });
89
- let DOMProps = (0, $k1tmY$reactariautils.filterDOMProps)(props);
90
91
  return /*#__PURE__*/ (0, ($parcel$interopDefault($k1tmY$react))).createElement("div", {
91
- ...DOMProps,
92
+ ...rest,
92
93
  ...renderProps,
93
94
  ref: ref,
94
95
  "data-disabled": state.isDisabled || undefined
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAChH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,2CAAgB;IAC3D,IAAI,QAAQ,CAAA,GAAA,sCAAiB,E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ACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;;AAEzC","sources":["packages/react-aria-components/src/ColorWheel.tsx"],"sourcesContent":["import {AriaColorWheelOptions, useColorWheel} from 'react-aria';\nimport {ColorWheelContext} from './RSPContexts';\nimport {ColorWheelState, useColorWheelState} from 'react-stately';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DOMProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, useContext, useRef} from 'react';\n\nexport interface ColorWheelRenderProps {\n /**\n * Whether the color wheel is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the color color wheel.\n */\n state: ColorWheelState\n}\n\nexport interface ColorWheelProps extends AriaColorWheelOptions, RenderProps<ColorWheelRenderProps>, SlotProps {}\n\nexport const ColorWheelStateContext = createContext<ColorWheelState | null>(null);\n\n/**\n * A color wheel allows users to adjust the hue of an HSL or HSB color value on a circular track.\n */\nexport const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelContext);\n let state = useColorWheelState(props);\n let inputRef = useRef(null);\n let {trackProps, inputProps, thumbProps} = useColorWheel(props, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false\n },\n defaultClassName: 'react-aria-ColorWheel',\n defaultStyle: {\n position: 'relative'\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [ColorWheelStateContext, state],\n [ColorWheelTrackContext, trackProps],\n [InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport interface ColorWheelTrackRenderProps extends ColorWheelRenderProps {}\nexport interface ColorWheelTrackProps extends StyleRenderProps<ColorWheelTrackRenderProps>, DOMProps {}\ninterface ColorWheelTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, ColorWheelTrackProps {}\n\nexport const ColorWheelTrackContext = createContext<ContextValue<ColorWheelTrackContextValue, HTMLDivElement>>(null);\n\n/**\n * A color wheel track renders a circular gradient track.\n */\nexport const ColorWheelTrack = forwardRef(function ColorWheelTrack(props: ColorWheelTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelTrackContext);\n let state = useContext(ColorWheelStateContext)!;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ColorWheelTrack',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n let DOMProps = filterDOMProps(props);\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ColorWheel.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,0DAAa,CAAA,GAAA,uBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAChH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,2CAAgB;IAC3D,IAAI,QAAQ,CAAA,GAAA,sCAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,8BAAY,EAAE,OAAO,OAAO;IAEvE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;mBACN;YACA,YAAY,MAAM,UAAU,IAAI;QAClC;QACA,kBAAkB;QAClB,cAAc;YACZ,UAAU;QACZ;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAwB;aAAM;YAC/B;gBAAC;gBAAwB;aAAW;YACpC;gBAAC,CAAA,GAAA,mDAAwB;gBAAG;2BAAC;gCAAO;oBAAY,WAAW;oBAAU,aAAa;oBAAY,YAAY,MAAM,UAAU;gBAAA;aAAE;SAC7H;OACA,YAAY,QAAQ;AAI7B;AAMO,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA6D;AAKxG,MAAM,0DAAkB,CAAA,GAAA,uBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IAC/H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,uBAAS,EAAE;IACvB,6DAA6D;IAC7D,IAAI,aAAC,SAAS,SAAE,KAAK,EAAE,GAAG,MAAK,GAAG;IAElC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,IAAI;QACP,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;;AAEzC","sources":["packages/react-aria-components/src/ColorWheel.tsx"],"sourcesContent":["import {AriaColorWheelOptions, useColorWheel} from 'react-aria';\nimport {ColorWheelContext} from './RSPContexts';\nimport {ColorWheelState, useColorWheelState} from 'react-stately';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DOMProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, useContext, useRef} from 'react';\n\nexport interface ColorWheelRenderProps {\n /**\n * Whether the color wheel is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the color color wheel.\n */\n state: ColorWheelState\n}\n\nexport interface ColorWheelProps extends AriaColorWheelOptions, RenderProps<ColorWheelRenderProps>, SlotProps {}\n\nexport const ColorWheelStateContext = createContext<ColorWheelState | null>(null);\n\n/**\n * A color wheel allows users to adjust the hue of an HSL or HSB color value on a circular track.\n */\nexport const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelContext);\n let state = useColorWheelState(props);\n let inputRef = useRef(null);\n let {trackProps, inputProps, thumbProps} = useColorWheel(props, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false\n },\n defaultClassName: 'react-aria-ColorWheel',\n defaultStyle: {\n position: 'relative'\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [ColorWheelStateContext, state],\n [ColorWheelTrackContext, trackProps],\n [InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport interface ColorWheelTrackRenderProps extends ColorWheelRenderProps {}\nexport interface ColorWheelTrackProps extends StyleRenderProps<ColorWheelTrackRenderProps>, DOMProps {}\ninterface ColorWheelTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, ColorWheelTrackProps {}\n\nexport const ColorWheelTrackContext = createContext<ContextValue<ColorWheelTrackContextValue, HTMLDivElement>>(null);\n\n/**\n * A color wheel track renders a circular gradient track.\n */\nexport const ColorWheelTrack = forwardRef(function ColorWheelTrack(props: ColorWheelTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelTrackContext);\n let state = useContext(ColorWheelStateContext)!;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {className, style, ...rest} = props;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ColorWheelTrack',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <div\n {...rest}\n {...renderProps}\n ref={ref}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ColorWheel.main.js.map"}
@@ -65,6 +65,8 @@ const $66beab92e74e495f$export$aec8299548648839 = /*#__PURE__*/ (0, $fp8U1$creat
65
65
  const $66beab92e74e495f$export$aaae3dd1f909c692 = /*#__PURE__*/ (0, $fp8U1$forwardRef)(function ColorWheelTrack(props, ref) {
66
66
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $66beab92e74e495f$export$aec8299548648839);
67
67
  let state = (0, $fp8U1$useContext)($66beab92e74e495f$export$f5327df9fc840d47);
68
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
+ let { className: className, style: style, ...rest } = props;
68
70
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
69
71
  ...props,
70
72
  defaultClassName: 'react-aria-ColorWheelTrack',
@@ -73,9 +75,8 @@ const $66beab92e74e495f$export$aaae3dd1f909c692 = /*#__PURE__*/ (0, $fp8U1$forwa
73
75
  state: state
74
76
  }
75
77
  });
76
- let DOMProps = (0, $fp8U1$filterDOMProps)(props);
77
78
  return /*#__PURE__*/ (0, $fp8U1$react).createElement("div", {
78
- ...DOMProps,
79
+ ...rest,
79
80
  ...renderProps,
80
81
  ref: ref,
81
82
  "data-disabled": state.isDisabled || undefined
@@ -65,6 +65,8 @@ const $66beab92e74e495f$export$aec8299548648839 = /*#__PURE__*/ (0, $fp8U1$creat
65
65
  const $66beab92e74e495f$export$aaae3dd1f909c692 = /*#__PURE__*/ (0, $fp8U1$forwardRef)(function ColorWheelTrack(props, ref) {
66
66
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $66beab92e74e495f$export$aec8299548648839);
67
67
  let state = (0, $fp8U1$useContext)($66beab92e74e495f$export$f5327df9fc840d47);
68
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
+ let { className: className, style: style, ...rest } = props;
68
70
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
69
71
  ...props,
70
72
  defaultClassName: 'react-aria-ColorWheelTrack',
@@ -73,9 +75,8 @@ const $66beab92e74e495f$export$aaae3dd1f909c692 = /*#__PURE__*/ (0, $fp8U1$forwa
73
75
  state: state
74
76
  }
75
77
  });
76
- let DOMProps = (0, $fp8U1$filterDOMProps)(props);
77
78
  return /*#__PURE__*/ (0, $fp8U1$react).createElement("div", {
78
- ...DOMProps,
79
+ ...rest,
79
80
  ...renderProps,
80
81
  ref: ref,
81
82
  "data-disabled": state.isDisabled || undefined
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAuBO,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAKrE,MAAM,0DAAa,CAAA,GAAA,iBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAChH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,yCAAgB;IAC3D,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE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":["import {AriaColorWheelOptions, useColorWheel} from 'react-aria';\nimport {ColorWheelContext} from './RSPContexts';\nimport {ColorWheelState, useColorWheelState} from 'react-stately';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DOMProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, useContext, useRef} from 'react';\n\nexport interface ColorWheelRenderProps {\n /**\n * Whether the color wheel is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the color color wheel.\n */\n state: ColorWheelState\n}\n\nexport interface ColorWheelProps extends AriaColorWheelOptions, RenderProps<ColorWheelRenderProps>, SlotProps {}\n\nexport const ColorWheelStateContext = createContext<ColorWheelState | null>(null);\n\n/**\n * A color wheel allows users to adjust the hue of an HSL or HSB color value on a circular track.\n */\nexport const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelContext);\n let state = useColorWheelState(props);\n let inputRef = useRef(null);\n let {trackProps, inputProps, thumbProps} = useColorWheel(props, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false\n },\n defaultClassName: 'react-aria-ColorWheel',\n defaultStyle: {\n position: 'relative'\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [ColorWheelStateContext, state],\n [ColorWheelTrackContext, trackProps],\n [InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport interface ColorWheelTrackRenderProps extends ColorWheelRenderProps {}\nexport interface ColorWheelTrackProps extends StyleRenderProps<ColorWheelTrackRenderProps>, DOMProps {}\ninterface ColorWheelTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, ColorWheelTrackProps {}\n\nexport const ColorWheelTrackContext = createContext<ContextValue<ColorWheelTrackContextValue, HTMLDivElement>>(null);\n\n/**\n * A color wheel track renders a circular gradient track.\n */\nexport const ColorWheelTrack = forwardRef(function ColorWheelTrack(props: ColorWheelTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelTrackContext);\n let state = useContext(ColorWheelStateContext)!;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ColorWheelTrack',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n let DOMProps = filterDOMProps(props);\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ColorWheel.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAuBO,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAKrE,MAAM,0DAAa,CAAA,GAAA,iBAAS,EAAE,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAChH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,yCAAgB;IAC3D,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE,OAAO,OAAO;IAEvE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;mBACN;YACA,YAAY,MAAM,UAAU,IAAI;QAClC;QACA,kBAAkB;QAClB,cAAc;YACZ,UAAU;QACZ;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAwB;aAAM;YAC/B;gBAAC;gBAAwB;aAAW;YACpC;gBAAC,CAAA,GAAA,yCAAwB;gBAAG;2BAAC;gCAAO;oBAAY,WAAW;oBAAU,aAAa;oBAAY,YAAY,MAAM,UAAU;gBAAA;aAAE;SAC7H;OACA,YAAY,QAAQ;AAI7B;AAMO,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA6D;AAKxG,MAAM,0DAAkB,CAAA,GAAA,iBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IAC/H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE;IACvB,6DAA6D;IAC7D,IAAI,aAAC,SAAS,SAAE,KAAK,EAAE,GAAG,MAAK,GAAG;IAElC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,IAAI;QACP,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;;AAEzC","sources":["packages/react-aria-components/src/ColorWheel.tsx"],"sourcesContent":["import {AriaColorWheelOptions, useColorWheel} from 'react-aria';\nimport {ColorWheelContext} from './RSPContexts';\nimport {ColorWheelState, useColorWheelState} from 'react-stately';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DOMProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {InternalColorThumbContext} from './ColorThumb';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, useContext, useRef} from 'react';\n\nexport interface ColorWheelRenderProps {\n /**\n * Whether the color wheel is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the color color wheel.\n */\n state: ColorWheelState\n}\n\nexport interface ColorWheelProps extends AriaColorWheelOptions, RenderProps<ColorWheelRenderProps>, SlotProps {}\n\nexport const ColorWheelStateContext = createContext<ColorWheelState | null>(null);\n\n/**\n * A color wheel allows users to adjust the hue of an HSL or HSB color value on a circular track.\n */\nexport const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelContext);\n let state = useColorWheelState(props);\n let inputRef = useRef(null);\n let {trackProps, inputProps, thumbProps} = useColorWheel(props, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false\n },\n defaultClassName: 'react-aria-ColorWheel',\n defaultStyle: {\n position: 'relative'\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}>\n <Provider\n values={[\n [ColorWheelStateContext, state],\n [ColorWheelTrackContext, trackProps],\n [InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport interface ColorWheelTrackRenderProps extends ColorWheelRenderProps {}\nexport interface ColorWheelTrackProps extends StyleRenderProps<ColorWheelTrackRenderProps>, DOMProps {}\ninterface ColorWheelTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, ColorWheelTrackProps {}\n\nexport const ColorWheelTrackContext = createContext<ContextValue<ColorWheelTrackContextValue, HTMLDivElement>>(null);\n\n/**\n * A color wheel track renders a circular gradient track.\n */\nexport const ColorWheelTrack = forwardRef(function ColorWheelTrack(props: ColorWheelTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ColorWheelTrackContext);\n let state = useContext(ColorWheelStateContext)!;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {className, style, ...rest} = props;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ColorWheelTrack',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <div\n {...rest}\n {...renderProps}\n ref={ref}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ColorWheel.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiCM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAAmD;AAC3F,MAAM,2DAAuB,CAAA,GAAA,0BAAY,EAAoC;AAsBtE,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,MAAM,KAAwB,EAAE,GAAiC;IAC1I,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IAErB,IAAI,KACF,qBAAO,0DAAC;QAAc,GAAG,KAAK;QAAE,UAAU;OAAM,MAAM,QAAQ;IAGhE,IAAI,iBACF,aAAa,6BACb,yBAAyB,UACzB,MAAM,eACN,WAAW,gBACX,YAAY,YACZ,QAAQ,cACR,UAAU,aACV,SAAS,4BACT,wBAAwB,gCACxB,4BAA4B,EAC5B,GAAG,YACJ,GAAG;IAEJ,qBACE,0DAAC;QACC,eAAe;QACf,2BAA2B;QAC3B,QAAQ;QACR,aAAa;QACb,cAAc;QACd,YAAY;QACZ,WAAW;QACX,0BAA0B;QAC1B,8BAA8B;qBAC9B,0DAAC;QAAc,GAAG,UAAU;QAAE,UAAU;OACrC;AAIT;AASA,SAAS,iDAA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AAA,GAAA,oCAAa,EAAE,QAAe,WAAW;QACvD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,YAAY;QAC3B,gBAAc,aAAa;OAC1B,+BACC,0DAAC,CAAA,GAAA,8BAAY;QAAE,WAAW,MAAM,KAAK;QAEtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaModalOverlayProps, DismissButton, Overlay, useIsSSR, useModalOverlay} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DOMAttributes, forwardRefType, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useEnterAnimation, useExitAnimation, useObjectRef, useViewportSize} from '@react-aria/utils';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo, useRef} from 'react';\n\nexport interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {\n /**\n * Whether the modal is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the modal is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element\n}\n\ninterface InternalModalContextValue {\n modalProps: DOMAttributes,\n modalRef: RefObject<HTMLDivElement | null>,\n isExiting: boolean,\n isDismissable?: boolean\n}\n\nexport const ModalContext = createContext<ContextValue<ModalOverlayProps, HTMLDivElement>>(null);\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\nexport interface ModalRenderProps {\n /**\n * Whether the modal is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the modal is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the modal.\n */\n state: OverlayTriggerState\n}\n\n/**\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport const Modal = /*#__PURE__*/ (forwardRef as forwardRefType)(function Modal(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n let ctx = useContext(InternalModalContext);\n\n if (ctx) {\n return <ModalContent {...props} modalRef={ref}>{props.children}</ModalContent>;\n }\n\n let {\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n defaultOpen,\n onOpenChange,\n children,\n isEntering,\n isExiting,\n UNSTABLE_portalContainer,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n return (\n <ModalOverlay\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isEntering={isEntering}\n isExiting={isExiting}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}>\n <ModalContent {...otherProps} modalRef={ref}>\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n});\n\ninterface ModalOverlayInnerProps extends ModalOverlayProps {\n overlayRef: RefObject<HTMLDivElement | null>,\n modalRef: RefObject<HTMLDivElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean\n}\n\nfunction ModalOverlayWithForwardRef(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ModalContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n\n let objectRef = useObjectRef(ref);\n let modalRef = useRef<HTMLDivElement>(null);\n let isOverlayExiting = useExitAnimation(objectRef, state.isOpen);\n let isModalExiting = useExitAnimation(modalRef, state.isOpen);\n let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;\n let isSSR = useIsSSR();\n\n if ((!state.isOpen && !isExiting) || isSSR) {\n return null;\n }\n\n return (\n <ModalOverlayInner\n {...props}\n state={state}\n isExiting={isExiting}\n overlayRef={objectRef}\n modalRef={modalRef} />\n );\n}\n\n/**\n * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.\n */\nexport const ModalOverlay = /*#__PURE__*/ (forwardRef as forwardRefType)(ModalOverlayWithForwardRef);\n\nfunction ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInnerProps) {\n let modalRef = props.modalRef;\n let {state} = props;\n let {modalProps, underlayProps} = useModalOverlay(props, state, modalRef);\n\n let entering = useEnterAnimation(props.overlayRef) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ModalOverlay',\n values: {\n isEntering: entering,\n isExiting: props.isExiting,\n state\n }\n });\n\n let viewport = useViewportSize();\n let style = {\n ...renderProps.style,\n '--visual-viewport-height': viewport.height + 'px'\n };\n\n return (\n <Overlay isExiting={props.isExiting} portalContainer={UNSTABLE_portalContainer}>\n <div\n {...mergeProps(filterDOMProps(props as any), underlayProps)}\n {...renderProps}\n style={style}\n ref={props.overlayRef}\n data-entering={entering || undefined}\n data-exiting={props.isExiting || undefined}>\n <Provider\n values={[\n [InternalModalContext, {modalProps, modalRef, isExiting: props.isExiting, isDismissable: props.isDismissable}],\n [OverlayTriggerStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </Overlay>\n );\n}\n\ninterface ModalContentProps extends RenderProps<ModalRenderProps> {\n modalRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction ModalContent(props: ModalContentProps) {\n let {modalProps, modalRef, isExiting, isDismissable} = useContext(InternalModalContext)!;\n let state = useContext(OverlayTriggerStateContext)!;\n let mergedRefs = useMemo(() => mergeRefs(props.modalRef, modalRef), [props.modalRef, modalRef]);\n\n let ref = useObjectRef(mergedRefs);\n let entering = useEnterAnimation(ref);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Modal',\n values: {\n isEntering: entering,\n isExiting,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(filterDOMProps(props as any), modalProps)}\n {...renderProps}\n ref={ref}\n data-entering={entering || undefined}\n data-exiting={isExiting || undefined}>\n {isDismissable &&\n <DismissButton onDismiss={state.close} />\n }\n {renderProps.children}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Modal.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAkCM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAAmD;AAC3F,MAAM,2DAAuB,CAAA,GAAA,0BAAY,EAAoC;AAsBtE,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,MAAM,KAAwB,EAAE,GAAiC;IAC1I,IAAI,MAAM,CAAA,GAAA,uBAAS,EAAE;IAErB,IAAI,KACF,qBAAO,0DAAC;QAAc,GAAG,KAAK;QAAE,UAAU;OAAM,MAAM,QAAQ;IAGhE,IAAI,iBACF,aAAa,6BACb,yBAAyB,UACzB,MAAM,eACN,WAAW,gBACX,YAAY,YACZ,QAAQ,cACR,UAAU,aACV,SAAS,4BACT,wBAAwB,gCACxB,4BAA4B,EAC5B,GAAG,YACJ,GAAG;IAEJ,qBACE,0DAAC;QACC,eAAe;QACf,2BAA2B;QAC3B,QAAQ;QACR,aAAa;QACb,cAAc;QACd,YAAY;QACZ,WAAW;QACX,0BAA0B;QAC1B,8BAA8B;qBAC9B,0DAAC;QAAc,GAAG,UAAU;QAAE,UAAU;OACrC;AAIT;AAS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CAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,QAAe,WAAW;QACvD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,YAAY;QAC3B,gBAAc,aAAa;OAC1B,+BACC,0DAAC,CAAA,GAAA,8BAAY;QAAE,WAAW,MAAM,KAAK;QAEtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaModalOverlayProps, DismissButton, Overlay, useIsSSR, useModalOverlay} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DOMAttributes, forwardRefType, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useEnterAnimation, useExitAnimation, useObjectRef, useViewportSize} from '@react-aria/utils';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo, useRef} from 'react';\n\nexport interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {\n /**\n * Whether the modal is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the modal is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element\n}\n\ninterface InternalModalContextValue {\n modalProps: DOMAttributes,\n modalRef: RefObject<HTMLDivElement | null>,\n isExiting: boolean,\n isDismissable?: boolean\n}\n\nexport const ModalContext = createContext<ContextValue<ModalOverlayProps, HTMLDivElement>>(null);\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\nexport interface ModalRenderProps {\n /**\n * Whether the modal is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the modal is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the modal.\n */\n state: OverlayTriggerState\n}\n\n/**\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport const Modal = /*#__PURE__*/ (forwardRef as forwardRefType)(function Modal(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n let ctx = useContext(InternalModalContext);\n\n if (ctx) {\n return <ModalContent {...props} modalRef={ref}>{props.children}</ModalContent>;\n }\n\n let {\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n defaultOpen,\n onOpenChange,\n children,\n isEntering,\n isExiting,\n UNSTABLE_portalContainer,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n return (\n <ModalOverlay\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isEntering={isEntering}\n isExiting={isExiting}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}>\n <ModalContent {...otherProps} modalRef={ref}>\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n});\n\ninterface ModalOverlayInnerProps extends ModalOverlayProps {\n overlayRef: RefObject<HTMLDivElement | null>,\n modalRef: RefObject<HTMLDivElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean\n}\n\nfunction ModalOverlayWithForwardRef(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ModalContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n\n let objectRef = useObjectRef(ref);\n let modalRef = useRef<HTMLDivElement>(null);\n let isOverlayExiting = useExitAnimation(objectRef, state.isOpen);\n let isModalExiting = useExitAnimation(modalRef, state.isOpen);\n let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;\n let isSSR = useIsSSR();\n\n if ((!state.isOpen && !isExiting) || isSSR) {\n return null;\n }\n\n return (\n <ModalOverlayInner\n {...props}\n state={state}\n isExiting={isExiting}\n overlayRef={objectRef}\n modalRef={modalRef} />\n );\n}\n\n/**\n * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.\n */\nexport const ModalOverlay = /*#__PURE__*/ (forwardRef as forwardRefType)(ModalOverlayWithForwardRef);\n\nfunction ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInnerProps) {\n let modalRef = props.modalRef;\n let {state} = props;\n let {modalProps, underlayProps} = useModalOverlay(props, state, modalRef);\n\n let entering = useEnterAnimation(props.overlayRef) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ModalOverlay',\n values: {\n isEntering: entering,\n isExiting: props.isExiting,\n state\n }\n });\n\n let viewport = useViewportSize();\n let style = {\n ...renderProps.style,\n '--visual-viewport-height': viewport.height + 'px'\n };\n\n return (\n <Overlay isExiting={props.isExiting} portalContainer={UNSTABLE_portalContainer}>\n <div\n {...mergeProps(filterDOMProps(props as any), underlayProps)}\n {...renderProps}\n style={style}\n ref={props.overlayRef}\n data-entering={entering || undefined}\n data-exiting={props.isExiting || undefined}>\n <Provider\n values={[\n [InternalModalContext, {modalProps, modalRef, isExiting: props.isExiting, isDismissable: props.isDismissable}],\n [OverlayTriggerStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </Overlay>\n );\n}\n\ninterface ModalContentProps extends RenderProps<ModalRenderProps> {\n modalRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction ModalContent(props: ModalContentProps) {\n let {modalProps, modalRef, isExiting, isDismissable} = useContext(InternalModalContext)!;\n let state = useContext(OverlayTriggerStateContext)!;\n let mergedRefs = useMemo(() => mergeRefs(props.modalRef, modalRef), [props.modalRef, modalRef]);\n\n let ref = useObjectRef(mergedRefs);\n let entering = useEnterAnimation(ref);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Modal',\n values: {\n isEntering: entering,\n isExiting,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(filterDOMProps(props as any), modalProps)}\n {...renderProps}\n ref={ref}\n data-entering={entering || undefined}\n data-exiting={isExiting || undefined}>\n {isDismissable &&\n <DismissButton onDismiss={state.close} />\n }\n {renderProps.children}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Modal.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiCM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAmD;AAC3F,MAAM,2DAAuB,CAAA,GAAA,oBAAY,EAAoC;AAsBtE,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,MAAM,KAAwB,EAAE,GAAiC;IAC1I,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IAErB,IAAI,KACF,qBAAO,gCAAC;QAAc,GAAG,KAAK;QAAE,UAAU;OAAM,MAAM,QAAQ;IAGhE,IAAI,iBACF,aAAa,6BACb,yBAAyB,UACzB,MAAM,eACN,WAAW,gBACX,YAAY,YACZ,QAAQ,cACR,UAAU,aACV,SAAS,4BACT,wBAAwB,gCACxB,4BAA4B,EAC5B,GAAG,YACJ,GAAG;IAEJ,qBACE,gCAAC;QACC,eAAe;QACf,2BAA2B;QAC3B,QAAQ;QACR,aAAa;QACb,cAAc;QACd,YAAY;QACZ,WAAW;QACX,0BAA0B;QAC1B,8BAA8B;qBAC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F;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,QAAe,WAAW;QACvD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,YAAY;QAC3B,gBAAc,aAAa;OAC1B,+BACC,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;QAEtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaModalOverlayProps, DismissButton, Overlay, useIsSSR, useModalOverlay} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DOMAttributes, forwardRefType, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useEnterAnimation, useExitAnimation, useObjectRef, useViewportSize} from '@react-aria/utils';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo, useRef} from 'react';\n\nexport interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {\n /**\n * Whether the modal is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the modal is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element\n}\n\ninterface InternalModalContextValue {\n modalProps: DOMAttributes,\n modalRef: RefObject<HTMLDivElement | null>,\n isExiting: boolean,\n isDismissable?: boolean\n}\n\nexport const ModalContext = createContext<ContextValue<ModalOverlayProps, HTMLDivElement>>(null);\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\nexport interface ModalRenderProps {\n /**\n * Whether the modal is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the modal is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the modal.\n */\n state: OverlayTriggerState\n}\n\n/**\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport const Modal = /*#__PURE__*/ (forwardRef as forwardRefType)(function Modal(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n let ctx = useContext(InternalModalContext);\n\n if (ctx) {\n return <ModalContent {...props} modalRef={ref}>{props.children}</ModalContent>;\n }\n\n let {\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n defaultOpen,\n onOpenChange,\n children,\n isEntering,\n isExiting,\n UNSTABLE_portalContainer,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n return (\n <ModalOverlay\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isEntering={isEntering}\n isExiting={isExiting}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}>\n <ModalContent {...otherProps} modalRef={ref}>\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n});\n\ninterface ModalOverlayInnerProps extends ModalOverlayProps {\n overlayRef: RefObject<HTMLDivElement | null>,\n modalRef: RefObject<HTMLDivElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean\n}\n\nfunction ModalOverlayWithForwardRef(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ModalContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n\n let objectRef = useObjectRef(ref);\n let modalRef = useRef<HTMLDivElement>(null);\n let isOverlayExiting = useExitAnimation(objectRef, state.isOpen);\n let isModalExiting = useExitAnimation(modalRef, state.isOpen);\n let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;\n let isSSR = useIsSSR();\n\n if ((!state.isOpen && !isExiting) || isSSR) {\n return null;\n }\n\n return (\n <ModalOverlayInner\n {...props}\n state={state}\n isExiting={isExiting}\n overlayRef={objectRef}\n modalRef={modalRef} />\n );\n}\n\n/**\n * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.\n */\nexport const ModalOverlay = /*#__PURE__*/ (forwardRef as forwardRefType)(ModalOverlayWithForwardRef);\n\nfunction ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInnerProps) {\n let modalRef = props.modalRef;\n let {state} = props;\n let {modalProps, underlayProps} = useModalOverlay(props, state, modalRef);\n\n let entering = useEnterAnimation(props.overlayRef) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ModalOverlay',\n values: {\n isEntering: entering,\n isExiting: props.isExiting,\n state\n }\n });\n\n let viewport = useViewportSize();\n let style = {\n ...renderProps.style,\n '--visual-viewport-height': viewport.height + 'px'\n };\n\n return (\n <Overlay isExiting={props.isExiting} portalContainer={UNSTABLE_portalContainer}>\n <div\n {...mergeProps(filterDOMProps(props as any), underlayProps)}\n {...renderProps}\n style={style}\n ref={props.overlayRef}\n data-entering={entering || undefined}\n data-exiting={props.isExiting || undefined}>\n <Provider\n values={[\n [InternalModalContext, {modalProps, modalRef, isExiting: props.isExiting, isDismissable: props.isDismissable}],\n [OverlayTriggerStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </Overlay>\n );\n}\n\ninterface ModalContentProps extends RenderProps<ModalRenderProps> {\n modalRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction ModalContent(props: ModalContentProps) {\n let {modalProps, modalRef, isExiting, isDismissable} = useContext(InternalModalContext)!;\n let state = useContext(OverlayTriggerStateContext)!;\n let mergedRefs = useMemo(() => mergeRefs(props.modalRef, modalRef), [props.modalRef, modalRef]);\n\n let ref = useObjectRef(mergedRefs);\n let entering = useEnterAnimation(ref);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Modal',\n values: {\n isEntering: entering,\n isExiting,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(filterDOMProps(props as any), modalProps)}\n {...renderProps}\n ref={ref}\n data-entering={entering || undefined}\n data-exiting={isExiting || undefined}>\n {isDismissable &&\n <DismissButton onDismiss={state.close} />\n }\n {renderProps.children}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Modal.module.js.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAkCM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAmD;AAC3F,MAAM,2DAAuB,CAAA,GAAA,oBAAY,EAAoC;AAsBtE,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,MAAM,KAAwB,EAAE,GAAiC;IAC1I,IAAI,MAAM,CAAA,GAAA,iBAAS,EAAE;IAErB,IAAI,KACF,qBAAO,gCAAC;QAAc,GAAG,KAAK;QAAE,UAAU;OAAM,MAAM,QAAQ;IAGhE,IAAI,iBACF,aAAa,6BACb,yBAAyB,UACzB,MAAM,eACN,WAAW,gBACX,YAAY,YACZ,QAAQ,cACR,UAAU,aACV,SAAS,4BACT,wBAAwB,gCACxB,4BAA4B,EAC5B,GAAG,YACJ,GAAG;IAEJ,qBACE,gCAAC;QACC,eAAe;QACf,2BAA2B;QAC3B,QAAQ;QACR,aAAa;QACb,cAAc;QACd,YAAY;QACZ,WAAW;QACX,0BAA0B;QAC1B,8BAA8B;qBAC9B,gC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;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,QAAe,WAAW;QACvD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,YAAY;QAC3B,gBAAc,aAAa;OAC1B,+BACC,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;QAEtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Modal.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaModalOverlayProps, DismissButton, Overlay, useIsSSR, useModalOverlay} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DOMAttributes, forwardRefType, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useEnterAnimation, useExitAnimation, useObjectRef, useViewportSize} from '@react-aria/utils';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo, useRef} from 'react';\n\nexport interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {\n /**\n * Whether the modal is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the modal is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element\n}\n\ninterface InternalModalContextValue {\n modalProps: DOMAttributes,\n modalRef: RefObject<HTMLDivElement | null>,\n isExiting: boolean,\n isDismissable?: boolean\n}\n\nexport const ModalContext = createContext<ContextValue<ModalOverlayProps, HTMLDivElement>>(null);\nconst InternalModalContext = createContext<InternalModalContextValue | null>(null);\n\nexport interface ModalRenderProps {\n /**\n * Whether the modal is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the modal is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the modal.\n */\n state: OverlayTriggerState\n}\n\n/**\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport const Modal = /*#__PURE__*/ (forwardRef as forwardRefType)(function Modal(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n let ctx = useContext(InternalModalContext);\n\n if (ctx) {\n return <ModalContent {...props} modalRef={ref}>{props.children}</ModalContent>;\n }\n\n let {\n isDismissable,\n isKeyboardDismissDisabled,\n isOpen,\n defaultOpen,\n onOpenChange,\n children,\n isEntering,\n isExiting,\n UNSTABLE_portalContainer,\n shouldCloseOnInteractOutside,\n ...otherProps\n } = props;\n\n return (\n <ModalOverlay\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isEntering={isEntering}\n isExiting={isExiting}\n UNSTABLE_portalContainer={UNSTABLE_portalContainer}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}>\n <ModalContent {...otherProps} modalRef={ref}>\n {children}\n </ModalContent>\n </ModalOverlay>\n );\n});\n\ninterface ModalOverlayInnerProps extends ModalOverlayProps {\n overlayRef: RefObject<HTMLDivElement | null>,\n modalRef: RefObject<HTMLDivElement | null>,\n state: OverlayTriggerState,\n isExiting: boolean\n}\n\nfunction ModalOverlayWithForwardRef(props: ModalOverlayProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ModalContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n\n let objectRef = useObjectRef(ref);\n let modalRef = useRef<HTMLDivElement>(null);\n let isOverlayExiting = useExitAnimation(objectRef, state.isOpen);\n let isModalExiting = useExitAnimation(modalRef, state.isOpen);\n let isExiting = isOverlayExiting || isModalExiting || props.isExiting || false;\n let isSSR = useIsSSR();\n\n if ((!state.isOpen && !isExiting) || isSSR) {\n return null;\n }\n\n return (\n <ModalOverlayInner\n {...props}\n state={state}\n isExiting={isExiting}\n overlayRef={objectRef}\n modalRef={modalRef} />\n );\n}\n\n/**\n * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.\n */\nexport const ModalOverlay = /*#__PURE__*/ (forwardRef as forwardRefType)(ModalOverlayWithForwardRef);\n\nfunction ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInnerProps) {\n let modalRef = props.modalRef;\n let {state} = props;\n let {modalProps, underlayProps} = useModalOverlay(props, state, modalRef);\n\n let entering = useEnterAnimation(props.overlayRef) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ModalOverlay',\n values: {\n isEntering: entering,\n isExiting: props.isExiting,\n state\n }\n });\n\n let viewport = useViewportSize();\n let style = {\n ...renderProps.style,\n '--visual-viewport-height': viewport.height + 'px'\n };\n\n return (\n <Overlay isExiting={props.isExiting} portalContainer={UNSTABLE_portalContainer}>\n <div\n {...mergeProps(filterDOMProps(props as any), underlayProps)}\n {...renderProps}\n style={style}\n ref={props.overlayRef}\n data-entering={entering || undefined}\n data-exiting={props.isExiting || undefined}>\n <Provider\n values={[\n [InternalModalContext, {modalProps, modalRef, isExiting: props.isExiting, isDismissable: props.isDismissable}],\n [OverlayTriggerStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </Overlay>\n );\n}\n\ninterface ModalContentProps extends RenderProps<ModalRenderProps> {\n modalRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction ModalContent(props: ModalContentProps) {\n let {modalProps, modalRef, isExiting, isDismissable} = useContext(InternalModalContext)!;\n let state = useContext(OverlayTriggerStateContext)!;\n let mergedRefs = useMemo(() => mergeRefs(props.modalRef, modalRef), [props.modalRef, modalRef]);\n\n let ref = useObjectRef(mergedRefs);\n let entering = useEnterAnimation(ref);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Modal',\n values: {\n isEntering: entering,\n isExiting,\n state\n }\n });\n\n return (\n <div\n {...mergeProps(filterDOMProps(props as any), modalProps)}\n {...renderProps}\n ref={ref}\n data-entering={entering || undefined}\n data-exiting={isExiting || undefined}>\n {isDismissable &&\n <DismissButton onDismiss={state.close} />\n }\n {renderProps.children}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Modal.module.js.map"}
@@ -90,7 +90,7 @@ function $61e2b7078adb18bc$var$PopoverInner({ state: state, isExiting: isExiting
90
90
  ...props,
91
91
  offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
92
92
  arrowSize: arrowWidth,
93
- // If this is a submenu/subdialog, use the root popover's container
93
+ // If this is a submenu/subdialog, use the root popover's container
94
94
  // to detect outside interaction and add aria-hidden.
95
95
  groupRef: isSubPopover ? groupCtx : containerRef
96
96
  }, state);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuEM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA2C;AAErF,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAA8B;IACtI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE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obe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, forwardRefType, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useEffect, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverProps, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl'\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container \n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props as any), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAwEM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA2C;AAErF,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAq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A7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, forwardRefType, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useEffect, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverProps, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl'\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props as any), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.main.js.map"}
package/dist/Popover.mjs CHANGED
@@ -79,7 +79,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
79
79
  ...props,
80
80
  offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
81
81
  arrowSize: arrowWidth,
82
- // If this is a submenu/subdialog, use the root popover's container
82
+ // If this is a submenu/subdialog, use the root popover's container
83
83
  // to detect outside interaction and add aria-hidden.
84
84
  groupRef: isSubPopover ? groupCtx : containerRef
85
85
  }, state);
@@ -79,7 +79,7 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
79
79
  ...props,
80
80
  offset: (_props_offset = props.offset) !== null && _props_offset !== void 0 ? _props_offset : 8,
81
81
  arrowSize: arrowWidth,
82
- // If this is a submenu/subdialog, use the root popover's container
82
+ // If this is a submenu/subdialog, use the root popover's container
83
83
  // to detect outside interaction and add aria-hidden.
84
84
  groupRef: isSubPopover ? groupCtx : containerRef
85
85
  }, state);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuEM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA2C;AAErF,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAA8B;IACtI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAe,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wCAAyB;IACvD,IAAI,aAAa,CAAA,GAAA,6BAAqB,EAAE;IACxC,IAAI,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAAM,WAAW,IAAI,QAAQ,CAAC,eAAe,aAAa;IAC9F,IAAI,YAAY,CAAA,GAAA,uBAAe,EAAE,KAAK,MAAM,MAAM,KAAK,MAAM,SAAS,IAAI;IAC1E,IAAI,WAAW,CAAA,GAAA,kBAAU;IACzB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAE1B,sEAA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sBAC3D,gCAAC,CAAA,GAAA,yCAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,YAAY,QAAQ,iBAEvB,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;;IAIzC,yGAAyG;IACzG,IAAI,CAAC,cACH,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB;OACtF,CAAC,MAAM,UAAU,IAAI,MAAM,MAAM,kBAAI,gCAAC;QAAI,eAAY;QAAY,GAAG,aAAa;QAAE,OAAO;YAAC,UAAU;YAAS,OAAO;QAAC;sBACxH,gCAAC;QAAI,KAAK;QAAc,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,0CAAoB,QAAQ;QAAC,OAAO;OAClC;QASgF;IAF3F,qEAAqE;IACrE,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB,CAAA,OAAA,qCAAA,sCAAA,2BAA4B,qBAAA,+BAAA,SAAU,OAAO,cAA7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, forwardRefType, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useEffect, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverProps, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl'\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container \n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props as any), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.module.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAwEM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA2C;AAErF,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAA8B;IACtI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAe,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wCAAyB;IACvD,IAAI,aAAa,CAAA,GAAA,6BAAqB,EAAE;IACxC,IAAI,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAAM,WAAW,IAAI,QAAQ,CAAC,eAAe,aAAa;IAC9F,IAAI,YAAY,CAAA,GAAA,uBAAe,EAAE,KAAK,MAAM,MAAM,KAAK,MAAM,SAAS,IAAI;IAC1E,IAAI,WAAW,CAAA,GAAA,kBAAU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MAAM,UAAU,kBAAI,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;sBAC3D,gCAAC,CAAA,GAAA,yCAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,YAAY,QAAQ,iBAEvB,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;;IAIzC,yGAAyG;IACzG,IAAI,CAAC,cACH,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB;OACtF,CAAC,MAAM,UAAU,IAAI,MAAM,MAAM,kBAAI,gCAAC;QAAI,eAAY;QAAY,GAAG,aAAa;QAAE,OAAO;YAAC,UAAU;YAAS,OAAO;QAAC;sBACxH,gCAAC;QAAI,KAAK;QAAc,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,0CAAoB,QAAQ;QAAC,OAAO;OAClC;QASgF;IAF3F,qEAAqE;IACrE,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB,CAAA,OAAA,qCAAA,sCAAA,2BAA4B,qBAAA,+BAAA,SAAU,OAAO,cAA7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, forwardRefType, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useEffect, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverProps, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl'\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props as any), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.module.js.map"}
@@ -7,6 +7,7 @@ var $coXVq$reactstately = require("react-stately");
7
7
  var $coXVq$react = require("react");
8
8
  var $coXVq$reactariassr = require("@react-aria/ssr");
9
9
  var $coXVq$reactariautils = require("@react-aria/utils");
10
+ var $coXVq$reactariaoverlays = require("@react-aria/overlays");
10
11
 
11
12
 
12
13
  function $parcel$interopDefault(a) {
@@ -39,6 +40,7 @@ $parcel$export(module.exports, "ToastContent", () => $4e3fafb90a1b5a5f$export$b1
39
40
 
40
41
 
41
42
 
43
+
42
44
  const $4e3fafb90a1b5a5f$var$ToastStateContext = /*#__PURE__*/ (0, $coXVq$react.createContext)(null);
43
45
  const $4e3fafb90a1b5a5f$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $coXVq$react.forwardRef)(function ToastRegion(props, ref) {
44
46
  let isSSR = (0, $coXVq$reactariassr.useIsSSR)();
@@ -56,7 +58,12 @@ const $4e3fafb90a1b5a5f$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $coXVq$react
56
58
  isFocusVisible: isFocusVisible
57
59
  }
58
60
  });
59
- let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
61
+ let portalContainer;
62
+ let { getContainer: getContainer } = (0, $coXVq$reactariaoverlays.useUNSAFE_PortalContext)();
63
+ if (!isSSR) {
64
+ portalContainer = document.body;
65
+ if (getContainer) portalContainer = getContainer();
66
+ }
60
67
  let region = /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement($4e3fafb90a1b5a5f$var$ToastStateContext.Provider, {
61
68
  value: state
62
69
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement("div", {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAaD,MAAM,wDAAoB,CAAA,GAAA,0BAAY,EAA0B;AAgCzD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAAe,KAA0B,EAAE,GAAiC;IAC3J,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,QAAQ,CAAA,GAAA,iCAAY,EAAE,MAAM,KAAK;IACrC,IAAI,YAAY,CAAA,GAAA,kCAAW,EAAE;IAC7B,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE,OAAO,OAAO;IAEjD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IACzD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,UAAU;QACV,kBAAkB;QAClB,QAAQ;YACN,eAAe,MAAM,aAAa;uBAClC;4BACA;QACF;IACF;IAEA,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,EAAC,GAAG;IAEvD,IAAI,uBACF,0DAAC,wCA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KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,OAAO,MAAM,KAAK;uBAClB;4BACA;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,WAAW;QACd,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QACtC,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAqB;aAAa;YACnC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;oBACT;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAEO,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D,CAAC;AAKtG,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,aAAa,KAAkC,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC;QAAI,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OACtD,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createPortal} from 'react-dom';\nimport {forwardRefType} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useObjectRef} from '@react-aria/utils';\n\nconst ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>> {\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement,\n /**\n * The container element in which the toast region portal will be placed.\n * @default document.body\n */\n portalContainer?: Element\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused,\n isFocusVisible\n }\n });\n\n let {portalContainer = isSSR ? null : document.body} = props;\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <div\n {...renderProps}\n {...mergeProps(regionProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} style={{display: 'contents'}} /> : props.children}\n </div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\n// TODO: possibly export this so additional children can be added to the region, outside the list.\nconst ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n return (\n // @ts-ignore\n <ol ref={ref} style={props.style} className={props.className}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>> {}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <div\n {...renderProps}\n {...mergeProps(toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <div className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAcD,MAAM,wDAAoB,CAAA,GAAA,0BAAY,EAA0B;AA2BzD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAAe,KAA0B,EAAE,GAAiC;IAC3J,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,QAAQ,CAAA,GAAA,iCAAY,EAAE,MAAM,KAAK;IACrC,IAAI,YAAY,CAAA,GAAA,kCAAW,EAAE;IAC7B,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE,OAAO,OAAO;IAEjD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IACzD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,UAAU;QACV,kBAAkB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U,gBAAE,YAAY,cAAE,UAAU,oBAAE,gBAAgB,oBAAE,gBAAgB,EAAC,GAAG,CAAA,GAAA,yBAAO,EACtF,OACA,OACA;IAGF,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW;IACzD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,OAAO,MAAM,KAAK;uBAClB;4BACA;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,WAAW;QACd,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QACtC,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAqB;aAAa;YACnC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;oBACT;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAEO,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D,CAAC;AAKtG,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,aAAa,KAAkC,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC;QAAI,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OACtD,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createPortal} from 'react-dom';\nimport {forwardRefType} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useObjectRef} from '@react-aria/utils';\nimport {useUNSAFE_PortalContext} from '@react-aria/overlays';\n\nconst ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>> {\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused,\n isFocusVisible\n }\n });\n\n let portalContainer;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!isSSR) {\n portalContainer = document.body;\n if (getContainer) {\n portalContainer = getContainer();\n }\n }\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <div\n {...renderProps}\n {...mergeProps(regionProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} style={{display: 'contents'}} /> : props.children}\n </div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\n// TODO: possibly export this so additional children can be added to the region, outside the list.\nconst ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n return (\n // @ts-ignore\n <ol ref={ref} style={props.style} className={props.className}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>> {}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <div\n {...renderProps}\n {...mergeProps(toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <div className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.main.js.map"}
package/dist/Toast.mjs CHANGED
@@ -7,6 +7,7 @@ import {useToastQueue as $9il6O$useToastQueue} from "react-stately";
7
7
  import $9il6O$react, {createContext as $9il6O$createContext, forwardRef as $9il6O$forwardRef, useContext as $9il6O$useContext} from "react";
8
8
  import {useIsSSR as $9il6O$useIsSSR} from "@react-aria/ssr";
9
9
  import {useObjectRef as $9il6O$useObjectRef} from "@react-aria/utils";
10
+ import {useUNSAFE_PortalContext as $9il6O$useUNSAFE_PortalContext} from "@react-aria/overlays";
10
11
 
11
12
  /*
12
13
  * Copyright 2025 Adobe. All rights reserved.
@@ -27,6 +28,7 @@ import {useObjectRef as $9il6O$useObjectRef} from "@react-aria/utils";
27
28
 
28
29
 
29
30
 
31
+
30
32
  const $692df8403b6ac2c7$var$ToastStateContext = /*#__PURE__*/ (0, $9il6O$createContext)(null);
31
33
  const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastRegion(props, ref) {
32
34
  let isSSR = (0, $9il6O$useIsSSR)();
@@ -44,7 +46,12 @@ const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwa
44
46
  isFocusVisible: isFocusVisible
45
47
  }
46
48
  });
47
- let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
49
+ let portalContainer;
50
+ let { getContainer: getContainer } = (0, $9il6O$useUNSAFE_PortalContext)();
51
+ if (!isSSR) {
52
+ portalContainer = document.body;
53
+ if (getContainer) portalContainer = getContainer();
54
+ }
48
55
  let region = /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$var$ToastStateContext.Provider, {
49
56
  value: state
50
57
  }, /*#__PURE__*/ (0, $9il6O$react).createElement("div", {
@@ -7,6 +7,7 @@ import {useToastQueue as $9il6O$useToastQueue} from "react-stately";
7
7
  import $9il6O$react, {createContext as $9il6O$createContext, forwardRef as $9il6O$forwardRef, useContext as $9il6O$useContext} from "react";
8
8
  import {useIsSSR as $9il6O$useIsSSR} from "@react-aria/ssr";
9
9
  import {useObjectRef as $9il6O$useObjectRef} from "@react-aria/utils";
10
+ import {useUNSAFE_PortalContext as $9il6O$useUNSAFE_PortalContext} from "@react-aria/overlays";
10
11
 
11
12
  /*
12
13
  * Copyright 2025 Adobe. All rights reserved.
@@ -27,6 +28,7 @@ import {useObjectRef as $9il6O$useObjectRef} from "@react-aria/utils";
27
28
 
28
29
 
29
30
 
31
+
30
32
  const $692df8403b6ac2c7$var$ToastStateContext = /*#__PURE__*/ (0, $9il6O$createContext)(null);
31
33
  const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastRegion(props, ref) {
32
34
  let isSSR = (0, $9il6O$useIsSSR)();
@@ -44,7 +46,12 @@ const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwa
44
46
  isFocusVisible: isFocusVisible
45
47
  }
46
48
  });
47
- let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
49
+ let portalContainer;
50
+ let { getContainer: getContainer } = (0, $9il6O$useUNSAFE_PortalContext)();
51
+ if (!isSSR) {
52
+ portalContainer = document.body;
53
+ if (getContainer) portalContainer = getContainer();
54
+ }
48
55
  let region = /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$var$ToastStateContext.Provider, {
49
56
  value: state
50
57
  }, /*#__PURE__*/ (0, $9il6O$react).createElement("div", {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAaD,MAAM,wDAAoB,CAAA,GAAA,oBAAY,EAA0B;AAgCzD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAAe,KAA0B,EAAE,GAAiC;IAC3J,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE,MAAM,KAAK;IACrC,IAAI,YAAY,CAAA,GAAA,mBAAW,EAAE;IAC7B,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO,OAAO;IAEjD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IACzD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,UAAU;QACV,kBAAkB;QAClB,QAAQ;YACN,eAAe,MAAM,aAAa;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AU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IACzD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,OAAO,MAAM,KAAK;uBAClB;4BACA;QACF;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,WAAW;QACd,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QACtC,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAqB;aAAa;YACnC;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,yCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,yCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;oBACT;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAEO,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA6D,CAAC;AAKtG,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,SAAS,aAAa,KAAkC,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC;QAAI,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OACtD,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createPortal} from 'react-dom';\nimport {forwardRefType} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useObjectRef} from '@react-aria/utils';\n\nconst ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>> {\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement,\n /**\n * The container element in which the toast region portal will be placed.\n * @default document.body\n */\n portalContainer?: Element\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused,\n isFocusVisible\n }\n });\n\n let {portalContainer = isSSR ? null : document.body} = props;\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <div\n {...renderProps}\n {...mergeProps(regionProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} style={{display: 'contents'}} /> : props.children}\n </div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\n// TODO: possibly export this so additional children can be added to the region, outside the list.\nconst ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n return (\n // @ts-ignore\n <ol ref={ref} style={props.style} className={props.className}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>> {}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <div\n {...renderProps}\n {...mergeProps(toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <div className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAcD,MAAM,wDAAoB,CAAA,GAAA,oBAAY,EAA0B;AA2BzD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAAe,KAA0B,EAAE,GAAiC;IAC3J,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE,MAAM,KAAK;IACrC,IAAI,YAAY,CAAA,GAAA,mBAAW,EAAE;IAC7B,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO,OAAO;IAEjD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAA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;AAGrB","sources":["packages/react-aria-components/src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createPortal} from 'react-dom';\nimport {forwardRefType} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useObjectRef} from '@react-aria/utils';\nimport {useUNSAFE_PortalContext} from '@react-aria/overlays';\n\nconst ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>> {\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused,\n isFocusVisible\n }\n });\n\n let portalContainer;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!isSSR) {\n portalContainer = document.body;\n if (getContainer) {\n portalContainer = getContainer();\n }\n }\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <div\n {...renderProps}\n {...mergeProps(regionProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} style={{display: 'contents'}} /> : props.children}\n </div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\n// TODO: possibly export this so additional children can be added to the region, outside the list.\nconst ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n return (\n // @ts-ignore\n <ol ref={ref} style={props.style} className={props.className}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>> {}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <div\n {...renderProps}\n {...mergeProps(toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <div className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.module.js.map"}