@sanity/ui 0.37.20 → 0.37.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dts/src/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/lib/dts/src/components/dialog/dialog.d.ts.map +1 -1
- package/lib/dts/src/components/dialog/styles.d.ts +1 -1
- package/lib/dts/src/components/dialog/styles.d.ts.map +1 -1
- package/lib/dts/src/components/hotkeys/hotkeys.d.ts.map +1 -1
- package/lib/dts/src/components/menu/menuGroup.d.ts.map +1 -1
- package/lib/dts/src/components/skeleton/skeleton.d.ts.map +1 -1
- package/lib/dts/src/hooks/index.d.ts +1 -2
- package/lib/dts/src/hooks/index.d.ts.map +1 -1
- package/lib/dts/src/hooks/useElementRect/useElementRect.d.ts +1 -1
- package/lib/dts/src/hooks/useElementRect/useElementRect.d.ts.map +1 -1
- package/lib/dts/src/hooks/useResponsiveProp.d.ts +6 -0
- package/lib/dts/src/hooks/useResponsiveProp.d.ts.map +1 -0
- package/lib/dts/src/index.d.ts +0 -1
- package/lib/dts/src/index.d.ts.map +1 -1
- package/lib/dts/src/primitives/_selectable/selectable.d.ts +2 -1
- package/lib/dts/src/primitives/_selectable/selectable.d.ts.map +1 -1
- package/lib/dts/src/primitives/avatar/avatar.d.ts.map +1 -1
- package/lib/dts/src/primitives/avatar/avatarCounter.d.ts.map +1 -1
- package/lib/dts/src/primitives/avatar/avatarStack.d.ts.map +1 -1
- package/lib/dts/src/primitives/avatar/styles.d.ts.map +1 -1
- package/lib/dts/src/primitives/badge/badge.d.ts.map +1 -1
- package/lib/dts/src/primitives/box/box.d.ts.map +1 -1
- package/lib/dts/src/primitives/button/button.d.ts.map +1 -1
- package/lib/dts/src/primitives/card/card.d.ts.map +1 -1
- package/lib/dts/src/primitives/code/code.d.ts.map +1 -1
- package/lib/dts/src/primitives/container/container.d.ts.map +1 -1
- package/lib/dts/src/primitives/container/styles.d.ts.map +1 -1
- package/lib/dts/src/primitives/container/types.d.ts +1 -1
- package/lib/dts/src/primitives/container/types.d.ts.map +1 -1
- package/lib/dts/src/primitives/flex/flex.d.ts.map +1 -1
- package/lib/dts/src/primitives/grid/grid.d.ts.map +1 -1
- package/lib/dts/src/primitives/heading/heading.d.ts.map +1 -1
- package/lib/dts/src/primitives/inline/inline.d.ts.map +1 -1
- package/lib/dts/src/primitives/inline/styles.d.ts.map +1 -1
- package/lib/dts/src/primitives/inline/types.d.ts +1 -1
- package/lib/dts/src/primitives/inline/types.d.ts.map +1 -1
- package/lib/dts/src/primitives/kbd/kbd.d.ts.map +1 -1
- package/lib/dts/src/primitives/label/label.d.ts.map +1 -1
- package/lib/dts/src/primitives/popover/popover.d.ts.map +1 -1
- package/lib/dts/src/primitives/select/styles.d.ts +1 -5
- package/lib/dts/src/primitives/select/styles.d.ts.map +1 -1
- package/lib/dts/src/primitives/stack/stack.d.ts.map +1 -1
- package/lib/dts/src/primitives/stack/styles.d.ts +1 -1
- package/lib/dts/src/primitives/stack/styles.d.ts.map +1 -1
- package/lib/dts/src/primitives/text/text.d.ts.map +1 -1
- package/lib/dts/src/primitives/textArea/textArea.d.ts.map +1 -1
- package/lib/dts/src/primitives/textInput/textInput.d.ts.map +1 -1
- package/lib/dts/src/primitives/tooltip/tooltip.d.ts.map +1 -1
- package/lib/dts/src/primitives/types.d.ts +1 -1
- package/lib/dts/src/primitives/types.d.ts.map +1 -1
- package/lib/dts/src/styles/border/types.d.ts +5 -5
- package/lib/dts/src/styles/border/types.d.ts.map +1 -1
- package/lib/dts/src/styles/box/types.d.ts +4 -4
- package/lib/dts/src/styles/box/types.d.ts.map +1 -1
- package/lib/dts/src/styles/flex/flexItemStyle.d.ts.map +1 -1
- package/lib/dts/src/styles/flex/types.d.ts +6 -6
- package/lib/dts/src/styles/flex/types.d.ts.map +1 -1
- package/lib/dts/src/styles/font/responsiveFont.d.ts.map +1 -1
- package/lib/dts/src/styles/font/types.d.ts +3 -3
- package/lib/dts/src/styles/font/types.d.ts.map +1 -1
- package/lib/dts/src/styles/grid/types.d.ts +14 -14
- package/lib/dts/src/styles/grid/types.d.ts.map +1 -1
- package/lib/dts/src/styles/helpers.d.ts +4 -4
- package/lib/dts/src/styles/helpers.d.ts.map +1 -1
- package/lib/dts/src/styles/input/responsiveInputPaddingStyle.d.ts +12 -12
- package/lib/dts/src/styles/input/responsiveInputPaddingStyle.d.ts.map +1 -1
- package/lib/dts/src/styles/input/textInputStyle.d.ts +2 -7
- package/lib/dts/src/styles/input/textInputStyle.d.ts.map +1 -1
- package/lib/dts/src/styles/margin/types.d.ts +7 -7
- package/lib/dts/src/styles/margin/types.d.ts.map +1 -1
- package/lib/dts/src/styles/padding/types.d.ts +7 -7
- package/lib/dts/src/styles/padding/types.d.ts.map +1 -1
- package/lib/dts/src/styles/radius/types.d.ts +1 -1
- package/lib/dts/src/styles/radius/types.d.ts.map +1 -1
- package/lib/dts/src/styles/shadow/shadowStyle.d.ts.map +1 -1
- package/lib/dts/src/styles/shadow/types.d.ts +1 -1
- package/lib/dts/src/styles/shadow/types.d.ts.map +1 -1
- package/lib/dts/src/theme/studioTheme/color.d.ts.map +1 -1
- package/lib/dts/src/utils/elementQuery/elementQuery.d.ts.map +1 -1
- package/lib/dts/src/utils/index.d.ts +1 -0
- package/lib/dts/src/utils/index.d.ts.map +1 -1
- package/lib/dts/src/utils/resizeObserver.d.ts +6 -0
- package/lib/dts/src/utils/resizeObserver.d.ts.map +1 -0
- package/lib/dts/src/utils/virtualList/virtualList.d.ts.map +1 -1
- package/lib/sanity-ui.js +570 -731
- package/lib/sanity-ui.js.map +1 -1
- package/lib/sanity-ui.modern.js +591 -762
- package/lib/sanity-ui.modern.js.map +1 -1
- package/lib/sanity-ui.module.js +566 -725
- package/lib/sanity-ui.module.js.map +1 -1
- package/package.json +11 -11
- package/src/__workshop__/color/overview.tsx +11 -9
- package/src/components/autocomplete/__workshop__/async.tsx +12 -14
- package/src/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -36
- package/src/components/autocomplete/autocomplete.tsx +2 -2
- package/src/components/breadcrumbs/breadcrumbs.tsx +2 -3
- package/src/components/dialog/dialog.tsx +9 -17
- package/src/components/dialog/styles.ts +4 -4
- package/src/components/hotkeys/hotkeys.tsx +1 -3
- package/src/components/menu/__workshop__/constrainedInBoundary.tsx +14 -11
- package/src/components/menu/__workshop__/groups.tsx +1 -1
- package/src/components/menu/menuGroup.tsx +2 -3
- package/src/components/menu/menuItem.tsx +3 -3
- package/src/components/skeleton/skeleton.tsx +1 -10
- package/src/components/skeleton/textSkeleton.tsx +7 -7
- package/src/hooks/index.ts +1 -2
- package/src/hooks/useElementRect/useElementRect.ts +16 -4
- package/src/hooks/useResponsiveProp.ts +10 -0
- package/src/index.ts +0 -1
- package/src/primitives/_selectable/selectable.tsx +4 -5
- package/src/primitives/avatar/avatar.tsx +5 -7
- package/src/primitives/avatar/avatarCounter.tsx +11 -12
- package/src/primitives/avatar/avatarStack.tsx +10 -15
- package/src/primitives/avatar/styles.ts +2 -2
- package/src/primitives/badge/badge.tsx +2 -3
- package/src/primitives/box/box.tsx +25 -26
- package/src/primitives/button/button.tsx +10 -22
- package/src/primitives/card/card.tsx +7 -8
- package/src/primitives/checkbox/__workshop__/example.tsx +2 -4
- package/src/primitives/checkbox/__workshop__/props.tsx +2 -4
- package/src/primitives/checkbox/__workshop__/readOnly.tsx +2 -4
- package/src/primitives/code/__workshop__/props.tsx +1 -1
- package/src/primitives/code/code.tsx +1 -2
- package/src/primitives/container/container.tsx +1 -10
- package/src/primitives/container/styles.ts +2 -2
- package/src/primitives/container/types.ts +1 -1
- package/src/primitives/flex/flex.tsx +5 -6
- package/src/primitives/grid/__workshop__/responsive.tsx +12 -13
- package/src/primitives/grid/grid.tsx +8 -9
- package/src/primitives/heading/__workshop__/opticalAlignment.tsx +7 -19
- package/src/primitives/heading/heading.tsx +2 -3
- package/src/primitives/inline/inline.tsx +6 -12
- package/src/primitives/inline/styles.ts +2 -2
- package/src/primitives/inline/types.ts +1 -1
- package/src/primitives/kbd/kbd.tsx +1 -2
- package/src/primitives/label/label.tsx +3 -4
- package/src/primitives/popover/__workshop__/index.ts +5 -10
- package/src/primitives/popover/__workshop__/{MarginsStory.tsx → margins.tsx} +1 -1
- package/src/primitives/popover/__workshop__/{MatchReferenceWidthStory.tsx → matchReferenceWidth.tsx} +0 -0
- package/src/primitives/popover/__workshop__/{PlainStory.tsx → plain.tsx} +14 -12
- package/src/primitives/popover/__workshop__/{RecursiveStory.tsx → recursive.tsx} +1 -4
- package/src/primitives/popover/__workshop__/rightAligned.tsx +57 -0
- package/src/primitives/popover/popover.tsx +10 -29
- package/src/primitives/select/select.tsx +9 -9
- package/src/primitives/select/styles.ts +4 -10
- package/src/primitives/stack/stack.tsx +1 -2
- package/src/primitives/stack/styles.ts +3 -3
- package/src/primitives/text/__workshop__/opticalAlignment.tsx +5 -15
- package/src/primitives/text/text.tsx +2 -3
- package/src/primitives/textArea/__workshop__/plain.tsx +18 -23
- package/src/primitives/textArea/textArea.tsx +5 -21
- package/src/primitives/textInput/__workshop__/clearButton.tsx +8 -14
- package/src/primitives/textInput/__workshop__/index.ts +2 -2
- package/src/primitives/textInput/__workshop__/plain.tsx +32 -39
- package/src/primitives/textInput/__workshop__/tones.tsx +95 -234
- package/src/primitives/textInput/__workshop__/typed.tsx +2 -8
- package/src/primitives/textInput/textInput.tsx +12 -47
- package/src/primitives/tooltip/__workshop__/props.tsx +2 -7
- package/src/primitives/tooltip/tooltip.tsx +9 -19
- package/src/primitives/types.ts +1 -1
- package/src/styles/border/borderStyle.ts +6 -6
- package/src/styles/border/types.ts +5 -5
- package/src/styles/box/boxStyle.ts +5 -5
- package/src/styles/box/types.ts +4 -4
- package/src/styles/flex/flexItemStyle.ts +4 -5
- package/src/styles/flex/flexStyle.ts +6 -6
- package/src/styles/flex/types.ts +6 -6
- package/src/styles/font/responsiveFont.ts +4 -2
- package/src/styles/font/textAlignStyle.ts +2 -2
- package/src/styles/font/types.ts +3 -4
- package/src/styles/grid/gridItemStyle.ts +7 -7
- package/src/styles/grid/gridStyle.ts +9 -9
- package/src/styles/grid/types.ts +14 -14
- package/src/styles/helpers.ts +9 -9
- package/src/styles/input/responsiveInputPaddingStyle.ts +27 -24
- package/src/styles/input/textInputStyle.ts +80 -92
- package/src/styles/margin/marginStyle.ts +8 -8
- package/src/styles/margin/marginsStyle.test.ts +1 -1
- package/src/styles/margin/types.ts +7 -7
- package/src/styles/padding/paddingStyle.test.ts +1 -1
- package/src/styles/padding/paddingStyle.ts +8 -8
- package/src/styles/padding/types.ts +7 -7
- package/src/styles/radius/radiusStyle.ts +2 -2
- package/src/styles/radius/types.ts +1 -1
- package/src/styles/shadow/shadowStyle.ts +5 -2
- package/src/styles/shadow/types.ts +1 -1
- package/src/theme/studioTheme/color.ts +14 -15
- package/src/theme/studioTheme/fonts.ts +4 -4
- package/src/utils/elementQuery/elementQuery.tsx +18 -5
- package/src/utils/index.ts +1 -0
- package/src/utils/layer/layerProvider.tsx +2 -2
- package/src/{observers → utils}/resizeObserver.ts +3 -1
- package/src/utils/virtualList/virtualList.tsx +1 -3
- package/lib/dts/src/hooks/useArrayProp.d.ts +0 -7
- package/lib/dts/src/hooks/useArrayProp.d.ts.map +0 -1
- package/lib/dts/src/hooks/useElementSize.d.ts +0 -7
- package/lib/dts/src/hooks/useElementSize.d.ts.map +0 -1
- package/lib/dts/src/observers/elementSizeObserver.d.ts +0 -37
- package/lib/dts/src/observers/elementSizeObserver.d.ts.map +0 -1
- package/lib/dts/src/observers/index.d.ts +0 -3
- package/lib/dts/src/observers/index.d.ts.map +0 -1
- package/lib/dts/src/observers/resizeObserver.d.ts +0 -5
- package/lib/dts/src/observers/resizeObserver.d.ts.map +0 -1
- package/src/hooks/useArrayProp.ts +0 -23
- package/src/hooks/useElementSize.ts +0 -18
- package/src/observers/elementSizeObserver.ts +0 -116
- package/src/observers/index.ts +0 -2
- package/src/primitives/popover/__workshop__/RightAlignedStory.tsx +0 -60
- package/src/primitives/popover/__workshop__/TestStory.tsx +0 -79
|
@@ -3,7 +3,7 @@ import React, {createElement, forwardRef, isValidElement, useCallback, useMemo}
|
|
|
3
3
|
import {isValidElementType} from 'react-is'
|
|
4
4
|
import styled from 'styled-components'
|
|
5
5
|
import {EMPTY_RECORD} from '../../constants'
|
|
6
|
-
import {
|
|
6
|
+
import {useForwardedRef, useCustomValidity, useResponsiveProp} from '../../hooks'
|
|
7
7
|
import {
|
|
8
8
|
responsiveRadiusStyle,
|
|
9
9
|
ResponsiveRadiusStyleProps,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
textInputRepresentationStyle,
|
|
17
17
|
textInputRootStyle,
|
|
18
18
|
} from '../../styles/internal'
|
|
19
|
-
import {ThemeFontWeightKey
|
|
19
|
+
import {ThemeFontWeightKey} from '../../theme'
|
|
20
20
|
import {Box} from '../box'
|
|
21
21
|
import {Button, ButtonProps} from '../button'
|
|
22
22
|
import {Card} from '../card'
|
|
@@ -72,7 +72,7 @@ export interface TextInputProps {
|
|
|
72
72
|
|
|
73
73
|
const CLEAR_BUTTON_BOX_STYLE: React.CSSProperties = {zIndex: 2}
|
|
74
74
|
|
|
75
|
-
const Root = styled
|
|
75
|
+
const Root = styled.span(textInputRootStyle)
|
|
76
76
|
|
|
77
77
|
const InputRoot = styled.span`
|
|
78
78
|
flex: 1;
|
|
@@ -118,12 +118,6 @@ const LeftBox = styled(Box)`
|
|
|
118
118
|
left: 0;
|
|
119
119
|
`
|
|
120
120
|
|
|
121
|
-
const RightBox = styled(Box)`
|
|
122
|
-
position: absolute;
|
|
123
|
-
top: 0;
|
|
124
|
-
right: 0;
|
|
125
|
-
`
|
|
126
|
-
|
|
127
121
|
const RightCard = styled(Card)`
|
|
128
122
|
background-color: transparent;
|
|
129
123
|
position: absolute;
|
|
@@ -142,7 +136,7 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
142
136
|
border = true,
|
|
143
137
|
clearButton,
|
|
144
138
|
disabled = false,
|
|
145
|
-
fontSize
|
|
139
|
+
fontSize = 2,
|
|
146
140
|
icon,
|
|
147
141
|
iconRight,
|
|
148
142
|
onClear,
|
|
@@ -150,22 +144,16 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
150
144
|
prefix,
|
|
151
145
|
radius: radiusProp = 1,
|
|
152
146
|
readOnly,
|
|
153
|
-
space
|
|
147
|
+
space = 3,
|
|
154
148
|
suffix,
|
|
155
149
|
customValidity,
|
|
156
150
|
type = 'text',
|
|
157
|
-
weight,
|
|
158
151
|
...restProps
|
|
159
152
|
} = props
|
|
160
153
|
|
|
161
154
|
const ref = useForwardedRef(forwardedRef)
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
const fontSize = useArrayProp(fontSizeProp)
|
|
166
|
-
const padding = useArrayProp(paddingProp)
|
|
167
|
-
const radius = useArrayProp(radiusProp)
|
|
168
|
-
const space = useArrayProp(spaceProp)
|
|
155
|
+
const padding = useResponsiveProp(paddingProp)
|
|
156
|
+
const radius = useResponsiveProp(radiusProp)
|
|
169
157
|
|
|
170
158
|
// Transient properties
|
|
171
159
|
const $hasClearButton = Boolean(clearButton)
|
|
@@ -214,10 +202,6 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
214
202
|
$hasPrefix={$hasPrefix}
|
|
215
203
|
$hasSuffix={$hasSuffix}
|
|
216
204
|
$radius={radius}
|
|
217
|
-
$scheme={rootTheme.scheme}
|
|
218
|
-
$tone={rootTheme.tone}
|
|
219
|
-
data-scheme={rootTheme.scheme}
|
|
220
|
-
data-tone={rootTheme.tone}
|
|
221
205
|
>
|
|
222
206
|
{icon && (
|
|
223
207
|
<LeftBox padding={padding}>
|
|
@@ -229,27 +213,16 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
229
213
|
)}
|
|
230
214
|
|
|
231
215
|
{!$hasClearButton && iconRight && (
|
|
232
|
-
<
|
|
216
|
+
<RightCard padding={padding}>
|
|
233
217
|
<Text size={fontSize}>
|
|
234
218
|
{isValidElement(iconRight) && iconRight}
|
|
235
219
|
{isValidElementType(iconRight) && createElement(iconRight)}
|
|
236
220
|
</Text>
|
|
237
|
-
</
|
|
221
|
+
</RightCard>
|
|
238
222
|
)}
|
|
239
223
|
</Presentation>
|
|
240
224
|
),
|
|
241
|
-
[
|
|
242
|
-
border,
|
|
243
|
-
fontSize,
|
|
244
|
-
icon,
|
|
245
|
-
iconRight,
|
|
246
|
-
padding,
|
|
247
|
-
radius,
|
|
248
|
-
rootTheme,
|
|
249
|
-
$hasClearButton,
|
|
250
|
-
$hasPrefix,
|
|
251
|
-
$hasSuffix,
|
|
252
|
-
]
|
|
225
|
+
[border, fontSize, icon, iconRight, padding, radius, $hasClearButton, $hasPrefix, $hasSuffix]
|
|
253
226
|
)
|
|
254
227
|
|
|
255
228
|
// Render clear button (memoized)
|
|
@@ -330,33 +303,25 @@ export const TextInput = forwardRef(function TextInput(
|
|
|
330
303
|
)
|
|
331
304
|
|
|
332
305
|
return (
|
|
333
|
-
<Root data-ui="TextInput"
|
|
306
|
+
<Root data-ui="TextInput">
|
|
334
307
|
{prefixNode}
|
|
335
|
-
|
|
336
308
|
<InputRoot>
|
|
337
309
|
<Input
|
|
338
310
|
data-as="input"
|
|
339
|
-
data-scheme={rootTheme.scheme}
|
|
340
|
-
data-tone={rootTheme.tone}
|
|
341
311
|
{...restProps}
|
|
342
|
-
$fontSize={fontSize}
|
|
343
312
|
$iconLeft={$hasIcon}
|
|
344
313
|
$iconRight={$hasIconRight || $hasClearButton}
|
|
345
314
|
$padding={padding}
|
|
346
|
-
$scheme={rootTheme.scheme}
|
|
347
315
|
$space={space}
|
|
348
|
-
$
|
|
349
|
-
$weight={weight}
|
|
316
|
+
$fontSize={fontSize}
|
|
350
317
|
disabled={disabled}
|
|
351
318
|
readOnly={readOnly}
|
|
352
319
|
ref={ref}
|
|
353
320
|
type={type}
|
|
354
321
|
/>
|
|
355
|
-
|
|
356
322
|
{presentationNode}
|
|
357
323
|
{clearButtonNode}
|
|
358
324
|
</InputRoot>
|
|
359
|
-
|
|
360
325
|
{suffixNode}
|
|
361
326
|
</Root>
|
|
362
327
|
)
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import {Box, Button, Card, Flex, Text, Tooltip} from '@sanity/ui'
|
|
2
|
-
import {useSelect, useText} from '@sanity/ui-workshop'
|
|
3
2
|
import React from 'react'
|
|
4
|
-
import {WORKSHOP_PLACEMENT_OPTIONS} from '../../../__workshop__/constants'
|
|
5
3
|
|
|
6
4
|
export default function PropsStory() {
|
|
7
|
-
const content = useText('Content', 'Tooltip content')
|
|
8
|
-
const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'top')
|
|
9
|
-
|
|
10
5
|
return (
|
|
11
6
|
<Card height="fill">
|
|
12
7
|
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
13
8
|
<Tooltip
|
|
14
9
|
content={
|
|
15
10
|
<Box padding={2}>
|
|
16
|
-
<Text size={1}>
|
|
11
|
+
<Text size={1}>Tooltip content</Text>
|
|
17
12
|
</Box>
|
|
18
13
|
}
|
|
19
|
-
placement=
|
|
14
|
+
placement="top"
|
|
20
15
|
portal
|
|
21
16
|
>
|
|
22
17
|
<Button mode="bleed" text="Hover me" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, {cloneElement, forwardRef, useCallback, useEffect,
|
|
1
|
+
import React, {cloneElement, forwardRef, useCallback, useEffect, useState} from 'react'
|
|
2
2
|
import {usePopper} from 'react-popper'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
|
-
import {
|
|
4
|
+
import {useForwardedRef} from '../../hooks'
|
|
5
5
|
import {ThemeColorSchemeKey, useTheme} from '../../theme'
|
|
6
6
|
import {Placement} from '../../types'
|
|
7
7
|
import {Layer, LayerProps, Portal, useBoundaryElement} from '../../utils'
|
|
@@ -42,14 +42,13 @@ export const Tooltip = forwardRef(function Tooltip(
|
|
|
42
42
|
children,
|
|
43
43
|
content,
|
|
44
44
|
disabled,
|
|
45
|
-
fallbackPlacements
|
|
45
|
+
fallbackPlacements,
|
|
46
46
|
placement = 'bottom',
|
|
47
47
|
portal,
|
|
48
48
|
scheme,
|
|
49
49
|
zOffset = theme.sanity.layer?.tooltip.zOffset,
|
|
50
50
|
...restProps
|
|
51
51
|
} = props
|
|
52
|
-
const fallbackPlacements = useArrayProp(fallbackPlacementsProp)
|
|
53
52
|
const forwardedRef = useForwardedRef(ref)
|
|
54
53
|
const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null)
|
|
55
54
|
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null)
|
|
@@ -118,23 +117,14 @@ export const Tooltip = forwardRef(function Tooltip(
|
|
|
118
117
|
}
|
|
119
118
|
}, [isOpen, referenceElement])
|
|
120
119
|
|
|
121
|
-
const updateTimeoutRef = useRef<NodeJS.Timeout | null>(null)
|
|
122
|
-
|
|
123
120
|
useEffect(() => {
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
updateTimeoutRef.current = setTimeout(() => {
|
|
130
|
-
if (forceUpdate) {
|
|
131
|
-
try {
|
|
132
|
-
forceUpdate()
|
|
133
|
-
} catch (_) {
|
|
134
|
-
// ignore caught error
|
|
135
|
-
}
|
|
121
|
+
if (forceUpdate) {
|
|
122
|
+
try {
|
|
123
|
+
forceUpdate()
|
|
124
|
+
} catch (_) {
|
|
125
|
+
// ignore caught error
|
|
136
126
|
}
|
|
137
|
-
}
|
|
127
|
+
}
|
|
138
128
|
}, [forceUpdate, content])
|
|
139
129
|
|
|
140
130
|
// Close when `disabled` changes to `true`
|
package/src/primitives/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {
|
|
2
|
+
import {getResponsiveProp, responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveBorderStyleProps} from './types'
|
|
5
5
|
|
|
@@ -15,7 +15,7 @@ function border(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
15
15
|
const {theme} = props
|
|
16
16
|
const {media} = theme.sanity
|
|
17
17
|
|
|
18
|
-
return
|
|
18
|
+
return responsive(media, getResponsiveProp(props.$border), (value) =>
|
|
19
19
|
value ? {'&&': {border: BORDER_VALUE}} : {'&&': {border: 0}}
|
|
20
20
|
)
|
|
21
21
|
}
|
|
@@ -24,7 +24,7 @@ function borderTop(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
24
24
|
const {theme} = props
|
|
25
25
|
const {media} = theme.sanity
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return responsive(media, getResponsiveProp(props.$borderTop), (value) =>
|
|
28
28
|
value ? {'&&': {borderTop: BORDER_VALUE}} : {'&&': {borderTop: 0}}
|
|
29
29
|
)
|
|
30
30
|
}
|
|
@@ -33,7 +33,7 @@ function borderRight(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
33
33
|
const {theme} = props
|
|
34
34
|
const {media} = theme.sanity
|
|
35
35
|
|
|
36
|
-
return
|
|
36
|
+
return responsive(media, getResponsiveProp(props.$borderRight), (value) =>
|
|
37
37
|
value ? {'&&': {borderRight: BORDER_VALUE}} : {'&&': {borderRight: 0}}
|
|
38
38
|
)
|
|
39
39
|
}
|
|
@@ -42,7 +42,7 @@ function borderBottom(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
42
42
|
const {theme} = props
|
|
43
43
|
const {media} = theme.sanity
|
|
44
44
|
|
|
45
|
-
return
|
|
45
|
+
return responsive(media, getResponsiveProp(props.$borderBottom), (value) =>
|
|
46
46
|
value ? {'&&': {borderBottom: BORDER_VALUE}} : {'&&': {borderBottom: 0}}
|
|
47
47
|
)
|
|
48
48
|
}
|
|
@@ -51,7 +51,7 @@ function borderLeft(props: ResponsiveBorderStyleProps & ThemeProps) {
|
|
|
51
51
|
const {theme} = props
|
|
52
52
|
const {media} = theme.sanity
|
|
53
53
|
|
|
54
|
-
return
|
|
54
|
+
return responsive(media, getResponsiveProp(props.$borderLeft), (value) =>
|
|
55
55
|
value ? {'&&': {borderLeft: BORDER_VALUE}} : {'&&': {borderLeft: 0}}
|
|
56
56
|
)
|
|
57
57
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @internal
|
|
3
3
|
*/
|
|
4
4
|
export interface ResponsiveBorderStyleProps {
|
|
5
|
-
$border
|
|
6
|
-
$borderTop
|
|
7
|
-
$borderRight
|
|
8
|
-
$borderBottom
|
|
9
|
-
$borderLeft
|
|
5
|
+
$border?: boolean | boolean[]
|
|
6
|
+
$borderTop?: boolean | boolean[]
|
|
7
|
+
$borderRight?: boolean | boolean[]
|
|
8
|
+
$borderBottom?: boolean | boolean[]
|
|
9
|
+
$borderLeft?: boolean | boolean[]
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Property} from 'csstype'
|
|
2
2
|
import {CSSObject} from 'styled-components'
|
|
3
|
-
import {
|
|
3
|
+
import {getResponsiveProp, responsive} from '../helpers'
|
|
4
4
|
import {ThemeProps} from '../types'
|
|
5
5
|
import {ResponsiveBoxStyleProps} from './types'
|
|
6
6
|
|
|
@@ -39,7 +39,7 @@ function responsiveBoxDisplayStyle(props: ResponsiveBoxStyleProps & ThemeProps)
|
|
|
39
39
|
const {theme} = props
|
|
40
40
|
const {media} = theme.sanity
|
|
41
41
|
|
|
42
|
-
return
|
|
42
|
+
return responsive(media, getResponsiveProp(props.$display), (display) => ({
|
|
43
43
|
'&:not([hidden])': {display},
|
|
44
44
|
}))
|
|
45
45
|
}
|
|
@@ -48,7 +48,7 @@ function responsiveBoxSizingStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
|
48
48
|
const {theme} = props
|
|
49
49
|
const {media} = theme.sanity
|
|
50
50
|
|
|
51
|
-
return
|
|
51
|
+
return responsive(media, getResponsiveProp(props.$sizing), (sizing) => ({
|
|
52
52
|
boxSizing: BOX_SIZING[sizing],
|
|
53
53
|
}))
|
|
54
54
|
}
|
|
@@ -57,7 +57,7 @@ function responsiveBoxHeightStyle(props: ResponsiveBoxStyleProps & ThemeProps) {
|
|
|
57
57
|
const {theme} = props
|
|
58
58
|
const {media} = theme.sanity
|
|
59
59
|
|
|
60
|
-
return
|
|
60
|
+
return responsive(media, getResponsiveProp(props.$height), (height) => ({
|
|
61
61
|
height: BOX_HEIGHT[height],
|
|
62
62
|
}))
|
|
63
63
|
}
|
|
@@ -66,7 +66,7 @@ function responsiveBoxOverflowStyle(props: ResponsiveBoxStyleProps & ThemeProps)
|
|
|
66
66
|
const {theme} = props
|
|
67
67
|
const {media} = theme.sanity
|
|
68
68
|
|
|
69
|
-
return
|
|
69
|
+
return responsive(media, getResponsiveProp(props.$overflow), (overflow) => ({
|
|
70
70
|
overflow,
|
|
71
71
|
}))
|
|
72
72
|
}
|
package/src/styles/box/types.ts
CHANGED
|
@@ -4,8 +4,8 @@ import {BoxDisplay, BoxHeight, BoxOverflow, BoxSizing} from '../../types'
|
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
6
|
export interface ResponsiveBoxStyleProps {
|
|
7
|
-
$display
|
|
8
|
-
$height
|
|
9
|
-
$overflow
|
|
10
|
-
$sizing
|
|
7
|
+
$display?: BoxDisplay | BoxDisplay[]
|
|
8
|
+
$height?: BoxHeight | BoxHeight[]
|
|
9
|
+
$overflow?: BoxOverflow | BoxOverflow[]
|
|
10
|
+
$sizing?: BoxSizing | BoxSizing[]
|
|
11
11
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {
|
|
3
|
-
import {_responsive} from '../helpers'
|
|
2
|
+
import {getResponsiveProp, responsive} from '../helpers'
|
|
4
3
|
import {ThemeProps} from '../types'
|
|
5
4
|
import {ResponsiveFlexItemStyleProps} from './types'
|
|
6
5
|
|
|
@@ -21,7 +20,7 @@ export function responsiveFlexItemStyle(
|
|
|
21
20
|
const {theme} = props
|
|
22
21
|
const {media} = theme.sanity
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
return responsive(media, getResponsiveProp(props.$flex), (flex) => {
|
|
24
|
+
return {flex}
|
|
25
|
+
})
|
|
27
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {rem,
|
|
2
|
+
import {getResponsiveProp, rem, responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveFlexStyleProps} from './types'
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ export function responsiveFlexAlignStyle(
|
|
|
28
28
|
const {theme} = props
|
|
29
29
|
const {media} = theme.sanity
|
|
30
30
|
|
|
31
|
-
return
|
|
31
|
+
return responsive(media, getResponsiveProp(props.$align), (align) => {
|
|
32
32
|
return {alignItems: align}
|
|
33
33
|
})
|
|
34
34
|
}
|
|
@@ -37,7 +37,7 @@ function responsiveFlexGapStyle(props: ResponsiveFlexStyleProps & ThemeProps) {
|
|
|
37
37
|
const {theme} = props
|
|
38
38
|
const {media, space} = theme.sanity
|
|
39
39
|
|
|
40
|
-
return
|
|
40
|
+
return responsive(media, getResponsiveProp(props.$gap), (gap) => ({
|
|
41
41
|
gap: gap ? rem(space[gap]) : undefined,
|
|
42
42
|
}))
|
|
43
43
|
}
|
|
@@ -46,7 +46,7 @@ export function responsiveFlexWrapStyle(props: ResponsiveFlexStyleProps & ThemeP
|
|
|
46
46
|
const {theme} = props
|
|
47
47
|
const {media} = theme.sanity
|
|
48
48
|
|
|
49
|
-
return
|
|
49
|
+
return responsive(media, getResponsiveProp(props.$wrap), (wrap) => {
|
|
50
50
|
return {flexWrap: wrap}
|
|
51
51
|
})
|
|
52
52
|
}
|
|
@@ -57,7 +57,7 @@ export function responsiveFlexJustifyStyle(
|
|
|
57
57
|
const {theme} = props
|
|
58
58
|
const {media} = theme.sanity
|
|
59
59
|
|
|
60
|
-
return
|
|
60
|
+
return responsive(media, getResponsiveProp(props.$justify), (justify) => {
|
|
61
61
|
return {justifyContent: justify}
|
|
62
62
|
})
|
|
63
63
|
}
|
|
@@ -68,7 +68,7 @@ export function responsiveFlexDirectionStyle(
|
|
|
68
68
|
const {theme} = props
|
|
69
69
|
const {media} = theme.sanity
|
|
70
70
|
|
|
71
|
-
return
|
|
71
|
+
return responsive(media, getResponsiveProp(props.$direction), (direction) => {
|
|
72
72
|
return {flexDirection: direction}
|
|
73
73
|
})
|
|
74
74
|
}
|
package/src/styles/flex/types.ts
CHANGED
|
@@ -4,18 +4,18 @@ import {FlexAlign, FlexDirection, FlexJustify, FlexValue, FlexWrap} from '../../
|
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
6
|
export interface ResponsiveFlexStyleProps {
|
|
7
|
-
$align
|
|
8
|
-
$direction
|
|
9
|
-
$gap
|
|
10
|
-
$justify
|
|
11
|
-
$wrap
|
|
7
|
+
$align?: FlexAlign | FlexAlign[]
|
|
8
|
+
$direction?: FlexDirection | FlexDirection[]
|
|
9
|
+
$gap?: number | number[]
|
|
10
|
+
$justify?: FlexJustify | FlexJustify[]
|
|
11
|
+
$wrap?: FlexWrap | FlexWrap[]
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export interface ResponsiveFlexItemStyleProps {
|
|
18
|
-
$flex
|
|
18
|
+
$flex?: FlexValue | FlexValue[]
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
2
|
import {ThemeFontSize, ThemeFontKey} from '../../theme'
|
|
3
|
-
import {rem,
|
|
3
|
+
import {getResponsiveProp, rem, responsive} from '../helpers'
|
|
4
4
|
import {ThemeProps} from '../types'
|
|
5
5
|
import {ResponsiveFontStyleProps} from './types'
|
|
6
6
|
|
|
@@ -48,7 +48,9 @@ export function responsiveFont(
|
|
|
48
48
|
},
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
const resp =
|
|
51
|
+
const resp = responsive(media, getResponsiveProp($size), (sizeIndex) =>
|
|
52
|
+
fontSize(sizes[sizeIndex] || defaultSize)
|
|
53
|
+
)
|
|
52
54
|
|
|
53
55
|
return [base, ...resp]
|
|
54
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {
|
|
2
|
+
import {getResponsiveProp, responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveTextAlignStyleProps} from './types'
|
|
5
5
|
|
|
@@ -12,7 +12,7 @@ export function responsiveTextAlignStyle(
|
|
|
12
12
|
): CSSObject[] {
|
|
13
13
|
const {theme} = props
|
|
14
14
|
|
|
15
|
-
return
|
|
15
|
+
return responsive(theme.sanity.media, getResponsiveProp(props.$align), (textAlign) => {
|
|
16
16
|
return {textAlign}
|
|
17
17
|
})
|
|
18
18
|
}
|
package/src/styles/font/types.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {TextAlign} from '../../types'
|
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
export interface ResponsiveFontSizeStyleProps {
|
|
8
|
-
$size
|
|
8
|
+
$size?: number | number[]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -19,7 +19,7 @@ export interface FontWeightStyleProps {
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export interface ResponsiveTextAlignStyleProps {
|
|
22
|
-
$align
|
|
22
|
+
$align?: TextAlign | TextAlign[]
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -27,8 +27,7 @@ export interface ResponsiveTextAlignStyleProps {
|
|
|
27
27
|
*/
|
|
28
28
|
export interface ResponsiveFontStyleProps
|
|
29
29
|
extends FontWeightStyleProps,
|
|
30
|
-
ResponsiveFontSizeStyleProps
|
|
31
|
-
ResponsiveTextAlignStyleProps {
|
|
30
|
+
ResponsiveFontSizeStyleProps {
|
|
32
31
|
$accent?: boolean
|
|
33
32
|
$muted?: boolean
|
|
34
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {
|
|
2
|
+
import {getResponsiveProp, responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveGridItemStyleProps} from './types'
|
|
5
5
|
|
|
@@ -30,7 +30,7 @@ function responsiveGridItemRowStyle(props: ResponsiveGridItemStyleProps & ThemeP
|
|
|
30
30
|
const {theme} = props
|
|
31
31
|
const {media} = theme.sanity
|
|
32
32
|
|
|
33
|
-
return
|
|
33
|
+
return responsive(media, getResponsiveProp(props.$row), (row) => {
|
|
34
34
|
if (typeof row === 'number') {
|
|
35
35
|
return {gridRow: `span ${row} / span ${row}`}
|
|
36
36
|
}
|
|
@@ -43,7 +43,7 @@ function responsiveGridItemRowStartStyle(props: ResponsiveGridItemStyleProps & T
|
|
|
43
43
|
const {theme} = props
|
|
44
44
|
const {media} = theme.sanity
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return responsive(media, getResponsiveProp(props.$rowStart), (rowStart) => ({
|
|
47
47
|
gridRowStart: rowStart,
|
|
48
48
|
}))
|
|
49
49
|
}
|
|
@@ -52,14 +52,14 @@ function responsiveGridItemRowEndStyle(props: ResponsiveGridItemStyleProps & The
|
|
|
52
52
|
const {theme} = props
|
|
53
53
|
const {media} = theme.sanity
|
|
54
54
|
|
|
55
|
-
return
|
|
55
|
+
return responsive(media, getResponsiveProp(props.$rowEnd), (rowEnd) => ({gridRowEnd: rowEnd}))
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function responsiveGridItemColumnStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
59
59
|
const {theme} = props
|
|
60
60
|
const {media} = theme.sanity
|
|
61
61
|
|
|
62
|
-
return
|
|
62
|
+
return responsive(media, getResponsiveProp(props.$column), (column) => {
|
|
63
63
|
if (typeof column === 'number') {
|
|
64
64
|
return {gridColumn: `span ${column} / span ${column}`}
|
|
65
65
|
}
|
|
@@ -72,7 +72,7 @@ function responsiveGridItemColumnStartStyle(props: ResponsiveGridItemStyleProps
|
|
|
72
72
|
const {theme} = props
|
|
73
73
|
const {media} = theme.sanity
|
|
74
74
|
|
|
75
|
-
return
|
|
75
|
+
return responsive(media, getResponsiveProp(props.$columnStart), (columnStart) => ({
|
|
76
76
|
gridColumnStart: columnStart,
|
|
77
77
|
}))
|
|
78
78
|
}
|
|
@@ -81,7 +81,7 @@ function responsiveGridItemColumnEndStyle(props: ResponsiveGridItemStyleProps &
|
|
|
81
81
|
const {theme} = props
|
|
82
82
|
const {media} = theme.sanity
|
|
83
83
|
|
|
84
|
-
return
|
|
84
|
+
return responsive(media, getResponsiveProp(props.$columnEnd), (columnEnd) => ({
|
|
85
85
|
gridColumnEnd: columnEnd,
|
|
86
86
|
}))
|
|
87
87
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {rem,
|
|
2
|
+
import {getResponsiveProp, rem, responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveGridStyleProps} from './types'
|
|
5
5
|
|
|
@@ -46,7 +46,7 @@ function responsiveGridAutoFlowStyle(props: ResponsiveGridStyleProps & ThemeProp
|
|
|
46
46
|
const {theme} = props
|
|
47
47
|
const {media} = theme.sanity
|
|
48
48
|
|
|
49
|
-
return
|
|
49
|
+
return responsive(media, getResponsiveProp(props.$autoFlow), (autoFlow) => ({
|
|
50
50
|
gridAutoFlow: autoFlow,
|
|
51
51
|
}))
|
|
52
52
|
}
|
|
@@ -55,7 +55,7 @@ function responsiveGridAutoRowsStyle(props: ResponsiveGridStyleProps & ThemeProp
|
|
|
55
55
|
const {theme} = props
|
|
56
56
|
const {media} = theme.sanity
|
|
57
57
|
|
|
58
|
-
return
|
|
58
|
+
return responsive(media, getResponsiveProp(props.$autoRows), (autoRows) => ({
|
|
59
59
|
gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows],
|
|
60
60
|
}))
|
|
61
61
|
}
|
|
@@ -64,7 +64,7 @@ function responsiveGridAutoColsStyle(props: ResponsiveGridStyleProps & ThemeProp
|
|
|
64
64
|
const {theme} = props
|
|
65
65
|
const {media} = theme.sanity
|
|
66
66
|
|
|
67
|
-
return
|
|
67
|
+
return responsive(media, getResponsiveProp(props.$autoCols), (autoCols) => ({
|
|
68
68
|
gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols],
|
|
69
69
|
}))
|
|
70
70
|
}
|
|
@@ -73,7 +73,7 @@ function responsiveGridColumnsStyle(props: ResponsiveGridStyleProps & ThemeProps
|
|
|
73
73
|
const {theme} = props
|
|
74
74
|
const {media} = theme.sanity
|
|
75
75
|
|
|
76
|
-
return
|
|
76
|
+
return responsive(media, getResponsiveProp(props.$columns), (columns) => ({
|
|
77
77
|
gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`,
|
|
78
78
|
}))
|
|
79
79
|
}
|
|
@@ -82,7 +82,7 @@ function responsiveGridRowsStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
82
82
|
const {theme} = props
|
|
83
83
|
const {media} = theme.sanity
|
|
84
84
|
|
|
85
|
-
return
|
|
85
|
+
return responsive(media, getResponsiveProp(props.$rows), (rows) => ({
|
|
86
86
|
gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`,
|
|
87
87
|
}))
|
|
88
88
|
}
|
|
@@ -91,7 +91,7 @@ function responsiveGridGapStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
91
91
|
const {theme} = props
|
|
92
92
|
const {media, space} = theme.sanity
|
|
93
93
|
|
|
94
|
-
return
|
|
94
|
+
return responsive(media, getResponsiveProp(props.$gap), (gap) => ({
|
|
95
95
|
gridGap: gap ? rem(space[gap]) : undefined,
|
|
96
96
|
}))
|
|
97
97
|
}
|
|
@@ -100,7 +100,7 @@ function responsiveGridGapXStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
100
100
|
const {theme} = props
|
|
101
101
|
const {media, space} = theme.sanity
|
|
102
102
|
|
|
103
|
-
return
|
|
103
|
+
return responsive(media, getResponsiveProp(props.$gapX), (gapX) => ({
|
|
104
104
|
columnGap: gapX ? rem(space[gapX]) : undefined,
|
|
105
105
|
}))
|
|
106
106
|
}
|
|
@@ -109,7 +109,7 @@ function responsiveGridGapYStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
109
109
|
const {theme} = props
|
|
110
110
|
const {media, space} = theme.sanity
|
|
111
111
|
|
|
112
|
-
return
|
|
112
|
+
return responsive(media, getResponsiveProp(props.$gapY), (gapY) => ({
|
|
113
113
|
rowGap: gapY ? rem(space[gapY]) : undefined,
|
|
114
114
|
}))
|
|
115
115
|
}
|