@sanity/ui 4.0.0-next.4 → 4.0.0-next.6
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/README.md +4 -0
- package/dist/_system-CTe2lb5l.d.ts +40 -0
- package/dist/_system-CTe2lb5l.d.ts.map +1 -0
- package/dist/arrow-BaxgKzOL.js +161 -0
- package/dist/arrow-BaxgKzOL.js.map +1 -0
- package/dist/autocomplete.d.ts +140 -0
- package/dist/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete.js +475 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/breadcrumbs.d.ts +18 -0
- package/dist/breadcrumbs.d.ts.map +1 -0
- package/dist/breadcrumbs.js +116 -0
- package/dist/breadcrumbs.js.map +1 -0
- package/dist/button-BDLRd1Rr.js +174 -0
- package/dist/button-BDLRd1Rr.js.map +1 -0
- package/dist/button-dnqMFkWg.d.ts +76 -0
- package/dist/button-dnqMFkWg.d.ts.map +1 -0
- package/dist/card-C0a0wQTc.d.ts +7 -0
- package/dist/card-C0a0wQTc.d.ts.map +1 -0
- package/dist/code.d.ts +20 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +85 -0
- package/dist/code.js.map +1 -0
- package/dist/codeFontStyle-DYUujk7K.js +11 -0
- package/dist/codeFontStyle-DYUujk7K.js.map +1 -0
- package/dist/component-DVlwaWB-.d.ts +25 -0
- package/dist/component-DVlwaWB-.d.ts.map +1 -0
- package/dist/element-BYgCE_iK.js +51 -0
- package/dist/element-BYgCE_iK.js.map +1 -0
- package/dist/{getScopedTheme-CqaSCfTH.js → factory-CvRcEQ36.js} +6 -753
- package/dist/factory-CvRcEQ36.js.map +1 -0
- package/dist/flex-BYRpBTOc.js +69 -0
- package/dist/flex-BYRpBTOc.js.map +1 -0
- package/dist/font-EtfxKPUz.d.ts +49 -0
- package/dist/font-EtfxKPUz.d.ts.map +1 -0
- package/dist/getElementRef-5HZQ-Owu.js +91 -0
- package/dist/getElementRef-5HZQ-Owu.js.map +1 -0
- package/dist/getScopedTheme-C-sZsyAz.js +267 -0
- package/dist/getScopedTheme-C-sZsyAz.js.map +1 -0
- package/dist/getTheme_v2-y09KqtEb.js +487 -0
- package/dist/getTheme_v2-y09KqtEb.js.map +1 -0
- package/dist/grid-D88j-N7f.js +108 -0
- package/dist/grid-D88j-N7f.js.map +1 -0
- package/dist/helpers-bwfx1e-Y.js +67 -0
- package/dist/helpers-bwfx1e-Y.js.map +1 -0
- package/dist/hotkeys-aHdaZFAl.js +151 -0
- package/dist/hotkeys-aHdaZFAl.js.map +1 -0
- package/dist/index.d.ts +138 -922
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +201 -4418
- package/dist/index.js.map +1 -1
- package/dist/layer-ChlP9Ik6.d.ts +242 -0
- package/dist/layer-ChlP9Ik6.d.ts.map +1 -0
- package/dist/layer-DeCVQfUb.js +61 -0
- package/dist/layer-DeCVQfUb.js.map +1 -0
- package/dist/menu.d.ts +146 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +614 -0
- package/dist/menu.js.map +1 -0
- package/dist/popover-CMlQeKn0.d.ts +96 -0
- package/dist/popover-CMlQeKn0.d.ts.map +1 -0
- package/dist/popover-DfXz9lUl.js +417 -0
- package/dist/popover-DfXz9lUl.js.map +1 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +3 -0
- package/dist/responsiveFont-hN1mZFjm.js +55 -0
- package/dist/responsiveFont-hN1mZFjm.js.map +1 -0
- package/dist/{rgba-LmTDhX0u.d.ts → rgba-BSYaEUW6.d.ts} +4 -87
- package/dist/rgba-BSYaEUW6.d.ts.map +1 -0
- package/dist/selectable-B0GUIL74.d.ts +7 -0
- package/dist/selectable-B0GUIL74.d.ts.map +1 -0
- package/dist/stack-C5WV-BRh.js +98 -0
- package/dist/stack-C5WV-BRh.js.map +1 -0
- package/dist/styles.css +28 -0
- package/dist/textInput-DhCo-b3N.js +321 -0
- package/dist/textInput-DhCo-b3N.js.map +1 -0
- package/dist/theme.d.ts +3 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +3 -1
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +73 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +297 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +88 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +446 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/useClickOutsideEvent-lEVhDFCQ.js +36 -0
- package/dist/useClickOutsideEvent-lEVhDFCQ.js.map +1 -0
- package/dist/useElementSize-BJvbGHq8.js +51 -0
- package/dist/useElementSize-BJvbGHq8.js.map +1 -0
- package/dist/useLayer-9Pz-GG0r.js +704 -0
- package/dist/useLayer-9Pz-GG0r.js.map +1 -0
- package/package.json +15 -3
- package/dist/getScopedTheme-CqaSCfTH.js.map +0 -1
- package/dist/rgba-LmTDhX0u.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textInput-DhCo-b3N.js","names":["_raf","fn","frameId","requestAnimationFrame","cancelAnimationFrame","_raf2","innerDispose","outerDispose","isHTMLAnchorElement","isHTMLButtonElement","isHTMLElement","isHTMLInputElement","isHTMLSelectElement","isHTMLTextAreaElement","_hasFocus","element","HTMLElement","Boolean","document","activeElement","contains","isFocusable","tabIndex","getAttribute","href","rel","type","disabled","attemptFocus","focus","focusFirstDescendant","i","childNodes","length","child","focusLastDescendant","useEffect","useCustomValidity","ref","customValidity","$","_c","t0","t1","current","setCustomValidity","CSSObject","getTheme_v2","_responsive","rem","ThemeProps","TextInputResponsivePaddingStyleProps","$fontSize","$iconLeft","$iconRight","$padding","$space","responsiveInputPaddingStyle","props","font","media","space","theme","len","Math","max","length","_padding","_space","_fontSize","i","undefined","_","size","text","sizes","emSize","lineHeight","ascenderHeight","descenderHeight","p","s","styles","paddingTop","paddingRight","paddingBottom","paddingLeft","responsiveInputPaddingIconRightStyle","css","ThemeColorSchemeKey","CSSObject","ThemeFontWeightKey","getTheme_v2","CardTone","focusRingBorderStyle","focusRingStyle","_responsive","rem","ThemeProps","TextInputInputStyleProps","$fontSize","$scheme","$tone","$weight","TextInputRepresentationStyleProps","$hasPrefix","$hasSuffix","$unstableDisableFocusRing","ROOT_STYLE","textInputRootStyle","ReturnType","textInputBaseStyle","props","color","font","theme","text","family","weights","regular","input","default","enabled","fg","placeholder","disabled","invalid","readOnly","textInputFontSizeStyle","media","sizeIndex","size","sizes","fontSize","lineHeight","textInputRepresentationStyle","undefined","bg","border","width","focusRing","hovered","CloseIcon","isValidElement","useCallback","useImperativeHandle","useMemo","useRef","isValidElementType","styled","ThemeFontWeightKey","EMPTY_RECORD","useCustomValidity","_getArrayProp","responsiveInputPaddingStyle","TextInputResponsivePaddingStyleProps","textInputBaseStyle","textInputFontSizeStyle","TextInputInputStyleProps","textInputRepresentationStyle","TextInputRepresentationStyleProps","textInputRootStyle","responsiveRadiusStyle","ResponsiveRadiusStyleProps","useRootTheme","Radius","Box","Button","ButtonOwnProps","Card","Text","TextInputClearButtonProps","Omit","React","HTMLProps","HTMLButtonElement","TextInputType","TextInputProps","__unstable_disableFocusRing","border","clearButton","customValidity","fontSize","icon","ElementType","ReactNode","iconRight","onClear","padding","prefix","radius","space","gap","suffix","type","weight","CLEAR_BUTTON_BOX_STYLE","CSSProperties","zIndex","StyledTextInput","attrs","forwardedAs","InputRoot","span","Prefix","Suffix","Input","input","Presentation","LeftBox","RightBox","RightCard","TextInputClearButton","display","TextInput","props","$","_c","IconComponent","IconRightComponent","forwardedRef","readOnly","restProps","t0","t1","t2","t3","t4","t5","t6","disabled","ref","undefined","fontSizeProp","paddingProp","radiusProp","rootTheme","t7","t8","t9","t10","$hasClearButton","Boolean","$hasIcon","$hasIconRight","$hasSuffix","$hasPrefix","t11","Symbol","for","current","handleClearMouseDown","_temp","t12","event_0","event","preventDefault","stopPropagation","focus","handleClearClick","t13","prefixNode","t14","t15","t16","t17","scheme","tone","presentationNode","t18","map","_temp2","clearButtonBoxPadding","t19","_temp3","clearButtonPadding","clearButtonProps","t20","clearButtonNode","t21","suffixNode","t22","t23","t24","t25","v_0","v"],"sources":["../src/core/helpers/animation.ts","../src/core/helpers/focus.ts","../src/core/hooks/useCustomValidity.ts","../src/core/styles/input/responsiveInputPaddingStyle.ts","../src/core/styles/input/textInputStyle.ts","../src/core/primitives/textInput/textInput.tsx"],"sourcesContent":["/**\n * @internal\n */\nexport function _raf(fn: () => void): () => void {\n const frameId = requestAnimationFrame(fn)\n\n return () => {\n cancelAnimationFrame(frameId)\n }\n}\n\n/**\n * @internal\n */\nexport function _raf2(fn: () => void): () => void {\n let innerDispose: (() => void) | null = null\n\n const outerDispose = _raf(() => {\n innerDispose = _raf(fn)\n })\n\n return () => {\n if (innerDispose) innerDispose()\n\n outerDispose()\n }\n}\n","import {\n isHTMLAnchorElement,\n isHTMLButtonElement,\n isHTMLElement,\n isHTMLInputElement,\n isHTMLSelectElement,\n isHTMLTextAreaElement,\n} from './element'\n\n// export const globalFocusState = {\n// IgnoreUtilFocusChanges: false,\n// }\n\n/**\n * @internal\n */\nexport function _hasFocus(element: HTMLElement): boolean {\n return Boolean(document.activeElement) && element.contains(document.activeElement)\n}\n\n/**\n * @internal\n */\nexport function isFocusable(element: HTMLElement): boolean {\n if (\n element.tabIndex > 0 ||\n (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)\n ) {\n return true\n }\n\n if (isHTMLAnchorElement(element)) {\n return Boolean(element.href) && element.rel !== 'ignore'\n }\n\n if (isHTMLInputElement(element)) {\n return element.type !== 'hidden' && element.type !== 'file' && !element.disabled\n }\n\n if (\n isHTMLButtonElement(element) ||\n isHTMLSelectElement(element) ||\n isHTMLTextAreaElement(element)\n ) {\n return !element.disabled\n }\n\n return false\n}\n\n/**\n * @internal\n */\nexport function attemptFocus(element: HTMLElement): boolean {\n if (!isFocusable(element)) {\n return false\n }\n\n // globalFocusState.IgnoreUtilFocusChanges = true\n\n try {\n element.focus()\n } catch {\n // ignore\n }\n\n // globalFocusState.IgnoreUtilFocusChanges = false\n\n return document.activeElement === element\n}\n\n/**\n * @internal\n */\nexport function focusFirstDescendant(element: HTMLElement): boolean {\n for (let i = 0; i < element.childNodes.length; i++) {\n const child = element.childNodes[i]\n\n if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child))) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * @internal\n */\nexport function focusLastDescendant(element: HTMLElement): boolean {\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\n const child = element.childNodes[i]\n\n if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child))) {\n return true\n }\n }\n\n return false\n}\n","import {useEffect} from 'react'\n\n/**\n * @beta\n */\nexport function useCustomValidity(\n ref: {current: null | {setCustomValidity: (validity: string) => void}},\n customValidity: string | undefined,\n): void {\n useEffect(() => {\n ref.current?.setCustomValidity(customValidity || '')\n }, [customValidity, ref])\n}\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\n\nexport interface TextInputResponsivePaddingStyleProps {\n $fontSize: number[]\n $iconLeft?: boolean\n $iconRight?: boolean\n $padding: number[]\n $space: number[]\n}\n\nexport function responsiveInputPaddingStyle(\n props: TextInputResponsivePaddingStyleProps & ThemeProps,\n): CSSObject[] {\n const {$fontSize, $iconLeft, $iconRight, $padding, $space} = props\n const {font, media, space} = getTheme_v2(props.theme)\n const len = Math.max($padding.length, $space.length, $fontSize.length)\n const _padding: number[] = []\n const _space: number[] = []\n const _fontSize: number[] = []\n\n for (let i = 0; i < len; i += 1) {\n _fontSize[i] = $fontSize[i] === undefined ? _fontSize[i - 1] : $fontSize[i]\n _padding[i] = $padding[i] === undefined ? _padding[i - 1] : $padding[i]\n _space[i] = $space[i] === undefined ? _space[i - 1] : $space[i]\n }\n\n return _responsive(media, _padding, (_, i) => {\n const size = font.text.sizes[_fontSize[i]] || font.text.sizes[2]\n const emSize = size.lineHeight - size.ascenderHeight - size.descenderHeight\n const p = space[_padding[i]]\n const s = space[_space[i]]\n\n const styles = {\n paddingTop: rem(p - size.ascenderHeight),\n paddingRight: rem(p),\n paddingBottom: rem(p - size.descenderHeight),\n paddingLeft: rem(p),\n }\n\n if ($iconRight) styles.paddingRight = rem(p + emSize + s)\n if ($iconLeft) styles.paddingLeft = rem(p + emSize + s)\n\n return styles\n })\n}\n\nexport function responsiveInputPaddingIconRightStyle(\n props: {\n $fontSize: number[]\n $padding: number[]\n $space: number[]\n } & ThemeProps,\n): CSSObject[] {\n return responsiveInputPaddingStyle({...props, $iconRight: true})\n}\n","import {css} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {CSSObject} from '../../../theme/system/css'\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {CardTone} from '../../types/card'\nimport {focusRingBorderStyle, focusRingStyle} from '../focusRing'\nimport {_responsive, rem} from '../helpers'\nimport {ThemeProps} from '../types'\n\n/**\n * @internal\n */\nexport interface TextInputInputStyleProps {\n $fontSize: number[]\n $scheme: ThemeColorSchemeKey\n $tone: CardTone\n $weight?: ThemeFontWeightKey\n}\n\n/**\n * @internal\n */\nexport interface TextInputRepresentationStyleProps {\n $hasPrefix?: boolean\n $hasSuffix?: boolean\n $scheme: ThemeColorSchemeKey\n $tone: CardTone\n $unstableDisableFocusRing?: boolean\n}\n\nconst ROOT_STYLE = css`\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n`\n\nexport function textInputRootStyle(): ReturnType<typeof css> {\n return ROOT_STYLE\n}\n\nexport function textInputBaseStyle(\n props: TextInputInputStyleProps & ThemeProps,\n): ReturnType<typeof css> {\n const {$scheme, $tone, $weight} = props\n const {color, font} = getTheme_v2(props.theme)\n\n return css`\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ${font.text.family};\n font-weight: ${($weight && font.text.weights[$weight]) || font.text.weights.regular};\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome’s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='${$scheme}'][data-tone='${$tone}'] {\n --input-fg-color: ${color.input.default.enabled.fg};\n --input-placeholder-color: ${color.input.default.enabled.placeholder};\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ${color.input.default.enabled.fg};\n --input-placeholder-color: ${color.input.default.enabled.placeholder};\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ${color.input.default.disabled.fg};\n --input-placeholder-color: ${color.input.default.disabled.placeholder};\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ${color.input.invalid.enabled.fg};\n --input-placeholder-color: ${color.input.invalid.enabled.placeholder};\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ${color.input.default.readOnly.fg};\n --input-placeholder-color: ${color.input.default.readOnly.placeholder};\n }\n }\n `\n}\n\nexport function textInputFontSizeStyle(props: TextInputInputStyleProps & ThemeProps): CSSObject[] {\n const {font, media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$fontSize, (sizeIndex) => {\n const size = font.text.sizes[sizeIndex] || font.text.sizes[2]\n\n return {\n fontSize: rem(size.fontSize),\n lineHeight: `${size.lineHeight / size.fontSize}`,\n }\n })\n}\n\nexport function textInputRepresentationStyle(\n props: TextInputRepresentationStyleProps & ThemeProps,\n): ReturnType<typeof css> {\n const {$hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing} = props\n const {color, input} = getTheme_v2(props.theme)\n\n return css`\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ${$hasPrefix ? 0 : undefined};\n border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};\n border-top-right-radius: ${$hasSuffix ? 0 : undefined};\n border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};\n\n &[data-scheme='${$scheme}'][data-tone='${$tone}'] {\n --card-bg-color: ${color.input.default.enabled.bg};\n --card-fg-color: ${color.input.default.enabled.fg};\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.enabled.border,\n width: input.border.width,\n })};\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ${color.input.invalid.enabled.bg};\n --card-fg-color: ${color.input.invalid.enabled.fg};\n\n &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.invalid.enabled.border,\n width: input.border.width,\n })};\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ${\n $unstableDisableFocusRing\n ? undefined\n : focusRingStyle({\n border: {color: color.input.default.enabled.border, width: input.border.width},\n focusRing: input.text.focusRing,\n })\n };\n }\n\n &:not([data-border]) {\n --input-box-shadow: ${\n $unstableDisableFocusRing\n ? undefined\n : focusRingStyle({focusRing: input.text.focusRing})\n };\n }\n }\n\n /* disabled */\n *:not(:invalid):disabled + & {\n --card-bg-color: ${color.input.default.disabled.bg} !important;\n --card-fg-color: ${color.input.default.disabled.fg} !important;\n --card-icon-color: ${color.input.default.disabled.fg} !important;\n\n &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.disabled.border,\n width: input.border.width,\n })};\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: ${color.input.invalid.disabled.bg} !important;\n --card-fg-color: ${color.input.invalid.disabled.fg} !important;\n --card-icon-color: ${color.input.invalid.disabled.fg} !important;\n\n &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.invalid.disabled.border,\n width: input.border.width,\n })};\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: ${color.input.default.readOnly.bg} !important;\n --card-fg-color: ${color.input.default.readOnly.fg} !important;\n }\n\n *:invalid:read-only + & {\n --card-bg-color: ${color.input.invalid.readOnly.bg} !important;\n --card-fg-color: ${color.input.invalid.readOnly.fg} !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ${color.input.default.hovered.bg};\n --card-fg-color: ${color.input.default.hovered.fg};\n }\n\n *:invalid:not(:disabled):not(:read-only):hover + & {\n --card-bg-color: ${color.input.invalid.hovered.bg};\n --card-fg-color: ${color.input.invalid.hovered.fg};\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.hovered.border,\n width: input.border.width,\n })};\n }\n\n *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.invalid.hovered.border,\n width: input.border.width,\n })};\n }\n }\n }\n `\n}\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {isValidElement, useCallback, useImperativeHandle, useMemo, useRef} from 'react'\nimport {isValidElementType} from 'react-is'\nimport {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {EMPTY_RECORD} from '../../constants'\nimport {useCustomValidity} from '../../hooks/useCustomValidity'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {\n responsiveInputPaddingStyle,\n TextInputResponsivePaddingStyleProps,\n} from '../../styles/input/responsiveInputPaddingStyle'\nimport {\n textInputBaseStyle,\n textInputFontSizeStyle,\n TextInputInputStyleProps,\n textInputRepresentationStyle,\n TextInputRepresentationStyleProps,\n textInputRootStyle,\n} from '../../styles/input/textInputStyle'\nimport {responsiveRadiusStyle} from '../../styles/radius/radiusStyle'\nimport {ResponsiveRadiusStyleProps} from '../../styles/radius/types'\nimport {useRootTheme} from '../../theme/useRootTheme'\nimport {Radius} from '../../types/radius'\nimport {Box} from '../box/box'\nimport {Button, ButtonOwnProps} from '../button/button'\nimport {Card} from '../card/card'\nimport {Text} from '../text/text'\n\n/**\n * @public\n */\nexport type TextInputClearButtonProps = ButtonOwnProps &\n Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>\n\n/**\n * @public\n */\nexport type TextInputType =\n | 'search'\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'url'\n | 'month'\n | 'number'\n | 'password'\n | 'tel'\n | 'time'\n | 'text'\n | 'week'\n | 'color'\n\n/**\n * @public\n */\nexport interface TextInputProps {\n /**\n * @beta\n */\n __unstable_disableFocusRing?: boolean\n border?: boolean\n /**\n * @beta\n */\n clearButton?: boolean | TextInputClearButtonProps\n customValidity?: string\n fontSize?: number | number[]\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 /**\n * @beta\n */\n onClear?: () => void\n padding?: number | number[]\n prefix?: React.ReactNode\n radius?: Radius | Radius[]\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n gap?: number | number[]\n suffix?: React.ReactNode\n type?: TextInputType\n weight?: ThemeFontWeightKey\n}\n\nconst CLEAR_BUTTON_BOX_STYLE: React.CSSProperties = {zIndex: 2}\n\nconst StyledTextInput = styled(Card).attrs({forwardedAs: 'span'})(textInputRootStyle)\n\nconst InputRoot = styled.span`\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n`\n\nconst Prefix = styled(Card).attrs({forwardedAs: 'span'})`\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n`\n\nconst Suffix = styled(Card).attrs({forwardedAs: 'span'})`\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n`\n\nconst Input = styled.input<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(\n responsiveInputPaddingStyle,\n textInputBaseStyle,\n textInputFontSizeStyle,\n)\n\nconst Presentation = styled.span<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>(\n responsiveRadiusStyle,\n textInputRepresentationStyle,\n)\n\nconst LeftBox = styled(Box)`\n position: absolute;\n top: 0;\n left: 0;\n`\n\nconst RightBox = styled(Box)`\n position: absolute;\n top: 0;\n right: 0;\n`\n\nconst RightCard = styled(Card)`\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n`\n\nconst TextInputClearButton = styled(Button)({\n '&:not([hidden])': {\n display: 'block',\n },\n})\n\n/**\n * Single line text input.\n *\n * @public\n */\nexport function TextInput(\n props: TextInputProps & Omit<React.HTMLProps<HTMLInputElement>, 'as' | 'prefix' | 'type'>,\n) {\n const {\n __unstable_disableFocusRing,\n border = true,\n clearButton,\n disabled = false,\n fontSize: fontSizeProp = 2,\n gap = 3,\n icon: IconComponent,\n iconRight: IconRightComponent,\n onClear,\n padding: paddingProp = 3,\n prefix,\n radius: radiusProp = 2,\n readOnly,\n ref: forwardedRef,\n suffix,\n customValidity,\n type = 'text',\n weight,\n ...restProps\n } = props\n const ref = useRef<HTMLInputElement | null>(null)\n\n const rootTheme = useRootTheme()\n\n const fontSize = _getArrayProp(fontSizeProp)\n const padding = _getArrayProp(paddingProp)\n const radius = _getArrayProp(radiusProp)\n const space = _getArrayProp(gap)\n\n // Transient properties\n const $hasClearButton = Boolean(clearButton)\n const $hasIcon = Boolean(IconComponent)\n const $hasIconRight = Boolean(IconRightComponent)\n const $hasSuffix = Boolean(suffix)\n const $hasPrefix = Boolean(prefix)\n\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n forwardedRef,\n () => ref.current,\n )\n\n useCustomValidity(ref, customValidity)\n\n // Prevent the clear button from taking the focus away from the input\n const handleClearMouseDown = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n }, [])\n\n const handleClearClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (onClear) onClear()\n\n // Focus the input, in case focus has been lost when clicking the clear button\n ref.current?.focus()\n },\n [onClear, ref],\n )\n\n // Render prefix (memoized)\n const prefixNode = useMemo(\n () =>\n prefix && (\n <Prefix borderTop borderLeft borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{prefix}</span>\n </Prefix>\n ),\n [prefix, radius],\n )\n\n // Render presentation (memoized)\n const presentationNode = useMemo(\n () => (\n <Presentation\n $hasPrefix={$hasPrefix}\n $unstableDisableFocusRing={__unstable_disableFocusRing}\n $hasSuffix={$hasSuffix}\n $radius={radius}\n $scheme={rootTheme.scheme}\n $tone={rootTheme.tone}\n data-border={border ? '' : undefined}\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n >\n {IconComponent && (\n <LeftBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </LeftBox>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <RightBox padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </RightBox>\n )}\n </Presentation>\n ),\n [\n __unstable_disableFocusRing,\n border,\n fontSize,\n IconComponent,\n IconRightComponent,\n padding,\n radius,\n rootTheme,\n $hasClearButton,\n $hasPrefix,\n $hasSuffix,\n ],\n )\n\n // Render clear button (memoized)\n const clearButtonBoxPadding = useMemo(\n () =>\n padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 1\n if (v === 2) return 1\n\n return v - 2\n }),\n [padding],\n )\n const clearButtonPadding = useMemo(\n () =>\n padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 0\n if (v === 2) return 1\n\n return v - 1\n }),\n [padding],\n )\n const clearButtonProps: TextInputClearButtonProps = useMemo(\n () => (typeof clearButton === 'object' ? clearButton : EMPTY_RECORD),\n [clearButton],\n )\n const clearButtonNode = useMemo(\n () =>\n !disabled &&\n !readOnly &&\n clearButton && (\n <RightCard\n forwardedAs=\"span\"\n padding={clearButtonBoxPadding}\n style={CLEAR_BUTTON_BOX_STYLE}\n tone={customValidity ? 'critical' : 'inherit'}\n >\n <TextInputClearButton\n aria-label=\"Clear\"\n data-qa=\"clear-button\"\n fontSize={fontSize}\n icon={CloseIcon}\n mode=\"bleed\"\n padding={clearButtonPadding}\n radius={radius}\n {...clearButtonProps}\n onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n ),\n [\n clearButton,\n clearButtonBoxPadding,\n clearButtonPadding,\n clearButtonProps,\n customValidity,\n disabled,\n fontSize,\n handleClearClick,\n handleClearMouseDown,\n radius,\n readOnly,\n ],\n )\n\n // Render suffix (memoized)\n const suffixNode = useMemo(\n () =>\n suffix && (\n <Suffix borderTop borderRight borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{suffix}</span>\n </Suffix>\n ),\n [radius, suffix],\n )\n\n return (\n <StyledTextInput data-ui=\"TextInput\" tone={rootTheme.tone}>\n {prefixNode}\n\n <InputRoot>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n {...restProps}\n $fontSize={fontSize}\n $iconLeft={$hasIcon}\n $iconRight={$hasIconRight || $hasClearButton}\n $padding={padding}\n $scheme={rootTheme.scheme}\n $space={space}\n $tone={rootTheme.tone}\n $weight={weight}\n disabled={disabled}\n readOnly={readOnly}\n ref={ref}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AAA,qBAAC,WAAD,EAAA,UAAA;EACED;EAmBCd;EACAU;CArBO,EAAA,CAAA,GAsBE9D,EAAA,MAAA8D,iBAAA9D,EAAA,MAAAoD,kBAAApD,EAAA,MAAAkE,KAAAlE,EAAA,MAAAmE,OAAAA,MAAAnE,EAAA;CAAA,IAAAoE;CAGI,OAHJpE,EAAA,QAAA6C,cAAA7C,EAAA,QAAAoB,UAAA+B,QAAAnD,EAAA,QAAAgE,cAAAhE,EAAA,QAAAmE,OAzBdC,MAAA,qBAAC,iBAAD;EAAyB,WAAA;EAAkB,MAAAhD,UAAS+B;EAApD,UAAA;GACGN;GAEDsB;GAwBCH;EA3Ba;KA4BEhE,EAAA,MAAA6C,YAAA7C,EAAA,MAAAoB,UAAA+B,MAAAnD,EAAA,MAAAgE,YAAAhE,EAAA,MAAAmE,KAAAnE,EAAA,MAAAoE,OAAAA,MAAApE,EAAA,KA5BlBoE;AA4BkB;AAxOf,SAAAV,OAAAW,KAAA;CA8IsB,OAFjBC,QAAM,KACNA,QAAM,IAAU,IAChBA,QAAM,IAAU,IAEbA,MAAI;AAAC;AAhJb,SAAAf,OAAAe,GAAA;CAmIsB,OAFjBA,MAAM,IAAU,IAChBA,MAAM,KACNA,MAAM,IAAU,IAEbA,IAAI;AAAC;AArIb,SAAAlC,MAAAG,OAAA;CAkDHA,AADAA,MAAKC,eAAgB,GACrBD,MAAKE,gBAAiB;AAAC"}
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as THEME_COLOR_STATES, a as ThemeColorInputModeKey, c as ThemeColorStateKey, d as THEME_COLOR_BLEND_MODES, f as THEME_COLOR_BUTTON_MODES, g as THEME_COLOR_SCHEMES, h as THEME_COLOR_INPUT_STATES, i as ThemeColorCardToneKey, l as ThemeColorStateToneKey, m as THEME_COLOR_INPUT_MODES, n as ThemeColorBlendModeKey, o as ThemeColorInputStateKey, p as THEME_COLOR_CARD_TONES, r as ThemeColorButtonModeKey, s as ThemeColorSchemeKey, t as ThemeColorAvatarColorKey, u as THEME_COLOR_AVATAR_COLORS, v as THEME_COLOR_STATE_TONES } from "./_system-CTe2lb5l.js";
|
|
2
|
+
import { a as ThemeFontWeightKey, i as ThemeFontWeight, n as ThemeFontKey, o as ThemeFonts, r as ThemeFontSize, t as ThemeFont } from "./font-EtfxKPUz.js";
|
|
3
|
+
import { $ as ThemeColorInputState_v2, A as ThemeColorMutedTone, B as ThemeColorBase, C as ThemeColorSpotKey, D as ThemeColorSelectableState, E as ThemeColorSelectable, F as ThemeColorCardState, G as ThemeInput_v2, H as ThemeColorToneKey, I as ThemeColorButton, J as ThemeColorSchemes_v2, K as ThemeColorCard_v2, L as ThemeColorButtonState, M as ThemeColorInputState, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, Q as ThemeColorInputMode_v2, R as ThemeColorButtonStates, S as ThemeColorSpot, T as ThemeColorSolidTone, U as ThemeColorGenericState, V as ThemeColorName, W as ThemeAvatar, X as ThemeColorSelectableTone_v2, Y as ThemeColorShadow, Z as ThemeColorSelectable_v2, _ as Theme_v2, _t as ThemeColorSyntax, a as rgbToHex, at as ThemeColorKBD, b as ThemeColorScheme, bt as RGBA, c as screen, ct as ThemeColorAvatarHue_v2, d as ThemeColorBuilderOpts, dt as ThemeFocusRing, et as ThemeColorInput_v2, f as createColorTheme, ft as ThemeStyles, g as Theme, gt as ThemeLayer, h as RootTheme_v2, ht as ThemeShadow, i as hslToRgb, it as ThemeColorState_v2, j as ThemeColorInput, k as ThemeColorMuted, l as multiply, lt as ThemeColorAvatar_v2, m as RootTheme, mt as ThemeBoxShadow, n as parseColor, nt as ThemeColorButtonTone_v2, o as rgbToHsl, ot as ThemeColorBadgeTone_v2, p as BaseTheme, pt as CSSObject, q as ThemeColorScheme_v2, r as hexToRgb, rt as ThemeColorButton_v2, s as rgbaToRGBA, st as ThemeColorBadge_v2, t as rgba, tt as ThemeColorButtonMode_v2, u as PartialThemeColorBuilderOpts, ut as ThemeAvatar_v2, v as ThemeInput, vt as HSL, w as ThemeColorSolid, x as ThemeColorSchemes, y as ThemeColor, yt as RGB, z as ThemeColorButtonTones } from "./rgba-BSYaEUW6.js";
|
|
2
4
|
import { ColorHueKey, ColorTint, ColorTintKey } from "@sanity/color";
|
|
3
5
|
/** @public */
|
|
4
6
|
declare const COLOR_CONFIG_STATE_KEYS: readonly ['_hue', 'bg', 'fg', 'border', 'focusRing', 'muted/fg', 'accent/fg', 'link/fg', 'code/bg', 'code/fg', 'skeleton/from', 'skeleton/to', 'status/dot', 'status/icon'];
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","names":[],"sources":["../src/theme/config/system.ts","../src/theme/config/tokens/color/types.ts","../src/theme/config/types.ts","../src/theme/build/buildTheme.ts","../src/theme/build/lib/color-fns/blend/mix.ts","../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/helpers.ts","../src/theme/config/tokens/types.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/config/tokens/parseTokenValue.ts","../src/theme/getScopedTheme.ts","../src/theme/system/color/_helpers.ts","../src/theme/versioning/getTheme_v2.ts","../src/theme/versioning/is_v0.ts","../src/theme/versioning/is_v2.ts","../src/theme/versioning/v0_v2.ts","../src/theme/versioning/v2_v0.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","names":[],"sources":["../src/theme/config/system.ts","../src/theme/config/tokens/color/types.ts","../src/theme/config/types.ts","../src/theme/build/buildTheme.ts","../src/theme/build/lib/color-fns/blend/mix.ts","../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/helpers.ts","../src/theme/config/tokens/types.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/config/tokens/parseTokenValue.ts","../src/theme/getScopedTheme.ts","../src/theme/system/color/_helpers.ts","../src/theme/versioning/getTheme_v2.ts","../src/theme/versioning/is_v0.ts","../src/theme/versio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d,WAAW,YAAY,cACvB,QAAQ,qBACR,MAAM,wBACL;;iBCfa,sBAAsB,cAAc,OAAO;;iBAM3C,cAAc,cAAc,OAAO;;iBAMnC,eAAe,cAAc,OAAO;;iBAMpC,kBAAkB,cAAc,OAAO;;iBCjBvC,YAAY,OAAO,QAAQ;;iBCJ3B,MAAM,WAAW,YAAY,eAAe,aAAa;;iBCAzD,MAAM,WAAW,YAAY,eAAe,aAAa;;iBCIzD,MAAM,IAAI,YAAY;;iBCiBtB,MAAM,IAAI,eAAe"}
|
package/dist/theme.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
|
|
2
|
+
import { i as is_v2, n as v2_v0, r as v0_v2, t as getScopedTheme } from "./getScopedTheme-C-sZsyAz.js";
|
|
3
|
+
import { A as COLOR_CONFIG_STATE_TONES, B as THEME_COLOR_INPUT_STATES, C as COLOR_CONFIG_BLEND_KEYS, D as COLOR_CONFIG_INPUT_STATES, E as COLOR_CONFIG_INPUT_MODES, F as THEME_COLOR_AVATAR_COLORS, H as THEME_COLOR_STATES, I as THEME_COLOR_BLEND_MODES, L as THEME_COLOR_BUTTON_MODES, M as isColorButtonMode, N as isColorHueKey, O as COLOR_CONFIG_STATES, P as isColorTintKey, R as THEME_COLOR_CARD_TONES, S as COLOR_CONFIG_AVATAR_COLORS, T as COLOR_CONFIG_CARD_TONES, U as THEME_COLOR_STATE_TONES, V as THEME_COLOR_SCHEMES, _ as isColorConfigStateKey, a as rgba, b as isColorTokenValue, c as hslToRgb, d as rgbaToRGBA, f as mix, g as isColorConfigBlendKey, h as isColorConfigBaseTone, i as multiply, j as isColorBlendModeValue, k as COLOR_CONFIG_STATE_KEYS, l as rgbToHex, m as isColorConfigBaseKey, n as buildTheme, o as parseColor, p as parseTokenValue, r as screen, s as hexToRgb, t as createColorTheme, u as rgbToHsl, v as isColorConfigStateTone, w as COLOR_CONFIG_CARD_KEYS, x as isColorValue, y as isColorOpacityValue, z as THEME_COLOR_INPUT_MODES } from "./factory-CvRcEQ36.js";
|
|
2
4
|
/** @internal */
|
|
3
5
|
function getContrastRatio(bg, fg) {
|
|
4
6
|
let rgb1 = parseColor(bg), rgb2 = parseColor(fg), c1 = rgb_lrgb(rgb1), c2 = rgb_lrgb(rgb2), l1 = lrgb_luminance(c1), l2 = lrgb_luminance(c2);
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":["parseColor","RGB","RGBA","getContrastRatio","bg","fg","rgb1","rgb2","c1","rgb_lrgb","c2","l1","lrgb_luminance","l2","Math","max","min","r","g","b","rgb_lrgb1","v","isColorButtonMode","isColorConfigBaseKey","isColorConfigBaseTone","isColorConfigBlendKey","isColorConfigStateKey","isColorConfigStateTone","TokenKeyNode","parseTokenKey","str","segments","split","segment0","shift","key","join","type","tone","segment1","segment2","mode","undefined"],"sources":["../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/versioning/is_v0.ts"],"sourcesContent":["import {parseColor} from './parse'\nimport {RGB, RGBA} from './types'\n\n/** @internal */\nexport function getContrastRatio(bg: string, fg: string): number {\n const rgb1 = parseColor(bg) // bg: RGB | RGBA, fg: RGB | RGBA\n const rgb2 = parseColor(fg)\n\n // convert the two colors from sRGB to linear-light RGB\n const c1 = rgb_lrgb(rgb1)\n const c2 = rgb_lrgb(rgb2)\n\n // compute the relative luminances\n const l1 = lrgb_luminance(c1)\n const l2 = lrgb_luminance(c2)\n\n // compute the contrast ratio\n return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)\n}\n\nfunction rgb_lrgb({r, g, b}: RGB | RGBA): [number, number, number] {\n return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)]\n}\n\nfunction rgb_lrgb1(v: number) {\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction lrgb_luminance([r, g, b]: [number, number, number]) {\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n","import {isColorButtonMode} from '../../system/color/_helpers'\nimport {\n isColorConfigBaseKey,\n isColorConfigBaseTone,\n isColorConfigBlendKey,\n isColorConfigStateKey,\n isColorConfigStateTone,\n} from '../helpers'\nimport {TokenKeyNode} from './types'\n\n/** @internal */\nexport function parseTokenKey(str: string): TokenKeyNode | undefined {\n const segments = str.split('/')\n const segment0 = segments.shift() || ''\n\n if (isColorConfigBaseTone(segment0)) {\n const key = segments.join('/')\n\n if (isColorConfigBaseKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n }\n\n if (segment0 === 'button') {\n const segment1 = segments.shift() || ''\n\n if (isColorConfigStateTone(segment1)) {\n const segment2 = segments.shift() || ''\n\n if (isColorButtonMode(segment2)) {\n const key = segments.join('/')\n\n if (isColorConfigStateKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n }\n }\n }\n\n return undefined\n}\n","import {RootTheme, RootTheme_v2} from '../system/theme'\n\n/** @internal */\nexport function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme {\n return themeProp._version === 0\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.js","names":["parseColor","RGB","RGBA","getContrastRatio","bg","fg","rgb1","rgb2","c1","rgb_lrgb","c2","l1","lrgb_luminance","l2","Math","max","min","r","g","b","rgb_lrgb1","v","isColorButtonMode","isColorConfigBaseKey","isColorConfigBaseTone","isColorConfigBlendKey","isColorConfigStateKey","isColorConfigStateTone","TokenKeyNode","parseTokenKey","str","segments","split","segment0","shift","key","join","type","tone","segment1","segment2","mode","undefined"],"sources":["../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/versioning/is_v0.ts"],"sourcesContent":["import {parseColor} from './parse'\nimport {RGB, RGBA} from './types'\n\n/** @internal */\nexport function getContrastRatio(bg: string, fg: string): number {\n const rgb1 = parseColor(bg) // bg: RGB | RGBA, fg: RGB | RGBA\n const rgb2 = parseColor(fg)\n\n // convert the two colors from sRGB to linear-light RGB\n const c1 = rgb_lrgb(rgb1)\n const c2 = rgb_lrgb(rgb2)\n\n // compute the relative luminances\n const l1 = lrgb_luminance(c1)\n const l2 = lrgb_luminance(c2)\n\n // compute the contrast ratio\n return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)\n}\n\nfunction rgb_lrgb({r, g, b}: RGB | RGBA): [number, number, number] {\n return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)]\n}\n\nfunction rgb_lrgb1(v: number) {\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction lrgb_luminance([r, g, b]: [number, number, number]) {\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n","import {isColorButtonMode} from '../../system/color/_helpers'\nimport {\n isColorConfigBaseKey,\n isColorConfigBaseTone,\n isColorConfigBlendKey,\n isColorConfigStateKey,\n isColorConfigStateTone,\n} from '../helpers'\nimport {TokenKeyNode} from './types'\n\n/** @internal */\nexport function parseTokenKey(str: string): TokenKeyNode | undefined {\n const segments = str.split('/')\n const segment0 = segments.shift() || ''\n\n if (isColorConfigBaseTone(segment0)) {\n const key = segments.join('/')\n\n if (isColorConfigBaseKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n }\n\n if (segment0 === 'button') {\n const segment1 = segments.shift() || ''\n\n if (isColorConfigStateTone(segment1)) {\n const segment2 = segments.shift() || ''\n\n if (isColorButtonMode(segment2)) {\n const key = segments.join('/')\n\n if (isColorConfigStateKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n }\n }\n }\n\n return undefined\n}\n","import {RootTheme, RootTheme_v2} from '../system/theme'\n\n/** @internal */\nexport function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme {\n return themeProp._version === 0\n}\n"],"mappings":";;;;AAIA,SAAgBG,iBAAiBC,IAAYC,IAAoB;CAC/D,IAAMC,OAAON,WAAWI,EAAE,GACpBG,OAAOP,WAAWK,EAAE,GAGpBG,KAAKC,SAASH,IAAI,GAClBI,KAAKD,SAASF,IAAI,GAGlBI,KAAKC,eAAeJ,EAAE,GACtBK,KAAKD,eAAeF,EAAE;CAG5B,QAAQI,KAAKC,IAAIJ,IAAIE,EAAE,IAAI,QAASC,KAAKE,IAAIL,IAAIE,EAAE,IAAI;AACzD;AAEA,SAASJ,SAAS,EAACQ,GAAGC,GAAGC,KAA0C;CACjE,OAAO;EAACC,UAAUH,IAAI,GAAG;EAAGG,UAAUF,IAAI,GAAG;EAAGE,UAAUD,IAAI,GAAG;CAAC;AACpE;AAEA,SAASC,UAAUC,GAAW;CAC5B,OAAOA,KAAK,SAAUA,IAAI,UAAUA,IAAI,QAAS,UAAU;AAC7D;AAEA,SAAST,eAAe,CAACK,GAAGC,GAAGC,IAA8B;CAC3D,OAAO,QAASF,IAAI,QAASC,IAAI,QAASC;AAC5C;;ACnBA,SAAgBU,cAAcC,KAAuC;CACnE,IAAMC,WAAWD,IAAIE,MAAM,GAAG,GACxBC,WAAWF,SAASG,MAAM,KAAK;CAErC,IAAIV,sBAAsBS,QAAQ,GAAG;EACnC,IAAME,MAAMJ,SAASK,KAAK,GAAG;EAU7B,IARIb,qBAAqBY,GAAG,KAQxBV,sBAAsBU,GAAG,GAC3B,OAAO;GACLE,MAAM;GACNC,MAAML;GACNE;EACF;CAEJ;CAEA,IAAIF,aAAa,UAAU;EACzB,IAAMM,WAAWR,SAASG,MAAM,KAAK;EAErC,IAAIP,uBAAuBY,QAAQ,GAAG;GACpC,IAAMC,WAAWT,SAASG,MAAM,KAAK;GAErC,IAAIZ,kBAAkBkB,QAAQ,GAAG;IAC/B,IAAML,MAAMJ,SAASK,KAAK,GAAG;IAW7B,IATIV,sBAAsBS,GAAG,KASzBV,sBAAsBU,GAAG,GAC3B,OAAO;KACLE,MAAM;KACNC,MAAMC;KACNE,MAAMD;KACNL;IACF;GAEJ;EACF;CACF;AAGF;;AC/DA,SAAgB,MAAM,WAA6D;CACjF,OAAO,UAAU,aAAa;AAChC"}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
4
|
+
interface ToastProps {
|
|
5
|
+
closable?: boolean;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
radius?: number | number[];
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
status?: 'error' | 'warning' | 'success' | 'info';
|
|
11
|
+
duration?: number;
|
|
12
|
+
updatedAt?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The `Toast` component gives feedback to users when an action has taken place.
|
|
16
|
+
*
|
|
17
|
+
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
declare function Toast(props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title' | 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'>): React.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
interface ToastLayerProps {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
padding?: number | number[];
|
|
28
|
+
paddingX?: number | number[];
|
|
29
|
+
paddingY?: number | number[];
|
|
30
|
+
gap?: number | number[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
zOffset?: number | number[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
interface ToastParams {
|
|
47
|
+
closable?: boolean;
|
|
48
|
+
description?: React.ReactNode;
|
|
49
|
+
duration?: number;
|
|
50
|
+
id?: string;
|
|
51
|
+
onClose?: () => void;
|
|
52
|
+
title?: React.ReactNode;
|
|
53
|
+
status?: 'error' | 'warning' | 'success' | 'info';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
interface ToastContextValue {
|
|
59
|
+
version: 0.0;
|
|
60
|
+
/**
|
|
61
|
+
* Creates or updates a toast notification.
|
|
62
|
+
* If a toast with the same ID already exists, it will be updated.
|
|
63
|
+
* If an ID is not provided, a random one will be generated.
|
|
64
|
+
* The returned ID can be used to programatically update a toast.
|
|
65
|
+
*/
|
|
66
|
+
push: (params: ToastParams) => string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
declare function useToast(): ToastContextValue;
|
|
72
|
+
export { Toast, type ToastContextValue, type ToastParams, type ToastProps, ToastProvider, type ToastProviderProps, useToast };
|
|
73
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","names":[],"sources":["../src/core/components/toast/toast.tsx","../src/core/components/toast/toastLayer.tsx","../src/core/components/toast/toastProvider.tsx","../src/core/components/toast/types.ts","../src/core/components/toast/useToast.ts"],"mappings":"AAsBA;;;UAAiB;EACf;EACA,cAAc,MAAM;EACpB;EACA;EACA,QAAQ,MAAM;EACd;EACA;EACA;;;;;;;;;iBAqBc,MACd,OAAO,aACL,KACE,MAAM,UAAU,oHAUnB,MAAM,IAAI;;;;UCxDI;EACf,UAAU,MAAM;EAChB;EACA;EACA;EACA;;;;;UCQe,2BAA2B,KAAK;EAC/C,WAAW,MAAM;EACjB;;;;;iBAMc,cAAc,OAAO,qBAAqB,MAAM,IAAI;;;;UC1BnD;EACf;EACA,cAAc,MAAM;EACpB;EACA;EACA;EACA,QAAQ,MAAM;EACd;;;;;UAMe;EACf;;;;;;;EAOA,OAAO,QAAQ;;;;;iBCfD,YAAY"}
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
|
|
3
|
+
import { d as createGlobalScopedContext, i as usePrefersReducedMotion, n as LayerProvider, r as isRecord, s as Card, t as useLayer, y as Box } from "./useLayer-9Pz-GG0r.js";
|
|
4
|
+
import { t as Flex } from "./flex-BYRpBTOc.js";
|
|
5
|
+
import { n as Text, t as Stack } from "./stack-C5WV-BRh.js";
|
|
6
|
+
import { t as Button } from "./button-BDLRd1Rr.js";
|
|
7
|
+
import { t as Grid } from "./grid-D88j-N7f.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { startTransition, useContext, useState, useSyncExternalStore } from "react";
|
|
10
|
+
import { styled } from "styled-components";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { AnimatePresence, motion, stagger } from "motion/react";
|
|
13
|
+
import { CloseIcon } from "@sanity/icons/Close";
|
|
14
|
+
const STATUS_CARD_TONE = {
|
|
15
|
+
error: "critical",
|
|
16
|
+
warning: "caution",
|
|
17
|
+
success: "positive",
|
|
18
|
+
info: "neutral"
|
|
19
|
+
}, BUTTON_TONE = {
|
|
20
|
+
error: "critical",
|
|
21
|
+
warning: "caution",
|
|
22
|
+
success: "positive",
|
|
23
|
+
info: "neutral"
|
|
24
|
+
}, TextBox = styled(Flex).withConfig({
|
|
25
|
+
displayName: "TextBox",
|
|
26
|
+
componentId: "sc-xd2ehd-0"
|
|
27
|
+
})`overflow-x:auto;`, StyledToast = styled(Card).withConfig({
|
|
28
|
+
displayName: "StyledToast",
|
|
29
|
+
componentId: "sc-xd2ehd-1"
|
|
30
|
+
})`pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(${2}px / 2);}`, LoadingBar = styled.div.withConfig({
|
|
31
|
+
displayName: "LoadingBar",
|
|
32
|
+
componentId: "sc-xd2ehd-2"
|
|
33
|
+
})`display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;`, LoadingBarMask = styled(Card).withConfig({
|
|
34
|
+
displayName: "LoadingBarMask",
|
|
35
|
+
componentId: "sc-xd2ehd-3"
|
|
36
|
+
})`position:absolute;top:0;left:-${2}px;right:-${2}px;bottom:${2}px;z-index:1;`, LoadingBarProgress = styled(Card).withConfig({
|
|
37
|
+
displayName: "LoadingBarProgress",
|
|
38
|
+
componentId: "sc-xd2ehd-4"
|
|
39
|
+
})`display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:${(props) => {
|
|
40
|
+
let { color } = getTheme_v2(props.theme);
|
|
41
|
+
return color.button.default[props.tone].enabled.bg;
|
|
42
|
+
}};`, ROLES = {
|
|
43
|
+
error: "alert",
|
|
44
|
+
warning: "alert",
|
|
45
|
+
success: "alert",
|
|
46
|
+
info: "alert"
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The `Toast` component gives feedback to users when an action has taken place.
|
|
50
|
+
*
|
|
51
|
+
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
function Toast(props) {
|
|
56
|
+
let $ = c(50), closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
|
|
57
|
+
$[0] === props ? (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]) : ({closable, description, duration, onClose, radius: t0, title, status, updatedAt, ...restProps} = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt);
|
|
58
|
+
let radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : .26, t1;
|
|
59
|
+
$[10] === visualDuration ? t1 = $[11] : (t1 = visualDuration ? {
|
|
60
|
+
type: "spring",
|
|
61
|
+
visualDuration,
|
|
62
|
+
bounce: .25
|
|
63
|
+
} : { duration: 0 }, $[10] = visualDuration, $[11] = t1);
|
|
64
|
+
let transition = t1, hasDuration = duration && isFinite(duration) && duration < 20736e5, t2;
|
|
65
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
|
|
66
|
+
let initial = t2, t3;
|
|
67
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
|
|
68
|
+
let animate = t3, t4;
|
|
69
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
|
|
70
|
+
let exit = t4, t5 = hasDuration ? "" : void 0, t6;
|
|
71
|
+
$[15] === title ? t6 = $[16] : (t6 = title && /* @__PURE__ */ jsx(Text, {
|
|
72
|
+
size: 1,
|
|
73
|
+
weight: "medium",
|
|
74
|
+
children: title
|
|
75
|
+
}), $[15] = title, $[16] = t6);
|
|
76
|
+
let t7;
|
|
77
|
+
$[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */ jsx(MotionText, {
|
|
78
|
+
muted: !0,
|
|
79
|
+
size: 1,
|
|
80
|
+
variants: content,
|
|
81
|
+
transition,
|
|
82
|
+
children: description
|
|
83
|
+
}), $[17] = description, $[18] = transition, $[19] = t7) : t7 = $[19];
|
|
84
|
+
let t8;
|
|
85
|
+
$[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */ jsx(TextBox, {
|
|
86
|
+
flex: 1,
|
|
87
|
+
padding: 3,
|
|
88
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
89
|
+
gap: 3,
|
|
90
|
+
children: [t6, t7]
|
|
91
|
+
})
|
|
92
|
+
}), $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22];
|
|
93
|
+
let t9;
|
|
94
|
+
$[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */ jsx(Box, {
|
|
95
|
+
padding: 1,
|
|
96
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
97
|
+
as: "button",
|
|
98
|
+
icon: CloseIcon,
|
|
99
|
+
mode: "bleed",
|
|
100
|
+
padding: 2,
|
|
101
|
+
tone: buttonTone,
|
|
102
|
+
onClick: onClose,
|
|
103
|
+
style: { verticalAlign: "top" }
|
|
104
|
+
})
|
|
105
|
+
}), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t9) : t9 = $[26];
|
|
106
|
+
let t10;
|
|
107
|
+
$[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */ jsxs(MotionFlex, {
|
|
108
|
+
align: "flex-start",
|
|
109
|
+
variants: content,
|
|
110
|
+
transition,
|
|
111
|
+
children: [t8, t9]
|
|
112
|
+
}), $[27] = t8, $[28] = t9, $[29] = transition, $[30] = t10) : t10 = $[30];
|
|
113
|
+
let t11;
|
|
114
|
+
$[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */ jsxs(MotionLoadingBar, {
|
|
115
|
+
variants: content,
|
|
116
|
+
transition,
|
|
117
|
+
children: [/* @__PURE__ */ jsx(LoadingBarMask, {
|
|
118
|
+
tone: cardTone,
|
|
119
|
+
radius
|
|
120
|
+
}), /* @__PURE__ */ jsx(MotionLoadingBarProgress, {
|
|
121
|
+
tone: cardTone,
|
|
122
|
+
initial: { scaleX: 0 },
|
|
123
|
+
animate: { scaleX: 1 },
|
|
124
|
+
transition: {
|
|
125
|
+
delay: visualDuration,
|
|
126
|
+
duration: duration / 1e3,
|
|
127
|
+
ease: "linear"
|
|
128
|
+
},
|
|
129
|
+
onAnimationComplete: onClose
|
|
130
|
+
}, `progress-${updatedAt}`)]
|
|
131
|
+
}), $[31] = cardTone, $[32] = duration, $[33] = hasDuration, $[34] = onClose, $[35] = radius, $[36] = transition, $[37] = updatedAt, $[38] = visualDuration, $[39] = t11) : t11 = $[39];
|
|
132
|
+
let t12;
|
|
133
|
+
return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */ jsxs(MotionToast, {
|
|
134
|
+
"data-ui": "Toast",
|
|
135
|
+
role,
|
|
136
|
+
...restProps,
|
|
137
|
+
"data-has-duration": t5,
|
|
138
|
+
custom: visualDuration,
|
|
139
|
+
radius,
|
|
140
|
+
shadow: 2,
|
|
141
|
+
tone: cardTone,
|
|
142
|
+
forwardedAs: "li",
|
|
143
|
+
layout: "position",
|
|
144
|
+
variants: container,
|
|
145
|
+
initial,
|
|
146
|
+
animate,
|
|
147
|
+
exit,
|
|
148
|
+
transition,
|
|
149
|
+
children: [t10, t11]
|
|
150
|
+
}), $[40] = cardTone, $[41] = radius, $[42] = restProps, $[43] = role, $[44] = t10, $[45] = t11, $[46] = t5, $[47] = transition, $[48] = visualDuration, $[49] = t12) : t12 = $[49], t12;
|
|
151
|
+
}
|
|
152
|
+
const container = {
|
|
153
|
+
initial: {
|
|
154
|
+
y: 32,
|
|
155
|
+
scale: .5,
|
|
156
|
+
zIndex: 1
|
|
157
|
+
},
|
|
158
|
+
hidden: { opacity: 0 },
|
|
159
|
+
visible: (visualDuration) => visualDuration ? {
|
|
160
|
+
opacity: 1,
|
|
161
|
+
transition: {
|
|
162
|
+
when: "beforeChildren",
|
|
163
|
+
delayChildren: stagger(visualDuration / 3),
|
|
164
|
+
duration: visualDuration / 3
|
|
165
|
+
}
|
|
166
|
+
} : { opacity: 1 },
|
|
167
|
+
slideIn: {
|
|
168
|
+
y: 0,
|
|
169
|
+
scale: 1
|
|
170
|
+
},
|
|
171
|
+
slideOut: {
|
|
172
|
+
zIndex: 0,
|
|
173
|
+
scale: .75
|
|
174
|
+
}
|
|
175
|
+
}, content = {
|
|
176
|
+
initial: { willChange: "transform" },
|
|
177
|
+
hidden: { opacity: 0 },
|
|
178
|
+
visible: { opacity: 1 }
|
|
179
|
+
}, MotionToast = motion.create(StyledToast), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionLoadingBar = motion.create(LoadingBar), MotionLoadingBarProgress = motion.create(LoadingBarProgress);
|
|
180
|
+
/**
|
|
181
|
+
* Some components should only render after mounting to the DOM, and not be rendered at all during SSR renderToString or equivalent.
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
function useMounted() {
|
|
185
|
+
return useSyncExternalStore(subscribe, _temp$1, _temp2);
|
|
186
|
+
}
|
|
187
|
+
function _temp2() {
|
|
188
|
+
return !1;
|
|
189
|
+
}
|
|
190
|
+
function _temp$1() {
|
|
191
|
+
return !0;
|
|
192
|
+
}
|
|
193
|
+
const subscribe = () => () => {}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
|
|
194
|
+
/**
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
function ToastLayer(props) {
|
|
198
|
+
let $ = c(9), { children, padding: t0, paddingX, paddingY, gap: t1 } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, { zIndex } = useLayer(), t2;
|
|
199
|
+
$[0] === zIndex ? t2 = $[1] : (t2 = { zIndex }, $[0] = zIndex, $[1] = t2);
|
|
200
|
+
let t3;
|
|
201
|
+
return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledLayer, {
|
|
202
|
+
forwardedAs: "ul",
|
|
203
|
+
"data-ui": "ToastProvider",
|
|
204
|
+
padding,
|
|
205
|
+
paddingX,
|
|
206
|
+
paddingY,
|
|
207
|
+
gap,
|
|
208
|
+
gridTemplateColumns: 1,
|
|
209
|
+
style: t2,
|
|
210
|
+
children
|
|
211
|
+
}), $[2] = children, $[3] = gap, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
|
|
212
|
+
}
|
|
213
|
+
const StyledLayer = styled(Grid).withConfig({
|
|
214
|
+
displayName: "StyledLayer",
|
|
215
|
+
componentId: "sc-kxgg1x-0"
|
|
216
|
+
})`box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;`;
|
|
217
|
+
let toastId = 0;
|
|
218
|
+
/** @internal */
|
|
219
|
+
function generateToastId() {
|
|
220
|
+
return String(toastId++);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
function ToastProvider(props) {
|
|
226
|
+
let $ = c(13), { children, padding, paddingX, paddingY, gap, zOffset: t0 } = props, zOffset = t0 === void 0 ? 1 : t0, t1;
|
|
227
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
228
|
+
let [state, setState] = useState(t1), mounted = useMounted(), t2;
|
|
229
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
230
|
+
let push = (params) => {
|
|
231
|
+
let id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
232
|
+
return startTransition(() => {
|
|
233
|
+
setState((prevState) => {
|
|
234
|
+
if (duration === .01) return prevState.filter((toast) => toast.id !== id);
|
|
235
|
+
let dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
|
|
236
|
+
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
237
|
+
dismiss,
|
|
238
|
+
id,
|
|
239
|
+
updatedAt: Date.now(),
|
|
240
|
+
params: {
|
|
241
|
+
...params,
|
|
242
|
+
duration
|
|
243
|
+
}
|
|
244
|
+
}];
|
|
245
|
+
});
|
|
246
|
+
}), id;
|
|
247
|
+
};
|
|
248
|
+
t2 = {
|
|
249
|
+
version: 0,
|
|
250
|
+
push
|
|
251
|
+
}, $[1] = t2;
|
|
252
|
+
} else t2 = $[1];
|
|
253
|
+
let value = t2, t3;
|
|
254
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsx(LayerProvider, {
|
|
255
|
+
zOffset,
|
|
256
|
+
children: /* @__PURE__ */ jsx(ToastLayer, {
|
|
257
|
+
padding,
|
|
258
|
+
paddingX,
|
|
259
|
+
paddingY,
|
|
260
|
+
gap,
|
|
261
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
262
|
+
initial: !1,
|
|
263
|
+
mode: "popLayout",
|
|
264
|
+
children: state.map(_temp)
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
}), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
|
|
268
|
+
let t4;
|
|
269
|
+
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext.Provider, {
|
|
270
|
+
value,
|
|
271
|
+
children: [children, t3]
|
|
272
|
+
}), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
273
|
+
}
|
|
274
|
+
function _temp(t0) {
|
|
275
|
+
let { dismiss: dismiss_0, id: id_0, params: params_0, updatedAt } = t0;
|
|
276
|
+
return /* @__PURE__ */ jsx(Toast, {
|
|
277
|
+
closable: params_0.closable,
|
|
278
|
+
description: params_0.description,
|
|
279
|
+
onClose: dismiss_0,
|
|
280
|
+
status: params_0.status,
|
|
281
|
+
title: params_0.title,
|
|
282
|
+
duration: params_0.duration,
|
|
283
|
+
updatedAt
|
|
284
|
+
}, id_0);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* @public
|
|
288
|
+
*/
|
|
289
|
+
function useToast() {
|
|
290
|
+
let value = useContext(ToastContext);
|
|
291
|
+
if (!value) throw Error("useToast(): missing context value");
|
|
292
|
+
if (!isRecord(value) || value.version !== 0) throw Error("useToast(): the context value is not compatible");
|
|
293
|
+
return value;
|
|
294
|
+
}
|
|
295
|
+
export { Toast, ToastProvider, useToast };
|
|
296
|
+
|
|
297
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","names":["styled","ThemeColorStateToneKey","getTheme_v2","Card","CardProps","Flex","ButtonTone","LOADING_BAR_HEIGHT","STATUS_CARD_TONE","error","warning","success","info","key","BUTTON_TONE","TextBox","StyledToast","LoadingBar","div","LoadingBarMask","LoadingBarProgressProps","Omit","tone","LoadingBarProgress","React","ComponentType","props","color","theme","button","default","enabled","bg","CloseIcon","motion","stagger","Variant","Variants","usePrefersReducedMotion","Box","Button","Flex","Stack","Text","BUTTON_TONE","LoadingBar","LoadingBarMask","LoadingBarProgress","STATUS_CARD_TONE","StyledToast","TextBox","ToastProps","closable","description","React","ReactNode","onClose","radius","title","status","duration","updatedAt","ROLES","error","warning","success","info","const","LONG_ENOUGH_BUT_NOT_TOO_LONG","Toast","props","$","_c","restProps","t0","undefined","cardTone","buttonTone","role","prefersReducedMotion","visualDuration","t1","type","bounce","transition","hasDuration","isFinite","t2","Symbol","for","initial","t3","animate","t4","exit","t5","t6","t7","content","t8","t9","verticalAlign","t10","t11","scaleX","delay","ease","t12","container","y","scale","zIndex","hidden","opacity","visible","when","delayChildren","slideIn","slideOut","ContainerVariants","willChange","Partial","Record","MotionToast","create","MotionFlex","MotionText","MotionLoadingBar","MotionLoadingBarProgress","useSyncExternalStore","useMounted","subscribe","_temp","_temp2","createGlobalScopedContext","ToastContextValue","ToastContext","styled","Grid","useLayer","ToastLayerProps","children","React","ReactNode","padding","paddingX","paddingY","gap","ToastLayer","props","$","_c","t0","t1","undefined","zIndex","t2","t3","StyledLayer","toastId","generateToastId","String","AnimatePresence","startTransition","useMemo","useState","useMounted","LayerProvider","Toast","ToastContext","ToastLayer","ToastLayerProps","generateToastId","ToastContextValue","ToastParams","ToastState","dismiss","id","updatedAt","params","ToastProviderProps","Omit","children","React","ReactNode","zOffset","ToastProvider","props","$","_c","padding","paddingX","paddingY","gap","t0","undefined","t1","Symbol","for","state","setState","mounted","t2","push","duration","prevState","filter","toast","currentState","toast_0","toast_1","Date","now","version","value","t3","map","_temp","t4","dismiss_0","id_0","params_0","closable","description","status","title","useContext","isRecord","ToastContext","ToastContextValue","useToast","value","Error","version"],"sources":["../src/core/components/toast/styles.ts","../src/core/components/toast/toast.tsx","../src/core/hooks/useMounted.ts","../src/core/components/toast/toastContext.ts","../src/core/components/toast/toastLayer.tsx","../src/core/components/toast/toastState.ts","../src/core/components/toast/toastProvider.tsx","../src/core/components/toast/useToast.ts"],"sourcesContent":["import {styled} from 'styled-components'\n\nimport {ThemeColorStateToneKey} from '../../../theme/system/color/_system'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {Card, type CardProps} from '../../primitives/card/card'\nimport {Flex} from '../../primitives/flex/flex'\nimport type {ButtonTone} from '../../types/button'\n\nconst LOADING_BAR_HEIGHT = 2\n\nexport const STATUS_CARD_TONE = {\n error: 'critical',\n warning: 'caution',\n success: 'positive',\n info: 'neutral',\n} satisfies {[key: string]: ThemeColorStateToneKey}\n\nexport const BUTTON_TONE = {\n error: 'critical',\n warning: 'caution',\n success: 'positive',\n info: 'neutral',\n} satisfies {[key: string]: ButtonTone}\n\nexport const TextBox = styled(Flex)`\n overflow-x: auto;\n`\n\nexport const StyledToast = styled(Card)`\n pointer-events: all;\n width: 100%;\n position: relative;\n overflow: hidden;\n overflow: clip;\n\n &[data-has-duration] {\n padding-bottom: calc(${LOADING_BAR_HEIGHT}px / 2);\n }\n`\n\nexport const LoadingBar = styled.div`\n display: flex;\n position: absolute;\n bottom: 0px;\n top: 0px;\n left: 0px;\n right: 0px;\n pointer-events: none;\n z-index: -1;\n overflow: hidden;\n overflow: clip;\n background: transparent;\n align-items: flex-end;\n will-change: opacity;\n`\n\nexport const LoadingBarMask = styled(Card)`\n position: absolute;\n top: 0;\n left: -${LOADING_BAR_HEIGHT}px;\n right: -${LOADING_BAR_HEIGHT}px;\n bottom: ${LOADING_BAR_HEIGHT}px;\n z-index: 1;\n`\n\ntype LoadingBarProgressProps = Omit<CardProps, 'tone'> & {\n tone: ThemeColorStateToneKey\n}\nexport const LoadingBarProgress = styled<React.ComponentType<LoadingBarProgressProps>>(Card)`\n display: block;\n height: 100%;\n width: 100%;\n transform-origin: 0% 50%;\n background-color: ${(props) => {\n const {color} = getTheme_v2(props.theme)\n\n return color.button.default[props.tone].enabled.bg\n }};\n`\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {motion, stagger, type Variant, type Variants} from 'motion/react'\n\nimport {usePrefersReducedMotion} from '../../hooks/usePrefersReducedMotion'\nimport {Box} from '../../primitives/box/box'\nimport {Button} from '../../primitives/button/button'\nimport {Flex} from '../../primitives/flex/flex'\nimport {Stack} from '../../primitives/stack/stack'\nimport {Text} from '../../primitives/text/text'\nimport {\n BUTTON_TONE,\n LoadingBar,\n LoadingBarMask,\n LoadingBarProgress,\n STATUS_CARD_TONE,\n StyledToast,\n TextBox,\n} from './styles'\n\n/**\n * @public\n */\nexport interface ToastProps {\n closable?: boolean\n description?: React.ReactNode\n onClose: () => void\n radius?: number | number[]\n title?: React.ReactNode\n status?: 'error' | 'warning' | 'success' | 'info'\n duration?: number\n updatedAt?: number\n}\n\nconst ROLES = {\n error: 'alert',\n warning: 'alert',\n success: 'alert',\n info: 'alert',\n} as const\n\n// Support pattern used by Sanity Studio, that works around the lack of `duration: Infinity` support in older @sanity/ui versions\n// https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value\nconst LONG_ENOUGH_BUT_NOT_TOO_LONG = 1000 * 60 * 60 * 24 * 24\n\n/**\n * The `Toast` component gives feedback to users when an action has taken place.\n *\n * Toasts can be closed with a close button, or auto-dismiss after a certain timeout.\n *\n * @public\n */\nexport function Toast(\n props: ToastProps &\n Omit<\n React.HTMLProps<HTMLDivElement>,\n | 'as'\n | 'height'\n | 'ref'\n | 'title'\n | 'onAnimationStart'\n | 'onDragStart'\n | 'onDragEnd'\n | 'onDrag'\n >,\n): React.JSX.Element {\n const {\n closable,\n description,\n duration,\n onClose,\n radius = 3,\n title,\n status,\n updatedAt,\n ...restProps\n } = props\n const cardTone = status ? STATUS_CARD_TONE[status] : 'default'\n const buttonTone = status ? BUTTON_TONE[status] : 'default'\n const role = status ? ROLES[status] : 'status'\n\n const prefersReducedMotion = usePrefersReducedMotion()\n\n const visualDuration: number = prefersReducedMotion ? 0 : 0.26\n const transition = visualDuration\n ? {type: 'spring' as const, visualDuration, bounce: 0.25}\n : {duration: 0}\n\n const hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG\n const initial: ContainerVariants[] = ['hidden', 'initial']\n const animate: ContainerVariants[] = ['visible', 'slideIn']\n const exit: ContainerVariants[] = ['hidden', 'slideOut']\n\n return (\n <MotionToast\n data-ui=\"Toast\"\n role={role}\n {...restProps}\n data-has-duration={hasDuration ? '' : undefined}\n custom={visualDuration}\n radius={radius}\n shadow={2}\n tone={cardTone}\n forwardedAs=\"li\"\n layout=\"position\"\n variants={container}\n initial={initial}\n animate={animate}\n exit={exit}\n transition={transition}\n >\n <MotionFlex align=\"flex-start\" variants={content} transition={transition}>\n <TextBox flex={1} padding={3}>\n <Stack gap={3}>\n {title && (\n <Text size={1} weight=\"medium\">\n {title}\n </Text>\n )}\n {description && (\n <MotionText muted size={1} variants={content} transition={transition}>\n {description}\n </MotionText>\n )}\n </Stack>\n </TextBox>\n\n {closable && (\n <Box padding={1}>\n <Button\n as=\"button\"\n icon={CloseIcon}\n mode=\"bleed\"\n padding={2}\n tone={buttonTone}\n onClick={onClose}\n style={{verticalAlign: 'top'}}\n />\n </Box>\n )}\n </MotionFlex>\n {hasDuration && (\n <MotionLoadingBar variants={content} transition={transition}>\n <LoadingBarMask tone={cardTone} radius={radius} />\n <MotionLoadingBarProgress\n key={`progress-${updatedAt}`}\n tone={cardTone}\n initial={{scaleX: 0}}\n animate={{scaleX: 1}}\n transition={{delay: visualDuration, duration: duration / 1_000, ease: 'linear'}}\n onAnimationComplete={onClose}\n />\n </MotionLoadingBar>\n )}\n </MotionToast>\n )\n}\n\nconst container = {\n initial: {y: 32, scale: 0.5, zIndex: 1},\n hidden: {opacity: 0},\n visible: (visualDuration: number) => {\n if (!visualDuration) return {opacity: 1}\n\n return {\n opacity: 1,\n transition: {\n when: 'beforeChildren',\n delayChildren: stagger(visualDuration / 3),\n duration: visualDuration / 3,\n },\n }\n },\n slideIn: {\n y: 0,\n scale: 1,\n },\n slideOut: {\n zIndex: 0,\n scale: 0.75,\n },\n} satisfies Variants\ntype ContainerVariants = keyof typeof container\n\nconst content = {\n initial: {\n willChange: 'transform',\n },\n hidden: {\n opacity: 0,\n },\n visible: {\n opacity: 1,\n },\n} satisfies Partial<Record<ContainerVariants, Variant>>\n\nconst MotionToast = motion.create(StyledToast)\nconst MotionFlex = motion.create(Flex)\nconst MotionText = motion.create(Text)\nconst MotionLoadingBar = motion.create(LoadingBar)\nconst MotionLoadingBarProgress = motion.create(LoadingBarProgress)\n","import {useSyncExternalStore} from 'react'\n\n/**\n * Some components should only render after mounting to the DOM, and not be rendered at all during SSR renderToString or equivalent.\n * @public\n */\nexport function useMounted(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n}\n\nconst subscribe = () => () => {}\n","import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'\nimport {ToastContextValue} from './types'\n\nexport const ToastContext = createGlobalScopedContext<ToastContextValue | null>(\n '@sanity/ui/context/toast',\n null,\n)\n","import {styled} from 'styled-components'\n\nimport {Grid} from '../../primitives/grid/grid'\nimport {useLayer} from '../../utils/layer/useLayer'\n\n/**\n * @public\n */\nexport interface ToastLayerProps {\n children: React.ReactNode\n padding?: number | number[]\n paddingX?: number | number[]\n paddingY?: number | number[]\n gap?: number | number[]\n}\n\n/**\n * @internal\n */\nexport function ToastLayer(props: ToastLayerProps): React.JSX.Element {\n const {children, padding = 4, paddingX, paddingY, gap = 3} = props\n const {zIndex} = useLayer()\n\n return (\n <StyledLayer\n forwardedAs=\"ul\"\n data-ui=\"ToastProvider\"\n padding={padding}\n paddingX={paddingX}\n paddingY={paddingY}\n gap={gap}\n gridTemplateColumns={1}\n style={{zIndex}}\n >\n {children}\n </StyledLayer>\n )\n}\n\nconst StyledLayer = styled(Grid)`\n box-sizing: border-box;\n position: fixed;\n right: 0;\n bottom: 0;\n list-style: none;\n pointer-events: none;\n max-width: 420px;\n width: 100%;\n`\n","let toastId = 0\n\n/** @internal */\nexport function generateToastId(): string {\n return String(toastId++)\n}\n","import {AnimatePresence} from 'motion/react'\nimport {startTransition, useMemo, useState} from 'react'\n\nimport {useMounted} from '../../hooks/useMounted'\nimport {LayerProvider} from '../../utils/layer/layerProvider'\nimport {Toast} from './toast'\nimport {ToastContext} from './toastContext'\nimport {ToastLayer, type ToastLayerProps} from './toastLayer'\nimport {generateToastId} from './toastState'\nimport {ToastContextValue, ToastParams} from './types'\n\ntype ToastState = {\n dismiss: () => void\n id: string\n updatedAt: number\n params: ToastParams\n}[]\n\n/**\n * @public\n */\nexport interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {\n children?: React.ReactNode\n zOffset?: number | number[]\n}\n\n/**\n * @public\n */\nexport function ToastProvider(props: ToastProviderProps): React.JSX.Element {\n const {children, padding, paddingX, paddingY, gap, zOffset = 1} = props\n const [state, setState] = useState<ToastState>([])\n const mounted = useMounted()\n\n const value: ToastContextValue = useMemo(() => {\n const push = (params: ToastParams) => {\n const id = params.id || generateToastId()\n const duration = params.duration || 5000\n\n startTransition(() => {\n setState((prevState): ToastState => {\n /**\n * Backwards compatibility for `sanity` patterns workaround a lack of programatically dismissible toasts.\n * It uses a super short duration that closes the toast immediately in previous versions of `@sanity/ui`.\n * We interpret this as a request to dismiss the toast immediately, and remove it from the state right away.\n * Even once we support programatic dismissal we'll need to keep this for backwards compatibility with v2 and v1.\n */\n if (duration === 0.01) {\n return prevState.filter((toast) => toast.id !== id)\n }\n\n /**\n * Creates a function to dismiss this specific toast.\n * This function will be passed to the Toast component\n * and called either on close button click or after duration.\n */\n const dismiss = () =>\n startTransition(() =>\n setState((currentState) => currentState.filter((toast) => toast.id !== id)),\n )\n\n /**\n * Create updated state by:\n * 1. Removing any existing toast with the same ID (prevents duplicates)\n * 2. Adding the new toast with its dismiss handler\n * 3. Updates the `updatedAt` timestamp, which resets progress bar count downs.\n */\n return [\n ...prevState.filter((toast) => toast.id !== id),\n {\n dismiss,\n id,\n updatedAt: Date.now(),\n params: {...params, duration},\n },\n ]\n })\n })\n\n return id\n }\n\n return {version: 0.0, push}\n }, [])\n\n return (\n <ToastContext.Provider value={value}>\n {children}\n {mounted && (\n <LayerProvider zOffset={zOffset}>\n <ToastLayer padding={padding} paddingX={paddingX} paddingY={paddingY} gap={gap}>\n <AnimatePresence initial={false} mode=\"popLayout\">\n {state.map(({dismiss, id, params, updatedAt}) => (\n <Toast\n key={id}\n closable={params.closable}\n description={params.description}\n onClose={dismiss}\n status={params.status}\n title={params.title}\n duration={params.duration}\n updatedAt={updatedAt}\n />\n ))}\n </AnimatePresence>\n </ToastLayer>\n </LayerProvider>\n )}\n </ToastContext.Provider>\n )\n}\n","import {useContext} from 'react'\n\nimport {isRecord} from '../../lib/isRecord'\nimport {ToastContext} from './toastContext'\nimport {ToastContextValue} from './types'\n\n/**\n * @public\n */\nexport function useToast(): ToastContextValue {\n const value = useContext(ToastContext)\n\n if (!value) {\n throw new Error('useToast(): 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('useToast(): the context value is not compatible')\n }\n\n return value\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,MAEaQ,mBAAmB;CAC9BC,OAAO;CACPC,SAAS;CACTC,SAAS;CACTC,MAAM;AACR,GAEaE,cAAc;CACzBL,OAAO;CACPC,SAAS;CACTC,SAAS;CACTC,MAAM;AACR,GAEaG,UAAUf,OAAOK,IAAI,CAAC,CAAA,WAAA;;;sBAItBW,cAAchB,OAAOG,IAAI,CAAC,CAAA,WAAA;;;AAQZI,CAAAA,CAAAA,0HAAAA,EAAkB,YAIhCU,aAAajB,OAAOkB,IAAAA,WAAAA;;;AAAG,CAAA,CAAA,sMAgBvBC,iBAAiBnB,OAAOG,IAAI,CAAC,CAAA,WAAA;;;AAG/BI,CAAAA,CAAAA,iCAAAA,EAAkB,YACjBA,EAAkB,YAClBA,EAAkB,gBAOjBgB,qBAAqBvB,OAAqDG,IAAI,CAAC,CAAA,WAAA;;;AAKrEuB,CAAAA,CAAAA,kFAAAA,UAAU;CAC7B,IAAM,EAACC,UAASzB,YAAYwB,MAAME,KAAK;CAEvC,OAAOD,MAAME,OAAOC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