@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,30 +0,0 @@
|
|
|
1
|
-
import {Card, Flex, Stack, Text} from '@sanity/ui'
|
|
2
|
-
import {useBoolean} from '@sanity/ui-workshop'
|
|
3
|
-
|
|
4
|
-
export default function InteractiveCardStory() {
|
|
5
|
-
const pressed = useBoolean('Pressed', false, 'Props')
|
|
6
|
-
const selected = useBoolean('Selected', false, 'Props')
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<Flex align="center" height="fill" justify="center">
|
|
10
|
-
<div>
|
|
11
|
-
<Card
|
|
12
|
-
__unstable_focusRing
|
|
13
|
-
as="button"
|
|
14
|
-
padding={3}
|
|
15
|
-
pressed={pressed}
|
|
16
|
-
selected={selected}
|
|
17
|
-
tabIndex={0}
|
|
18
|
-
>
|
|
19
|
-
<Stack space={3}>
|
|
20
|
-
<Text>
|
|
21
|
-
Text <code>Code</code>
|
|
22
|
-
</Text>
|
|
23
|
-
<Text muted>Muted</Text>
|
|
24
|
-
<Text accent>Accent</Text>
|
|
25
|
-
</Stack>
|
|
26
|
-
</Card>
|
|
27
|
-
</div>
|
|
28
|
-
</Flex>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {Box, Card, Flex, Skeleton, Text} from '@sanity/ui'
|
|
2
|
-
|
|
3
|
-
import {Stack} from '../../stack'
|
|
4
|
-
|
|
5
|
-
export default function ListNavigationStory() {
|
|
6
|
-
return (
|
|
7
|
-
<Box height="fill" padding={[3, 4, 5]} sizing="border">
|
|
8
|
-
<Card height="fill" shadow={1}>
|
|
9
|
-
<Flex height="fill">
|
|
10
|
-
<Card flex={1} padding={2}>
|
|
11
|
-
<List1 />
|
|
12
|
-
</Card>
|
|
13
|
-
<Card borderLeft flex={1} padding={2}>
|
|
14
|
-
<List2 />
|
|
15
|
-
</Card>
|
|
16
|
-
</Flex>
|
|
17
|
-
</Card>
|
|
18
|
-
</Box>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function List1() {
|
|
23
|
-
return (
|
|
24
|
-
<Stack space={1}>
|
|
25
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
26
|
-
<Preview />
|
|
27
|
-
</Card>
|
|
28
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} pressed radius={2}>
|
|
29
|
-
<Preview />
|
|
30
|
-
</Card>
|
|
31
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
32
|
-
<Preview />
|
|
33
|
-
</Card>
|
|
34
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
35
|
-
<Preview />
|
|
36
|
-
</Card>
|
|
37
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
38
|
-
<Preview />
|
|
39
|
-
</Card>
|
|
40
|
-
</Stack>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function List2() {
|
|
45
|
-
return (
|
|
46
|
-
<Stack space={1}>
|
|
47
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
48
|
-
<Preview />
|
|
49
|
-
</Card>
|
|
50
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} pressed radius={2} selected>
|
|
51
|
-
<Preview />
|
|
52
|
-
</Card>
|
|
53
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
54
|
-
<Preview />
|
|
55
|
-
</Card>
|
|
56
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
57
|
-
<Preview />
|
|
58
|
-
</Card>
|
|
59
|
-
<Card __unstable_focusRing as="a" href="#" padding={2} radius={2}>
|
|
60
|
-
<Preview />
|
|
61
|
-
</Card>
|
|
62
|
-
</Stack>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function Preview() {
|
|
67
|
-
return (
|
|
68
|
-
<Flex align="center" gap={2}>
|
|
69
|
-
<Skeleton radius="full" style={{width: 33, height: 33}} />
|
|
70
|
-
<Stack flex={1} space={2}>
|
|
71
|
-
<Text size={1} weight="medium">
|
|
72
|
-
Preview
|
|
73
|
-
</Text>
|
|
74
|
-
<Text muted size={1}>
|
|
75
|
-
Preview
|
|
76
|
-
</Text>
|
|
77
|
-
</Stack>
|
|
78
|
-
</Flex>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {Card, Flex, Stack, Text} from '@sanity/ui'
|
|
2
|
-
import {useAction, useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
WORKSHOP_CARD_AS_OPTIONS,
|
|
6
|
-
WORKSHOP_CARD_TONE_OPTIONS,
|
|
7
|
-
WORKSHOP_RADIUS_OPTIONS,
|
|
8
|
-
WORKSHOP_SHADOW_OPTIONS,
|
|
9
|
-
WORKSHOP_SPACE_OPTIONS,
|
|
10
|
-
} from '../../../__workshop__/constants'
|
|
11
|
-
|
|
12
|
-
export default function PropsStory() {
|
|
13
|
-
const as = useSelect('As', WORKSHOP_CARD_AS_OPTIONS, 'div', 'Props')
|
|
14
|
-
const border = useBoolean('Border', false, 'Props')
|
|
15
|
-
const checkered = useBoolean('Checkered', false, 'Props')
|
|
16
|
-
const muted = useBoolean('Muted', false, 'Props')
|
|
17
|
-
const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3, 'Props')
|
|
18
|
-
const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 0, 'Props')
|
|
19
|
-
const selected = useBoolean('Selected', false, 'Props')
|
|
20
|
-
const shadow = useSelect('Shadow', WORKSHOP_SHADOW_OPTIONS, 0, 'Props')
|
|
21
|
-
const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS, 'default', 'Props')
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
25
|
-
<Card
|
|
26
|
-
__unstable_checkered={checkered}
|
|
27
|
-
as={as}
|
|
28
|
-
border={border}
|
|
29
|
-
muted={muted}
|
|
30
|
-
onClick={useAction('onClick')}
|
|
31
|
-
padding={padding}
|
|
32
|
-
radius={radius}
|
|
33
|
-
selected={selected}
|
|
34
|
-
shadow={shadow}
|
|
35
|
-
tone={tone}
|
|
36
|
-
>
|
|
37
|
-
<Stack space={3}>
|
|
38
|
-
<Text size={1}>
|
|
39
|
-
Card with <code>padding={padding}</code>, <code>tone={tone}</code>, and{' '}
|
|
40
|
-
<code>shadow={shadow}</code>.
|
|
41
|
-
</Text>
|
|
42
|
-
<Text size={1}>
|
|
43
|
-
Text with {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
44
|
-
<a href="#">link</a>.
|
|
45
|
-
</Text>
|
|
46
|
-
<Text accent size={1}>
|
|
47
|
-
Text with accent color.
|
|
48
|
-
</Text>
|
|
49
|
-
</Stack>
|
|
50
|
-
</Card>
|
|
51
|
-
</Flex>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {EditIcon, PublishIcon} from '@sanity/icons'
|
|
2
|
-
import {Box, Card, Container, Flex, Inline, Stack, Text, ThemeProps, useRootTheme} from '@sanity/ui'
|
|
3
|
-
import {getTheme_v2, ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
4
|
-
import {useBoolean} from '@sanity/ui-workshop'
|
|
5
|
-
import {css, styled} from 'styled-components'
|
|
6
|
-
|
|
7
|
-
const TextWithTone = styled(Text)<{$tone: ThemeColorStateToneKey}>((
|
|
8
|
-
props: {
|
|
9
|
-
$tone: ThemeColorStateToneKey
|
|
10
|
-
} & ThemeProps,
|
|
11
|
-
) => {
|
|
12
|
-
const {$tone} = props
|
|
13
|
-
const {color} = getTheme_v2(props.theme)
|
|
14
|
-
const tone = color.button.default[$tone]
|
|
15
|
-
|
|
16
|
-
return css`
|
|
17
|
-
&:not([data-selected]) {
|
|
18
|
-
--card-fg-color: ${tone.enabled.bg};
|
|
19
|
-
--card-muted-fg-color: ${tone.enabled.bg};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[data-ui='Card']:disabled & {
|
|
23
|
-
--card-fg-color: inherit;
|
|
24
|
-
--card-muted-fg-color: inherit;
|
|
25
|
-
}
|
|
26
|
-
`
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
export default function SelectedStory() {
|
|
30
|
-
const disabled = useBoolean('Disabled', false) || false
|
|
31
|
-
const selected = useBoolean('Selected', false) || false
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
35
|
-
<Container width={0}>
|
|
36
|
-
<Stack space={1}>
|
|
37
|
-
<Card
|
|
38
|
-
__unstable_focusRing
|
|
39
|
-
as="button"
|
|
40
|
-
disabled={disabled}
|
|
41
|
-
padding={3}
|
|
42
|
-
radius={2}
|
|
43
|
-
selected={selected}
|
|
44
|
-
>
|
|
45
|
-
<Preview selected={selected} />
|
|
46
|
-
</Card>
|
|
47
|
-
|
|
48
|
-
<Card
|
|
49
|
-
__unstable_focusRing
|
|
50
|
-
as="button"
|
|
51
|
-
disabled={disabled}
|
|
52
|
-
padding={3}
|
|
53
|
-
radius={2}
|
|
54
|
-
selected={selected}
|
|
55
|
-
tone="critical"
|
|
56
|
-
>
|
|
57
|
-
<Preview selected={selected} />
|
|
58
|
-
</Card>
|
|
59
|
-
</Stack>
|
|
60
|
-
</Container>
|
|
61
|
-
</Flex>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function Preview({selected}: {selected: boolean}) {
|
|
66
|
-
const rootTheme = useRootTheme()
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<Flex>
|
|
70
|
-
<Box flex={1}>
|
|
71
|
-
<Text size={1}>Title</Text>
|
|
72
|
-
</Box>
|
|
73
|
-
<Inline space={3}>
|
|
74
|
-
<TextWithTone
|
|
75
|
-
data-selected={selected ? '' : undefined}
|
|
76
|
-
muted
|
|
77
|
-
size={1}
|
|
78
|
-
weight="medium"
|
|
79
|
-
$tone={rootTheme.tone === 'default' ? 'caution' : 'default'}
|
|
80
|
-
>
|
|
81
|
-
<EditIcon />
|
|
82
|
-
</TextWithTone>
|
|
83
|
-
<TextWithTone
|
|
84
|
-
data-selected={selected ? '' : undefined}
|
|
85
|
-
muted
|
|
86
|
-
size={1}
|
|
87
|
-
$tone={rootTheme.tone === 'default' ? 'positive' : 'default'}
|
|
88
|
-
>
|
|
89
|
-
<PublishIcon />
|
|
90
|
-
</TextWithTone>
|
|
91
|
-
</Inline>
|
|
92
|
-
</Flex>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {Card, Flex, Text} from '@sanity/ui'
|
|
2
|
-
import {styled} from 'styled-components'
|
|
3
|
-
|
|
4
|
-
const StyledCard = styled(Card).attrs({forwardedAs: 'ol'})``
|
|
5
|
-
|
|
6
|
-
export default function StyledCardStory() {
|
|
7
|
-
return (
|
|
8
|
-
<Flex align="center" height="fill" justify="center">
|
|
9
|
-
<StyledCard>
|
|
10
|
-
<Text as="li">Styled</Text>
|
|
11
|
-
</StyledCard>
|
|
12
|
-
</Flex>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {Box, Checkbox, Flex, Text} from '@sanity/ui'
|
|
2
|
-
import {useCallback, useState} from 'react'
|
|
3
|
-
|
|
4
|
-
export default function ExampleStory() {
|
|
5
|
-
const [checked, setChecked] = useState<boolean | undefined>(undefined)
|
|
6
|
-
const [indeterminate] = useState(checked === undefined)
|
|
7
|
-
const handleChange = useCallback(() => setChecked((val) => !val), [])
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
11
|
-
<Flex align="center" as="label">
|
|
12
|
-
<Checkbox
|
|
13
|
-
checked={checked || false}
|
|
14
|
-
indeterminate={indeterminate}
|
|
15
|
-
onChange={handleChange}
|
|
16
|
-
/>
|
|
17
|
-
<Box marginLeft={2}>
|
|
18
|
-
<Text size={1} weight="medium">
|
|
19
|
-
Toggle
|
|
20
|
-
</Text>
|
|
21
|
-
</Box>
|
|
22
|
-
</Flex>
|
|
23
|
-
</Flex>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {defineScope} from '@sanity/ui-workshop'
|
|
2
|
-
import {lazy} from 'react'
|
|
3
|
-
|
|
4
|
-
export default defineScope({
|
|
5
|
-
name: 'primitives/checkbox',
|
|
6
|
-
title: 'Checkbox',
|
|
7
|
-
stories: [
|
|
8
|
-
{name: 'props', title: 'Props', component: lazy(() => import('./props'))},
|
|
9
|
-
{name: 'example', title: 'Example', component: lazy(() => import('./example'))},
|
|
10
|
-
{name: 'read-only', title: 'Read-only', component: lazy(() => import('./readOnly'))},
|
|
11
|
-
{name: 'multiple-tones', title: 'Multiple tones', component: lazy(() => import('./tones'))},
|
|
12
|
-
],
|
|
13
|
-
})
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {Box, Checkbox, Flex, Text} from '@sanity/ui'
|
|
2
|
-
import {useAction, useBoolean} from '@sanity/ui-workshop'
|
|
3
|
-
|
|
4
|
-
export default function PropsStory() {
|
|
5
|
-
const checked = useBoolean('Checked', false, 'Props')
|
|
6
|
-
const disabled = useBoolean('Disabled', false, 'Props')
|
|
7
|
-
const indeterminate = useBoolean('Indeterminate', false, 'Props')
|
|
8
|
-
const onChange = useAction('onChange')
|
|
9
|
-
const onFocus = useAction('onFocus')
|
|
10
|
-
const onBlur = useAction('onBlur')
|
|
11
|
-
const readOnly = useBoolean('Read only', false, 'Props')
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
15
|
-
<Flex align="center" as="label">
|
|
16
|
-
<Checkbox
|
|
17
|
-
checked={checked}
|
|
18
|
-
disabled={disabled}
|
|
19
|
-
indeterminate={indeterminate}
|
|
20
|
-
onChange={onChange}
|
|
21
|
-
onFocus={onFocus}
|
|
22
|
-
onBlur={onBlur}
|
|
23
|
-
readOnly={readOnly}
|
|
24
|
-
/>
|
|
25
|
-
<Box marginLeft={2}>
|
|
26
|
-
<Text size={1} weight="medium">
|
|
27
|
-
Toggle
|
|
28
|
-
</Text>
|
|
29
|
-
</Box>
|
|
30
|
-
</Flex>
|
|
31
|
-
</Flex>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {Box, Checkbox, Flex, Text} from '@sanity/ui'
|
|
2
|
-
|
|
3
|
-
export default function ReadOnlyStory() {
|
|
4
|
-
return (
|
|
5
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
6
|
-
<Flex align="center" as="label">
|
|
7
|
-
<Checkbox id="checkbox-example" readOnly />
|
|
8
|
-
<Box marginLeft={2}>
|
|
9
|
-
<Text size={1} weight="medium">
|
|
10
|
-
Toggle
|
|
11
|
-
</Text>
|
|
12
|
-
</Box>
|
|
13
|
-
</Flex>
|
|
14
|
-
</Flex>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {Card, Checkbox, Flex, Stack} from '@sanity/ui'
|
|
2
|
-
|
|
3
|
-
export default function MultipleTonesStory() {
|
|
4
|
-
return (
|
|
5
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
6
|
-
<Stack>
|
|
7
|
-
<Card padding={3} tone="neutral">
|
|
8
|
-
<Checkbox />
|
|
9
|
-
</Card>
|
|
10
|
-
<Card padding={3} tone="primary">
|
|
11
|
-
<Checkbox />
|
|
12
|
-
</Card>
|
|
13
|
-
<Card padding={3} tone="suggest">
|
|
14
|
-
<Checkbox />
|
|
15
|
-
</Card>
|
|
16
|
-
<Card padding={3} tone="positive">
|
|
17
|
-
<Checkbox />
|
|
18
|
-
</Card>
|
|
19
|
-
<Card padding={3} tone="caution">
|
|
20
|
-
<Checkbox />
|
|
21
|
-
</Card>
|
|
22
|
-
<Card padding={3} tone="critical">
|
|
23
|
-
<Checkbox />
|
|
24
|
-
</Card>
|
|
25
|
-
</Stack>
|
|
26
|
-
</Flex>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {defineScope} from '@sanity/ui-workshop'
|
|
2
|
-
import {lazy} from 'react'
|
|
3
|
-
|
|
4
|
-
export default defineScope({
|
|
5
|
-
name: 'primitives/code',
|
|
6
|
-
title: 'Code',
|
|
7
|
-
stories: [
|
|
8
|
-
{
|
|
9
|
-
name: 'props',
|
|
10
|
-
title: 'Props',
|
|
11
|
-
component: lazy(() => import('./props')),
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'optical-alignment',
|
|
15
|
-
title: 'Optical alignment',
|
|
16
|
-
component: lazy(() => import('./opticalAlignment')),
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
})
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {AddCircleIcon} from '@sanity/icons'
|
|
2
|
-
import {Box, Card, Code, Flex, Stack} from '@sanity/ui'
|
|
3
|
-
|
|
4
|
-
export default function OpticalAlignment() {
|
|
5
|
-
return (
|
|
6
|
-
<Box padding={[4, 5, 6]}>
|
|
7
|
-
<Stack space={1}>
|
|
8
|
-
<Flex>
|
|
9
|
-
<Card padding={0} scheme="dark">
|
|
10
|
-
<Code size={4}>Hamburgefonstiv M</Code>
|
|
11
|
-
</Card>
|
|
12
|
-
</Flex>
|
|
13
|
-
|
|
14
|
-
<Flex>
|
|
15
|
-
<Card padding={0} scheme="dark">
|
|
16
|
-
<Code size={3}>Hamburgefonstiv M</Code>
|
|
17
|
-
</Card>
|
|
18
|
-
</Flex>
|
|
19
|
-
|
|
20
|
-
<Flex>
|
|
21
|
-
<Card padding={0} scheme="dark">
|
|
22
|
-
<Code size={2}>Hamburgefonstiv M</Code>
|
|
23
|
-
</Card>
|
|
24
|
-
</Flex>
|
|
25
|
-
|
|
26
|
-
<Flex>
|
|
27
|
-
<Card padding={0} scheme="dark">
|
|
28
|
-
<Code size={1}>Hamburgefonstiv M</Code>
|
|
29
|
-
</Card>
|
|
30
|
-
</Flex>
|
|
31
|
-
|
|
32
|
-
<Flex>
|
|
33
|
-
<Card padding={0} scheme="dark">
|
|
34
|
-
<Code size={0}>Hamburgefonstiv M</Code>
|
|
35
|
-
</Card>
|
|
36
|
-
</Flex>
|
|
37
|
-
|
|
38
|
-
<Flex>
|
|
39
|
-
<Card padding={2} scheme="dark">
|
|
40
|
-
<Code>
|
|
41
|
-
<AddCircleIcon />
|
|
42
|
-
</Code>
|
|
43
|
-
</Card>
|
|
44
|
-
</Flex>
|
|
45
|
-
</Stack>
|
|
46
|
-
</Box>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {Box, Code} from '@sanity/ui'
|
|
2
|
-
import {useSelect, useText} from '@sanity/ui-workshop'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
WORKSHOP_CODE_LANGUAGE_OPTIONS,
|
|
6
|
-
WORKSHOP_TEXT_FONT_SIZE_OPTIONS,
|
|
7
|
-
} from '../../../__workshop__/constants'
|
|
8
|
-
|
|
9
|
-
export default function PropsStory() {
|
|
10
|
-
const code = useText('Code', `console.log('Hello, world')`, 'Props')
|
|
11
|
-
const language = useSelect('Language', WORKSHOP_CODE_LANGUAGE_OPTIONS, 'typescript', 'Props')
|
|
12
|
-
const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 1, 'Props')
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Box padding={[4, 5, 6]}>
|
|
16
|
-
<Code language={language} size={size}>
|
|
17
|
-
{code}
|
|
18
|
-
</Code>
|
|
19
|
-
</Box>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {Card, Container, Flex, Text} from '@sanity/ui'
|
|
2
|
-
import {useAction, useSelect} from '@sanity/ui-workshop'
|
|
3
|
-
|
|
4
|
-
import {WORKSHOP_CONTAINER_WIDTH_OPTIONS} from '../../../__workshop__/constants'
|
|
5
|
-
|
|
6
|
-
export default function PlainStory() {
|
|
7
|
-
const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 0, 'Props')
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
11
|
-
<Container onClick={useAction('onClick')} width={width}>
|
|
12
|
-
<Card padding={4} shadow={1}>
|
|
13
|
-
<Text size={1}>
|
|
14
|
-
Container with <code>max-width={width}</code>
|
|
15
|
-
</Text>
|
|
16
|
-
</Card>
|
|
17
|
-
</Container>
|
|
18
|
-
</Flex>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {Card, Code, Flex} from '@sanity/ui'
|
|
2
|
-
import {useSelect} from '@sanity/ui-workshop'
|
|
3
|
-
import {styled} from 'styled-components'
|
|
4
|
-
|
|
5
|
-
import {WORKSHOP_FLEX_DIRECTION_OPTIONS} from '../../../__workshop__/constants'
|
|
6
|
-
|
|
7
|
-
const DebugCard = styled(Card)`
|
|
8
|
-
outline: 1px solid red;
|
|
9
|
-
&:not([hidden]) {
|
|
10
|
-
display: flex;
|
|
11
|
-
}
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
`
|
|
15
|
-
|
|
16
|
-
export default function ExampleStory() {
|
|
17
|
-
const direction = useSelect('Direction', WORKSHOP_FLEX_DIRECTION_OPTIONS, 'row', 'Props')
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Flex direction={direction} height="fill" style={{width: '100%'}}>
|
|
21
|
-
<DebugCard flex={1}>
|
|
22
|
-
<Code size={1}>1</Code>
|
|
23
|
-
</DebugCard>
|
|
24
|
-
|
|
25
|
-
<DebugCard flex={[1, 2, 3]}>
|
|
26
|
-
<Code size={1}>[1,2,3]</Code>
|
|
27
|
-
</DebugCard>
|
|
28
|
-
|
|
29
|
-
<DebugCard flex={['none', 'none', 1]}>
|
|
30
|
-
<Code size={1}>['none', 'none', 1]</Code>
|
|
31
|
-
</DebugCard>
|
|
32
|
-
</Flex>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {Card, Flex, Text} from '@sanity/ui'
|
|
2
|
-
|
|
3
|
-
export default function GapStory() {
|
|
4
|
-
return (
|
|
5
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
6
|
-
<Flex align="center" gap={[2, 3, 4]} justify="center" wrap="wrap">
|
|
7
|
-
<Card padding={3} scheme="dark">
|
|
8
|
-
<Text size={0}>Card 0</Text>
|
|
9
|
-
</Card>
|
|
10
|
-
<Card padding={3} scheme="dark">
|
|
11
|
-
<Text size={1}>Card 1</Text>
|
|
12
|
-
</Card>
|
|
13
|
-
<Card padding={3} scheme="dark">
|
|
14
|
-
<Text size={2}>Card 2</Text>
|
|
15
|
-
</Card>
|
|
16
|
-
<Card padding={3} scheme="dark">
|
|
17
|
-
<Text size={3}>Card 3</Text>
|
|
18
|
-
</Card>
|
|
19
|
-
<Card padding={3} scheme="dark">
|
|
20
|
-
<Text size={4}>Card 4</Text>
|
|
21
|
-
</Card>
|
|
22
|
-
</Flex>
|
|
23
|
-
</Flex>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {defineScope} from '@sanity/ui-workshop'
|
|
2
|
-
import {lazy} from 'react'
|
|
3
|
-
|
|
4
|
-
export default defineScope({
|
|
5
|
-
name: 'primitives/flex',
|
|
6
|
-
title: 'Flex',
|
|
7
|
-
stories: [
|
|
8
|
-
{name: 'plain', title: 'Plain', component: lazy(() => import('./example'))},
|
|
9
|
-
{name: 'gap', title: 'Gap', component: lazy(() => import('./gap'))},
|
|
10
|
-
],
|
|
11
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import {defineScope} from '@sanity/ui-workshop'
|
|
2
|
-
import {lazy} from 'react'
|
|
3
|
-
|
|
4
|
-
export default defineScope({
|
|
5
|
-
name: 'primitives/grid',
|
|
6
|
-
title: 'Grid',
|
|
7
|
-
stories: [
|
|
8
|
-
{name: 'responsive', title: 'Responsive', component: lazy(() => import('./responsive'))},
|
|
9
|
-
],
|
|
10
|
-
})
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {Card, Code, Container, Flex, Grid} from '@sanity/ui'
|
|
2
|
-
|
|
3
|
-
export default function ResponsiveStory() {
|
|
4
|
-
return (
|
|
5
|
-
<Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
|
|
6
|
-
<Container width="auto">
|
|
7
|
-
<Grid
|
|
8
|
-
id="responsive-grid"
|
|
9
|
-
columns={[1, 2, 3, 4, 5, 6, 7]}
|
|
10
|
-
gap={[0, 1, 2, 3, 4, 5, 6]}
|
|
11
|
-
rows={[1, 2, 3, 4, 5, 6, 7]}
|
|
12
|
-
style={{textAlign: 'center'}}
|
|
13
|
-
>
|
|
14
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
15
|
-
<Code>1</Code>
|
|
16
|
-
</Card>
|
|
17
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
18
|
-
<Code>2</Code>
|
|
19
|
-
</Card>
|
|
20
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
21
|
-
<Code>3</Code>
|
|
22
|
-
</Card>
|
|
23
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
24
|
-
<Code>4</Code>
|
|
25
|
-
</Card>
|
|
26
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
27
|
-
<Code>5</Code>
|
|
28
|
-
</Card>
|
|
29
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
30
|
-
<Code>6</Code>
|
|
31
|
-
</Card>
|
|
32
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
33
|
-
<Code>7</Code>
|
|
34
|
-
</Card>
|
|
35
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
36
|
-
<Code>8</Code>
|
|
37
|
-
</Card>
|
|
38
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
39
|
-
<Code>9</Code>
|
|
40
|
-
</Card>
|
|
41
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
42
|
-
<Code>10</Code>
|
|
43
|
-
</Card>
|
|
44
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
45
|
-
<Code>11</Code>
|
|
46
|
-
</Card>
|
|
47
|
-
<Card padding={[1, 2, 3]} tone="neutral">
|
|
48
|
-
<Code>12</Code>
|
|
49
|
-
</Card>
|
|
50
|
-
</Grid>
|
|
51
|
-
</Container>
|
|
52
|
-
</Flex>
|
|
53
|
-
)
|
|
54
|
-
}
|