@sanity/ui 3.0.0-static.19 → 3.0.0-static.20
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/_chunks-cjs/_visual-editing.cjs +109 -112
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/buildCommand.cjs +30 -24
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +110 -113
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/css.cjs +379 -358
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +45 -10
- package/dist/css.d.ts +45 -10
- package/dist/css.js +379 -358
- package/dist/css.js.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/theme.cjs +89 -64
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +28 -2
- package/dist/theme.d.ts +28 -2
- package/dist/theme.js +89 -64
- package/dist/theme.js.map +1 -1
- package/dist/ui-system.css +1236 -801
- package/dist/ui-system.min.css +1 -1
- package/dist/ui-theme.css +413 -82
- package/dist/ui-theme.min.css +1 -1
- package/dist/ui.css +1649 -883
- package/dist/ui.min.css +1 -1
- package/exports/_visual-editing.ts +0 -1
- package/package.json +6 -6
- package/src/cli/buildCommand.ts +48 -41
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +12 -11
- package/src/core/components/autocomplete/__workshop__/example.tsx +13 -12
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +53 -54
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -2
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
- package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
- package/src/core/components/dialog/__workshop__/position.tsx +3 -3
- package/src/core/components/dialog/__workshop__/props.tsx +6 -6
- package/src/core/components/menu/__workshop__/menuButton.tsx +3 -3
- package/src/core/components/menu/__workshop__/tones.tsx +3 -3
- package/src/core/components/skeleton/__workshop__/delay.tsx +2 -2
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +2 -2
- package/src/core/components/tab/__workshop__/example.tsx +1 -1
- package/src/core/components/toast/__workshop__/toast.tsx +5 -5
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/props.tsx +5 -8
- package/src/core/primitives/box/__workshop__/props.tsx +2 -2
- package/src/core/primitives/box/box.tsx +2 -0
- package/src/core/primitives/button/__workshop__/props.tsx +17 -19
- package/src/core/primitives/button/__workshop__/stacked.tsx +12 -12
- package/src/core/primitives/card/__workshop__/asButton.tsx +1 -1
- package/src/core/primitives/card/__workshop__/interactive.tsx +2 -2
- package/src/core/primitives/card/__workshop__/props.tsx +11 -11
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/checkbox/__workshop__/props.tsx +5 -5
- package/src/core/primitives/code/__workshop__/props.tsx +4 -7
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/container/__workshop__/example.tsx +2 -2
- package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
- package/src/core/primitives/heading/__workshop__/plain.tsx +11 -7
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
- package/src/core/primitives/label/__workshop__/plain.tsx +7 -8
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +3 -1
- package/src/core/primitives/radio/__workshop__/example.tsx +2 -2
- package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
- package/src/core/primitives/select/__workshop__/plain.tsx +5 -8
- package/src/core/primitives/spinner/__workshop__/Props.tsx +3 -3
- package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
- package/src/core/primitives/text/__workshop__/example.tsx +8 -11
- package/src/core/primitives/textArea/__workshop__/plain.tsx +11 -12
- package/src/core/primitives/textArea/textArea.tsx +10 -7
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +30 -18
- package/src/core/primitives/textInput/__workshop__/states.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +11 -20
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +3 -3
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/props.tsx +4 -4
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +1 -3
- package/src/css/_system.style.ts +2 -0
- package/src/css/aspects/font/font.style.ts +9 -8
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/margin/margin.style.ts +13 -0
- package/src/css/aspects/margin/types.ts +12 -7
- package/src/css/aspects/minHeight/index.ts +2 -0
- package/src/css/aspects/minHeight/minHeight.style.ts +9 -0
- package/src/css/aspects/minHeight/minHeight.ts +8 -0
- package/src/css/aspects/minHeight/types.ts +9 -0
- package/src/css/components/skeleton/skeleton.style.ts +7 -10
- package/src/css/primitives/_input/_input.style.ts +30 -51
- package/src/css/primitives/_selectable/_selectable.style.ts +2 -3
- package/src/css/primitives/box/box.style.ts +0 -3
- package/src/css/primitives/box/box.ts +2 -0
- package/src/css/primitives/box/types.ts +2 -0
- package/src/css/primitives/card/card.style.ts +3 -0
- package/src/css/primitives/code/code.style.ts +1 -0
- package/src/css/primitives/heading/heading.style.ts +1 -0
- package/src/css/primitives/label/label.style.ts +1 -0
- package/src/css/primitives/text/text.style.ts +1 -0
- package/src/css/primitives/textArea/textArea.style.ts +1 -3
- package/src/css/primitives/textInput/textInput.style.ts +10 -18
- package/src/css/primitives/textInput/textInput.ts +15 -0
- package/src/css/primitives/tooltip/tooltip.style.ts +0 -13
- package/src/css/primitives/tooltip/tooltip.ts +0 -5
- package/src/css/theme/resolveTheme.ts +29 -18
- package/src/theme/v0/font.ts +0 -1
- package/src/theme/v2/defaults/fonts.ts +0 -1
- package/src/theme/v3/_parseColorToken.ts +0 -5
- package/src/theme/v3/buildTheme_v3.ts +2 -2
- package/src/theme/v3/defaultFonts.ts +250 -0
- package/src/theme/v3/defaultTokens.ts +39 -35
- package/src/theme/v3/types.ts +35 -2
- package/src/theme/versioning/v3_v2.ts +1 -0
- package/src/css/primitives/_input/__workshop__/customInput.tsx +0 -16
- package/src/css/primitives/_input/__workshop__/index.ts +0 -14
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import {Badge, Flex} from '@sanity/ui'
|
|
2
2
|
import {useAction, useSelect, useText} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
WORKSHOP_BADGE_TONE_OPTIONS,
|
|
6
|
-
WORKSHOP_SPACE_OPTIONS,
|
|
7
|
-
} from '../../../../../workshop/constants'
|
|
4
|
+
import {WORKSHOP_BADGE_TONE_OPTIONS, WORKSHOP_SPACE_OPTIONS} from '$workshop'
|
|
8
5
|
|
|
9
6
|
export default function PropsStory() {
|
|
10
|
-
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS, 1
|
|
11
|
-
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS, 1
|
|
12
|
-
const tone = useSelect('Tone', WORKSHOP_BADGE_TONE_OPTIONS, 'default'
|
|
13
|
-
const textProp = useText('Text', 'Label'
|
|
7
|
+
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS, 1)
|
|
8
|
+
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS, 1)
|
|
9
|
+
const tone = useSelect('Tone', WORKSHOP_BADGE_TONE_OPTIONS, 'default')
|
|
10
|
+
const textProp = useText('Text', 'Label')
|
|
14
11
|
|
|
15
12
|
return (
|
|
16
13
|
<Flex align="center" height="fill" justify="center">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Box, Card, Text} from '@sanity/ui'
|
|
2
2
|
import {useAction, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_SPACE_OPTIONS} from '
|
|
4
|
+
import {WORKSHOP_SPACE_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
6
|
export default function PropsStory() {
|
|
7
|
-
const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 0
|
|
7
|
+
const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 0)
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<Box padding={[4, 5, 6]}>
|
|
@@ -94,6 +94,7 @@ export function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(props
|
|
|
94
94
|
marginBottom,
|
|
95
95
|
marginLeft,
|
|
96
96
|
maxWidth,
|
|
97
|
+
minHeight = 0,
|
|
97
98
|
minWidth = 0,
|
|
98
99
|
muted,
|
|
99
100
|
outline,
|
|
@@ -162,6 +163,7 @@ export function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(props
|
|
|
162
163
|
marginBottom,
|
|
163
164
|
marginLeft,
|
|
164
165
|
maxWidth,
|
|
166
|
+
minHeight,
|
|
165
167
|
minWidth,
|
|
166
168
|
muted,
|
|
167
169
|
outline,
|
|
@@ -9,28 +9,26 @@ import {
|
|
|
9
9
|
WORKSHOP_FLEX_JUSTIFY_OPTIONS,
|
|
10
10
|
WORKSHOP_ICON_SYMBOL_OPTIONS,
|
|
11
11
|
WORKSHOP_SPACE_OPTIONS,
|
|
12
|
-
|
|
12
|
+
WORKSHOP_TEXT_FONT_SIZE_OPTIONS,
|
|
13
13
|
WORKSHOP_TEXT_WEIGHT_OPTIONS,
|
|
14
|
-
} from '
|
|
14
|
+
} from '$workshop'
|
|
15
15
|
|
|
16
16
|
export default function ButtonStory() {
|
|
17
|
-
const disabled = useBoolean('Disabled'
|
|
18
|
-
const fontSize = useSelect('Font size',
|
|
19
|
-
const gap = useSelect('Gap', WORKSHOP_SPACE_OPTIONS
|
|
20
|
-
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS
|
|
21
|
-
const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS
|
|
22
|
-
const justify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS
|
|
23
|
-
const loading = useBoolean('Loading'
|
|
24
|
-
const mode = useSelect('Mode', WORKSHOP_BUTTON_MODE_OPTIONS
|
|
25
|
-
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS
|
|
26
|
-
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS
|
|
27
|
-
const selected = useBoolean('Selected'
|
|
28
|
-
const tone = useSelect('Tone', WORKSHOP_BUTTON_TONE_OPTIONS
|
|
29
|
-
const textAlign =
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const textWeight =
|
|
33
|
-
useSelect('Text weight', WORKSHOP_TEXT_WEIGHT_OPTIONS, '', 'Props') || undefined
|
|
17
|
+
const disabled = useBoolean('Disabled')
|
|
18
|
+
const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS)
|
|
19
|
+
const gap = useSelect('Gap', WORKSHOP_SPACE_OPTIONS)
|
|
20
|
+
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS)
|
|
21
|
+
const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS)
|
|
22
|
+
const justify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS)
|
|
23
|
+
const loading = useBoolean('Loading')
|
|
24
|
+
const mode = useSelect('Mode', WORKSHOP_BUTTON_MODE_OPTIONS)
|
|
25
|
+
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS)
|
|
26
|
+
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS)
|
|
27
|
+
const selected = useBoolean('Selected')
|
|
28
|
+
const tone = useSelect('Tone', WORKSHOP_BUTTON_TONE_OPTIONS)
|
|
29
|
+
const textAlign = useSelect('Text align', WORKSHOP_BUTTON_TEXT_ALIGN_OPTIONS)
|
|
30
|
+
const textProp = useText('Text', 'Label')
|
|
31
|
+
const textWeight = useSelect('Text weight', WORKSHOP_TEXT_WEIGHT_OPTIONS)
|
|
34
32
|
|
|
35
33
|
return (
|
|
36
34
|
<Flex align="center" height="fill" justify="center">
|
|
@@ -8,22 +8,22 @@ import {
|
|
|
8
8
|
WORKSHOP_FLEX_JUSTIFY_OPTIONS,
|
|
9
9
|
WORKSHOP_ICON_SYMBOL_OPTIONS,
|
|
10
10
|
WORKSHOP_SPACE_OPTIONS,
|
|
11
|
-
|
|
12
|
-
} from '
|
|
11
|
+
WORKSHOP_TEXT_FONT_SIZE_OPTIONS,
|
|
12
|
+
} from '$workshop'
|
|
13
13
|
|
|
14
14
|
export default function StackedStory() {
|
|
15
15
|
const tones = Object.entries(WORKSHOP_BUTTON_TONE_OPTIONS)
|
|
16
|
-
const disabled = useBoolean('Disabled', false
|
|
17
|
-
const fontSize = useSelect('Font size',
|
|
18
|
-
const gap = useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 3
|
|
19
|
-
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, 'add-circle'
|
|
20
|
-
const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS
|
|
21
|
-
const justify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS, 'center'
|
|
22
|
-
const mode = useSelect('Mode', WORKSHOP_BUTTON_MODE_OPTIONS, 'default'
|
|
16
|
+
const disabled = useBoolean('Disabled', false)
|
|
17
|
+
const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 2)
|
|
18
|
+
const gap = useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 3)
|
|
19
|
+
const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, 'add-circle')
|
|
20
|
+
const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS)
|
|
21
|
+
const justify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS, 'center')
|
|
22
|
+
const mode = useSelect('Mode', WORKSHOP_BUTTON_MODE_OPTIONS, 'default')
|
|
23
23
|
const onClick = useAction('onClick')
|
|
24
|
-
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS, 3
|
|
25
|
-
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS, 3
|
|
26
|
-
const selected = useBoolean('Selected', false
|
|
24
|
+
const paddingX = useSelect('Padding X', WORKSHOP_SPACE_OPTIONS, 3)
|
|
25
|
+
const paddingY = useSelect('Padding Y', WORKSHOP_SPACE_OPTIONS, 3)
|
|
26
|
+
const selected = useBoolean('Selected', false)
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<Card height="fill">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Box, Card, Container, Flex, Grid, Stack, Text} from '@sanity/ui'
|
|
2
2
|
|
|
3
|
-
import {WORKSHOP_CARD_TONE_OPTIONS} from '
|
|
3
|
+
import {WORKSHOP_CARD_TONE_OPTIONS} from '$workshop'
|
|
4
4
|
|
|
5
5
|
export default function AsButtonStory() {
|
|
6
6
|
const tones = Object.entries(WORKSHOP_CARD_TONE_OPTIONS)
|
|
@@ -2,8 +2,8 @@ import {Card, Flex, Stack, Text} from '@sanity/ui'
|
|
|
2
2
|
import {useBoolean} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
4
|
export default function InteractiveCardStory() {
|
|
5
|
-
const pressed = useBoolean('Pressed', false
|
|
6
|
-
const selected = useBoolean('Selected', false
|
|
5
|
+
const pressed = useBoolean('Pressed', false)
|
|
6
|
+
const selected = useBoolean('Selected', false)
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
9
|
<Flex align="center" height="fill" justify="center">
|
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
WORKSHOP_RADIUS_OPTIONS,
|
|
8
8
|
WORKSHOP_SHADOW_OPTIONS,
|
|
9
9
|
WORKSHOP_SPACE_OPTIONS,
|
|
10
|
-
} from '
|
|
10
|
+
} from '$workshop'
|
|
11
11
|
|
|
12
12
|
export default function PropsStory() {
|
|
13
|
-
const as = useSelect('As', WORKSHOP_CARD_AS_OPTIONS, 'div'
|
|
14
|
-
const border = useBoolean('Border', false
|
|
15
|
-
const checkered = useBoolean('Checkered', false
|
|
16
|
-
const muted = useBoolean('Muted', false
|
|
17
|
-
const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3
|
|
18
|
-
const pressed = useBoolean('Pressed', false
|
|
19
|
-
const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 0
|
|
20
|
-
const selected = useBoolean('Selected', false
|
|
21
|
-
const shadow = useSelect('Shadow', WORKSHOP_SHADOW_OPTIONS, 0
|
|
22
|
-
const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS, 'default'
|
|
13
|
+
const as = useSelect('As', WORKSHOP_CARD_AS_OPTIONS, 'div')
|
|
14
|
+
const border = useBoolean('Border', false)
|
|
15
|
+
const checkered = useBoolean('Checkered', false)
|
|
16
|
+
const muted = useBoolean('Muted', false)
|
|
17
|
+
const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3)
|
|
18
|
+
const pressed = useBoolean('Pressed', false)
|
|
19
|
+
const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 0)
|
|
20
|
+
const selected = useBoolean('Selected', false)
|
|
21
|
+
const shadow = useSelect('Shadow', WORKSHOP_SHADOW_OPTIONS, 0)
|
|
22
|
+
const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS, 'default')
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
@@ -3,8 +3,8 @@ import {Box, Card, Container, Flex, Inline, Stack, Text} from '@sanity/ui'
|
|
|
3
3
|
import {useBoolean} from '@sanity/ui-workshop'
|
|
4
4
|
|
|
5
5
|
export default function SelectedStory() {
|
|
6
|
-
const disabled = useBoolean('Disabled', false)
|
|
7
|
-
const selected = useBoolean('Selected', false)
|
|
6
|
+
const disabled = useBoolean('Disabled', false)
|
|
7
|
+
const selected = useBoolean('Selected', false)
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
@@ -2,14 +2,14 @@ import {Box, Checkbox, Flex, Text} from '@sanity/ui'
|
|
|
2
2
|
import {useAction, useBoolean} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
4
|
export default function PropsStory() {
|
|
5
|
-
const checked = useBoolean('Checked', false
|
|
6
|
-
const disabled = useBoolean('Disabled', false
|
|
7
|
-
const indeterminate = useBoolean('Indeterminate', false
|
|
8
|
-
const invalid = useBoolean('Invalid', false
|
|
5
|
+
const checked = useBoolean('Checked', false)
|
|
6
|
+
const disabled = useBoolean('Disabled', false)
|
|
7
|
+
const indeterminate = useBoolean('Indeterminate', false)
|
|
8
|
+
const invalid = useBoolean('Invalid', false)
|
|
9
9
|
const onChange = useAction('onChange')
|
|
10
10
|
const onFocus = useAction('onFocus')
|
|
11
11
|
const onBlur = useAction('onBlur')
|
|
12
|
-
const readOnly = useBoolean('Read only', false
|
|
12
|
+
const readOnly = useBoolean('Read only', false)
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {Box, Code} from '@sanity/ui'
|
|
2
2
|
import {useSelect, useText} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
WORKSHOP_CODE_LANGUAGE_OPTIONS,
|
|
6
|
-
WORKSHOP_TEXT_FONT_SIZE_OPTIONS,
|
|
7
|
-
} from '../../../../../workshop/constants'
|
|
4
|
+
import {WORKSHOP_CODE_LANGUAGE_OPTIONS, WORKSHOP_TEXT_FONT_SIZE_OPTIONS} from '$workshop'
|
|
8
5
|
|
|
9
6
|
export default function PropsStory() {
|
|
10
|
-
const code = useText('Code', `console.log('Hello, world')
|
|
11
|
-
const language = useSelect('Language', WORKSHOP_CODE_LANGUAGE_OPTIONS, 'typescript'
|
|
12
|
-
const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 1
|
|
7
|
+
const code = useText('Code', `console.log('Hello, world')`)
|
|
8
|
+
const language = useSelect('Language', WORKSHOP_CODE_LANGUAGE_OPTIONS, 'typescript')
|
|
9
|
+
const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 1)
|
|
13
10
|
|
|
14
11
|
return (
|
|
15
12
|
<Box padding={[4, 5, 6]}>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Card, Container, Flex, Text} from '@sanity/ui'
|
|
2
2
|
import {useAction, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_CONTAINER_WIDTH_OPTIONS} from '
|
|
4
|
+
import {WORKSHOP_CONTAINER_WIDTH_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
6
|
export default function PlainStory() {
|
|
7
|
-
const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 0
|
|
7
|
+
const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 0)
|
|
8
8
|
|
|
9
9
|
return (
|
|
10
10
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
@@ -2,7 +2,7 @@ import {Card, Code, Flex} from '@sanity/ui'
|
|
|
2
2
|
import {useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
import {styled} from 'styled-components'
|
|
4
4
|
|
|
5
|
-
import {WORKSHOP_FLEX_DIRECTION_OPTIONS} from '
|
|
5
|
+
import {WORKSHOP_FLEX_DIRECTION_OPTIONS} from '$workshop'
|
|
6
6
|
|
|
7
7
|
const DebugCard = styled(Card)`
|
|
8
8
|
outline: 1px solid red;
|
|
@@ -14,7 +14,7 @@ const DebugCard = styled(Card)`
|
|
|
14
14
|
`
|
|
15
15
|
|
|
16
16
|
export default function ExampleStory() {
|
|
17
|
-
const direction = useSelect('Direction', WORKSHOP_FLEX_DIRECTION_OPTIONS, 'row'
|
|
17
|
+
const direction = useSelect('Direction', WORKSHOP_FLEX_DIRECTION_OPTIONS, 'row')
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<Flex direction={direction} height="fill" style={{width: '100%'}}>
|
|
@@ -5,15 +5,19 @@ import {
|
|
|
5
5
|
WORKSHOP_FONT_WEIGHT_OPTIONS,
|
|
6
6
|
WORKSHOP_HEADING_FONT_SIZE_OPTIONS,
|
|
7
7
|
WORKSHOP_TEXT_OVERFLOW_OPTIONS,
|
|
8
|
-
} from '
|
|
8
|
+
} from '$workshop'
|
|
9
9
|
|
|
10
10
|
export default function PlainStory() {
|
|
11
|
-
const muted = useBoolean('Muted', false
|
|
12
|
-
const size = useSelect('Size', WORKSHOP_HEADING_FONT_SIZE_OPTIONS, 2
|
|
13
|
-
const textChild = useText('Text', 'Hello, world'
|
|
14
|
-
const textOverflow =
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const muted = useBoolean('Muted', false)
|
|
12
|
+
const size = useSelect('Size', WORKSHOP_HEADING_FONT_SIZE_OPTIONS, 2)
|
|
13
|
+
const textChild = useText('Text', 'Hello, world')
|
|
14
|
+
const textOverflow = useSelect(
|
|
15
|
+
'Text overflow',
|
|
16
|
+
WORKSHOP_TEXT_OVERFLOW_OPTIONS,
|
|
17
|
+
undefined,
|
|
18
|
+
'Props',
|
|
19
|
+
)
|
|
20
|
+
const weight = useSelect('Weight', WORKSHOP_FONT_WEIGHT_OPTIONS)
|
|
17
21
|
|
|
18
22
|
return (
|
|
19
23
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {Card, Flex, Inline, Text} from '@sanity/ui'
|
|
2
2
|
import {useAction, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_SPACE_OPTIONS} from '
|
|
4
|
+
import {WORKSHOP_SPACE_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
6
|
export default function PlainStory() {
|
|
7
7
|
return (
|
|
8
8
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
9
|
-
<Inline
|
|
10
|
-
gap={useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 0, 'Props')}
|
|
11
|
-
onClick={useAction('onClick')}
|
|
12
|
-
>
|
|
9
|
+
<Inline gap={useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 0)} onClick={useAction('onClick')}>
|
|
13
10
|
<Card padding={1} shadow={1}>
|
|
14
11
|
<Text size={1}>Inline item</Text>
|
|
15
12
|
</Card>
|
|
@@ -6,16 +6,15 @@ import {
|
|
|
6
6
|
WORKSHOP_LABEL_FONT_SIZE_OPTIONS,
|
|
7
7
|
WORKSHOP_TEXT_ALIGN_OPTIONS,
|
|
8
8
|
WORKSHOP_TEXT_OVERFLOW_OPTIONS,
|
|
9
|
-
} from '
|
|
9
|
+
} from '$workshop'
|
|
10
10
|
|
|
11
11
|
export default function PlainStory() {
|
|
12
|
-
const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS
|
|
13
|
-
const muted = useBoolean('Muted', false
|
|
14
|
-
const size = useSelect('Size', WORKSHOP_LABEL_FONT_SIZE_OPTIONS
|
|
15
|
-
const textChild = useText('Text', 'Label text'
|
|
16
|
-
const textOverflow =
|
|
17
|
-
|
|
18
|
-
const weight = useSelect('Weight', WORKSHOP_FONT_WEIGHT_OPTIONS, '', 'Props') || undefined
|
|
12
|
+
const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS)
|
|
13
|
+
const muted = useBoolean('Muted', false)
|
|
14
|
+
const size = useSelect('Size', WORKSHOP_LABEL_FONT_SIZE_OPTIONS)
|
|
15
|
+
const textChild = useText('Text', 'Label text')
|
|
16
|
+
const textOverflow = useSelect('Text overflow', WORKSHOP_TEXT_OVERFLOW_OPTIONS)
|
|
17
|
+
const weight = useSelect('Weight', WORKSHOP_FONT_WEIGHT_OPTIONS)
|
|
19
18
|
|
|
20
19
|
return (
|
|
21
20
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
@@ -4,20 +4,20 @@ import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
|
4
4
|
import {useCallback, useRef, useState} from 'react'
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
+
WORKSHOP_CONTAINER_WIDTH_OPTIONS,
|
|
7
8
|
WORKSHOP_FLEX_ALIGN_OPTIONS,
|
|
8
9
|
WORKSHOP_FLEX_JUSTIFY_OPTIONS,
|
|
9
10
|
WORKSHOP_PLACEMENT_OPTIONS,
|
|
10
|
-
|
|
11
|
-
} from '../../../../../workshop/constants'
|
|
11
|
+
} from '$workshop'
|
|
12
12
|
|
|
13
13
|
export default function AlignedStory() {
|
|
14
14
|
const constrainSize = useBoolean('Constrain size', false)
|
|
15
|
-
const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS
|
|
15
|
+
const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS)
|
|
16
16
|
const portal = useBoolean('Portal', true)
|
|
17
|
-
const width = useSelect('Width',
|
|
17
|
+
const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 'auto')
|
|
18
18
|
|
|
19
|
-
const flexAlign = useSelect('Align', WORKSHOP_FLEX_ALIGN_OPTIONS
|
|
20
|
-
const flexJustify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS
|
|
19
|
+
const flexAlign = useSelect('Align', WORKSHOP_FLEX_ALIGN_OPTIONS)
|
|
20
|
+
const flexJustify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS)
|
|
21
21
|
|
|
22
22
|
const [open, setOpen] = useState(false)
|
|
23
23
|
const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {Box, Button, Container, Flex, Popover, Stack, Text} from '@sanity/ui'
|
|
2
2
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_PLACEMENT_OPTIONS} from '
|
|
4
|
+
import {WORKSHOP_PLACEMENT_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
6
|
export default function MatchReferenceWidthStory() {
|
|
7
|
-
const arrow = useBoolean('Arrow', true
|
|
8
|
-
const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'bottom'
|
|
7
|
+
const arrow = useBoolean('Arrow', true)
|
|
8
|
+
const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'bottom')
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {useSelect} from '@sanity/ui-workshop'
|
|
2
2
|
import {useCallback, useEffect, useRef, useState} from 'react'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_CARD_TONE_OPTIONS} from '
|
|
4
|
+
import {WORKSHOP_CARD_TONE_OPTIONS} from '$workshop'
|
|
5
5
|
import type {CardTone} from '../../../types'
|
|
6
6
|
import {BoundaryElementProvider} from '../../../utils'
|
|
7
7
|
import {Box} from '../../box'
|
|
@@ -3,9 +3,11 @@ import {useRef, useState} from 'react'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
WORKSHOP_CONTAINER_WIDTH_OPTIONS,
|
|
6
|
+
// WORKSHOP_CONTAINER_WIDTH_OPTIONS,
|
|
6
7
|
WORKSHOP_PLACEMENT_OPTIONS,
|
|
7
8
|
WORKSHOP_RADIUS_OPTIONS,
|
|
8
|
-
} from '
|
|
9
|
+
} from '$workshop'
|
|
10
|
+
|
|
9
11
|
import {BoundaryElementProvider, PortalProvider} from '../../../utils'
|
|
10
12
|
import {Button} from '../../button'
|
|
11
13
|
import {Card} from '../../card'
|
|
@@ -4,8 +4,8 @@ import {useCallback, useState} from 'react'
|
|
|
4
4
|
|
|
5
5
|
export default function ExampleStory() {
|
|
6
6
|
const [value, setValue] = useState('first-option')
|
|
7
|
-
const disabled = useBoolean('Disabled', false
|
|
8
|
-
const readOnly = useBoolean('Read only', false
|
|
7
|
+
const disabled = useBoolean('Disabled', false)
|
|
8
|
+
const readOnly = useBoolean('Read only', false)
|
|
9
9
|
|
|
10
10
|
const handleChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
|
11
11
|
setValue(event.target.value)
|
|
@@ -2,14 +2,14 @@ import {Flex, Radio} from '@sanity/ui'
|
|
|
2
2
|
import {useAction, useBoolean} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
4
|
export default function PlainStory() {
|
|
5
|
-
const checked = useBoolean('Checked', false
|
|
6
|
-
const disabled = useBoolean('Disabled', false
|
|
5
|
+
const checked = useBoolean('Checked', false)
|
|
6
|
+
const disabled = useBoolean('Disabled', false)
|
|
7
7
|
const id = 'radioStory'
|
|
8
8
|
const name = 'radioStory'
|
|
9
9
|
const onBlur = useAction('onBlur')
|
|
10
10
|
const onChange = useAction('onChange')
|
|
11
11
|
const onFocus = useAction('onFocus')
|
|
12
|
-
const readOnly = useBoolean('Read only', false
|
|
12
|
+
const readOnly = useBoolean('Read only', false)
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<Flex align="center" height="fill" justify="center" padding={[3, 4, 5]} sizing="border">
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import {Card, Container, Label, Select, Stack} from '@sanity/ui'
|
|
2
2
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
WORKSHOP_RADIUS_OPTIONS,
|
|
6
|
-
WORKSHOP_TEXT_FONT_SIZE_OPTIONS,
|
|
7
|
-
} from '../../../../../workshop/constants'
|
|
4
|
+
import {WORKSHOP_RADIUS_OPTIONS, WORKSHOP_TEXT_FONT_SIZE_OPTIONS} from '$workshop'
|
|
8
5
|
|
|
9
6
|
export default function PlainStory() {
|
|
10
7
|
const border = useBoolean('Border', true)
|
|
11
|
-
const disabled = useBoolean('Disabled', false
|
|
12
|
-
const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS
|
|
13
|
-
const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS
|
|
14
|
-
const readOnly = useBoolean('Read only', false
|
|
8
|
+
const disabled = useBoolean('Disabled', false)
|
|
9
|
+
const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS)
|
|
10
|
+
const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS)
|
|
11
|
+
const readOnly = useBoolean('Read only', false)
|
|
15
12
|
|
|
16
13
|
return (
|
|
17
14
|
<Container width={0}>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {Flex, Spinner} from '@sanity/ui'
|
|
2
2
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {WORKSHOP_TEXT_FONT_SIZE_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
6
|
export default function Props() {
|
|
7
|
-
const muted = useBoolean('Muted', false
|
|
8
|
-
const size = useSelect('Size',
|
|
7
|
+
const muted = useBoolean('Muted', false)
|
|
8
|
+
const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 2)
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<Flex align="center" height="fill" justify="center">
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {Card, Container, Flex, Stack, Text} from '@sanity/ui'
|
|
2
2
|
import {useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_SPACE_OPTIONS} from '
|
|
4
|
+
import {WORKSHOP_SPACE_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
6
|
export default function PlainStory() {
|
|
7
7
|
return (
|
|
8
8
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
9
9
|
<Container width={0}>
|
|
10
|
-
<Stack gap={useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 0
|
|
10
|
+
<Stack gap={useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 0)}>
|
|
11
11
|
<Card padding={[2, 3, 4]} shadow={1}>
|
|
12
12
|
<Text align="center" muted>
|
|
13
13
|
Stack item
|
|
@@ -4,14 +4,14 @@ import type {AvatarColor} from '@sanity/ui/theme'
|
|
|
4
4
|
import {useSelect} from '@sanity/ui-workshop'
|
|
5
5
|
import {styled} from 'styled-components'
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {WORKSHOP_AVATAR_COLOR_OPTIONS} from '$workshop'
|
|
8
8
|
|
|
9
9
|
const ColoredText = styled(Text)<{$color: AvatarColor}>`
|
|
10
10
|
${varNames.color.fg}: ${({$color}) => vars.color.avatar[$color].bg};
|
|
11
11
|
`
|
|
12
12
|
|
|
13
13
|
export default function ColoredTextStory() {
|
|
14
|
-
const color = useSelect('Color',
|
|
14
|
+
const color = useSelect('Color', WORKSHOP_AVATAR_COLOR_OPTIONS, 'gray') ?? 'gray'
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
@@ -3,21 +3,18 @@ import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
WORKSHOP_TEXT_ALIGN_OPTIONS,
|
|
6
|
+
WORKSHOP_TEXT_FONT_SIZE_OPTIONS,
|
|
6
7
|
WORKSHOP_TEXT_OVERFLOW_OPTIONS,
|
|
7
|
-
WORKSHOP_TEXT_SIZE_OPTIONS,
|
|
8
8
|
WORKSHOP_TEXT_WEIGHT_OPTIONS,
|
|
9
|
-
} from '
|
|
9
|
+
} from '$workshop'
|
|
10
10
|
|
|
11
11
|
export default function TextStory() {
|
|
12
|
-
const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS
|
|
13
|
-
const muted = useBoolean('Muted', false
|
|
14
|
-
const size = useSelect('Size',
|
|
15
|
-
const text = useText('Text', 'Hello, world'
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
useSelect('Text overflow', WORKSHOP_TEXT_OVERFLOW_OPTIONS, undefined, 'Props') || undefined
|
|
19
|
-
|
|
20
|
-
const weight = useSelect('Weight', WORKSHOP_TEXT_WEIGHT_OPTIONS, '', 'Props') || undefined
|
|
12
|
+
const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS)
|
|
13
|
+
const muted = useBoolean('Muted', false)
|
|
14
|
+
const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 1)
|
|
15
|
+
const text = useText('Text', 'Hello, world')
|
|
16
|
+
const textOverflow = useSelect('Text overflow', WORKSHOP_TEXT_OVERFLOW_OPTIONS)
|
|
17
|
+
const weight = useSelect('Weight', WORKSHOP_TEXT_WEIGHT_OPTIONS)
|
|
21
18
|
|
|
22
19
|
return (
|
|
23
20
|
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|