@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.
Files changed (71) hide show
  1. package/LICENSE +1 -1
  2. package/dist/{types/src/index.d.ts → index.d.ts} +136 -68
  3. package/dist/{sanity-ui.esm.js → index.esm.js} +698 -1525
  4. package/dist/index.esm.js.map +1 -0
  5. package/dist/{sanity-ui.js → index.js} +697 -1539
  6. package/dist/index.js.map +1 -0
  7. package/package.json +112 -23
  8. package/src/components/autocomplete/__workshop__/example.tsx +1 -1
  9. package/src/components/autocomplete/__workshop__/index.ts +36 -32
  10. package/src/components/autocomplete/autocomplete.tsx +1 -2
  11. package/src/components/autocomplete/constants.ts +3 -8
  12. package/src/components/breadcrumbs/__workshop__/index.ts +11 -7
  13. package/src/components/dialog/__workshop__/index.ts +13 -9
  14. package/src/components/hotkeys/__workshop__/index.ts +11 -3
  15. package/src/components/menu/__workshop__/index.ts +71 -67
  16. package/src/components/menu/menuButton.tsx +16 -14
  17. package/src/components/skeleton/__workshop__/index.ts +8 -4
  18. package/src/components/tab/__workshop__/index.ts +11 -3
  19. package/src/components/toast/__workshop__/index.ts +16 -4
  20. package/src/components/tree/__workshop__/basic.perf.ts +1 -14
  21. package/src/components/tree/__workshop__/basic.tsx +1 -1
  22. package/src/components/tree/__workshop__/index.ts +12 -8
  23. package/src/hooks/useElementRect/__workshop__/index.ts +11 -3
  24. package/src/hooks/useMediaIndex/__workshop__/index.ts +11 -3
  25. package/src/primitives/avatar/__workshop__/index.ts +16 -12
  26. package/src/primitives/badge/__workshop__/index.ts +16 -12
  27. package/src/primitives/badge/__workshop__/tones.tsx +1 -1
  28. package/src/primitives/box/__workshop__/index.ts +16 -4
  29. package/src/primitives/button/__workshop__/index.ts +51 -47
  30. package/src/primitives/card/__workshop__/index.ts +15 -11
  31. package/src/primitives/checkbox/__workshop__/index.ts +10 -6
  32. package/src/primitives/code/__workshop__/index.ts +16 -12
  33. package/src/primitives/container/__workshop__/index.ts +5 -3
  34. package/src/primitives/flex/__workshop__/index.ts +8 -4
  35. package/src/primitives/grid/__workshop__/index.ts +7 -3
  36. package/src/primitives/heading/__workshop__/index.ts +16 -12
  37. package/src/primitives/inline/__workshop__/index.ts +5 -3
  38. package/src/primitives/kbd/__workshop__/index.ts +5 -3
  39. package/src/primitives/label/__workshop__/index.ts +16 -12
  40. package/src/primitives/popover/__workshop__/PlainStory.tsx +0 -1
  41. package/src/primitives/popover/__workshop__/TestStory.tsx +0 -1
  42. package/src/primitives/popover/__workshop__/index.ts +36 -32
  43. package/src/primitives/popover/constants.ts +0 -3
  44. package/src/primitives/popover/floating-ui/size.ts +40 -25
  45. package/src/primitives/popover/popover.tsx +54 -41
  46. package/src/primitives/popover/popoverCard.tsx +9 -16
  47. package/src/primitives/radio/__workshop__/index.ts +8 -4
  48. package/src/primitives/select/__workshop__/index.ts +8 -4
  49. package/src/primitives/spinner/__workshop__/index.ts +11 -7
  50. package/src/primitives/stack/__workshop__/index.ts +11 -7
  51. package/src/primitives/switch/__workshop__/index.ts +8 -4
  52. package/src/primitives/text/__workshop__/index.ts +21 -17
  53. package/src/primitives/textArea/__workshop__/index.ts +11 -7
  54. package/src/primitives/textInput/__workshop__/index.ts +46 -42
  55. package/src/primitives/textInput/__workshop__/plain.tsx +2 -1
  56. package/src/primitives/tooltip/__workshop__/index.ts +11 -7
  57. package/src/theme/__workshop__/index.ts +26 -22
  58. package/src/theme/{ThemeContext.ts → themeContext.ts} +0 -0
  59. package/src/utils/boundaryElement/__workshop__/index.ts +11 -7
  60. package/src/utils/elementQuery/__workshop__/index.ts +11 -7
  61. package/src/utils/layer/__workshop__/index.ts +21 -17
  62. package/src/utils/portal/__workshop__/index.ts +11 -7
  63. package/src/utils/virtualList/__workshop__/index.ts +26 -22
  64. package/dist/sanity-ui.esm.js.map +0 -1
  65. package/dist/sanity-ui.js.map +0 -1
  66. package/src/__workshop__/color/overview.tsx +0 -101
  67. package/src/__workshop__/index.ts +0 -10
  68. package/src/icons/__workshop__/.eslintrc +0 -5
  69. package/src/icons/__workshop__/index.tsx +0 -6
  70. package/src/icons/__workshop__/overview.tsx +0 -76
  71. 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('components/tree', 'Tree', [
5
- {
6
- name: 'basic',
7
- title: 'Basic',
8
- component: lazy(() => import('./basic')),
9
- // options: {perfTests: () => import('./basic.perf')},
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('hooks/useElementRect', 'useElementRect', [
5
- {name: 'example', title: 'Example', component: lazy(() => import('./example'))},
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('hooks/use-media-index', 'useMediaIndex', [
5
- {name: 'test', title: 'Test', component: lazy(() => import('./test'))},
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('primitives/avatar', 'Avatar', [
5
- {
6
- name: 'as-button',
7
- title: 'As button',
8
- component: lazy(() => import('./asButton')),
9
- },
10
- {
11
- name: 'avatar-stack',
12
- title: 'Avatar stack',
13
- component: lazy(() => import('./stack')),
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('primitives/badge', 'Badge', [
5
- {
6
- name: 'props',
7
- title: 'Props',
8
- component: lazy(() => import('./props')),
9
- },
10
- {
11
- name: 'tones',
12
- title: 'Tones',
13
- component: lazy(() => import('./tones')),
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('primitives/box', 'Box', [
5
- {name: 'props', title: 'Props', component: lazy(() => import('./props'))},
6
- {name: 'responsive', title: 'Responsive', component: lazy(() => import('./responsive'))},
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('primitives/button', 'Button', [
5
- {
6
- name: 'props',
7
- title: 'Props',
8
- component: lazy(() => import('./props')),
9
- },
10
- {
11
- name: 'styled-1',
12
- title: 'Styled #1',
13
- component: lazy(() => import('./styled1')),
14
- },
15
- {
16
- name: 'styled-2',
17
- title: 'Styled #2',
18
- component: lazy(() => import('./styled2')),
19
- },
20
- {
21
- name: 'stacked',
22
- title: 'Stacked',
23
- component: lazy(() => import('./stacked')),
24
- },
25
- {
26
- name: 'custom',
27
- title: 'Custom',
28
- component: lazy(() => import('./custom')),
29
- },
30
- {
31
- name: 'mixed-children',
32
- title: 'Mixed children',
33
- component: lazy(() => import('./mixedChildren')),
34
- },
35
- {
36
- name: 'upload-button',
37
- title: 'Upload button',
38
- component: lazy(() => import('./uploadButton')),
39
- },
40
- {
41
- name: 'sanity-upload-button-workaround',
42
- title: 'SanityUploadButtonWorkaroundStory',
43
- component: lazy(() => import('./sanityUploadButton')),
44
- },
45
- {
46
- name: 'custom-icons',
47
- title: 'Custom icons',
48
- component: lazy(() => import('./customIcons')),
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('primitives/card', 'Card', [
5
- {name: 'props', title: 'Props', component: lazy(() => import('./props'))},
6
- {name: 'styled', title: 'Styled', component: lazy(() => import('./styled'))},
7
- {name: 'interactive', title: 'Interactive', component: lazy(() => import('./interactive'))},
8
- {name: 'tones', title: 'Tones', component: lazy(() => import('./allTones'))},
9
- {name: 'as-button', title: 'As button', component: lazy(() => import('./asButton'))},
10
- {name: 'list-nav', title: 'List navigation', component: lazy(() => import('./listNavigation'))},
11
- {name: 'checkered', title: 'Checkered', component: lazy(() => import('./checkered'))},
12
- {name: 'as-component', title: 'As component', component: lazy(() => import('./asComponent'))},
13
- {name: 'selected', title: 'Selected', component: lazy(() => import('./selected'))},
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('primitives/checkbox', 'Checkbox', [
5
- {name: 'props', title: 'Props', component: lazy(() => import('./props'))},
6
- {name: 'example', title: 'Example', component: lazy(() => import('./example'))},
7
- {name: 'read-only', title: 'Read-only', component: lazy(() => import('./readOnly'))},
8
- {name: 'multiple-tones', title: 'Multiple tones', component: lazy(() => import('./tones'))},
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('primitives/code', 'Code', [
5
- {
6
- name: 'props',
7
- title: 'Props',
8
- component: lazy(() => import('./props')),
9
- },
10
- {
11
- name: 'optical-alignment',
12
- title: 'Optical alignment',
13
- component: lazy(() => import('./opticalAlignment')),
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('primitives/container', 'Container', [
5
- {name: 'plain', title: 'Plain', component: lazy(() => import('./example'))},
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('primitives/flex', 'Flex', [
5
- {name: 'plain', title: 'Plain', component: lazy(() => import('./example'))},
6
- {name: 'gap', title: 'Gap', component: lazy(() => import('./gap'))},
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('primitives/grid', 'Grid', [
5
- {name: 'responsive', title: 'Responsive', component: lazy(() => import('./responsive'))},
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('primitives/heading', 'Heading', [
5
- {
6
- name: 'plain',
7
- title: 'Plain',
8
- component: lazy(() => import('./plain')),
9
- },
10
- {
11
- name: 'optical-alignment',
12
- title: 'Optical alignment',
13
- component: lazy(() => import('./opticalAlignment')),
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('primitives/inline', 'Inline', [
5
- {name: 'plain', title: 'Plain', component: lazy(() => import('./plain'))},
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('primitives/kbd', 'KBD', [
5
- {name: 'plain', title: 'Plain', component: lazy(() => import('./plain'))},
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('primitives/label', 'Label', [
5
- {
6
- name: 'plain',
7
- title: 'Plain',
8
- component: lazy(() => import('./plain')),
9
- },
10
- {
11
- name: 'optical-alignment',
12
- title: 'Optical alignment',
13
- component: lazy(() => import('./opticalAlignment')),
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
+ })
@@ -52,7 +52,6 @@ export default function PlainStory() {
52
52
  fallbackPlacements={['top', 'bottom']}
53
53
  matchReferenceWidth={matchReferenceWidth}
54
54
  open={open}
55
- overflow="auto"
56
55
  padding={padding}
57
56
  placement={placement}
58
57
  portal={portal}
@@ -63,7 +63,6 @@ export default function TestStory(): ReactElement {
63
63
  fallbackPlacements={['left', 'bottom', 'right', 'top']}
64
64
  matchReferenceWidth={matchReferenceWidth}
65
65
  open={open}
66
- overflow="auto"
67
66
  padding={3}
68
67
  placement={placement}
69
68
  portal
@@ -1,35 +1,39 @@
1
1
  import {defineScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
- export default defineScope('primitives/popover', 'Popover', [
5
- {
6
- name: 'test',
7
- title: 'Test',
8
- component: lazy(() => import('./TestStory')),
9
- },
10
- {
11
- name: 'plain',
12
- title: 'Plain',
13
- component: lazy(() => import('./PlainStory')),
14
- },
15
- {
16
- name: 'recursive',
17
- title: 'Recursive',
18
- component: lazy(() => import('./RecursiveStory')),
19
- },
20
- {
21
- name: 'match-ref-width',
22
- title: 'Match reference width',
23
- component: lazy(() => import('./MatchReferenceWidthStory')),
24
- },
25
- {
26
- name: 'margins',
27
- title: 'Margins',
28
- component: lazy(() => import('./MarginsStory')),
29
- },
30
- {
31
- name: 'aligned',
32
- title: 'Aligned',
33
- component: lazy(() => import('./AlignedStory')),
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]