@artsy/palette 41.7.0 → 41.8.1
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/Theme.d.ts
CHANGED
|
@@ -1,6 +1,147 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export * from "@artsy/palette-tokens/dist/themes/v3";
|
|
3
3
|
export { TextVariant } from "@artsy/palette-tokens/dist/typography/v3";
|
|
4
|
+
export declare const THEMES: {
|
|
5
|
+
light: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
breakpoints: string[] & {
|
|
9
|
+
lg: string;
|
|
10
|
+
md: string;
|
|
11
|
+
sm: string;
|
|
12
|
+
xs: string;
|
|
13
|
+
};
|
|
14
|
+
colors: {
|
|
15
|
+
mono100: string;
|
|
16
|
+
mono60: string;
|
|
17
|
+
mono30: string;
|
|
18
|
+
mono15: string;
|
|
19
|
+
mono10: string;
|
|
20
|
+
mono5: string;
|
|
21
|
+
mono0: string;
|
|
22
|
+
blue200: string;
|
|
23
|
+
blue150: string;
|
|
24
|
+
blue100: string;
|
|
25
|
+
brand: string;
|
|
26
|
+
blue15: string;
|
|
27
|
+
blue10: string;
|
|
28
|
+
green150: string;
|
|
29
|
+
green100: string;
|
|
30
|
+
green10: string;
|
|
31
|
+
yellow150: string;
|
|
32
|
+
yellow100: string;
|
|
33
|
+
yellow10: string;
|
|
34
|
+
orange150: string;
|
|
35
|
+
orange100: string;
|
|
36
|
+
orange10: string;
|
|
37
|
+
red150: string;
|
|
38
|
+
red100: string;
|
|
39
|
+
red50: string;
|
|
40
|
+
red10: string;
|
|
41
|
+
};
|
|
42
|
+
effects: {
|
|
43
|
+
dropShadow: string;
|
|
44
|
+
innerShadow: string;
|
|
45
|
+
flatShadow: string;
|
|
46
|
+
textShadow: string;
|
|
47
|
+
overlayGradient: string;
|
|
48
|
+
fadeRight: string;
|
|
49
|
+
backdrop: string;
|
|
50
|
+
};
|
|
51
|
+
fonts: {
|
|
52
|
+
sans: string;
|
|
53
|
+
};
|
|
54
|
+
mediaQueries: {
|
|
55
|
+
lg: string;
|
|
56
|
+
md: string;
|
|
57
|
+
sm: string;
|
|
58
|
+
xs: string;
|
|
59
|
+
hover: string;
|
|
60
|
+
};
|
|
61
|
+
grid: {
|
|
62
|
+
breakpoints: {};
|
|
63
|
+
};
|
|
64
|
+
space: {
|
|
65
|
+
0.5: string;
|
|
66
|
+
1: string;
|
|
67
|
+
2: string;
|
|
68
|
+
4: string;
|
|
69
|
+
6: string;
|
|
70
|
+
12: string;
|
|
71
|
+
};
|
|
72
|
+
textVariants: Record<"xxxl" | "xxl" | "xl" | "lg" | "lg-display" | "md" | "sm" | "sm-display" | "xs" | "xxs" | "bq", import("@artsy/palette-tokens/dist/typography/v3").TextTreatment>;
|
|
73
|
+
};
|
|
74
|
+
dark: {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
colors: {
|
|
78
|
+
mono100: string;
|
|
79
|
+
mono60: string;
|
|
80
|
+
mono30: string;
|
|
81
|
+
mono15: string;
|
|
82
|
+
mono10: string;
|
|
83
|
+
mono5: string;
|
|
84
|
+
mono0: string;
|
|
85
|
+
blue200: string;
|
|
86
|
+
blue150: string;
|
|
87
|
+
blue100: string;
|
|
88
|
+
brand: string;
|
|
89
|
+
blue15: string;
|
|
90
|
+
blue10: string;
|
|
91
|
+
green150: string;
|
|
92
|
+
green100: string;
|
|
93
|
+
green10: string;
|
|
94
|
+
yellow150: string;
|
|
95
|
+
yellow100: string;
|
|
96
|
+
yellow10: string;
|
|
97
|
+
orange150: string;
|
|
98
|
+
orange100: string;
|
|
99
|
+
orange10: string;
|
|
100
|
+
red150: string;
|
|
101
|
+
red100: string;
|
|
102
|
+
red50: string;
|
|
103
|
+
red10: string;
|
|
104
|
+
};
|
|
105
|
+
effects: {
|
|
106
|
+
/** Returns the current theme */
|
|
107
|
+
dropShadow: string;
|
|
108
|
+
innerShadow: string;
|
|
109
|
+
flatShadow: string;
|
|
110
|
+
textShadow: string;
|
|
111
|
+
overlayGradient: string;
|
|
112
|
+
fadeRight: string;
|
|
113
|
+
backdrop: string;
|
|
114
|
+
};
|
|
115
|
+
breakpoints: string[] & {
|
|
116
|
+
lg: string;
|
|
117
|
+
md: string;
|
|
118
|
+
sm: string;
|
|
119
|
+
xs: string;
|
|
120
|
+
};
|
|
121
|
+
fonts: {
|
|
122
|
+
sans: string;
|
|
123
|
+
};
|
|
124
|
+
mediaQueries: {
|
|
125
|
+
lg: string;
|
|
126
|
+
md: string;
|
|
127
|
+
sm: string;
|
|
128
|
+
xs: string;
|
|
129
|
+
hover: string;
|
|
130
|
+
};
|
|
131
|
+
grid: {
|
|
132
|
+
breakpoints: {};
|
|
133
|
+
};
|
|
134
|
+
space: {
|
|
135
|
+
0.5: string;
|
|
136
|
+
1: string;
|
|
137
|
+
2: string;
|
|
138
|
+
4: string;
|
|
139
|
+
6: string;
|
|
140
|
+
12: string;
|
|
141
|
+
};
|
|
142
|
+
textVariants: Record<"xxxl" | "xxl" | "xl" | "lg" | "lg-display" | "md" | "sm" | "sm-display" | "xs" | "xxs" | "bq", import("@artsy/palette-tokens/dist/typography/v3").TextTreatment>;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
4
145
|
interface ThemeProps {
|
|
5
146
|
children?: React.ReactNode;
|
|
6
147
|
theme?: "light" | "dark";
|
package/dist/Theme.js
CHANGED
|
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
var _exportNames = {
|
|
8
|
+
THEMES: true,
|
|
8
9
|
Theme: true,
|
|
9
10
|
useTheme: true,
|
|
10
11
|
TextVariant: true
|
|
11
12
|
};
|
|
13
|
+
exports.THEMES = void 0;
|
|
12
14
|
Object.defineProperty(exports, "TextVariant", {
|
|
13
15
|
enumerable: true,
|
|
14
16
|
get: function get() {
|
|
@@ -39,6 +41,7 @@ var THEMES = {
|
|
|
39
41
|
light: _themes.THEME,
|
|
40
42
|
dark: _v3Dark.THEME_DARK
|
|
41
43
|
};
|
|
44
|
+
exports.THEMES = THEMES;
|
|
42
45
|
var DEFAULT_THEME = _themes.THEME;
|
|
43
46
|
/**
|
|
44
47
|
* A wrapper component for passing down the Artsy theme context
|
package/dist/Theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_themes","_v","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_v3Dark","_v2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","THEMES","light","THEME","dark","THEME_DARK","DEFAULT_THEME","Theme","_ref","children","_ref$theme","theme","selectedTheme","createElement","ThemeProvider","displayName","useTheme","useContext","ThemeContext"],"sources":["../src/Theme.tsx"],"sourcesContent":["import React, { useContext } from \"react\"\nimport { ThemeContext, ThemeProvider } from \"styled-components\"\nimport { THEME, Theme as TTheme } from \"./themes\"\n\nexport * from \"@artsy/palette-tokens/dist/themes/v3\"\nimport { THEME_DARK } from \"@artsy/palette-tokens/dist/themes/v3Dark\"\nexport { TextVariant } from \"@artsy/palette-tokens/dist/typography/v3\"\n\
|
|
1
|
+
{"version":3,"file":"Theme.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_themes","_v","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_v3Dark","_v2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","THEMES","light","THEME","dark","THEME_DARK","DEFAULT_THEME","Theme","_ref","children","_ref$theme","theme","selectedTheme","createElement","ThemeProvider","displayName","useTheme","useContext","ThemeContext"],"sources":["../src/Theme.tsx"],"sourcesContent":["import React, { useContext } from \"react\"\nimport { ThemeContext, ThemeProvider } from \"styled-components\"\nimport { THEME, Theme as TTheme } from \"./themes\"\n\nexport * from \"@artsy/palette-tokens/dist/themes/v3\"\nimport { THEME_DARK } from \"@artsy/palette-tokens/dist/themes/v3Dark\"\nexport { TextVariant } from \"@artsy/palette-tokens/dist/typography/v3\"\n\nexport const THEMES = {\n light: THEME,\n dark: THEME_DARK,\n}\n\nconst DEFAULT_THEME = THEME\n\ninterface ThemeProps {\n children?: React.ReactNode\n theme?: \"light\" | \"dark\"\n}\n\n/**\n * A wrapper component for passing down the Artsy theme context\n */\nexport const Theme: React.FC<React.PropsWithChildren<ThemeProps>> = ({\n children,\n theme = \"light\",\n}) => {\n const selectedTheme = THEMES[theme]\n return <ThemeProvider theme={selectedTheme}>{children}</ThemeProvider>\n}\n\n/** Returns the current theme */\nexport const useTheme = <T extends TTheme>() => {\n const theme: T = (useContext(ThemeContext) || DEFAULT_THEME) as T\n return { theme }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,EAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,EAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,EAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAZ,EAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IA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EAAEC,aAAK;EACZC,IAAI,EAAEC;AACR,CAAC;AAAA1B,OAAA,CAAAsB,MAAA,GAAAA,MAAA;AAED,IAAMK,aAAa,GAAGH,aAAK;AAO3B;AACA;AACA;AACO,IAAMI,KAAoD,GAAG,SAAvDA,KAAoDA,CAAAC,IAAA,EAG3D;EAAA,IAFJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,UAAA,GAAAF,IAAA,CACRG,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,OAAO,GAAAA,UAAA;EAEf,IAAME,aAAa,GAAGX,MAAM,CAACU,KAAK,CAAC;EACnC,oBAAO9C,MAAA,CAAA4B,OAAA,CAAAoB,aAAA,CAAC7C,iBAAA,CAAA8C,aAAa;IAACH,KAAK,EAAEC;EAAc,GAAEH,QAAQ,CAAiB;AACxE,CAAC;AAAA9B,OAAA,CAAA4B,KAAA,GAAAA,KAAA;AANYA,KAAoD,CAAAQ,WAAA;AAQjE;AACO,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAA,EAA2B;EAC9C,IAAML,KAAQ,GAAI,IAAAM,iBAAU,EAACC,8BAAY,CAAC,IAAIZ,aAAmB;EACjE,OAAO;IAAEK,KAAK,EAALA;EAAM,CAAC;AAClB,CAAC;AAAAhC,OAAA,CAAAqC,QAAA,GAAAA,QAAA"}
|
|
@@ -233,7 +233,7 @@ var PhoneInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, forwarde
|
|
|
233
233
|
value: inputValue
|
|
234
234
|
}, inputProps)), /*#__PURE__*/_react.default.createElement(StyledLabel, {
|
|
235
235
|
htmlFor: inputName
|
|
236
|
-
}, "Phone
|
|
236
|
+
}, "Phone number", /*#__PURE__*/_react.default.createElement("span", null))), isDropdownVisible && /*#__PURE__*/_react.default.createElement(SelectDropdown, {
|
|
237
237
|
ref: tooltipRef,
|
|
238
238
|
role: "listbox",
|
|
239
239
|
width: width
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.js","names":["_composeReactRefs","_interopRequireDefault","require","_themeGet","_react","_interopRequireWildcard","_styledComponents","_styledSystem","_utils","_Box","_Input","_Text","_tokens","_useKeyboardListNavigation","_RequiredField","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","PhoneInput","React","forwardRef","_ref","forwardedRef","className","options","disabled","error","focus","hover","required","onSelect","dropdownValue","inputValue","rest","Error","inputRef","useRef","searchInputRef","containerRef","countryPickerRef","defaultOption","useMemo","find","option","_splitBoxProps","splitBoxProps","_splitBoxProps2","boxProps","inputProps","_useState","useState","_useState2","isDropdownVisible","setDropdownVisible","_useState3","_useState4","searchQuery","setSearchQuery","_useState5","_useState6","selectedOption","setSelectedOption","filteredOptions","filter","filteredCountry","text","toLowerCase","includes","_usePosition","usePosition","position","offset","active","flip","anchorRef","tooltipRef","_useKeyboardListNavig","useKeyboardListNavigation","ref","list","waitForInteractive","onEnter","_ref2","element","event","preventDefault","stopPropagation","handleSelect","resetUI","reset","_useWidthOf","useWidthOf","width","inputName","optionsWithRefs","map","createRef","setTimeout","_inputRef$current","current","_inputRef$current2","handleFocusChange","useCallback","focused","_useContainsFocus","useContainsFocus","onChange","containsFocusRef","handleCountryPickerKeydown","_countryPickerRef$cur","blur","handleSearchInputKeydown","_searchInputRef$curre","shiftKey","cursor","interactive","createElement","Box","composeRefs","ContainerBox","placeholder","SelectContainer","onClick","tabIndex","onKeyDown","StyledInput","type","autoComplete","maxLength","StyledLabel","htmlFor","SelectDropdown","role","Input","p","pb","autoFocus","e","SelectOptions","_ref3","SelectOption","selected","Text","minWidth","RequiredField","mt","ml","variant","mr","color","textAlign","exports","displayName","caretMixin","css","themeGet","_ref4","styled","withConfig","componentId","props","PHONE_INPUT_STATES","completed","input","systemHeight","label"],"sources":["../../../src/elements/PhoneInput/PhoneInput.tsx"],"sourcesContent":["import composeRefs from \"@seznam/compose-react-refs\"\nimport { themeGet } from \"@styled-system/theme-get\"\nimport React, { createRef, useCallback, useMemo, useRef, useState } from \"react\"\nimport styled, { css, ExecutionContext } from \"styled-components\"\nimport { height as systemHeight } from \"styled-system\"\nimport { useContainsFocus, usePosition, useWidthOf } from \"../../utils\"\nimport { Box, splitBoxProps } from \"../Box\"\nimport { Input, InputProps } from \"../Input\"\nimport { Text } from \"../Text\"\nimport { PHONE_INPUT_STATES } from \"./tokens\"\nimport { useKeyboardListNavigation } from \"use-keyboard-list-navigation\"\nimport { RequiredField } from \"../../shared/RequiredField\"\n\n/**\n * The option structure for the list in the dropdown menu\n *\n * @interface Option\n * @property {string} `text` is the content that will be displayed as selected option\n * @property {string} `name` is the content that will be displayed in the dropdown list\n * @property {string} `value` is the value that will be passed to onSelect\n */\ninterface Option {\n text: string\n name: string\n value: string\n countryCode?: string\n flag?: string\n}\n\nexport interface PhoneInputProps extends Omit<InputProps, \"onSelect\"> {\n options: Option[]\n onSelect: (option: Option) => void\n active?: boolean\n disabled?: boolean\n error?: string | boolean\n focus?: boolean\n hover?: boolean\n required?: boolean\n dropdownValue?: string\n inputValue?: string\n}\n\nexport const PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(\n (\n {\n className,\n options,\n disabled,\n error,\n focus,\n hover,\n required,\n onSelect,\n dropdownValue,\n inputValue,\n ...rest\n },\n forwardedRef\n ) => {\n if (options.length === 0) {\n throw new Error(\n \"Palette PhoneInput requires at least 1 option in the options prop\"\n )\n }\n\n const inputRef = useRef<HTMLInputElement | null>(null)\n const searchInputRef = useRef<HTMLInputElement | null>(null)\n const containerRef = useRef<HTMLDivElement | null>(null)\n const countryPickerRef = useRef<HTMLDivElement | null>(null)\n\n const defaultOption = useMemo(\n () =>\n dropdownValue &&\n options.find((option) => option.value === dropdownValue),\n [dropdownValue, options]\n )\n\n const [boxProps, inputProps] = splitBoxProps(rest)\n const [isDropdownVisible, setDropdownVisible] = useState(false)\n const [searchQuery, setSearchQuery] = useState(\"\")\n const [selectedOption, setSelectedOption] = useState(\n defaultOption || options[0]\n )\n\n const filteredOptions = options.filter((option) => {\n if (searchQuery !== \"\") {\n const filteredCountry =\n option.text.toLowerCase().includes(searchQuery.toLowerCase()) ||\n option.name.toLowerCase().includes(searchQuery.toLowerCase())\n return filteredCountry\n }\n return true\n })\n\n const { anchorRef, tooltipRef } = usePosition({\n key: filteredOptions.length,\n position: \"bottom\",\n offset: 10,\n active: isDropdownVisible,\n flip: false,\n })\n\n const { reset, set } = useKeyboardListNavigation({\n ref: containerRef,\n list: filteredOptions,\n waitForInteractive: true,\n onEnter: ({ element: option, event }) => {\n event.preventDefault()\n event.stopPropagation()\n if (option) {\n handleSelect(option)\n }\n resetUI()\n },\n })\n\n const { width } = useWidthOf({ ref: anchorRef })\n\n const inputName = inputProps.name || \"palette-phone-input\"\n\n const optionsWithRefs = useMemo(() => {\n return filteredOptions.map((option) => ({\n option,\n ref: createRef<HTMLDivElement>(),\n }))\n }, [filteredOptions])\n\n const resetUI = () => {\n setTimeout(() => {\n inputRef.current?.focus()\n reset()\n setDropdownVisible(false)\n }, 100)\n }\n\n const handleSelect = (option: Option) => {\n inputRef.current?.focus()\n setSearchQuery(\"\")\n setSelectedOption(option)\n setDropdownVisible(false)\n onSelect?.(option)\n }\n\n const handleFocusChange = useCallback(\n (focused: boolean) => {\n if (focused || !isDropdownVisible) return\n\n setDropdownVisible(false)\n },\n [isDropdownVisible]\n )\n\n // Handle closing the dropdown when clicking outside of the input\n // or when focus leaves the input completely\n const { ref: containsFocusRef } = useContainsFocus({\n onChange: handleFocusChange,\n })\n\n const handleCountryPickerKeydown = (\n event: React.KeyboardEvent<HTMLDivElement>\n ) => {\n switch (event.key) {\n case \"Escape\":\n event.preventDefault()\n event.stopPropagation()\n\n setDropdownVisible(false)\n countryPickerRef.current?.blur()\n reset()\n\n return\n\n case \"Enter\":\n case \" \":\n event.preventDefault()\n event.stopPropagation()\n\n if (!disabled) {\n setDropdownVisible(true)\n }\n return\n }\n }\n\n const handleSearchInputKeydown = (\n event: React.KeyboardEvent<HTMLInputElement>\n ) => {\n switch (event.key) {\n case \"Tab\":\n if (event.shiftKey) {\n // ignore\n } else {\n // move down to the list\n event.preventDefault()\n event.stopPropagation()\n reset()\n\n set({ cursor: 0, interactive: true })\n }\n return\n\n case \"Enter\":\n event.preventDefault()\n event.stopPropagation()\n if (filteredOptions.length) {\n handleSelect(filteredOptions[0])\n }\n return\n\n default:\n searchInputRef.current?.focus()\n }\n }\n\n return (\n <Box\n ref={composeRefs(containerRef, containsFocusRef) as any}\n width=\"100%\"\n className={className}\n {...boxProps}\n >\n <ContainerBox\n ref={anchorRef as any}\n isDropdownVisible={isDropdownVisible}\n hover={hover}\n focus={focus}\n error={error}\n disabled={disabled}\n placeholder={inputProps.placeholder}\n >\n <SelectContainer\n data-testid=\"country-picker\"\n ref={countryPickerRef as any}\n disabled={disabled}\n onClick={() => {\n setDropdownVisible(!disabled && !isDropdownVisible)\n }}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleCountryPickerKeydown}\n >\n {selectedOption.text}\n </SelectContainer>\n\n <StyledInput\n disabled={disabled}\n ref={composeRefs(inputRef, forwardedRef) as any}\n type=\"tel\"\n autoComplete=\"tel-national\"\n required={required}\n name={inputName}\n maxLength={25}\n placeholder={inputProps.placeholder}\n value={inputValue}\n {...inputProps}\n />\n\n <StyledLabel htmlFor={inputName}>\n Phone Number\n <span />\n </StyledLabel>\n </ContainerBox>\n\n {isDropdownVisible && (\n <SelectDropdown ref={tooltipRef as any} role=\"listbox\" width={width}>\n <Input\n ref={searchInputRef}\n p={1}\n pb={0}\n autoFocus\n placeholder=\"Search\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n onKeyDown={handleSearchInputKeydown}\n />\n\n <SelectOptions>\n {optionsWithRefs.map(({ option, ref }, i) => {\n return (\n <SelectOption\n key={i}\n ref={ref as any}\n role=\"option\"\n aria-selected={option.value === selectedOption.value}\n aria-posinset={i + 1}\n aria-setsize={options.length}\n selected={option.value === selectedOption.value}\n onClick={() => handleSelect(option)}\n tabIndex={-1}\n >\n <Text minWidth={80}>{option.text}</Text>\n <Text>{option.name}</Text>\n </SelectOption>\n )\n })}\n </SelectOptions>\n </SelectDropdown>\n )}\n\n {required && !(error && typeof error === \"string\") && (\n <RequiredField mt={0.5} ml={1} disabled={disabled} />\n )}\n\n {error && typeof error === \"string\" && (\n <Text variant=\"xs\" mt={0.5} mr={1} color=\"red100\" textAlign=\"right\">\n {error}\n </Text>\n )}\n </Box>\n )\n }\n)\n\nPhoneInput.displayName = \"PhoneInput\"\n\ninterface CaretProps extends ExecutionContext {\n disabled?: boolean\n}\n\nconst caretMixin = css`\n &::after {\n content: \"\";\n cursor: inherit;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: ${themeGet(\"space.1\")};\n pointer-events: none;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid\n ${({ disabled }: CaretProps) => {\n return disabled ? themeGet(\"colors.mono10\") : themeGet(\"colors.mono60\")\n }};\n }\n`\n\ntype ContainerProps = Pick<\n PhoneInputProps,\n \"disabled\" | \"error\" | \"hover\" | \"focus\" | \"placeholder\"\n> & { isDropdownVisible: boolean }\n\nconst ContainerBox = styled(Box)<ContainerProps>`\n position: relative;\n display: flex;\n flex-direction: row;\n\n ${(props) => {\n return css`\n ${PHONE_INPUT_STATES.default}\n ${props.hover && PHONE_INPUT_STATES.hover}\n ${(props.focus || props.isDropdownVisible) && PHONE_INPUT_STATES.focus}\n ${props.disabled && PHONE_INPUT_STATES.disabled}\n ${props.error && PHONE_INPUT_STATES.error}\n\n &:hover {\n /* Applies hover style if the dropdown is not visible or the input is disabled */\n ${!props.isDropdownVisible &&\n !props.disabled &&\n PHONE_INPUT_STATES.hover}\n }\n\n &:focus-within {\n ${!props.disabled && PHONE_INPUT_STATES.focus}\n\n &:has(input:not(:placeholder-shown)) {\n ${PHONE_INPUT_STATES.active}\n ${props.error && PHONE_INPUT_STATES.error};\n }\n }\n\n &:has(input:not(:placeholder-shown)) {\n ${!!props.placeholder && PHONE_INPUT_STATES.completed}\n ${props.error && PHONE_INPUT_STATES.error};\n }\n `\n }}\n`\n\nconst SelectContainer = styled(Box)<{ disabled?: boolean }>`\n display: flex;\n align-items: center;\n position: relative;\n min-width: 120px;\n border: 1px solid;\n border-right: 0;\n /* 24px = space.1 + 4px-wide caret + space.1 */\n padding: 0 24px 0 ${themeGet(\"space.1\")};\n font-family: ${themeGet(\"fonts.sans\")};\n border-radius: 3px 0 0 3px;\n border-color: ${themeGet(\"colors.mono30\")};\n cursor: pointer;\n line-height: 1;\n transition: color 0.25s, border-color 0.25s;\n height: 50px;\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.mono100\")};\n\n ${caretMixin}\n`\n\nconst SelectDropdown = styled(Box)`\n box-shadow: ${themeGet(\"effects.dropShadow\")};\n z-index: 1;\n background: ${themeGet(\"colors.mono0\")};\n`\n\nconst SelectOptions = styled(Box)`\n /* 308 = Roughly, 5.5 default sized options */\n max-height: 308px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n padding: ${themeGet(\"space.1\")};\n`\n\nconst SelectOption = styled(Box)<{ selected?: boolean }>`\n padding: ${themeGet(\"space.1\")} 0;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n align-items: center;\n text-decoration: none;\n color: ${themeGet(\"colors.mono60\")};\n transition: color 0.25s, text-decoration 0.25s;\n\n &:hover {\n color: ${themeGet(\"colors.blue100\")};\n text-decoration: underline;\n }\n\n &:focus,\n &:active {\n color: ${themeGet(\"colors.mono100\")};\n text-decoration: none;\n }\n\n ${(props) =>\n props.selected &&\n css`\n color: ${themeGet(\"colors.mono100\")};\n text-decoration: none;\n `}\n`\n\nconst StyledInput = styled.input`\n width: 100%;\n background-color: ${themeGet(\"colors.mono0\")};\n padding: 0 ${themeGet(\"space.1\")};\n appearance: none;\n outline: none;\n line-height: 1;\n border: 1px solid;\n border-radius: 0 3px 3px 0;\n transition: color 0.25s, border-color 0.25s;\n font-family: ${themeGet(\"fonts.sans\")};\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.mono100\")};\n border-color: ${themeGet(\"colors.mono30\")};\n ${systemHeight}\n\n ::placeholder {\n color: ${themeGet(\"colors.mono60\")};\n transition: color 0.25s;\n }\n`\n\nconst StyledLabel = styled.label`\n position: absolute;\n top: 0;\n left: 5px;\n padding: 0 5px;\n background-color: transparent;\n transform: translateY(-50%);\n transition: color 0.25s;\n font-family: ${themeGet(\"fonts.sans\")};\n pointer-events: none;\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n color: ${themeGet(\"colors.mono60\")};\n\n & > span {\n background-color: ${themeGet(\"colors.mono0\")};\n height: 2px;\n width: 100%;\n display: block;\n position: absolute;\n top: 50%;\n left: 0;\n z-index: -1;\n }\n`\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAD,uBAAA,CAAAH,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,M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,CAACM,KAAK,CAAAL,UAAA;EAAAN,WAAA;EAAAO,WAAA;AAAA,4SAEV,IAAAJ,kBAAQ,EAAC,cAAc,CAAC,EAC/B,IAAAA,kBAAQ,EAAC,SAAS,CAAC,EAOjB,IAAAA,kBAAQ,EAAC,YAAY,CAAC,EACxB,IAAAA,kBAAQ,EAAC,kCAAkC,CAAC,EAChD,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,EACnB,IAAAA,kBAAQ,EAAC,eAAe,CAAC,EACvCS,oBAAY,EAGH,IAAAT,kBAAQ,EAAC,eAAe,CAAC,CAGrC;AAED,IAAM1B,WAAW,GAAG4B,yBAAM,CAACQ,KAAK,CAAAP,UAAA;EAAAN,WAAA;EAAAO,WAAA;AAAA,sTAQf,IAAAJ,kBAAQ,EAAC,YAAY,CAAC,EAExB,IAAAA,kBAAQ,EAAC,0BAA0B,CAAC,EACxC,IAAAA,kBAAQ,EAAC,eAAe,CAAC,EAGZ,IAAAA,kBAAQ,EAAC,cAAc,CAAC,CAS/C"}
|
|
1
|
+
{"version":3,"file":"PhoneInput.js","names":["_composeReactRefs","_interopRequireDefault","require","_themeGet","_react","_interopRequireWildcard","_styledComponents","_styledSystem","_utils","_Box","_Input","_Text","_tokens","_useKeyboardListNavigation","_RequiredField","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","PhoneInput","React","forwardRef","_ref","forwardedRef","className","options","disabled","error","focus","hover","required","onSelect","dropdownValue","inputValue","rest","Error","inputRef","useRef","searchInputRef","containerRef","countryPickerRef","defaultOption","useMemo","find","option","_splitBoxProps","splitBoxProps","_splitBoxProps2","boxProps","inputProps","_useState","useState","_useState2","isDropdownVisible","setDropdownVisible","_useState3","_useState4","searchQuery","setSearchQuery","_useState5","_useState6","selectedOption","setSelectedOption","filteredOptions","filter","filteredCountry","text","toLowerCase","includes","_usePosition","usePosition","position","offset","active","flip","anchorRef","tooltipRef","_useKeyboardListNavig","useKeyboardListNavigation","ref","list","waitForInteractive","onEnter","_ref2","element","event","preventDefault","stopPropagation","handleSelect","resetUI","reset","_useWidthOf","useWidthOf","width","inputName","optionsWithRefs","map","createRef","setTimeout","_inputRef$current","current","_inputRef$current2","handleFocusChange","useCallback","focused","_useContainsFocus","useContainsFocus","onChange","containsFocusRef","handleCountryPickerKeydown","_countryPickerRef$cur","blur","handleSearchInputKeydown","_searchInputRef$curre","shiftKey","cursor","interactive","createElement","Box","composeRefs","ContainerBox","placeholder","SelectContainer","onClick","tabIndex","onKeyDown","StyledInput","type","autoComplete","maxLength","StyledLabel","htmlFor","SelectDropdown","role","Input","p","pb","autoFocus","e","SelectOptions","_ref3","SelectOption","selected","Text","minWidth","RequiredField","mt","ml","variant","mr","color","textAlign","exports","displayName","caretMixin","css","themeGet","_ref4","styled","withConfig","componentId","props","PHONE_INPUT_STATES","completed","input","systemHeight","label"],"sources":["../../../src/elements/PhoneInput/PhoneInput.tsx"],"sourcesContent":["import composeRefs from \"@seznam/compose-react-refs\"\nimport { themeGet } from \"@styled-system/theme-get\"\nimport React, { createRef, useCallback, useMemo, useRef, useState } from \"react\"\nimport styled, { css, ExecutionContext } from \"styled-components\"\nimport { height as systemHeight } from \"styled-system\"\nimport { useContainsFocus, usePosition, useWidthOf } from \"../../utils\"\nimport { Box, splitBoxProps } from \"../Box\"\nimport { Input, InputProps } from \"../Input\"\nimport { Text } from \"../Text\"\nimport { PHONE_INPUT_STATES } from \"./tokens\"\nimport { useKeyboardListNavigation } from \"use-keyboard-list-navigation\"\nimport { RequiredField } from \"../../shared/RequiredField\"\n\n/**\n * The option structure for the list in the dropdown menu\n *\n * @interface Option\n * @property {string} `text` is the content that will be displayed as selected option\n * @property {string} `name` is the content that will be displayed in the dropdown list\n * @property {string} `value` is the value that will be passed to onSelect\n */\ninterface Option {\n text: string\n name: string\n value: string\n countryCode?: string\n flag?: string\n}\n\nexport interface PhoneInputProps extends Omit<InputProps, \"onSelect\"> {\n options: Option[]\n onSelect: (option: Option) => void\n active?: boolean\n disabled?: boolean\n error?: string | boolean\n focus?: boolean\n hover?: boolean\n required?: boolean\n dropdownValue?: string\n inputValue?: string\n}\n\nexport const PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(\n (\n {\n className,\n options,\n disabled,\n error,\n focus,\n hover,\n required,\n onSelect,\n dropdownValue,\n inputValue,\n ...rest\n },\n forwardedRef\n ) => {\n if (options.length === 0) {\n throw new Error(\n \"Palette PhoneInput requires at least 1 option in the options prop\"\n )\n }\n\n const inputRef = useRef<HTMLInputElement | null>(null)\n const searchInputRef = useRef<HTMLInputElement | null>(null)\n const containerRef = useRef<HTMLDivElement | null>(null)\n const countryPickerRef = useRef<HTMLDivElement | null>(null)\n\n const defaultOption = useMemo(\n () =>\n dropdownValue &&\n options.find((option) => option.value === dropdownValue),\n [dropdownValue, options]\n )\n\n const [boxProps, inputProps] = splitBoxProps(rest)\n const [isDropdownVisible, setDropdownVisible] = useState(false)\n const [searchQuery, setSearchQuery] = useState(\"\")\n const [selectedOption, setSelectedOption] = useState(\n defaultOption || options[0]\n )\n\n const filteredOptions = options.filter((option) => {\n if (searchQuery !== \"\") {\n const filteredCountry =\n option.text.toLowerCase().includes(searchQuery.toLowerCase()) ||\n option.name.toLowerCase().includes(searchQuery.toLowerCase())\n return filteredCountry\n }\n return true\n })\n\n const { anchorRef, tooltipRef } = usePosition({\n key: filteredOptions.length,\n position: \"bottom\",\n offset: 10,\n active: isDropdownVisible,\n flip: false,\n })\n\n const { reset, set } = useKeyboardListNavigation({\n ref: containerRef,\n list: filteredOptions,\n waitForInteractive: true,\n onEnter: ({ element: option, event }) => {\n event.preventDefault()\n event.stopPropagation()\n if (option) {\n handleSelect(option)\n }\n resetUI()\n },\n })\n\n const { width } = useWidthOf({ ref: anchorRef })\n\n const inputName = inputProps.name || \"palette-phone-input\"\n\n const optionsWithRefs = useMemo(() => {\n return filteredOptions.map((option) => ({\n option,\n ref: createRef<HTMLDivElement>(),\n }))\n }, [filteredOptions])\n\n const resetUI = () => {\n setTimeout(() => {\n inputRef.current?.focus()\n reset()\n setDropdownVisible(false)\n }, 100)\n }\n\n const handleSelect = (option: Option) => {\n inputRef.current?.focus()\n setSearchQuery(\"\")\n setSelectedOption(option)\n setDropdownVisible(false)\n onSelect?.(option)\n }\n\n const handleFocusChange = useCallback(\n (focused: boolean) => {\n if (focused || !isDropdownVisible) return\n\n setDropdownVisible(false)\n },\n [isDropdownVisible]\n )\n\n // Handle closing the dropdown when clicking outside of the input\n // or when focus leaves the input completely\n const { ref: containsFocusRef } = useContainsFocus({\n onChange: handleFocusChange,\n })\n\n const handleCountryPickerKeydown = (\n event: React.KeyboardEvent<HTMLDivElement>\n ) => {\n switch (event.key) {\n case \"Escape\":\n event.preventDefault()\n event.stopPropagation()\n\n setDropdownVisible(false)\n countryPickerRef.current?.blur()\n reset()\n\n return\n\n case \"Enter\":\n case \" \":\n event.preventDefault()\n event.stopPropagation()\n\n if (!disabled) {\n setDropdownVisible(true)\n }\n return\n }\n }\n\n const handleSearchInputKeydown = (\n event: React.KeyboardEvent<HTMLInputElement>\n ) => {\n switch (event.key) {\n case \"Tab\":\n if (event.shiftKey) {\n // ignore\n } else {\n // move down to the list\n event.preventDefault()\n event.stopPropagation()\n reset()\n\n set({ cursor: 0, interactive: true })\n }\n return\n\n case \"Enter\":\n event.preventDefault()\n event.stopPropagation()\n if (filteredOptions.length) {\n handleSelect(filteredOptions[0])\n }\n return\n\n default:\n searchInputRef.current?.focus()\n }\n }\n\n return (\n <Box\n ref={composeRefs(containerRef, containsFocusRef) as any}\n width=\"100%\"\n className={className}\n {...boxProps}\n >\n <ContainerBox\n ref={anchorRef as any}\n isDropdownVisible={isDropdownVisible}\n hover={hover}\n focus={focus}\n error={error}\n disabled={disabled}\n placeholder={inputProps.placeholder}\n >\n <SelectContainer\n data-testid=\"country-picker\"\n ref={countryPickerRef as any}\n disabled={disabled}\n onClick={() => {\n setDropdownVisible(!disabled && !isDropdownVisible)\n }}\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleCountryPickerKeydown}\n >\n {selectedOption.text}\n </SelectContainer>\n\n <StyledInput\n disabled={disabled}\n ref={composeRefs(inputRef, forwardedRef) as any}\n type=\"tel\"\n autoComplete=\"tel-national\"\n required={required}\n name={inputName}\n maxLength={25}\n placeholder={inputProps.placeholder}\n value={inputValue}\n {...inputProps}\n />\n\n <StyledLabel htmlFor={inputName}>\n Phone number\n <span />\n </StyledLabel>\n </ContainerBox>\n\n {isDropdownVisible && (\n <SelectDropdown ref={tooltipRef as any} role=\"listbox\" width={width}>\n <Input\n ref={searchInputRef}\n p={1}\n pb={0}\n autoFocus\n placeholder=\"Search\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n onKeyDown={handleSearchInputKeydown}\n />\n\n <SelectOptions>\n {optionsWithRefs.map(({ option, ref }, i) => {\n return (\n <SelectOption\n key={i}\n ref={ref as any}\n role=\"option\"\n aria-selected={option.value === selectedOption.value}\n aria-posinset={i + 1}\n aria-setsize={options.length}\n selected={option.value === selectedOption.value}\n onClick={() => handleSelect(option)}\n tabIndex={-1}\n >\n <Text minWidth={80}>{option.text}</Text>\n <Text>{option.name}</Text>\n </SelectOption>\n )\n })}\n </SelectOptions>\n </SelectDropdown>\n )}\n\n {required && !(error && typeof error === \"string\") && (\n <RequiredField mt={0.5} ml={1} disabled={disabled} />\n )}\n\n {error && typeof error === \"string\" && (\n <Text variant=\"xs\" mt={0.5} mr={1} color=\"red100\" textAlign=\"right\">\n {error}\n </Text>\n )}\n </Box>\n )\n }\n)\n\nPhoneInput.displayName = \"PhoneInput\"\n\ninterface CaretProps extends ExecutionContext {\n disabled?: boolean\n}\n\nconst caretMixin = css`\n &::after {\n content: \"\";\n cursor: inherit;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: ${themeGet(\"space.1\")};\n pointer-events: none;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid\n ${({ disabled }: CaretProps) => {\n return disabled ? themeGet(\"colors.mono10\") : themeGet(\"colors.mono60\")\n }};\n }\n`\n\ntype ContainerProps = Pick<\n PhoneInputProps,\n \"disabled\" | \"error\" | \"hover\" | \"focus\" | \"placeholder\"\n> & { isDropdownVisible: boolean }\n\nconst ContainerBox = styled(Box)<ContainerProps>`\n position: relative;\n display: flex;\n flex-direction: row;\n\n ${(props) => {\n return css`\n ${PHONE_INPUT_STATES.default}\n ${props.hover && PHONE_INPUT_STATES.hover}\n ${(props.focus || props.isDropdownVisible) && PHONE_INPUT_STATES.focus}\n ${props.disabled && PHONE_INPUT_STATES.disabled}\n ${props.error && PHONE_INPUT_STATES.error}\n\n &:hover {\n /* Applies hover style if the dropdown is not visible or the input is disabled */\n ${!props.isDropdownVisible &&\n !props.disabled &&\n PHONE_INPUT_STATES.hover}\n }\n\n &:focus-within {\n ${!props.disabled && PHONE_INPUT_STATES.focus}\n\n &:has(input:not(:placeholder-shown)) {\n ${PHONE_INPUT_STATES.active}\n ${props.error && PHONE_INPUT_STATES.error};\n }\n }\n\n &:has(input:not(:placeholder-shown)) {\n ${!!props.placeholder && PHONE_INPUT_STATES.completed}\n ${props.error && PHONE_INPUT_STATES.error};\n }\n `\n }}\n`\n\nconst SelectContainer = styled(Box)<{ disabled?: boolean }>`\n display: flex;\n align-items: center;\n position: relative;\n min-width: 120px;\n border: 1px solid;\n border-right: 0;\n /* 24px = space.1 + 4px-wide caret + space.1 */\n padding: 0 24px 0 ${themeGet(\"space.1\")};\n font-family: ${themeGet(\"fonts.sans\")};\n border-radius: 3px 0 0 3px;\n border-color: ${themeGet(\"colors.mono30\")};\n cursor: pointer;\n line-height: 1;\n transition: color 0.25s, border-color 0.25s;\n height: 50px;\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.mono100\")};\n\n ${caretMixin}\n`\n\nconst SelectDropdown = styled(Box)`\n box-shadow: ${themeGet(\"effects.dropShadow\")};\n z-index: 1;\n background: ${themeGet(\"colors.mono0\")};\n`\n\nconst SelectOptions = styled(Box)`\n /* 308 = Roughly, 5.5 default sized options */\n max-height: 308px;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n padding: ${themeGet(\"space.1\")};\n`\n\nconst SelectOption = styled(Box)<{ selected?: boolean }>`\n padding: ${themeGet(\"space.1\")} 0;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n align-items: center;\n text-decoration: none;\n color: ${themeGet(\"colors.mono60\")};\n transition: color 0.25s, text-decoration 0.25s;\n\n &:hover {\n color: ${themeGet(\"colors.blue100\")};\n text-decoration: underline;\n }\n\n &:focus,\n &:active {\n color: ${themeGet(\"colors.mono100\")};\n text-decoration: none;\n }\n\n ${(props) =>\n props.selected &&\n css`\n color: ${themeGet(\"colors.mono100\")};\n text-decoration: none;\n `}\n`\n\nconst StyledInput = styled.input`\n width: 100%;\n background-color: ${themeGet(\"colors.mono0\")};\n padding: 0 ${themeGet(\"space.1\")};\n appearance: none;\n outline: none;\n line-height: 1;\n border: 1px solid;\n border-radius: 0 3px 3px 0;\n transition: color 0.25s, border-color 0.25s;\n font-family: ${themeGet(\"fonts.sans\")};\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.mono100\")};\n border-color: ${themeGet(\"colors.mono30\")};\n ${systemHeight}\n\n ::placeholder {\n color: ${themeGet(\"colors.mono60\")};\n transition: color 0.25s;\n }\n`\n\nconst StyledLabel = styled.label`\n position: absolute;\n top: 0;\n left: 5px;\n padding: 0 5px;\n background-color: transparent;\n transform: translateY(-50%);\n transition: color 0.25s;\n font-family: ${themeGet(\"fonts.sans\")};\n pointer-events: none;\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n color: ${themeGet(\"colors.mono60\")};\n\n & > span {\n background-color: ${themeGet(\"colors.mono0\")};\n height: 2px;\n width: 100%;\n display: block;\n position: absolute;\n top: 50%;\n left: 0;\n z-index: -1;\n }\n`\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAD,uBAAA,CAAAH,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,0BAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAA0D,IAAAa,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAgB,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,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EAAC,eAAe,CAAC,EAGZ,IAAAA,kBAAQ,EAAC,cAAc,CAAC,CAS/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.8.1",
|
|
4
4
|
"description": "Design system library for react components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
120
|
"@artsy/icons": "^3.2.2",
|
|
121
|
-
"@artsy/palette-tokens": "^7.0.
|
|
121
|
+
"@artsy/palette-tokens": "^7.0.1",
|
|
122
122
|
"@seznam/compose-react-refs": "^1.0.6",
|
|
123
123
|
"@styled-system/theme-get": "^5.1.2",
|
|
124
124
|
"es-toolkit": "^1.16.0",
|
|
@@ -187,5 +187,5 @@
|
|
|
187
187
|
"url": "http://localhost"
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
|
-
"gitHead": "
|
|
190
|
+
"gitHead": "a677dc3f0858561f042de36a4560f6678de262a9"
|
|
191
191
|
}
|