@sanity/ui 2.15.7 → 2.15.9
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.js +134 -134
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +134 -134
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +1 -1
- package/dist/_visual-editing.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +77 -80
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -81
- package/dist/index.mjs.map +1 -1
- package/dist/theme.js +431 -40
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +393 -4
- package/dist/theme.mjs.map +1 -1
- package/exports/_visual-editing.ts +15 -15
- package/package.json +34 -30
- package/src/core/_compat.ts +11 -11
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -0
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/example.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -0
- package/src/core/components/autocomplete/autocomplete.styles.tsx +2 -1
- package/src/core/components/autocomplete/autocomplete.tsx +3 -2
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +7 -0
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
- package/src/core/components/dialog/__workshop__/activate.tsx +2 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -0
- package/src/core/components/dialog/__workshop__/position.tsx +1 -0
- package/src/core/components/dialog/__workshop__/props.tsx +1 -0
- package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -3
- package/src/core/components/dialog/dialog.tsx +3 -0
- package/src/core/components/dialog/dialogProvider.tsx +1 -0
- package/src/core/components/dialog/styles.ts +1 -0
- package/src/core/components/dialog/useDialog.ts +1 -0
- package/src/core/components/hotkeys/hotkeys.tsx +1 -0
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -0
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -0
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +1 -0
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -0
- package/src/core/components/menu/__workshop__/menuButton.tsx +1 -0
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -0
- package/src/core/components/menu/__workshop__/tones.tsx +1 -0
- package/src/core/components/menu/menu.test.tsx +1 -0
- package/src/core/components/menu/menu.tsx +1 -0
- package/src/core/components/menu/menuButton.tsx +4 -3
- package/src/core/components/menu/menuGroup.tsx +1 -0
- package/src/core/components/menu/menuItem.tsx +1 -1
- package/src/core/components/menu/useMenu.ts +1 -0
- package/src/core/components/menu/useMenuController.ts +1 -0
- package/src/core/components/skeleton/__workshop__/delay.tsx +1 -0
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +1 -0
- package/src/core/components/skeleton/skeleton.tsx +2 -2
- package/src/core/components/skeleton/textSkeleton.tsx +3 -2
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.tsx +2 -1
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/__workshop__/toast.tsx +1 -0
- package/src/core/components/toast/styles.ts +2 -1
- package/src/core/components/toast/toast.tsx +4 -4
- package/src/core/components/toast/toastLayer.tsx +1 -0
- package/src/core/components/toast/toastProvider.tsx +1 -0
- package/src/core/components/toast/useToast.ts +1 -0
- package/src/core/components/tree/__workshop__/basic.tsx +1 -0
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +2 -1
- package/src/core/components/tree/style.ts +1 -0
- package/src/core/components/tree/tree.tsx +1 -0
- package/src/core/components/tree/treeGroup.tsx +1 -0
- package/src/core/components/tree/treeItem.tsx +3 -2
- package/src/core/components/tree/useTree.ts +1 -0
- package/src/core/helpers/focus.ts +2 -2
- package/src/core/hooks/useArrayProp.ts +1 -0
- package/src/core/hooks/useClickOutside.test.tsx +0 -1
- package/src/core/hooks/useClickOutside.ts +1 -0
- package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -1
- package/src/core/hooks/useClickOutsideEvent.ts +1 -0
- package/src/core/hooks/useDelayed.test.ts +2 -1
- package/src/core/hooks/useDelayedState.ts +1 -2
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -0
- package/src/core/hooks/useElementSize.ts +2 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +1 -0
- package/src/core/hooks/usePrefersDark.test.tsx +2 -1
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +2 -1
- package/src/core/index.ts +1 -2
- package/src/core/lib/createGlobalScopedContext.ts +2 -1
- package/src/core/primitives/_selectable/selectable.tsx +1 -0
- package/src/core/primitives/_selectable/style.ts +1 -0
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -0
- package/src/core/primitives/avatar/avatar.tsx +2 -7
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -2
- package/src/core/primitives/avatar/avatarStack.tsx +3 -2
- package/src/core/primitives/avatar/styles.ts +2 -1
- package/src/core/primitives/avatar/types.ts +1 -0
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -0
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -0
- package/src/core/primitives/badge/badge.test.tsx +1 -0
- package/src/core/primitives/badge/badge.tsx +1 -0
- package/src/core/primitives/badge/styles.ts +1 -0
- package/src/core/primitives/box/__workshop__/props.tsx +1 -0
- package/src/core/primitives/box/box.tsx +3 -2
- package/src/core/primitives/button/__workshop__/custom.tsx +3 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +1 -0
- package/src/core/primitives/button/__workshop__/props.tsx +2 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +1 -0
- package/src/core/primitives/button/button.test.tsx +1 -0
- package/src/core/primitives/button/button.tsx +1 -0
- package/src/core/primitives/button/styles.ts +1 -0
- package/src/core/primitives/card/__workshop__/asButton.tsx +1 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -0
- package/src/core/primitives/card/__workshop__/props.tsx +3 -1
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/card/card.tsx +1 -0
- package/src/core/primitives/card/styles.ts +1 -0
- package/src/core/primitives/checkbox/checkbox.tsx +1 -0
- package/src/core/primitives/checkbox/styles.ts +1 -0
- package/src/core/primitives/code/__workshop__/props.tsx +1 -0
- package/src/core/primitives/code/code.tsx +2 -1
- package/src/core/primitives/container/__workshop__/example.tsx +1 -0
- package/src/core/primitives/container/container.tsx +1 -0
- package/src/core/primitives/container/styles.ts +2 -1
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -0
- package/src/core/primitives/flex/flex.tsx +2 -1
- package/src/core/primitives/grid/grid.tsx +1 -0
- package/src/core/primitives/heading/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +1 -0
- package/src/core/primitives/heading/styles.ts +1 -0
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/inline/inline.tsx +2 -1
- package/src/core/primitives/inline/styles.ts +2 -1
- package/src/core/primitives/kbd/kbd.tsx +2 -1
- package/src/core/primitives/label/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/label/label.tsx +1 -0
- package/src/core/primitives/label/styles.ts +1 -0
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +1 -0
- package/src/core/primitives/popover/floating-ui/size.ts +2 -1
- package/src/core/primitives/popover/popover.tsx +6 -7
- package/src/core/primitives/popover/popoverCard.tsx +2 -1
- package/src/core/primitives/radio/radio.tsx +2 -1
- package/src/core/primitives/radio/styles.ts +1 -0
- package/src/core/primitives/select/select.tsx +2 -1
- package/src/core/primitives/select/styles.ts +3 -3
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -0
- package/src/core/primitives/spinner/spinner.tsx +2 -1
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/stack/stack.tsx +2 -1
- package/src/core/primitives/stack/styles.ts +2 -1
- package/src/core/primitives/switch/styles.ts +1 -0
- package/src/core/primitives/switch/switch.tsx +2 -1
- package/src/core/primitives/text/__workshop__/colored.tsx +3 -2
- package/src/core/primitives/text/__workshop__/example.tsx +1 -0
- package/src/core/primitives/text/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +1 -0
- package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/textArea/textArea.tsx +6 -5
- package/src/core/primitives/textInput/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -0
- package/src/core/primitives/textInput/textInput.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/props.tsx +3 -2
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +4 -2
- package/src/core/primitives/tooltip/tooltip.tsx +6 -5
- package/src/core/primitives/tooltip/tooltipCard.tsx +2 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +1 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -0
- package/src/core/styles/border/borderStyle.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +1 -0
- package/src/core/styles/card/_cardColorStyle.ts +1 -2
- package/src/core/styles/flex/flexItemStyle.ts +1 -0
- package/src/core/styles/flex/flexStyle.ts +2 -1
- package/src/core/styles/flex/index.ts +1 -1
- package/src/core/styles/flex/types.ts +1 -0
- package/src/core/styles/font/codeFontStyle.ts +1 -0
- package/src/core/styles/font/headingFontStyle.ts +1 -0
- package/src/core/styles/font/labelFontStyle.ts +1 -0
- package/src/core/styles/font/responsiveFont.ts +3 -3
- package/src/core/styles/font/textAlignStyle.ts +1 -0
- package/src/core/styles/font/textFontStyle.ts +1 -0
- package/src/core/styles/font/types.ts +1 -0
- package/src/core/styles/grid/gridItemStyle.ts +1 -0
- package/src/core/styles/grid/gridStyle.ts +2 -1
- package/src/core/styles/grid/index.ts +1 -1
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -1
- package/src/core/styles/input/textInputStyle.ts +3 -3
- package/src/core/styles/margin/marginStyle.ts +1 -0
- package/src/core/styles/margin/marginsStyle.test.ts +1 -0
- package/src/core/styles/padding/paddingStyle.test.ts +1 -0
- package/src/core/styles/padding/paddingStyle.ts +1 -0
- package/src/core/styles/radius/radiusStyle.ts +1 -0
- package/src/core/styles/shadow/shadowStyle.ts +3 -3
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/__workshop__/build/story.tsx +18 -9
- package/src/core/theme/__workshop__/canvas.tsx +7 -6
- package/src/core/theme/__workshop__/debug/story.tsx +5 -3
- package/src/core/theme/index.ts +1 -1
- package/src/core/theme/theme.test.tsx +1 -0
- package/src/core/theme/themeColorProvider.tsx +1 -0
- package/src/core/theme/themeProvider.tsx +3 -2
- package/src/core/theme/useRootTheme.ts +1 -0
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +4 -3
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +1 -0
- package/src/core/utils/boundaryElement/index.ts +1 -1
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -0
- package/src/core/utils/elementQuery/elementQuery.tsx +1 -0
- package/src/core/utils/errorBoundary.tsx +1 -0
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +1 -0
- package/src/core/utils/layer/__workshop__/nested.tsx +1 -0
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +1 -0
- package/src/core/utils/layer/index.ts +1 -1
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/layerProvider.tsx +2 -1
- package/src/core/utils/layer/useLayer.ts +1 -0
- package/src/core/utils/portal/portal.ts +1 -0
- package/src/core/utils/portal/portalProvider.tsx +1 -0
- package/src/core/utils/portal/usePortal.ts +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +1 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +1 -1
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +1 -1
- package/src/theme/build/_deprecated/color/factory.ts +6 -6
- package/src/theme/build/buildColorTheme.ts +15 -15
- package/src/theme/build/colorToken/colorToken.ts +1 -1
- package/src/theme/build/mixThemeColor.ts +1 -1
- package/src/theme/build/renderColorTheme.ts +7 -6
- package/src/theme/build/renderColorValue.ts +3 -2
- package/src/theme/build/resolveColorTokens.ts +5 -4
- package/src/theme/config/helpers.ts +2 -2
- package/src/theme/config/system.ts +2 -1
- package/src/theme/config/tokens/color/types.ts +2 -1
- package/src/theme/config/tokens/types.ts +2 -1
- package/src/theme/config/types.ts +2 -1
- package/src/theme/system/color/_helpers.ts +1 -0
- package/src/theme/system/color/_system.ts +1 -1
- package/src/theme/system/color/color.ts +1 -1
- package/src/theme/system/index.ts +1 -2
- package/src/theme/system/theme.ts +2 -2
- package/src/theme/system/v0/color/index.ts +1 -1
- package/src/theme/system/v0/index.ts +1 -1
- package/src/theme/versioning/themeColor_v0_v2.ts +5 -5
- package/dist/_chunks-cjs/getTheme_v2.js +0 -397
- package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -398
- package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
- package/src/core/__workshop__/fontsPlugin.tsx +0 -76
- /package/src/core/components/autocomplete/{__fixtures__ → __mocks__}/countries.ts +0 -0
- /package/src/core/primitives/kbd/{index.tsx → index.ts} +0 -0
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
* These are internal exports for usage in `@sanity/visual-editing` and `@sanity/insert-menu`,
|
|
3
3
|
* which are used in environments where the regular `@sanity/ui` export is far too heavy due to imports from refractor and more.
|
|
4
4
|
*/
|
|
5
|
-
export {
|
|
6
|
-
export {Button} from '../src/core/primitives/button/button'
|
|
7
|
-
export {Card} from '../src/core/primitives/card/card'
|
|
8
|
-
export {Flex} from '../src/core/primitives/flex/flex'
|
|
9
|
-
export {Grid} from '../src/core/primitives/grid/grid'
|
|
5
|
+
export {studioTheme} from '../src/core/_compat'
|
|
10
6
|
export {Hotkeys} from '../src/core/components/hotkeys/hotkeys'
|
|
11
|
-
export {isHTMLAnchorElement, isHTMLElement} from '../src/core/helpers/element'
|
|
12
|
-
export {LayerProvider} from '../src/core/utils/layer/layerProvider'
|
|
13
7
|
export {Menu} from '../src/core/components/menu/menu'
|
|
14
8
|
export {MenuDivider} from '../src/core/components/menu/menuDivider'
|
|
15
9
|
export {MenuGroup} from '../src/core/components/menu/menuGroup'
|
|
16
10
|
export {MenuItem, type MenuItemProps} from '../src/core/components/menu/menuItem'
|
|
11
|
+
export {Tab} from '../src/core/components/tab/tab'
|
|
12
|
+
export {TabList} from '../src/core/components/tab/tabList'
|
|
13
|
+
export {isHTMLAnchorElement, isHTMLElement} from '../src/core/helpers/element'
|
|
14
|
+
export {usePrefersDark} from '../src/core/hooks/usePrefersDark'
|
|
15
|
+
export {Box} from '../src/core/primitives/box/box'
|
|
16
|
+
export {Button} from '../src/core/primitives/button/button'
|
|
17
|
+
export {Card} from '../src/core/primitives/card/card'
|
|
18
|
+
export {Flex} from '../src/core/primitives/flex/flex'
|
|
19
|
+
export {Grid} from '../src/core/primitives/grid/grid'
|
|
17
20
|
export {Popover} from '../src/core/primitives/popover/popover'
|
|
18
|
-
export {Portal} from '../src/core/utils/portal/portal'
|
|
19
|
-
export {PortalProvider} from '../src/core/utils/portal/portalProvider'
|
|
20
21
|
export {Spinner} from '../src/core/primitives/spinner/spinner'
|
|
21
22
|
export {Stack} from '../src/core/primitives/stack/stack'
|
|
22
|
-
export {studioTheme} from '../src/core/_compat'
|
|
23
|
-
export {Tab} from '../src/core/components/tab/tab'
|
|
24
|
-
export {TabList} from '../src/core/components/tab/tabList'
|
|
25
23
|
export {Text} from '../src/core/primitives/text/text'
|
|
26
24
|
export {TextInput} from '../src/core/primitives/textInput/textInput'
|
|
27
|
-
export {ThemeProvider} from '../src/core/theme/themeProvider'
|
|
28
25
|
export {Tooltip} from '../src/core/primitives/tooltip/tooltip'
|
|
29
|
-
export
|
|
30
|
-
export {usePrefersDark} from '../src/core/hooks/usePrefersDark'
|
|
26
|
+
export {ThemeProvider} from '../src/core/theme/themeProvider'
|
|
31
27
|
export {useTheme_v2} from '../src/core/theme/useTheme'
|
|
28
|
+
export type {PopoverMargins} from '../src/core/types/popover'
|
|
29
|
+
export {LayerProvider} from '../src/core/utils/layer/layerProvider'
|
|
30
|
+
export {Portal} from '../src/core/utils/portal/portal'
|
|
31
|
+
export {PortalProvider} from '../src/core/utils/portal/portalProvider'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.9",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"dev": "run-p storybook:dev workshop:dev",
|
|
71
71
|
"figma:pkg:build": "cd figma && pnpm build",
|
|
72
72
|
"format": "prettier --write --cache --ignore-unknown .",
|
|
73
|
-
"lint": "eslint .
|
|
73
|
+
"lint": "eslint .",
|
|
74
74
|
"pkg:build": "pkg build --strict",
|
|
75
75
|
"pkg:check": "pkg --strict",
|
|
76
76
|
"prepare": "husky install",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@sanity/icons": "^3.7.0",
|
|
121
121
|
"csstype": "^3.1.3",
|
|
122
122
|
"framer-motion": "^12.5.0",
|
|
123
|
-
"react-compiler-runtime": "19.0.0-beta-
|
|
123
|
+
"react-compiler-runtime": "19.0.0-beta-e993439-20250328",
|
|
124
124
|
"react-refractor": "^2.2.0",
|
|
125
125
|
"use-effect-event": "^1.0.2"
|
|
126
126
|
},
|
|
@@ -131,24 +131,25 @@
|
|
|
131
131
|
"@babel/preset-typescript": "^7.26.0",
|
|
132
132
|
"@commitlint/cli": "^19.8.0",
|
|
133
133
|
"@commitlint/config-conventional": "^19.8.0",
|
|
134
|
-
"@
|
|
134
|
+
"@eslint/js": "^9.23.0",
|
|
135
|
+
"@sanity/pkg-utils": "^7.1.1",
|
|
135
136
|
"@sanity/prettier-config": "^1.0.3",
|
|
136
137
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
137
|
-
"@sanity/ui-workshop": "^2.0.
|
|
138
|
-
"@storybook/addon-a11y": "^8.6.
|
|
139
|
-
"@storybook/addon-docs": "^8.6.
|
|
140
|
-
"@storybook/addon-essentials": "^8.6.
|
|
141
|
-
"@storybook/addon-interactions": "^8.6.
|
|
142
|
-
"@storybook/addon-links": "^8.6.
|
|
143
|
-
"@storybook/addon-mdx-gfm": "^8.6.
|
|
144
|
-
"@storybook/addon-storysource": "^8.6.
|
|
145
|
-
"@storybook/addon-themes": "^8.6.
|
|
146
|
-
"@storybook/blocks": "^8.6.
|
|
147
|
-
"@storybook/manager-api": "^8.6.
|
|
148
|
-
"@storybook/react": "^8.6.
|
|
149
|
-
"@storybook/react-vite": "^8.6.
|
|
150
|
-
"@storybook/test": "^8.6.
|
|
151
|
-
"@storybook/theming": "^8.6.
|
|
138
|
+
"@sanity/ui-workshop": "^2.0.33",
|
|
139
|
+
"@storybook/addon-a11y": "^8.6.8",
|
|
140
|
+
"@storybook/addon-docs": "^8.6.8",
|
|
141
|
+
"@storybook/addon-essentials": "^8.6.8",
|
|
142
|
+
"@storybook/addon-interactions": "^8.6.8",
|
|
143
|
+
"@storybook/addon-links": "^8.6.8",
|
|
144
|
+
"@storybook/addon-mdx-gfm": "^8.6.8",
|
|
145
|
+
"@storybook/addon-storysource": "^8.6.8",
|
|
146
|
+
"@storybook/addon-themes": "^8.6.8",
|
|
147
|
+
"@storybook/blocks": "^8.6.8",
|
|
148
|
+
"@storybook/manager-api": "^8.6.8",
|
|
149
|
+
"@storybook/react": "^8.6.8",
|
|
150
|
+
"@storybook/react-vite": "^8.6.8",
|
|
151
|
+
"@storybook/test": "^8.6.8",
|
|
152
|
+
"@storybook/theming": "^8.6.8",
|
|
152
153
|
"@testing-library/dom": "^10.4.0",
|
|
153
154
|
"@testing-library/jest-dom": "^6.6.3",
|
|
154
155
|
"@testing-library/react": "^16.2.0",
|
|
@@ -156,28 +157,30 @@
|
|
|
156
157
|
"@types/jest": "^29.5.14",
|
|
157
158
|
"@types/jest-axe": "^3.5.9",
|
|
158
159
|
"@types/node": "^20.12.7",
|
|
159
|
-
"@types/react": "^19.0.
|
|
160
|
+
"@types/react": "^19.0.12",
|
|
160
161
|
"@types/react-dom": "^19.0.4",
|
|
161
162
|
"@types/react-is": "^19.0.0",
|
|
162
163
|
"@types/refractor": "^3.4.1",
|
|
163
|
-
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
164
|
-
"@typescript-eslint/parser": "^8.26.1",
|
|
165
164
|
"@vitejs/plugin-react": "^4.3.4",
|
|
166
|
-
"babel-plugin-react-compiler": "19.0.0-beta-
|
|
165
|
+
"babel-plugin-react-compiler": "19.0.0-beta-e993439-20250328",
|
|
167
166
|
"babel-plugin-styled-components": "^2.1.4",
|
|
168
167
|
"commitizen": "^4.3.1",
|
|
169
168
|
"cypress": "^13.17.0",
|
|
170
169
|
"cypress-real-events": "^1.14.0",
|
|
171
170
|
"cz-conventional-changelog": "^3.3.0",
|
|
172
|
-
"eslint": "^
|
|
171
|
+
"eslint": "^9.23.0",
|
|
173
172
|
"eslint-config-prettier": "^10.1.1",
|
|
173
|
+
"eslint-formatter-compact": "^8.40.0",
|
|
174
174
|
"eslint-plugin-boundaries": "^5.0.1",
|
|
175
175
|
"eslint-plugin-import": "^2.31.0",
|
|
176
176
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
177
177
|
"eslint-plugin-react": "^7.37.4",
|
|
178
|
-
"eslint-plugin-react-compiler": "19.0.0-beta-
|
|
178
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250328",
|
|
179
179
|
"eslint-plugin-react-hooks": "experimental",
|
|
180
|
-
"eslint-plugin-
|
|
180
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
181
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
182
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
183
|
+
"globals": "^16.0.0",
|
|
181
184
|
"http-server": "^14.1.1",
|
|
182
185
|
"husky": "^8.0.3",
|
|
183
186
|
"jest": "^29.7.0",
|
|
@@ -193,12 +196,13 @@
|
|
|
193
196
|
"refractor": "^4.9.0",
|
|
194
197
|
"rimraf": "^5.0.5",
|
|
195
198
|
"semantic-release": "^24.2.3",
|
|
196
|
-
"start-server-and-test": "^2.0.
|
|
197
|
-
"storybook": "^8.6.
|
|
198
|
-
"styled-components": "^6.1.
|
|
199
|
+
"start-server-and-test": "^2.0.11",
|
|
200
|
+
"storybook": "^8.6.8",
|
|
201
|
+
"styled-components": "^6.1.16",
|
|
199
202
|
"tsconfig-paths": "^4.2.0",
|
|
200
203
|
"typescript": "5.8.2",
|
|
201
|
-
"
|
|
204
|
+
"typescript-eslint": "^8.28.0",
|
|
205
|
+
"vite": "^5.4.15",
|
|
202
206
|
"vite-tsconfig-paths": "^5.1.4"
|
|
203
207
|
},
|
|
204
208
|
"peerDependencies": {
|
package/src/core/_compat.ts
CHANGED
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
type BaseTheme as _BaseTheme,
|
|
5
|
-
|
|
5
|
+
buildTheme,
|
|
6
6
|
type HSL as _HSL,
|
|
7
7
|
type PartialThemeColorBuilderOpts,
|
|
8
8
|
type RGB as _RGB,
|
|
9
9
|
type RootTheme as _RootTheme,
|
|
10
|
-
type ThemeStyles,
|
|
11
10
|
type Theme as _Theme,
|
|
12
11
|
type ThemeAvatar,
|
|
12
|
+
type ThemeBoxShadow,
|
|
13
13
|
type ThemeColor,
|
|
14
14
|
type ThemeColorBase,
|
|
15
15
|
type ThemeColorBuilderOpts,
|
|
16
16
|
type ThemeColorButton,
|
|
17
17
|
type ThemeColorButtonModeKey as _ThemeColorButtonModeKey,
|
|
18
|
+
type ThemeColorButtonState,
|
|
18
19
|
type ThemeColorButtonStates,
|
|
19
20
|
type ThemeColorButtonTones,
|
|
20
21
|
type ThemeColorCard,
|
|
22
|
+
type ThemeColorCardState,
|
|
21
23
|
type ThemeColorGenericState,
|
|
22
24
|
type ThemeColorInput,
|
|
23
25
|
type ThemeColorInputState,
|
|
@@ -29,6 +31,7 @@ import {
|
|
|
29
31
|
type ThemeColorSchemeKey as _ThemeColorSchemeKey,
|
|
30
32
|
type ThemeColorSchemes,
|
|
31
33
|
type ThemeColorSelectable,
|
|
34
|
+
type ThemeColorSelectableState,
|
|
32
35
|
type ThemeColorSelectableStates,
|
|
33
36
|
type ThemeColorSolid,
|
|
34
37
|
type ThemeColorSolidTone,
|
|
@@ -38,17 +41,14 @@ import {
|
|
|
38
41
|
type ThemeColorToneKey,
|
|
39
42
|
type ThemeFont as _ThemeFont,
|
|
40
43
|
type ThemeFontKey as _ThemeFontKey,
|
|
44
|
+
type ThemeFonts as _ThemeFonts,
|
|
41
45
|
type ThemeFontSize as _ThemeFontSize,
|
|
42
46
|
type ThemeFontWeight as _ThemeFontWeight,
|
|
43
47
|
type ThemeFontWeightKey as _ThemeFontWeightKey,
|
|
44
|
-
type ThemeFonts as _ThemeFonts,
|
|
45
48
|
type ThemeInput,
|
|
46
49
|
type ThemeLayer as _ThemeLayer,
|
|
47
50
|
type ThemeShadow as _ThemeShadow,
|
|
48
|
-
type
|
|
49
|
-
type ThemeColorCardState,
|
|
50
|
-
type ThemeColorSelectableState,
|
|
51
|
-
buildTheme,
|
|
51
|
+
type ThemeStyles,
|
|
52
52
|
} from '@sanity/ui/theme'
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -166,9 +166,11 @@ export {
|
|
|
166
166
|
type ThemeColorBase,
|
|
167
167
|
type ThemeColorBuilderOpts,
|
|
168
168
|
type ThemeColorButton,
|
|
169
|
+
type ThemeColorButtonState,
|
|
169
170
|
type ThemeColorButtonStates,
|
|
170
171
|
type ThemeColorButtonTones,
|
|
171
172
|
type ThemeColorCard,
|
|
173
|
+
type ThemeColorCardState,
|
|
172
174
|
type ThemeColorGenericState,
|
|
173
175
|
type ThemeColorInput,
|
|
174
176
|
type ThemeColorInputState,
|
|
@@ -179,6 +181,7 @@ export {
|
|
|
179
181
|
type ThemeColorScheme,
|
|
180
182
|
type ThemeColorSchemes,
|
|
181
183
|
type ThemeColorSelectable,
|
|
184
|
+
type ThemeColorSelectableState,
|
|
182
185
|
type ThemeColorSelectableStates,
|
|
183
186
|
type ThemeColorSolid,
|
|
184
187
|
type ThemeColorSolidTone,
|
|
@@ -186,9 +189,6 @@ export {
|
|
|
186
189
|
type ThemeColorSpotKey,
|
|
187
190
|
type ThemeColorToneKey,
|
|
188
191
|
type ThemeInput,
|
|
189
|
-
type ThemeColorButtonState,
|
|
190
|
-
type ThemeColorCardState,
|
|
191
|
-
type ThemeColorSelectableState,
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
import {
|
|
@@ -197,9 +197,9 @@ import {
|
|
|
197
197
|
hslToRgb as _hslToRgb,
|
|
198
198
|
multiply as _multiply,
|
|
199
199
|
parseColor as _parseColor,
|
|
200
|
+
rgba as _rgba,
|
|
200
201
|
rgbToHex as _rgbToHex,
|
|
201
202
|
rgbToHsl as _rgbToHsl,
|
|
202
|
-
rgba as _rgba,
|
|
203
203
|
screen as _screen,
|
|
204
204
|
} from '@sanity/ui/theme'
|
|
205
205
|
|
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
Text,
|
|
10
10
|
} from '@sanity/ui'
|
|
11
11
|
import {useCallback, useState} from 'react'
|
|
12
|
+
|
|
12
13
|
import {Popover} from '../../../primitives'
|
|
13
|
-
import countries from '../
|
|
14
|
+
import countries from '../__mocks__/countries'
|
|
14
15
|
import {AutocompleteProps} from '../autocomplete'
|
|
15
16
|
import {ExampleOption} from './types'
|
|
16
17
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {Autocomplete, Box, Button, Card, Code, Container, Stack, Text} from '@sanity/ui'
|
|
2
2
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
3
3
|
import {useCallback, useState} from 'react'
|
|
4
|
+
|
|
4
5
|
import {
|
|
5
6
|
WORKSHOP_RADIUS_OPTIONS,
|
|
6
7
|
WORKSHOP_SPACE_OPTIONS,
|
|
7
8
|
WORKSHOP_TEXT_SIZE_OPTIONS,
|
|
8
9
|
} from '../../../__workshop__/constants'
|
|
9
|
-
import countries from '../
|
|
10
|
+
import countries from '../__mocks__/countries'
|
|
10
11
|
import {ExampleOption} from './types'
|
|
11
12
|
|
|
12
13
|
export default function CustomStory() {
|
|
@@ -3,13 +3,14 @@ import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
|
3
3
|
import {PerfTestProps, usePerfTest} from '@sanity/ui-workshop/plugin-perf'
|
|
4
4
|
import {fireEvent} from '@testing-library/dom'
|
|
5
5
|
import {useCallback, useMemo, useState} from 'react'
|
|
6
|
+
|
|
6
7
|
import {
|
|
7
8
|
WORKSHOP_CARD_TONE_OPTIONS,
|
|
8
9
|
WORKSHOP_RADIUS_OPTIONS,
|
|
9
10
|
WORKSHOP_SPACE_OPTIONS,
|
|
10
11
|
WORKSHOP_TEXT_SIZE_OPTIONS,
|
|
11
12
|
} from '../../../__workshop__/constants'
|
|
12
|
-
import countries from '../
|
|
13
|
+
import countries from '../__mocks__/countries'
|
|
13
14
|
|
|
14
15
|
const typingPerfTest: PerfTestProps<HTMLInputElement> = {
|
|
15
16
|
name: 'typing',
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {ChevronDownIcon} from '@sanity/icons'
|
|
2
2
|
import {
|
|
3
3
|
ChangeEvent,
|
|
4
|
+
cloneElement,
|
|
4
5
|
ElementType,
|
|
5
6
|
FocusEvent,
|
|
7
|
+
forwardRef,
|
|
6
8
|
HTMLProps,
|
|
7
9
|
KeyboardEvent,
|
|
8
10
|
MouseEvent,
|
|
9
11
|
ReactNode,
|
|
10
12
|
Ref,
|
|
11
|
-
cloneElement,
|
|
12
|
-
forwardRef,
|
|
13
13
|
useCallback,
|
|
14
14
|
useEffect,
|
|
15
15
|
useImperativeHandle,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
useReducer,
|
|
18
18
|
useRef,
|
|
19
19
|
} from 'react'
|
|
20
|
+
|
|
20
21
|
import {EMPTY_ARRAY, EMPTY_RECORD} from '../../constants'
|
|
21
22
|
import {_hasFocus, _raf, focusFirstDescendant} from '../../helpers'
|
|
22
23
|
import {useArrayProp} from '../../hooks'
|
|
@@ -28,24 +28,31 @@ export default function Example() {
|
|
|
28
28
|
space={2}
|
|
29
29
|
>
|
|
30
30
|
<Text size={1}>
|
|
31
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
31
32
|
<a href="#">Root</a>
|
|
32
33
|
</Text>
|
|
33
34
|
<Text size={1}>
|
|
35
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
34
36
|
<a href="#">Category A</a>
|
|
35
37
|
</Text>
|
|
36
38
|
<Text size={1}>
|
|
39
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
37
40
|
<a href="#">Category B</a>
|
|
38
41
|
</Text>
|
|
39
42
|
<Text size={1}>
|
|
43
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
40
44
|
<a href="#">Category C</a>
|
|
41
45
|
</Text>
|
|
42
46
|
<Text size={1}>
|
|
47
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
43
48
|
<a href="#">Category D</a>
|
|
44
49
|
</Text>
|
|
45
50
|
<Text size={1}>
|
|
51
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
46
52
|
<a href="#">Category E</a>
|
|
47
53
|
</Text>
|
|
48
54
|
<Text size={1}>
|
|
55
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
49
56
|
<a href="#">Category F</a>
|
|
50
57
|
</Text>
|
|
51
58
|
<Text size={1}>Item</Text>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {useState} from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import {Button, Flex, Stack, Text} from '../../../primitives'
|
|
3
4
|
import {Layer, LayerProvider} from '../../../utils'
|
|
4
5
|
import {Menu, MenuButton, MenuItem} from '../../menu'
|
|
5
6
|
import {Dialog} from '../dialog'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {useCallback, useState} from 'react'
|
|
2
2
|
import {styled} from 'styled-components'
|
|
3
|
+
|
|
3
4
|
import {Box, Button, Card, Flex} from '../../../primitives'
|
|
4
5
|
import {BoundaryElementProvider, PortalProvider} from '../../../utils'
|
|
5
6
|
import {Menu, MenuButton, MenuItem} from '../../menu'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ArrowDownIcon, ArrowUpIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Dialog, LayerProvider, Stack, Text} from '@sanity/ui'
|
|
3
3
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
4
|
+
|
|
4
5
|
import {WORKSHOP_DIALOG_POSITION_OPTIONS} from '../../../__workshop__/constants'
|
|
5
6
|
|
|
6
7
|
export default function PositionStory() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {Box, Button, Dialog, LayerProvider, Stack, Text} from '@sanity/ui'
|
|
2
2
|
import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
|
|
3
3
|
import {useCallback, useRef, useState} from 'react'
|
|
4
|
+
|
|
4
5
|
import {WORKSHOP_WIDTH_OPTIONS} from '../../../__workshop__/constants'
|
|
5
6
|
|
|
6
7
|
export default function PropsStory() {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import {Box, Button, Dialog, DialogProps, LayerProvider, useLayer} from '@sanity/ui'
|
|
1
2
|
import {ReactNode, useCallback, useEffect, useRef, useState} from 'react'
|
|
2
|
-
import {Box, Button} from '../../../primitives'
|
|
3
|
-
import {LayerProvider, useLayer} from '../../../utils'
|
|
4
|
-
import {Dialog, DialogProps} from '../dialog'
|
|
5
3
|
|
|
6
4
|
export default function WrappedStory() {
|
|
7
5
|
return (
|
|
@@ -2,6 +2,7 @@ import {CloseIcon} from '@sanity/icons'
|
|
|
2
2
|
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
3
3
|
import {forwardRef, useCallback, useEffect, useImperativeHandle, useRef} from 'react'
|
|
4
4
|
import {styled} from 'styled-components'
|
|
5
|
+
|
|
5
6
|
import {
|
|
6
7
|
containsOrEqualsElement,
|
|
7
8
|
focusFirstDescendant,
|
|
@@ -404,6 +405,7 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
404
405
|
role="dialog"
|
|
405
406
|
zOffset={zOffset}
|
|
406
407
|
>
|
|
408
|
+
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
|
|
407
409
|
<div ref={preDivRef} tabIndex={0} />
|
|
408
410
|
<DialogCard
|
|
409
411
|
__unstable_autoFocus={autoFocus}
|
|
@@ -423,6 +425,7 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
423
425
|
>
|
|
424
426
|
{children}
|
|
425
427
|
</DialogCard>
|
|
428
|
+
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
|
|
426
429
|
<div ref={postDivRef} tabIndex={0} />
|
|
427
430
|
</StyledDialog>
|
|
428
431
|
</Portal>
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from '@sanity/ui'
|
|
14
14
|
import {useAction, useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
15
15
|
import {useMemo} from 'react'
|
|
16
|
+
|
|
16
17
|
import {WORKSHOP_CARD_TONE_OPTIONS} from '../../../__workshop__/constants'
|
|
17
18
|
|
|
18
19
|
export default function MenuButtonStory() {
|
|
@@ -2,6 +2,7 @@ import {CubeIcon} from '@sanity/icons'
|
|
|
2
2
|
import {Box, Card, LayerProvider, Menu, MenuItem} from '@sanity/ui'
|
|
3
3
|
import {THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
|
|
4
4
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
5
|
+
|
|
5
6
|
import {WORKSHOP_CARD_TONE_OPTIONS} from '../../../__workshop__/constants'
|
|
6
7
|
|
|
7
8
|
export default function TonesStory() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef} from 'react'
|
|
2
2
|
import {styled} from 'styled-components'
|
|
3
|
+
|
|
3
4
|
import {useClickOutsideEvent, useGlobalKeyDown} from '../../hooks'
|
|
4
5
|
import {Box, Stack} from '../../primitives'
|
|
5
6
|
import {ResponsivePaddingProps} from '../../primitives/types'
|
|
@@ -3,12 +3,13 @@ import {
|
|
|
3
3
|
cloneElement,
|
|
4
4
|
forwardRef,
|
|
5
5
|
useCallback,
|
|
6
|
-
useMemo,
|
|
7
|
-
useState,
|
|
8
6
|
useEffect,
|
|
9
|
-
useRef,
|
|
10
7
|
useImperativeHandle,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
11
|
} from 'react'
|
|
12
|
+
|
|
12
13
|
import {Popover, PopoverProps} from '../../primitives'
|
|
13
14
|
import {Placement, Radius} from '../../types'
|
|
14
15
|
import {MenuProps} from './menu'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ChevronRightIcon} from '@sanity/icons'
|
|
2
2
|
import {isValidElement, useCallback, useEffect, useState} from 'react'
|
|
3
3
|
import {isValidElementType} from 'react-is'
|
|
4
|
+
|
|
4
5
|
import {useArrayProp} from '../../hooks'
|
|
5
6
|
import {Box, Flex, Popover, PopoverProps, Text} from '../../primitives'
|
|
6
7
|
import {Selectable} from '../../primitives/_selectable'
|