@sanity/ui 0.37.12 → 0.37.13
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/autocomplete/autocomplete.d.ts +2 -2
- package/lib/dts/src/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/lib/dts/src/components/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/lib/dts/src/components/autocomplete/constants.d.ts +0 -4
- package/lib/dts/src/components/autocomplete/constants.d.ts.map +1 -1
- 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/menuButton.d.ts.map +1 -1
- package/lib/dts/src/components/menu/menuGroup.d.ts.map +1 -1
- package/lib/dts/src/components/menu/menuItem.d.ts.map +1 -1
- package/lib/dts/src/components/skeleton/skeleton.d.ts.map +1 -1
- package/lib/dts/src/hooks/_internal/useUnique.d.ts +2 -3
- package/lib/dts/src/hooks/_internal/useUnique.d.ts.map +1 -1
- package/lib/dts/src/hooks/index.d.ts +2 -1
- package/lib/dts/src/hooks/index.d.ts.map +1 -1
- package/lib/dts/src/hooks/useArrayProp.d.ts +7 -0
- package/lib/dts/src/hooks/useArrayProp.d.ts.map +1 -0
- 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/useElementSize.d.ts +7 -0
- package/lib/dts/src/hooks/useElementSize.d.ts.map +1 -0
- package/lib/dts/src/index.d.ts +1 -0
- package/lib/dts/src/index.d.ts.map +1 -1
- package/lib/dts/src/observers/elementSizeObserver.d.ts +37 -0
- package/lib/dts/src/observers/elementSizeObserver.d.ts.map +1 -0
- package/lib/dts/src/observers/index.d.ts +3 -0
- package/lib/dts/src/observers/index.d.ts.map +1 -0
- package/lib/dts/src/observers/resizeObserver.d.ts +5 -0
- package/lib/dts/src/observers/resizeObserver.d.ts.map +1 -0
- package/lib/dts/src/primitives/_selectable/selectable.d.ts +1 -2
- 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 +1 -0
- package/lib/dts/src/primitives/avatar/avatarCounter.d.ts.map +1 -1
- package/lib/dts/src/primitives/avatar/avatarStack.d.ts +1 -0
- 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 +5 -1
- 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 +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 +4 -1
- 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/lib/theme/fonts.d.ts +1 -3
- package/lib/dts/src/theme/lib/theme/fonts.d.ts.map +1 -1
- package/lib/dts/src/theme/studioTheme/fonts.d.ts.map +1 -1
- package/lib/dts/src/types/index.d.ts +2 -1
- package/lib/dts/src/types/index.d.ts.map +1 -1
- package/lib/dts/src/types/placement.d.ts +7 -0
- package/lib/dts/src/types/placement.d.ts.map +1 -0
- package/lib/dts/src/types/text.d.ts +5 -0
- package/lib/dts/src/types/text.d.ts.map +1 -0
- package/lib/dts/src/utils/elementQuery/elementQuery.d.ts.map +1 -1
- package/lib/dts/src/utils/index.d.ts +0 -1
- package/lib/dts/src/utils/index.d.ts.map +1 -1
- package/lib/dts/src/utils/virtualList/virtualList.d.ts.map +1 -1
- package/lib/sanity-ui.js +738 -627
- package/lib/sanity-ui.js.map +1 -1
- package/lib/{sanity-ui.modern.js → sanity-ui.modern.mjs} +736 -616
- package/lib/sanity-ui.modern.mjs.map +1 -0
- package/lib/sanity-ui.module.js +732 -623
- package/lib/sanity-ui.module.js.map +1 -1
- package/package.json +11 -11
- package/src/__workshop__/color/overview.tsx +9 -11
- package/src/components/autocomplete/__workshop__/async.tsx +14 -12
- package/src/components/autocomplete/__workshop__/constrainedHeight.tsx +36 -0
- package/src/components/autocomplete/autocomplete.styles.tsx +0 -1
- package/src/components/autocomplete/autocomplete.tsx +14 -7
- package/src/components/autocomplete/constants.ts +0 -5
- package/src/components/breadcrumbs/breadcrumbs.tsx +3 -2
- package/src/components/dialog/dialog.tsx +17 -9
- package/src/components/dialog/styles.ts +3 -3
- package/src/components/hotkeys/hotkeys.tsx +3 -1
- package/src/components/menu/__workshop__/constrainedInBoundary.tsx +11 -14
- package/src/components/menu/__workshop__/groups.tsx +1 -1
- package/src/components/menu/menuButton.tsx +21 -13
- package/src/components/menu/menuGroup.tsx +3 -2
- package/src/components/menu/menuItem.tsx +4 -5
- package/src/components/skeleton/skeleton.tsx +10 -1
- package/src/components/skeleton/textSkeleton.tsx +7 -7
- package/src/hooks/_internal/useUnique.ts +4 -5
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useArrayProp.ts +23 -0
- package/src/hooks/useElementRect/useElementRect.ts +4 -16
- package/src/hooks/useElementSize.ts +18 -0
- package/src/index.ts +1 -0
- package/src/observers/elementSizeObserver.ts +116 -0
- package/src/observers/index.ts +2 -0
- package/src/{utils → observers}/resizeObserver.ts +1 -4
- package/src/primitives/_selectable/selectable.tsx +5 -4
- package/src/primitives/avatar/avatar.tsx +7 -5
- package/src/primitives/avatar/avatarCounter.tsx +14 -12
- package/src/primitives/avatar/avatarStack.tsx +19 -13
- package/src/primitives/avatar/styles.ts +2 -2
- package/src/primitives/badge/badge.tsx +3 -2
- package/src/primitives/box/box.tsx +27 -26
- package/src/primitives/button/button.tsx +22 -10
- package/src/primitives/card/card.tsx +13 -11
- package/src/primitives/checkbox/__workshop__/example.tsx +4 -2
- package/src/primitives/checkbox/__workshop__/props.tsx +4 -2
- package/src/primitives/checkbox/__workshop__/readOnly.tsx +4 -2
- package/src/primitives/code/__workshop__/props.tsx +1 -1
- package/src/primitives/code/code.tsx +2 -1
- package/src/primitives/container/container.tsx +10 -1
- package/src/primitives/container/styles.ts +2 -2
- package/src/primitives/container/types.ts +1 -1
- package/src/primitives/flex/flex.tsx +6 -5
- package/src/primitives/grid/__workshop__/responsive.tsx +13 -12
- package/src/primitives/grid/grid.tsx +9 -8
- package/src/primitives/heading/__workshop__/opticalAlignment.tsx +19 -7
- package/src/primitives/heading/heading.tsx +3 -2
- package/src/primitives/inline/inline.tsx +12 -6
- package/src/primitives/inline/styles.ts +2 -2
- package/src/primitives/inline/types.ts +1 -1
- package/src/primitives/kbd/kbd.tsx +2 -1
- package/src/primitives/label/label.tsx +4 -3
- package/src/primitives/popover/__workshop__/{margins.tsx → MarginsStory.tsx} +1 -1
- package/src/primitives/popover/__workshop__/{matchReferenceWidth.tsx → MatchReferenceWidthStory.tsx} +0 -0
- package/src/primitives/popover/__workshop__/{plain.tsx → PlainStory.tsx} +12 -14
- package/src/primitives/popover/__workshop__/{recursive.tsx → RecursiveStory.tsx} +4 -1
- package/src/primitives/popover/__workshop__/RightAlignedStory.tsx +60 -0
- package/src/primitives/popover/__workshop__/TestStory.tsx +79 -0
- package/src/primitives/popover/__workshop__/index.ts +10 -5
- package/src/primitives/popover/popover.tsx +5 -3
- package/src/primitives/select/select.tsx +9 -9
- package/src/primitives/select/styles.ts +10 -4
- package/src/primitives/stack/stack.tsx +2 -1
- package/src/primitives/stack/styles.ts +3 -3
- package/src/primitives/text/__workshop__/opticalAlignment.tsx +15 -5
- package/src/primitives/text/text.tsx +3 -2
- package/src/primitives/textArea/__workshop__/plain.tsx +23 -18
- package/src/primitives/textArea/textArea.tsx +17 -5
- package/src/primitives/textInput/__workshop__/clearButton.tsx +14 -8
- package/src/primitives/textInput/__workshop__/index.ts +2 -2
- package/src/primitives/textInput/__workshop__/plain.tsx +39 -32
- package/src/primitives/textInput/__workshop__/tones.tsx +97 -75
- package/src/primitives/textInput/__workshop__/typed.tsx +8 -2
- package/src/primitives/textInput/textInput.tsx +43 -12
- package/src/primitives/tooltip/__workshop__/props.tsx +5 -1
- package/src/primitives/tooltip/tooltip.tsx +3 -2
- 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 +5 -4
- package/src/styles/flex/flexStyle.ts +6 -6
- package/src/styles/flex/types.ts +6 -6
- package/src/styles/font/responsiveFont.ts +7 -27
- package/src/styles/font/textAlignStyle.ts +2 -2
- package/src/styles/font/types.ts +4 -3
- 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 +24 -27
- package/src/styles/input/textInputStyle.ts +89 -79
- 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 +2 -5
- package/src/styles/shadow/types.ts +1 -1
- package/src/theme/lib/theme/fonts.ts +1 -3
- package/src/theme/studioTheme/fonts.ts +5 -9
- package/src/types/index.ts +2 -2
- package/src/types/placement.ts +18 -0
- package/src/types/text.ts +4 -0
- package/src/utils/elementQuery/elementQuery.tsx +5 -18
- package/src/utils/index.ts +0 -1
- package/src/utils/layer/layer.tsx +1 -1
- package/src/utils/layer/layerProvider.tsx +2 -2
- package/src/utils/virtualList/virtualList.tsx +8 -7
- package/lib/dts/src/hooks/useResponsiveProp.d.ts +0 -6
- package/lib/dts/src/hooks/useResponsiveProp.d.ts.map +0 -1
- package/lib/dts/src/types/common.d.ts +0 -11
- package/lib/dts/src/types/common.d.ts.map +0 -1
- package/lib/dts/src/utils/resizeObserver.d.ts +0 -6
- package/lib/dts/src/utils/resizeObserver.d.ts.map +0 -1
- package/lib/sanity-ui.modern.js.map +0 -1
- package/src/hooks/useResponsiveProp.ts +0 -10
- package/src/primitives/popover/__workshop__/rightAligned.tsx +0 -57
- package/src/types/common.ts +0 -12
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {EllipsisVerticalIcon} from '@sanity/icons'
|
|
2
|
+
import {Button, Card, Flex, Popover, Text, useClickOutside} from '@sanity/ui'
|
|
3
|
+
import {useBoolean} from '@sanity/ui-workshop'
|
|
4
|
+
import React, {useCallback, useState} from 'react'
|
|
5
|
+
|
|
6
|
+
export default function RightAlignedStory() {
|
|
7
|
+
const constrainSize = useBoolean('Constrain size', false)
|
|
8
|
+
|
|
9
|
+
const [open, setOpen] = useState(false)
|
|
10
|
+
const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)
|
|
11
|
+
const [buttonElement, setButtonElement] = useState<HTMLButtonElement | null>(null)
|
|
12
|
+
const [popoverElement, setPopoverElement] = useState<HTMLDivElement | null>(null)
|
|
13
|
+
|
|
14
|
+
const content = (
|
|
15
|
+
<Text>
|
|
16
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque at nisl at sem tempor
|
|
17
|
+
hendrerit scelerisque ut libero. Maecenas iaculis efficitur lorem, ac faucibus mi imperdiet
|
|
18
|
+
quis. Cras a consectetur erat. Fusce imperdiet, dolor et pellentesque iaculis, ex quam luctus
|
|
19
|
+
felis, non ultrices enim sem vitae quam. Duis lorem velit, lacinia at rhoncus a, tempus vel
|
|
20
|
+
neque. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;
|
|
21
|
+
Sed id mauris quam. Nam finibus sapien non lacinia ultricies. Integer fermentum tortor at
|
|
22
|
+
pellentesque faucibus. In venenatis commodo placerat. Curabitur commodo tortor libero, vel
|
|
23
|
+
pellentesque elit luctus sodales. Donec mattis tristique nunc ac lacinia. Vestibulum non
|
|
24
|
+
pulvinar turpis, posuere consequat arcu. Fusce ut urna blandit, finibus nisi a, molestie elit.
|
|
25
|
+
Nulla sed eleifend mi.
|
|
26
|
+
</Text>
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const handleToggleOpen = useCallback(() => setOpen((v) => !v), [])
|
|
30
|
+
const handleClose = useCallback(() => setOpen(false), [])
|
|
31
|
+
|
|
32
|
+
useClickOutside(handleClose, [buttonElement, popoverElement])
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Card height="fill" padding={[4, 5, 6]} sizing="border" tone="transparent">
|
|
36
|
+
<Card height="fill" padding={2} ref={setBoundaryElement} shadow={1}>
|
|
37
|
+
<Flex justify="flex-end" padding={0}>
|
|
38
|
+
<Popover
|
|
39
|
+
boundaryElement={boundaryElement}
|
|
40
|
+
constrainSize={constrainSize}
|
|
41
|
+
content={content}
|
|
42
|
+
open={open}
|
|
43
|
+
padding={3}
|
|
44
|
+
portal
|
|
45
|
+
placement="bottom"
|
|
46
|
+
ref={setPopoverElement}
|
|
47
|
+
>
|
|
48
|
+
<Button
|
|
49
|
+
icon={EllipsisVerticalIcon}
|
|
50
|
+
mode="bleed"
|
|
51
|
+
onClick={handleToggleOpen}
|
|
52
|
+
ref={setButtonElement}
|
|
53
|
+
selected={open}
|
|
54
|
+
/>
|
|
55
|
+
</Popover>
|
|
56
|
+
</Flex>
|
|
57
|
+
</Card>
|
|
58
|
+
</Card>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
2
|
+
import React, {ReactElement, useState} from 'react'
|
|
3
|
+
import {
|
|
4
|
+
WORKSHOP_CONTAINER_WIDTH_OPTIONS,
|
|
5
|
+
WORKSHOP_PLACEMENT_OPTIONS,
|
|
6
|
+
WORKSHOP_RADIUS_OPTIONS,
|
|
7
|
+
} from '../../../__workshop__/constants'
|
|
8
|
+
import {BoundaryElementProvider, PortalProvider} from '../../../utils'
|
|
9
|
+
import {Button} from '../../button'
|
|
10
|
+
import {Card} from '../../card'
|
|
11
|
+
import {Text} from '../../text'
|
|
12
|
+
import {Popover} from '../popover'
|
|
13
|
+
|
|
14
|
+
export default function TestStory(): ReactElement {
|
|
15
|
+
const [portalElement, setPortalElement] = useState<HTMLDivElement | null>(null)
|
|
16
|
+
const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)
|
|
17
|
+
const arrow = useBoolean('Arrow', true)
|
|
18
|
+
const matchReferenceWidth = useBoolean('Match reference width', false)
|
|
19
|
+
const open = useBoolean('Open', true)
|
|
20
|
+
const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'bottom')
|
|
21
|
+
const preventOverflow = useBoolean('Prevent overflow', true)
|
|
22
|
+
const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 2)
|
|
23
|
+
const referenceWide = useBoolean('Reference wide?', false)
|
|
24
|
+
const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 'auto')
|
|
25
|
+
|
|
26
|
+
const text = useText('Text', 'Test')
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Card
|
|
30
|
+
ref={setBoundaryElement}
|
|
31
|
+
shadow={2}
|
|
32
|
+
style={{
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
top: 50,
|
|
35
|
+
right: 50,
|
|
36
|
+
bottom: 50,
|
|
37
|
+
left: 50,
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
data-portal=""
|
|
42
|
+
ref={setPortalElement}
|
|
43
|
+
style={{
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
top: 0,
|
|
46
|
+
right: 0,
|
|
47
|
+
bottom: 0,
|
|
48
|
+
left: 0,
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
pointerEvents: 'none',
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<div style={{width: '100%', height: '100%', overflow: 'auto'}}>
|
|
55
|
+
<div style={{padding: '150vh'}}>
|
|
56
|
+
<PortalProvider element={portalElement}>
|
|
57
|
+
<BoundaryElementProvider element={boundaryElement}>
|
|
58
|
+
<Popover
|
|
59
|
+
arrow={arrow}
|
|
60
|
+
content={<Text size={1}>{text}</Text>}
|
|
61
|
+
fallbackPlacements={['left', 'bottom', 'right', 'top']}
|
|
62
|
+
matchReferenceWidth={matchReferenceWidth}
|
|
63
|
+
open={open}
|
|
64
|
+
padding={3}
|
|
65
|
+
placement={placement}
|
|
66
|
+
portal
|
|
67
|
+
preventOverflow={preventOverflow}
|
|
68
|
+
radius={radius}
|
|
69
|
+
width={width}
|
|
70
|
+
>
|
|
71
|
+
<Button text="reference" style={{width: referenceWide ? 300 : undefined}} />
|
|
72
|
+
</Popover>
|
|
73
|
+
</BoundaryElementProvider>
|
|
74
|
+
</PortalProvider>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</Card>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
@@ -2,29 +2,34 @@ import {defineScope} from '@sanity/ui-workshop'
|
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
4
|
export default defineScope('primitives/popover', 'Popover', [
|
|
5
|
+
{
|
|
6
|
+
name: 'test',
|
|
7
|
+
title: 'Test',
|
|
8
|
+
component: lazy(() => import('./TestStory')),
|
|
9
|
+
},
|
|
5
10
|
{
|
|
6
11
|
name: 'plain',
|
|
7
12
|
title: 'Plain',
|
|
8
|
-
component: lazy(() => import('./
|
|
13
|
+
component: lazy(() => import('./PlainStory')),
|
|
9
14
|
},
|
|
10
15
|
{
|
|
11
16
|
name: 'recursive',
|
|
12
17
|
title: 'Recursive',
|
|
13
|
-
component: lazy(() => import('./
|
|
18
|
+
component: lazy(() => import('./RecursiveStory')),
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
name: 'match-ref-width',
|
|
17
22
|
title: 'Match reference width',
|
|
18
|
-
component: lazy(() => import('./
|
|
23
|
+
component: lazy(() => import('./MatchReferenceWidthStory')),
|
|
19
24
|
},
|
|
20
25
|
{
|
|
21
26
|
name: 'margins',
|
|
22
27
|
title: 'Margins',
|
|
23
|
-
component: lazy(() => import('./
|
|
28
|
+
component: lazy(() => import('./MarginsStory')),
|
|
24
29
|
},
|
|
25
30
|
{
|
|
26
31
|
name: 'right-aligned',
|
|
27
32
|
title: 'Right-aligned',
|
|
28
|
-
component: lazy(() => import('./
|
|
33
|
+
component: lazy(() => import('./RightAlignedStory')),
|
|
29
34
|
},
|
|
30
35
|
])
|
|
@@ -2,7 +2,7 @@ import React, {cloneElement, forwardRef, useCallback, useEffect, useMemo, useSta
|
|
|
2
2
|
import {usePopper} from 'react-popper'
|
|
3
3
|
import styled, {css} from 'styled-components'
|
|
4
4
|
import {EMPTY_RECORD} from '../../constants'
|
|
5
|
-
import {useForwardedRef} from '../../hooks'
|
|
5
|
+
import {useArrayProp, useForwardedRef} from '../../hooks'
|
|
6
6
|
import {ThemeColorSchemeKey, useTheme} from '../../theme'
|
|
7
7
|
import {CardTone, Placement, PopoverMargins} from '../../types'
|
|
8
8
|
import {Layer, LayerProps, Portal, useBoundaryElement, usePortal} from '../../utils'
|
|
@@ -71,6 +71,7 @@ const PopoverCard = styled(Card)<
|
|
|
71
71
|
ResponsiveWidthStyleProps & {
|
|
72
72
|
$constrainSize?: boolean
|
|
73
73
|
$preventOverflow?: boolean
|
|
74
|
+
$width: (number | 'auto')[]
|
|
74
75
|
}
|
|
75
76
|
>(
|
|
76
77
|
({$constrainSize}) => css`
|
|
@@ -126,7 +127,7 @@ export const Popover = forwardRef(function Popover(
|
|
|
126
127
|
tether,
|
|
127
128
|
tetherOffset,
|
|
128
129
|
tone = 'inherit',
|
|
129
|
-
width = 0,
|
|
130
|
+
width: widthProp = 0,
|
|
130
131
|
zOffset = theme.sanity.layer?.popover.zOffset,
|
|
131
132
|
...restProps
|
|
132
133
|
} = props
|
|
@@ -136,6 +137,7 @@ export const Popover = forwardRef(function Popover(
|
|
|
136
137
|
const [popperElement, setPopperElement] = useState<HTMLElement | null>(null)
|
|
137
138
|
const [arrowElement, setArrowElement] = useState<HTMLElement | null>(null)
|
|
138
139
|
const popperReferenceElement = referenceElementProp || referenceElement
|
|
140
|
+
const width = useArrayProp(widthProp)
|
|
139
141
|
|
|
140
142
|
const modifiers = usePopoverModifiers({
|
|
141
143
|
allowedAutoPlacements,
|
|
@@ -212,13 +214,13 @@ export const Popover = forwardRef(function Popover(
|
|
|
212
214
|
>
|
|
213
215
|
<PopoverCard
|
|
214
216
|
$constrainSize={constrainSize}
|
|
217
|
+
$width={width}
|
|
215
218
|
data-ui="PopoverCard"
|
|
216
219
|
padding={padding}
|
|
217
220
|
radius={radius}
|
|
218
221
|
scheme={scheme}
|
|
219
222
|
shadow={shadow}
|
|
220
223
|
tone={tone}
|
|
221
|
-
width={width as any}
|
|
222
224
|
>
|
|
223
225
|
{arrow && <PopoverArrow ref={setArrowElement} style={styles.arrow} />}
|
|
224
226
|
{content}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {SelectIcon} from '@sanity/icons'
|
|
2
2
|
import React, {forwardRef} from 'react'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
|
-
import {useForwardedRef, useCustomValidity} from '../../hooks'
|
|
4
|
+
import {useForwardedRef, useCustomValidity, useArrayProp} from '../../hooks'
|
|
5
5
|
import {Box} from '../box'
|
|
6
6
|
import {Text} from '../text'
|
|
7
7
|
import {selectStyle} from './styles'
|
|
@@ -20,10 +20,10 @@ export interface SelectProps {
|
|
|
20
20
|
const Root = styled.div(selectStyle.root)
|
|
21
21
|
|
|
22
22
|
const Input = styled.select<{
|
|
23
|
-
$fontSize
|
|
24
|
-
$padding
|
|
25
|
-
$radius
|
|
26
|
-
$space
|
|
23
|
+
$fontSize: number[]
|
|
24
|
+
$padding: number[]
|
|
25
|
+
$radius: number[]
|
|
26
|
+
$space: number[]
|
|
27
27
|
}>(selectStyle.input)
|
|
28
28
|
|
|
29
29
|
const IconBox = styled(Box)(selectStyle.iconBox)
|
|
@@ -57,10 +57,10 @@ export const Select = forwardRef(function Select(
|
|
|
57
57
|
data-read-only={!disabled && readOnly ? '' : undefined}
|
|
58
58
|
data-ui="Select"
|
|
59
59
|
{...restProps}
|
|
60
|
-
$fontSize={fontSize}
|
|
61
|
-
$padding={padding}
|
|
62
|
-
$radius={radius}
|
|
63
|
-
$space={space}
|
|
60
|
+
$fontSize={useArrayProp(fontSize)}
|
|
61
|
+
$padding={useArrayProp(padding)}
|
|
62
|
+
$radius={useArrayProp(radius)}
|
|
63
|
+
$space={useArrayProp(space)}
|
|
64
64
|
disabled={disabled || readOnly}
|
|
65
65
|
ref={ref}
|
|
66
66
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {css, CSSObject, FlattenSimpleInterpolation} from 'styled-components'
|
|
2
|
-
import {
|
|
2
|
+
import {rem, _responsive, ThemeProps} from '../../styles'
|
|
3
3
|
import {
|
|
4
4
|
focusRingBorderStyle,
|
|
5
5
|
focusRingStyle,
|
|
@@ -100,17 +100,23 @@ function textSize(size: ThemeFontSize) {
|
|
|
100
100
|
return {fontSize: rem(size.fontSize), lineHeight: rem(size.lineHeight)}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
function inputTextSizeStyle(props: {$fontSize
|
|
103
|
+
function inputTextSizeStyle(props: {$fontSize: number[]} & ThemeProps) {
|
|
104
104
|
const {theme, $fontSize} = props
|
|
105
105
|
const {sizes} = theme.sanity.fonts.text
|
|
106
106
|
|
|
107
|
-
return
|
|
107
|
+
return _responsive(theme.sanity.media, $fontSize, (sizeIndex) =>
|
|
108
108
|
textSize(sizes[sizeIndex] || sizes[2])
|
|
109
109
|
)
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
function inputStyle(): Array<
|
|
113
|
-
| ((
|
|
113
|
+
| ((
|
|
114
|
+
props: ResponsiveRadiusStyleProps & {
|
|
115
|
+
$fontSize: number[]
|
|
116
|
+
$padding: number[]
|
|
117
|
+
$space: number[]
|
|
118
|
+
} & ThemeProps
|
|
119
|
+
) => CSSObject[])
|
|
114
120
|
| ((props: ThemeProps) => FlattenSimpleInterpolation)
|
|
115
121
|
> {
|
|
116
122
|
return [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, {forwardRef} from 'react'
|
|
2
2
|
import styled from 'styled-components'
|
|
3
|
+
import {useArrayProp} from '../../hooks'
|
|
3
4
|
import {Box, BoxProps} from '../box'
|
|
4
5
|
import {stackBaseStyle, responsiveStackSpaceStyle, ResponsiveStackSpaceStyleProps} from './styles'
|
|
5
6
|
|
|
@@ -27,7 +28,7 @@ export const Stack = forwardRef(function Stack(
|
|
|
27
28
|
data-as={typeof as === 'string' ? as : undefined}
|
|
28
29
|
data-ui="Stack"
|
|
29
30
|
{...restProps}
|
|
30
|
-
$space={space}
|
|
31
|
+
$space={useArrayProp(space)}
|
|
31
32
|
forwardedAs={as}
|
|
32
33
|
ref={ref}
|
|
33
34
|
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {CSSObject} from 'styled-components'
|
|
2
|
-
import {
|
|
2
|
+
import {rem, _responsive, ThemeProps} from '../../styles'
|
|
3
3
|
|
|
4
4
|
export interface ResponsiveStackSpaceStyleProps {
|
|
5
|
-
$space
|
|
5
|
+
$space: number[]
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const BASE_STYLE: CSSObject = {
|
|
@@ -26,7 +26,7 @@ export function responsiveStackSpaceStyle(
|
|
|
26
26
|
const {theme} = props
|
|
27
27
|
const {media, space} = theme.sanity
|
|
28
28
|
|
|
29
|
-
return
|
|
29
|
+
return _responsive(media, props.$space, (spaceIndex) => ({
|
|
30
30
|
gridGap: rem(space[spaceIndex]),
|
|
31
31
|
}))
|
|
32
32
|
}
|
|
@@ -8,31 +8,41 @@ export default function OpticalAlignment() {
|
|
|
8
8
|
<Stack space={1}>
|
|
9
9
|
<Flex>
|
|
10
10
|
<Card padding={0} scheme="dark">
|
|
11
|
-
<Text size={4}>
|
|
11
|
+
<Text accent size={4}>
|
|
12
|
+
Hamburgefonstiv M
|
|
13
|
+
</Text>
|
|
12
14
|
</Card>
|
|
13
15
|
</Flex>
|
|
14
16
|
|
|
15
17
|
<Flex>
|
|
16
18
|
<Card padding={0} scheme="dark">
|
|
17
|
-
<Text size={3}>
|
|
19
|
+
<Text accent size={3}>
|
|
20
|
+
Hamburgefonstiv M
|
|
21
|
+
</Text>
|
|
18
22
|
</Card>
|
|
19
23
|
</Flex>
|
|
20
24
|
|
|
21
25
|
<Flex>
|
|
22
26
|
<Card padding={0} scheme="dark">
|
|
23
|
-
<Text size={2}>
|
|
27
|
+
<Text accent size={2}>
|
|
28
|
+
Hamburgefonstiv M
|
|
29
|
+
</Text>
|
|
24
30
|
</Card>
|
|
25
31
|
</Flex>
|
|
26
32
|
|
|
27
33
|
<Flex>
|
|
28
34
|
<Card padding={0} scheme="dark">
|
|
29
|
-
<Text size={1}>
|
|
35
|
+
<Text accent size={1}>
|
|
36
|
+
Hamburgefonstiv M
|
|
37
|
+
</Text>
|
|
30
38
|
</Card>
|
|
31
39
|
</Flex>
|
|
32
40
|
|
|
33
41
|
<Flex>
|
|
34
42
|
<Card padding={0} scheme="dark">
|
|
35
|
-
<Text size={0}>
|
|
43
|
+
<Text accent size={0}>
|
|
44
|
+
Hamburgefonstiv M
|
|
45
|
+
</Text>
|
|
36
46
|
</Card>
|
|
37
47
|
</Flex>
|
|
38
48
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, {forwardRef} from 'react'
|
|
2
2
|
import styled from 'styled-components'
|
|
3
|
+
import {useArrayProp} from '../../hooks'
|
|
3
4
|
import {
|
|
4
5
|
ResponsiveFontStyleProps,
|
|
5
6
|
responsiveTextAlignStyle,
|
|
@@ -69,10 +70,10 @@ export const Text = forwardRef(function Text(
|
|
|
69
70
|
data-ui="Text"
|
|
70
71
|
{...restProps}
|
|
71
72
|
$accent={accent}
|
|
72
|
-
$align={align}
|
|
73
|
+
$align={useArrayProp(align)}
|
|
73
74
|
$muted={muted}
|
|
74
75
|
ref={ref}
|
|
75
|
-
$size={size}
|
|
76
|
+
$size={useArrayProp(size)}
|
|
76
77
|
$weight={weight}
|
|
77
78
|
>
|
|
78
79
|
<span>{children}</span>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {Container, Flex, Stack, Text, TextArea} from '@sanity/ui'
|
|
1
|
+
import {Card, Container, Flex, Stack, Text, TextArea} from '@sanity/ui'
|
|
2
2
|
import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import {
|
|
5
|
+
WORKSHOP_CARD_TONE_OPTIONS,
|
|
5
6
|
WORKSHOP_FONT_WEIGHT_OPTIONS,
|
|
6
7
|
WORKSHOP_RADIUS_OPTIONS,
|
|
7
8
|
WORKSHOP_SPACE_OPTIONS,
|
|
@@ -9,6 +10,8 @@ import {
|
|
|
9
10
|
} from '../../../__workshop__/constants'
|
|
10
11
|
|
|
11
12
|
export default function PlainStory() {
|
|
13
|
+
const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS)
|
|
14
|
+
|
|
12
15
|
const border = useBoolean('Border', true, 'Props')
|
|
13
16
|
const customValidity = useText('Custom validity', '', 'Props') || undefined
|
|
14
17
|
const disabled = useBoolean('Disabled', false, 'Props')
|
|
@@ -22,23 +25,25 @@ export default function PlainStory() {
|
|
|
22
25
|
return (
|
|
23
26
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
24
27
|
<Container width={0}>
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
<Card padding={3} tone={tone}>
|
|
29
|
+
<Stack space={3}>
|
|
30
|
+
<Text as="label" htmlFor="text-area-example" size={1} weight="semibold">
|
|
31
|
+
TextArea
|
|
32
|
+
</Text>
|
|
33
|
+
<TextArea
|
|
34
|
+
border={border}
|
|
35
|
+
customValidity={customValidity}
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
fontSize={fontSize}
|
|
38
|
+
id="text-area-example"
|
|
39
|
+
padding={padding}
|
|
40
|
+
placeholder={placeholder}
|
|
41
|
+
radius={radius}
|
|
42
|
+
readOnly={readOnly}
|
|
43
|
+
weight={weight}
|
|
44
|
+
/>
|
|
45
|
+
</Stack>
|
|
46
|
+
</Card>
|
|
42
47
|
</Container>
|
|
43
48
|
</Flex>
|
|
44
49
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {forwardRef} from 'react'
|
|
2
2
|
import styled from 'styled-components'
|
|
3
|
-
import {useForwardedRef, useCustomValidity} from '../../hooks'
|
|
3
|
+
import {useForwardedRef, useCustomValidity, useArrayProp} from '../../hooks'
|
|
4
4
|
import {
|
|
5
5
|
responsiveInputPaddingStyle,
|
|
6
6
|
responsiveRadiusStyle,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
textInputFontSizeStyle,
|
|
14
14
|
textInputRepresentationStyle,
|
|
15
15
|
} from '../../styles/internal'
|
|
16
|
-
import {ThemeFontWeightKey} from '../../theme'
|
|
16
|
+
import {ThemeFontWeightKey, useRootTheme} from '../../theme'
|
|
17
17
|
import {ResponsiveRadiusProps} from '../types'
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -61,11 +61,14 @@ export const TextArea = forwardRef(function TextArea(
|
|
|
61
61
|
fontSize = 2,
|
|
62
62
|
padding = 3,
|
|
63
63
|
radius = 1,
|
|
64
|
+
weight,
|
|
64
65
|
...restProps
|
|
65
66
|
} = props
|
|
66
67
|
|
|
67
68
|
const ref = useForwardedRef(forwardedRef)
|
|
68
69
|
|
|
70
|
+
const rootTheme = useRootTheme()
|
|
71
|
+
|
|
69
72
|
useCustomValidity(ref, customValidity)
|
|
70
73
|
|
|
71
74
|
return (
|
|
@@ -73,13 +76,22 @@ export const TextArea = forwardRef(function TextArea(
|
|
|
73
76
|
<InputRoot>
|
|
74
77
|
<Input
|
|
75
78
|
data-as="textarea"
|
|
79
|
+
data-tone={rootTheme.tone}
|
|
76
80
|
{...restProps}
|
|
77
|
-
$fontSize={fontSize}
|
|
78
|
-
$padding={padding}
|
|
81
|
+
$fontSize={useArrayProp(fontSize)}
|
|
82
|
+
$padding={useArrayProp(padding)}
|
|
83
|
+
$space={useArrayProp(0)}
|
|
84
|
+
$tone={rootTheme.tone}
|
|
85
|
+
$weight={weight}
|
|
79
86
|
disabled={disabled}
|
|
80
87
|
ref={ref}
|
|
81
88
|
/>
|
|
82
|
-
<Presentation
|
|
89
|
+
<Presentation
|
|
90
|
+
$border={border}
|
|
91
|
+
$radius={useArrayProp(radius)}
|
|
92
|
+
$tone={rootTheme.tone}
|
|
93
|
+
data-tone={rootTheme.tone}
|
|
94
|
+
/>
|
|
83
95
|
</InputRoot>
|
|
84
96
|
</Root>
|
|
85
97
|
)
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {TextInput} from '@sanity/ui'
|
|
1
|
+
import {Box, TextInput} from '@sanity/ui'
|
|
2
|
+
import {useText} from '@sanity/ui-workshop'
|
|
2
3
|
import React, {useCallback, useState} from 'react'
|
|
3
4
|
|
|
4
5
|
export default function ClearButtonStory() {
|
|
6
|
+
const customValidity = useText('Custom validitiy')
|
|
7
|
+
|
|
5
8
|
const [value, setValue] = useState('')
|
|
6
9
|
|
|
7
10
|
const handleChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
@@ -13,12 +16,15 @@ export default function ClearButtonStory() {
|
|
|
13
16
|
}, [])
|
|
14
17
|
|
|
15
18
|
return (
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
<Box padding={4}>
|
|
20
|
+
<TextInput
|
|
21
|
+
clearButton
|
|
22
|
+
customValidity={customValidity}
|
|
23
|
+
onChange={handleChange}
|
|
24
|
+
onClear={handleClear}
|
|
25
|
+
placeholder="Enter text"
|
|
26
|
+
value={value}
|
|
27
|
+
/>
|
|
28
|
+
</Box>
|
|
23
29
|
)
|
|
24
30
|
}
|
|
@@ -13,8 +13,8 @@ export default defineScope('primitives/text-input', 'TextInput', [
|
|
|
13
13
|
component: lazy(() => import('./customValidity')),
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
name: '
|
|
17
|
-
title: '
|
|
16
|
+
name: 'typed',
|
|
17
|
+
title: 'Typed',
|
|
18
18
|
component: lazy(() => import('./typed')),
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -30,15 +30,33 @@ const typingPerfTest: PerfTestProps<HTMLInputElement> = {
|
|
|
30
30
|
export default function PlainStory() {
|
|
31
31
|
const {ref, Wrapper} = usePerfTest(typingPerfTest)
|
|
32
32
|
|
|
33
|
+
return (
|
|
34
|
+
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
35
|
+
<Container width={0}>
|
|
36
|
+
<Stack space={3}>
|
|
37
|
+
<Text as="label" htmlFor="text-input-example" size={1} weight="semibold">
|
|
38
|
+
TextInput
|
|
39
|
+
</Text>
|
|
40
|
+
<Wrapper>
|
|
41
|
+
<TextInputTest inputRef={ref} />
|
|
42
|
+
</Wrapper>
|
|
43
|
+
</Stack>
|
|
44
|
+
</Container>
|
|
45
|
+
</Flex>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function TextInputTest(props: {inputRef: React.Ref<HTMLInputElement>}) {
|
|
50
|
+
const {inputRef: ref} = props
|
|
33
51
|
const border = useBoolean('Border', true, 'Props')
|
|
34
52
|
const customValidity = useText('Custom validity', '', 'Props') || undefined
|
|
35
53
|
const disabled = useBoolean('Disabled', false, 'Props')
|
|
36
54
|
const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 2, 'Props')
|
|
37
|
-
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, '
|
|
55
|
+
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, 'search', 'Props') as IconSymbol
|
|
38
56
|
const iconRight = useSelect(
|
|
39
57
|
'Icon (right)',
|
|
40
58
|
WORKSHOP_ICON_SYMBOL_OPTIONS,
|
|
41
|
-
'
|
|
59
|
+
'close',
|
|
42
60
|
'Props'
|
|
43
61
|
) as IconSymbol
|
|
44
62
|
const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
@@ -56,35 +74,24 @@ export default function PlainStory() {
|
|
|
56
74
|
)
|
|
57
75
|
|
|
58
76
|
return (
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
radius={radius}
|
|
79
|
-
readOnly={readOnly}
|
|
80
|
-
ref={ref}
|
|
81
|
-
space={space}
|
|
82
|
-
value={value}
|
|
83
|
-
weight={weight}
|
|
84
|
-
/>
|
|
85
|
-
</Wrapper>
|
|
86
|
-
</Stack>
|
|
87
|
-
</Container>
|
|
88
|
-
</Flex>
|
|
77
|
+
<TextInput
|
|
78
|
+
border={border}
|
|
79
|
+
customValidity={customValidity}
|
|
80
|
+
disabled={disabled}
|
|
81
|
+
fontSize={fontSize}
|
|
82
|
+
icon={icon && icons[icon]}
|
|
83
|
+
iconRight={iconRight && icons[iconRight]}
|
|
84
|
+
id="text-input-example"
|
|
85
|
+
name="email"
|
|
86
|
+
onChange={handleChange}
|
|
87
|
+
padding={padding}
|
|
88
|
+
placeholder={placeholder}
|
|
89
|
+
radius={radius}
|
|
90
|
+
readOnly={readOnly}
|
|
91
|
+
ref={ref}
|
|
92
|
+
space={space}
|
|
93
|
+
value={value}
|
|
94
|
+
weight={weight}
|
|
95
|
+
/>
|
|
89
96
|
)
|
|
90
97
|
}
|