@sanity/ui 1.0.0-beta.32 → 1.0.0-beta.34
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/LICENSE +1 -1
- package/dist/{types/src/index.d.ts → index.d.ts} +136 -68
- package/dist/{sanity-ui.esm.js → index.esm.js} +698 -1525
- package/dist/index.esm.js.map +1 -0
- package/dist/{sanity-ui.js → index.js} +697 -1539
- package/dist/index.js.map +1 -0
- package/package.json +112 -23
- package/src/components/autocomplete/__workshop__/example.tsx +1 -1
- package/src/components/autocomplete/__workshop__/index.ts +36 -32
- package/src/components/autocomplete/autocomplete.tsx +1 -2
- package/src/components/autocomplete/constants.ts +3 -8
- package/src/components/breadcrumbs/__workshop__/index.ts +11 -7
- package/src/components/dialog/__workshop__/index.ts +13 -9
- package/src/components/hotkeys/__workshop__/index.ts +11 -3
- package/src/components/menu/__workshop__/index.ts +71 -67
- package/src/components/menu/menuButton.tsx +16 -14
- package/src/components/skeleton/__workshop__/index.ts +8 -4
- package/src/components/tab/__workshop__/index.ts +11 -3
- package/src/components/toast/__workshop__/index.ts +16 -4
- package/src/components/tree/__workshop__/basic.perf.ts +1 -14
- package/src/components/tree/__workshop__/basic.tsx +1 -1
- package/src/components/tree/__workshop__/index.ts +12 -8
- package/src/hooks/useElementRect/__workshop__/index.ts +11 -3
- package/src/hooks/useMediaIndex/__workshop__/index.ts +11 -3
- package/src/primitives/avatar/__workshop__/index.ts +16 -12
- package/src/primitives/badge/__workshop__/index.ts +16 -12
- package/src/primitives/badge/__workshop__/tones.tsx +1 -1
- package/src/primitives/box/__workshop__/index.ts +16 -4
- package/src/primitives/button/__workshop__/index.ts +51 -47
- package/src/primitives/card/__workshop__/index.ts +15 -11
- package/src/primitives/checkbox/__workshop__/index.ts +10 -6
- package/src/primitives/code/__workshop__/index.ts +16 -12
- package/src/primitives/container/__workshop__/index.ts +5 -3
- package/src/primitives/flex/__workshop__/index.ts +8 -4
- package/src/primitives/grid/__workshop__/index.ts +7 -3
- package/src/primitives/heading/__workshop__/index.ts +16 -12
- package/src/primitives/inline/__workshop__/index.ts +5 -3
- package/src/primitives/kbd/__workshop__/index.ts +5 -3
- package/src/primitives/label/__workshop__/index.ts +16 -12
- package/src/primitives/popover/__workshop__/PlainStory.tsx +0 -1
- package/src/primitives/popover/__workshop__/TestStory.tsx +0 -1
- package/src/primitives/popover/__workshop__/index.ts +36 -32
- package/src/primitives/popover/constants.ts +0 -3
- package/src/primitives/popover/floating-ui/size.ts +40 -25
- package/src/primitives/popover/popover.tsx +54 -41
- package/src/primitives/popover/popoverCard.tsx +9 -16
- package/src/primitives/radio/__workshop__/index.ts +8 -4
- package/src/primitives/select/__workshop__/index.ts +8 -4
- package/src/primitives/spinner/__workshop__/index.ts +11 -7
- package/src/primitives/stack/__workshop__/index.ts +11 -7
- package/src/primitives/switch/__workshop__/index.ts +8 -4
- package/src/primitives/text/__workshop__/index.ts +21 -17
- package/src/primitives/textArea/__workshop__/index.ts +11 -7
- package/src/primitives/textInput/__workshop__/index.ts +46 -42
- package/src/primitives/textInput/__workshop__/plain.tsx +2 -1
- package/src/primitives/tooltip/__workshop__/index.ts +11 -7
- package/src/theme/__workshop__/index.ts +26 -22
- package/src/theme/{ThemeContext.ts → themeContext.ts} +0 -0
- package/src/utils/boundaryElement/__workshop__/index.ts +11 -7
- package/src/utils/elementQuery/__workshop__/index.ts +11 -7
- package/src/utils/layer/__workshop__/index.ts +21 -17
- package/src/utils/portal/__workshop__/index.ts +11 -7
- package/src/utils/virtualList/__workshop__/index.ts +26 -22
- package/dist/sanity-ui.esm.js.map +0 -1
- package/dist/sanity-ui.js.map +0 -1
- package/src/__workshop__/color/overview.tsx +0 -101
- package/src/__workshop__/index.ts +0 -10
- package/src/icons/__workshop__/.eslintrc +0 -5
- package/src/icons/__workshop__/index.tsx +0 -6
- package/src/icons/__workshop__/overview.tsx +0 -76
- package/src/utils/srOnly/__workshop__/.eslintrc +0 -5
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {PerfTestProps, PerfTestRunFn} from '@sanity/ui-workshop'
|
|
1
|
+
import {PerfTestProps, PerfTestRunFn} from '@sanity/ui-workshop/plugin-perf'
|
|
2
2
|
import {findByTestId, fireEvent} from '@testing-library/dom'
|
|
3
3
|
|
|
4
|
-
// // function delay(ms: number) {
|
|
5
|
-
// // return new Promise((resolve) => setTimeout(resolve, ms))
|
|
6
|
-
// // }
|
|
7
|
-
|
|
8
4
|
function test<ElementType = unknown>(
|
|
9
5
|
title: string,
|
|
10
6
|
run: PerfTestRunFn<ElementType>
|
|
@@ -12,17 +8,8 @@ function test<ElementType = unknown>(
|
|
|
12
8
|
return {name: title, run}
|
|
13
9
|
}
|
|
14
10
|
|
|
15
|
-
// export const toggleTreeGroupsTest = perfTest(
|
|
16
|
-
// 'Toggle tree groups',
|
|
17
|
-
// async ({target}: {target: HTMLDivElement}) => {
|
|
18
|
-
|
|
19
|
-
// }
|
|
20
|
-
// )
|
|
21
|
-
|
|
22
11
|
export const perfTests = [
|
|
23
12
|
test('Toggle tree groups', async ({target}: {target: HTMLDivElement}) => {
|
|
24
|
-
// await delay(50)
|
|
25
|
-
|
|
26
13
|
const apples = await findByTestId(target, 'apples')
|
|
27
14
|
const oranges = await findByTestId(target, 'oranges')
|
|
28
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {LinkIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Tree, TreeItem} from '@sanity/ui'
|
|
3
|
-
import {usePerfTest} from '@sanity/ui-workshop'
|
|
3
|
+
import {usePerfTest} from '@sanity/ui-workshop/plugin-perf'
|
|
4
4
|
import {useCallback, useState} from 'react'
|
|
5
5
|
import {perfTests} from './basic.perf'
|
|
6
6
|
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'components/tree',
|
|
6
|
+
title: 'Tree',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'basic',
|
|
10
|
+
title: 'Basic',
|
|
11
|
+
component: lazy(() => import('./basic')),
|
|
12
|
+
// options: {perfTests: () => import('./basic.perf')},
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
})
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'hooks/useElementRect',
|
|
6
|
+
title: 'useElementRect',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'example',
|
|
10
|
+
title: 'Example',
|
|
11
|
+
component: lazy(() => import('./example')),
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
})
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'hooks/use-media-index',
|
|
6
|
+
title: 'useMediaIndex',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'test',
|
|
10
|
+
title: 'Test',
|
|
11
|
+
component: lazy(() => import('./test')),
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
})
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/avatar',
|
|
6
|
+
title: 'Avatar',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'as-button',
|
|
10
|
+
title: 'As button',
|
|
11
|
+
component: lazy(() => import('./asButton')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'avatar-stack',
|
|
15
|
+
title: 'Avatar stack',
|
|
16
|
+
component: lazy(() => import('./stack')),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/badge',
|
|
6
|
+
title: 'Badge',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'props',
|
|
10
|
+
title: 'Props',
|
|
11
|
+
component: lazy(() => import('./props')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'tones',
|
|
15
|
+
title: 'Tones',
|
|
16
|
+
component: lazy(() => import('./tones')),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
@@ -6,7 +6,7 @@ export default function Tones() {
|
|
|
6
6
|
const mode = useSelect('Mode', WORKSHOP_BADGE_MODE_OPTIONS, 'default', 'Props')
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<Flex align="center" height="fill" justify="center">
|
|
9
|
+
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
10
10
|
<Inline space={2}>
|
|
11
11
|
<Badge mode={mode}>Default</Badge>
|
|
12
12
|
<Badge mode={mode} tone="primary">
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/box',
|
|
6
|
+
title: 'Box',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'props',
|
|
10
|
+
title: 'Props',
|
|
11
|
+
component: lazy(() => import('./props')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'responsive',
|
|
15
|
+
title: 'Responsive',
|
|
16
|
+
component: lazy(() => import('./responsive')),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/button',
|
|
6
|
+
title: 'Button',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'props',
|
|
10
|
+
title: 'Props',
|
|
11
|
+
component: lazy(() => import('./props')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'styled-1',
|
|
15
|
+
title: 'Styled #1',
|
|
16
|
+
component: lazy(() => import('./styled1')),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'styled-2',
|
|
20
|
+
title: 'Styled #2',
|
|
21
|
+
component: lazy(() => import('./styled2')),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'stacked',
|
|
25
|
+
title: 'Stacked',
|
|
26
|
+
component: lazy(() => import('./stacked')),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'custom',
|
|
30
|
+
title: 'Custom',
|
|
31
|
+
component: lazy(() => import('./custom')),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'mixed-children',
|
|
35
|
+
title: 'Mixed children',
|
|
36
|
+
component: lazy(() => import('./mixedChildren')),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'upload-button',
|
|
40
|
+
title: 'Upload button',
|
|
41
|
+
component: lazy(() => import('./uploadButton')),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'sanity-upload-button-workaround',
|
|
45
|
+
title: 'SanityUploadButtonWorkaroundStory',
|
|
46
|
+
component: lazy(() => import('./sanityUploadButton')),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'custom-icons',
|
|
50
|
+
title: 'Custom icons',
|
|
51
|
+
component: lazy(() => import('./customIcons')),
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
})
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/card',
|
|
6
|
+
title: 'Card',
|
|
7
|
+
stories: [
|
|
8
|
+
{name: 'props', title: 'Props', component: lazy(() => import('./props'))},
|
|
9
|
+
{name: 'styled', title: 'Styled', component: lazy(() => import('./styled'))},
|
|
10
|
+
{name: 'interactive', title: 'Interactive', component: lazy(() => import('./interactive'))},
|
|
11
|
+
{name: 'tones', title: 'Tones', component: lazy(() => import('./allTones'))},
|
|
12
|
+
{name: 'as-button', title: 'As button', component: lazy(() => import('./asButton'))},
|
|
13
|
+
{name: 'list-nav', title: 'List navigation', component: lazy(() => import('./listNavigation'))},
|
|
14
|
+
{name: 'checkered', title: 'Checkered', component: lazy(() => import('./checkered'))},
|
|
15
|
+
{name: 'as-component', title: 'As component', component: lazy(() => import('./asComponent'))},
|
|
16
|
+
{name: 'selected', title: 'Selected', component: lazy(() => import('./selected'))},
|
|
17
|
+
],
|
|
18
|
+
})
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/checkbox',
|
|
6
|
+
title: 'Checkbox',
|
|
7
|
+
stories: [
|
|
8
|
+
{name: 'props', title: 'Props', component: lazy(() => import('./props'))},
|
|
9
|
+
{name: 'example', title: 'Example', component: lazy(() => import('./example'))},
|
|
10
|
+
{name: 'read-only', title: 'Read-only', component: lazy(() => import('./readOnly'))},
|
|
11
|
+
{name: 'multiple-tones', title: 'Multiple tones', component: lazy(() => import('./tones'))},
|
|
12
|
+
],
|
|
13
|
+
})
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/code',
|
|
6
|
+
title: 'Code',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'props',
|
|
10
|
+
title: 'Props',
|
|
11
|
+
component: lazy(() => import('./props')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'optical-alignment',
|
|
15
|
+
title: 'Optical alignment',
|
|
16
|
+
component: lazy(() => import('./opticalAlignment')),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/container',
|
|
6
|
+
title: 'Container',
|
|
7
|
+
stories: [{name: 'plain', title: 'Plain', component: lazy(() => import('./example'))}],
|
|
8
|
+
})
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/flex',
|
|
6
|
+
title: 'Flex',
|
|
7
|
+
stories: [
|
|
8
|
+
{name: 'plain', title: 'Plain', component: lazy(() => import('./example'))},
|
|
9
|
+
{name: 'gap', title: 'Gap', component: lazy(() => import('./gap'))},
|
|
10
|
+
],
|
|
11
|
+
})
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/grid',
|
|
6
|
+
title: 'Grid',
|
|
7
|
+
stories: [
|
|
8
|
+
{name: 'responsive', title: 'Responsive', component: lazy(() => import('./responsive'))},
|
|
9
|
+
],
|
|
10
|
+
})
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/heading',
|
|
6
|
+
title: 'Heading',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'plain',
|
|
10
|
+
title: 'Plain',
|
|
11
|
+
component: lazy(() => import('./plain')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'optical-alignment',
|
|
15
|
+
title: 'Optical alignment',
|
|
16
|
+
component: lazy(() => import('./opticalAlignment')),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/inline',
|
|
6
|
+
title: 'Inline',
|
|
7
|
+
stories: [{name: 'plain', title: 'Plain', component: lazy(() => import('./plain'))}],
|
|
8
|
+
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/kbd',
|
|
6
|
+
title: 'KBD',
|
|
7
|
+
stories: [{name: 'plain', title: 'Plain', component: lazy(() => import('./plain'))}],
|
|
8
|
+
})
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/label',
|
|
6
|
+
title: 'Label',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'plain',
|
|
10
|
+
title: 'Plain',
|
|
11
|
+
component: lazy(() => import('./plain')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'optical-alignment',
|
|
15
|
+
title: 'Optical alignment',
|
|
16
|
+
component: lazy(() => import('./opticalAlignment')),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import {defineScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
export default defineScope(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'primitives/popover',
|
|
6
|
+
title: 'Popover',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'test',
|
|
10
|
+
title: 'Test',
|
|
11
|
+
component: lazy(() => import('./TestStory')),
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'plain',
|
|
15
|
+
title: 'Plain',
|
|
16
|
+
component: lazy(() => import('./PlainStory')),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'recursive',
|
|
20
|
+
title: 'Recursive',
|
|
21
|
+
component: lazy(() => import('./RecursiveStory')),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'match-ref-width',
|
|
25
|
+
title: 'Match reference width',
|
|
26
|
+
component: lazy(() => import('./MatchReferenceWidthStory')),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'margins',
|
|
30
|
+
title: 'Margins',
|
|
31
|
+
component: lazy(() => import('./MarginsStory')),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'aligned',
|
|
35
|
+
title: 'Aligned',
|
|
36
|
+
component: lazy(() => import('./AlignedStory')),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
})
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {PopoverMargins} from '../../types'
|
|
2
2
|
|
|
3
3
|
export const DEFAULT_POPOVER_DISTANCE = 4
|
|
4
|
-
|
|
5
4
|
export const DEFAULT_POPOVER_PADDING = 4
|
|
6
|
-
|
|
7
5
|
export const DEFAULT_POPOVER_ARROW_WIDTH = 27
|
|
8
6
|
export const DEFAULT_POPOVER_ARROW_HEIGHT = 11
|
|
9
|
-
|
|
10
7
|
export const DEFAULT_POPOVER_MARGINS: PopoverMargins = [0, 0, 0, 0]
|