@sanity/ui 3.3.0 → 3.3.2
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 +12 -0
- package/dist/_visual-editing.d.mts +2 -1126
- package/dist/_visual-editing.d.ts +2 -1126
- package/dist/_visual-editing.js +3 -31
- package/dist/_visual-editing.mjs +2 -31
- package/dist/index.d.mts +555 -2769
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +555 -2769
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2982 -1934
- package/dist/index.mjs +2950 -1903
- package/dist/index.mjs.map +1 -1
- package/dist/refractor.js +16 -0
- package/dist/refractor.mjs +21 -0
- package/dist/refractor.mjs.map +1 -0
- package/dist/tabList.js +3804 -0
- package/dist/tabList.mjs +3355 -0
- package/dist/tabList.mjs.map +1 -0
- package/dist/theme.d.mts +927 -1227
- package/dist/theme.d.mts.map +1 -0
- package/dist/theme.d.ts +927 -1227
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +3 -4127
- package/dist/theme.mjs +2 -4127
- package/dist/theme2.d.mts +2 -0
- package/dist/theme2.d.ts +2 -0
- package/dist/theme2.js +4104 -0
- package/dist/theme2.mjs +3851 -0
- package/dist/theme2.mjs.map +1 -0
- package/dist/useTheme.d.mts +1451 -0
- package/dist/useTheme.d.mts.map +1 -0
- package/dist/useTheme.d.ts +1451 -0
- package/dist/useTheme.d.ts.map +1 -0
- package/exports/_visual-editing.ts +1 -0
- package/package.json +52 -168
- package/src/core/_compat.ts +30 -0
- package/src/core/components/autocomplete/autocomplete.tsx +8 -0
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
- package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +8 -5
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +3 -0
- package/src/core/components/dialog/dialog.tsx +5 -2
- package/src/core/components/hotkeys/hotkeys.test.tsx +10 -5
- package/src/core/components/hotkeys/hotkeys.tsx +2 -0
- package/src/core/components/menu/menu.spacing.test.tsx +12 -7
- package/src/core/components/menu/menu.test.tsx +9 -6
- package/src/core/components/menu/menu.tsx +4 -2
- package/src/core/components/menu/menuButton.tsx +8 -0
- package/src/core/components/menu/menuDivider.ts +1 -0
- package/src/core/components/menu/menuGroup.spacing.test.tsx +9 -6
- package/src/core/components/menu/menuGroup.tsx +6 -2
- package/src/core/components/menu/menuItem.spacing.test.tsx +8 -5
- package/src/core/components/menu/menuItem.tsx +4 -0
- package/src/core/components/menu/useMenuController.ts +2 -0
- package/src/core/components/skeleton/skeleton.tsx +1 -0
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.test.tsx +7 -5
- package/src/core/components/tab/tabList.tsx +1 -0
- package/src/core/components/toast/toast.test.tsx +9 -4
- package/src/core/components/toast/toast.tsx +1 -0
- package/src/core/components/toast/toastLayer.tsx +1 -0
- package/src/core/components/tree/tree.test.tsx +10 -5
- package/src/core/components/tree/tree.tsx +2 -0
- package/src/core/components/tree/treeGroup.tsx +1 -0
- package/src/core/components/tree/treeItem.test.tsx +10 -5
- package/src/core/components/tree/treeItem.tsx +1 -0
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useClickOutside.test.tsx +43 -15
- package/src/core/hooks/useClickOutside.ts +1 -1
- package/src/core/hooks/useClickOutsideEvent.test.tsx +8 -4
- package/src/core/hooks/useDelayed.test.ts +9 -8
- package/src/core/hooks/useElementRect/useElementRect.ts +1 -0
- package/src/core/hooks/useForwardedRef.ts +1 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +7 -5
- package/src/core/hooks/usePrefersDark.test.tsx +3 -1
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +7 -5
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +3 -1
- package/src/core/lib/createGlobalScopedContext.ts +1 -0
- package/src/core/lib/globalScope.ts +1 -0
- package/src/core/observers/elementSizeObserver.ts +1 -0
- package/src/core/primitives/avatar/avatar.tsx +2 -2
- package/src/core/primitives/avatar/avatarStack.tsx +1 -0
- package/src/core/primitives/badge/badge.test.tsx +3 -2
- package/src/core/primitives/badge/badge.tsx +3 -1
- package/src/core/primitives/box/box.test.tsx +18 -5
- package/src/core/primitives/box/box.tsx +9 -1
- package/src/core/primitives/button/button.test.tsx +10 -6
- package/src/core/primitives/button/button.tsx +4 -0
- package/src/core/primitives/button/styles.ts +1 -0
- package/src/core/primitives/card/card.tsx +2 -5
- package/src/core/primitives/card/types.ts +1 -0
- package/src/core/primitives/code/code.tsx +1 -0
- package/src/core/primitives/code/refractor.tsx +2 -0
- package/src/core/primitives/container/container.tsx +1 -0
- package/src/core/primitives/flex/flex.tsx +2 -3
- package/src/core/primitives/grid/grid.test.tsx +11 -5
- package/src/core/primitives/grid/grid.tsx +3 -0
- package/src/core/primitives/heading/heading.tsx +1 -0
- package/src/core/primitives/inline/inline.test.tsx +9 -5
- package/src/core/primitives/inline/inline.tsx +3 -0
- package/src/core/primitives/kbd/kbd.tsx +5 -1
- package/src/core/primitives/label/label.tsx +1 -0
- package/src/core/primitives/popover/popover.tsx +5 -4
- package/src/core/primitives/popover/popoverCard.tsx +1 -0
- package/src/core/primitives/popover/types.ts +0 -1
- package/src/core/primitives/select/select.test.tsx +9 -5
- package/src/core/primitives/select/select.tsx +1 -0
- package/src/core/primitives/stack/stack.test.tsx +9 -5
- package/src/core/primitives/stack/stack.tsx +2 -0
- package/src/core/primitives/stack/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +1 -0
- package/src/core/primitives/textInput/textInput.test.tsx +9 -5
- package/src/core/primitives/textInput/textInput.tsx +3 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +82 -49
- package/src/core/primitives/tooltip/tooltip.tsx +3 -1
- package/src/core/primitives/tooltip/tooltipCard.tsx +1 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +2 -0
- package/src/core/styles/flex/types.ts +0 -1
- package/src/core/styles/font/responsiveFont.ts +0 -3
- package/src/core/styles/font/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +1 -0
- package/src/core/styles/margin/marginStyle.ts +1 -0
- package/src/core/styles/margin/marginsStyle.test.ts +2 -1
- package/src/core/styles/padding/paddingStyle.test.ts +2 -1
- package/src/core/styles/padding/paddingStyle.ts +1 -0
- package/src/core/theme/theme.test.tsx +7 -3
- package/src/core/theme/useRootTheme.ts +1 -0
- package/src/core/theme/useTheme.ts +2 -0
- package/src/core/utils/arrow/arrow.tsx +1 -0
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +9 -4
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +1 -0
- package/src/core/utils/getElementRef.ts +5 -0
- package/src/core/utils/layer/getLayerContext.test.ts +2 -0
- package/src/core/utils/layer/layer.test.tsx +9 -4
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/useLayer.ts +2 -0
- package/src/core/utils/portal/portal.test.tsx +9 -4
- package/src/core/utils/portal/portalProvider.tsx +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +2 -1
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +10 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +4 -0
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +5 -0
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +5 -0
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +6 -0
- package/src/theme/build/_deprecated/color/color.test.ts +5 -1
- package/src/theme/build/_deprecated/color/defaults.ts +1 -0
- package/src/theme/build/_deprecated/color/factory.ts +36 -0
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +5 -0
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +4 -0
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +3 -0
- package/src/theme/build/buildColorTheme.test.ts +2 -0
- package/src/theme/build/buildColorTheme.ts +8 -0
- package/src/theme/build/buildTheme.test.ts +2 -0
- package/src/theme/build/lib/color-fns/color-fns.test.ts +3 -1
- package/src/theme/build/merge.ts +5 -0
- package/src/theme/build/mixThemeColor.test.ts +2 -0
- package/src/theme/build/renderColorTheme.ts +6 -0
- package/src/theme/build/renderColorValue.ts +0 -2
- package/src/theme/build/resolveColorTokens.ts +6 -0
- package/src/theme/build/theme.test.ts +2 -0
- package/src/theme/config/helpers.ts +5 -0
- package/src/theme/config/system.ts +2 -0
- package/src/theme/config/tokens/color/types.ts +6 -4
- package/src/theme/config/tokens/parseTokenKey.test.ts +2 -0
- package/src/theme/config/tokens/parseTokenValue.test.ts +2 -0
- package/src/theme/config/tokens/parseTokenValue.ts +1 -0
- package/src/theme/getScopedTheme.ts +6 -1
- package/src/theme/system/color/_helpers.ts +4 -0
- package/src/theme/system/theme.ts +4 -0
- package/src/theme/system/v0/color/_system.ts +1 -0
- package/src/theme/system/v0/color/button.ts +14 -0
- package/src/theme/system/v0/color/card.ts +6 -0
- package/src/theme/system/v0/color/color.ts +11 -0
- package/src/theme/system/v0/color/input.ts +6 -0
- package/src/theme/system/v0/color/muted.ts +11 -0
- package/src/theme/system/v0/color/selectable.ts +11 -0
- package/src/theme/system/v0/color/solid.ts +11 -0
- package/src/theme/system/v0/color/spot.ts +1 -0
- package/src/theme/versioning/getTheme_v2.ts +15 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +7 -0
- package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -0
- package/src/theme/versioning/v0_v2.ts +13 -1
- package/src/theme/versioning/v2_v0.ts +18 -0
- package/dist/_chunks-cjs/_visual-editing.js +0 -5899
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js +0 -23
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs +0 -5905
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs +0 -26
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_visual-editing.js.map +0 -1
- package/dist/_visual-editing.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/theme.mjs.map +0 -1
- package/src/core/__workshop__/constants.ts +0 -293
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
- package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
- package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
- package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
- package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
- package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
- package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
- package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/core/components/dialog/__workshop__/index.ts +0 -19
- package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
- package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
- package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
- package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
- package/src/core/components/dialog/__workshop__/position.tsx +0 -30
- package/src/core/components/dialog/__workshop__/props.tsx +0 -75
- package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
- package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
- package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
- package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/core/components/menu/__workshop__/groups.tsx +0 -156
- package/src/core/components/menu/__workshop__/index.ts +0 -89
- package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
- package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
- package/src/core/components/menu/__workshop__/tones.tsx +0 -25
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
- package/src/core/components/skeleton/__workshop__/index.ts +0 -11
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/core/components/tab/__workshop__/example.tsx +0 -79
- package/src/core/components/tab/__workshop__/index.ts +0 -14
- package/src/core/components/toast/__workshop__/hook.tsx +0 -71
- package/src/core/components/toast/__workshop__/index.ts +0 -19
- package/src/core/components/toast/__workshop__/toast.tsx +0 -26
- package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/core/components/tree/__workshop__/basic.tsx +0 -105
- package/src/core/components/tree/__workshop__/index.ts +0 -21
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
- package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
- package/src/core/primitives/badge/__workshop__/index.ts +0 -19
- package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
- package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
- package/src/core/primitives/box/__workshop__/asComponent.tsx +0 -31
- package/src/core/primitives/box/__workshop__/index.ts +0 -24
- package/src/core/primitives/box/__workshop__/props.tsx +0 -20
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
- package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
- package/src/core/primitives/button/__workshop__/index.ts +0 -59
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
- package/src/core/primitives/button/__workshop__/props.tsx +0 -55
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
- package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/core/primitives/card/__workshop__/index.ts +0 -18
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
- package/src/core/primitives/card/__workshop__/props.tsx +0 -53
- package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
- package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
- package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
- package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
- package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
- package/src/core/primitives/code/__workshop__/index.ts +0 -19
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/code/__workshop__/props.tsx +0 -21
- package/src/core/primitives/container/__workshop__/example.tsx +0 -20
- package/src/core/primitives/container/__workshop__/index.ts +0 -8
- package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
- package/src/core/primitives/flex/__workshop__/index.ts +0 -11
- package/src/core/primitives/grid/__workshop__/index.ts +0 -10
- package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/index.ts +0 -19
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/inline/__workshop__/index.ts +0 -8
- package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
- package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
- package/src/core/primitives/label/__workshop__/index.ts +0 -19
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/core/primitives/popover/__workshop__/index.ts +0 -49
- package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/core/primitives/radio/__workshop__/index.ts +0 -11
- package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/select/__workshop__/index.ts +0 -11
- package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
- package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
- package/src/core/primitives/switch/__workshop__/index.ts +0 -11
- package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
- package/src/core/primitives/text/__workshop__/example.tsx +0 -39
- package/src/core/primitives/text/__workshop__/index.ts +0 -24
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
- package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
- package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
- package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/core/theme/__workshop__/build/Root.tsx +0 -367
- package/src/core/theme/__workshop__/build/helpers.ts +0 -46
- package/src/core/theme/__workshop__/build/story.tsx +0 -465
- package/src/core/theme/__workshop__/canvas.tsx +0 -352
- package/src/core/theme/__workshop__/color.tsx +0 -62
- package/src/core/theme/__workshop__/debug/story.tsx +0 -408
- package/src/core/theme/__workshop__/index.ts +0 -39
- package/src/core/theme/__workshop__/layer.tsx +0 -78
- package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
- package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
- package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
- package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
- package/src/core/utils/layer/__workshop__/index.ts +0 -24
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
- package/src/core/utils/portal/__workshop__/index.ts +0 -14
- package/src/core/utils/portal/__workshop__/named.tsx +0 -63
- package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
- package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildTheme,
|
|
3
|
-
THEME_COLOR_BUTTON_MODES,
|
|
4
|
-
THEME_COLOR_CARD_TONES,
|
|
5
|
-
THEME_COLOR_INPUT_MODES,
|
|
6
|
-
THEME_COLOR_STATE_TONES,
|
|
7
|
-
ThemeColorButtonTone_v2,
|
|
8
|
-
ThemeColorCard_v2,
|
|
9
|
-
ThemeColorCardToneKey,
|
|
10
|
-
ThemeColorInputMode_v2,
|
|
11
|
-
ThemeColorInputModeKey,
|
|
12
|
-
ThemeColorState_v2,
|
|
13
|
-
} from '@sanity/ui/theme'
|
|
14
|
-
|
|
15
|
-
import {rem} from '../../../styles'
|
|
16
|
-
import {useTheme_v2} from '../../useTheme'
|
|
17
|
-
import {getCSSProps} from './helpers'
|
|
18
|
-
import {Root} from './Root'
|
|
19
|
-
|
|
20
|
-
const theme = buildTheme()
|
|
21
|
-
|
|
22
|
-
export default function BuildStory(): React.JSX.Element {
|
|
23
|
-
return (
|
|
24
|
-
<Root>
|
|
25
|
-
<div
|
|
26
|
-
style={{
|
|
27
|
-
display: 'flex',
|
|
28
|
-
...getCSSProps({
|
|
29
|
-
radius: theme.radius.map((r) => rem(r)),
|
|
30
|
-
shadows: theme.shadows.map((s) =>
|
|
31
|
-
s
|
|
32
|
-
? {
|
|
33
|
-
umbra: s.umbra.join(' '),
|
|
34
|
-
penumbra: s.penumbra.join(' '),
|
|
35
|
-
ambient: s.ambient.join(' '),
|
|
36
|
-
}
|
|
37
|
-
: {},
|
|
38
|
-
),
|
|
39
|
-
space: theme.space.map((s) => rem(s)),
|
|
40
|
-
}),
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
<div style={{flex: 1}}>
|
|
44
|
-
{THEME_COLOR_CARD_TONES.map((baseTone) => (
|
|
45
|
-
<BaseTonePreview
|
|
46
|
-
baseTone={baseTone}
|
|
47
|
-
key={baseTone}
|
|
48
|
-
scheme="light"
|
|
49
|
-
theme={theme.v2!.color.light[baseTone]}
|
|
50
|
-
/>
|
|
51
|
-
))}
|
|
52
|
-
</div>
|
|
53
|
-
<div style={{flex: 1}}>
|
|
54
|
-
{THEME_COLOR_CARD_TONES.map((baseTone) => (
|
|
55
|
-
<BaseTonePreview
|
|
56
|
-
baseTone={baseTone}
|
|
57
|
-
key={baseTone}
|
|
58
|
-
scheme="dark"
|
|
59
|
-
theme={theme.v2!.color.dark[baseTone]}
|
|
60
|
-
/>
|
|
61
|
-
))}
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</Root>
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function BaseTonePreview(props: {
|
|
69
|
-
baseTone: ThemeColorCardToneKey
|
|
70
|
-
scheme: 'light' | 'dark'
|
|
71
|
-
theme: ThemeColorCard_v2
|
|
72
|
-
}) {
|
|
73
|
-
const {baseTone, scheme, theme: color} = props
|
|
74
|
-
const theme = useTheme_v2()
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<div className="base" style={getCSSProps(color as unknown as Record<string, unknown>)}>
|
|
78
|
-
<div
|
|
79
|
-
style={{
|
|
80
|
-
maxWidth: 600,
|
|
81
|
-
margin: 'auto',
|
|
82
|
-
padding: 'var(--space-4)',
|
|
83
|
-
}}
|
|
84
|
-
>
|
|
85
|
-
<pre style={{padding: 12}}>
|
|
86
|
-
color/{scheme}/{baseTone}
|
|
87
|
-
</pre>
|
|
88
|
-
<div style={{padding: 12}}>
|
|
89
|
-
<div
|
|
90
|
-
style={{
|
|
91
|
-
boxShadow: [
|
|
92
|
-
`0 0 0 ${theme.card.shadow.outline}px var(--shadow-outline)`,
|
|
93
|
-
`0 6px 8px -4px var(--shadow-umbra)`,
|
|
94
|
-
`0 12px 17px 2px var(--shadow-penumbra)`,
|
|
95
|
-
`0 5px 22px 4px var(--shadow-ambient)`,
|
|
96
|
-
].join(', '),
|
|
97
|
-
padding: 'var(--space-3)',
|
|
98
|
-
borderRadius: 'var(--radius-2)',
|
|
99
|
-
}}
|
|
100
|
-
>
|
|
101
|
-
Shadow
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
<div style={{padding: 'var(--space-3)'}}>
|
|
105
|
-
<StatePreview theme={color.selectable.default.enabled} />
|
|
106
|
-
</div>
|
|
107
|
-
<div
|
|
108
|
-
style={{
|
|
109
|
-
padding: 'var(--space-3)',
|
|
110
|
-
display: 'flex',
|
|
111
|
-
flexDirection: 'column',
|
|
112
|
-
gap: 'var(--space-4)',
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
115
|
-
{THEME_COLOR_INPUT_MODES.map((mode) => (
|
|
116
|
-
<InputPreview key={mode} mode={mode} theme={color.input[mode]} />
|
|
117
|
-
))}
|
|
118
|
-
</div>
|
|
119
|
-
<div
|
|
120
|
-
style={{
|
|
121
|
-
marginTop: 'var(--space-4)',
|
|
122
|
-
padding: '1px 12px 12px 12px',
|
|
123
|
-
display: 'flex',
|
|
124
|
-
flexDirection: 'column',
|
|
125
|
-
gap: 'var(--space-4)',
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
{THEME_COLOR_BUTTON_MODES.map((mode) => (
|
|
129
|
-
<div
|
|
130
|
-
key={mode}
|
|
131
|
-
style={{display: 'flex', flexDirection: 'column', gap: 'var(--space-1)'}}
|
|
132
|
-
>
|
|
133
|
-
{THEME_COLOR_STATE_TONES.map((tone) => {
|
|
134
|
-
return <ButtonPreview key={tone} theme={color.button[mode][tone]} />
|
|
135
|
-
})}
|
|
136
|
-
</div>
|
|
137
|
-
))}
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function StatePreview(props: {theme: ThemeColorState_v2}) {
|
|
145
|
-
const {theme: card} = props
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<div
|
|
149
|
-
style={
|
|
150
|
-
{
|
|
151
|
-
...getCSSProps({card}),
|
|
152
|
-
|
|
153
|
-
display: 'flex',
|
|
154
|
-
flexDirection: 'column',
|
|
155
|
-
marginTop: -1,
|
|
156
|
-
} as any
|
|
157
|
-
}
|
|
158
|
-
>
|
|
159
|
-
<div
|
|
160
|
-
style={{
|
|
161
|
-
display: 'flex',
|
|
162
|
-
gap: 4,
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
<div
|
|
166
|
-
className="card"
|
|
167
|
-
style={{
|
|
168
|
-
flex: 1,
|
|
169
|
-
padding: 'var(--space-2)',
|
|
170
|
-
display: 'flex',
|
|
171
|
-
gap: 'var(--space-1)',
|
|
172
|
-
}}
|
|
173
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
174
|
-
tabIndex={0}
|
|
175
|
-
>
|
|
176
|
-
<div style={{flex: 'none'}}>Card</div>
|
|
177
|
-
<div className="icon" style={{flex: 'none'}}>
|
|
178
|
-
©
|
|
179
|
-
</div>
|
|
180
|
-
<div className="muted-fg" style={{flex: 'none'}}>
|
|
181
|
-
m
|
|
182
|
-
</div>
|
|
183
|
-
<div className="accent-fg" style={{flex: 'none'}}>
|
|
184
|
-
a
|
|
185
|
-
</div>
|
|
186
|
-
<div className="link-fg" style={{flex: 'none'}}>
|
|
187
|
-
l
|
|
188
|
-
</div>
|
|
189
|
-
<div className="code" style={{flex: 'none'}}>
|
|
190
|
-
c
|
|
191
|
-
</div>
|
|
192
|
-
<div style={{flex: 'none'}}>
|
|
193
|
-
<CheckeredBackground />
|
|
194
|
-
</div>
|
|
195
|
-
<div style={{flex: 'none'}}>
|
|
196
|
-
<Skeleton />
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
199
|
-
<div
|
|
200
|
-
className="card selected"
|
|
201
|
-
style={{
|
|
202
|
-
flex: 1,
|
|
203
|
-
padding: 'var(--space-2)',
|
|
204
|
-
display: 'flex',
|
|
205
|
-
gap: 4,
|
|
206
|
-
}}
|
|
207
|
-
>
|
|
208
|
-
<div style={{flex: 'none'}}>Card</div>
|
|
209
|
-
<div className="icon" style={{flex: 'none'}}>
|
|
210
|
-
©
|
|
211
|
-
</div>
|
|
212
|
-
<div className="muted-fg" style={{flex: 'none'}}>
|
|
213
|
-
m
|
|
214
|
-
</div>
|
|
215
|
-
<div className="accent-fg" style={{flex: 'none'}}>
|
|
216
|
-
a
|
|
217
|
-
</div>
|
|
218
|
-
<div className="link-fg" style={{flex: 'none'}}>
|
|
219
|
-
l
|
|
220
|
-
</div>
|
|
221
|
-
<div className="code" style={{flex: 'none'}}>
|
|
222
|
-
c
|
|
223
|
-
</div>
|
|
224
|
-
<div style={{flex: 'none'}}>
|
|
225
|
-
<CheckeredBackground />
|
|
226
|
-
</div>
|
|
227
|
-
<div style={{flex: 'none'}}>
|
|
228
|
-
<Skeleton />
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
<div
|
|
232
|
-
className="card disabled"
|
|
233
|
-
style={{
|
|
234
|
-
flex: 1,
|
|
235
|
-
padding: 'var(--space-2)',
|
|
236
|
-
display: 'flex',
|
|
237
|
-
gap: 4,
|
|
238
|
-
}}
|
|
239
|
-
>
|
|
240
|
-
<div style={{flex: 'none'}}>Card</div>
|
|
241
|
-
<div className="icon" style={{flex: 'none'}}>
|
|
242
|
-
©
|
|
243
|
-
</div>
|
|
244
|
-
<div className="muted-fg" style={{flex: 'none'}}>
|
|
245
|
-
m
|
|
246
|
-
</div>
|
|
247
|
-
<div className="accent-fg" style={{flex: 'none'}}>
|
|
248
|
-
a
|
|
249
|
-
</div>
|
|
250
|
-
<div className="link-fg" style={{flex: 'none'}}>
|
|
251
|
-
l
|
|
252
|
-
</div>
|
|
253
|
-
<div className="code" style={{flex: 'none'}}>
|
|
254
|
-
c
|
|
255
|
-
</div>
|
|
256
|
-
<div style={{flex: 'none'}}>
|
|
257
|
-
<CheckeredBackground />
|
|
258
|
-
</div>
|
|
259
|
-
<div style={{flex: 'none'}}>
|
|
260
|
-
<Skeleton />
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
</div>
|
|
264
|
-
</div>
|
|
265
|
-
)
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function ButtonPreview(props: {theme: ThemeColorButtonTone_v2}) {
|
|
269
|
-
const {theme: button} = props
|
|
270
|
-
|
|
271
|
-
return (
|
|
272
|
-
<div
|
|
273
|
-
style={{
|
|
274
|
-
...getCSSProps({button}),
|
|
275
|
-
|
|
276
|
-
display: 'flex',
|
|
277
|
-
gap: 4,
|
|
278
|
-
}}
|
|
279
|
-
>
|
|
280
|
-
<div
|
|
281
|
-
className="button"
|
|
282
|
-
style={{flex: 1, padding: 'var(--space-2)', display: 'flex', gap: 4}}
|
|
283
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
284
|
-
tabIndex={0}
|
|
285
|
-
>
|
|
286
|
-
<div style={{flex: 'none'}}>Button</div>
|
|
287
|
-
<div className="icon" style={{flex: 'none'}}>
|
|
288
|
-
©
|
|
289
|
-
</div>
|
|
290
|
-
<div className="muted" style={{flex: 'none'}}>
|
|
291
|
-
m
|
|
292
|
-
</div>
|
|
293
|
-
<div className="accent" style={{flex: 'none'}}>
|
|
294
|
-
a
|
|
295
|
-
</div>
|
|
296
|
-
<div className="link" style={{flex: 'none'}}>
|
|
297
|
-
l
|
|
298
|
-
</div>
|
|
299
|
-
<div className="code" style={{flex: 'none'}}>
|
|
300
|
-
c
|
|
301
|
-
</div>
|
|
302
|
-
<div className="kbd" style={{flex: 'none'}}>
|
|
303
|
-
k
|
|
304
|
-
</div>
|
|
305
|
-
<div className="badge badge--default" style={{flex: 'none'}}>
|
|
306
|
-
b
|
|
307
|
-
</div>
|
|
308
|
-
<div style={{flex: 'none'}}>
|
|
309
|
-
<CheckeredBackground />
|
|
310
|
-
</div>
|
|
311
|
-
<div style={{flex: 'none'}}>
|
|
312
|
-
<Skeleton />
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
<div
|
|
316
|
-
className="button selected"
|
|
317
|
-
style={{flex: 1, padding: 'var(--space-2)', display: 'flex', gap: 4}}
|
|
318
|
-
>
|
|
319
|
-
<div style={{flex: 'none'}}>Button</div>
|
|
320
|
-
<div className="icon" style={{flex: 'none'}}>
|
|
321
|
-
©
|
|
322
|
-
</div>
|
|
323
|
-
<div className="muted-fg" style={{flex: 'none'}}>
|
|
324
|
-
m
|
|
325
|
-
</div>
|
|
326
|
-
<div className="accent-fg" style={{flex: 'none'}}>
|
|
327
|
-
a
|
|
328
|
-
</div>
|
|
329
|
-
<div className="link-fg" style={{flex: 'none'}}>
|
|
330
|
-
l
|
|
331
|
-
</div>
|
|
332
|
-
<div className="code" style={{flex: 'none'}}>
|
|
333
|
-
c
|
|
334
|
-
</div>
|
|
335
|
-
<div style={{flex: 'none'}}>
|
|
336
|
-
<CheckeredBackground />
|
|
337
|
-
</div>
|
|
338
|
-
<div style={{flex: 'none'}}>
|
|
339
|
-
<Skeleton />
|
|
340
|
-
</div>
|
|
341
|
-
</div>
|
|
342
|
-
<div
|
|
343
|
-
className="button disabled"
|
|
344
|
-
style={{flex: 1, padding: 'var(--space-2)', display: 'flex', gap: 4}}
|
|
345
|
-
>
|
|
346
|
-
<div style={{flex: 'none'}}>Button</div>
|
|
347
|
-
<div className="icon" style={{flex: 'none'}}>
|
|
348
|
-
©
|
|
349
|
-
</div>
|
|
350
|
-
<div className="muted-fg" style={{flex: 'none'}}>
|
|
351
|
-
m
|
|
352
|
-
</div>
|
|
353
|
-
<div className="accent-fg" style={{flex: 'none'}}>
|
|
354
|
-
a
|
|
355
|
-
</div>
|
|
356
|
-
<div className="link-fg" style={{flex: 'none'}}>
|
|
357
|
-
l
|
|
358
|
-
</div>
|
|
359
|
-
<div className="code" style={{flex: 'none'}}>
|
|
360
|
-
c
|
|
361
|
-
</div>
|
|
362
|
-
<div style={{flex: 'none'}}>
|
|
363
|
-
<CheckeredBackground />
|
|
364
|
-
</div>
|
|
365
|
-
<div style={{flex: 'none'}}>
|
|
366
|
-
<Skeleton />
|
|
367
|
-
</div>
|
|
368
|
-
</div>
|
|
369
|
-
</div>
|
|
370
|
-
)
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function CheckeredBackground() {
|
|
374
|
-
return (
|
|
375
|
-
<div className="border" style={{display: 'flex', flexDirection: 'column'}}>
|
|
376
|
-
<div style={{display: 'flex'}}>
|
|
377
|
-
<div
|
|
378
|
-
style={{
|
|
379
|
-
width: 8,
|
|
380
|
-
height: 8,
|
|
381
|
-
}}
|
|
382
|
-
/>
|
|
383
|
-
<div
|
|
384
|
-
className="bg2"
|
|
385
|
-
style={{
|
|
386
|
-
width: 8,
|
|
387
|
-
height: 8,
|
|
388
|
-
}}
|
|
389
|
-
/>
|
|
390
|
-
</div>
|
|
391
|
-
<div style={{display: 'flex'}}>
|
|
392
|
-
<div
|
|
393
|
-
className="bg2"
|
|
394
|
-
style={{
|
|
395
|
-
width: 8,
|
|
396
|
-
height: 8,
|
|
397
|
-
}}
|
|
398
|
-
/>
|
|
399
|
-
<div
|
|
400
|
-
style={{
|
|
401
|
-
width: 8,
|
|
402
|
-
height: 8,
|
|
403
|
-
}}
|
|
404
|
-
/>
|
|
405
|
-
</div>
|
|
406
|
-
</div>
|
|
407
|
-
)
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
function Skeleton() {
|
|
411
|
-
return (
|
|
412
|
-
<div className="border" style={{display: 'flex'}}>
|
|
413
|
-
<div
|
|
414
|
-
className="skeleton-from"
|
|
415
|
-
style={{
|
|
416
|
-
width: 8,
|
|
417
|
-
height: 16,
|
|
418
|
-
}}
|
|
419
|
-
/>
|
|
420
|
-
<div
|
|
421
|
-
className="skeleton-to"
|
|
422
|
-
style={{
|
|
423
|
-
width: 8,
|
|
424
|
-
height: 16,
|
|
425
|
-
}}
|
|
426
|
-
/>
|
|
427
|
-
</div>
|
|
428
|
-
)
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
function InputPreview(props: {mode: ThemeColorInputModeKey; theme: ThemeColorInputMode_v2}) {
|
|
432
|
-
const {mode, theme: input} = props
|
|
433
|
-
|
|
434
|
-
return (
|
|
435
|
-
<div
|
|
436
|
-
style={
|
|
437
|
-
{
|
|
438
|
-
...getCSSProps({input}),
|
|
439
|
-
|
|
440
|
-
display: 'flex',
|
|
441
|
-
flexDirection: 'column',
|
|
442
|
-
gap: 8,
|
|
443
|
-
} as any
|
|
444
|
-
}
|
|
445
|
-
>
|
|
446
|
-
<div
|
|
447
|
-
className="input"
|
|
448
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
449
|
-
tabIndex={0}
|
|
450
|
-
>
|
|
451
|
-
<span>Text ({mode})</span> <span className="placeholder">Placeholder</span>
|
|
452
|
-
</div>
|
|
453
|
-
<div
|
|
454
|
-
className="input readOnly"
|
|
455
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
456
|
-
tabIndex={0}
|
|
457
|
-
>
|
|
458
|
-
<span>Text ({mode})</span>
|
|
459
|
-
</div>
|
|
460
|
-
<div className="input disabled">
|
|
461
|
-
<span>Text ({mode})</span>
|
|
462
|
-
</div>
|
|
463
|
-
</div>
|
|
464
|
-
)
|
|
465
|
-
}
|