@sanity/ui 2.10.18 → 2.11.1
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/index.d.mts +29 -19
- package/dist/index.d.ts +29 -19
- package/dist/index.esm.js +32 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +3 -4
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +1 -1
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -1
- package/src/core/components/menu/menuButton.tsx +2 -2
- package/src/core/components/menu/menuGroup.tsx +15 -2
- package/src/core/components/tab/tabList.tsx +2 -2
- package/src/core/components/toast/toast.tsx +1 -1
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/tree.tsx +1 -1
- package/src/core/components/tree/treeGroup.tsx +1 -1
- package/src/core/components/tree/treeItem.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -2
- package/src/core/primitives/popover/popover.tsx +3 -3
- package/src/core/primitives/tooltip/tooltip.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +1 -1
- package/src/core/theme/__workshop__/build/story.tsx +1 -2
- package/src/core/theme/themeColorProvider.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/utils/arrow/arrow.tsx +2 -2
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +1 -3
- package/src/core/utils/layer/layerProvider.tsx +1 -1
- package/src/core/utils/portal/portalProvider.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@sanity/color": "^3.0.6",
|
|
110
110
|
"@sanity/icons": "^3.5.7",
|
|
111
111
|
"csstype": "^3.1.3",
|
|
112
|
-
"framer-motion": "^11.
|
|
112
|
+
"framer-motion": "^11.16.0",
|
|
113
113
|
"react-compiler-runtime": "19.0.0-beta-55955c9-20241229",
|
|
114
114
|
"react-refractor": "^2.2.0",
|
|
115
115
|
"use-effect-event": "^1.0.2"
|
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
"@commitlint/cli": "^19.6.1",
|
|
123
123
|
"@commitlint/config-conventional": "^19.6.0",
|
|
124
124
|
"@juggle/resize-observer": "^3.4.0",
|
|
125
|
-
"@sanity/pkg-utils": "^6.13.
|
|
125
|
+
"@sanity/pkg-utils": "^6.13.1",
|
|
126
126
|
"@sanity/prettier-config": "^1.0.3",
|
|
127
127
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
128
|
-
"@sanity/ui-workshop": "^2.0.
|
|
128
|
+
"@sanity/ui-workshop": "^2.0.21",
|
|
129
129
|
"@storybook/addon-a11y": "^8.4.7",
|
|
130
130
|
"@storybook/addon-docs": "^8.4.7",
|
|
131
131
|
"@storybook/addon-essentials": "^8.4.7",
|
|
@@ -147,14 +147,14 @@
|
|
|
147
147
|
"@types/jest": "^29.5.14",
|
|
148
148
|
"@types/jest-axe": "^3.5.9",
|
|
149
149
|
"@types/node": "^20.12.7",
|
|
150
|
-
"@types/react": "^19.0.
|
|
150
|
+
"@types/react": "^19.0.3",
|
|
151
151
|
"@types/react-dom": "^19.0.2",
|
|
152
152
|
"@types/react-is": "^19.0.0",
|
|
153
153
|
"@types/refractor": "^3.4.1",
|
|
154
154
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
155
155
|
"@typescript-eslint/parser": "^7.18.0",
|
|
156
156
|
"@vitejs/plugin-react": "^4.3.4",
|
|
157
|
-
"babel-plugin-react-compiler": "19.0.0-beta-
|
|
157
|
+
"babel-plugin-react-compiler": "19.0.0-beta-63e3235-20250105",
|
|
158
158
|
"babel-plugin-styled-components": "^2.1.4",
|
|
159
159
|
"commitizen": "^4.3.1",
|
|
160
160
|
"cypress": "^13.17.0",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"eslint-plugin-import": "^2.31.0",
|
|
167
167
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
168
168
|
"eslint-plugin-react": "^7.37.3",
|
|
169
|
-
"eslint-plugin-react-compiler": "19.0.0-beta-
|
|
169
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-63e3235-20250105",
|
|
170
170
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
171
171
|
"eslint-plugin-storybook": "^0.11.2",
|
|
172
172
|
"http-server": "^14.1.1",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"semantic-release": "^24.2.1",
|
|
187
187
|
"start-server-and-test": "^2.0.9",
|
|
188
188
|
"storybook": "^8.4.7",
|
|
189
|
-
"styled-components": "^6.1.
|
|
189
|
+
"styled-components": "^6.1.14",
|
|
190
190
|
"tsconfig-paths": "^4.2.0",
|
|
191
191
|
"typescript": "5.7.2",
|
|
192
192
|
"vite": "^5.4.11",
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"react-is": "^18 || >=19.0.0-0",
|
|
199
199
|
"styled-components": "^5.2 || ^6"
|
|
200
200
|
},
|
|
201
|
-
"packageManager": "pnpm@9.15.
|
|
201
|
+
"packageManager": "pnpm@9.15.3",
|
|
202
202
|
"engines": {
|
|
203
203
|
"node": ">=14.0.0"
|
|
204
204
|
},
|
|
@@ -81,7 +81,7 @@ function ConstrainedHeightExampleField({id, label}: {id: string; label: string})
|
|
|
81
81
|
const renderPopover: AutocompleteProps['renderPopover'] = useCallback(
|
|
82
82
|
(
|
|
83
83
|
popoverProps: {
|
|
84
|
-
content: React.
|
|
84
|
+
content: React.JSX.Element | null
|
|
85
85
|
hidden: boolean
|
|
86
86
|
inputElement: HTMLInputElement | null
|
|
87
87
|
onMouseEnter: () => void
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
HTMLProps,
|
|
7
7
|
KeyboardEvent,
|
|
8
8
|
MouseEvent,
|
|
9
|
-
ReactElement,
|
|
10
9
|
ReactNode,
|
|
11
10
|
Ref,
|
|
12
11
|
cloneElement,
|
|
@@ -73,11 +72,11 @@ export interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseA
|
|
|
73
72
|
/** @beta */
|
|
74
73
|
relatedElements?: HTMLElement[]
|
|
75
74
|
/** The callback function for rendering each option. */
|
|
76
|
-
renderOption?: (option: Option) =>
|
|
75
|
+
renderOption?: (option: Option) => React.JSX.Element
|
|
77
76
|
/** @beta */
|
|
78
77
|
renderPopover?: (
|
|
79
78
|
props: {
|
|
80
|
-
content:
|
|
79
|
+
content: React.JSX.Element | null
|
|
81
80
|
hidden: boolean
|
|
82
81
|
inputElement: HTMLInputElement | null
|
|
83
82
|
onMouseEnter: () => void
|
|
@@ -726,4 +725,4 @@ export const Autocomplete = InnerAutocomplete as <Option extends BaseAutocomplet
|
|
|
726
725
|
> & {
|
|
727
726
|
ref?: Ref<HTMLInputElement>
|
|
728
727
|
},
|
|
729
|
-
) =>
|
|
728
|
+
) => React.JSX.Element
|
|
@@ -9,7 +9,7 @@ export interface AutocompleteOptionProps {
|
|
|
9
9
|
value: string
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export function AutocompleteOption(props: AutocompleteOptionProps): React.
|
|
12
|
+
export function AutocompleteOption(props: AutocompleteOptionProps): React.JSX.Element {
|
|
13
13
|
const {children, id, onSelect, selected, value} = props
|
|
14
14
|
|
|
15
15
|
const handleClick = useCallback(() => {
|
|
@@ -16,7 +16,7 @@ export interface DialogProviderProps {
|
|
|
16
16
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
17
17
|
* @beta
|
|
18
18
|
*/
|
|
19
|
-
export function DialogProvider(props: DialogProviderProps): React.
|
|
19
|
+
export function DialogProvider(props: DialogProviderProps): React.JSX.Element {
|
|
20
20
|
const {children, position, zOffset} = props
|
|
21
21
|
|
|
22
22
|
const contextValue: DialogContextValue = useMemo(
|
|
@@ -4,7 +4,7 @@ import {forwardRef} from 'react'
|
|
|
4
4
|
const CustomLink = forwardRef(function CustomLink(
|
|
5
5
|
props: {req: string} & Omit<React.HTMLProps<HTMLAnchorElement>, 'as' | 'href'>,
|
|
6
6
|
ref: React.ForwardedRef<HTMLAnchorElement>,
|
|
7
|
-
): React.
|
|
7
|
+
): React.JSX.Element {
|
|
8
8
|
const {children, req, ...restProps} = props
|
|
9
9
|
|
|
10
10
|
return (
|
|
@@ -25,9 +25,9 @@ export interface MenuButtonProps {
|
|
|
25
25
|
* @deprecated Use `popover={{boundaryElement: element}}` instead.
|
|
26
26
|
*/
|
|
27
27
|
boundaryElement?: HTMLElement
|
|
28
|
-
button: React.
|
|
28
|
+
button: React.JSX.Element
|
|
29
29
|
id: string
|
|
30
|
-
menu?: React.
|
|
30
|
+
menu?: React.JSX.Element
|
|
31
31
|
onClose?: () => void
|
|
32
32
|
onOpen?: () => void
|
|
33
33
|
/**
|
|
@@ -6,7 +6,7 @@ import {Box, Flex, Popover, PopoverProps, Text} from '../../primitives'
|
|
|
6
6
|
import {Selectable} from '../../primitives/_selectable'
|
|
7
7
|
import {useRootTheme} from '../../theme'
|
|
8
8
|
import {Radius, SelectableTone} from '../../types'
|
|
9
|
-
import {Menu} from './menu'
|
|
9
|
+
import {Menu, MenuProps} from './menu'
|
|
10
10
|
import {useMenu} from './useMenu'
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -16,6 +16,17 @@ export interface MenuGroupProps {
|
|
|
16
16
|
as?: React.ElementType | keyof React.JSX.IntrinsicElements
|
|
17
17
|
fontSize?: number | number[]
|
|
18
18
|
icon?: React.ElementType | React.ReactNode
|
|
19
|
+
menu?: Omit<
|
|
20
|
+
MenuProps,
|
|
21
|
+
| 'onClickOutside'
|
|
22
|
+
| 'onEscape'
|
|
23
|
+
| 'onItemClick'
|
|
24
|
+
| 'onKeyDown'
|
|
25
|
+
| 'onMouseEnter'
|
|
26
|
+
| 'registerElement'
|
|
27
|
+
| 'shouldFocus'
|
|
28
|
+
| 'onBlurCapture'
|
|
29
|
+
>
|
|
19
30
|
padding?: number | number[]
|
|
20
31
|
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
21
32
|
radius?: Radius | Radius[]
|
|
@@ -30,12 +41,13 @@ export interface MenuGroupProps {
|
|
|
30
41
|
export function MenuGroup(
|
|
31
42
|
props: Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'popover' | 'ref' | 'tabIndex'> &
|
|
32
43
|
MenuGroupProps,
|
|
33
|
-
): React.
|
|
44
|
+
): React.JSX.Element {
|
|
34
45
|
const {
|
|
35
46
|
as = 'button',
|
|
36
47
|
children,
|
|
37
48
|
fontSize = 1,
|
|
38
49
|
icon: IconComponent,
|
|
50
|
+
menu: menuProps,
|
|
39
51
|
onClick,
|
|
40
52
|
padding = 3,
|
|
41
53
|
popover,
|
|
@@ -129,6 +141,7 @@ export function MenuGroup(
|
|
|
129
141
|
|
|
130
142
|
const childMenu = (
|
|
131
143
|
<Menu
|
|
144
|
+
{...menuProps}
|
|
132
145
|
onClickOutside={onClickOutside}
|
|
133
146
|
onEscape={onEscape}
|
|
134
147
|
onItemClick={handleChildItemClick}
|
|
@@ -6,7 +6,7 @@ import {Inline, InlineProps} from '../../primitives'
|
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export interface TabListProps extends Omit<InlineProps, 'as' | 'height'> {
|
|
9
|
-
children: Array<React.
|
|
9
|
+
children: Array<React.JSX.Element | null | undefined | false>
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
//Limits the width of tabs in tablist
|
|
@@ -29,7 +29,7 @@ export const TabList = forwardRef(function TabList(
|
|
|
29
29
|
const {children: childrenProp, ...restProps} = props
|
|
30
30
|
const [focusedIndex, setFocusedIndex] = useState(-1)
|
|
31
31
|
|
|
32
|
-
const children: React.
|
|
32
|
+
const children: React.JSX.Element[] = Children.toArray(childrenProp).filter(isValidElement)
|
|
33
33
|
|
|
34
34
|
const tabs = children.map((child, childIndex) =>
|
|
35
35
|
cloneElement(child, {
|
|
@@ -53,7 +53,7 @@ const StyledToast = styled(Card)<{$duration?: number; tone: ThemeColorStateToneK
|
|
|
53
53
|
*/
|
|
54
54
|
export function Toast(
|
|
55
55
|
props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title'>,
|
|
56
|
-
): React.
|
|
56
|
+
): React.JSX.Element {
|
|
57
57
|
const {closable, description, duration, onClose, radius = 3, title, status, ...restProps} = props
|
|
58
58
|
const cardTone = status ? STATUS_CARD_TONE[status] : 'default'
|
|
59
59
|
const buttonTone = status ? BUTTON_TONE[status] : 'default'
|
|
@@ -49,7 +49,7 @@ const ToastContainer = styled.div`
|
|
|
49
49
|
/**
|
|
50
50
|
* @public
|
|
51
51
|
*/
|
|
52
|
-
export function ToastProvider(props: ToastProviderProps): React.
|
|
52
|
+
export function ToastProvider(props: ToastProviderProps): React.JSX.Element {
|
|
53
53
|
const {children, padding = 4, paddingX, paddingY, zOffset} = props
|
|
54
54
|
const [state, _setState] = useState<ToastState>([])
|
|
55
55
|
const toastsRef = useRef<{[key: string]: {timeoutId: NodeJS.Timeout}}>({})
|
|
@@ -30,7 +30,7 @@ export const Tree = memo(
|
|
|
30
30
|
props: TreeProps &
|
|
31
31
|
Omit<React.HTMLProps<HTMLDivElement>, 'align' | 'as' | 'height' | 'ref' | 'role' | 'wrap'>,
|
|
32
32
|
forwardedRef: React.ForwardedRef<HTMLDivElement>,
|
|
33
|
-
): React.
|
|
33
|
+
): React.JSX.Element {
|
|
34
34
|
const {children, space = 1, onFocus, ...restProps} = props
|
|
35
35
|
const ref = useRef<HTMLDivElement | null>(null)
|
|
36
36
|
const [focusedElement, setFocusedElement] = useState<HTMLElement | null>(null)
|
|
@@ -9,7 +9,7 @@ export interface TreeGroupProps {
|
|
|
9
9
|
export const TreeGroup = memo(function TreeGroup(
|
|
10
10
|
props: TreeGroupProps &
|
|
11
11
|
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'role' | 'wrap'>,
|
|
12
|
-
): React.
|
|
12
|
+
): React.JSX.Element {
|
|
13
13
|
const {children, expanded = false, ...restProps} = props
|
|
14
14
|
const tree = useTree()
|
|
15
15
|
|
|
@@ -46,7 +46,7 @@ const ToggleArrowText = styled(Text)`
|
|
|
46
46
|
*/
|
|
47
47
|
export const TreeItem = memo(function TreeItem(
|
|
48
48
|
props: TreeItemProps & Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'ref' | 'role'>,
|
|
49
|
-
): React.
|
|
49
|
+
): React.JSX.Element {
|
|
50
50
|
const {
|
|
51
51
|
children,
|
|
52
52
|
expanded: expandedProp = false,
|
|
@@ -68,7 +68,7 @@ export const AvatarStack = forwardRef(function AvatarStack(
|
|
|
68
68
|
size: sizeProp = 1,
|
|
69
69
|
...restProps
|
|
70
70
|
} = props
|
|
71
|
-
const children: React.
|
|
71
|
+
const children: React.JSX.Element[] = Children.toArray(childrenProp).filter(isValidElement)
|
|
72
72
|
const maxLength = Math.max(maxLengthProp, 0)
|
|
73
73
|
const size = useArrayProp(sizeProp)
|
|
74
74
|
|
|
@@ -4,7 +4,7 @@ import {forwardRef} from 'react'
|
|
|
4
4
|
const CustomLink = forwardRef(function CustomLink(
|
|
5
5
|
props: {req: string} & Omit<React.HTMLProps<HTMLAnchorElement>, 'as' | 'href'>,
|
|
6
6
|
ref: React.ForwardedRef<HTMLAnchorElement>,
|
|
7
|
-
): React.
|
|
7
|
+
): React.JSX.Element {
|
|
8
8
|
const {children, req, ...restProps} = props
|
|
9
9
|
|
|
10
10
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
2
|
-
import {
|
|
2
|
+
import {useRef, useState} from 'react'
|
|
3
3
|
import {
|
|
4
4
|
WORKSHOP_CONTAINER_WIDTH_OPTIONS,
|
|
5
5
|
WORKSHOP_PLACEMENT_OPTIONS,
|
|
@@ -12,7 +12,7 @@ import {Text} from '../../text'
|
|
|
12
12
|
import {Popover} from '../popover'
|
|
13
13
|
import {PopoverUpdateCallback} from '../types'
|
|
14
14
|
|
|
15
|
-
export default function TestStory():
|
|
15
|
+
export default function TestStory(): React.JSX.Element {
|
|
16
16
|
const [portalElement, setPortalElement] = useState<HTMLDivElement | null>(null)
|
|
17
17
|
const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)
|
|
18
18
|
|
|
@@ -59,7 +59,7 @@ export interface PopoverProps
|
|
|
59
59
|
arrow?: boolean
|
|
60
60
|
/** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
|
|
61
61
|
boundaryElement?: HTMLElement | null
|
|
62
|
-
children?: React.
|
|
62
|
+
children?: React.JSX.Element
|
|
63
63
|
/**
|
|
64
64
|
* When `true`, prevent overflow within the current boundary:
|
|
65
65
|
* - by flipping on its side axis
|
|
@@ -117,7 +117,7 @@ export const Popover = memo(
|
|
|
117
117
|
props: PopoverProps &
|
|
118
118
|
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'width'>,
|
|
119
119
|
forwardedRef: React.ForwardedRef<HTMLDivElement>,
|
|
120
|
-
): React.
|
|
120
|
+
): React.JSX.Element {
|
|
121
121
|
const {container, layer} = useTheme_v2()
|
|
122
122
|
const boundaryElementContext = useBoundaryElement()
|
|
123
123
|
|
|
@@ -449,7 +449,7 @@ Popover.displayName = 'Memo(ForwardRef(Popover))'
|
|
|
449
449
|
// https://github.com/facebook/react/pull/28348
|
|
450
450
|
//
|
|
451
451
|
// Access the ref using the method that doesn't yield a warning.
|
|
452
|
-
function getElementRef(element: React.
|
|
452
|
+
function getElementRef(element: React.JSX.Element) {
|
|
453
453
|
// React <=18 in DEV
|
|
454
454
|
let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get
|
|
455
455
|
let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning
|
|
@@ -47,7 +47,7 @@ export interface TooltipProps extends Omit<LayerProps, 'as'> {
|
|
|
47
47
|
allowedAutoPlacements?: Placement[]
|
|
48
48
|
arrow?: boolean
|
|
49
49
|
boundaryElement?: HTMLElement | null
|
|
50
|
-
children?: React.
|
|
50
|
+
children?: React.JSX.Element
|
|
51
51
|
content?: React.ReactNode
|
|
52
52
|
disabled?: boolean
|
|
53
53
|
fallbackPlacements?: Placement[]
|
|
@@ -28,7 +28,7 @@ export interface TooltipDelayGroupProviderProps {
|
|
|
28
28
|
*/
|
|
29
29
|
export function TooltipDelayGroupProvider(
|
|
30
30
|
props: TooltipDelayGroupProviderProps,
|
|
31
|
-
): React.
|
|
31
|
+
): React.JSX.Element {
|
|
32
32
|
const {children, delay} = props
|
|
33
33
|
const [isGroupActive, setIsGroupActive] = useDelayedState(false)
|
|
34
34
|
const [openTooltipId, setOpenTooltipId] = useDelayedState<string | null>(null)
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
ThemeColorInputModeKey,
|
|
14
14
|
} from '@sanity/ui/theme'
|
|
15
15
|
import {buildTheme} from '@sanity/ui/theme'
|
|
16
|
-
import {ReactElement} from 'react'
|
|
17
16
|
import {rem} from '../../../styles'
|
|
18
17
|
import {useTheme_v2} from '../../useTheme'
|
|
19
18
|
import {getCSSProps} from './helpers'
|
|
@@ -21,7 +20,7 @@ import {Root} from './Root'
|
|
|
21
20
|
|
|
22
21
|
const theme = buildTheme()
|
|
23
22
|
|
|
24
|
-
export default function BuildStory():
|
|
23
|
+
export default function BuildStory(): React.JSX.Element {
|
|
25
24
|
return (
|
|
26
25
|
<Root>
|
|
27
26
|
<div
|
|
@@ -14,7 +14,7 @@ export interface ThemeColorProviderProps {
|
|
|
14
14
|
/**
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export function ThemeColorProvider(props: ThemeColorProviderProps): React.
|
|
17
|
+
export function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element {
|
|
18
18
|
const {children, scheme, tone} = props
|
|
19
19
|
const root = useRootTheme()
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ export interface ThemeProviderProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
export function ThemeProvider(props: ThemeProviderProps): React.
|
|
26
|
+
export function ThemeProvider(props: ThemeProviderProps): React.JSX.Element {
|
|
27
27
|
const parentTheme = useContext(ThemeContext)
|
|
28
28
|
const {children} = props
|
|
29
29
|
const scheme = props.scheme ?? (parentTheme?.scheme || 'light')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ForwardedRef, HTMLProps,
|
|
1
|
+
import {ForwardedRef, HTMLProps, forwardRef} from 'react'
|
|
2
2
|
import {styled, css} from 'styled-components'
|
|
3
3
|
import {useTheme_v2} from '../../theme'
|
|
4
4
|
import {Point, compileCommands, getRoundedCommands} from './cmds'
|
|
@@ -68,7 +68,7 @@ export const Arrow = forwardRef(function Arrow(
|
|
|
68
68
|
'width' | 'height'
|
|
69
69
|
>,
|
|
70
70
|
ref: ForwardedRef<HTMLDivElement>,
|
|
71
|
-
):
|
|
71
|
+
): React.JSX.Element {
|
|
72
72
|
const {width: w, height: h, radius = 0, ...restProps} = props
|
|
73
73
|
const {card} = useTheme_v2()
|
|
74
74
|
const strokeWidth = card.shadow.outline
|
|
@@ -13,9 +13,7 @@ export interface BoundaryElementProviderProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export function BoundaryElementProvider(
|
|
17
|
-
props: BoundaryElementProviderProps,
|
|
18
|
-
): React.ReactElement<any> {
|
|
16
|
+
export function BoundaryElementProvider(props: BoundaryElementProviderProps): React.JSX.Element {
|
|
19
17
|
const {children, element} = props
|
|
20
18
|
const value: BoundaryElementContextValue = useMemo(() => ({version: 0.0, element}), [element])
|
|
21
19
|
|
|
@@ -15,7 +15,7 @@ export interface LayerProviderProps {
|
|
|
15
15
|
/**
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
export function LayerProvider(props: LayerProviderProps): React.
|
|
18
|
+
export function LayerProvider(props: LayerProviderProps): React.JSX.Element {
|
|
19
19
|
const {children, zOffset: zOffsetProp = 0} = props
|
|
20
20
|
|
|
21
21
|
// Get parent context values
|
|
@@ -21,7 +21,7 @@ export interface PortalProviderProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
export function PortalProvider(props: PortalProviderProps): React.
|
|
24
|
+
export function PortalProvider(props: PortalProviderProps): React.JSX.Element {
|
|
25
25
|
const {boundaryElement, children, element, __unstable_elements: elementsProp} = props
|
|
26
26
|
const elements = useUnique(elementsProp)
|
|
27
27
|
const fallbackElement = useSyncExternalStore(
|
|
@@ -47,7 +47,7 @@ export const VirtualList = forwardRef(function VirtualList(
|
|
|
47
47
|
StackProps &
|
|
48
48
|
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'onChange' | 'ref'>,
|
|
49
49
|
forwardedRef: React.ForwardedRef<HTMLDivElement>,
|
|
50
|
-
): React.
|
|
50
|
+
): React.JSX.Element {
|
|
51
51
|
const {as = 'div', gap = 0, getItemKey, items = [], onChange, renderItem, ...restProps} = props
|
|
52
52
|
const {space} = useTheme_v2()
|
|
53
53
|
const ref = useRef<HTMLDivElement | null>(null)
|