@sanity/ui 0.36.12 → 0.36.13-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/autocomplete/autocomplete.styles.d.ts +1 -1
- package/lib/cjs/components/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/lib/cjs/components/dialog/dialog.d.ts.map +1 -1
- package/lib/cjs/components/dialog/dialog.js +6 -8
- package/lib/cjs/components/dialog/dialog.js.map +2 -2
- package/lib/cjs/hooks/_internal/index.d.ts +2 -0
- package/lib/cjs/hooks/_internal/index.d.ts.map +1 -0
- package/lib/cjs/hooks/_internal/index.js +20 -0
- package/lib/cjs/hooks/_internal/index.js.map +7 -0
- package/lib/cjs/hooks/_internal/useUnique.d.ts +8 -0
- package/lib/cjs/hooks/_internal/useUnique.d.ts.map +1 -0
- package/lib/cjs/hooks/_internal/useUnique.js +35 -0
- package/lib/cjs/hooks/_internal/useUnique.js.map +7 -0
- package/lib/cjs/utils/portal/portal.d.ts +4 -0
- package/lib/cjs/utils/portal/portal.d.ts.map +1 -1
- package/lib/cjs/utils/portal/portal.js +4 -2
- package/lib/cjs/utils/portal/portal.js.map +2 -2
- package/lib/cjs/utils/portal/portalProvider.d.ts +5 -1
- package/lib/cjs/utils/portal/portalProvider.d.ts.map +1 -1
- package/lib/cjs/utils/portal/portalProvider.js +6 -3
- package/lib/cjs/utils/portal/portalProvider.js.map +2 -2
- package/lib/cjs/utils/portal/types.d.ts +1 -0
- package/lib/cjs/utils/portal/types.d.ts.map +1 -1
- package/lib/cjs/utils/portal/types.js.map +1 -1
- package/lib/esm/components/autocomplete/autocomplete.styles.d.ts +1 -1
- package/lib/esm/components/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/lib/esm/components/dialog/dialog.d.ts.map +1 -1
- package/lib/esm/components/dialog/dialog.js +7 -9
- package/lib/esm/components/dialog/dialog.js.map +2 -2
- package/lib/esm/hooks/_internal/index.d.ts +2 -0
- package/lib/esm/hooks/_internal/index.d.ts.map +1 -0
- package/lib/esm/hooks/_internal/index.js +1 -0
- package/lib/esm/hooks/_internal/index.js.map +7 -0
- package/lib/esm/hooks/_internal/useUnique.d.ts +8 -0
- package/lib/esm/hooks/_internal/useUnique.d.ts.map +1 -0
- package/lib/esm/hooks/_internal/useUnique.js +12 -0
- package/lib/esm/hooks/_internal/useUnique.js.map +7 -0
- package/lib/esm/utils/portal/portal.d.ts +4 -0
- package/lib/esm/utils/portal/portal.d.ts.map +1 -1
- package/lib/esm/utils/portal/portal.js +4 -2
- package/lib/esm/utils/portal/portal.js.map +2 -2
- package/lib/esm/utils/portal/portalProvider.d.ts +5 -1
- package/lib/esm/utils/portal/portalProvider.d.ts.map +1 -1
- package/lib/esm/utils/portal/portalProvider.js +6 -3
- package/lib/esm/utils/portal/portalProvider.js.map +2 -2
- package/lib/esm/utils/portal/types.d.ts +1 -0
- package/lib/esm/utils/portal/types.d.ts.map +1 -1
- package/lib/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +10 -9
|
@@ -14,5 +14,5 @@ export declare const ResultsPopover: import("styled-components").StyledComponent
|
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export declare const AnimatedSpinnerIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "x" | "y" | "r" | "name" | "mode" | "key" | "color" | "media" | "radius" | "from" | "children" | "version" | "style" | "clipPath" | "filter" | "mask" | "path" | "end" | "local" | "clip" | "fill" | "stroke" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "min" | "max" | "display" | "height" | "fontFamily" | "fontWeight" | "fontSize" | "letterSpacing" | "transform" | "overflow" | "type" | "width" | "className" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crossOrigin" | "href" | "method" | "target" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "format" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "lightingColor" | "limitingConeAngle" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & import("react").RefAttributes<SVGSVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
+
export declare const AnimatedSpinnerIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "x" | "y" | "r" | "name" | "mode" | "key" | "color" | "media" | "radius" | "from" | "children" | "version" | "style" | "clipPath" | "filter" | "mask" | "path" | "end" | "local" | "clip" | "fill" | "stroke" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "min" | "max" | "fr" | "display" | "height" | "fontFamily" | "fontWeight" | "fontSize" | "letterSpacing" | "transform" | "overflow" | "type" | "width" | "className" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crossOrigin" | "href" | "method" | "target" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "format" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "lightingColor" | "limitingConeAngle" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & import("react").RefAttributes<SVGSVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
18
18
|
//# sourceMappingURL=autocomplete.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/autocomplete/autocomplete.styles.tsx"],"names":[],"mappings":";AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,yGAEhB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,miMAMnB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,qhMAS1B,CAAA;AAYD;;GAEG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/autocomplete/autocomplete.styles.tsx"],"names":[],"mappings":";AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,yGAEhB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,miMAMnB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,qhMAS1B,CAAA;AAYD;;GAEG;AACH,eAAO,MAAM,mBAAmB,6sPAE/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;AAKjF,OAAO,EAAC,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAEnF,OAAO,EAAC,mBAAmB,EAAW,MAAM,aAAa,CAAA;AACzD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAS1C;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,sBAAsB,EAAE,oBAAoB;IAC/E;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAA;IAC5C,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC5B;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;AAKjF,OAAO,EAAC,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAEnF,OAAO,EAAC,mBAAmB,EAAW,MAAM,aAAa,CAAA;AACzD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAS1C;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,sBAAsB,EAAE,oBAAoB;IAC/E;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAA;IAC5C,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC5B;AA2MD;;GAEG;AACH,eAAO,MAAM,MAAM,m3LAyFjB,CAAA"}
|
|
@@ -130,6 +130,7 @@ const DialogCard = (0, import_react.forwardRef)(function DialogCard2(props, ref)
|
|
|
130
130
|
shadow,
|
|
131
131
|
width
|
|
132
132
|
} = props;
|
|
133
|
+
const forwardedRef = (0, import_hooks.useForwardedRef)(ref);
|
|
133
134
|
const [rootElement, setRootElement] = (0, import_react.useState)(null);
|
|
134
135
|
const localContentRef = (0, import_react.useRef)(null);
|
|
135
136
|
const layer = (0, import_utils.useLayer)();
|
|
@@ -140,10 +141,10 @@ const DialogCard = (0, import_react.forwardRef)(function DialogCard2(props, ref)
|
|
|
140
141
|
(0, import_react.useEffect)(() => {
|
|
141
142
|
if (!autoFocus)
|
|
142
143
|
return;
|
|
143
|
-
if (
|
|
144
|
-
(0, import_helpers.focusFirstDescendant)(
|
|
144
|
+
if (forwardedRef.current) {
|
|
145
|
+
(0, import_helpers.focusFirstDescendant)(forwardedRef.current);
|
|
145
146
|
}
|
|
146
|
-
}, [autoFocus]);
|
|
147
|
+
}, [autoFocus, forwardedRef]);
|
|
147
148
|
(0, import_hooks.useGlobalKeyDown)((0, import_react.useCallback)((event) => {
|
|
148
149
|
if (!isTopLayer || !onClose)
|
|
149
150
|
return;
|
|
@@ -160,11 +161,8 @@ const DialogCard = (0, import_react.forwardRef)(function DialogCard2(props, ref)
|
|
|
160
161
|
}, [isTopLayer, onClickOutside]), [rootElement]);
|
|
161
162
|
const setRef = (0, import_react.useCallback)((el) => {
|
|
162
163
|
setRootElement(el);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
else if (ref)
|
|
166
|
-
ref.current = el;
|
|
167
|
-
}, [ref]);
|
|
164
|
+
forwardedRef.current = el;
|
|
165
|
+
}, [forwardedRef]);
|
|
168
166
|
const setContentRef = (0, import_react.useCallback)((el) => {
|
|
169
167
|
localContentRef.current = el;
|
|
170
168
|
if (typeof contentRef === "function")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/dialog/dialog.tsx"],
|
|
4
|
-
"sourcesContent": ["import {CloseIcon} from '@sanity/icons'\nimport React, {forwardRef, useCallback, useEffect, useRef, useState} from 'react'\nimport styled from 'styled-components'\nimport {focusFirstDescendant, focusLastDescendant} from '../../helpers'\nimport {useClickOutside, useGlobalKeyDown} from '../../hooks'\nimport {Box, Button, Card, Container, Flex, Text} from '../../primitives'\nimport {ResponsivePaddingProps, ResponsiveWidthProps} from '../../primitives/types'\nimport {responsivePaddingStyle, ResponsivePaddingStyleProps} from '../../styles/internal'\nimport {ThemeColorSchemeKey, useTheme} from '../../theme'\nimport {DialogPosition} from '../../types'\nimport {Layer, Portal, useLayer} from '../../utils'\nimport {\n dialogStyle,\n responsiveDialogPositionStyle,\n ResponsiveDialogPositionStyleProps,\n} from './styles'\nimport {useDialog} from './useDialog'\n\n/**\n * @public\n */\nexport interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProps {\n /**\n * @beta\n */\n __unstable_autoFocus?: boolean\n /**\n * @beta\n */\n __unstable_hideCloseButton?: boolean\n cardRadius?: number | number[]\n cardShadow?: number | number[]\n contentRef?: React.ForwardedRef<HTMLDivElement>\n footer?: React.ReactNode\n header?: React.ReactNode\n id: string\n onClickOutside?: () => void\n onClose?: () => void\n position?: DialogPosition | DialogPosition[]\n scheme?: ThemeColorSchemeKey\n zOffset?: number | number[]\n}\n\ninterface DialogCardProps extends ResponsiveWidthProps {\n /**\n * @beta\n */\n __unstable_autoFocus: boolean\n /**\n * @beta\n */\n __unstable_hideCloseButton: boolean\n children: React.ReactNode\n contentRef?: React.ForwardedRef<HTMLDivElement>\n footer: React.ReactNode\n header: React.ReactNode\n id: string\n onClickOutside?: () => void\n onClose?: () => void\n radius: number | number[]\n scheme?: ThemeColorSchemeKey\n shadow: number | number[]\n}\n\nconst Root = styled(Layer)<ResponsiveDialogPositionStyleProps & ResponsivePaddingStyleProps>(\n responsivePaddingStyle,\n dialogStyle,\n responsiveDialogPositionStyle\n)\n\nconst DialogContainer = styled(Container)`\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n height: 100%;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`\n\nconst DialogCardRoot = styled(Card)`\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n min-height: 0;\n max-height: 100%;\n overflow: hidden;\n`\n\nconst DialogLayout = styled(Flex)`\n flex: 1;\n min-height: 0;\n width: 100%;\n`\n\nconst DialogHeader = styled(Card)`\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-bottom: 1px solid var(--card-hairline-soft-color);\n }\n`\n\nconst DialogContent = styled(Box)`\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n`\n\nconst DialogFooter = styled(Box)`\n position: relative;\n z-index: 3;\n border-top: 1px solid var(--card-hairline-soft-color);\n`\n\nconst DialogCard = forwardRef(function DialogCard(props: DialogCardProps
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,mBAAwB;AACxB,mBAA0E;AAC1E,+BAAmB;AACnB,qBAAwD;AACxD,
|
|
4
|
+
"sourcesContent": ["import {CloseIcon} from '@sanity/icons'\nimport React, {forwardRef, useCallback, useEffect, useRef, useState} from 'react'\nimport styled from 'styled-components'\nimport {focusFirstDescendant, focusLastDescendant} from '../../helpers'\nimport {useClickOutside, useForwardedRef, useGlobalKeyDown} from '../../hooks'\nimport {Box, Button, Card, Container, Flex, Text} from '../../primitives'\nimport {ResponsivePaddingProps, ResponsiveWidthProps} from '../../primitives/types'\nimport {responsivePaddingStyle, ResponsivePaddingStyleProps} from '../../styles/internal'\nimport {ThemeColorSchemeKey, useTheme} from '../../theme'\nimport {DialogPosition} from '../../types'\nimport {Layer, Portal, useLayer} from '../../utils'\nimport {\n dialogStyle,\n responsiveDialogPositionStyle,\n ResponsiveDialogPositionStyleProps,\n} from './styles'\nimport {useDialog} from './useDialog'\n\n/**\n * @public\n */\nexport interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProps {\n /**\n * @beta\n */\n __unstable_autoFocus?: boolean\n /**\n * @beta\n */\n __unstable_hideCloseButton?: boolean\n cardRadius?: number | number[]\n cardShadow?: number | number[]\n contentRef?: React.ForwardedRef<HTMLDivElement>\n footer?: React.ReactNode\n header?: React.ReactNode\n id: string\n onClickOutside?: () => void\n onClose?: () => void\n position?: DialogPosition | DialogPosition[]\n scheme?: ThemeColorSchemeKey\n zOffset?: number | number[]\n}\n\ninterface DialogCardProps extends ResponsiveWidthProps {\n /**\n * @beta\n */\n __unstable_autoFocus: boolean\n /**\n * @beta\n */\n __unstable_hideCloseButton: boolean\n children: React.ReactNode\n contentRef?: React.ForwardedRef<HTMLDivElement>\n footer: React.ReactNode\n header: React.ReactNode\n id: string\n onClickOutside?: () => void\n onClose?: () => void\n radius: number | number[]\n scheme?: ThemeColorSchemeKey\n shadow: number | number[]\n}\n\nconst Root = styled(Layer)<ResponsiveDialogPositionStyleProps & ResponsivePaddingStyleProps>(\n responsivePaddingStyle,\n dialogStyle,\n responsiveDialogPositionStyle\n)\n\nconst DialogContainer = styled(Container)`\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n height: 100%;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n`\n\nconst DialogCardRoot = styled(Card)`\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n min-height: 0;\n max-height: 100%;\n overflow: hidden;\n`\n\nconst DialogLayout = styled(Flex)`\n flex: 1;\n min-height: 0;\n width: 100%;\n`\n\nconst DialogHeader = styled(Card)`\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-bottom: 1px solid var(--card-hairline-soft-color);\n }\n`\n\nconst DialogContent = styled(Box)`\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n`\n\nconst DialogFooter = styled(Box)`\n position: relative;\n z-index: 3;\n border-top: 1px solid var(--card-hairline-soft-color);\n`\n\nconst DialogCard = forwardRef(function DialogCard(\n props: DialogCardProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const {\n __unstable_autoFocus: autoFocus,\n __unstable_hideCloseButton: hideCloseButton,\n children,\n contentRef,\n footer,\n header,\n id,\n onClickOutside,\n onClose,\n radius,\n scheme,\n shadow,\n width,\n } = props\n const forwardedRef = useForwardedRef(ref)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const localContentRef = useRef<HTMLDivElement | null>(null)\n const layer = useLayer()\n const {isTopLayer} = layer\n const labelId = `${id}_label`\n const showCloseButton = Boolean(onClose) && hideCloseButton === false\n const showHeader = Boolean(header) || showCloseButton\n\n useEffect(() => {\n if (!autoFocus) return\n\n // On mount: focus the first interactive element in the contents\n if (forwardedRef.current) {\n focusFirstDescendant(forwardedRef.current)\n }\n }, [autoFocus, forwardedRef])\n\n useGlobalKeyDown(\n useCallback(\n (event: KeyboardEvent) => {\n if (!isTopLayer || !onClose) return\n\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n onClose()\n }\n },\n [isTopLayer, onClose]\n )\n )\n\n useClickOutside(\n useCallback(() => {\n if (!isTopLayer || !onClickOutside) return\n\n onClickOutside()\n }, [isTopLayer, onClickOutside]),\n [rootElement]\n )\n\n const setRef = useCallback(\n (el: HTMLDivElement | null) => {\n setRootElement(el)\n forwardedRef.current = el\n },\n [forwardedRef]\n )\n\n const setContentRef = useCallback(\n (el: HTMLDivElement | null) => {\n localContentRef.current = el\n if (typeof contentRef === 'function') contentRef(el)\n else if (contentRef) contentRef.current = el\n },\n [contentRef]\n )\n\n return (\n <DialogContainer data-ui=\"DialogCard\" width={width}>\n <DialogCardRoot radius={radius} ref={setRef} scheme={scheme} shadow={shadow}>\n <DialogLayout direction=\"column\">\n {showHeader && (\n <DialogHeader>\n <Flex>\n <Box flex={1} padding={4}>\n {header && (\n <Text id={labelId} weight=\"semibold\">\n {header}\n </Text>\n )}\n </Box>\n {showCloseButton && (\n <Box padding={2}>\n <Button\n aria-label=\"Close dialog\"\n disabled={!onClose}\n icon={CloseIcon}\n mode=\"bleed\"\n onClick={onClose}\n padding={3}\n />\n </Box>\n )}\n </Flex>\n </DialogHeader>\n )}\n\n <DialogContent flex={1} ref={setContentRef} tabIndex={-1}>\n {children}\n </DialogContent>\n\n {footer && <DialogFooter>{footer}</DialogFooter>}\n </DialogLayout>\n </DialogCardRoot>\n </DialogContainer>\n )\n})\n\n/**\n * @public\n */\nexport const Dialog = forwardRef(function Dialog(\n props: DialogProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'id' | 'width'>,\n ref: React.Ref<HTMLDivElement>\n) {\n const dialog = useDialog()\n const theme = useTheme()\n const {\n __unstable_autoFocus: autoFocus = true,\n __unstable_hideCloseButton: hideCloseButton = false,\n cardRadius = 3,\n cardShadow = 4,\n children,\n contentRef,\n footer,\n header,\n id,\n onClickOutside,\n onClose,\n padding = 4,\n position = dialog.position || 'fixed',\n scheme,\n width = 0,\n zOffset = dialog.zOffset || theme.sanity.layer?.dialog.zOffset,\n ...restProps\n } = props\n const preDivRef = useRef<HTMLDivElement | null>(null)\n const postDivRef = useRef<HTMLDivElement | null>(null)\n const cardRef = useRef<HTMLDivElement | null>(null)\n\n const handleFocus = useCallback((event: React.FocusEvent<HTMLDivElement>) => {\n const target = event.target\n const cardElement = cardRef.current\n\n if (!cardElement) {\n return\n }\n\n if (target === preDivRef.current) {\n focusLastDescendant(cardElement)\n\n return\n }\n\n if (target === postDivRef.current) {\n focusFirstDescendant(cardElement)\n\n return\n }\n }, [])\n\n const labelId = `${id}_label`\n\n return (\n <Portal>\n <Root\n {...restProps}\n $padding={padding}\n $position={position}\n aria-labelledby={labelId}\n aria-modal\n data-ui=\"Dialog\"\n id={id}\n onFocus={handleFocus}\n ref={ref}\n role=\"dialog\"\n zOffset={zOffset}\n >\n <div ref={preDivRef} tabIndex={0} />\n <DialogCard\n __unstable_autoFocus={autoFocus}\n __unstable_hideCloseButton={hideCloseButton}\n contentRef={contentRef}\n footer={footer}\n header={header}\n id={id}\n onClickOutside={onClickOutside}\n onClose={onClose}\n radius={cardRadius}\n ref={cardRef}\n scheme={scheme}\n shadow={cardShadow}\n width={width}\n >\n {children}\n </DialogCard>\n <div ref={postDivRef} tabIndex={0} />\n </Root>\n </Portal>\n )\n})\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/_internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __reExport = (target, module2, desc) => {
|
|
9
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(module2))
|
|
11
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
12
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
var __toModule = (module2) => {
|
|
17
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
+
};
|
|
19
|
+
__markAsModule(exports);
|
|
20
|
+
__reExport(exports, __toModule(require("./useUnique")));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is React hook – an and escape hatch – to make sure that a value is the same
|
|
3
|
+
* on every render. SHOULD NOT BE USED IN MOST CASES.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function useUnique<ValueType>(value: ValueType): ValueType;
|
|
8
|
+
//# sourceMappingURL=useUnique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnique.d.ts","sourceRoot":"","sources":["../../../../src/hooks/_internal/useUnique.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,CAQhE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
__markAsModule(target);
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, module2, desc) => {
|
|
14
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(module2))
|
|
16
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
17
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
21
|
+
var __toModule = (module2) => {
|
|
22
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
23
|
+
};
|
|
24
|
+
__export(exports, {
|
|
25
|
+
useUnique: () => useUnique
|
|
26
|
+
});
|
|
27
|
+
var import_lodash = __toModule(require("lodash"));
|
|
28
|
+
var import_react = __toModule(require("react"));
|
|
29
|
+
function useUnique(value) {
|
|
30
|
+
const valueRef = (0, import_react.useRef)(value);
|
|
31
|
+
if (!(0, import_lodash.isEqual)(valueRef.current, value)) {
|
|
32
|
+
valueRef.current = value;
|
|
33
|
+
}
|
|
34
|
+
return valueRef.current;
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/hooks/_internal/useUnique.ts"],
|
|
4
|
+
"sourcesContent": ["import {isEqual} from 'lodash'\nimport {useRef} from 'react'\n\n/**\n * This is React hook \u2013 an and escape hatch \u2013 to make sure that a value is the same\n * on every render. SHOULD NOT BE USED IN MOST CASES.\n *\n * @internal\n */\nexport function useUnique<ValueType>(value: ValueType): ValueType {\n const valueRef = useRef<ValueType>(value)\n\n if (!isEqual(valueRef.current, value)) {\n valueRef.current = value\n }\n\n return valueRef.current\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,oBAAsB;AACtB,mBAAqB;AAQd,mBAA8B,OAA6B;AAChE,QAAM,WAAW,yBAAkB;AAEnC,MAAI,CAAC,2BAAQ,SAAS,SAAS,QAAQ;AACrC,aAAS,UAAU;AAAA;AAGrB,SAAO,SAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../src/utils/portal/portal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../src/utils/portal/portal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAUnE"}
|
|
@@ -27,9 +27,11 @@ __export(exports, {
|
|
|
27
27
|
var import_react_dom = __toModule(require("react-dom"));
|
|
28
28
|
var import_usePortal = __toModule(require("./usePortal"));
|
|
29
29
|
function Portal(props) {
|
|
30
|
+
const { children, __unstable_name: name } = props;
|
|
30
31
|
const portal = (0, import_usePortal.usePortal)();
|
|
31
|
-
|
|
32
|
+
const portalElement = name ? portal.elements && portal.elements[name] : portal.element;
|
|
33
|
+
if (!portalElement) {
|
|
32
34
|
return null;
|
|
33
35
|
}
|
|
34
|
-
return import_react_dom.default.createPortal(
|
|
36
|
+
return import_react_dom.default.createPortal(children, portalElement);
|
|
35
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/utils/portal/portal.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport {usePortal} from './usePortal'\n\n/**\n * @public\n */\nexport interface PortalProps {\n children: React.ReactNode\n}\n\n/**\n * @public\n */\nexport function Portal(props: PortalProps): React.ReactPortal | null {\n const portal = usePortal()\n\n if (!
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AACA,uBAAqB;AACrB,uBAAwB;
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport {usePortal} from './usePortal'\n\n/**\n * @public\n */\nexport interface PortalProps {\n children: React.ReactNode\n /**\n * @beta This API might change. DO NOT USE IN PRODUCTION.\n */\n __unstable_name?: string\n}\n\n/**\n * @public\n */\nexport function Portal(props: PortalProps): React.ReactPortal | null {\n const {children, __unstable_name: name} = props\n const portal = usePortal()\n const portalElement = name ? portal.elements && portal.elements[name] : portal.element\n\n if (!portalElement) {\n return null\n }\n\n return ReactDOM.createPortal(children, portalElement)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AACA,uBAAqB;AACrB,uBAAwB;AAgBjB,gBAAgB,OAA8C;AACnE,QAAM,EAAC,UAAU,iBAAiB,SAAQ;AAC1C,QAAM,SAAS;AACf,QAAM,gBAAgB,OAAO,OAAO,YAAY,OAAO,SAAS,QAAQ,OAAO;AAE/E,MAAI,CAAC,eAAe;AAClB,WAAO;AAAA;AAGT,SAAO,yBAAS,aAAa,UAAU;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,7 +8,11 @@ export interface PortalProviderProps {
|
|
|
8
8
|
*/
|
|
9
9
|
boundaryElement?: HTMLElement | null;
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
-
element
|
|
11
|
+
element?: HTMLElement | null;
|
|
12
|
+
/**
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
__unstable_elements?: Record<string, HTMLElement | null | undefined>;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portalProvider.d.ts","sourceRoot":"","sources":["../../../../src/utils/portal/portalProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"portalProvider.d.ts","sourceRoot":"","sources":["../../../../src/utils/portal/portalProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAA;AAKpC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC5B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;CACrE;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAc7E"}
|
|
@@ -25,17 +25,20 @@ __export(exports, {
|
|
|
25
25
|
PortalProvider: () => PortalProvider
|
|
26
26
|
});
|
|
27
27
|
var import_react = __toModule(require("react"));
|
|
28
|
+
var import_internal = __toModule(require("../../hooks/_internal"));
|
|
28
29
|
var import_portalContext = __toModule(require("./portalContext"));
|
|
29
30
|
const __BROWSER__ = typeof window !== "undefined";
|
|
30
31
|
function PortalProvider(props) {
|
|
31
|
-
const { boundaryElement, children, element } = props;
|
|
32
|
+
const { boundaryElement, children, element, __unstable_elements: elementsProp } = props;
|
|
33
|
+
const elements = (0, import_internal.useUnique)(elementsProp);
|
|
32
34
|
const value = (0, import_react.useMemo)(() => {
|
|
33
35
|
return {
|
|
34
36
|
version: 0,
|
|
35
37
|
boundaryElement: boundaryElement || null,
|
|
36
|
-
element: element || __BROWSER__ && document.body || null
|
|
38
|
+
element: element || __BROWSER__ && document.body || null,
|
|
39
|
+
elements
|
|
37
40
|
};
|
|
38
|
-
}, [boundaryElement, element]);
|
|
41
|
+
}, [boundaryElement, element, elements]);
|
|
39
42
|
return /* @__PURE__ */ import_react.default.createElement(import_portalContext.PortalContext.Provider, {
|
|
40
43
|
value
|
|
41
44
|
}, children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/utils/portal/portalProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, {useMemo} from 'react'\nimport {PortalContext} from './portalContext'\nimport {PortalContextValue} from './types'\n\n/**\n * @public\n */\nexport interface PortalProviderProps {\n /**\n * @deprecated Use `<BoundaryElementProvider element={...} />` instead\n */\n boundaryElement?: HTMLElement | null\n children: React.ReactNode\n element
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAC7B,2BAA4B;
|
|
4
|
+
"sourcesContent": ["import React, {useMemo} from 'react'\nimport {useUnique} from '../../hooks/_internal'\nimport {PortalContext} from './portalContext'\nimport {PortalContextValue} from './types'\n\n/**\n * @public\n */\nexport interface PortalProviderProps {\n /**\n * @deprecated Use `<BoundaryElementProvider element={...} />` instead\n */\n boundaryElement?: HTMLElement | null\n children: React.ReactNode\n element?: HTMLElement | null\n /**\n * @beta\n */\n __unstable_elements?: Record<string, HTMLElement | null | undefined>\n}\n\nconst __BROWSER__ = typeof window !== 'undefined'\n\n/**\n * @public\n */\nexport function PortalProvider(props: PortalProviderProps): React.ReactElement {\n const {boundaryElement, children, element, __unstable_elements: elementsProp} = props\n const elements = useUnique(elementsProp)\n\n const value: PortalContextValue = useMemo(() => {\n return {\n version: 0.0,\n boundaryElement: boundaryElement || null,\n element: element || (__BROWSER__ && document.body) || null,\n elements,\n }\n }, [boundaryElement, element, elements])\n\n return <PortalContext.Provider value={value}>{children}</PortalContext.Provider>\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAC7B,sBAAwB;AACxB,2BAA4B;AAmB5B,MAAM,cAAc,OAAO,WAAW;AAK/B,wBAAwB,OAAgD;AAC7E,QAAM,EAAC,iBAAiB,UAAU,SAAS,qBAAqB,iBAAgB;AAChF,QAAM,WAAW,+BAAU;AAE3B,QAAM,QAA4B,0BAAQ,MAAM;AAC9C,WAAO;AAAA,MACL,SAAS;AAAA,MACT,iBAAiB,mBAAmB;AAAA,MACpC,SAAS,WAAY,eAAe,SAAS,QAAS;AAAA,MACtD;AAAA;AAAA,KAED,CAAC,iBAAiB,SAAS;AAE9B,SAAO,mDAAC,mCAAc,UAAf;AAAA,IAAwB;AAAA,KAAe;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/portal/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,GAAG,CAAA;IACZ,eAAe,EAAE,WAAW,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/utils/portal/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,GAAG,CAAA;IACZ,eAAe,EAAE,WAAW,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;CAC1D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/utils/portal/types.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @public\n */\nexport interface PortalContextValue {\n version: 0.0\n boundaryElement: HTMLElement | null\n element: HTMLElement | null\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * @public\n */\nexport interface PortalContextValue {\n version: 0.0\n boundaryElement: HTMLElement | null\n element: HTMLElement | null\n elements?: Record<string, HTMLElement | null | undefined>\n}\n"],
|
|
5
5
|
"mappings": ";;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,5 +14,5 @@ export declare const ResultsPopover: import("styled-components").StyledComponent
|
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
export declare const AnimatedSpinnerIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "x" | "y" | "r" | "name" | "mode" | "key" | "color" | "media" | "radius" | "from" | "children" | "version" | "style" | "clipPath" | "filter" | "mask" | "path" | "end" | "local" | "clip" | "fill" | "stroke" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "min" | "max" | "display" | "height" | "fontFamily" | "fontWeight" | "fontSize" | "letterSpacing" | "transform" | "overflow" | "type" | "width" | "className" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crossOrigin" | "href" | "method" | "target" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "format" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "lightingColor" | "limitingConeAngle" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & import("react").RefAttributes<SVGSVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
+
export declare const AnimatedSpinnerIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "x" | "y" | "r" | "name" | "mode" | "key" | "color" | "media" | "radius" | "from" | "children" | "version" | "style" | "clipPath" | "filter" | "mask" | "path" | "end" | "local" | "clip" | "fill" | "stroke" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "min" | "max" | "fr" | "display" | "height" | "fontFamily" | "fontWeight" | "fontSize" | "letterSpacing" | "transform" | "overflow" | "type" | "width" | "className" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "crossOrigin" | "href" | "method" | "target" | "accentHeight" | "accumulate" | "additive" | "alignmentBaseline" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "azimuth" | "baseFrequency" | "baselineShift" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorProfile" | "colorRendering" | "contentScriptType" | "contentStyleType" | "cursor" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "direction" | "divisor" | "dominantBaseline" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "fillOpacity" | "fillRule" | "filterRes" | "filterUnits" | "floodColor" | "floodOpacity" | "focusable" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "format" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphOrientationVertical" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "imageRendering" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "lightingColor" | "limitingConeAngle" | "markerEnd" | "markerHeight" | "markerMid" | "markerStart" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "offset" | "opacity" | "operator" | "order" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "paintOrder" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "pointerEvents" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rotate" | "rx" | "ry" | "scale" | "seed" | "shapeRendering" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "stopColor" | "stopOpacity" | "strikethroughPosition" | "strikethroughThickness" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textAnchor" | "textDecoration" | "textLength" | "textRendering" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeBidi" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "vectorEffect" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "visibility" | "vMathematical" | "widths" | "wordSpacing" | "writingMode" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & import("react").RefAttributes<SVGSVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
18
18
|
//# sourceMappingURL=autocomplete.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/autocomplete/autocomplete.styles.tsx"],"names":[],"mappings":";AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,yGAEhB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,miMAMnB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,qhMAS1B,CAAA;AAYD;;GAEG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/autocomplete/autocomplete.styles.tsx"],"names":[],"mappings":";AAIA;;GAEG;AACH,eAAO,MAAM,IAAI,yGAEhB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,miMAMnB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,qhMAS1B,CAAA;AAYD;;GAEG;AACH,eAAO,MAAM,mBAAmB,6sPAE/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;AAKjF,OAAO,EAAC,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAEnF,OAAO,EAAC,mBAAmB,EAAW,MAAM,aAAa,CAAA;AACzD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAS1C;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,sBAAsB,EAAE,oBAAoB;IAC/E;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAA;IAC5C,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC5B;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;AAKjF,OAAO,EAAC,sBAAsB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAEnF,OAAO,EAAC,mBAAmB,EAAW,MAAM,aAAa,CAAA;AACzD,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAA;AAS1C;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,sBAAsB,EAAE,oBAAoB;IAC/E;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAA;IAC5C,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC5B;AA2MD;;GAEG;AACH,eAAO,MAAM,MAAM,m3LAyFjB,CAAA"}
|
|
@@ -33,7 +33,7 @@ import { CloseIcon } from "@sanity/icons";
|
|
|
33
33
|
import React, { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
34
34
|
import styled from "styled-components";
|
|
35
35
|
import { focusFirstDescendant, focusLastDescendant } from "../../helpers";
|
|
36
|
-
import { useClickOutside, useGlobalKeyDown } from "../../hooks";
|
|
36
|
+
import { useClickOutside, useForwardedRef, useGlobalKeyDown } from "../../hooks";
|
|
37
37
|
import { Box, Button, Card, Container, Flex, Text } from "../../primitives";
|
|
38
38
|
import { responsivePaddingStyle } from "../../styles/internal";
|
|
39
39
|
import { useTheme } from "../../theme";
|
|
@@ -109,6 +109,7 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
|
109
109
|
shadow,
|
|
110
110
|
width
|
|
111
111
|
} = props;
|
|
112
|
+
const forwardedRef = useForwardedRef(ref);
|
|
112
113
|
const [rootElement, setRootElement] = useState(null);
|
|
113
114
|
const localContentRef = useRef(null);
|
|
114
115
|
const layer = useLayer();
|
|
@@ -119,10 +120,10 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
|
119
120
|
useEffect(() => {
|
|
120
121
|
if (!autoFocus)
|
|
121
122
|
return;
|
|
122
|
-
if (
|
|
123
|
-
focusFirstDescendant(
|
|
123
|
+
if (forwardedRef.current) {
|
|
124
|
+
focusFirstDescendant(forwardedRef.current);
|
|
124
125
|
}
|
|
125
|
-
}, [autoFocus]);
|
|
126
|
+
}, [autoFocus, forwardedRef]);
|
|
126
127
|
useGlobalKeyDown(useCallback((event) => {
|
|
127
128
|
if (!isTopLayer || !onClose)
|
|
128
129
|
return;
|
|
@@ -139,11 +140,8 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
|
139
140
|
}, [isTopLayer, onClickOutside]), [rootElement]);
|
|
140
141
|
const setRef = useCallback((el) => {
|
|
141
142
|
setRootElement(el);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
else if (ref)
|
|
145
|
-
ref.current = el;
|
|
146
|
-
}, [ref]);
|
|
143
|
+
forwardedRef.current = el;
|
|
144
|
+
}, [forwardedRef]);
|
|
147
145
|
const setContentRef = useCallback((el) => {
|
|
148
146
|
localContentRef.current = el;
|
|
149
147
|
if (typeof contentRef === "function")
|