@sanity/ui 5.0.0-alpha.6 → 5.0.0-alpha.8
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/README.md +1 -1
- package/dist/cli/install.js +2 -1
- package/dist/index.d.ts +285 -116
- package/dist/index.js +177 -174
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/cli/install.ts +2 -1
- package/src/components/box/box.props.ts +7 -2
- package/src/components/button/button.props.ts +27 -9
- package/src/components/card/card.props.ts +6 -2
- package/src/components/checkbox/Checkbox.tsx +2 -1
- package/src/components/checkbox/checkbox.props.ts +11 -3
- package/src/components/code/code.props.ts +10 -3
- package/src/components/container/container.props.ts +6 -2
- package/src/components/{modal/Modal.tsx → dialog/Dialog.tsx} +28 -28
- package/src/components/{modal/modal.css → dialog/dialog.css} +11 -11
- package/src/components/dialog/dialog.props.ts +38 -0
- package/src/components/eyebrow/eyebrow.props.ts +6 -2
- package/src/components/flex/flex.props.ts +6 -2
- package/src/components/grid/grid.props.ts +6 -2
- package/src/components/h-stack/hStack.props.ts +3 -1
- package/src/components/heading/heading.props.ts +8 -2
- package/src/components/icon/icon.props.ts +6 -2
- package/src/components/icon-button/iconButton.props.ts +7 -2
- package/src/components/index.css +1 -1
- package/src/components/indicator/indicator.props.ts +6 -2
- package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
- package/src/components/inline/inline.props.ts +6 -2
- package/src/components/label/label.props.ts +7 -1
- package/src/components/link/link.props.ts +4 -4
- package/src/components/list/list.props.ts +27 -9
- package/src/components/popover/popover.props.ts +14 -4
- package/src/components/press-area/pressArea.props.ts +3 -1
- package/src/components/radio/radio.props.ts +7 -2
- package/src/components/skip-to-content/skipToContent.props.ts +9 -3
- package/src/components/spinner/Spinner.tsx +1 -1
- package/src/components/spinner/spinner.props.ts +3 -0
- package/src/components/switch/switch.props.ts +7 -2
- package/src/components/text/text.props.ts +6 -2
- package/src/components/tooltip/tooltip.props.ts +12 -4
- package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
- package/src/components/v-stack/vStack.props.ts +3 -1
- package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
- package/src/index.ts +1 -1
- package/src/version.ts +2 -2
- package/src/components/modal/modal.props.ts +0 -29
|
@@ -11,7 +11,9 @@ import type {Responsive} from '../../types/Responsive'
|
|
|
11
11
|
|
|
12
12
|
/** @beta */
|
|
13
13
|
export interface ListProps<T extends ListTag = 'ul'> extends Pick<GapProps, 'gap'> {
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* HTML element to render.
|
|
16
|
+
*/
|
|
15
17
|
as?: T
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -24,11 +26,17 @@ export const listProps: Record<string, PropDef> = {
|
|
|
24
26
|
|
|
25
27
|
/** @beta */
|
|
26
28
|
export interface ListItemProps extends React.ComponentProps<'li'> {
|
|
27
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Sets horizontal padding, gap, and minimum row height together.
|
|
31
|
+
*/
|
|
28
32
|
density?: Responsive<Density>
|
|
29
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Slot at the left edge of the row.
|
|
35
|
+
*/
|
|
30
36
|
start?: React.ReactNode
|
|
31
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Slot at the right edge of the row.
|
|
39
|
+
*/
|
|
32
40
|
end?: React.ReactNode
|
|
33
41
|
}
|
|
34
42
|
|
|
@@ -73,9 +81,13 @@ export const listItemProps: Record<string, PropDef> = {
|
|
|
73
81
|
|
|
74
82
|
/** @beta */
|
|
75
83
|
export interface ListButtonItemProps<T extends React.ElementType = 'button'> extends ListItemProps {
|
|
76
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Element or component to render for the press target.
|
|
86
|
+
*/
|
|
77
87
|
as?: InteractiveAs<T>
|
|
78
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Marks the row as the current selection.
|
|
90
|
+
*/
|
|
79
91
|
selected?: boolean
|
|
80
92
|
}
|
|
81
93
|
|
|
@@ -91,11 +103,17 @@ export const listButtonItemProps: Record<string, PropDef> = {
|
|
|
91
103
|
|
|
92
104
|
/** @beta */
|
|
93
105
|
export interface ListItemTextProps<T extends React.ElementType = 'div'> {
|
|
94
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* HTML element to render.
|
|
108
|
+
*/
|
|
95
109
|
as?: T
|
|
96
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* Main label.
|
|
112
|
+
*/
|
|
97
113
|
title?: React.ReactNode
|
|
98
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Text below the title.
|
|
116
|
+
*/
|
|
99
117
|
subtitle?: React.ReactNode
|
|
100
118
|
}
|
|
101
119
|
|
|
@@ -4,13 +4,23 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
4
4
|
/** @beta */
|
|
5
5
|
export interface PopoverProps
|
|
6
6
|
extends Omit<React.ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Shared anchor identifier.
|
|
9
|
+
* @remarks Set the same value on a Tooltip and a Popover to point both at one trigger.
|
|
10
|
+
*/
|
|
8
11
|
anchorName?: React.ReactNode
|
|
9
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The trigger element.
|
|
14
|
+
* @remarks Popover clones it and attaches the `popovertarget` attribute that opens the floating layer.
|
|
15
|
+
*/
|
|
10
16
|
children: React.ReactElement<Record<string, unknown>>
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The floating content.
|
|
19
|
+
*/
|
|
12
20
|
content?: React.ReactNode
|
|
13
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Renders the content into `document.body` through a React portal instead of inline.
|
|
23
|
+
*/
|
|
14
24
|
portal?: boolean
|
|
15
25
|
}
|
|
16
26
|
|
|
@@ -3,9 +3,14 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
3
3
|
|
|
4
4
|
/** @beta */
|
|
5
5
|
export interface RadioProps extends React.ComponentProps<'input'>, MarginProps {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Applies error styling to the radio mark.
|
|
8
|
+
* @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
|
|
9
|
+
*/
|
|
7
10
|
error?: boolean
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Visible label next to the radio.
|
|
13
|
+
*/
|
|
9
14
|
label: React.ReactNode
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -3,12 +3,18 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
3
3
|
/** @beta */
|
|
4
4
|
export interface SkipToContentProps extends React.ComponentProps<'a'> {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Same-page fragment to jump to.
|
|
7
|
+
* @remarks Note: The hash character # is required for proper linking.
|
|
7
8
|
*/
|
|
8
9
|
href: string
|
|
9
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Visible and announced text.
|
|
12
|
+
*/
|
|
10
13
|
label: string
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Not accepted.
|
|
16
|
+
* @remarks Pass text via `label`.
|
|
17
|
+
*/
|
|
12
18
|
children?: never
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -3,9 +3,14 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
3
3
|
|
|
4
4
|
/** @beta */
|
|
5
5
|
export interface SwitchProps extends React.ComponentProps<'input'>, MarginProps {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Applies error styling to the switch track.
|
|
8
|
+
* @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
|
|
9
|
+
*/
|
|
7
10
|
error?: boolean
|
|
8
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Visible label next to the switch.
|
|
13
|
+
*/
|
|
9
14
|
label: React.ReactNode
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -5,9 +5,13 @@ import {TEXT_SIZE, type TextSize} from '../../types/Text'
|
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
7
7
|
export interface TextProps<T extends React.ElementType = 'span'> extends TypographyProps {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* HTML element to render.
|
|
10
|
+
*/
|
|
9
11
|
as?: T
|
|
10
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Sets font size.
|
|
14
|
+
*/
|
|
11
15
|
size?: Responsive<TextSize>
|
|
12
16
|
}
|
|
13
17
|
|
|
@@ -4,13 +4,21 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
4
4
|
/** @beta */
|
|
5
5
|
export interface TooltipProps
|
|
6
6
|
extends Omit<React.ComponentProps<'div'>, 'children' | 'content'>, PlacementProps {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Shared anchor identifier.
|
|
9
|
+
*/
|
|
8
10
|
anchorName?: React.ReactNode
|
|
9
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The trigger element.
|
|
13
|
+
*/
|
|
10
14
|
children: React.ReactElement<Record<string, unknown>>
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The tooltip label.
|
|
17
|
+
*/
|
|
12
18
|
content?: React.ReactNode
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Renders the label into `document.body` through a React portal instead of inline.
|
|
21
|
+
*/
|
|
14
22
|
portal?: boolean
|
|
15
23
|
}
|
|
16
24
|
|
|
@@ -2,9 +2,13 @@ import {type PropDef} from '../../types/PropDef'
|
|
|
2
2
|
|
|
3
3
|
/** @public */
|
|
4
4
|
export interface VisuallyHiddenProps<T extends React.ElementType = 'span'> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* HTML element to render.
|
|
7
|
+
*/
|
|
6
8
|
as?: T
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* If true, the element becomes visible on `:focus-visible`.
|
|
11
|
+
*/
|
|
8
12
|
visibleOnFocus?: boolean
|
|
9
13
|
}
|
|
10
14
|
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './components/card/Card'
|
|
|
4
4
|
export * from './components/checkbox/Checkbox'
|
|
5
5
|
export * from './components/code/Code'
|
|
6
6
|
export * from './components/container/Container'
|
|
7
|
+
export * from './components/dialog/Dialog'
|
|
7
8
|
export * from './components/divider/Divider'
|
|
8
9
|
export * from './components/eyebrow/Eyebrow'
|
|
9
10
|
export * from './components/flex/Flex'
|
|
@@ -18,7 +19,6 @@ export * from './components/inline/Inline'
|
|
|
18
19
|
export * from './components/label/Label'
|
|
19
20
|
export * from './components/link/Link'
|
|
20
21
|
export * from './components/list/List'
|
|
21
|
-
export * from './components/modal/Modal'
|
|
22
22
|
export * from './components/popover/Popover'
|
|
23
23
|
export * from './components/press-area/PressArea'
|
|
24
24
|
export * from './components/radio/Radio'
|
package/src/version.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// This file is generated by scripts/write-version.js. Do not edit.
|
|
2
|
-
export const VERSION = '
|
|
3
|
-
export const HASH = '
|
|
2
|
+
export const VERSION = '500alpha8'
|
|
3
|
+
export const HASH = 'ff7a34'
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {CONTAINER_SIZE, type ContainerSize} from '../../types/Container'
|
|
2
|
-
import {type PropDef} from '../../types/PropDef'
|
|
3
|
-
import type {Responsive} from '../../types/Responsive'
|
|
4
|
-
|
|
5
|
-
/** @beta */
|
|
6
|
-
export interface ModalProps extends Omit<React.ComponentProps<'dialog'>, 'open'> {
|
|
7
|
-
/** Text to be displayed as the modal's heading; optional but recommended for optimal accessibility and presentation */
|
|
8
|
-
header?: string
|
|
9
|
-
/** Used to set the value of open to false. Fires whenever the modal is closed, either programmatically or by the user (via Esc key, clicking background, clicking the modal's close button, or any other means.) */
|
|
10
|
-
onClose: React.ReactEventHandler<HTMLDialogElement>
|
|
11
|
-
/** Whether the modal is open; defaults to false. */
|
|
12
|
-
open?: boolean
|
|
13
|
-
/** Max width of the modal */
|
|
14
|
-
size?: Responsive<ContainerSize>
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const modalProps: Record<string, PropDef> = {
|
|
18
|
-
header: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
open: {
|
|
22
|
-
type: 'boolean',
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
type: 'union',
|
|
26
|
-
className: 'container',
|
|
27
|
-
values: CONTAINER_SIZE,
|
|
28
|
-
},
|
|
29
|
-
}
|