@sanity/ui 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{arrow-C6TlkggA.js → arrow-BmX6qbAS.js} +57 -49
- package/dist/arrow-BmX6qbAS.js.map +1 -0
- package/dist/autocomplete.d.ts +2 -2
- package/dist/autocomplete.d.ts.map +1 -1
- package/dist/autocomplete.js +5 -5
- package/dist/breadcrumbs.d.ts +2 -2
- package/dist/breadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs.js +10 -5
- package/dist/breadcrumbs.js.map +1 -1
- package/dist/{button-D3iEd7Je.js → button-BNyKSDyA.js} +6 -5
- package/dist/button-BNyKSDyA.js.map +1 -0
- package/dist/code.d.ts +2 -2
- package/dist/code.d.ts.map +1 -1
- package/dist/{factory-BA3gEfyI.js → factory-BzXTX8_Q.js} +2 -2
- package/dist/{factory-BA3gEfyI.js.map → factory-BzXTX8_Q.js.map} +1 -1
- package/dist/{flex-CySCBzQm.js → flex-DmbDG2ks.js} +2 -2
- package/dist/{flex-CySCBzQm.js.map → flex-DmbDG2ks.js.map} +1 -1
- package/dist/{getElementRef-5HZQ-Owu.js → getElementRef-Jw7gY0eV.js} +13 -2
- package/dist/getElementRef-Jw7gY0eV.js.map +1 -0
- package/dist/{grid-I2TNptX-.js → grid-6JSgMj1O.js} +2 -2
- package/dist/{grid-I2TNptX-.js.map → grid-6JSgMj1O.js.map} +1 -1
- package/dist/{hotkeys-Bi6Q5963.js → hotkeys-CaHsQlsO.js} +9 -6
- package/dist/hotkeys-CaHsQlsO.js.map +1 -0
- package/dist/index.d.ts +156 -156
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +83 -159
- package/dist/index.js.map +1 -1
- package/dist/{layer-BK7xWHcE.js → layer-Bl5R3uNR.js} +4 -4
- package/dist/{layer-BK7xWHcE.js.map → layer-Bl5R3uNR.js.map} +1 -1
- package/dist/menu.d.ts +6 -6
- package/dist/menu.d.ts.map +1 -1
- package/dist/menu.js +6 -6
- package/dist/menu.js.map +1 -1
- package/dist/{popover-CdBTZDvj.js → popover-B7-28L8y.js} +44 -40
- package/dist/popover-B7-28L8y.js.map +1 -0
- package/dist/popover-CMlQeKn0.d.ts.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/{stack-BGFEokua.js → stack-rsNFPq2-.js} +2 -2
- package/dist/{stack-BGFEokua.js.map → stack-rsNFPq2-.js.map} +1 -1
- package/dist/styles.css +135 -24
- package/dist/{textInput-Bu3QuADZ.js → textInput-pSfQjkmx.js} +23 -19
- package/dist/textInput-pSfQjkmx.js.map +1 -0
- package/dist/theme.d.ts +33 -33
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +4 -4
- package/dist/toast.d.ts.map +1 -1
- package/dist/toast.js +6 -5
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.d.ts +5 -5
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +28 -27
- package/dist/tooltip.js.map +1 -1
- package/dist/{useLayer-jUJIz8mh.js → useLayer-D1usxIE0.js} +2 -2
- package/dist/{useLayer-jUJIz8mh.js.map → useLayer-D1usxIE0.js.map} +1 -1
- package/package.json +10 -9
- package/dist/arrow-C6TlkggA.js.map +0 -1
- package/dist/button-D3iEd7Je.js.map +0 -1
- package/dist/getElementRef-5HZQ-Owu.js.map +0 -1
- package/dist/hotkeys-Bi6Q5963.js.map +0 -1
- package/dist/popover-CdBTZDvj.js.map +0 -1
- package/dist/textInput-Bu3QuADZ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayer-jUJIz8mh.js","names":["asProp = 'div'","display = 'block'","margin = 0","padding = 0","_getArrayProp(gridColumn)","_getArrayProp(gridColumnStart)","_getArrayProp(gridColumnEnd)","_getArrayProp(display)","_getArrayProp(flex)","_getArrayProp(height)","_getArrayProp(margin)","_getArrayProp(marginX)","_getArrayProp(marginY)","_getArrayProp(marginTop)","_getArrayProp(marginRight)","_getArrayProp(marginBottom)","_getArrayProp(marginLeft)","_getArrayProp(overflow)","_getArrayProp(padding)","_getArrayProp(paddingX)","_getArrayProp(paddingY)","_getArrayProp(paddingTop)","_getArrayProp(paddingRight)","_getArrayProp(paddingBottom)","_getArrayProp(paddingLeft)","_getArrayProp(gridRow)","_getArrayProp(gridRowStart)","_getArrayProp(gridRowEnd)","_getArrayProp(sizing)","<StyledBox\n data-as={typeof asProp === 'string' ? asProp : undefined}\n data-ui=\"Box\"\n {...restProps}\n $column={_getArrayProp(gridColumn)}\n $columnStart={_getArrayProp(gridColumnStart)}\n $columnEnd={_getArrayProp(gridColumnEnd)}\n $display={_getArrayProp(display)}\n $flex={_getArrayProp(flex)}\n $height={_getArrayProp(height)}\n $margin={_getArrayProp(margin)}\n $marginX={_getArrayProp(marginX)}\n $marginY={_getArrayProp(marginY)}\n $marginTop={_getArrayProp(marginTop)}\n $marginRight={_getArrayProp(marginRight)}\n $marginBottom={_getArrayProp(marginBottom)}\n $marginLeft={_getArrayProp(marginLeft)}\n $overflow={_getArrayProp(overflow)}\n $padding={_getArrayProp(padding)}\n $paddingX={_getArrayProp(paddingX)}\n $paddingY={_getArrayProp(paddingY)}\n $paddingTop={_getArrayProp(paddingTop)}\n $paddingRight={_getArrayProp(paddingRight)}\n $paddingBottom={_getArrayProp(paddingBottom)}\n $paddingLeft={_getArrayProp(paddingLeft)}\n $row={_getArrayProp(gridRow)}\n $rowStart={_getArrayProp(gridRowStart)}\n $rowEnd={_getArrayProp(gridRowEnd)}\n $sizing={_getArrayProp(sizing)}\n // styled-components 6.5 distributes PolymorphicCallProps over ElementType and\n // hits TS2589; narrow the call-site target while still passing the real value.\n // oxlint-disable-next-line no-unsafe-type-assertion\n as={asProp as 'div'}\n ref={ref}\n >\n {props.children}\n </StyledBox>","children","asProp as 'div'","typeof asProp === 'string' ? asProp : undefined","getTheme_v2(useStyledTheme() as Theme)","useStyledTheme() as Theme","useMemo(() => {\n if (!rootTheme) return null\n\n return {\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }\n }, [rootTheme, scheme, tone])","{\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }","useMemo(() => {\n if (!rootTheme) return null\n\n return getScopedTheme(rootTheme, scheme, tone)\n }, [scheme, rootTheme, tone])","getScopedTheme(rootTheme, scheme, tone)","<pre>ThemeProvider: no \"theme\" property provided</pre>","<StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>","<ThemeContext.Provider value={themeContext}>\n <StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>\n </ThemeContext.Provider>","ThemeContext.Provider","<ThemeProvider scheme={scheme || root.scheme} theme={root.theme} tone={tone}>\n {children}\n </ThemeProvider>","theme","scheme || root.scheme","checkered = false","focusRing = false","radius = 0","toneProp = 'default'","_getArrayProp(border)","_getArrayProp(borderTop)","_getArrayProp(borderRight)","_getArrayProp(borderBottom)","_getArrayProp(borderLeft)","_getArrayProp(radius)","_getArrayProp(shadow)","<StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />","scheme","muted ?? false","checkered ? '' : undefined","pressed ? '' : undefined","selected ? '' : undefined","typeof as === 'string' ? as : undefined","rootTheme.scheme","<ThemeColorProvider scheme={scheme} tone={tone}>\n <StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />\n </ThemeColorProvider>","_createMediaStore(media)","useMemo(() => _createMediaStore(media), [media])","(onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n }","() => window.matchMedia(mediaQueryString).matches","useCallback(\n (onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n },\n [mediaQueryString],\n )","() => false","getServerSnapshot = () => false","zOffsetProp = 0","parentContextValue && getLayerContext(parentContextValue)","_getArrayProp(zOffsetProp)","{}","(childLevel?: number) => {\n // Register child layers to the parent layer\n const parentDispose = parentRegisterChild?.(childLevel)\n\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const prevLen = state[childLevel] ?? 0\n const nextState = {...state, [childLevel]: prevLen + 1}\n\n setSize(Object.keys(nextState).length)\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, increment the size by 1\n setSize((v) => v + 1)\n }\n\n return () => {\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const nextState = {...state}\n\n if (nextState[childLevel] === 1) {\n delete nextState[childLevel]\n\n setSize(Object.keys(nextState).length)\n } else {\n nextState[childLevel] -= 1\n }\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, decrement the size by 1\n setSize((v) => v - 1)\n }\n\n parentDispose?.()\n }\n }","(v) => v + 1","nextState","state","(v) => v - 1","useCallback(\n (childLevel?: number) => {\n // Register child layers to the parent layer\n const parentDispose = parentRegisterChild?.(childLevel)\n\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const prevLen = state[childLevel] ?? 0\n const nextState = {...state, [childLevel]: prevLen + 1}\n\n setSize(Object.keys(nextState).length)\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, increment the size by 1\n setSize((v) => v + 1)\n }\n\n return () => {\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const nextState = {...state}\n\n if (nextState[childLevel] === 1) {\n delete nextState[childLevel]\n\n setSize(Object.keys(nextState).length)\n } else {\n nextState[childLevel] -= 1\n }\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, decrement the size by 1\n setSize((v) => v - 1)\n }\n\n parentDispose?.()\n }\n },\n [parentRegisterChild, setSize, setChildLayers],\n )","() => parentRegisterChild?.(level)","[level, parentRegisterChild]","{\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }","useMemo(\n () => ({\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }),\n [isTopLayer, level, registerChild, size, zIndex],\n )","<LayerContext.Provider value={value}>{children}</LayerContext.Provider>","LayerContext.Provider","v","getLayerContext(value)","err"],"sources":["../src/core/styles/box/boxStyle.ts","../src/core/styles/flex/flexItemStyle.ts","../src/core/styles/grid/gridItemStyle.ts","../src/core/styles/margin/marginStyle.ts","../src/core/styles/padding/paddingStyle.ts","../src/core/primitives/box/box.tsx","../src/core/styles/radius/radiusStyle.ts","../src/core/theme/useTheme.ts","../src/core/styles/card/_cardColorStyle.ts","../src/core/styles/focusRing/index.ts","../src/core/styles/border/borderStyle.ts","../src/core/styles/shadow/shadowStyle.ts","../src/core/lib/globalScope.ts","../src/core/lib/createGlobalScopedContext.ts","../src/core/theme/themeContext.ts","../src/core/theme/themeProvider.tsx","../src/core/theme/useRootTheme.ts","../src/core/theme/themeColorProvider.tsx","../src/core/primitives/card/styles.ts","../src/core/primitives/card/card.tsx","../src/core/hooks/useMediaIndex/useMediaIndex.ts","../src/core/hooks/useMatchMedia.ts","../src/core/hooks/usePrefersReducedMotion.ts","../src/core/lib/isRecord.ts","../src/core/utils/layer/getLayerContext.ts","../src/core/utils/layer/layerContext.ts","../src/core/utils/layer/layerProvider.tsx","../src/core/utils/layer/useLayer.ts"],"sourcesContent":["import {Property} from 'csstype'\n\nimport {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveBoxStyleProps} from './types'\n\nconst BASE_STYLE: CSSObject = {\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n}\n\nconst BOX_SIZING: {[key: string]: Property.BoxSizing} = {\n content: 'content-box',\n border: 'border-box',\n}\n\nconst BOX_HEIGHT = {\n stretch: 'stretch',\n fill: '100%',\n}\n\nexport function boxStyle(): CSSObject {\n return BASE_STYLE\n}\n\nexport function responsiveBoxStyle(): Array<\n (props: ResponsiveBoxStyleProps & ThemeProps) => CSSObject[]\n> {\n return [\n responsiveBoxSizingStyle,\n responsiveBoxHeightStyle,\n responsiveBoxOverflowStyle,\n responsiveBoxDisplayStyle,\n ]\n}\n\nfunction responsiveBoxDisplayStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$display, (display) => ({\n '&:not([hidden])': {display},\n }))\n}\n\nfunction responsiveBoxSizingStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$sizing, (sizing) => ({\n boxSizing: BOX_SIZING[sizing],\n }))\n}\n\nfunction responsiveBoxHeightStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$height, (height) => ({\n height: BOX_HEIGHT[height],\n }))\n}\n\nfunction responsiveBoxOverflowStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$overflow, (overflow) => ({\n overflow,\n }))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {EMPTY_ARRAY} from '../../constants'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveFlexItemStyleProps} from './types'\n\nconst BASE_STYLE: CSSObject = {\n minWidth: 0,\n minHeight: 0,\n}\n\nexport function flexItemStyle(): Array<\n CSSObject | ((props: ResponsiveFlexItemStyleProps & ThemeProps) => CSSObject[])\n> {\n return [BASE_STYLE, responsiveFlexItemStyle]\n}\n\nfunction responsiveFlexItemStyle(props: ResponsiveFlexItemStyleProps & ThemeProps): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n if (!props.$flex) return EMPTY_ARRAY\n\n return _responsive(media, props.$flex, (flex) => ({flex: `${flex}`}))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveGridItemStyleProps} from './types'\n\nexport function responsiveGridItemStyle(): Array<\n (props: ResponsiveGridItemStyleProps & ThemeProps) => CSSObject[]\n> {\n return [\n responsiveGridItemRowStyle,\n responsiveGridItemRowStartStyle,\n responsiveGridItemRowEndStyle,\n responsiveGridItemColumnStyle,\n responsiveGridItemColumnStartStyle,\n responsiveGridItemColumnEndStyle,\n ]\n}\n\nconst GRID_ITEM_ROW = {\n auto: 'auto',\n full: '1 / -1',\n}\n\nconst GRID_ITEM_COLUMN = {\n auto: 'auto',\n full: '1 / -1',\n}\n\nfunction responsiveGridItemRowStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$row, (row) => {\n if (typeof row === 'number') {\n return {gridRow: `span ${row} / span ${row}`}\n }\n\n return {gridRow: GRID_ITEM_ROW[row]}\n })\n}\n\nfunction responsiveGridItemRowStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$rowStart, (rowStart) => ({\n gridRowStart: `${rowStart}`,\n }))\n}\n\nfunction responsiveGridItemRowEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$rowEnd, (rowEnd) => ({gridRowEnd: `${rowEnd}`}))\n}\n\nfunction responsiveGridItemColumnStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$column, (column) => {\n if (typeof column === 'number') {\n return {gridColumn: `span ${column} / span ${column}`}\n }\n\n return {gridColumn: GRID_ITEM_COLUMN[column]}\n })\n}\n\nfunction responsiveGridItemColumnStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$columnStart, (columnStart) => ({\n gridColumnStart: `${columnStart}`,\n }))\n}\n\nfunction responsiveGridItemColumnEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$columnEnd, (columnEnd) => ({\n gridColumnEnd: `${columnEnd}`,\n }))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {_getResponsiveSpace} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveMarginStyleProps} from './types'\n\nexport function responsiveMarginStyle(\n props: ResponsiveMarginStyleProps & ThemeProps,\n): CSSObject[][] {\n const {theme} = props\n\n // oxlint-disable-next-line no-unsafe-type-assertion\n return [\n _getResponsiveSpace(theme, ['margin'], props.$margin),\n _getResponsiveSpace(theme, ['marginLeft', 'marginRight'], props.$marginX),\n _getResponsiveSpace(theme, ['marginTop', 'marginBottom'], props.$marginY),\n _getResponsiveSpace(theme, ['marginTop'], props.$marginTop),\n _getResponsiveSpace(theme, ['marginRight'], props.$marginRight),\n _getResponsiveSpace(theme, ['marginBottom'], props.$marginBottom),\n _getResponsiveSpace(theme, ['marginLeft'], props.$marginLeft),\n ].filter(Boolean) as CSSObject[][]\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {_getResponsiveSpace} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsivePaddingStyleProps} from './types'\n\nexport function responsivePaddingStyle(\n props: ResponsivePaddingStyleProps & ThemeProps,\n): CSSObject[][] {\n const {theme} = props\n\n // oxlint-disable-next-line no-unsafe-type-assertion\n return [\n _getResponsiveSpace(theme, ['padding'], props.$padding),\n _getResponsiveSpace(theme, ['paddingLeft', 'paddingRight'], props.$paddingX),\n _getResponsiveSpace(theme, ['paddingTop', 'paddingBottom'], props.$paddingY),\n _getResponsiveSpace(theme, ['paddingTop'], props.$paddingTop),\n _getResponsiveSpace(theme, ['paddingRight'], props.$paddingRight),\n _getResponsiveSpace(theme, ['paddingBottom'], props.$paddingBottom),\n _getResponsiveSpace(theme, ['paddingLeft'], props.$paddingLeft),\n ].filter(Boolean) as CSSObject[][]\n}\n","import {styled} from 'styled-components'\n\nimport {boxStyle, responsiveBoxStyle} from '../../styles/box/boxStyle'\nimport {ResponsiveBoxStyleProps} from '../../styles/box/types'\nimport {flexItemStyle} from '../../styles/flex/flexItemStyle'\nimport {FlexItemStyleProps} from '../../styles/flex/types'\nimport {responsiveGridItemStyle} from '../../styles/grid/gridItemStyle'\nimport {ResponsiveGridItemStyleProps} from '../../styles/grid/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveMarginStyle} from '../../styles/margin/marginStyle'\nimport {ResponsiveMarginStyleProps} from '../../styles/margin/types'\nimport {responsivePaddingStyle} from '../../styles/padding/paddingStyle'\nimport {ResponsivePaddingStyleProps} from '../../styles/padding/types'\nimport {ElementType, Props} from '../../types/component'\nimport {\n ResponsiveBoxProps,\n ResponsiveFlexItemProps,\n ResponsiveGridItemProps,\n ResponsiveMarginProps,\n ResponsivePaddingProps,\n} from '../types'\n\n/**\n * The props that `Box` adds on top of the element it renders as.\n *\n * @public\n */\nexport interface BoxOwnProps\n extends\n ResponsiveFlexItemProps,\n ResponsiveBoxProps,\n ResponsiveGridItemProps,\n ResponsiveMarginProps,\n ResponsivePaddingProps {\n forwardedAs?: ElementType\n}\n\n/**\n * @public\n */\nexport type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>\n\nconst StyledBox = styled.div<\n FlexItemStyleProps &\n ResponsiveBoxStyleProps &\n ResponsiveGridItemStyleProps &\n ResponsiveMarginStyleProps &\n ResponsivePaddingStyleProps\n>(\n boxStyle,\n flexItemStyle,\n responsiveBoxStyle,\n responsiveGridItemStyle,\n responsiveMarginStyle,\n responsivePaddingStyle,\n)\n\nconst BoxComponent = function Box(\n props: BoxOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,\n) {\n const {\n as: asProp = 'div',\n ref,\n gridColumn,\n gridColumnStart,\n gridColumnEnd,\n display = 'block',\n flex,\n height,\n margin = 0,\n marginX,\n marginY,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n overflow,\n padding = 0,\n paddingX,\n paddingY,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n gridRow,\n gridRowStart,\n gridRowEnd,\n sizing,\n ...restProps\n } = props\n\n return (\n <StyledBox\n data-as={typeof asProp === 'string' ? asProp : undefined}\n data-ui=\"Box\"\n {...restProps}\n $column={_getArrayProp(gridColumn)}\n $columnStart={_getArrayProp(gridColumnStart)}\n $columnEnd={_getArrayProp(gridColumnEnd)}\n $display={_getArrayProp(display)}\n $flex={_getArrayProp(flex)}\n $height={_getArrayProp(height)}\n $margin={_getArrayProp(margin)}\n $marginX={_getArrayProp(marginX)}\n $marginY={_getArrayProp(marginY)}\n $marginTop={_getArrayProp(marginTop)}\n $marginRight={_getArrayProp(marginRight)}\n $marginBottom={_getArrayProp(marginBottom)}\n $marginLeft={_getArrayProp(marginLeft)}\n $overflow={_getArrayProp(overflow)}\n $padding={_getArrayProp(padding)}\n $paddingX={_getArrayProp(paddingX)}\n $paddingY={_getArrayProp(paddingY)}\n $paddingTop={_getArrayProp(paddingTop)}\n $paddingRight={_getArrayProp(paddingRight)}\n $paddingBottom={_getArrayProp(paddingBottom)}\n $paddingLeft={_getArrayProp(paddingLeft)}\n $row={_getArrayProp(gridRow)}\n $rowStart={_getArrayProp(gridRowStart)}\n $rowEnd={_getArrayProp(gridRowEnd)}\n $sizing={_getArrayProp(sizing)}\n // styled-components 6.5 distributes PolymorphicCallProps over ElementType and\n // hits TS2589; narrow the call-site target while still passing the real value.\n // oxlint-disable-next-line no-unsafe-type-assertion\n as={asProp as 'div'}\n ref={ref}\n >\n {props.children}\n </StyledBox>\n )\n}\n\n/**\n * The `Box` component is a basic layout wrapper component which provides utility properties\n * for flex, margins and padding.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Box = BoxComponent as unknown as <E extends ElementType = 'div'>(\n props: BoxProps<E>,\n) => React.JSX.Element\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveRadiusStyleProps} from './types'\n\nexport function responsiveRadiusStyle(props: ResponsiveRadiusStyleProps & ThemeProps): CSSObject[] {\n const {media, radius} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$radius, (value) => {\n let borderRadius: string | 0 = 0\n\n if (typeof value === 'number') {\n borderRadius = rem(radius[value])\n }\n\n if (value === 'full') {\n borderRadius = '9999px'\n }\n\n return {borderRadius}\n })\n}\n","import {useTheme as useStyledTheme} from 'styled-components'\n\nimport {Theme, Theme_v2} from '../../theme/system/theme'\nimport {getTheme_v2} from '../../theme/versioning/getTheme_v2'\n\n/**\n * @public\n */\nexport function useTheme(): Theme {\n // oxlint-disable-next-line no-unnecessary-type-assertion\n return useStyledTheme() as Theme\n}\n\n/**\n * @public\n */\nexport function useTheme_v2(): Theme_v2 {\n // oxlint-disable-next-line no-unnecessary-type-assertion\n return getTheme_v2(useStyledTheme() as Theme)\n}\n","import {ThemeColorCard_v2} from '../../../theme/system/color/color'\nimport {ThemeColorState_v2} from '../../../theme/system/color/state'\nimport {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function _cardColorStyle(\n base: ThemeColorCard_v2,\n color: ThemeColorState_v2,\n checkered = false,\n): CSSObject {\n return {\n // from base\n\n '--card-backdrop-color': base.backdrop,\n\n '--card-focus-ring-color': base.focusRing,\n\n '--card-shadow-outline-color': base.shadow.outline,\n '--card-shadow-umbra-color': base.shadow.umbra,\n '--card-shadow-penumbra-color': base.shadow.penumbra,\n '--card-shadow-ambient-color': base.shadow.ambient,\n\n // from state\n\n '--card-accent-fg-color': color.accent.fg,\n\n '--card-avatar-gray-bg-color': color.avatar.gray.bg,\n '--card-avatar-gray-fg-color': color.avatar.gray.fg,\n '--card-avatar-blue-bg-color': color.avatar.blue.bg,\n '--card-avatar-blue-fg-color': color.avatar.blue.fg,\n '--card-avatar-purple-bg-color': color.avatar.purple.bg,\n '--card-avatar-purple-fg-color': color.avatar.purple.fg,\n '--card-avatar-magenta-bg-color': color.avatar.magenta.bg,\n '--card-avatar-magenta-fg-color': color.avatar.magenta.fg,\n '--card-avatar-red-bg-color': color.avatar.red.bg,\n '--card-avatar-red-fg-color': color.avatar.red.fg,\n '--card-avatar-orange-bg-color': color.avatar.orange.bg,\n '--card-avatar-orange-fg-color': color.avatar.orange.fg,\n '--card-avatar-yellow-bg-color': color.avatar.yellow.bg,\n '--card-avatar-yellow-fg-color': color.avatar.yellow.fg,\n '--card-avatar-green-bg-color': color.avatar.green.bg,\n '--card-avatar-green-fg-color': color.avatar.green.fg,\n '--card-avatar-cyan-bg-color': color.avatar.cyan.bg,\n '--card-avatar-cyan-fg-color': color.avatar.cyan.fg,\n\n '--card-bg-color': color.bg,\n '--card-bg-image': checkered\n ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)`\n : undefined,\n\n '--card-border-color': color.border,\n\n '--card-badge-default-bg-color': color.badge.default.bg,\n '--card-badge-default-dot-color': color.badge.default.dot,\n '--card-badge-default-fg-color': color.badge.default.fg,\n '--card-badge-default-icon-color': color.badge.default.icon,\n '--card-badge-neutral-bg-color': color.badge.neutral?.bg,\n '--card-badge-neutral-dot-color': color.badge.neutral?.dot,\n '--card-badge-neutral-fg-color': color.badge.neutral?.fg,\n '--card-badge-neutral-icon-color': color.badge.neutral?.icon,\n '--card-badge-primary-bg-color': color.badge.primary.bg,\n '--card-badge-primary-dot-color': color.badge.primary.dot,\n '--card-badge-primary-fg-color': color.badge.primary.fg,\n '--card-badge-primary-icon-color': color.badge.primary.icon,\n '--card-badge-suggest-bg-color': color.badge.suggest?.bg,\n '--card-badge-suggest-dot-color': color.badge.suggest?.dot,\n '--card-badge-suggest-fg-color': color.badge.suggest?.fg,\n '--card-badge-suggest-icon-color': color.badge.suggest?.icon,\n '--card-badge-positive-bg-color': color.badge.positive.bg,\n '--card-badge-positive-dot-color': color.badge.positive.dot,\n '--card-badge-positive-fg-color': color.badge.positive.fg,\n '--card-badge-positive-icon-color': color.badge.positive.icon,\n '--card-badge-caution-bg-color': color.badge.caution.bg,\n '--card-badge-caution-dot-color': color.badge.caution.dot,\n '--card-badge-caution-fg-color': color.badge.caution.fg,\n '--card-badge-caution-icon-color': color.badge.caution.icon,\n '--card-badge-critical-bg-color': color.badge.critical.bg,\n '--card-badge-critical-dot-color': color.badge.critical.dot,\n '--card-badge-critical-fg-color': color.badge.critical.fg,\n '--card-badge-critical-icon-color': color.badge.critical.icon,\n\n '--card-code-bg-color': color.code.bg,\n '--card-code-fg-color': color.code.fg,\n\n '--card-fg-color': color.fg,\n\n '--card-icon-color': color.icon,\n\n '--card-kbd-bg-color': color.kbd.bg,\n '--card-kbd-border-color': color.kbd.border,\n '--card-kbd-fg-color': color.kbd.fg,\n\n '--card-link-fg-color': color.link.fg,\n\n '--card-muted-bg-color': color.muted.bg,\n '--card-muted-fg-color': color.muted.fg,\n\n '--card-skeleton-color-from': color.skeleton.from,\n '--card-skeleton-color-to': color.skeleton.to,\n\n // deprecated variables (kept for legacy)\n\n '--card-bg2-color': color.muted.bg,\n '--card-link-color': color.link.fg,\n '--card-hairline-soft-color': color.border,\n '--card-hairline-hard-color': color.border,\n }\n}\n","import {ThemeFocusRing} from '../../../theme/system/focusRing'\n\nexport function focusRingBorderStyle(border: {color: string; width: number}): string {\n return `inset 0 0 0 ${border.width}px ${border.color}`\n}\n\nexport function focusRingStyle(opts: {\n base?: {bg: string}\n border?: {color: string; width: number}\n focusRing: ThemeFocusRing\n}): string {\n const {base, border, focusRing} = opts\n const focusRingOutsetWidth = focusRing.offset + focusRing.width\n const focusRingInsetWidth = 0 - focusRing.offset\n const bgColor = base ? base.bg : 'var(--card-bg-color)'\n\n return [\n focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,\n border && focusRingBorderStyle(border),\n focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,\n focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`,\n ]\n .filter(Boolean)\n .join(',')\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveBorderStyleProps} from './types'\n\nexport function responsiveBorderStyle(): Array<\n (props: ResponsiveBorderStyleProps & ThemeProps) => CSSObject[]\n> {\n return [border, borderTop, borderRight, borderBottom, borderLeft]\n}\n\nfunction border(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$border, (value) =>\n value ? {'&&': {border: borderStyle}} : {'&&': {border: 0}},\n )\n}\n\nfunction borderTop(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderTop, (value) =>\n value ? {'&&': {borderTop: borderStyle}} : {'&&': {borderTop: 0}},\n )\n}\n\nfunction borderRight(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderRight, (value) =>\n value ? {'&&': {borderRight: borderStyle}} : {'&&': {borderRight: 0}},\n )\n}\n\nfunction borderBottom(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderBottom, (value) =>\n value ? {'&&': {borderBottom: borderStyle}} : {'&&': {borderBottom: 0}},\n )\n}\n\nfunction borderLeft(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderLeft, (value) =>\n value ? {'&&': {borderLeft: borderStyle}} : {'&&': {borderLeft: 0}},\n )\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {ThemeBoxShadow, ThemeShadow} from '../../../theme/system/shadow'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {EMPTY_RECORD} from '../../constants'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveShadowStyleProps} from './types'\n\nfunction toBoxShadow(shadow: ThemeBoxShadow, color: string) {\n return `${shadow.map(rem).join(' ')} ${color}`\n}\n\nfunction shadowStyle(shadow: ThemeShadow | null, outlineWidth: number = 1): CSSObject {\n if (!shadow) return EMPTY_RECORD\n\n const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`\n const umbra = toBoxShadow(shadow.umbra, 'var(--card-shadow-umbra-color)')\n const penumbra = toBoxShadow(shadow.penumbra, 'var(--card-shadow-penumbra-color)')\n const ambient = toBoxShadow(shadow.ambient, 'var(--card-shadow-ambient-color)')\n\n return {boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}`}\n}\n\nexport function responsiveShadowStyle(props: ResponsiveShadowStyleProps & ThemeProps): CSSObject[] {\n const {card, media, shadow} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$shadow, (index) =>\n shadowStyle(shadow[index], card.shadow.outline),\n )\n}\n","/**\n * Gets the global scope instance in a given environment.\n *\n * The strategy is to return the most modern, and if not, the most common:\n * - The `globalThis` variable is the modern approach to accessing the global scope\n * - The `window` variable is the global scope in a web browser\n * - The `self` variable is the global scope in workers and others\n * - The `global` variable is the global scope in Node.js\n */\nfunction getGlobalScope() {\n if (typeof globalThis !== 'undefined') return globalThis\n if (typeof window !== 'undefined') return window\n if (typeof self !== 'undefined') return self\n if (typeof global !== 'undefined') return global\n\n throw new Error('@sanity/ui: could not locate global scope')\n}\n\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const globalScope = getGlobalScope() as any\n","/**\n * As `@sanity/ui` is declared as a dependency, and may be duplicated, sometimes across major versions\n * it's critical that vital react contexts are shared even when there is a duplicate.\n * If we used a model similar to `sanity` itself, or `styled-components`, this would be unnecessary as\n * those libraries enforce single instances.\n * Since we don't enforce it we have to support a sanity plugin being able to call hooks like `useToast`, and then\n * read the context setup by `sanity`, which calls `ToastProvider`, even if the provider and hook are different instances in memory.\n * It's also why it's vital that all changes to globally scoped providers remain fully backwards compatible to v1.\n */\n\nimport {type Context, createContext} from 'react'\n\nimport {globalScope} from './globalScope'\n\n// oxlint-disable-next-line no-unnecessary-type-parameters\nexport function createGlobalScopedContext<ContextType, const T extends ContextType = ContextType>(\n /**\n * Enforce that all Symbol.for keys used for globally scoped contexts have a predictable prefix\n */\n key: `@sanity/ui/context/${string}`,\n defaultValue: T,\n): Context<ContextType> {\n const symbol = Symbol.for(key)\n\n /**\n * Prevent errors about re-renders on React SSR on Next.js App Router\n */\n if (typeof document === 'undefined') {\n const context = createContext<ContextType>(defaultValue)\n context.displayName = key\n return context\n }\n\n globalScope[symbol] = globalScope[symbol] || createContext<T>(defaultValue)\n\n return globalScope[symbol]\n}\n","import {createGlobalScopedContext} from '../lib/createGlobalScopedContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @internal\n */\nexport const ThemeContext = createGlobalScopedContext<ThemeContextValue | null>(\n '@sanity/ui/context/theme',\n null,\n)\n","import {useContext, useMemo} from 'react'\nimport {ThemeProvider as StyledThemeProvider} from 'styled-components'\n\nimport {getScopedTheme} from '../../theme/getScopedTheme'\nimport {\n type ThemeColorCardToneKey,\n type ThemeColorSchemeKey,\n} from '../../theme/system/color/_system'\nimport {type RootTheme, type Theme} from '../../theme/system/theme'\nimport {ThemeContext} from './themeContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @public\n */\nexport interface ThemeProviderProps {\n children?: React.ReactNode\n scheme?: ThemeColorSchemeKey\n theme?: RootTheme\n tone?: ThemeColorCardToneKey\n}\n\n/**\n * @public\n */\nexport function ThemeProvider(props: ThemeProviderProps): React.JSX.Element {\n const parentTheme = useContext(ThemeContext)\n const {children} = props\n const scheme = props.scheme ?? (parentTheme?.scheme || 'light')\n const rootTheme = props.theme ?? (parentTheme?.theme || null)\n const tone = props.tone ?? (parentTheme?.tone || 'default')\n\n const themeContext: ThemeContextValue | null = useMemo(() => {\n if (!rootTheme) return null\n\n return {\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }\n }, [rootTheme, scheme, tone])\n\n const theme: Theme | null = useMemo(() => {\n if (!rootTheme) return null\n\n return getScopedTheme(rootTheme, scheme, tone)\n }, [scheme, rootTheme, tone])\n\n if (!theme) {\n return <pre>ThemeProvider: no \"theme\" property provided</pre>\n }\n\n return (\n <ThemeContext.Provider value={themeContext}>\n <StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>\n </ThemeContext.Provider>\n )\n}\n","import {useContext} from 'react'\n\nimport {ThemeContext} from './themeContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @public\n */\nexport function useRootTheme(): ThemeContextValue {\n const value = useContext(ThemeContext)\n\n if (!value) {\n throw new Error('useRootTheme(): missing context value')\n }\n\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n return value as unknown as ThemeContextValue\n}\n","import {ThemeColorCardToneKey, ThemeColorSchemeKey} from '../../theme/system/color/_system'\nimport {ThemeProvider} from './themeProvider'\nimport {useRootTheme} from './useRootTheme'\n\n/**\n * @public\n */\nexport interface ThemeColorProviderProps {\n children?: React.ReactNode\n scheme?: ThemeColorSchemeKey\n tone?: ThemeColorCardToneKey\n}\n\n/**\n * @public\n */\nexport function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element {\n const {children, scheme, tone} = props\n const root = useRootTheme()\n\n return (\n <ThemeProvider scheme={scheme || root.scheme} theme={root.theme} tone={tone}>\n {children}\n </ThemeProvider>\n )\n}\n","import {css} from 'styled-components'\n\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_cardColorStyle} from '../../styles/card/_cardColorStyle'\nimport {focusRingStyle} from '../../styles/focusRing'\nimport {ThemeProps} from '../../styles/types'\nimport {CardStyleProps} from './types'\n\nexport function cardStyle(\n props: CardStyleProps & ThemeProps,\n): Array<ReturnType<typeof css> | (() => ReturnType<typeof css>)> {\n return [cardBaseStyle(props), cardColorStyle(props)]\n}\n\nfunction cardBaseStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {\n const {$checkered} = props\n const {space} = getTheme_v2(props.theme)\n\n return css`\n ${\n $checkered &&\n css`\n background-size: ${space[3]}px ${space[3]}px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n `\n }\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n `\n}\n\nfunction cardColorStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {\n const {$checkered, $focusRing, $muted} = props\n const {card, color, style} = getTheme_v2(props.theme)\n const border = {width: card.border.width, color: 'var(--card-border-color)'}\n\n return css`\n color-scheme: ${color._dark ? 'dark' : 'light'};\n\n ${_cardColorStyle(color, color, $checkered)}\n\n background-color: ${$muted ? 'var(--card-muted-bg-color)' : 'var(--card-bg-color)'};\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n\n &[data-selected] {\n ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}\n }\n\n &:active {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ${\n $focusRing\n ? focusRingStyle({base: color, border, focusRing: card.focusRing})\n : undefined\n };\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n\n &[data-selected] {\n ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}\n }\n\n &:active {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ${\n $focusRing\n ? focusRingStyle({base: color, border, focusRing: card.focusRing})\n : undefined\n };\n }\n }\n }\n\n ${style?.card?.root}\n `\n}\n","import {isValidElementType} from 'react-is'\nimport {styled} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {responsiveBorderStyle} from '../../styles/border/borderStyle'\nimport {ResponsiveBorderStyleProps} from '../../styles/border/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveRadiusStyle} from '../../styles/radius/radiusStyle'\nimport {ResponsiveRadiusStyleProps} from '../../styles/radius/types'\nimport {responsiveShadowStyle} from '../../styles/shadow/shadowStyle'\nimport {ResponsiveShadowStyleProps} from '../../styles/shadow/types'\nimport {ThemeColorProvider} from '../../theme/themeColorProvider'\nimport {useRootTheme} from '../../theme/useRootTheme'\nimport {CardTone} from '../../types/card'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'\nimport {cardStyle} from './styles'\nimport {CardStyleProps} from './types'\n\n/**\n * @public\n */\nexport interface CardOwnProps\n extends BoxOwnProps, ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps {\n /**\n * Do not use in production.\n * @beta\n */\n __unstable_checkered?: boolean\n /**\n * Do not use in production.\n * @beta\n */\n __unstable_focusRing?: boolean\n disabled?: boolean\n muted?: boolean\n pressed?: boolean\n scheme?: ThemeColorSchemeKey\n selected?: boolean\n tone?: CardTone\n}\n\n/**\n * @public\n */\nexport type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>\n\nconst StyledCard = styled(Box)<\n CardStyleProps &\n ResponsiveRadiusStyleProps &\n ResponsiveBorderStyleProps &\n ResponsiveShadowStyleProps\n>(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle)\n\nfunction CardComponent(\n props: CardOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,\n) {\n const {\n __unstable_checkered: checkered = false,\n __unstable_focusRing: focusRing = false,\n as: asProp,\n border,\n borderTop,\n borderRight,\n borderBottom,\n borderLeft,\n muted,\n pressed,\n radius = 0,\n ref,\n scheme,\n selected,\n shadow,\n tone: toneProp = 'default',\n ...restProps\n } = props\n\n const as = isValidElementType(asProp) ? asProp : 'div'\n const rootTheme = useRootTheme()\n const tone = toneProp === 'inherit' ? rootTheme.tone : toneProp\n\n // todo: Consider adding the wrapper approach for nested cards in which the tones are not changing, avoid unnecessary ThemeColorProvider\n return (\n <ThemeColorProvider scheme={scheme} tone={tone}>\n <StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />\n </ThemeColorProvider>\n )\n}\n\n/**\n * The `Card` component acts much like a `Box`, but with a background and foreground color.\n * Components within a `Card` inherit its colors.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Card = CardComponent as unknown as <E extends ElementType = 'div'>(\n props: CardProps<E>,\n) => React.JSX.Element\n","import {useMemo, useSyncExternalStore} from 'react'\n\nimport {useTheme_v2} from '../../theme/useTheme'\n\n/**\n * @internal\n */\nexport interface _MediaStore {\n subscribe: (onStoreChange: () => void) => () => void\n getSnapshot: () => number\n}\n\ntype MediaQueryMinWidth = `(min-width: ${number}px)`\ntype MediaQueryMaxWidth = `(max-width: ${number}px)`\ntype MediaQueryMinMaxWidth = `${MediaQueryMinWidth} and ${MediaQueryMaxWidth}`\ntype MediaQuery = `screen and ${MediaQueryMinWidth | MediaQueryMaxWidth | MediaQueryMinMaxWidth}`\n\nfunction _getMediaQuery(media: number[], index: number): MediaQuery {\n if (index === 0) {\n return `screen and (max-width: ${media[index] - 1}px)`\n }\n\n if (index === media.length) {\n return `screen and (min-width: ${media[index - 1]}px)`\n }\n\n return `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`\n}\n\nfunction _createMediaStore(media: number[]): _MediaStore {\n const mediaLen = media.length\n let sizes: {mq: MediaQueryList; index: number}[]\n\n // The _createMediaStore function is called in both server and client environments.\n // However since subscribe and getSnapshot are only called on the client we lazy init what we need for them\n // so that we don't need to run checks for wether it's safe to call `window.matchMedia`\n const getSizes = () => {\n if (!sizes) {\n sizes = []\n\n for (let index = mediaLen; index > -1; index -= 1) {\n const mediaQuery = _getMediaQuery(media, index)\n\n sizes.push({index, mq: window.matchMedia(mediaQuery)})\n }\n }\n\n return sizes\n }\n\n const getSnapshot = () => {\n for (const {index, mq} of getSizes()) {\n if (mq.matches) return index\n }\n\n return 0\n }\n\n const subscribe = (onStoreChange: () => void) => {\n const disposeFns: (() => void)[] = []\n\n for (const {mq} of getSizes()) {\n const handleChange = () => {\n if (mq.matches) onStoreChange()\n }\n\n mq.addEventListener('change', handleChange)\n\n disposeFns.push(() => mq.removeEventListener('change', handleChange))\n }\n\n return () => {\n for (const disposeFn of disposeFns) {\n disposeFn()\n }\n }\n }\n\n return {getSnapshot, subscribe}\n}\n\n/**\n * Only called during server-side rendering, and hydration if using hydrateRoot\n * Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query\n * and we assume `(prefers-color-scheme: light)` since it's the most common scheme\n *\n * @link https://beta.reactjs.org/apis/react/useSyncExternalStore#adding-support-for-server-rendering\n */\nfunction getServerSnapshot() {\n return 0\n}\n\n/**\n * This API might change. DO NOT USE IN PRODUCTION.\n * @beta\n */\nexport function useMediaIndex(): number {\n const {media} = useTheme_v2()\n const store = useMemo(() => _createMediaStore(media), [media])\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot)\n}\n","import {useCallback, useDebugValue, useSyncExternalStore} from 'react'\n\n/**\n * Efficiently subscribes to `window.matchMedia` queries\n *\n * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)\n *\n * @public\n */\nexport function useMatchMedia(\n mediaQueryString: `(${string})`,\n getServerSnapshot?: () => boolean,\n): boolean {\n useDebugValue(mediaQueryString)\n\n return useSyncExternalStore(\n useCallback(\n (onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n },\n [mediaQueryString],\n ),\n () => window.matchMedia(mediaQueryString).matches,\n getServerSnapshot,\n )\n}\n","import {useMatchMedia} from './useMatchMedia'\n\n/**\n * Returns true if motion should be reduced\n *\n * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)\n *\n * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.\n * Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion\n * @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b\n *\n * @public\n */\nexport function usePrefersReducedMotion(getServerSnapshot = () => false): boolean {\n return useMatchMedia('(prefers-reduced-motion: reduce)', getServerSnapshot)\n}\n","export function isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === 'object' && !Array.isArray(value))\n}\n","import {isRecord} from '../../lib/isRecord'\nimport {LayerContextValue} from './types'\n\nexport function getLayerContext(contextValue: LayerContextValue): LayerContextValue {\n // NOTE: This check is for future-compatiblity\n // - If the value is not an object, it’s not compatible with the current version\n // - If the value is an object, but doesn’t have `version: 0.0`, it’s not compatible with the current version\n if (!isRecord(contextValue) || contextValue.version !== 0.0) {\n throw new Error('the context value is not compatible')\n }\n\n if (!contextValue) {\n throw new Error('components using `useLayer()` should be wrapped in a <LayerProvider>.')\n }\n\n if (contextValue.version === 0.0) {\n return contextValue\n }\n\n throw new Error('could not get layer context')\n}\n","import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'\nimport {LayerContextValue} from './types'\n\nexport const LayerContext = createGlobalScopedContext<LayerContextValue | null>(\n '@sanity/ui/context/layer',\n null,\n)\n","import {useCallback, useContext, useEffect, useMemo, useState} from 'react'\n\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {getLayerContext} from './getLayerContext'\nimport {LayerContext} from './layerContext'\nimport {LayerContextValue} from './types'\n\n/**\n * @public\n */\nexport interface LayerProviderProps {\n children?: React.ReactNode\n zOffset?: number | number[]\n}\n\n/**\n * @public\n */\nexport function LayerProvider(props: LayerProviderProps): React.JSX.Element {\n const {children, zOffset: zOffsetProp = 0} = props\n\n // Get parent context values\n const parentContextValue = useContext(LayerContext)\n const parent = parentContextValue && getLayerContext(parentContextValue)\n const parentRegisterChild = parent?.registerChild\n const parentLevel = parent?.level ?? 0\n\n // Get level\n const level = parentLevel + 1\n\n // Get z-index offset\n const zOffset = _getArrayProp(zOffsetProp)\n\n // Get responsive z-index value\n const maxMediaIndex = zOffset.length - 1\n const mediaIndex = Math.min(useMediaIndex(), maxMediaIndex)\n const zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex]\n\n // A state value that is used to keep track of the number of child layers on each level\n const [, setChildLayers] = useState<Record<number, number>>({})\n\n // A state value that is used to keep track of the number of child levels\n const [size, setSize] = useState(0)\n\n const isTopLayer = size === 0\n\n const registerChild = useCallback(\n (childLevel?: number) => {\n // Register child layers to the parent layer\n const parentDispose = parentRegisterChild?.(childLevel)\n\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const prevLen = state[childLevel] ?? 0\n const nextState = {...state, [childLevel]: prevLen + 1}\n\n setSize(Object.keys(nextState).length)\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, increment the size by 1\n setSize((v) => v + 1)\n }\n\n return () => {\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const nextState = {...state}\n\n if (nextState[childLevel] === 1) {\n delete nextState[childLevel]\n\n setSize(Object.keys(nextState).length)\n } else {\n nextState[childLevel] -= 1\n }\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, decrement the size by 1\n setSize((v) => v - 1)\n }\n\n parentDispose?.()\n }\n },\n [parentRegisterChild, setSize, setChildLayers],\n )\n\n // Register this layer on mount\n useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild])\n\n const value: LayerContextValue = useMemo(\n () => ({\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }),\n [isTopLayer, level, registerChild, size, zIndex],\n )\n\n return <LayerContext.Provider value={value}>{children}</LayerContext.Provider>\n}\n","import {useContext} from 'react'\n\nimport {getLayerContext} from './getLayerContext'\nimport {LayerContext} from './layerContext'\nimport {LayerContextValue} from './types'\n\n/**\n * @public\n */\nexport function useLayer(): LayerContextValue {\n const value = useContext(LayerContext)\n\n if (!value) {\n throw new Error('useLayer(): missing context value')\n }\n\n try {\n return getLayerContext(value)\n } catch (err) {\n if (err instanceof Error) {\n // oxlint-disable-next-line preserve-caught-error\n throw new Error(`useLayer(): ${err.message}`)\n } else {\n // oxlint-disable-next-line preserve-caught-error, restrict-template-expressions\n throw new Error(`useLayer(): ${err}`)\n }\n }\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,eAAwB,EAC5B,uCAAmC,EACjC,WAAW,OACb,EACF,GAEM,aAAkD;CACtD,SAAS;CACT,QAAQ;AACV,GAEM,aAAa;CACjB,SAAS;CACT,MAAM;AACR;AAEA,SAAgB,WAAsB;CACpC,OAAO;AACT;AAEA,SAAgB,qBAEd;CACA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF;AAEA,SAAS,0BAA0B,OAA6C;CAC9E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,WAAW,aAAa,EACtD,mBAAmB,EAAC,QAAO,EAC7B,EAAE;AACJ;AAEA,SAAS,yBAAyB,OAA6C;CAC7E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,UAAU,YAAY,EACpD,WAAW,WAAW,QACxB,EAAE;AACJ;AAEA,SAAS,yBAAyB,OAA6C;CAC7E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,UAAU,YAAY,EACpD,QAAQ,WAAW,QACrB,EAAE;AACJ;AAEA,SAAS,2BAA2B,OAA6C;CAC/E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,YAAY,cAAc,EACxD,SACF,EAAE;AACJ;AC9DA,MAAM,aAAwB;CAC5B,UAAU;CACV,WAAW;AACb;AAEA,SAAgB,gBAEd;CACA,OAAO,CAAC,YAAY,uBAAuB;AAC7C;AAEA,SAAS,wBAAwB,OAA+D;CAC9F,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAIvC,OAFK,MAAM,QAEJ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ACH,MAAU,MAAM,mCAAmC;CAGrD,IAAI;EACKC,IAAAA;EAAP,OAAuB,EAAA,OAAA,qBAAhB,KAAA,gBAAgB,KAAK,GAAL,EAAA,KAAA,mBAAhBA;CACT,SAASC,IAAK;EAAL,IAAA,MAAA;EAML,MALE,eAAe,QAEP,MAAM,eAAe,IAAI,SAAS,IAGlC,MAAM,eAAe,KAAK;CAExC;AACF"}
|
|
1
|
+
{"version":3,"file":"useLayer-D1usxIE0.js","names":["asProp = 'div'","display = 'block'","margin = 0","padding = 0","_getArrayProp(gridColumn)","_getArrayProp(gridColumnStart)","_getArrayProp(gridColumnEnd)","_getArrayProp(display)","_getArrayProp(flex)","_getArrayProp(height)","_getArrayProp(margin)","_getArrayProp(marginX)","_getArrayProp(marginY)","_getArrayProp(marginTop)","_getArrayProp(marginRight)","_getArrayProp(marginBottom)","_getArrayProp(marginLeft)","_getArrayProp(overflow)","_getArrayProp(padding)","_getArrayProp(paddingX)","_getArrayProp(paddingY)","_getArrayProp(paddingTop)","_getArrayProp(paddingRight)","_getArrayProp(paddingBottom)","_getArrayProp(paddingLeft)","_getArrayProp(gridRow)","_getArrayProp(gridRowStart)","_getArrayProp(gridRowEnd)","_getArrayProp(sizing)","<StyledBox\n data-as={typeof asProp === 'string' ? asProp : undefined}\n data-ui=\"Box\"\n {...restProps}\n $column={_getArrayProp(gridColumn)}\n $columnStart={_getArrayProp(gridColumnStart)}\n $columnEnd={_getArrayProp(gridColumnEnd)}\n $display={_getArrayProp(display)}\n $flex={_getArrayProp(flex)}\n $height={_getArrayProp(height)}\n $margin={_getArrayProp(margin)}\n $marginX={_getArrayProp(marginX)}\n $marginY={_getArrayProp(marginY)}\n $marginTop={_getArrayProp(marginTop)}\n $marginRight={_getArrayProp(marginRight)}\n $marginBottom={_getArrayProp(marginBottom)}\n $marginLeft={_getArrayProp(marginLeft)}\n $overflow={_getArrayProp(overflow)}\n $padding={_getArrayProp(padding)}\n $paddingX={_getArrayProp(paddingX)}\n $paddingY={_getArrayProp(paddingY)}\n $paddingTop={_getArrayProp(paddingTop)}\n $paddingRight={_getArrayProp(paddingRight)}\n $paddingBottom={_getArrayProp(paddingBottom)}\n $paddingLeft={_getArrayProp(paddingLeft)}\n $row={_getArrayProp(gridRow)}\n $rowStart={_getArrayProp(gridRowStart)}\n $rowEnd={_getArrayProp(gridRowEnd)}\n $sizing={_getArrayProp(sizing)}\n // styled-components 6.5 distributes PolymorphicCallProps over ElementType and\n // hits TS2589; narrow the call-site target while still passing the real value.\n // oxlint-disable-next-line no-unsafe-type-assertion\n as={asProp as 'div'}\n ref={ref}\n >\n {props.children}\n </StyledBox>","children","asProp as 'div'","typeof asProp === 'string' ? asProp : undefined","getTheme_v2(useStyledTheme() as Theme)","useStyledTheme() as Theme","useMemo(() => {\n if (!rootTheme) return null\n\n return {\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }\n }, [rootTheme, scheme, tone])","{\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }","useMemo(() => {\n if (!rootTheme) return null\n\n return getScopedTheme(rootTheme, scheme, tone)\n }, [scheme, rootTheme, tone])","getScopedTheme(rootTheme, scheme, tone)","<pre>ThemeProvider: no \"theme\" property provided</pre>","<StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>","<ThemeContext.Provider value={themeContext}>\n <StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>\n </ThemeContext.Provider>","ThemeContext.Provider","<ThemeProvider scheme={scheme || root.scheme} theme={root.theme} tone={tone}>\n {children}\n </ThemeProvider>","theme","scheme || root.scheme","checkered = false","focusRing = false","radius = 0","toneProp = 'default'","_getArrayProp(border)","_getArrayProp(borderTop)","_getArrayProp(borderRight)","_getArrayProp(borderBottom)","_getArrayProp(borderLeft)","_getArrayProp(radius)","_getArrayProp(shadow)","<StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />","scheme","muted ?? false","checkered ? '' : undefined","pressed ? '' : undefined","selected ? '' : undefined","typeof as === 'string' ? as : undefined","rootTheme.scheme","<ThemeColorProvider scheme={scheme} tone={tone}>\n <StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />\n </ThemeColorProvider>","_createMediaStore(media)","useMemo(() => _createMediaStore(media), [media])","(onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n }","() => window.matchMedia(mediaQueryString).matches","useCallback(\n (onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n },\n [mediaQueryString],\n )","() => false","getServerSnapshot = () => false","zOffsetProp = 0","parentContextValue && getLayerContext(parentContextValue)","_getArrayProp(zOffsetProp)","{}","(childLevel?: number) => {\n // Register child layers to the parent layer\n const parentDispose = parentRegisterChild?.(childLevel)\n\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const prevLen = state[childLevel] ?? 0\n const nextState = {...state, [childLevel]: prevLen + 1}\n\n setSize(Object.keys(nextState).length)\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, increment the size by 1\n setSize((v) => v + 1)\n }\n\n return () => {\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const nextState = {...state}\n\n if (nextState[childLevel] === 1) {\n delete nextState[childLevel]\n\n setSize(Object.keys(nextState).length)\n } else {\n nextState[childLevel] -= 1\n }\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, decrement the size by 1\n setSize((v) => v - 1)\n }\n\n parentDispose?.()\n }\n }","(v) => v + 1","nextState","state","(v) => v - 1","useCallback(\n (childLevel?: number) => {\n // Register child layers to the parent layer\n const parentDispose = parentRegisterChild?.(childLevel)\n\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const prevLen = state[childLevel] ?? 0\n const nextState = {...state, [childLevel]: prevLen + 1}\n\n setSize(Object.keys(nextState).length)\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, increment the size by 1\n setSize((v) => v + 1)\n }\n\n return () => {\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const nextState = {...state}\n\n if (nextState[childLevel] === 1) {\n delete nextState[childLevel]\n\n setSize(Object.keys(nextState).length)\n } else {\n nextState[childLevel] -= 1\n }\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, decrement the size by 1\n setSize((v) => v - 1)\n }\n\n parentDispose?.()\n }\n },\n [parentRegisterChild, setSize, setChildLayers],\n )","() => parentRegisterChild?.(level)","[level, parentRegisterChild]","{\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }","useMemo(\n () => ({\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }),\n [isTopLayer, level, registerChild, size, zIndex],\n )","<LayerContext.Provider value={value}>{children}</LayerContext.Provider>","LayerContext.Provider","v","getLayerContext(value)","err"],"sources":["../src/core/styles/box/boxStyle.ts","../src/core/styles/flex/flexItemStyle.ts","../src/core/styles/grid/gridItemStyle.ts","../src/core/styles/margin/marginStyle.ts","../src/core/styles/padding/paddingStyle.ts","../src/core/primitives/box/box.tsx","../src/core/styles/radius/radiusStyle.ts","../src/core/theme/useTheme.ts","../src/core/styles/card/_cardColorStyle.ts","../src/core/styles/focusRing/index.ts","../src/core/styles/border/borderStyle.ts","../src/core/styles/shadow/shadowStyle.ts","../src/core/lib/globalScope.ts","../src/core/lib/createGlobalScopedContext.ts","../src/core/theme/themeContext.ts","../src/core/theme/themeProvider.tsx","../src/core/theme/useRootTheme.ts","../src/core/theme/themeColorProvider.tsx","../src/core/primitives/card/styles.ts","../src/core/primitives/card/card.tsx","../src/core/hooks/useMediaIndex/useMediaIndex.ts","../src/core/hooks/useMatchMedia.ts","../src/core/hooks/usePrefersReducedMotion.ts","../src/core/lib/isRecord.ts","../src/core/utils/layer/getLayerContext.ts","../src/core/utils/layer/layerContext.ts","../src/core/utils/layer/layerProvider.tsx","../src/core/utils/layer/useLayer.ts"],"sourcesContent":["import {Property} from 'csstype'\n\nimport {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveBoxStyleProps} from './types'\n\nconst BASE_STYLE: CSSObject = {\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n}\n\nconst BOX_SIZING: {[key: string]: Property.BoxSizing} = {\n content: 'content-box',\n border: 'border-box',\n}\n\nconst BOX_HEIGHT = {\n stretch: 'stretch',\n fill: '100%',\n}\n\nexport function boxStyle(): CSSObject {\n return BASE_STYLE\n}\n\nexport function responsiveBoxStyle(): Array<\n (props: ResponsiveBoxStyleProps & ThemeProps) => CSSObject[]\n> {\n return [\n responsiveBoxSizingStyle,\n responsiveBoxHeightStyle,\n responsiveBoxOverflowStyle,\n responsiveBoxDisplayStyle,\n ]\n}\n\nfunction responsiveBoxDisplayStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$display, (display) => ({\n '&:not([hidden])': {display},\n }))\n}\n\nfunction responsiveBoxSizingStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$sizing, (sizing) => ({\n boxSizing: BOX_SIZING[sizing],\n }))\n}\n\nfunction responsiveBoxHeightStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$height, (height) => ({\n height: BOX_HEIGHT[height],\n }))\n}\n\nfunction responsiveBoxOverflowStyle(props: ResponsiveBoxStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$overflow, (overflow) => ({\n overflow,\n }))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {EMPTY_ARRAY} from '../../constants'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveFlexItemStyleProps} from './types'\n\nconst BASE_STYLE: CSSObject = {\n minWidth: 0,\n minHeight: 0,\n}\n\nexport function flexItemStyle(): Array<\n CSSObject | ((props: ResponsiveFlexItemStyleProps & ThemeProps) => CSSObject[])\n> {\n return [BASE_STYLE, responsiveFlexItemStyle]\n}\n\nfunction responsiveFlexItemStyle(props: ResponsiveFlexItemStyleProps & ThemeProps): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n if (!props.$flex) return EMPTY_ARRAY\n\n return _responsive(media, props.$flex, (flex) => ({flex: `${flex}`}))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveGridItemStyleProps} from './types'\n\nexport function responsiveGridItemStyle(): Array<\n (props: ResponsiveGridItemStyleProps & ThemeProps) => CSSObject[]\n> {\n return [\n responsiveGridItemRowStyle,\n responsiveGridItemRowStartStyle,\n responsiveGridItemRowEndStyle,\n responsiveGridItemColumnStyle,\n responsiveGridItemColumnStartStyle,\n responsiveGridItemColumnEndStyle,\n ]\n}\n\nconst GRID_ITEM_ROW = {\n auto: 'auto',\n full: '1 / -1',\n}\n\nconst GRID_ITEM_COLUMN = {\n auto: 'auto',\n full: '1 / -1',\n}\n\nfunction responsiveGridItemRowStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$row, (row) => {\n if (typeof row === 'number') {\n return {gridRow: `span ${row} / span ${row}`}\n }\n\n return {gridRow: GRID_ITEM_ROW[row]}\n })\n}\n\nfunction responsiveGridItemRowStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$rowStart, (rowStart) => ({\n gridRowStart: `${rowStart}`,\n }))\n}\n\nfunction responsiveGridItemRowEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$rowEnd, (rowEnd) => ({gridRowEnd: `${rowEnd}`}))\n}\n\nfunction responsiveGridItemColumnStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$column, (column) => {\n if (typeof column === 'number') {\n return {gridColumn: `span ${column} / span ${column}`}\n }\n\n return {gridColumn: GRID_ITEM_COLUMN[column]}\n })\n}\n\nfunction responsiveGridItemColumnStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$columnStart, (columnStart) => ({\n gridColumnStart: `${columnStart}`,\n }))\n}\n\nfunction responsiveGridItemColumnEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$columnEnd, (columnEnd) => ({\n gridColumnEnd: `${columnEnd}`,\n }))\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {_getResponsiveSpace} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveMarginStyleProps} from './types'\n\nexport function responsiveMarginStyle(\n props: ResponsiveMarginStyleProps & ThemeProps,\n): CSSObject[][] {\n const {theme} = props\n\n // oxlint-disable-next-line no-unsafe-type-assertion\n return [\n _getResponsiveSpace(theme, ['margin'], props.$margin),\n _getResponsiveSpace(theme, ['marginLeft', 'marginRight'], props.$marginX),\n _getResponsiveSpace(theme, ['marginTop', 'marginBottom'], props.$marginY),\n _getResponsiveSpace(theme, ['marginTop'], props.$marginTop),\n _getResponsiveSpace(theme, ['marginRight'], props.$marginRight),\n _getResponsiveSpace(theme, ['marginBottom'], props.$marginBottom),\n _getResponsiveSpace(theme, ['marginLeft'], props.$marginLeft),\n ].filter(Boolean) as CSSObject[][]\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {_getResponsiveSpace} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsivePaddingStyleProps} from './types'\n\nexport function responsivePaddingStyle(\n props: ResponsivePaddingStyleProps & ThemeProps,\n): CSSObject[][] {\n const {theme} = props\n\n // oxlint-disable-next-line no-unsafe-type-assertion\n return [\n _getResponsiveSpace(theme, ['padding'], props.$padding),\n _getResponsiveSpace(theme, ['paddingLeft', 'paddingRight'], props.$paddingX),\n _getResponsiveSpace(theme, ['paddingTop', 'paddingBottom'], props.$paddingY),\n _getResponsiveSpace(theme, ['paddingTop'], props.$paddingTop),\n _getResponsiveSpace(theme, ['paddingRight'], props.$paddingRight),\n _getResponsiveSpace(theme, ['paddingBottom'], props.$paddingBottom),\n _getResponsiveSpace(theme, ['paddingLeft'], props.$paddingLeft),\n ].filter(Boolean) as CSSObject[][]\n}\n","import {styled} from 'styled-components'\n\nimport {boxStyle, responsiveBoxStyle} from '../../styles/box/boxStyle'\nimport {ResponsiveBoxStyleProps} from '../../styles/box/types'\nimport {flexItemStyle} from '../../styles/flex/flexItemStyle'\nimport {FlexItemStyleProps} from '../../styles/flex/types'\nimport {responsiveGridItemStyle} from '../../styles/grid/gridItemStyle'\nimport {ResponsiveGridItemStyleProps} from '../../styles/grid/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveMarginStyle} from '../../styles/margin/marginStyle'\nimport {ResponsiveMarginStyleProps} from '../../styles/margin/types'\nimport {responsivePaddingStyle} from '../../styles/padding/paddingStyle'\nimport {ResponsivePaddingStyleProps} from '../../styles/padding/types'\nimport {ElementType, Props} from '../../types/component'\nimport {\n ResponsiveBoxProps,\n ResponsiveFlexItemProps,\n ResponsiveGridItemProps,\n ResponsiveMarginProps,\n ResponsivePaddingProps,\n} from '../types'\n\n/**\n * The props that `Box` adds on top of the element it renders as.\n *\n * @public\n */\nexport interface BoxOwnProps\n extends\n ResponsiveFlexItemProps,\n ResponsiveBoxProps,\n ResponsiveGridItemProps,\n ResponsiveMarginProps,\n ResponsivePaddingProps {\n forwardedAs?: ElementType\n}\n\n/**\n * @public\n */\nexport type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>\n\nconst StyledBox = styled.div<\n FlexItemStyleProps &\n ResponsiveBoxStyleProps &\n ResponsiveGridItemStyleProps &\n ResponsiveMarginStyleProps &\n ResponsivePaddingStyleProps\n>(\n boxStyle,\n flexItemStyle,\n responsiveBoxStyle,\n responsiveGridItemStyle,\n responsiveMarginStyle,\n responsivePaddingStyle,\n)\n\nconst BoxComponent = function Box(\n props: BoxOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,\n) {\n const {\n as: asProp = 'div',\n ref,\n gridColumn,\n gridColumnStart,\n gridColumnEnd,\n display = 'block',\n flex,\n height,\n margin = 0,\n marginX,\n marginY,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n overflow,\n padding = 0,\n paddingX,\n paddingY,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n gridRow,\n gridRowStart,\n gridRowEnd,\n sizing,\n ...restProps\n } = props\n\n return (\n <StyledBox\n data-as={typeof asProp === 'string' ? asProp : undefined}\n data-ui=\"Box\"\n {...restProps}\n $column={_getArrayProp(gridColumn)}\n $columnStart={_getArrayProp(gridColumnStart)}\n $columnEnd={_getArrayProp(gridColumnEnd)}\n $display={_getArrayProp(display)}\n $flex={_getArrayProp(flex)}\n $height={_getArrayProp(height)}\n $margin={_getArrayProp(margin)}\n $marginX={_getArrayProp(marginX)}\n $marginY={_getArrayProp(marginY)}\n $marginTop={_getArrayProp(marginTop)}\n $marginRight={_getArrayProp(marginRight)}\n $marginBottom={_getArrayProp(marginBottom)}\n $marginLeft={_getArrayProp(marginLeft)}\n $overflow={_getArrayProp(overflow)}\n $padding={_getArrayProp(padding)}\n $paddingX={_getArrayProp(paddingX)}\n $paddingY={_getArrayProp(paddingY)}\n $paddingTop={_getArrayProp(paddingTop)}\n $paddingRight={_getArrayProp(paddingRight)}\n $paddingBottom={_getArrayProp(paddingBottom)}\n $paddingLeft={_getArrayProp(paddingLeft)}\n $row={_getArrayProp(gridRow)}\n $rowStart={_getArrayProp(gridRowStart)}\n $rowEnd={_getArrayProp(gridRowEnd)}\n $sizing={_getArrayProp(sizing)}\n // styled-components 6.5 distributes PolymorphicCallProps over ElementType and\n // hits TS2589; narrow the call-site target while still passing the real value.\n // oxlint-disable-next-line no-unsafe-type-assertion\n as={asProp as 'div'}\n ref={ref}\n >\n {props.children}\n </StyledBox>\n )\n}\n\n/**\n * The `Box` component is a basic layout wrapper component which provides utility properties\n * for flex, margins and padding.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Box = BoxComponent as unknown as <E extends ElementType = 'div'>(\n props: BoxProps<E>,\n) => React.JSX.Element\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveRadiusStyleProps} from './types'\n\nexport function responsiveRadiusStyle(props: ResponsiveRadiusStyleProps & ThemeProps): CSSObject[] {\n const {media, radius} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$radius, (value) => {\n let borderRadius: string | 0 = 0\n\n if (typeof value === 'number') {\n borderRadius = rem(radius[value])\n }\n\n if (value === 'full') {\n borderRadius = '9999px'\n }\n\n return {borderRadius}\n })\n}\n","import {useTheme as useStyledTheme} from 'styled-components'\n\nimport {Theme, Theme_v2} from '../../theme/system/theme'\nimport {getTheme_v2} from '../../theme/versioning/getTheme_v2'\n\n/**\n * @public\n */\nexport function useTheme(): Theme {\n // oxlint-disable-next-line no-unnecessary-type-assertion\n return useStyledTheme() as Theme\n}\n\n/**\n * @public\n */\nexport function useTheme_v2(): Theme_v2 {\n // oxlint-disable-next-line no-unnecessary-type-assertion\n return getTheme_v2(useStyledTheme() as Theme)\n}\n","import {ThemeColorCard_v2} from '../../../theme/system/color/color'\nimport {ThemeColorState_v2} from '../../../theme/system/color/state'\nimport {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function _cardColorStyle(\n base: ThemeColorCard_v2,\n color: ThemeColorState_v2,\n checkered = false,\n): CSSObject {\n return {\n // from base\n\n '--card-backdrop-color': base.backdrop,\n\n '--card-focus-ring-color': base.focusRing,\n\n '--card-shadow-outline-color': base.shadow.outline,\n '--card-shadow-umbra-color': base.shadow.umbra,\n '--card-shadow-penumbra-color': base.shadow.penumbra,\n '--card-shadow-ambient-color': base.shadow.ambient,\n\n // from state\n\n '--card-accent-fg-color': color.accent.fg,\n\n '--card-avatar-gray-bg-color': color.avatar.gray.bg,\n '--card-avatar-gray-fg-color': color.avatar.gray.fg,\n '--card-avatar-blue-bg-color': color.avatar.blue.bg,\n '--card-avatar-blue-fg-color': color.avatar.blue.fg,\n '--card-avatar-purple-bg-color': color.avatar.purple.bg,\n '--card-avatar-purple-fg-color': color.avatar.purple.fg,\n '--card-avatar-magenta-bg-color': color.avatar.magenta.bg,\n '--card-avatar-magenta-fg-color': color.avatar.magenta.fg,\n '--card-avatar-red-bg-color': color.avatar.red.bg,\n '--card-avatar-red-fg-color': color.avatar.red.fg,\n '--card-avatar-orange-bg-color': color.avatar.orange.bg,\n '--card-avatar-orange-fg-color': color.avatar.orange.fg,\n '--card-avatar-yellow-bg-color': color.avatar.yellow.bg,\n '--card-avatar-yellow-fg-color': color.avatar.yellow.fg,\n '--card-avatar-green-bg-color': color.avatar.green.bg,\n '--card-avatar-green-fg-color': color.avatar.green.fg,\n '--card-avatar-cyan-bg-color': color.avatar.cyan.bg,\n '--card-avatar-cyan-fg-color': color.avatar.cyan.fg,\n\n '--card-bg-color': color.bg,\n '--card-bg-image': checkered\n ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)`\n : undefined,\n\n '--card-border-color': color.border,\n\n '--card-badge-default-bg-color': color.badge.default.bg,\n '--card-badge-default-dot-color': color.badge.default.dot,\n '--card-badge-default-fg-color': color.badge.default.fg,\n '--card-badge-default-icon-color': color.badge.default.icon,\n '--card-badge-neutral-bg-color': color.badge.neutral?.bg,\n '--card-badge-neutral-dot-color': color.badge.neutral?.dot,\n '--card-badge-neutral-fg-color': color.badge.neutral?.fg,\n '--card-badge-neutral-icon-color': color.badge.neutral?.icon,\n '--card-badge-primary-bg-color': color.badge.primary.bg,\n '--card-badge-primary-dot-color': color.badge.primary.dot,\n '--card-badge-primary-fg-color': color.badge.primary.fg,\n '--card-badge-primary-icon-color': color.badge.primary.icon,\n '--card-badge-suggest-bg-color': color.badge.suggest?.bg,\n '--card-badge-suggest-dot-color': color.badge.suggest?.dot,\n '--card-badge-suggest-fg-color': color.badge.suggest?.fg,\n '--card-badge-suggest-icon-color': color.badge.suggest?.icon,\n '--card-badge-positive-bg-color': color.badge.positive.bg,\n '--card-badge-positive-dot-color': color.badge.positive.dot,\n '--card-badge-positive-fg-color': color.badge.positive.fg,\n '--card-badge-positive-icon-color': color.badge.positive.icon,\n '--card-badge-caution-bg-color': color.badge.caution.bg,\n '--card-badge-caution-dot-color': color.badge.caution.dot,\n '--card-badge-caution-fg-color': color.badge.caution.fg,\n '--card-badge-caution-icon-color': color.badge.caution.icon,\n '--card-badge-critical-bg-color': color.badge.critical.bg,\n '--card-badge-critical-dot-color': color.badge.critical.dot,\n '--card-badge-critical-fg-color': color.badge.critical.fg,\n '--card-badge-critical-icon-color': color.badge.critical.icon,\n\n '--card-code-bg-color': color.code.bg,\n '--card-code-fg-color': color.code.fg,\n\n '--card-fg-color': color.fg,\n\n '--card-icon-color': color.icon,\n\n '--card-kbd-bg-color': color.kbd.bg,\n '--card-kbd-border-color': color.kbd.border,\n '--card-kbd-fg-color': color.kbd.fg,\n\n '--card-link-fg-color': color.link.fg,\n\n '--card-muted-bg-color': color.muted.bg,\n '--card-muted-fg-color': color.muted.fg,\n\n '--card-skeleton-color-from': color.skeleton.from,\n '--card-skeleton-color-to': color.skeleton.to,\n\n // deprecated variables (kept for legacy)\n\n '--card-bg2-color': color.muted.bg,\n '--card-link-color': color.link.fg,\n '--card-hairline-soft-color': color.border,\n '--card-hairline-hard-color': color.border,\n }\n}\n","import {ThemeFocusRing} from '../../../theme/system/focusRing'\n\nexport function focusRingBorderStyle(border: {color: string; width: number}): string {\n return `inset 0 0 0 ${border.width}px ${border.color}`\n}\n\nexport function focusRingStyle(opts: {\n base?: {bg: string}\n border?: {color: string; width: number}\n focusRing: ThemeFocusRing\n}): string {\n const {base, border, focusRing} = opts\n const focusRingOutsetWidth = focusRing.offset + focusRing.width\n const focusRingInsetWidth = 0 - focusRing.offset\n const bgColor = base ? base.bg : 'var(--card-bg-color)'\n\n return [\n focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,\n border && focusRingBorderStyle(border),\n focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,\n focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`,\n ]\n .filter(Boolean)\n .join(',')\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveBorderStyleProps} from './types'\n\nexport function responsiveBorderStyle(): Array<\n (props: ResponsiveBorderStyleProps & ThemeProps) => CSSObject[]\n> {\n return [border, borderTop, borderRight, borderBottom, borderLeft]\n}\n\nfunction border(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$border, (value) =>\n value ? {'&&': {border: borderStyle}} : {'&&': {border: 0}},\n )\n}\n\nfunction borderTop(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderTop, (value) =>\n value ? {'&&': {borderTop: borderStyle}} : {'&&': {borderTop: 0}},\n )\n}\n\nfunction borderRight(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderRight, (value) =>\n value ? {'&&': {borderRight: borderStyle}} : {'&&': {borderRight: 0}},\n )\n}\n\nfunction borderBottom(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderBottom, (value) =>\n value ? {'&&': {borderBottom: borderStyle}} : {'&&': {borderBottom: 0}},\n )\n}\n\nfunction borderLeft(props: ResponsiveBorderStyleProps & ThemeProps) {\n const {card, media} = getTheme_v2(props.theme)\n const borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`\n\n return _responsive(media, props.$borderLeft, (value) =>\n value ? {'&&': {borderLeft: borderStyle}} : {'&&': {borderLeft: 0}},\n )\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {ThemeBoxShadow, ThemeShadow} from '../../../theme/system/shadow'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {EMPTY_RECORD} from '../../constants'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {ResponsiveShadowStyleProps} from './types'\n\nfunction toBoxShadow(shadow: ThemeBoxShadow, color: string) {\n return `${shadow.map(rem).join(' ')} ${color}`\n}\n\nfunction shadowStyle(shadow: ThemeShadow | null, outlineWidth: number = 1): CSSObject {\n if (!shadow) return EMPTY_RECORD\n\n const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`\n const umbra = toBoxShadow(shadow.umbra, 'var(--card-shadow-umbra-color)')\n const penumbra = toBoxShadow(shadow.penumbra, 'var(--card-shadow-penumbra-color)')\n const ambient = toBoxShadow(shadow.ambient, 'var(--card-shadow-ambient-color)')\n\n return {boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}`}\n}\n\nexport function responsiveShadowStyle(props: ResponsiveShadowStyleProps & ThemeProps): CSSObject[] {\n const {card, media, shadow} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$shadow, (index) =>\n shadowStyle(shadow[index], card.shadow.outline),\n )\n}\n","/**\n * Gets the global scope instance in a given environment.\n *\n * The strategy is to return the most modern, and if not, the most common:\n * - The `globalThis` variable is the modern approach to accessing the global scope\n * - The `window` variable is the global scope in a web browser\n * - The `self` variable is the global scope in workers and others\n * - The `global` variable is the global scope in Node.js\n */\nfunction getGlobalScope() {\n if (typeof globalThis !== 'undefined') return globalThis\n if (typeof window !== 'undefined') return window\n if (typeof self !== 'undefined') return self\n if (typeof global !== 'undefined') return global\n\n throw new Error('@sanity/ui: could not locate global scope')\n}\n\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const globalScope = getGlobalScope() as any\n","/**\n * As `@sanity/ui` is declared as a dependency, and may be duplicated, sometimes across major versions\n * it's critical that vital react contexts are shared even when there is a duplicate.\n * If we used a model similar to `sanity` itself, or `styled-components`, this would be unnecessary as\n * those libraries enforce single instances.\n * Since we don't enforce it we have to support a sanity plugin being able to call hooks like `useToast`, and then\n * read the context setup by `sanity`, which calls `ToastProvider`, even if the provider and hook are different instances in memory.\n * It's also why it's vital that all changes to globally scoped providers remain fully backwards compatible to v1.\n */\n\nimport {type Context, createContext} from 'react'\n\nimport {globalScope} from './globalScope'\n\n// oxlint-disable-next-line no-unnecessary-type-parameters\nexport function createGlobalScopedContext<ContextType, const T extends ContextType = ContextType>(\n /**\n * Enforce that all Symbol.for keys used for globally scoped contexts have a predictable prefix\n */\n key: `@sanity/ui/context/${string}`,\n defaultValue: T,\n): Context<ContextType> {\n const symbol = Symbol.for(key)\n\n /**\n * Prevent errors about re-renders on React SSR on Next.js App Router\n */\n if (typeof document === 'undefined') {\n const context = createContext<ContextType>(defaultValue)\n context.displayName = key\n return context\n }\n\n globalScope[symbol] = globalScope[symbol] || createContext<T>(defaultValue)\n\n return globalScope[symbol]\n}\n","import {createGlobalScopedContext} from '../lib/createGlobalScopedContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @internal\n */\nexport const ThemeContext = createGlobalScopedContext<ThemeContextValue | null>(\n '@sanity/ui/context/theme',\n null,\n)\n","import {useContext, useMemo} from 'react'\nimport {ThemeProvider as StyledThemeProvider} from 'styled-components'\n\nimport {getScopedTheme} from '../../theme/getScopedTheme'\nimport {\n type ThemeColorCardToneKey,\n type ThemeColorSchemeKey,\n} from '../../theme/system/color/_system'\nimport {type RootTheme, type Theme} from '../../theme/system/theme'\nimport {ThemeContext} from './themeContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @public\n */\nexport interface ThemeProviderProps {\n children?: React.ReactNode\n scheme?: ThemeColorSchemeKey\n theme?: RootTheme\n tone?: ThemeColorCardToneKey\n}\n\n/**\n * @public\n */\nexport function ThemeProvider(props: ThemeProviderProps): React.JSX.Element {\n const parentTheme = useContext(ThemeContext)\n const {children} = props\n const scheme = props.scheme ?? (parentTheme?.scheme || 'light')\n const rootTheme = props.theme ?? (parentTheme?.theme || null)\n const tone = props.tone ?? (parentTheme?.tone || 'default')\n\n const themeContext: ThemeContextValue | null = useMemo(() => {\n if (!rootTheme) return null\n\n return {\n version: 0.0,\n theme: rootTheme,\n scheme,\n tone,\n }\n }, [rootTheme, scheme, tone])\n\n const theme: Theme | null = useMemo(() => {\n if (!rootTheme) return null\n\n return getScopedTheme(rootTheme, scheme, tone)\n }, [scheme, rootTheme, tone])\n\n if (!theme) {\n return <pre>ThemeProvider: no \"theme\" property provided</pre>\n }\n\n return (\n <ThemeContext.Provider value={themeContext}>\n <StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>\n </ThemeContext.Provider>\n )\n}\n","import {useContext} from 'react'\n\nimport {ThemeContext} from './themeContext'\nimport {ThemeContextValue} from './types'\n\n/**\n * @public\n */\nexport function useRootTheme(): ThemeContextValue {\n const value = useContext(ThemeContext)\n\n if (!value) {\n throw new Error('useRootTheme(): missing context value')\n }\n\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n return value as unknown as ThemeContextValue\n}\n","import {ThemeColorCardToneKey, ThemeColorSchemeKey} from '../../theme/system/color/_system'\nimport {ThemeProvider} from './themeProvider'\nimport {useRootTheme} from './useRootTheme'\n\n/**\n * @public\n */\nexport interface ThemeColorProviderProps {\n children?: React.ReactNode\n scheme?: ThemeColorSchemeKey\n tone?: ThemeColorCardToneKey\n}\n\n/**\n * @public\n */\nexport function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element {\n const {children, scheme, tone} = props\n const root = useRootTheme()\n\n return (\n <ThemeProvider scheme={scheme || root.scheme} theme={root.theme} tone={tone}>\n {children}\n </ThemeProvider>\n )\n}\n","import {css} from 'styled-components'\n\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_cardColorStyle} from '../../styles/card/_cardColorStyle'\nimport {focusRingStyle} from '../../styles/focusRing'\nimport {ThemeProps} from '../../styles/types'\nimport {CardStyleProps} from './types'\n\nexport function cardStyle(\n props: CardStyleProps & ThemeProps,\n): Array<ReturnType<typeof css> | (() => ReturnType<typeof css>)> {\n return [cardBaseStyle(props), cardColorStyle(props)]\n}\n\nfunction cardBaseStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {\n const {$checkered} = props\n const {space} = getTheme_v2(props.theme)\n\n return css`\n ${\n $checkered &&\n css`\n background-size: ${space[3]}px ${space[3]}px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n `\n }\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n `\n}\n\nfunction cardColorStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {\n const {$checkered, $focusRing, $muted} = props\n const {card, color, style} = getTheme_v2(props.theme)\n const border = {width: card.border.width, color: 'var(--card-border-color)'}\n\n return css`\n color-scheme: ${color._dark ? 'dark' : 'light'};\n\n ${_cardColorStyle(color, color, $checkered)}\n\n background-color: ${$muted ? 'var(--card-muted-bg-color)' : 'var(--card-bg-color)'};\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n\n &[data-selected] {\n ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}\n }\n\n &:active {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ${\n $focusRing\n ? focusRingStyle({base: color, border, focusRing: card.focusRing})\n : undefined\n };\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n\n &[data-selected] {\n ${_cardColorStyle(color, color.selectable.default.selected, $checkered)}\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}\n }\n\n &:active {\n ${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ${\n $focusRing\n ? focusRingStyle({base: color, border, focusRing: card.focusRing})\n : undefined\n };\n }\n }\n }\n\n ${style?.card?.root}\n `\n}\n","import {isValidElementType} from 'react-is'\nimport {styled} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {responsiveBorderStyle} from '../../styles/border/borderStyle'\nimport {ResponsiveBorderStyleProps} from '../../styles/border/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveRadiusStyle} from '../../styles/radius/radiusStyle'\nimport {ResponsiveRadiusStyleProps} from '../../styles/radius/types'\nimport {responsiveShadowStyle} from '../../styles/shadow/shadowStyle'\nimport {ResponsiveShadowStyleProps} from '../../styles/shadow/types'\nimport {ThemeColorProvider} from '../../theme/themeColorProvider'\nimport {useRootTheme} from '../../theme/useRootTheme'\nimport {CardTone} from '../../types/card'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'\nimport {cardStyle} from './styles'\nimport {CardStyleProps} from './types'\n\n/**\n * @public\n */\nexport interface CardOwnProps\n extends BoxOwnProps, ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps {\n /**\n * Do not use in production.\n * @beta\n */\n __unstable_checkered?: boolean\n /**\n * Do not use in production.\n * @beta\n */\n __unstable_focusRing?: boolean\n disabled?: boolean\n muted?: boolean\n pressed?: boolean\n scheme?: ThemeColorSchemeKey\n selected?: boolean\n tone?: CardTone\n}\n\n/**\n * @public\n */\nexport type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>\n\nconst StyledCard = styled(Box)<\n CardStyleProps &\n ResponsiveRadiusStyleProps &\n ResponsiveBorderStyleProps &\n ResponsiveShadowStyleProps\n>(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle)\n\nfunction CardComponent(\n props: CardOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height'>,\n) {\n const {\n __unstable_checkered: checkered = false,\n __unstable_focusRing: focusRing = false,\n as: asProp,\n border,\n borderTop,\n borderRight,\n borderBottom,\n borderLeft,\n muted,\n pressed,\n radius = 0,\n ref,\n scheme,\n selected,\n shadow,\n tone: toneProp = 'default',\n ...restProps\n } = props\n\n const as = isValidElementType(asProp) ? asProp : 'div'\n const rootTheme = useRootTheme()\n const tone = toneProp === 'inherit' ? rootTheme.tone : toneProp\n\n // todo: Consider adding the wrapper approach for nested cards in which the tones are not changing, avoid unnecessary ThemeColorProvider\n return (\n <ThemeColorProvider scheme={scheme} tone={tone}>\n <StyledCard\n data-as={typeof as === 'string' ? as : undefined}\n data-scheme={rootTheme.scheme}\n data-ui=\"Card\"\n data-tone={tone}\n {...restProps}\n $border={_getArrayProp(border)}\n $borderTop={_getArrayProp(borderTop)}\n $borderRight={_getArrayProp(borderRight)}\n $borderBottom={_getArrayProp(borderBottom)}\n $borderLeft={_getArrayProp(borderLeft)}\n $checkered={checkered}\n $focusRing={focusRing}\n $muted={muted ?? false}\n $radius={_getArrayProp(radius)}\n $shadow={_getArrayProp(shadow)}\n $tone={tone}\n data-checkered={checkered ? '' : undefined}\n data-pressed={pressed ? '' : undefined}\n data-selected={selected ? '' : undefined}\n forwardedAs={as}\n ref={ref}\n selected={selected}\n />\n </ThemeColorProvider>\n )\n}\n\n/**\n * The `Card` component acts much like a `Box`, but with a background and foreground color.\n * Components within a `Card` inherit its colors.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Card = CardComponent as unknown as <E extends ElementType = 'div'>(\n props: CardProps<E>,\n) => React.JSX.Element\n","import {useMemo, useSyncExternalStore} from 'react'\n\nimport {useTheme_v2} from '../../theme/useTheme'\n\n/**\n * @internal\n */\nexport interface _MediaStore {\n subscribe: (onStoreChange: () => void) => () => void\n getSnapshot: () => number\n}\n\ntype MediaQueryMinWidth = `(min-width: ${number}px)`\ntype MediaQueryMaxWidth = `(max-width: ${number}px)`\ntype MediaQueryMinMaxWidth = `${MediaQueryMinWidth} and ${MediaQueryMaxWidth}`\ntype MediaQuery = `screen and ${MediaQueryMinWidth | MediaQueryMaxWidth | MediaQueryMinMaxWidth}`\n\nfunction _getMediaQuery(media: number[], index: number): MediaQuery {\n if (index === 0) {\n return `screen and (max-width: ${media[index] - 1}px)`\n }\n\n if (index === media.length) {\n return `screen and (min-width: ${media[index - 1]}px)`\n }\n\n return `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`\n}\n\nfunction _createMediaStore(media: number[]): _MediaStore {\n const mediaLen = media.length\n let sizes: {mq: MediaQueryList; index: number}[]\n\n // The _createMediaStore function is called in both server and client environments.\n // However since subscribe and getSnapshot are only called on the client we lazy init what we need for them\n // so that we don't need to run checks for wether it's safe to call `window.matchMedia`\n const getSizes = () => {\n if (!sizes) {\n sizes = []\n\n for (let index = mediaLen; index > -1; index -= 1) {\n const mediaQuery = _getMediaQuery(media, index)\n\n sizes.push({index, mq: window.matchMedia(mediaQuery)})\n }\n }\n\n return sizes\n }\n\n const getSnapshot = () => {\n for (const {index, mq} of getSizes()) {\n if (mq.matches) return index\n }\n\n return 0\n }\n\n const subscribe = (onStoreChange: () => void) => {\n const disposeFns: (() => void)[] = []\n\n for (const {mq} of getSizes()) {\n const handleChange = () => {\n if (mq.matches) onStoreChange()\n }\n\n mq.addEventListener('change', handleChange)\n\n disposeFns.push(() => mq.removeEventListener('change', handleChange))\n }\n\n return () => {\n for (const disposeFn of disposeFns) {\n disposeFn()\n }\n }\n }\n\n return {getSnapshot, subscribe}\n}\n\n/**\n * Only called during server-side rendering, and hydration if using hydrateRoot\n * Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query\n * and we assume `(prefers-color-scheme: light)` since it's the most common scheme\n *\n * @link https://beta.reactjs.org/apis/react/useSyncExternalStore#adding-support-for-server-rendering\n */\nfunction getServerSnapshot() {\n return 0\n}\n\n/**\n * This API might change. DO NOT USE IN PRODUCTION.\n * @beta\n */\nexport function useMediaIndex(): number {\n const {media} = useTheme_v2()\n const store = useMemo(() => _createMediaStore(media), [media])\n\n return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot)\n}\n","import {useCallback, useDebugValue, useSyncExternalStore} from 'react'\n\n/**\n * Efficiently subscribes to `window.matchMedia` queries\n *\n * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)\n *\n * @public\n */\nexport function useMatchMedia(\n mediaQueryString: `(${string})`,\n getServerSnapshot?: () => boolean,\n): boolean {\n useDebugValue(mediaQueryString)\n\n return useSyncExternalStore(\n useCallback(\n (onStoreChange) => {\n const media = window.matchMedia(mediaQueryString)\n media.addEventListener('change', onStoreChange)\n return () => media.removeEventListener('change', onStoreChange)\n },\n [mediaQueryString],\n ),\n () => window.matchMedia(mediaQueryString).matches,\n getServerSnapshot,\n )\n}\n","import {useMatchMedia} from './useMatchMedia'\n\n/**\n * Returns true if motion should be reduced\n *\n * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)\n *\n * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.\n * Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion\n * @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b\n *\n * @public\n */\nexport function usePrefersReducedMotion(getServerSnapshot = () => false): boolean {\n return useMatchMedia('(prefers-reduced-motion: reduce)', getServerSnapshot)\n}\n","export function isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === 'object' && !Array.isArray(value))\n}\n","import {isRecord} from '../../lib/isRecord'\nimport {LayerContextValue} from './types'\n\nexport function getLayerContext(contextValue: LayerContextValue): LayerContextValue {\n // NOTE: This check is for future-compatiblity\n // - If the value is not an object, it’s not compatible with the current version\n // - If the value is an object, but doesn’t have `version: 0.0`, it’s not compatible with the current version\n if (!isRecord(contextValue) || contextValue.version !== 0.0) {\n throw new Error('the context value is not compatible')\n }\n\n if (!contextValue) {\n throw new Error('components using `useLayer()` should be wrapped in a <LayerProvider>.')\n }\n\n if (contextValue.version === 0.0) {\n return contextValue\n }\n\n throw new Error('could not get layer context')\n}\n","import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'\nimport {LayerContextValue} from './types'\n\nexport const LayerContext = createGlobalScopedContext<LayerContextValue | null>(\n '@sanity/ui/context/layer',\n null,\n)\n","import {useCallback, useContext, useEffect, useMemo, useState} from 'react'\n\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {getLayerContext} from './getLayerContext'\nimport {LayerContext} from './layerContext'\nimport {LayerContextValue} from './types'\n\n/**\n * @public\n */\nexport interface LayerProviderProps {\n children?: React.ReactNode\n zOffset?: number | number[]\n}\n\n/**\n * @public\n */\nexport function LayerProvider(props: LayerProviderProps): React.JSX.Element {\n const {children, zOffset: zOffsetProp = 0} = props\n\n // Get parent context values\n const parentContextValue = useContext(LayerContext)\n const parent = parentContextValue && getLayerContext(parentContextValue)\n const parentRegisterChild = parent?.registerChild\n const parentLevel = parent?.level ?? 0\n\n // Get level\n const level = parentLevel + 1\n\n // Get z-index offset\n const zOffset = _getArrayProp(zOffsetProp)\n\n // Get responsive z-index value\n const maxMediaIndex = zOffset.length - 1\n const mediaIndex = Math.min(useMediaIndex(), maxMediaIndex)\n const zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex]\n\n // A state value that is used to keep track of the number of child layers on each level\n const [, setChildLayers] = useState<Record<number, number>>({})\n\n // A state value that is used to keep track of the number of child levels\n const [size, setSize] = useState(0)\n\n const isTopLayer = size === 0\n\n const registerChild = useCallback(\n (childLevel?: number) => {\n // Register child layers to the parent layer\n const parentDispose = parentRegisterChild?.(childLevel)\n\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const prevLen = state[childLevel] ?? 0\n const nextState = {...state, [childLevel]: prevLen + 1}\n\n setSize(Object.keys(nextState).length)\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, increment the size by 1\n setSize((v) => v + 1)\n }\n\n return () => {\n if (childLevel !== undefined) {\n setChildLayers((state) => {\n const nextState = {...state}\n\n if (nextState[childLevel] === 1) {\n delete nextState[childLevel]\n\n setSize(Object.keys(nextState).length)\n } else {\n nextState[childLevel] -= 1\n }\n\n return nextState\n })\n } else {\n // Legacy behavior: if no child level is provided, decrement the size by 1\n setSize((v) => v - 1)\n }\n\n parentDispose?.()\n }\n },\n [parentRegisterChild, setSize, setChildLayers],\n )\n\n // Register this layer on mount\n useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild])\n\n const value: LayerContextValue = useMemo(\n () => ({\n version: 0.0,\n isTopLayer,\n level,\n registerChild,\n size,\n zIndex,\n }),\n [isTopLayer, level, registerChild, size, zIndex],\n )\n\n return <LayerContext.Provider value={value}>{children}</LayerContext.Provider>\n}\n","import {useContext} from 'react'\n\nimport {getLayerContext} from './getLayerContext'\nimport {LayerContext} from './layerContext'\nimport {LayerContextValue} from './types'\n\n/**\n * @public\n */\nexport function useLayer(): LayerContextValue {\n const value = useContext(LayerContext)\n\n if (!value) {\n throw new Error('useLayer(): missing context value')\n }\n\n try {\n return getLayerContext(value)\n } catch (err) {\n if (err instanceof Error) {\n // oxlint-disable-next-line preserve-caught-error\n throw new Error(`useLayer(): ${err.message}`)\n } else {\n // oxlint-disable-next-line preserve-caught-error, restrict-template-expressions\n throw new Error(`useLayer(): ${err}`)\n }\n }\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,eAAwB,EAC5B,uCAAmC,EACjC,WAAW,OACb,EACF,GAEM,aAAkD;CACtD,SAAS;CACT,QAAQ;AACV,GAEM,aAAa;CACjB,SAAS;CACT,MAAM;AACR;AAEA,SAAgB,WAAsB;CACpC,OAAO;AACT;AAEA,SAAgB,qBAEd;CACA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF;AAEA,SAAS,0BAA0B,OAA6C;CAC9E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,WAAW,aAAa,EACtD,mBAAmB,EAAC,QAAO,EAC7B,EAAE;AACJ;AAEA,SAAS,yBAAyB,OAA6C;CAC7E,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,UAAU,YAAY,EACpD,WAAW,WAAW,QACxB,EAAE;AACJ;AAEA,S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K,KAAA;EACL,SAAS;EACT;EACA;EACA;EACA;EACA;CACF,GALE,EAAA,MAAA,YACA,EAAA,MAAA,OACA,EAAA,MAAA,eACA,EAAA,MAAA,MACA,EAAA,MAAA;CAPJ,IAAM,QAA2BC,IAY1BC;CAAP,OAA6C,EAAA,QAAA,YAAA,EAAA,QAAR,SAA9B,KAAA,oBAACC,aAAAA,UAAD;EAA8B;EAAQ;CAAgC,CAAA,GAAhC,EAAA,MAAA,UAAR,EAAA,MAAA,iCAA9BD;AACT;AAzBkB,SAAA,OAAC,KAAA;CAAME,OAAAA,MAAI;;AApBb,SAAA,MAAC,GAAA;CAAM,OAAA,IAAI;;;;;ACtD3B,SAAgB,WAA8B;eACtC,QAAQ,WAAW,YAAY;CAErC,IAAI,CAAC,OACH,MAAU,MAAM,mCAAmC;CAGrD,IAAI;EACKC,IAAAA;EAAP,OAAuB,EAAA,OAAA,qBAAhB,KAAA,gBAAgB,KAAK,GAAL,EAAA,KAAA,mBAAhBA;CACT,SAASC,IAAK;EAAL,IAAA,MAAA;EAML,MALE,eAAe,QAEP,MAAM,eAAe,IAAI,SAAS,IAGlC,MAAM,eAAe,KAAK;CAExC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"components",
|
|
6
6
|
"design-system",
|
|
@@ -51,36 +51,37 @@
|
|
|
51
51
|
"@floating-ui/react-dom": "^2.1.9",
|
|
52
52
|
"@sanity/color": "^3.0.8",
|
|
53
53
|
"@sanity/icons": "^5.2.1",
|
|
54
|
+
"@vanilla-extract/dynamic": "^2.1.5",
|
|
54
55
|
"clsx": "^2.1.1",
|
|
55
56
|
"csstype": "^3.2.3",
|
|
56
|
-
"motion": "^13.
|
|
57
|
+
"motion": "^13.2.0",
|
|
57
58
|
"react-is": "^19.2.8",
|
|
58
59
|
"react-refractor": "^4.0.0",
|
|
59
60
|
"use-effect-event": "^2.0.4"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@sanity/tsdown-config": "^0.
|
|
63
|
-
"@sanity/vanilla-extract-vite-plugin": "^0.2.
|
|
63
|
+
"@sanity/tsdown-config": "^0.28.0",
|
|
64
|
+
"@sanity/vanilla-extract-vite-plugin": "^0.2.18",
|
|
64
65
|
"@testing-library/dom": "^10.4.1",
|
|
65
66
|
"@testing-library/jest-dom": "^7.0.1",
|
|
66
67
|
"@testing-library/react": "^16.3.3",
|
|
67
|
-
"@testing-library/user-event": "^14.6.
|
|
68
|
+
"@testing-library/user-event": "^14.6.7",
|
|
68
69
|
"@types/node": "^24.13.3",
|
|
69
70
|
"@types/react": "^19.2.18",
|
|
70
|
-
"@types/react-dom": "^19.2.
|
|
71
|
+
"@types/react-dom": "^19.2.7",
|
|
71
72
|
"@types/react-is": "^19.2.0",
|
|
72
73
|
"@vanilla-extract/css": "^1.21.2",
|
|
73
74
|
"jsdom": "^30.0.1",
|
|
74
|
-
"oxc-transform-react": "^0.
|
|
75
|
+
"oxc-transform-react": "^0.149.0",
|
|
75
76
|
"react": "^19.2.8",
|
|
76
77
|
"react-dom": "^19.2.8",
|
|
77
78
|
"rimraf": "^5.0.5",
|
|
78
79
|
"styled-components": "^6.5.3",
|
|
79
|
-
"tsdown": "^0.
|
|
80
|
+
"tsdown": "^0.23.0",
|
|
80
81
|
"typescript": "7.0.2",
|
|
81
82
|
"unrun": "^0.3.1",
|
|
82
83
|
"vite": "^8.2.2",
|
|
83
|
-
"vitest": "^
|
|
84
|
+
"vitest": "^5.0.0",
|
|
84
85
|
"vitest-axe": "^1.0.0-pre.5"
|
|
85
86
|
},
|
|
86
87
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-C6TlkggA.js","names":["createPortal(children, portalElement)","radius = 0","compileCommands(cmds)","<mask id=\"stroke-mask\">\n <rect x={0} y={strokeWidth} width={w} height={w} fill=\"white\" />\n </mask>","<StrokePath d={strokePath} mask=\"url(#stroke-mask)\" strokeWidth={strokeWidth * 2} />","strokeWidth * 2","<ShapePath d={fillPath} />","<svg width={w} height={w} viewBox={`0 0 ${w} ${w}`}>\n <mask id=\"stroke-mask\">\n <rect x={0} y={strokeWidth} width={w} height={w} fill=\"white\" />\n </mask>\n <StrokePath d={strokePath} mask=\"url(#stroke-mask)\" strokeWidth={strokeWidth * 2} />\n <ShapePath d={fillPath} />\n </svg>","`0 0 ${w} ${w}`","<StyledArrow data-ui=\"Arrow\" {...restProps} $w={w} ref={ref}>\n <svg width={w} height={w} viewBox={`0 0 ${w} ${w}`}>\n <mask id=\"stroke-mask\">\n <rect x={0} y={strokeWidth} width={w} height={w} fill=\"white\" />\n </mask>\n <StrokePath d={strokePath} mask=\"url(#stroke-mask)\" strokeWidth={strokeWidth * 2} />\n <ShapePath d={fillPath} />\n </svg>\n </StyledArrow>"],"sources":["../src/core/utils/boundaryElement/boundaryElementContext.ts","../src/core/utils/boundaryElement/useBoundaryElement.ts","../src/core/utils/portal/portalContext.ts","../src/core/utils/portal/usePortal.ts","../src/core/utils/portal/portal.ts","../src/core/utils/arrow/cmds.ts","../src/core/utils/arrow/arrow.tsx"],"sourcesContent":["import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'\nimport {BoundaryElementContextValue} from './types'\n\nexport const BoundaryElementContext = createGlobalScopedContext<BoundaryElementContextValue | null>(\n '@sanity/ui/context/boundaryElement',\n null,\n)\n","import {useContext} from 'react'\n\nimport {isRecord} from '../../lib/isRecord'\nimport {BoundaryElementContext} from './boundaryElementContext'\nimport {BoundaryElementContextValue} from './types'\n\nconst DEFAULT_VALUE: BoundaryElementContextValue = {\n version: 0.0,\n element: null,\n}\n\n/**\n * @public\n */\nexport function useBoundaryElement(): BoundaryElementContextValue {\n const value = useContext(BoundaryElementContext)\n\n // NOTE: This check is for future-compatiblity\n // - If the value is not an object, it’s not compatible with the current version\n // - If the value is an object, but doesn’t have `version: 0.0`, it’s not compatible with the current version\n if (value && (!isRecord(value) || value.version !== 0.0)) {\n throw new Error('useBoundaryElement(): the context value is not compatible')\n }\n\n return value || DEFAULT_VALUE\n}\n","import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'\nimport {globalScope} from '../../lib/globalScope'\nimport {PortalContextValue} from './types'\n\nconst key = '@sanity/ui/context/portal'\nconst elementKey = Symbol.for(`${key}/element`)\n\nglobalScope[elementKey] = null\n\nconst defaultContextValue: PortalContextValue = {\n version: 0.0,\n boundaryElement: null,\n get element() {\n if (typeof document === 'undefined') {\n return null\n }\n\n if (globalScope[elementKey]) {\n return globalScope[elementKey]\n }\n\n globalScope[elementKey] = document.createElement('div')\n globalScope[elementKey].setAttribute('data-portal', '')\n\n document.body.appendChild(globalScope[elementKey])\n\n return globalScope[elementKey]\n },\n}\n\nexport const PortalContext = createGlobalScopedContext<PortalContextValue>(key, defaultContextValue)\n","import {useContext} from 'react'\n\nimport {isRecord} from '../../lib/isRecord'\nimport {PortalContext} from './portalContext'\nimport {PortalContextValue} from './types'\n\n/**\n * @public\n */\nexport function usePortal(): PortalContextValue {\n const value = useContext(PortalContext)\n\n if (!value) {\n throw new Error('usePortal(): missing context value')\n }\n\n // NOTE: This check is for future-compatiblity\n // - If the value is not an object, it’s not compatible with the current version\n // - If the value is an object, but doesn’t have `version: 0.0`, it’s not compatible with the current version\n if (!isRecord(value) || value.version !== 0.0) {\n throw new Error('usePortal(): the context value is not compatible')\n }\n\n return value\n}\n","import {createPortal} from 'react-dom'\n\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 =\n (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default\n\n if (!portalElement) {\n return null\n }\n\n return createPortal(children, portalElement)\n}\n","interface PointCmd {\n type: 'point'\n x: number\n y: number\n radius?: number\n}\n\ninterface CurveCmd {\n type: 'curve'\n startControl: Point\n endControl: Point\n curveEnd: Point\n}\n\nexport type Cmd = PointCmd | CurveCmd\n\nexport interface Point {\n x: number\n y: number\n radius?: number\n}\n\nfunction moveTowardsLength(movingPoint: Point, targetPoint: Point, amount: number) {\n const width = targetPoint.x - movingPoint.x\n const height = targetPoint.y - movingPoint.y\n\n const distance = Math.sqrt(width * width + height * height)\n\n return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance))\n}\n\nfunction moveTowardsFractional(movingPoint: Point, targetPoint: Point, fraction: number): Point {\n return {\n x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,\n y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction,\n }\n}\n\nexport function getRoundedCommands(points: Point[]): Cmd[] {\n const len = points.length\n\n const cmds: Cmd[] = []\n\n for (let i = 0; i < len; i += 1) {\n const point = points[i]\n const prevPoint = points[i - 1]\n const nextPoint = points[i + 1]\n\n if (prevPoint && point.radius) {\n const curveStart = moveTowardsLength(point, prevPoint, point.radius)\n const curveEnd = moveTowardsLength(point, nextPoint, point.radius)\n const startControl = moveTowardsFractional(curveStart, point, 0.5)\n const endControl = moveTowardsFractional(point, curveEnd, 0.5)\n\n cmds.push({\n type: 'point',\n ...curveStart,\n })\n\n cmds.push({\n type: 'curve',\n curveEnd,\n startControl,\n endControl,\n })\n } else {\n cmds.push({\n type: 'point',\n ...point,\n })\n }\n }\n\n return cmds\n}\n\nexport function compileCommands(cmds: Cmd[]): string {\n return cmds\n .map((n, idx) => {\n if (n.type === 'point') {\n return `${idx === 0 ? 'M' : 'L'} ${n.x} ${n.y}`\n }\n\n if (n.type === 'curve') {\n return `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}`\n }\n\n return ``\n })\n .join(' ')\n}\n","import {HTMLProps} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {useTheme_v2} from '../../theme/useTheme'\nimport {compileCommands, getRoundedCommands, Point} from './cmds'\n\nconst StyledArrow = styled.div<{$w: number}>(\n ({$w: w}) => css`\n position: absolute;\n width: ${w}px;\n height: ${w}px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ${w / 2}px ${w / 2}px;\n }\n\n [data-placement^='top'] > & {\n bottom: -${w}px;\n\n & > svg {\n transform: rotate(0);\n }\n }\n\n [data-placement^='right'] > & {\n left: -${w}px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -${w}px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -${w}px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n `,\n)\n\nconst StrokePath = styled.path`\n stroke: var(--card-shadow-outline-color);\n`\n\nconst ShapePath = styled.path`\n fill: var(--card-bg-color);\n`\n\n/** @internal */\nexport function Arrow(\n props: {width: number; height: number; radius?: number} & Omit<\n HTMLProps<HTMLDivElement>,\n 'width' | 'height'\n >,\n): React.JSX.Element {\n const {width: w, height: h, radius = 0, ref, ...restProps} = props\n const {card} = useTheme_v2()\n const strokeWidth = card.shadow.outline\n\n const center = w / 2\n\n const points: Point[] = [\n {\n x: 0,\n y: 0,\n },\n {\n x: radius,\n y: 0,\n radius,\n },\n {\n x: center,\n y: h - 1,\n radius,\n },\n {\n x: w - radius,\n y: 0,\n radius,\n },\n {\n x: w,\n y: 0,\n },\n ]\n\n const cmds = getRoundedCommands(points)\n const path = compileCommands(cmds)\n\n // oxlint-disable-next-line no-unnecessary-template-expression\n const strokePath = `${path}`\n const fillPath = `${path} M ${w} -1 M 0 -1 Z`\n\n return (\n <StyledArrow data-ui=\"Arrow\" {...restProps} $w={w} ref={ref}>\n <svg width={w} height={w} viewBox={`0 0 ${w} ${w}`}>\n <mask id=\"stroke-mask\">\n <rect x={0} y={strokeWidth} width={w} height={w} fill=\"white\" />\n </mask>\n <StrokePath d={strokePath} mask=\"url(#stroke-mask)\" strokeWidth={strokeWidth * 2} />\n <ShapePath d={fillPath} />\n </svg>\n </StyledArrow>\n )\n}\n"],"mappings":";;;;;;AAGA,MAAa,yBAAyB,0BACpC,sCACA,IACF,GCAM,gBAA6C;CACjD,SAAS;CACT,SAAS;AACX;;;;AAKA,SAAgB,qBAAkD;CAChE,IAAM,QAAQ,WAAW,sBAAsB;CAK/C,IAAI,UAAU,CAAC,SAAS,KAAK,KAAK,MAAM,YAAY,IAClD,MAAU,MAAM,2DAA2D;CAG7E,OAAO,SAAS;AAClB;ACrBA,MAAM,MAAM,6BACN,aAAa,OAAO,IAAI,GAAG,IAAI,SAAS;AAE9C,YAAY,cAAc;AAuB1B,MAAa,gBAAgB,0BAA8C,KAAK;CApB9E,SAAS;CACT,iBAAiB;CACjB,IAAI,UAAU;EAcZ,OAbI,OAAO,WAAa,MACf,OAGL,YAAY,cACP,YAAY,eAGrB,YAAY,cAAc,SAAS,cAAc,KAAK,GACtD,YAAY,WAAW,CAAC,aAAa,eAAe,EAAE,GAEtD,SAAS,KAAK,YAAY,YAAY,WAAW,GAE1C,YAAY;CACrB;AAG8E,CAAmB;;;;ACrBnG,SAAgB,YAAgC;CAC9C,IAAM,QAAQ,WAAW,aAAa;CAEtC,IAAI,CAAC,OACH,MAAU,MAAM,oCAAoC;CAMtD,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,YAAY,GACxC,MAAU,MAAM,kDAAkD;CAGpE,OAAO;AACT;;;;ACNA,SAAgB,OAAO,OAA8C;eAC7D,EAAC,UAAU,iBAAiB,SAAQ,OACpC,SAAS,UAAU,GACnB,iBACH,OAAO,OAAO,YAAY,OAAO,SAAS,QAAQ,OAAO,YAAY,OAAO,UAAU;CAEzF,IAAI,CAAC,eACH,OAAO;CAGFA,IAAAA;CAAP,OAAo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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-D3iEd7Je.js","names":["<SpinnerIcon className={spinnerIcon} />","<Text data-ui=\"Spinner\" {...props}>\n <SpinnerIcon className={spinnerIcon} />\n </Text>","fontSize = 1","justifyProp = 'center'","mode = 'default'","paddingProp = 3","radiusProp = 2","gap = 3","tone = 'default'","type = 'button'","muted = false","_getArrayProp(justifyProp)","_getArrayProp(paddingProp)","_getArrayProp(paddingXProp)","_getArrayProp(paddingYProp)","_getArrayProp(paddingTopProp)","_getArrayProp(paddingBottomProp)","_getArrayProp(paddingLeftProp)","_getArrayProp(paddingRightProp)","_getArrayProp(radiusProp)","_getArrayProp(gap)","{\n // flex: 1,\n padding,\n paddingX,\n paddingY,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n }","useMemo(\n () => ({\n // flex: 1,\n padding,\n paddingX,\n paddingY,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n }),\n [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight],\n )","Boolean(loading) && (\n <div className={buttonLoadingBox}>\n <Spinner />\n </div>\n )","(IconComponent || text || IconRightComponent) && (\n <Box as=\"span\" {...boxProps}>\n <Flex as=\"span\" justify={justify} gap={spacing}>\n {IconComponent && (\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n )}\n\n {text && (\n <Box>\n <Text\n muted={muted}\n align={textAlign}\n size={fontSize}\n textOverflow=\"ellipsis\"\n weight={textWeight ?? button.textWeight}\n >\n {text}\n </Text>\n </Box>\n )}\n\n {IconRightComponent && (\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n )}\n </Flex>\n </Box>\n )","button.textWeight","children && (\n <Box as=\"span\" {...boxProps}>\n {children}\n </Box>\n )","<StyledButton\n data-ui=\"Button\"\n {...restProps}\n $mode={mode}\n $radius={radius}\n $tone={tone}\n data-disabled={Boolean(loading || disabled)}\n data-selected={selected ? '' : undefined}\n disabled={Boolean(loading || disabled)}\n ref={ref}\n type={type}\n $width={width}\n >\n {Boolean(loading) && (\n <div className={buttonLoadingBox}>\n <Spinner />\n </div>\n )}\n\n {(IconComponent || text || IconRightComponent) && (\n <Box as=\"span\" {...boxProps}>\n <Flex as=\"span\" justify={justify} gap={spacing}>\n {IconComponent && (\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n )}\n\n {text && (\n <Box>\n <Text\n muted={muted}\n align={textAlign}\n size={fontSize}\n textOverflow=\"ellipsis\"\n weight={textWeight ?? button.textWeight}\n >\n {text}\n </Text>\n </Box>\n )}\n\n {IconRightComponent && (\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n )}\n </Flex>\n </Box>\n )}\n\n {children && (\n <Box as=\"span\" {...boxProps}>\n {children}\n </Box>\n )}\n </StyledButton>","Boolean(loading || disabled)","selected ? '' : undefined"],"sources":["../src/core/primitives/spinner/spinner.css.ts","../src/core/primitives/spinner/spinner.tsx","../src/core/primitives/button/styles.ts","../src/core/primitives/button/button.css.ts","../src/core/primitives/button/button.tsx"],"sourcesContent":["import {keyframes, style} from '@vanilla-extract/css'\n\nconst rotate = keyframes({\n from: {transform: 'rotate(0deg)'},\n to: {transform: 'rotate(360deg)'},\n})\n\nexport const spinnerIcon = style({\n animation: `${rotate} 500ms linear infinite`,\n})\n","import {SpinnerIcon} from '@sanity/icons/Spinner'\n\nimport {Text} from '../text/text'\n\nimport {spinnerIcon} from './spinner.css'\n\n/**\n * @public\n */\nexport interface SpinnerProps {\n muted?: boolean\n size?: number | number[]\n}\n\n/**\n * Indicate that something is loading for an indeterminate amount of time.\n *\n * @public\n */\nexport function Spinner(\n props: SpinnerProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'size'>,\n) {\n return (\n <Text data-ui=\"Spinner\" {...props}>\n <SpinnerIcon className={spinnerIcon} />\n </Text>\n )\n}\n","import {css} from 'styled-components'\n\nimport {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_cardColorStyle} from '../../styles/card/_cardColorStyle'\nimport {focusRingBorderStyle, focusRingStyle} from '../../styles/focusRing'\nimport {ThemeProps} from '../../styles/types'\nimport {ButtonMode, ButtonTone, ButtonWidth} from '../../types/button'\n\n/**\n * @internal\n */\nexport function buttonBaseStyles(\n props: {$width?: ButtonWidth} & ThemeProps,\n): ReturnType<typeof css> {\n const {$width} = props\n const {style} = getTheme_v2(props.theme)\n\n return css`\n ${style?.button};\n\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n vertical-align: top;\n\n ${\n $width === 'fill' &&\n css`\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n `\n }\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n `\n}\n\nfunction combineBoxShadow(...boxShadows: (string | undefined)[]): string {\n return boxShadows.filter(Boolean).join(',')\n}\n\n/**\n * @internal\n */\nexport function buttonColorStyles(\n props: {$mode: ButtonMode; $tone: ButtonTone} & ThemeProps,\n): CSSObject[] {\n const {$mode} = props\n const {button, color: baseColor, style} = getTheme_v2(props.theme)\n const shadow = props.$mode === 'ghost'\n const mode = baseColor.button[$mode] || baseColor.button.default\n const color = mode[props.$tone] || mode.default\n const border = {\n width: button.border.width,\n color: 'var(--card-border-color)',\n }\n // const defaultBoxShadow = `inset 0px -1.5px 0px ${buttonTheme.border.width}px color-mix(in srgb, var(--card-border-color) 25%, var(--card-bg-color))`\n const defaultBoxShadow = undefined\n\n // oxlint-disable-next-line no-unsafe-type-assertion\n return [\n _cardColorStyle(baseColor, color.enabled),\n {\n 'backgroundColor': 'var(--card-bg-color)',\n 'color': 'var(--card-fg-color)',\n 'boxShadow': focusRingBorderStyle(border),\n '&:disabled, &[data-disabled=\"true\"]': _cardColorStyle(baseColor, color.disabled),\n \"&:not([data-disabled='true'])\": {\n 'boxShadow': combineBoxShadow(\n focusRingBorderStyle(border),\n shadow ? defaultBoxShadow : undefined,\n ),\n '&:focus': {\n boxShadow: focusRingStyle({\n base: baseColor,\n border: {width: 2, color: baseColor.bg},\n focusRing: button.focusRing,\n }),\n },\n '&:focus:not(:focus-visible)': {\n boxShadow: combineBoxShadow(\n focusRingBorderStyle(border),\n shadow ? defaultBoxShadow : undefined,\n ),\n },\n '@media (hover: hover)': {\n '&:hover': _cardColorStyle(baseColor, color.hovered),\n '&:active': _cardColorStyle(baseColor, color.pressed),\n '&[data-hovered]': _cardColorStyle(baseColor, color.hovered),\n },\n '&[data-selected]': _cardColorStyle(baseColor, color.pressed),\n },\n },\n style?.button?.root,\n ].filter(Boolean) as CSSObject[]\n}\n","import {style} from '@vanilla-extract/css'\n\nexport const buttonLoadingBox = style({\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: 'var(--card-bg-color)',\n borderRadius: 'inherit',\n zIndex: 1,\n boxShadow: 'inherit',\n})\n","import {isValidElement, useMemo} from 'react'\nimport {isValidElementType} from 'react-is'\nimport {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {responsiveRadiusStyle} from '../../styles/radius/radiusStyle'\nimport {ResponsiveRadiusStyleProps} from '../../styles/radius/types'\nimport {useTheme_v2} from '../../theme/useTheme'\nimport {ButtonMode, ButtonTextAlign, ButtonTone, ButtonWidth} from '../../types/button'\nimport {ElementType, Props} from '../../types/component'\nimport {FlexJustify} from '../../types/flex'\nimport {Box} from '../box/box'\nimport {Flex} from '../flex/flex'\nimport {Spinner} from '../spinner/spinner'\nimport {Text} from '../text/text'\nimport {ResponsivePaddingProps, ResponsiveRadiusProps} from '../types'\nimport {buttonBaseStyles, buttonColorStyles} from './styles'\n\nimport {buttonLoadingBox} from './button.css'\n\n/**\n * @public\n */\nexport interface ButtonOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {\n fontSize?: number | number[]\n mode?: ButtonMode\n // oxlint-disable-next-line no-redundant-type-constituents\n icon?: React.ElementType | React.ReactNode\n // oxlint-disable-next-line no-redundant-type-constituents\n iconRight?: React.ElementType | React.ReactNode\n justify?: FlexJustify | FlexJustify[]\n /**\n * @beta Do not use in production, as this might change.\n */\n loading?: boolean\n selected?: boolean\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n gap?: number | number[]\n muted?: boolean\n text?: React.ReactNode\n textAlign?: ButtonTextAlign\n textWeight?: ThemeFontWeightKey\n tone?: ButtonTone\n type?: 'button' | 'reset' | 'submit'\n width?: ButtonWidth\n}\n\n/**\n * @public\n */\nexport type ButtonProps<E extends ElementType = 'button'> = Props<ButtonOwnProps, E>\n\nconst StyledButton = styled.button<\n {$mode: ButtonMode; $tone: ButtonTone; $width?: ButtonWidth} & ResponsiveRadiusStyleProps\n>(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles)\n\nfunction ButtonComponent(\n props: ButtonOwnProps & {as?: ElementType} & Omit<\n React.HTMLProps<HTMLButtonElement>,\n 'as' | 'width'\n >,\n) {\n const {\n children,\n disabled,\n ref,\n fontSize = 1,\n icon: IconComponent,\n iconRight: IconRightComponent,\n justify: justifyProp = 'center',\n loading,\n mode = 'default',\n padding: paddingProp = 3,\n paddingX: paddingXProp,\n paddingY: paddingYProp,\n paddingTop: paddingTopProp,\n paddingBottom: paddingBottomProp,\n paddingLeft: paddingLeftProp,\n paddingRight: paddingRightProp,\n radius: radiusProp = 2,\n selected,\n gap = 3,\n text,\n textAlign,\n textWeight,\n tone = 'default',\n type = 'button',\n muted = false,\n width,\n ...restProps\n } = props\n const {button} = useTheme_v2()\n\n const justify = _getArrayProp(justifyProp)\n const padding = _getArrayProp(paddingProp)\n const paddingX = _getArrayProp(paddingXProp)\n const paddingY = _getArrayProp(paddingYProp)\n const paddingTop = _getArrayProp(paddingTopProp)\n const paddingBottom = _getArrayProp(paddingBottomProp)\n const paddingLeft = _getArrayProp(paddingLeftProp)\n const paddingRight = _getArrayProp(paddingRightProp)\n const radius = _getArrayProp(radiusProp)\n const spacing = _getArrayProp(gap)\n\n const boxProps = useMemo(\n () => ({\n // flex: 1,\n padding,\n paddingX,\n paddingY,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n }),\n [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight],\n )\n\n return (\n <StyledButton\n data-ui=\"Button\"\n {...restProps}\n $mode={mode}\n $radius={radius}\n $tone={tone}\n data-disabled={Boolean(loading || disabled)}\n data-selected={selected ? '' : undefined}\n disabled={Boolean(loading || disabled)}\n ref={ref}\n type={type}\n $width={width}\n >\n {Boolean(loading) && (\n <div className={buttonLoadingBox}>\n <Spinner />\n </div>\n )}\n\n {(IconComponent || text || IconRightComponent) && (\n <Box as=\"span\" {...boxProps}>\n <Flex as=\"span\" justify={justify} gap={spacing}>\n {IconComponent && (\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n )}\n\n {text && (\n <Box>\n <Text\n muted={muted}\n align={textAlign}\n size={fontSize}\n textOverflow=\"ellipsis\"\n weight={textWeight ?? button.textWeight}\n >\n {text}\n </Text>\n </Box>\n )}\n\n {IconRightComponent && (\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n )}\n </Flex>\n </Box>\n )}\n\n {children && (\n <Box as=\"span\" {...boxProps}>\n {children}\n </Box>\n )}\n </StyledButton>\n )\n}\n\n/**\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Button = ButtonComponent as unknown as <E extends ElementType = 'button'>(\n props: ButtonProps<E>,\n) => React.JSX.Element\n"],"mappings":";;;;;;;;;;;;;;;;;ACmBA,SAAgB,QACd,OACA;eAGIA;qDAAC,KAAA,oBAAA,aAAD,EAAa,WAAW,YAAc,CAAA;CADxCC,IAAAA;CADF,OAC8B,EAAA,OAAA,qBAA5B,KAAA,oBAAC,MAAD;EAAM,WAAQ;EAAU,GAAI;EAC1BD,UAAAA;CACI,CAAA,GAFsB,EAAA,KAAA,mBAA5BC;AAIJ;;;;ACfA,SAAgB,iBACd,OACwB;CACxB,IAAM,EAAC,WAAU,OACX,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,GAAG,GACN,OAAO,OAAO,4RAqBd,WAAW,UACX,GAAG,mEAKJ;AAcL;AAEA,SAAS,iBAAiB,GAAG,YAA4C;CACvE,OAAO,WAAW,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AAC5C;;;;AAKA,SAAgB,kBACd,OACa;CACb,IAAM,EAAC,UAAS,OACV,EAAC,QAAQ,OAAO,WAAW,UAAS,YAAY,MAAM,KAAK;CAClD,MAAM;CAFrB,IAGM,OAAO,UAAU,OAAO,UAAU,UAAU,OAAO,SACnD,QAAQ,KAAK,MAAM,UAAU,KAAK,SAClC,SAAS;EACb,OAAO,OAAO,OAAO;EACrB,OAAO;CACT;CAKA,OAAO;EACL,gBAAgB,WAAW,MAAM,OAAO;EACxC;GACE,iBAAmB;GACnB,OAAS;GACT,WAAa,qBAAqB,MAAM;GACxC,yCAAuC,gBAAgB,WAAW,MAAM,QAAQ;GAChF,iCAAiC;IAC/B,WAAa,iBACX,qBAAqB,MAAM,GAClB,MACX;IACA,WAAW,EACT,WAAW,eAAe;KACxB,MAAM;KACN,QAAQ;M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,QAbd,EAAA,MAAA,UAFS,EAAA,MAAA,SAWV,EAAA,MAAA,OAXwB,EAAA,MAAA,SAFxB,EAAA,MAAA,MAcA,EAAA,MAAA,WAGC,EAAA,MAAA;CAiBnBC,IAAAA;CACoB,AAAA,EAAA,QAAA,YAAA,EAAA,QADpB,YACC,MAAA,YAAA,oBAAC,KAAD;EAAK,IAAG;EAAO,GAAI;EAChB;CACE,CAAA,GAFc,EAAA,MAAA,UADpB,EAAA,MAAA;CArDHC,IAAAA;CADF,OAIW,EAAA,QAAA,QAAA,EAAA,QACE,UAAA,EAAA,QAKJ,OAAA,EAAA,QAPD,aAAA,EAAA,QAIWC,OAAAA,EAAAA,QACAC,OAAAA,EAAAA,QACLD,OAAAA,EAAAA,QAKTL,OAAAA,EAAAA,QAMAC,OAAAA,EAAAA,QAkCAE,OAAAA,EAAAA,QAhDM,QAAA,EAAA,QAKD,QAAA,EAAA,QACE,SAXV,MAAA,qBAAC,cAAD;EACE,WAAQ;EACR,GAAI;EACJ,OAAO;EACP,SAAS;EACT,OAAO;EACP,iBAAeE;EACf,iBAAeC;EACf,UAAUD;EACL;EACC;EACN,QAAQ;EAXV,UAAA;GAaGL;GAMAC;GAkCAE;EAKW;KAvDL,EAAA,MAAA,MACE,EAAA,MAAA,QAKJ,EAAA,MAAA,KAPD,EAAA,MAAA,WAIWE,EAAAA,MAAAA,KACAC,EAAAA,MAAAA,KACLD,EAAAA,MAAAA,KAKTL,EAAAA,MAAAA,KAMAC,EAAAA,MAAAA,KAkCAE,EAAAA,MAAAA,KAhDM,EAAA,MAAA,MAKD,EAAA,MAAA,MACE,EAAA,MAAA,mCAXVC;AA4DJ;;;;AAMA,MAAa,SAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getElementRef-5HZQ-Owu.js","names":["{mode: modeFromProps, layoutMode, children}: AnimateActivityProps","() => setMode('hidden')","<PresenceChild\n isPresent={isPresent}\n onExitComplete={!isPresent ? onExitComplete : undefined}\n presenceAffectsLayout={false}\n mode={layoutMode === 'pop' ? 'popLayout' : 'sync'}\n >\n {/* oxlint-disable-next-line no-unsafe-type-assertion -- PresenceChild expects a single ReactElement */}\n {children as any}\n </PresenceChild>","!isPresent ? onExitComplete : undefined","layoutMode === 'pop' ? 'popLayout' : 'sync'","children as any","<Activity mode={mode}>\n <PresenceChild\n isPresent={isPresent}\n onExitComplete={!isPresent ? onExitComplete : undefined}\n presenceAffectsLayout={false}\n mode={layoutMode === 'pop' ? 'popLayout' : 'sync'}\n >\n {/* oxlint-disable-next-line no-unsafe-type-assertion -- PresenceChild expects a single ReactElement */}\n {children as any}\n </PresenceChild>\n </Activity>"],"sources":["../src/core/middleware/origin.ts","../src/core/utils/animateActivity.tsx","../src/core/utils/getElementRef.ts"],"sourcesContent":["import {Middleware} from '@floating-ui/react-dom'\n\n/**\n * Custom floating-ui middleware which calculates transform-origin X + Y offsets\n * based on the current floating rect's dimensions and shift offset.\n *\n * Scaling popovers with these transform-origin offsets will give the effect of\n * popvers slightly 'growing' from the origin/reference element.\n *\n * This middleware must be applied after both `@sanity/ui/size` and `shift` middlewares.\n */\nexport const origin: Middleware = {\n name: '@sanity/ui/origin',\n fn({middlewareData, placement, rects}) {\n const [side] = placement.split('-')\n\n const floatingWidth = rects.floating.width\n const floatingHeight = rects.floating.height\n\n const shiftX = middlewareData.shift?.x || 0\n const shiftY = middlewareData.shift?.y || 0\n\n if (floatingWidth <= 0 || floatingHeight <= 0) {\n return {}\n }\n\n const isVerticalPlacement = ['bottom', 'top'].includes(side)\n\n const {originX, originY}: {originX: number; originY: number} = isVerticalPlacement\n ? {\n originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),\n originY: side === 'bottom' ? 0 : 1,\n }\n : {\n originX: side === 'left' ? 1 : 0,\n originY: clamp(0.5 - shiftY / floatingHeight, 0, 1),\n }\n\n return {\n data: {originX, originY},\n }\n },\n}\n\nfunction clamp(num: number, min: number, max: number) {\n return Math.min(Math.max(num, min), max)\n}\n","/**\n * MIT License\n *\n * Copyright (c) 2024 Motion One\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {invariant, PresenceChild} from 'motion/react'\nimport {Activity, useState} from 'react'\n\ninterface AnimateActivityProps {\n mode: 'visible' | 'hidden'\n layoutMode: 'default' | 'pop'\n children: React.ReactNode\n}\n\n/**\n * Animated version of React's `Activity` that defers `mode=\"hidden\"` until\n * child exit animations have finished.\n *\n * @internal\n */\nexport function AnimateActivity({mode: modeFromProps, layoutMode, children}: AnimateActivityProps) {\n /**\n * This is the mode that we'll render.\n */\n const [mode, setMode] = useState(modeFromProps)\n\n /**\n * This is the goal state as defined by props.\n */\n const isPresent = modeFromProps === 'visible'\n\n /**\n * Immediately switch to mode=\"visible\" when the user\n * changes the mode prop.\n */\n if (isPresent && mode !== 'visible') {\n setMode('visible')\n return null\n }\n\n /**\n * Set mode to \"hidden\" only when the exit animation is complete.\n */\n const onExitComplete = () => setMode('hidden')\n\n invariant(Boolean(Activity), 'Activity component not found - upgrade to React 19.2.0 or higher')\n\n return (\n <Activity mode={mode}>\n <PresenceChild\n isPresent={isPresent}\n onExitComplete={!isPresent ? onExitComplete : undefined}\n presenceAffectsLayout={false}\n mode={layoutMode === 'pop' ? 'popLayout' : 'sync'}\n >\n {/* oxlint-disable-next-line no-unsafe-type-assertion -- PresenceChild expects a single ReactElement */}\n {children as any}\n </PresenceChild>\n </Activity>\n )\n}\n","// Based on https://github.com/radix-ui/primitives/blob/0bade6a704e5821b90a6da0f3d8cfa8a7711127d/packages/react/slot/src/Slot.tsx#L128-L150\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nexport function getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n // oxlint-disable-next-line unbound-method\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning\n\n if (mayWarn) {\n // oxlint-disable-next-line no-unsafe-type-assertion\n return (element as any).ref\n }\n\n // React 19 in DEV\n // oxlint-disable-next-line unbound-method\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning\n\n if (mayWarn) {\n // oxlint-disable-next-line no-unsafe-type-assertion\n return (element.props as {ref?: React.Ref<unknown>}).ref\n }\n\n // Not DEV\n // oxlint-disable-next-line no-unsafe-type-assertion\n return (element.props as {ref?: React.Ref<unknown>}).ref || (element as any).ref\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,SAAqB;CAChC,MAAM;CACN,GAAG,EAAC,gBAAgB,WAAW,SAAQ;EACrC,IAAM,CAAC,QAAQ,UAAU,MAAM,GAAG,GAE5B,gBAAgB,MAAM,SAAS,OAC/B,iBAAiB,MAAM,SAAS,QAEhC,SAAS,eAAe,OAAO,KAAK,GACpC,SAAS,eAAe,OAAO,KAAK;EAE1C,IAAI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