@sanity/ui 4.4.12 → 4.4.14
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/{_system-CTe2lb5l.d.ts → _system-DjnSx8gA.d.ts} +1 -1
- package/dist/{_system-CTe2lb5l.d.ts.map → _system-DjnSx8gA.d.ts.map} +1 -1
- package/dist/{arrow-Df43Duu7.js → arrow-BhooatHA.js} +2 -2
- package/dist/{arrow-Df43Duu7.js.map → arrow-BhooatHA.js.map} +1 -1
- package/dist/autocomplete.d.ts +3 -3
- package/dist/autocomplete.js +8 -8
- package/dist/breadcrumbs.js +6 -6
- package/dist/{button-dnqMFkWg.d.ts → button-DJ_N-Z82.d.ts} +5 -5
- package/dist/{button-dnqMFkWg.d.ts.map → button-DJ_N-Z82.d.ts.map} +1 -1
- package/dist/{button-DBWvhK72.js → button-GFefHUiY.js} +8 -8
- package/dist/{button-DBWvhK72.js.map → button-GFefHUiY.js.map} +1 -1
- package/dist/card-CEB9JLru.d.ts +7 -0
- package/dist/card-CEB9JLru.d.ts.map +1 -0
- package/dist/code.d.ts +1 -1
- package/dist/code.js +4 -4
- package/dist/{component-DVlwaWB-.d.ts → component-CWyWF8Ut.d.ts} +1 -1
- package/dist/{component-DVlwaWB-.d.ts.map → component-CWyWF8Ut.d.ts.map} +1 -1
- package/dist/{element-BYgCE_iK.js → element-DIcKo4Jp.js} +1 -1
- package/dist/{element-BYgCE_iK.js.map → element-DIcKo4Jp.js.map} +1 -1
- package/dist/{elementSizeObserver-pevZfdGa.js → elementSizeObserver-CSI5StGC.js} +1 -1
- package/dist/{elementSizeObserver-pevZfdGa.js.map → elementSizeObserver-CSI5StGC.js.map} +1 -1
- package/dist/{factory-BzXTX8_Q.js → factory-D1M0GqJn.js} +3 -3
- package/dist/{factory-BzXTX8_Q.js.map → factory-D1M0GqJn.js.map} +1 -1
- package/dist/{flex-DZLSBZTk.js → flex-DeU6k2uN.js} +4 -4
- package/dist/{flex-DZLSBZTk.js.map → flex-DeU6k2uN.js.map} +1 -1
- package/dist/{font-EtfxKPUz.d.ts → font-DI_tc5s8.d.ts} +1 -1
- package/dist/{font-EtfxKPUz.d.ts.map → font-DI_tc5s8.d.ts.map} +1 -1
- package/dist/{getElementRef-BLVMlHTn.js → getElementRef-5HypX0AT.js} +1 -1
- package/dist/{getElementRef-BLVMlHTn.js.map → getElementRef-5HypX0AT.js.map} +1 -1
- package/dist/{getScopedTheme-C-sZsyAz.js → getScopedTheme-BJoqtbrb.js} +2 -2
- package/dist/{getScopedTheme-C-sZsyAz.js.map → getScopedTheme-BJoqtbrb.js.map} +1 -1
- package/dist/{getTheme_v2-y09KqtEb.js → getTheme_v2-CP5x_AcH.js} +1 -1
- package/dist/{getTheme_v2-y09KqtEb.js.map → getTheme_v2-CP5x_AcH.js.map} +1 -1
- package/dist/{grid-HONPZVbL.js → grid-Bz_gKSjw.js} +4 -4
- package/dist/{grid-HONPZVbL.js.map → grid-Bz_gKSjw.js.map} +1 -1
- package/dist/{helpers-XThPpWje.js → helpers-jp2T-bdR.js} +2 -2
- package/dist/{helpers-XThPpWje.js.map → helpers-jp2T-bdR.js.map} +1 -1
- package/dist/{hotkeys-CQgNwGAf.js → hotkeys-B9h8uliL.js} +5 -5
- package/dist/{hotkeys-CQgNwGAf.js.map → hotkeys-B9h8uliL.js.map} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +19 -19
- package/dist/{layer-CZ8G9TS5.js → layer-Bl7rtdZ_.js} +4 -4
- package/dist/{layer-CZ8G9TS5.js.map → layer-Bl7rtdZ_.js.map} +1 -1
- package/dist/{layer-ChlP9Ik6.d.ts → layer-CAyooswI.d.ts} +1 -1
- package/dist/{layer-ChlP9Ik6.d.ts.map → layer-CAyooswI.d.ts.map} +1 -1
- package/dist/menu.d.ts +4 -4
- package/dist/menu.js +12 -12
- package/dist/{popover-sE-Xd89W.js → popover-C-YWzo_l.js} +9 -9
- package/dist/{popover-sE-Xd89W.js.map → popover-C-YWzo_l.js.map} +1 -1
- package/dist/{popover-fmTtK69w.d.ts → popover-DpHuX7yr.d.ts} +4 -4
- package/dist/{popover-fmTtK69w.d.ts.map → popover-DpHuX7yr.d.ts.map} +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/{refractor-CC48DwHi.js → refractor-DeAFUFLp.js} +2 -2
- package/dist/{refractor-CC48DwHi.js.map → refractor-DeAFUFLp.js.map} +1 -1
- package/dist/{responsiveFont-DJ-TUdSl.js → responsiveFont-CfFXLc7o.js} +3 -3
- package/dist/{responsiveFont-DJ-TUdSl.js.map → responsiveFont-CfFXLc7o.js.map} +1 -1
- package/dist/{rgba-BSYaEUW6.d.ts → rgba-Hlu7P1jF.d.ts} +3 -3
- package/dist/{rgba-BSYaEUW6.d.ts.map → rgba-Hlu7P1jF.d.ts.map} +1 -1
- package/dist/selectable-2IHh9SLq.d.ts +7 -0
- package/dist/selectable-2IHh9SLq.d.ts.map +1 -0
- package/dist/{stack-DFSqrIj4.js → stack-DFRXALVU.js} +5 -5
- package/dist/{stack-DFSqrIj4.js.map → stack-DFRXALVU.js.map} +1 -1
- package/dist/{textInput-CUhBHHFK.js → textInput-cMQvSl5n.js} +7 -7
- package/dist/{textInput-CUhBHHFK.js.map → textInput-cMQvSl5n.js.map} +1 -1
- package/dist/theme.d.ts +3 -3
- package/dist/theme.js +3 -3
- package/dist/toast.js +8 -8
- package/dist/tooltip.d.ts +2 -2
- package/dist/tooltip.js +7 -7
- package/dist/{useClickOutsideEvent-CC1zgOmv.js → useClickOutsideEvent-C-9cvlOu.js} +2 -2
- package/dist/{useClickOutsideEvent-CC1zgOmv.js.map → useClickOutsideEvent-C-9cvlOu.js.map} +1 -1
- package/dist/{useLayer-CKA2DU8j.js → useLayer-DiYnwQ5T.js} +4 -4
- package/dist/{useLayer-CKA2DU8j.js.map → useLayer-DiYnwQ5T.js.map} +1 -1
- package/package.json +17 -17
- package/dist/card-C0a0wQTc.d.ts +0 -7
- package/dist/card-C0a0wQTc.d.ts.map +0 -1
- package/dist/selectable-B0GUIL74.d.ts +0 -7
- package/dist/selectable-B0GUIL74.d.ts.map +0 -1
package/dist/popover.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { t as Popover } from "./popover-
|
|
2
|
+
export { t as Popover } from "./popover-C-YWzo_l.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from "react/compiler-runtime";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
2
|
import { Refractor, hasLanguage } from "react-refractor";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
function LazyRefractor(props) {
|
|
5
5
|
let $ = c(13), { language: languageProp, value } = props, language = typeof languageProp == "string" ? languageProp : void 0, t0;
|
|
6
6
|
$[0] === language ? t0 = $[1] : (t0 = language ? hasLanguage(language) : !1, $[0] = language, $[1] = t0);
|
|
@@ -17,4 +17,4 @@ function LazyRefractor(props) {
|
|
|
17
17
|
}
|
|
18
18
|
export { LazyRefractor as default };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=refractor-
|
|
20
|
+
//# sourceMappingURL=refractor-DeAFUFLp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refractor-
|
|
1
|
+
{"version":3,"file":"refractor-DeAFUFLp.js","names":["language ? hasLanguage(language as any) : false","!(language && registered) && <code>{value}</code>","language && registered && <Refractor inline language={language} value={String(value)} />","<>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>","_jsx"],"sources":["../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";;;AAEA,SAAwB,cACtB,OAGA;C,eACM,EAAC,UAAU,cAAc,UAAS,OAClC,WAAW,OAAO,gBAAiB,WAAW,eAAe,KAAA,GAEhDA;C,iCAAW,KAAA,WAAA,YAAY,QAAe,IAAI,IAA1C,EAAA,KAAA,U;CAAnB,IAAM,aAAaA,IAIdC;CAAE,EAAA,OAAA,YAAA,EAAA,OAAY,cAAA,EAAA,OAAsB,SAApCA,KAAAA,EAAE,YAAY,eAAeG,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA,GAA9C,EAAA,KAAA,UAAY,EAAA,KAAA,YAAsB,EAAA,KAAA,O;CAEpCF,IAAAA;CAAY,EAAA,OAAA,YAAA,EAAA,OAAA,cAAA,EAAA,OAAkE,SAA9EA,KAAAA,YAAY,cAAcE,oBAAC,WAAD;EAAW,QAAA;EAAiB;EAAU,OAAO,OAAO,KAAK;CAAI,CAAA,GAAvF,EAAA,KAAA,UAAY,EAAA,KAAA,YAAkE,EAAA,KAAA,O;CAHjFD,IAAAA;CADF,OAEKF,EAAAA,QAAAA,MAAAA,EAAAA,QAEAC,MAHHC,KAAAA,qBAAAA,UAAAA,EAAAA,UAAAA,CACGF,IAEAC,EACD,EAAA,CAAA,GAHCD,EAAAA,MAAAA,IAEAC,EAAAA,MAAAA,I,0BAHHC;AAMJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getTheme_v2 } from "./getTheme_v2-
|
|
2
|
-
import { a as _ruleSet, i as _responsive, o as rem } from "./helpers-
|
|
1
|
+
import { t as getTheme_v2 } from "./getTheme_v2-CP5x_AcH.js";
|
|
2
|
+
import { a as _ruleSet, i as _responsive, o as rem } from "./helpers-jp2T-bdR.js";
|
|
3
3
|
const FONT_BOX_STYLE = {
|
|
4
4
|
padding: "1px 0",
|
|
5
5
|
margin: 0,
|
|
@@ -78,4 +78,4 @@ function fontSize(size) {
|
|
|
78
78
|
}
|
|
79
79
|
export { responsiveFont as i, _fontWeight as n, _responsiveFontSize as r, _fontBase as t };
|
|
80
80
|
|
|
81
|
-
//# sourceMappingURL=responsiveFont-
|
|
81
|
+
//# sourceMappingURL=responsiveFont-CfFXLc7o.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsiveFont-
|
|
1
|
+
{"version":3,"file":"responsiveFont-CfFXLc7o.js","names":["\"padding\"","\"margin\"","\"fontSize\"","\"lineHeight\"","\"letterSpacing\"","\"transform\""],"sources":["../src/core/styles/font/responsiveFont.ts"],"sourcesContent":["import {CSSObject} from '../../../theme/system/css'\nimport {ThemeFontKey, ThemeFontSize} from '../../../theme/system/font'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, _ruleSet, rem} from '../helpers'\nimport {ThemeProps} from '../types'\nimport {FontWeightStyleProps, ResponsiveFontSizeStyleProps} from './types'\n\nconst FONT_BOX_STYLE: CSSObject = {\n 'padding': '1px 0',\n 'margin': 0,\n\n '&:before': {\n content: '\"\"',\n display: 'block',\n height: 0,\n },\n\n '&:after': {\n content: '\"\"',\n display: 'block',\n height: 0,\n },\n\n '& > code, & > span': {\n display: 'block',\n },\n\n '&:not([hidden])': {\n display: 'block',\n },\n}\n\n/**\n * A utility function getting responsive font styles.\n * @internal\n */\nexport function responsiveFont(\n fontKey: ThemeFontKey,\n props: FontWeightStyleProps & ResponsiveFontSizeStyleProps & ThemeProps,\n): CSSObject[] {\n const {$size} = props\n const base = {..._fontBase(fontKey, props), ..._fontWeight(fontKey, props)}\n\n // @TODO fix the real condition that is causing $size to be undefined sometimes\n if (!$size) {\n // @ts-expect-error: `warned` isn't typed, the underlying issue should be solved rather than typing it\n if (!responsiveFont.warned) {\n console.warn('No size specified for responsive font', {fontKey, $size, props, base})\n // @ts-expect-error: `warned` isn't typed, the underlying issue should be solved rather than typing it\n responsiveFont.warned = true\n }\n\n return _ruleSet(base)\n }\n\n return _ruleSet(base, _responsiveFontSize(fontKey, props))\n}\n\n/**\n * @internal\n */\nexport function _fontBase(fontKey: ThemeFontKey, props: ThemeProps): CSSObject {\n const {font} = getTheme_v2(props.theme)\n\n return {\n position: 'relative',\n fontFamily: font[fontKey].family,\n ...FONT_BOX_STYLE,\n }\n}\n\n/**\n * @internal\n */\nexport function _fontWeight(\n fontKey: ThemeFontKey,\n props: FontWeightStyleProps & ThemeProps,\n): CSSObject {\n const {weights} = getTheme_v2(props.theme).font[fontKey]\n\n return {fontWeight: `${(props.$weight && weights[props.$weight]) || weights.regular}`}\n}\n\n/**\n * @internal\n */\nexport function _responsiveFontSize(\n fontKey: ThemeFontKey,\n props: ResponsiveFontSizeStyleProps & ThemeProps,\n): CSSObject[] {\n const {font, media} = getTheme_v2(props.theme)\n const {sizes} = font[fontKey]\n\n return _responsive(media, props.$size, (sizeIndex) => fontSize(sizes[sizeIndex] || sizes[2]))\n}\n\nfunction fontSize(size: ThemeFontSize): CSSObject {\n const {ascenderHeight, descenderHeight, fontSize, iconSize, letterSpacing, lineHeight} = size\n const negHeight = ascenderHeight + descenderHeight\n const capHeight = lineHeight - negHeight\n const iconOffset = (capHeight - iconSize) / 2\n const customIconSize = Math.floor((fontSize * 1.125) / 2) * 2 + 1\n const customIconOffset = (capHeight - customIconSize) / 2\n\n return {\n 'fontSize': rem(fontSize),\n 'lineHeight': `calc(${lineHeight} / ${fontSize})`,\n 'letterSpacing': rem(letterSpacing),\n 'transform': `translateY(${rem(descenderHeight)})`,\n\n '&:before': {\n marginTop: `calc(${rem(0 - negHeight)} - 1px)`,\n },\n\n '&:after': {\n marginBottom: '-1px',\n },\n\n '& svg:not([data-sanity-icon])': {\n fontSize: `calc(${customIconSize} / 16 * 1rem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Ae,eAAc,MACnF,YAAY,iBAAiB,iBAC7B,YAAY,aAAa,WACzB,cAAc,YAAY,YAAY,GACtC,iBAAiB,KAAK,MAAO,WAAW,QAAS,CAAC,IAAI,IAAI,GAC1D,oBAAoB,YAAY,kBAAkB;CAExD,OAAO;EACLC,UAAY,IAAI,QAAQ;EACxBC,YAAc,QAAQ,WAAW,KAAK,SAAS;EAC/CC,eAAiB,IAAI,aAAa;EAClCC,WAAa,cAAc,IAAI,eAAe,EAAE;EAEhD,YAAY,EACV,WAAW,QAAQ,IAAI,IAAI,SAAS,EAAE,SACxC;EAEA,WAAW,EACT,cAAc,OAChB;EAEA,iCAAiC;GAC/B,UAAU,QAAQ,eAAe;GACjC,QAAQ,IAAI,gBAAgB;EAC9B;EAEA,wBAAwB;GACtB,UAAU,QAAQ,SAAS;GAC3B,QAAQ,IAAI,UAAU;EACxB;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ThemeColorInputModeKey, c as ThemeColorStateKey, i as ThemeColorCardToneKey, l as ThemeColorStateToneKey, n as ThemeColorBlendModeKey, o as ThemeColorInputStateKey, r as ThemeColorButtonModeKey, s as ThemeColorSchemeKey, t as ThemeColorAvatarColorKey } from "./_system-
|
|
2
|
-
import { a as ThemeFontWeightKey, o as ThemeFonts } from "./font-
|
|
1
|
+
import { a as ThemeColorInputModeKey, c as ThemeColorStateKey, i as ThemeColorCardToneKey, l as ThemeColorStateToneKey, n as ThemeColorBlendModeKey, o as ThemeColorInputStateKey, r as ThemeColorButtonModeKey, s as ThemeColorSchemeKey, t as ThemeColorAvatarColorKey } from "./_system-DjnSx8gA.js";
|
|
2
|
+
import { a as ThemeFontWeightKey, o as ThemeFonts } from "./font-DI_tc5s8.js";
|
|
3
3
|
import * as CSS from "csstype";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
@@ -843,4 +843,4 @@ declare function parseColor(color: unknown): RGB | RGBA;
|
|
|
843
843
|
*/
|
|
844
844
|
declare function rgba(color: unknown, a: number): string;
|
|
845
845
|
export { ThemeColorInputState_v2 as $, ThemeColorMutedTone as A, ThemeColorBase as B, ThemeColorSpotKey as C, ThemeColorSelectableState as D, ThemeColorSelectable as E, ThemeColorCardState as F, ThemeInput_v2 as G, ThemeColorToneKey as H, ThemeColorButton as I, ThemeColorSchemes_v2 as J, ThemeColorCard_v2 as K, ThemeColorButtonState as L, ThemeColorInputState as M, ThemeColorInputStates as N, ThemeColorSelectableStates as O, ThemeColorCard as P, ThemeColorInputMode_v2 as Q, ThemeColorButtonStates as R, ThemeColorSpot as S, ThemeColorSolidTone as T, ThemeColorGenericState as U, ThemeColorName as V, ThemeAvatar as W, ThemeColorSelectableTone_v2 as X, ThemeColorShadow as Y, ThemeColorSelectable_v2 as Z, Theme_v2 as _, ThemeColorSyntax as _t, rgbToHex as a, ThemeColorKBD as at, ThemeColorScheme as b, RGBA as bt, screen as c, ThemeColorAvatarHue_v2 as ct, ThemeColorBuilderOpts as d, ThemeFocusRing as dt, ThemeColorInput_v2 as et, createColorTheme as f, ThemeStyles as ft, Theme as g, ThemeLayer as gt, RootTheme_v2 as h, ThemeShadow as ht, hslToRgb as i, ThemeColorState_v2 as it, ThemeColorInput as j, ThemeColorMuted as k, multiply as l, ThemeColorAvatar_v2 as lt, RootTheme as m, ThemeBoxShadow as mt, parseColor as n, ThemeColorButtonTone_v2 as nt, rgbToHsl as o, ThemeColorBadgeTone_v2 as ot, BaseTheme as p, CSSObject as pt, ThemeColorScheme_v2 as q, hexToRgb as r, ThemeColorButton_v2 as rt, rgbaToRGBA as s, ThemeColorBadge_v2 as st, rgba as t, ThemeColorButtonMode_v2 as tt, PartialThemeColorBuilderOpts as u, ThemeAvatar_v2 as ut, ThemeInput as v, HSL as vt, ThemeColorSolid as w, ThemeColorSchemes as x, ThemeColor as y, RGB as yt, ThemeColorButtonTones as z };
|
|
846
|
-
//# sourceMappingURL=rgba-
|
|
846
|
+
//# sourceMappingURL=rgba-Hlu7P1jF.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rgba-
|
|
1
|
+
{"version":3,"file":"rgba-Hlu7P1jF.d.ts","names":[],"sources":["../src/theme/build/lib/color-fns/types.ts","../src/theme/system/color/syntax.ts","../src/theme/system/layer.ts","../src/theme/system/shadow.ts","../src/theme/system/css.ts","../src/theme/system/styles.ts","../src/theme/system/focusRing.ts","../src/theme/system/avatar.ts","../src/theme/system/color/avatar.ts","../src/theme/system/color/badge.ts","../src/theme/system/color/kbd.ts","../src/theme/system/color/state.ts","../src/theme/system/color/button.ts","../src/theme/system/color/input.ts","../src/theme/system/color/selectable.ts","../src/theme/system/color/shadow.ts","../src/theme/system/color/color.ts","../src/theme/system/input.ts","../src/theme/system/v0/avatar.ts","../src/theme/system/v0/color/_generic.ts","../src/theme/system/v0/color/_system.ts","../src/theme/system/v0/color/base.ts","../src/theme/system/v0/color/button.ts","../src/theme/system/v0/color/card.ts","../src/theme/system/v0/color/input.ts","../src/theme/system/v0/color/muted.ts","../src/theme/system/v0/color/selectable.ts","../src/theme/system/v0/color/solid.ts","../src/theme/system/v0/color/spot.ts","../src/theme/system/v0/color/color.ts","../src/theme/system/v0/input.ts","../src/theme/system/theme.ts","../src/theme/build/_deprecated/color/factory.ts","../src/theme/build/lib/color-fns/blend/multiply.ts","../src/theme/build/lib/color-fns/blend/screen.ts","../src/theme/build/lib/color-fns/convert.ts","../src/theme/build/lib/color-fns/parse.ts","../src/theme/build/lib/color-fns/rgba.ts"],"mappings":";;;;;;UAGiB;EACf;EACA;EACA;EACA;;;;;UAMe;EACf;EACA;EACA;EACA;;;;;UAMe;EACf;EACA;EACA;;;;;UCvBe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;UCpCe;EACf;IAAS;;EACT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;IACA;QAEI;EAEN,SAAS;IAAO,MAAM;IAAgB;QAAmB;EAEzD,OAAO;IAAO,MAAM;IAAgB;IAAe,KAAK;;;;;;;KAQ9C,+BAA+B,QAAQ;;;;;iBAMnC,iBAEd,cAAa,+BAEZ;;;;;;iBC3Ga,SAAS,GAAG,MAAM,MAAM,GAAG,MAAM,OAAO;;;;;;iBCAxC,OAAO,GAAG,MAAM,MAAM,GAAG,MAAM,OAAO;;;;iBCLtC,SAAS,cAAc;;;;iBAuBvB,WAAW,eAAe;;;;iBAc1B,SAAS,OAAO,MAAM;;;;;iBAgBtB,WAAU,GAAG,GAAG,KAAI,MAAM;;;;iBA8C1B,SAAS,KAAK,MAAM;;;;iBClEpB,WAAW,iBAAiB,MAAM;;;;iBClClC,KAAK,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectable-2IHh9SLq.d.ts","names":[],"sources":["../src/core/types/selectable.ts"],"mappings":";;;;KAKY,iBAAiB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as _responsive, n as _getArrayProp, o as rem } from "./helpers-
|
|
2
|
-
import { t as getTheme_v2 } from "./getTheme_v2-
|
|
3
|
-
import { y as Box } from "./useLayer-
|
|
4
|
-
import { n as _fontWeight, r as _responsiveFontSize, t as _fontBase } from "./responsiveFont-
|
|
1
|
+
import { i as _responsive, n as _getArrayProp, o as rem } from "./helpers-jp2T-bdR.js";
|
|
2
|
+
import { t as getTheme_v2 } from "./getTheme_v2-CP5x_AcH.js";
|
|
3
|
+
import { y as Box } from "./useLayer-DiYnwQ5T.js";
|
|
4
|
+
import { n as _fontWeight, r as _responsiveFontSize, t as _fontBase } from "./responsiveFont-CfFXLc7o.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { css, styled } from "styled-components";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -114,4 +114,4 @@ function StackComponent(props) {
|
|
|
114
114
|
const Stack = StackComponent;
|
|
115
115
|
export { fontColorStyle as a, responsiveTextAlignStyle as i, Text as n, SpanWithTextOverflow as r, Stack as t };
|
|
116
116
|
|
|
117
|
-
//# sourceMappingURL=stack-
|
|
117
|
+
//# sourceMappingURL=stack-DFRXALVU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-DFSqrIj4.js","names":["<span className={spanWithTextOverflow}>{props.children}</span>","children","accent = false","muted = false","size = 2","...restProps","<SpanWithTextOverflow>{children}</SpanWithTextOverflow>","_getArrayProp(align)","_getArrayProp(size)","<span>{children}</span>","<StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>","...restProps","typeof as === 'string' ? as : undefined","_getArrayProp(gap)","<StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />","\"gridTemplateColumns\"","\"gridAutoRows\""],"sources":["../src/core/styles/font/fontColorStyle.ts","../src/core/styles/font/textAlignStyle.ts","../src/core/utils/spanWithTextOverflow.css.ts","../src/core/utils/spanWithTextOverflow.tsx","../src/core/primitives/text/styles.ts","../src/core/primitives/text/text.tsx","../src/core/primitives/stack/styles.ts","../src/core/primitives/stack/stack.tsx"],"sourcesContent":["import {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function fontColorStyle(props: {\n $accent?: boolean\n $muted?: boolean\n}): CSSObject | undefined {\n if (props.$muted) return {color: 'var(--card-muted-fg-color)'}\n if (props.$accent) return {color: 'var(--card-accent-fg-color)'}\n return undefined\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 {ResponsiveTextAlignStyleProps} from './types'\n\n/**\n * Get responsive text align styles.\n * @internal\n */\nexport function responsiveTextAlignStyle(\n props: ResponsiveTextAlignStyleProps & ThemeProps,\n): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$align, (textAlign) => {\n return {textAlign}\n })\n}\n","import {css, firstThatWorks} from '#styled-system/css'\n\nexport const spanWithTextOverflow = css({\n display: 'block',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: firstThatWorks('clip', 'hidden'),\n})\n","import {spanWithTextOverflow} from './spanWithTextOverflow.css'\n\n/** @internal */\nexport function SpanWithTextOverflow(props: {children?: React.ReactNode}): React.JSX.Element {\n return <span className={spanWithTextOverflow}>{props.children}</span>\n}\n","import {css} from 'styled-components'\n\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_fontBase} from '../../styles/font/responsiveFont'\nimport {ThemeProps} from '../../styles/types'\n\nexport function textBaseStyle(props: ThemeProps): ReturnType<typeof css> {\n const {font} = getTheme_v2(props.theme)\n\n return css`\n ${_fontBase('text', props)}\n\n color: var(--card-fg-color);\n\n & code {\n font-family: ${font.code.family};\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ${font.text.weights.bold};\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n /* ...and aren't squeezed by resets that set max-width: 100% */\n max-width: unset;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n `\n}\n","import {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {fontColorStyle} from '../../styles/font/fontColorStyle'\nimport {_fontWeight, _responsiveFontSize} from '../../styles/font/responsiveFont'\nimport {responsiveTextAlignStyle} from '../../styles/font/textAlignStyle'\nimport {ResponsiveFontSizeStyleProps, ResponsiveFontStyleProps} from '../../styles/font/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {TextAlign} from '../../types/text'\nimport {SpanWithTextOverflow} from '../../utils/spanWithTextOverflow'\nimport {textBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface TextOwnProps {\n accent?: boolean\n align?: TextAlign | TextAlign[]\n /** When `true` the text color will be muted. */\n muted?: boolean\n size?: number | number[]\n /**\n * Controls how overflowing text is treated.\n * Use `textOverflow=\"ellipsis\"` to render text as a single line which is concatenated with a `…` symbol.\n * @beta\n */\n textOverflow?: 'ellipsis'\n weight?: ThemeFontWeightKey\n}\n\n/**\n * @public\n */\nexport type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>\n\nconst TextBase = styled.div(textBaseStyle)\n\nconst TextSize = styled(TextBase)<ResponsiveFontSizeStyleProps>((props) =>\n _responsiveFontSize('text', props),\n)\n\nconst StyledText = styled(TextSize)<ResponsiveFontStyleProps>(\n (props) => _fontWeight('text', props),\n responsiveTextAlignStyle,\n fontColorStyle,\n)\n\nfunction TextComponent(\n props: TextOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'size'>,\n) {\n const {\n accent = false,\n align,\n children: childrenProp,\n muted = false,\n ref,\n size = 2,\n textOverflow,\n weight,\n ...restProps\n } = props\n\n let children = childrenProp\n\n if (textOverflow === 'ellipsis') {\n children = <SpanWithTextOverflow>{children}</SpanWithTextOverflow>\n }\n\n return (\n <StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>\n )\n}\n\n/**\n * The `Text` component is an agile, themed typographic element.\n *\n * @public\n */\nexport const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element =\n TextComponent\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../../styles/helpers'\nimport {ThemeProps} from '../../styles/types'\n\nexport interface ResponsiveStackSpaceStyleProps {\n $space: number[]\n}\n\nconst BASE_STYLE: CSSObject = {\n '&&:not([hidden])': {\n display: 'grid',\n },\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n 'gridTemplateColumns': 'minmax(0, 1fr)',\n 'gridAutoRows': 'min-content',\n}\n\nexport function stackBaseStyle(): CSSObject {\n return BASE_STYLE\n}\n\nexport function responsiveStackSpaceStyle(\n props: ResponsiveStackSpaceStyleProps & ThemeProps,\n): CSSObject[] {\n const {media, space} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$space, (spaceIndex) => ({\n // oxlint-disable-next-line no-deprecated\n gridGap: rem(space[spaceIndex]),\n }))\n}\n","import {styled} from 'styled-components'\n\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {responsiveStackSpaceStyle, ResponsiveStackSpaceStyleProps, stackBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface StackOwnProps extends BoxOwnProps {\n gap?: number | number[]\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n}\n\n/**\n * @public\n */\nexport type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>\n\nconst StyledStack = styled(Box)<ResponsiveStackSpaceStyleProps>(\n stackBaseStyle,\n responsiveStackSpaceStyle,\n)\n\nfunction StackComponent(\n props: StackOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as'>,\n) {\n const {as, gap, ref, ...restProps} = props\n\n return (\n <StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />\n )\n}\n\n/**\n * The `Stack` component is used to place elements on top of each other.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Stack = StackComponent as unknown as <E extends ElementType = 'div'>(\n props: StackProps<E>,\n) => React.JSX.Element\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,eAAe,OAGL;CACxB,IAAI,MAAM,QAAQ,OAAO,EAAC,OAAO,6BAA4B;CAC7D,IAAI,MAAM,SAAS,OAAO,EAAC,OAAO,8BAA6B;AAEjE;;;;;ACFA,SAAgB,yBACd,OACa;CACb,IAAM,EAAC,UAAS,YAAY,MAAM,KAAK;CAEvC,OAAO,YAAY,OAAO,MAAM,SAAS,eAChC,EAAC,UAAS,EAClB;AACH;;AEfA,SAAgB,qBAAqB,OAAwD;C,cACpFA;CAAP,OAAqDC,EAAAA,OAAAA,MAAAA,W,aAA9CD,KAAAA,oBAAC,QAAD;EAAM,WAAW;EAAuB,UAAA,MAAM;CAAe,CAAA,GAAfC,EAAAA,KAAAA,MAAAA,U,YAA9CD;AACT;ACCA,SAAgB,cAAc,OAA2C;CACvE,IAAM,EAAC,SAAQ,YAAY,MAAM,KAAK;CAEtC,OAAO,GAAG,GACN,UAAU,QAAQ,KAAK,EAAE,iDAKV,KAAK,KAAK,OAAO,4YA8BjB,KAAK,KAAK,QAAQ,KAAK;AAoB5C;ACvBA,MAAM,aAAa,uBAJF,uBAFA,uBAAO,IAAA,WAAA;;;AAAI,CAAA,CAAA,CAAA,aAEJ,CAAQ,CAAC,CAAA,WAAA;;;AAAgC,CAAA,CAAA,EAAA,UAC/D,oBAAoB,QAAQ,KAAK,CAGT,CAAQ,CAAC,CAAA,WAAA;;;AAChC,CAAA,CAAA,EAAA,UAAU,YAAY,QAAQ,KAAK,GACpC,0BACA,cACF;AA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AOA,MAAa,OACX,eClFI,aAAwB;CAC5B,oBAAoB,EAClB,SAAS,OACX;CACA,uCAAmC,EACjC,WAAW,OACb;CACAK,qBAAuB;CACvBC,cAAgB;AAClB;AAEA,SAAgB,iBAA4B;CAC1C,OAAO;AACT;AAEA,SAAgB,0BACd,OACa;CACb,IAAM,EAAC,OAAO,UAAS,YAAY,MAAM,KAAK;CAE9C,OAAO,YAAY,OAAO,MAAM,SAAS,gBAAgB,EAEvD,SAAS,IAAI,MAAM,WAAW,EAChC,EAAE;AACJ;ACVA,MAAM,cAAc,uBAAO,GAAG,CAAC,CAAA,WAAA;;;AAC7B,CAAA,CAAA,CAAA,gBACA,yBACF;AAEA,SAAS,eACP,OACA;C,eACO,IAAI,KAAK,KAAQ;CAAa,EAAA,OAAA,S,wDAA/B,CAAC,IAAI,KAAK,KAAKL,GAAAA,aAAgB,O;CAIxBC,IAAAA,KAAAA,OAAO,MAAO,WAAW,KAAK,KAAA,GAG/BC;CAAc,EAAA,OAAA,M,aAAdA,KAAAA,cAAc,GAAG,GAAH,EAAA,KAAA,K;CAJxBC,IAAAA;CADF,OAMiB,EAAA,OAAA,MAAA,EAAA,OACR,OAAA,EAAA,OAHD,aAAA,EAAA,QAFKF,MAAAA,EAAAA,QAGDC,MAJVC,KAAAA,oBAAC,aAAD;EACE,WAASF;EACT,WAAQ;EACR,GAAI;EACJ,QAAQC;EACR,aAAa;EACR;CACN,CAAA,GAFc,EAAA,KAAA,IACR,EAAA,KAAA,KAHD,EAAA,KAAA,WAFKD,EAAAA,MAAAA,IAGDC,EAAAA,MAAAA,I,0BAJVC;AASJ;;;;;;AAQA,MAAa,QAAQ"}
|
|
1
|
+
{"version":3,"file":"stack-DFRXALVU.js","names":["<span className={spanWithTextOverflow}>{props.children}</span>","children","accent = false","muted = false","size = 2","...restProps","<SpanWithTextOverflow>{children}</SpanWithTextOverflow>","_getArrayProp(align)","_getArrayProp(size)","<span>{children}</span>","<StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>","...restProps","typeof as === 'string' ? as : undefined","_getArrayProp(gap)","<StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />","\"gridTemplateColumns\"","\"gridAutoRows\""],"sources":["../src/core/styles/font/fontColorStyle.ts","../src/core/styles/font/textAlignStyle.ts","../src/core/utils/spanWithTextOverflow.css.ts","../src/core/utils/spanWithTextOverflow.tsx","../src/core/primitives/text/styles.ts","../src/core/primitives/text/text.tsx","../src/core/primitives/stack/styles.ts","../src/core/primitives/stack/stack.tsx"],"sourcesContent":["import {CSSObject} from '../../../theme/system/css'\n\n/**\n * @internal\n */\nexport function fontColorStyle(props: {\n $accent?: boolean\n $muted?: boolean\n}): CSSObject | undefined {\n if (props.$muted) return {color: 'var(--card-muted-fg-color)'}\n if (props.$accent) return {color: 'var(--card-accent-fg-color)'}\n return undefined\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 {ResponsiveTextAlignStyleProps} from './types'\n\n/**\n * Get responsive text align styles.\n * @internal\n */\nexport function responsiveTextAlignStyle(\n props: ResponsiveTextAlignStyleProps & ThemeProps,\n): CSSObject[] {\n const {media} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$align, (textAlign) => {\n return {textAlign}\n })\n}\n","import {css, firstThatWorks} from '#styled-system/css'\n\nexport const spanWithTextOverflow = css({\n display: 'block',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n overflow: firstThatWorks('clip', 'hidden'),\n})\n","import {spanWithTextOverflow} from './spanWithTextOverflow.css'\n\n/** @internal */\nexport function SpanWithTextOverflow(props: {children?: React.ReactNode}): React.JSX.Element {\n return <span className={spanWithTextOverflow}>{props.children}</span>\n}\n","import {css} from 'styled-components'\n\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_fontBase} from '../../styles/font/responsiveFont'\nimport {ThemeProps} from '../../styles/types'\n\nexport function textBaseStyle(props: ThemeProps): ReturnType<typeof css> {\n const {font} = getTheme_v2(props.theme)\n\n return css`\n ${_fontBase('text', props)}\n\n color: var(--card-fg-color);\n\n & code {\n font-family: ${font.code.family};\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ${font.text.weights.bold};\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n /* ...and aren't squeezed by resets that set max-width: 100% */\n max-width: unset;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n `\n}\n","import {styled} from 'styled-components'\n\nimport {ThemeFontWeightKey} from '../../../theme/system/font'\nimport {fontColorStyle} from '../../styles/font/fontColorStyle'\nimport {_fontWeight, _responsiveFontSize} from '../../styles/font/responsiveFont'\nimport {responsiveTextAlignStyle} from '../../styles/font/textAlignStyle'\nimport {ResponsiveFontSizeStyleProps, ResponsiveFontStyleProps} from '../../styles/font/types'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {TextAlign} from '../../types/text'\nimport {SpanWithTextOverflow} from '../../utils/spanWithTextOverflow'\nimport {textBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface TextOwnProps {\n accent?: boolean\n align?: TextAlign | TextAlign[]\n /** When `true` the text color will be muted. */\n muted?: boolean\n size?: number | number[]\n /**\n * Controls how overflowing text is treated.\n * Use `textOverflow=\"ellipsis\"` to render text as a single line which is concatenated with a `…` symbol.\n * @beta\n */\n textOverflow?: 'ellipsis'\n weight?: ThemeFontWeightKey\n}\n\n/**\n * @public\n */\nexport type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>\n\nconst TextBase = styled.div(textBaseStyle)\n\nconst TextSize = styled(TextBase)<ResponsiveFontSizeStyleProps>((props) =>\n _responsiveFontSize('text', props),\n)\n\nconst StyledText = styled(TextSize)<ResponsiveFontStyleProps>(\n (props) => _fontWeight('text', props),\n responsiveTextAlignStyle,\n fontColorStyle,\n)\n\nfunction TextComponent(\n props: TextOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'size'>,\n) {\n const {\n accent = false,\n align,\n children: childrenProp,\n muted = false,\n ref,\n size = 2,\n textOverflow,\n weight,\n ...restProps\n } = props\n\n let children = childrenProp\n\n if (textOverflow === 'ellipsis') {\n children = <SpanWithTextOverflow>{children}</SpanWithTextOverflow>\n }\n\n return (\n <StyledText\n data-ui=\"Text\"\n {...restProps}\n $accent={accent}\n $align={_getArrayProp(align)}\n $muted={muted}\n ref={ref}\n $size={_getArrayProp(size)}\n $weight={weight}\n >\n <span>{children}</span>\n </StyledText>\n )\n}\n\n/**\n * The `Text` component is an agile, themed typographic element.\n *\n * @public\n */\nexport const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element =\n TextComponent\n","import {CSSObject} from '../../../theme/system/css'\nimport {getTheme_v2} from '../../../theme/versioning/getTheme_v2'\nimport {_responsive, rem} from '../../styles/helpers'\nimport {ThemeProps} from '../../styles/types'\n\nexport interface ResponsiveStackSpaceStyleProps {\n $space: number[]\n}\n\nconst BASE_STYLE: CSSObject = {\n '&&:not([hidden])': {\n display: 'grid',\n },\n '&[data-as=\"ul\"],&[data-as=\"ol\"]': {\n listStyle: 'none',\n },\n 'gridTemplateColumns': 'minmax(0, 1fr)',\n 'gridAutoRows': 'min-content',\n}\n\nexport function stackBaseStyle(): CSSObject {\n return BASE_STYLE\n}\n\nexport function responsiveStackSpaceStyle(\n props: ResponsiveStackSpaceStyleProps & ThemeProps,\n): CSSObject[] {\n const {media, space} = getTheme_v2(props.theme)\n\n return _responsive(media, props.$space, (spaceIndex) => ({\n // oxlint-disable-next-line no-deprecated\n gridGap: rem(space[spaceIndex]),\n }))\n}\n","import {styled} from 'styled-components'\n\nimport {_getArrayProp} from '../../styles/helpers'\nimport {ElementType, Props} from '../../types/component'\nimport {Box, BoxOwnProps} from '../box/box'\nimport {responsiveStackSpaceStyle, ResponsiveStackSpaceStyleProps, stackBaseStyle} from './styles'\n\n/**\n * @public\n */\nexport interface StackOwnProps extends BoxOwnProps {\n gap?: number | number[]\n /**\n * @deprecated Use `gap` instead.\n */\n space?: never\n}\n\n/**\n * @public\n */\nexport type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>\n\nconst StyledStack = styled(Box)<ResponsiveStackSpaceStyleProps>(\n stackBaseStyle,\n responsiveStackSpaceStyle,\n)\n\nfunction StackComponent(\n props: StackOwnProps & {as?: ElementType} & Omit<React.HTMLProps<HTMLDivElement>, 'as'>,\n) {\n const {as, gap, ref, ...restProps} = props\n\n return (\n <StyledStack\n data-as={typeof as === 'string' ? as : undefined}\n data-ui=\"Stack\"\n {...restProps}\n $space={_getArrayProp(gap)}\n forwardedAs={as}\n ref={ref}\n />\n )\n}\n\n/**\n * The `Stack` component is used to place elements on top of each other.\n *\n * @public\n */\n// oxlint-disable-next-line no-unsafe-type-assertion\nexport const Stack = StackComponent as unknown as <E extends ElementType = 'div'>(\n props: StackProps<E>,\n) => React.JSX.Element\n"],"mappings":";;;;;;;;;;AAKA,SAAgB,eAAe,OAGL;CACxB,IAAI,MAAM,QAAQ,OAAO,EAAC,OAAO,6BAA4B;CAC7D,I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AAA,CAAA,CAAA,gBACA,yBACF;AAEA,SAAS,eACP,OACA;C,eACO,IAAI,KAAK,KAAQ;CAAa,EAAA,OAAA,S,wDAA/B,CAAC,IAAI,KAAK,KAAKL,GAAAA,aAAgB,O;CAIxBC,IAAAA,KAAAA,OAAO,MAAO,WAAW,KAAK,KAAA,GAG/BC;CAAc,EAAA,OAAA,M,aAAdA,KAAAA,cAAc,GAAG,GAAH,EAAA,KAAA,K;CAJxBC,IAAAA;CADF,OAMiB,EAAA,OAAA,MAAA,EAAA,OACR,OAAA,EAAA,OAHD,aAAA,EAAA,QAFKF,MAAAA,EAAAA,QAGDC,MAJVC,KAAAA,oBAAC,aAAD;EACE,WAASF;EACT,WAAQ;EACR,GAAI;EACJ,QAAQC;EACR,aAAa;EACR;CACN,CAAA,GAFc,EAAA,KAAA,IACR,EAAA,KAAA,KAHD,EAAA,KAAA,WAFKD,EAAAA,MAAAA,IAGDC,EAAAA,MAAAA,I,0BAJVC;AASJ;;;;;;AAQA,MAAa,QAAQ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as EMPTY_RECORD, i as _responsive, n as _getArrayProp, o as rem } from "./helpers-
|
|
2
|
-
import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement } from "./element-
|
|
3
|
-
import { t as getTheme_v2 } from "./getTheme_v2-
|
|
4
|
-
import { l as useRootTheme, m as focusRingStyle, p as focusRingBorderStyle, s as Card, v as responsiveRadiusStyle, y as Box } from "./useLayer-
|
|
5
|
-
import { n as Text } from "./stack-
|
|
6
|
-
import { t as Button } from "./button-
|
|
1
|
+
import { c as EMPTY_RECORD, i as _responsive, n as _getArrayProp, o as rem } from "./helpers-jp2T-bdR.js";
|
|
2
|
+
import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement } from "./element-DIcKo4Jp.js";
|
|
3
|
+
import { t as getTheme_v2 } from "./getTheme_v2-CP5x_AcH.js";
|
|
4
|
+
import { l as useRootTheme, m as focusRingStyle, p as focusRingBorderStyle, s as Card, v as responsiveRadiusStyle, y as Box } from "./useLayer-DiYnwQ5T.js";
|
|
5
|
+
import { n as Text } from "./stack-DFRXALVU.js";
|
|
6
|
+
import { t as Button } from "./button-GFefHUiY.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { clsx } from "clsx/lite";
|
|
9
9
|
import { isValidElement, useEffect, useImperativeHandle, useRef } from "react";
|
|
@@ -332,4 +332,4 @@ function _temp(event) {
|
|
|
332
332
|
}
|
|
333
333
|
export { isFocusable as _, textInputColorStyle as a, textInputRepresentationColorStyle as c, responsiveInputPaddingStyle as d, useCustomValidity as f, focusLastDescendant as g, focusFirstDescendant as h, textInputBaseStyle as i, textInputRepresentationStyle as l, attemptFocus as m, inputRoot as n, textInputFontSizeStyle as o, _hasFocus as p, textAreaRoot as r, textInputFontStyle as s, TextInput as t, responsiveInputPaddingIconRightStyle as u, _raf as v, _raf2 as y };
|
|
334
334
|
|
|
335
|
-
//# sourceMappingURL=textInput-
|
|
335
|
+
//# sourceMappingURL=textInput-cMQvSl5n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textInput-CUhBHHFK.js","names":["() => {\n ref.current?.setCustomValidity(customValidity || '')\n }","[customValidity, ref]","ref.current","border = true","disabled = false","fontSizeProp = 2","gap = 3","paddingProp = 3","radiusProp = 2","type = 'text'","...restProps","_getArrayProp(fontSizeProp)","_getArrayProp(paddingProp)","_getArrayProp(radiusProp)","_getArrayProp(gap)","() => ref.current","useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\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 }","event","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 )","prefix && (\n <Prefix borderTop borderLeft borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{prefix}</span>\n </Prefix>\n )","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 )","border ? '' : undefined","IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )","!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\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 data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\n )}\n </Presentation>","scheme","tone","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 data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\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 )","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 })","(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 }","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 )","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 })","(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 }","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 )","!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 <Button\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 className={clsx(textInputClearButton, clearButtonProps.className)}\n onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n )","clearButtonProps.className","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 <Button\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 className={clsx(textInputClearButton, clearButtonProps.className)}\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 )","suffix && (\n <Suffix borderTop borderRight borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{suffix}</span>\n </Suffix>\n )","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 )","$hasIconRight || $hasClearButton","<Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />","<span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>","<Card\n as=\"span\"\n className={textInputRoot}\n data-ui=\"TextInput\"\n display=\"flex\"\n tone={rootTheme.tone}\n >\n {prefixNode}\n\n <span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>\n\n {suffixNode}\n </Card>","v","(event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n }","_jsx","_jsxs"],"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/styles/input/textInput.css.ts","../src/core/primitives/textInput/textInput.css.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\nexport const textInputBaseStyle = 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 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\nexport function textInputColorStyle(\n props: Pick<TextInputInputStyleProps, '$scheme' | '$tone'> & ThemeProps,\n): ReturnType<typeof css> {\n const {$scheme, $tone} = props\n const {color} = getTheme_v2(props.theme)\n\n return css`\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 textInputFontStyle(\n props: Pick<TextInputInputStyleProps, '$weight'> & ThemeProps,\n): CSSObject {\n const {$weight} = props\n const {font} = getTheme_v2(props.theme)\n\n return {\n fontFamily: font.text.family,\n fontWeight: `${($weight && font.text.weights[$weight]) || font.text.weights.regular}`,\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: Pick<TextInputRepresentationStyleProps, '$hasPrefix' | '$hasSuffix'>,\n): ReturnType<typeof css> {\n const {$hasPrefix, $hasSuffix} = props\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}\n\nexport function textInputRepresentationColorStyle(\n props: Omit<TextInputRepresentationStyleProps, '$hasPrefix' | '$hasSuffix'> & ThemeProps,\n): ReturnType<typeof css> {\n const {$scheme, $tone, $unstableDisableFocusRing} = props\n const {color, input} = getTheme_v2(props.theme)\n\n return css`\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 {css} from '#styled-system/css'\n\n// TextInput renders its root as a Card, whose Box styles own `display`, so the\n// flex layout comes from the `display` prop there and only the alignment lives\n// here. TextArea's root is a plain span, so it reuses that class and adds display.\nexport const textInputRoot = css({\n alignItems: 'center',\n})\n\nexport const textAreaRoot = css({\n 'alignItems': 'center',\n '&:not([hidden])': {\n display: 'flex',\n },\n})\n\nexport const inputRoot = css({\n flex: 1,\n minWidth: 0,\n display: 'block',\n position: 'relative',\n})\n","import {css} from '#styled-system/css'\n\nexport const textInputLeftBox = css({\n position: 'absolute',\n top: 0,\n left: 0,\n})\n\nexport const textInputRightBox = css({\n position: 'absolute',\n top: 0,\n right: 0,\n})\n\nexport const textInputClearButton = css({\n '&:not([hidden])': {\n display: 'block',\n },\n})\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {clsx} from 'clsx/lite'\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 textInputColorStyle,\n textInputFontSizeStyle,\n textInputFontStyle,\n TextInputInputStyleProps,\n textInputRepresentationColorStyle,\n textInputRepresentationStyle,\n TextInputRepresentationStyleProps,\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\nimport {inputRoot, textInputRoot} from '../../styles/input/textInput.css'\nimport {textInputClearButton, textInputLeftBox, textInputRightBox} from './textInput.css'\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\n// Prefix and Suffix stay on styled-components: their corner radius longhands\n// must beat Card's runtime `border-radius` shorthand at equal specificity,\n// which needs both rules in the runtime stylesheet.\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 InputBase = styled.input`\n ${textInputBaseStyle}\n`\n\nconst InputColor = styled(InputBase)<TextInputInputStyleProps>(textInputColorStyle)\n\nconst Input = styled(InputColor)<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(\n responsiveInputPaddingStyle,\n textInputFontStyle,\n textInputFontSizeStyle,\n)\n\nconst PresentationColor = styled.span<TextInputRepresentationStyleProps>(\n textInputRepresentationColorStyle,\n)\n\nconst Presentation = styled(PresentationColor)<\n ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps\n>(responsiveRadiusStyle, textInputRepresentationStyle)\n\n// Stays on styled-components: `background-color: transparent` must beat Card's\n// runtime `background-color: var(--card-bg-color)` at equal specificity, which\n// needs both rules in the runtime stylesheet.\nconst RightCard = styled(Card)`\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\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 data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\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 =\n typeof clearButton === 'object' ? clearButton : EMPTY_RECORD\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 <Button\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 className={clsx(textInputClearButton, clearButtonProps.className)}\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 <Card\n as=\"span\"\n className={textInputRoot}\n data-ui=\"TextInput\"\n display=\"flex\"\n tone={rootTheme.tone}\n >\n {prefixNode}\n\n <span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>\n\n {suffixNode}\n </Card>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,SAAgB,KAAK,IAA4B;CAC/C,IAAM,UAAU,sBAAsB,EAAE;CAExC,aAAa;EACX,qBAAqB,OAAO;CAC9B;AACF;;;;AAKA,SAAgB,MAAM,IAA4B;CAChD,IAAI,eAAoC,MAElC,eAAe,WAAW;EAC9B,eAAe,KAAK,EAAE;CACxB,CAAC;CAED,aAAa;EACP,gBAAc,aAAa,GAE/B,aAAa;CACf;AACF;;;;ACVA,SAAgB,UAAU,SAA+B;CACvD,OAAO,EAAQ,SAAS,iBAAkB,QAAQ,SAAS,SAAS,aAAa;AACnF;;;;AAKA,SAAgB,YAAY,SAA+B;CAwBzD,OAtBE,QAAQ,WAAW,KAClB,QAAQ,aAAa,KAAK,QAAQ,aAAa,UAAU,MAAM,OAEzD,KAGL,oBAAoB,OAAO,IACtB,EAAQ,QAAQ,QAAS,QAAQ,QAAQ,WAG9C,mBAAmB,OAAO,IACrB,QAAQ,SAAS,YAAY,QAAQ,SAAS,UAAU,CAAC,QAAQ,WAIxE,oBAAoB,OAAO,KAC3B,oBAAoB,OAAO,KAC3B,sBAAsB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,IA5BH,EAAA,MAAA,YAFef,EAAAA,MAAAA,UAAAA,MA6Bf,EAAA,MAAA,YAzBDe,EAAAA,MAAAA,K,4BATFC;AAqCJ;AArGkBV,SAAAA,OAACW,KAAM;CAKjB,OAJIA,QAAM,KACNA,QAAM,IAAU,IAChBA,QAAM,IAAU,IAEbA,MAAI;AACb;AAjBYd,SAAAA,OAAC,GAAM;CAKjB,OAJI,MAAM,IAAU,IAChB,MAAM,KACN,MAAM,IAAU,IAEb,IAAI;AACb;AAvFqCe,SAAAA,MAAC,OAA+C;CACvF,MAAM,eAAe,GACrB,MAAM,gBAAgB;AACxB"}
|
|
1
|
+
{"version":3,"file":"textInput-cMQvSl5n.js","names":["() => {\n ref.current?.setCustomValidity(customValidity || '')\n }","[customValidity, ref]","ref.current","border = true","disabled = false","fontSizeProp = 2","gap = 3","paddingProp = 3","radiusProp = 2","type = 'text'","...restProps","_getArrayProp(fontSizeProp)","_getArrayProp(paddingProp)","_getArrayProp(radiusProp)","_getArrayProp(gap)","() => ref.current","useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\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 }","event","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 )","prefix && (\n <Prefix borderTop borderLeft borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{prefix}</span>\n </Prefix>\n )","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 )","border ? '' : undefined","IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )","!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\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 data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\n )}\n </Presentation>","scheme","tone","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 data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\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 )","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 })","(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 }","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 )","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 })","(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 }","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 )","!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 <Button\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 className={clsx(textInputClearButton, clearButtonProps.className)}\n onClick={handleClearClick}\n onMouseDown={handleClearMouseDown}\n />\n </RightCard>\n )","clearButtonProps.className","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 <Button\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 className={clsx(textInputClearButton, clearButtonProps.className)}\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 )","suffix && (\n <Suffix borderTop borderRight borderBottom radius={radius} sizing=\"border\" tone=\"inherit\">\n <span>{suffix}</span>\n </Suffix>\n )","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 )","$hasIconRight || $hasClearButton","<Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />","<span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>","<Card\n as=\"span\"\n className={textInputRoot}\n data-ui=\"TextInput\"\n display=\"flex\"\n tone={rootTheme.tone}\n >\n {prefixNode}\n\n <span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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}\n type={type}\n />\n\n {presentationNode}\n {clearButtonNode}\n </span>\n\n {suffixNode}\n </Card>","v","(event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n }","_jsx","_jsxs"],"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/styles/input/textInput.css.ts","../src/core/primitives/textInput/textInput.css.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\nexport const textInputBaseStyle = 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 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\nexport function textInputColorStyle(\n props: Pick<TextInputInputStyleProps, '$scheme' | '$tone'> & ThemeProps,\n): ReturnType<typeof css> {\n const {$scheme, $tone} = props\n const {color} = getTheme_v2(props.theme)\n\n return css`\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 textInputFontStyle(\n props: Pick<TextInputInputStyleProps, '$weight'> & ThemeProps,\n): CSSObject {\n const {$weight} = props\n const {font} = getTheme_v2(props.theme)\n\n return {\n fontFamily: font.text.family,\n fontWeight: `${($weight && font.text.weights[$weight]) || font.text.weights.regular}`,\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: Pick<TextInputRepresentationStyleProps, '$hasPrefix' | '$hasSuffix'>,\n): ReturnType<typeof css> {\n const {$hasPrefix, $hasSuffix} = props\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}\n\nexport function textInputRepresentationColorStyle(\n props: Omit<TextInputRepresentationStyleProps, '$hasPrefix' | '$hasSuffix'> & ThemeProps,\n): ReturnType<typeof css> {\n const {$scheme, $tone, $unstableDisableFocusRing} = props\n const {color, input} = getTheme_v2(props.theme)\n\n return css`\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 {css} from '#styled-system/css'\n\n// TextInput renders its root as a Card, whose Box styles own `display`, so the\n// flex layout comes from the `display` prop there and only the alignment lives\n// here. TextArea's root is a plain span, so it reuses that class and adds display.\nexport const textInputRoot = css({\n alignItems: 'center',\n})\n\nexport const textAreaRoot = css({\n 'alignItems': 'center',\n '&:not([hidden])': {\n display: 'flex',\n },\n})\n\nexport const inputRoot = css({\n flex: 1,\n minWidth: 0,\n display: 'block',\n position: 'relative',\n})\n","import {css} from '#styled-system/css'\n\nexport const textInputLeftBox = css({\n position: 'absolute',\n top: 0,\n left: 0,\n})\n\nexport const textInputRightBox = css({\n position: 'absolute',\n top: 0,\n right: 0,\n})\n\nexport const textInputClearButton = css({\n '&:not([hidden])': {\n display: 'block',\n },\n})\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {clsx} from 'clsx/lite'\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 textInputColorStyle,\n textInputFontSizeStyle,\n textInputFontStyle,\n TextInputInputStyleProps,\n textInputRepresentationColorStyle,\n textInputRepresentationStyle,\n TextInputRepresentationStyleProps,\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\nimport {inputRoot, textInputRoot} from '../../styles/input/textInput.css'\nimport {textInputClearButton, textInputLeftBox, textInputRightBox} from './textInput.css'\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\n// Prefix and Suffix stay on styled-components: their corner radius longhands\n// must beat Card's runtime `border-radius` shorthand at equal specificity,\n// which needs both rules in the runtime stylesheet.\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 InputBase = styled.input`\n ${textInputBaseStyle}\n`\n\nconst InputColor = styled(InputBase)<TextInputInputStyleProps>(textInputColorStyle)\n\nconst Input = styled(InputColor)<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(\n responsiveInputPaddingStyle,\n textInputFontStyle,\n textInputFontSizeStyle,\n)\n\nconst PresentationColor = styled.span<TextInputRepresentationStyleProps>(\n textInputRepresentationColorStyle,\n)\n\nconst Presentation = styled(PresentationColor)<\n ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps\n>(responsiveRadiusStyle, textInputRepresentationStyle)\n\n// Stays on styled-components: `background-color: transparent` must beat Card's\n// runtime `background-color: var(--card-bg-color)` at equal specificity, which\n// needs both rules in the runtime stylesheet.\nconst RightCard = styled(Card)`\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\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 data-ui=\"TextInput__presentation\"\n >\n {IconComponent && (\n <Box className={textInputLeftBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconComponent) && IconComponent}\n {isValidElementType(IconComponent) && <IconComponent />}\n </Text>\n </Box>\n )}\n\n {!$hasClearButton && IconRightComponent && (\n <Box className={textInputRightBox} padding={padding}>\n <Text size={fontSize}>\n {isValidElement(IconRightComponent) && IconRightComponent}\n {isValidElementType(IconRightComponent) && <IconRightComponent />}\n </Text>\n </Box>\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 =\n typeof clearButton === 'object' ? clearButton : EMPTY_RECORD\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 <Button\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 className={clsx(textInputClearButton, clearButtonProps.className)}\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 <Card\n as=\"span\"\n className={textInputRoot}\n data-ui=\"TextInput\"\n display=\"flex\"\n tone={rootTheme.tone}\n >\n {prefixNode}\n\n <span className={inputRoot}>\n <Input\n data-as=\"input\"\n data-scheme={rootTheme.scheme}\n data-tone={rootTheme.tone}\n data-ui=\"TextInput__input\"\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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ANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
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-
|
|
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 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";
|
|
1
|
+
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-Hlu7P1jF.js";
|
|
4
2
|
import { ColorHueKey, ColorTint, ColorTintKey } from "@sanity/color";
|
|
3
|
+
import { a as ThemeFontWeightKey, i as ThemeFontWeight, n as ThemeFontKey, o as ThemeFonts, r as ThemeFontSize, t as ThemeFont } from "./font-DI_tc5s8.js";
|
|
4
|
+
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-DjnSx8gA.js";
|
|
5
5
|
/** @public */
|
|
6
6
|
export 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'];
|
|
7
7
|
/** @public */
|
package/dist/theme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
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-
|
|
2
|
-
import { i as is_v2, n as v2_v0, r as v0_v2, t as getScopedTheme } from "./getScopedTheme-
|
|
3
|
-
import { t as getTheme_v2 } from "./getTheme_v2-
|
|
1
|
+
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-D1M0GqJn.js";
|
|
2
|
+
import { i as is_v2, n as v2_v0, r as v0_v2, t as getScopedTheme } from "./getScopedTheme-BJoqtbrb.js";
|
|
3
|
+
import { t as getTheme_v2 } from "./getTheme_v2-CP5x_AcH.js";
|
|
4
4
|
/** @internal */
|
|
5
5
|
function getContrastRatio(bg, fg) {
|
|
6
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/toast.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { _ as useTheme_v2, d as createGlobalScopedContext, i as usePrefersReducedMotion, n as LayerProvider, r as isRecord, s as Card, t as useLayer, y as Box } from "./useLayer-CKA2DU8j.js";
|
|
3
|
-
import { t as Button } from "./button-DBWvhK72.js";
|
|
4
|
-
import { t as Flex } from "./flex-DZLSBZTk.js";
|
|
5
|
-
import { n as Text, t as Stack } from "./stack-DFSqrIj4.js";
|
|
6
|
-
import { t as Grid } from "./grid-HONPZVbL.js";
|
|
7
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { CloseIcon } from "@sanity/icons/Close";
|
|
8
4
|
import { clsx } from "clsx/lite";
|
|
9
|
-
import { startTransition, useContext, useState, useSyncExternalStore } from "react";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
5
|
import { AnimatePresence, motion, stagger } from "motion/react";
|
|
12
|
-
import {
|
|
6
|
+
import { _ as useTheme_v2, d as createGlobalScopedContext, i as usePrefersReducedMotion, n as LayerProvider, r as isRecord, s as Card, t as useLayer, y as Box } from "./useLayer-DiYnwQ5T.js";
|
|
7
|
+
import { t as Button } from "./button-GFefHUiY.js";
|
|
8
|
+
import { t as Flex } from "./flex-DeU6k2uN.js";
|
|
9
|
+
import { n as Text, t as Stack } from "./stack-DFRXALVU.js";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { startTransition, useContext, useState, useSyncExternalStore } from "react";
|
|
12
|
+
import { t as Grid } from "./grid-Bz_gKSjw.js";
|
|
13
13
|
const STATUS_CARD_TONE = {
|
|
14
14
|
error: "critical",
|
|
15
15
|
warning: "caution",
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as ThemeColorSchemeKey } from "./_system-
|
|
2
|
-
import { i as Delay, n as LayerProps, r as Placement } from "./layer-
|
|
1
|
+
import { s as ThemeColorSchemeKey } from "./_system-DjnSx8gA.js";
|
|
2
|
+
import { i as Delay, n as LayerProps, r as Placement } from "./layer-CAyooswI.js";
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
package/dist/tooltip.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as useReferenceElement, i as origin, n as AnimateActivity, r as getTransformOrigin, s as useLatestRef, t as getElementRef } from "./getElementRef-BLVMlHTn.js";
|
|
3
|
-
import { _ as useTheme_v2, d as createGlobalScopedContext, i as usePrefersReducedMotion, s as Card } from "./useLayer-CKA2DU8j.js";
|
|
4
|
-
import { l as POPOVER_MOTION_PROPS, n as _getArrayProp } from "./helpers-XThPpWje.js";
|
|
5
|
-
import { a as resolvePortalElement, n as Portal, o as useBoundaryElement, r as usePortal, t as Arrow } from "./arrow-Df43Duu7.js";
|
|
6
|
-
import { t as Layer } from "./layer-CZ8G9TS5.js";
|
|
7
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { arrow, autoUpdate, detectOverflow, flip, offset, shift, size, useFloating } from "@floating-ui/react-dom";
|
|
8
4
|
import { clsx } from "clsx/lite";
|
|
9
5
|
import { Activity, cloneElement, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
10
6
|
import { useEffectEvent } from "use-effect-event";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { a as useReferenceElement, i as origin, n as AnimateActivity, r as getTransformOrigin, s as useLatestRef, t as getElementRef } from "./getElementRef-5HypX0AT.js";
|
|
8
|
+
import { _ as useTheme_v2, d as createGlobalScopedContext, i as usePrefersReducedMotion, s as Card } from "./useLayer-DiYnwQ5T.js";
|
|
9
|
+
import { l as POPOVER_MOTION_PROPS, n as _getArrayProp } from "./helpers-jp2T-bdR.js";
|
|
10
|
+
import { a as resolvePortalElement, n as Portal, o as useBoundaryElement, r as usePortal, t as Arrow } from "./arrow-BhooatHA.js";
|
|
11
|
+
import { t as Layer } from "./layer-Bl7rtdZ_.js";
|
|
13
12
|
import { motion } from "motion/react";
|
|
13
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
/**
|
|
15
15
|
* @beta
|
|
16
16
|
*/
|