@sanity/ui 2.0.0-alpha.9 → 2.0.0-beta.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/dist/index.cjs.mjs +38 -13
- package/dist/index.d.ts +500 -600
- package/dist/index.esm.js +1243 -6208
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1525 -6286
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +54 -0
- package/dist/theme.d.ts +1528 -0
- package/dist/theme.esm.js +4345 -0
- package/dist/theme.esm.js.map +1 -0
- package/dist/theme.js +4400 -0
- package/dist/theme.js.map +1 -0
- package/exports/index.ts +1 -0
- package/exports/theme.ts +1 -0
- package/package.json +89 -68
- package/src/{__workshop__ → core/__workshop__}/constants.ts +4 -5
- package/src/core/__workshop__/fontsPlugin.tsx +36 -0
- package/src/core/_compat.ts +115 -0
- package/src/{components → core/components}/autocomplete/__workshop__/async.tsx +4 -5
- package/src/{components → core/components}/autocomplete/__workshop__/constrainedHeight.tsx +27 -22
- package/src/{components → core/components}/autocomplete/__workshop__/custom.tsx +36 -31
- package/src/{components → core/components}/autocomplete/__workshop__/example.tsx +2 -2
- package/src/{components → core/components}/autocomplete/__workshop__/focusAndBlur.tsx +5 -3
- package/src/{components → core/components}/autocomplete/autocomplete.tsx +7 -1
- package/src/{components → core/components}/dialog/__workshop__/activate.tsx +0 -1
- package/src/{components → core/components}/dialog/__workshop__/layering.tsx +5 -1
- package/src/{components → core/components}/dialog/__workshop__/panes.tsx +2 -7
- package/src/{components → core/components}/dialog/dialog.tsx +34 -96
- package/src/core/components/dialog/styles.ts +76 -0
- package/src/{components → core/components}/hotkeys/hotkeys.tsx +6 -2
- package/src/{components → core/components}/menu/__workshop__/asComponent.tsx +4 -4
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +50 -0
- package/src/{components → core/components}/menu/__workshop__/closableMenuButton.tsx +2 -2
- package/src/{components → core/components}/menu/__workshop__/customMenuItem.tsx +9 -3
- package/src/{components → core/components}/menu/__workshop__/disableFocusOnClose.tsx +2 -2
- package/src/{components → core/components}/menu/__workshop__/index.ts +5 -0
- package/src/{components → core/components}/menu/__workshop__/menuButton.tsx +1 -1
- package/src/{components → core/components}/menu/menu.test.tsx +1 -1
- package/src/{components → core/components}/menu/menu.tsx +2 -0
- package/src/{components → core/components}/menu/menuButton.tsx +3 -1
- package/src/{components → core/components}/menu/menuDivider.ts +1 -2
- package/src/{components → core/components}/menu/menuGroup.tsx +2 -2
- package/src/{components → core/components}/menu/menuItem.tsx +11 -5
- package/src/{components → core/components}/skeleton/styles.ts +7 -8
- package/src/{components → core/components}/skeleton/textSkeleton.tsx +12 -14
- package/src/{components → core/components}/tab/tab.tsx +4 -2
- package/src/{components → core/components}/toast/toast.test.tsx +1 -1
- package/src/{components → core/components}/toast/toast.tsx +13 -4
- package/src/{components → core/components}/tree/__workshop__/tabFromElement.tsx +1 -1
- package/src/{components → core/components}/tree/style.ts +23 -25
- package/src/{components → core/components}/tree/treeItem.tsx +3 -3
- package/src/{constants.ts → core/constants.ts} +1 -0
- package/src/{hooks → core/hooks}/useElementRect/__workshop__/example.tsx +3 -1
- package/src/{hooks → core/hooks}/useMediaIndex/__workshop__/test.tsx +1 -1
- package/src/{hooks → core/hooks}/useMediaIndex/useMediaIndex.test.tsx +4 -3
- package/src/{hooks → core/hooks}/useMediaIndex/useMediaIndex.ts +2 -3
- package/src/{index.ts → core/index.ts} +2 -0
- package/src/{lib → core/lib}/isRecord.ts +1 -1
- package/src/{primitives → core/primitives}/_selectable/style.ts +24 -26
- package/src/{primitives → core/primitives}/avatar/__workshop__/asButton.tsx +1 -1
- package/src/{primitives → core/primitives}/avatar/__workshop__/stack.tsx +1 -1
- package/src/{primitives → core/primitives}/avatar/avatar.tsx +49 -30
- package/src/{primitives → core/primitives}/avatar/avatarCounter.tsx +25 -15
- package/src/{primitives → core/primitives}/avatar/avatarStack.tsx +4 -4
- package/src/{primitives → core/primitives}/avatar/styles.ts +21 -12
- package/src/{primitives → core/primitives}/avatar/types.ts +2 -15
- package/src/{primitives → core/primitives}/badge/__workshop__/props.tsx +1 -1
- package/src/{primitives → core/primitives}/badge/__workshop__/tones.tsx +1 -1
- package/src/{primitives → core/primitives}/badge/badge.test.tsx +1 -1
- package/src/{primitives → core/primitives}/badge/badge.tsx +6 -3
- package/src/core/primitives/badge/styles.ts +19 -0
- package/src/{primitives → core/primitives}/badge/types.ts +1 -2
- package/src/{primitives → core/primitives}/box/__workshop__/responsive.tsx +2 -2
- package/src/{primitives → core/primitives}/box/box.tsx +3 -0
- package/src/{primitives → core/primitives}/button/__workshop__/sanityUploadButton.tsx +2 -1
- package/src/{primitives → core/primitives}/button/__workshop__/stacked.tsx +1 -1
- package/src/{primitives → core/primitives}/button/button.test.tsx +1 -1
- package/src/{primitives → core/primitives}/button/button.tsx +12 -9
- package/src/core/primitives/button/styles.ts +116 -0
- package/src/{primitives → core/primitives}/card/__workshop__/asButton.tsx +6 -6
- package/src/{primitives → core/primitives}/card/__workshop__/asComponent.tsx +1 -1
- package/src/{primitives → core/primitives}/card/__workshop__/selected.tsx +18 -27
- package/src/{primitives → core/primitives}/card/card.tsx +12 -43
- package/src/{primitives → core/primitives}/card/styles.ts +31 -45
- package/src/{primitives → core/primitives}/card/types.ts +1 -3
- package/src/{primitives → core/primitives}/checkbox/__workshop__/example.tsx +1 -1
- package/src/{primitives → core/primitives}/checkbox/__workshop__/props.tsx +1 -1
- package/src/{primitives → core/primitives}/checkbox/__workshop__/readOnly.tsx +1 -1
- package/src/{primitives → core/primitives}/checkbox/checkbox.tsx +2 -0
- package/src/{primitives → core/primitives}/checkbox/styles.ts +23 -23
- package/src/{primitives → core/primitives}/code/code.tsx +4 -15
- package/src/core/primitives/code/styles.ts +77 -0
- package/src/{primitives → core/primitives}/container/container.tsx +2 -0
- package/src/{primitives → core/primitives}/container/styles.ts +2 -3
- package/src/{primitives → core/primitives}/flex/flex.tsx +2 -1
- package/src/{primitives → core/primitives}/grid/grid.tsx +2 -0
- package/src/{primitives → core/primitives}/heading/heading.tsx +3 -1
- package/src/{primitives → core/primitives}/heading/styles.ts +9 -8
- package/src/{primitives → core/primitives}/inline/inline.tsx +3 -0
- package/src/{primitives → core/primitives}/inline/styles.ts +6 -6
- package/src/{primitives → core/primitives}/kbd/kbd.tsx +10 -4
- package/src/{primitives → core/primitives}/label/label.tsx +3 -1
- package/src/{primitives → core/primitives}/label/styles.ts +6 -6
- package/src/{primitives → core/primitives}/popover/__workshop__/RecursiveStory.tsx +2 -9
- package/src/{primitives → core/primitives}/popover/__workshop__/TestStory.tsx +6 -3
- package/src/{primitives → core/primitives}/popover/constants.ts +3 -2
- package/src/{primitives → core/primitives}/popover/helpers.ts +3 -4
- package/src/{primitives → core/primitives}/popover/popover.tsx +19 -11
- package/src/{primitives → core/primitives}/popover/popoverCard.tsx +24 -22
- package/src/{primitives → core/primitives}/popover/types.ts +1 -1
- package/src/{primitives → core/primitives}/radio/radio.tsx +2 -0
- package/src/{primitives → core/primitives}/radio/styles.ts +17 -19
- package/src/{primitives → core/primitives}/select/select.tsx +4 -2
- package/src/{primitives → core/primitives}/select/styles.ts +32 -33
- package/src/{primitives → core/primitives}/spinner/spinner.tsx +2 -0
- package/src/{primitives → core/primitives}/stack/stack.tsx +2 -0
- package/src/{primitives → core/primitives}/stack/styles.ts +2 -3
- package/src/{primitives → core/primitives}/switch/__workshop__/example.tsx +1 -1
- package/src/core/primitives/switch/__workshop__/props.tsx +21 -0
- package/src/{primitives → core/primitives}/switch/styles.ts +18 -21
- package/src/{primitives → core/primitives}/switch/switch.tsx +4 -0
- package/src/core/primitives/text/__workshop__/colored.tsx +29 -0
- package/src/{primitives → core/primitives}/text/styles.ts +18 -14
- package/src/{primitives → core/primitives}/text/text.tsx +4 -1
- package/src/{primitives → core/primitives}/textArea/__workshop__/plain.tsx +1 -1
- package/src/{primitives → core/primitives}/textArea/textArea.tsx +15 -7
- package/src/{primitives → core/primitives}/textInput/__workshop__/plain.tsx +1 -1
- package/src/{primitives → core/primitives}/textInput/__workshop__/states.tsx +3 -3
- package/src/{primitives → core/primitives}/textInput/textInput.tsx +22 -12
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +99 -0
- package/src/core/primitives/tooltip/__workshop__/index.ts +29 -0
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +73 -0
- package/src/{primitives → core/primitives}/tooltip/__workshop__/props.tsx +3 -20
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +85 -0
- package/src/core/primitives/tooltip/conditionalWrapper.tsx +15 -0
- package/src/core/primitives/tooltip/constants.ts +23 -0
- package/src/{primitives → core/primitives}/tooltip/tooltip.test.tsx +192 -20
- package/src/{primitives → core/primitives}/tooltip/tooltip.tsx +202 -79
- package/src/{primitives → core/primitives}/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +4 -10
- package/src/{primitives → core/primitives}/types.ts +4 -0
- package/src/core/styles/border/borderStyle.ts +55 -0
- package/src/{styles → core/styles}/box/boxStyle.ts +5 -9
- package/src/core/styles/card/_cardColorStyle.ts +99 -0
- package/src/core/styles/card/index.ts +1 -0
- package/src/{styles → core/styles}/flex/flexItemStyle.ts +2 -3
- package/src/{styles → core/styles}/flex/flexStyle.ts +6 -11
- package/src/{styles → core/styles}/focusRing/index.ts +5 -7
- package/src/{styles → core/styles}/font/codeFontStyle.ts +1 -1
- package/src/{styles → core/styles}/font/headingFontStyle.ts +1 -1
- package/src/{styles → core/styles}/font/labelFontStyle.ts +1 -1
- package/src/{styles → core/styles}/font/responsiveFont.ts +5 -5
- package/src/{styles → core/styles}/font/textAlignStyle.ts +3 -3
- package/src/{styles → core/styles}/font/textFontStyle.ts +1 -1
- package/src/{styles → core/styles}/font/types.ts +1 -1
- package/src/{styles → core/styles}/grid/gridItemStyle.ts +7 -13
- package/src/{styles → core/styles}/grid/gridStyle.ts +9 -17
- package/src/{styles → core/styles}/helpers.ts +6 -4
- package/src/{styles → core/styles}/input/responsiveInputPaddingStyle.ts +6 -6
- package/src/core/styles/input/textInputStyle.ts +232 -0
- package/src/{styles → core/styles}/margin/marginStyle.ts +1 -1
- package/src/{styles → core/styles}/margin/marginsStyle.test.ts +2 -2
- package/src/{styles → core/styles}/padding/paddingStyle.test.ts +2 -2
- package/src/{styles → core/styles}/padding/paddingStyle.ts +1 -1
- package/src/{styles → core/styles}/radius/radiusStyle.ts +2 -3
- package/src/core/styles/shadow/shadowStyle.ts +29 -0
- package/src/{styles → core/styles}/types.ts +1 -1
- package/src/core/theme/__workshop__/build/Root.tsx +350 -0
- package/src/core/theme/__workshop__/build/helpers.ts +46 -0
- package/src/core/theme/__workshop__/build/story.tsx +453 -0
- package/src/core/theme/__workshop__/canvas.tsx +350 -0
- package/src/{theme → core/theme}/__workshop__/color.tsx +5 -8
- package/src/{theme → core/theme}/__workshop__/index.ts +10 -0
- package/src/core/theme/index.ts +5 -0
- package/src/{theme → core/theme}/theme.test.tsx +3 -36
- package/src/{theme → core/theme}/themeColorProvider.tsx +2 -4
- package/src/{theme → core/theme}/themeContext.ts +2 -2
- package/src/core/theme/themeProvider.tsx +61 -0
- package/src/core/theme/types.ts +12 -0
- package/src/core/theme/useRootTheme.ts +16 -0
- package/src/core/theme/useTheme.ts +16 -0
- package/src/{types → core/types}/avatar.ts +1 -1
- package/src/core/types/badge.ts +12 -0
- package/src/core/types/button.ts +22 -0
- package/src/core/types/card.ts +6 -0
- package/src/{types → core/types}/index.ts +0 -1
- package/src/core/types/selectable.ts +6 -0
- package/src/core/utils/arrow/arrow.tsx +121 -0
- package/src/core/utils/arrow/cmds.ts +91 -0
- package/src/core/utils/arrow/index.ts +1 -0
- package/src/{utils → core/utils}/boundaryElement/__workshop__/plain.tsx +2 -6
- package/src/{utils → core/utils}/boundaryElement/boundaryElement.test.tsx +1 -1
- package/src/{utils → core/utils}/elementQuery/__workshop__/customMedia.tsx +3 -4
- package/src/{utils → core/utils}/elementQuery/elementQuery.tsx +3 -3
- package/src/{utils → core/utils}/index.ts +1 -0
- package/src/{utils → core/utils}/layer/__workshop__/_debug.tsx +1 -1
- package/src/{utils → core/utils}/layer/layer.test.tsx +1 -1
- package/src/{utils → core/utils}/portal/__workshop__/named.tsx +3 -3
- package/src/{utils → core/utils}/portal/portal.test.tsx +1 -1
- package/src/{utils → core/utils}/virtualList/virtualList.tsx +2 -2
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +76 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +54 -0
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +22 -0
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +55 -0
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +60 -0
- package/src/theme/build/_deprecated/color/color.test.ts +63 -0
- package/src/theme/build/_deprecated/color/defaults.ts +390 -0
- package/src/theme/build/_deprecated/color/factory.ts +142 -0
- package/src/theme/build/_deprecated/color/index.ts +1 -0
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +81 -0
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +54 -0
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +20 -0
- package/src/theme/build/buildColorTheme.test.ts +183 -0
- package/src/theme/build/buildColorTheme.ts +484 -0
- package/src/theme/build/buildTheme.test.ts +87 -0
- package/src/theme/build/buildTheme.ts +36 -0
- package/src/theme/build/colorToken.ts +39 -0
- package/src/theme/build/index.ts +3 -0
- package/src/theme/{lib → build/lib}/color-fns/blend/index.ts +1 -0
- package/src/theme/build/lib/color-fns/blend/mix.ts +21 -0
- package/src/theme/{lib → build/lib}/color-fns/blend/multiply.ts +3 -7
- package/src/theme/{lib → build/lib}/color-fns/blend/screen.ts +3 -7
- package/src/theme/{lib → build/lib}/color-fns/color-fns.test.ts +10 -7
- package/src/theme/build/lib/color-fns/contrastRatio.ts +31 -0
- package/src/theme/{lib → build/lib}/color-fns/convert.ts +10 -1
- package/src/theme/{lib → build/lib}/color-fns/index.ts +2 -1
- package/src/theme/{lib/color-fns/helpers → build/lib/color-fns}/rgba.ts +1 -1
- package/src/theme/build/lib/isRecord.ts +3 -0
- package/src/theme/build/lib/utils.ts +19 -0
- package/src/theme/build/merge.ts +28 -0
- package/src/theme/build/mixThemeColor.test.ts +21 -0
- package/src/theme/build/mixThemeColor.ts +53 -0
- package/src/theme/build/renderColorTheme.ts +536 -0
- package/src/theme/build/renderColorValue.ts +77 -0
- package/src/theme/build/resolveColorTokens.ts +331 -0
- package/src/theme/build/theme.test.ts +27 -0
- package/src/theme/config/helpers.ts +55 -0
- package/src/theme/config/index.ts +4 -0
- package/src/theme/config/system.ts +112 -0
- package/src/theme/config/tokens/color/index.ts +1 -0
- package/src/theme/config/tokens/color/types.ts +135 -0
- package/src/theme/config/tokens/index.ts +4 -0
- package/src/theme/config/tokens/parseTokenKey.test.ts +64 -0
- package/src/theme/config/tokens/parseTokenKey.ts +66 -0
- package/src/theme/config/tokens/parseTokenValue.test.ts +45 -0
- package/src/theme/config/tokens/parseTokenValue.ts +102 -0
- package/src/theme/config/tokens/types.ts +51 -0
- package/src/theme/config/types.ts +45 -0
- package/src/theme/defaults/colorPalette.ts +5 -0
- package/src/theme/defaults/colorTokens.ts +552 -0
- package/src/theme/{studioTheme/theme.ts → defaults/config.ts} +38 -42
- package/src/theme/{studioTheme → defaults}/fonts.ts +67 -59
- package/src/theme/getScopedTheme.ts +81 -0
- package/src/theme/index.ts +12 -8
- package/src/theme/system/avatar.ts +14 -0
- package/src/theme/system/color/_constants.ts +38 -0
- package/src/theme/system/color/_helpers.ts +23 -0
- package/src/theme/system/color/_system.ts +39 -0
- package/src/theme/system/color/avatar.ts +25 -0
- package/src/theme/system/color/badge.ts +20 -0
- package/src/theme/system/color/button.ts +33 -0
- package/src/theme/system/color/color.ts +34 -0
- package/src/theme/system/color/index.ts +13 -0
- package/src/theme/system/color/input.ts +33 -0
- package/src/theme/system/color/kbd.ts +8 -0
- package/src/theme/system/color/selectable.ts +23 -0
- package/src/theme/system/color/shadow.ts +7 -0
- package/src/theme/system/color/state.ts +37 -0
- package/src/theme/system/color/syntax.ts +41 -0
- package/src/theme/system/css.ts +9 -0
- package/src/theme/system/focusRing.ts +7 -0
- package/src/theme/{lib/theme → system}/index.ts +6 -1
- package/src/theme/system/input.ts +33 -0
- package/src/theme/{lib/theme → system}/layer.ts +1 -2
- package/src/theme/system/shadow.ts +25 -0
- package/src/theme/system/styles.ts +19 -0
- package/src/theme/system/theme.ts +128 -0
- package/src/theme/{lib/theme → system/v0}/avatar.ts +1 -3
- package/src/theme/system/v0/color/_generic.ts +35 -0
- package/src/theme/system/v0/color/_system.ts +13 -0
- package/src/theme/system/v0/color/base.ts +21 -0
- package/src/theme/system/v0/color/button.ts +42 -0
- package/src/theme/system/v0/color/card.ts +19 -0
- package/src/theme/system/v0/color/color.ts +40 -0
- package/src/theme/system/v0/color/index.ts +11 -0
- package/src/theme/system/v0/color/input.ts +34 -0
- package/src/theme/system/v0/color/muted.ts +26 -0
- package/src/theme/system/v0/color/selectable.ts +31 -0
- package/src/theme/system/v0/color/solid.ts +26 -0
- package/src/theme/system/v0/color/spot.ts +13 -0
- package/src/theme/system/v0/index.ts +3 -0
- package/src/theme/{lib/theme → system/v0}/input.ts +1 -11
- package/src/theme/versioning/getTheme_v2.ts +56 -0
- package/src/theme/versioning/index.ts +5 -0
- package/src/theme/versioning/is_v0.ts +6 -0
- package/src/theme/versioning/is_v2.ts +6 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +217 -0
- package/src/theme/versioning/v0_v2.ts +90 -0
- package/src/theme/versioning/v2_v0.ts +126 -0
- package/src/components/dialog/constants.ts +0 -4
- package/src/components/dialog/styles.ts +0 -37
- package/src/primitives/avatar/spotColors.ts +0 -53
- package/src/primitives/badge/styles.ts +0 -19
- package/src/primitives/button/styles.ts +0 -166
- package/src/primitives/code/styles.ts +0 -83
- package/src/primitives/popover/popoverArrow.tsx +0 -77
- package/src/primitives/switch/__workshop__/props.tsx +0 -41
- package/src/primitives/text/__workshop__/colored.tsx +0 -27
- package/src/primitives/tooltip/__workshop__/index.ts +0 -14
- package/src/primitives/tooltip/constants.ts +0 -16
- package/src/primitives/tooltip/tooltipArrow.tsx +0 -90
- package/src/styles/border/borderStyle.ts +0 -58
- package/src/styles/colorVars/colorVarsStyle.ts +0 -84
- package/src/styles/colorVars/index.ts +0 -1
- package/src/styles/input/textInputStyle.ts +0 -214
- package/src/styles/shadow/shadowStyle.ts +0 -28
- package/src/theme/defaults.ts +0 -7
- package/src/theme/lib/color-fns/helpers/index.ts +0 -1
- package/src/theme/lib/theme/color/_legacy/createColorTheme.ts +0 -7
- package/src/theme/lib/theme/color/_legacy/index.ts +0 -1
- package/src/theme/lib/theme/color/_legacy/legacyColor.ts +0 -3997
- package/src/theme/lib/theme/color/cssVariables/cardVariables.ts +0 -88
- package/src/theme/lib/theme/color/cssVariables/createCssVars.ts +0 -31
- package/src/theme/lib/theme/color/cssVariables/cssVars.test.ts +0 -262
- package/src/theme/lib/theme/color/cssVariables/index.ts +0 -1
- package/src/theme/lib/theme/color/cssVariables/tints.ts +0 -312
- package/src/theme/lib/theme/color/cssVariables/tones.ts +0 -67
- package/src/theme/lib/theme/color/cssVariables/utils.test.ts +0 -15
- package/src/theme/lib/theme/color/cssVariables/utils.ts +0 -9
- package/src/theme/lib/theme/color/index.ts +0 -5
- package/src/theme/lib/theme/color/types.ts +0 -41
- package/src/theme/lib/theme/shadow.ts +0 -20
- package/src/theme/lib/theme/theme.ts +0 -43
- package/src/theme/studioTheme/color.ts +0 -11
- package/src/theme/studioTheme/helpers.ts +0 -31
- package/src/theme/studioTheme/index.ts +0 -1
- package/src/theme/themeProvider.tsx +0 -81
- package/src/theme/toneContext/toneContext.ts +0 -12
- package/src/theme/toneContext/toneProvider.tsx +0 -31
- package/src/theme/toneContext/types.ts +0 -10
- package/src/theme/toneContext/useToneContext.tsx +0 -26
- package/src/theme/types.ts +0 -45
- package/src/theme/useRootTheme.ts +0 -25
- package/src/theme/useTheme.ts +0 -10
- package/src/types/badge.ts +0 -9
- package/src/types/button.ts +0 -14
- package/src/types/card.ts +0 -6
- package/src/types/selectable.ts +0 -4
- package/src/types/styled.ts +0 -9
- /package/src/{components → core/components}/autocomplete/__fixtures__/countries.ts +0 -0
- /package/src/{components → core/components}/autocomplete/__mocks__/apiStore.ts +0 -0
- /package/src/{components → core/components}/autocomplete/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/autocomplete/__workshop__/fullscreen.tsx +0 -0
- /package/src/{components → core/components}/autocomplete/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/autocomplete/__workshop__/types.ts +0 -0
- /package/src/{components → core/components}/autocomplete/autocomplete.styles.tsx +0 -0
- /package/src/{components → core/components}/autocomplete/autocompleteOption.tsx +0 -0
- /package/src/{components → core/components}/autocomplete/autocompleteReducer.ts +0 -0
- /package/src/{components → core/components}/autocomplete/constants.ts +0 -0
- /package/src/{components → core/components}/autocomplete/index.ts +0 -0
- /package/src/{components → core/components}/autocomplete/types.ts +0 -0
- /package/src/{components → core/components}/breadcrumbs/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/breadcrumbs/__workshop__/example.tsx +0 -0
- /package/src/{components → core/components}/breadcrumbs/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/breadcrumbs/breadcrumbs.styles.ts +0 -0
- /package/src/{components → core/components}/breadcrumbs/breadcrumbs.tsx +0 -0
- /package/src/{components → core/components}/breadcrumbs/index.ts +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/autoFocus.tsx +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/nested.tsx +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/onScroll.tsx +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/position.tsx +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/props.tsx +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/provider.tsx +0 -0
- /package/src/{components → core/components}/dialog/__workshop__/wrapped.tsx +0 -0
- /package/src/{components → core/components}/dialog/dialogContext.ts +0 -0
- /package/src/{components → core/components}/dialog/dialogProvider.tsx +0 -0
- /package/src/{components → core/components}/dialog/index.ts +0 -0
- /package/src/{components → core/components}/dialog/useDialog.ts +0 -0
- /package/src/{components → core/components}/hotkeys/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/hotkeys/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/hotkeys/__workshop__/plain.tsx +0 -0
- /package/src/{components → core/components}/hotkeys/index.ts +0 -0
- /package/src/{components → core/components}/index.ts +0 -0
- /package/src/{components → core/components}/menu/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/menu/__workshop__/constrainedInBoundary.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/groups.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/menuGroupRight.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/nestedMenu.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/onCloseMenuButton.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/selectedItem.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/shouldFocus.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/tones.tsx +0 -0
- /package/src/{components → core/components}/menu/__workshop__/withoutArrow.tsx +0 -0
- /package/src/{components → core/components}/menu/helpers.ts +0 -0
- /package/src/{components → core/components}/menu/index.ts +0 -0
- /package/src/{components → core/components}/menu/menuContext.ts +0 -0
- /package/src/{components → core/components}/menu/useMenu.ts +0 -0
- /package/src/{components → core/components}/menu/useMenuController.ts +0 -0
- /package/src/{components → core/components}/skeleton/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/{components → core/components}/skeleton/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/{components → core/components}/skeleton/index.ts +0 -0
- /package/src/{components → core/components}/skeleton/skeleton.tsx +0 -0
- /package/src/{components → core/components}/tab/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/tab/__workshop__/example.tsx +0 -0
- /package/src/{components → core/components}/tab/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/tab/index.ts +0 -0
- /package/src/{components → core/components}/tab/tabList.tsx +0 -0
- /package/src/{components → core/components}/tab/tabPanel.tsx +0 -0
- /package/src/{components → core/components}/toast/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/toast/__workshop__/hook.tsx +0 -0
- /package/src/{components → core/components}/toast/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/toast/__workshop__/toast.tsx +0 -0
- /package/src/{components → core/components}/toast/index.ts +0 -0
- /package/src/{components → core/components}/toast/toastContext.ts +0 -0
- /package/src/{components → core/components}/toast/toastProvider.tsx +0 -0
- /package/src/{components → core/components}/toast/types.ts +0 -0
- /package/src/{components → core/components}/toast/useToast.ts +0 -0
- /package/src/{components → core/components}/tree/__workshop__/.eslintrc +0 -0
- /package/src/{components → core/components}/tree/__workshop__/basic.perf.ts +0 -0
- /package/src/{components → core/components}/tree/__workshop__/basic.tsx +0 -0
- /package/src/{components → core/components}/tree/__workshop__/index.ts +0 -0
- /package/src/{components → core/components}/tree/helpers.ts +0 -0
- /package/src/{components → core/components}/tree/index.ts +0 -0
- /package/src/{components → core/components}/tree/tree.tsx +0 -0
- /package/src/{components → core/components}/tree/treeContext.ts +0 -0
- /package/src/{components → core/components}/tree/treeGroup.tsx +0 -0
- /package/src/{components → core/components}/tree/types.ts +0 -0
- /package/src/{components → core/components}/tree/useTree.ts +0 -0
- /package/src/{global.ts → core/global.ts} +0 -0
- /package/src/{helpers → core/helpers}/animation.ts +0 -0
- /package/src/{helpers → core/helpers}/element.ts +0 -0
- /package/src/{helpers → core/helpers}/focus.ts +0 -0
- /package/src/{helpers → core/helpers}/index.ts +0 -0
- /package/src/{helpers → core/helpers}/scroll.ts +0 -0
- /package/src/{hooks → core/hooks}/_internal/index.ts +0 -0
- /package/src/{hooks → core/hooks}/_internal/useUnique.ts +0 -0
- /package/src/{hooks → core/hooks}/index.ts +0 -0
- /package/src/{hooks → core/hooks}/useArrayProp.ts +0 -0
- /package/src/{hooks → core/hooks}/useClickOutside.ts +0 -0
- /package/src/{hooks → core/hooks}/useCustomValidity.ts +0 -0
- /package/src/{hooks → core/hooks}/useDelayed.test.ts +0 -0
- /package/src/{hooks → core/hooks}/useDelayedState.ts +0 -0
- /package/src/{hooks → core/hooks}/useElementRect/__workshop__/.eslintrc +0 -0
- /package/src/{hooks → core/hooks}/useElementRect/__workshop__/index.ts +0 -0
- /package/src/{hooks → core/hooks}/useElementRect/index.ts +0 -0
- /package/src/{hooks → core/hooks}/useElementRect/useElementRect.ts +0 -0
- /package/src/{hooks → core/hooks}/useElementSize.ts +0 -0
- /package/src/{hooks → core/hooks}/useForwardedRef.ts +0 -0
- /package/src/{hooks → core/hooks}/useGlobalKeyDown.ts +0 -0
- /package/src/{hooks → core/hooks}/useIsomorphicEffect.ts +0 -0
- /package/src/{hooks → core/hooks}/useMediaIndex/__workshop__/.eslintrc +0 -0
- /package/src/{hooks → core/hooks}/useMediaIndex/__workshop__/index.ts +0 -0
- /package/src/{hooks → core/hooks}/useMediaIndex/index.ts +0 -0
- /package/src/{hooks → core/hooks}/useMounted.ts +0 -0
- /package/src/{hooks → core/hooks}/usePrefersDark.hydration.test.tsx +0 -0
- /package/src/{hooks → core/hooks}/usePrefersDark.test.tsx +0 -0
- /package/src/{hooks → core/hooks}/usePrefersDark.ts +0 -0
- /package/src/{hooks → core/hooks}/usePrefersReducedMotion.hydration.test.tsx +0 -0
- /package/src/{hooks → core/hooks}/usePrefersReducedMotion.test.tsx +0 -0
- /package/src/{hooks → core/hooks}/usePrefersReducedMotion.ts +0 -0
- /package/src/{lib → core/lib}/globalScope.ts +0 -0
- /package/src/{observers → core/observers}/elementSizeObserver.ts +0 -0
- /package/src/{observers → core/observers}/index.ts +0 -0
- /package/src/{observers → core/observers}/resizeObserver.ts +0 -0
- /package/src/{primitives → core/primitives}/_selectable/index.ts +0 -0
- /package/src/{primitives → core/primitives}/_selectable/selectable.tsx +0 -0
- /package/src/{primitives → core/primitives}/avatar/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/avatar/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/avatar/index.ts +0 -0
- /package/src/{primitives → core/primitives}/badge/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/badge/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/badge/index.ts +0 -0
- /package/src/{primitives → core/primitives}/box/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/box/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/box/__workshop__/props.tsx +0 -0
- /package/src/{primitives → core/primitives}/box/index.ts +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/custom.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/customIcons.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/mixedChildren.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/props.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/styled1.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/styled2.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/__workshop__/uploadButton.tsx +0 -0
- /package/src/{primitives → core/primitives}/button/index.ts +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/allTones.tsx +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/checkered.tsx +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/interactive.tsx +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/listNavigation.tsx +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/props.tsx +0 -0
- /package/src/{primitives → core/primitives}/card/__workshop__/styled.tsx +0 -0
- /package/src/{primitives → core/primitives}/card/index.ts +0 -0
- /package/src/{primitives → core/primitives}/checkbox/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/checkbox/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/checkbox/__workshop__/tones.tsx +0 -0
- /package/src/{primitives → core/primitives}/checkbox/index.ts +0 -0
- /package/src/{primitives → core/primitives}/code/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/code/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/code/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{primitives → core/primitives}/code/__workshop__/props.tsx +0 -0
- /package/src/{primitives → core/primitives}/code/index.ts +0 -0
- /package/src/{primitives → core/primitives}/container/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/container/__workshop__/example.tsx +0 -0
- /package/src/{primitives → core/primitives}/container/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/container/index.ts +0 -0
- /package/src/{primitives → core/primitives}/container/types.ts +0 -0
- /package/src/{primitives → core/primitives}/flex/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/flex/__workshop__/example.tsx +0 -0
- /package/src/{primitives → core/primitives}/flex/__workshop__/gap.tsx +0 -0
- /package/src/{primitives → core/primitives}/flex/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/flex/index.ts +0 -0
- /package/src/{primitives → core/primitives}/grid/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/grid/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/grid/__workshop__/responsive.tsx +0 -0
- /package/src/{primitives → core/primitives}/grid/index.ts +0 -0
- /package/src/{primitives → core/primitives}/heading/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/heading/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/heading/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{primitives → core/primitives}/heading/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/heading/index.ts +0 -0
- /package/src/{primitives → core/primitives}/heading/types.ts +0 -0
- /package/src/{primitives → core/primitives}/helpers.ts +0 -0
- /package/src/{primitives → core/primitives}/index.ts +0 -0
- /package/src/{primitives → core/primitives}/inline/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/inline/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/inline/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/inline/index.ts +0 -0
- /package/src/{primitives → core/primitives}/inline/types.ts +0 -0
- /package/src/{primitives → core/primitives}/kbd/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/kbd/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/kbd/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/kbd/index.tsx +0 -0
- /package/src/{primitives → core/primitives}/label/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/label/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/label/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{primitives → core/primitives}/label/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/label/index.ts +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/AlignedStory.tsx +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/MarginsStory.tsx +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/OpenOnMountStory.tsx +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/PlainStory.tsx +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/SidePanelStory.tsx +0 -0
- /package/src/{primitives → core/primitives}/popover/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/popover/floating-ui/size.ts +0 -0
- /package/src/{primitives → core/primitives}/popover/index.ts +0 -0
- /package/src/{primitives → core/primitives}/radio/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/radio/__workshop__/example.tsx +0 -0
- /package/src/{primitives → core/primitives}/radio/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/radio/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/radio/index.ts +0 -0
- /package/src/{primitives → core/primitives}/select/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/select/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/select/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/select/__workshop__/readOnly.tsx +0 -0
- /package/src/{primitives → core/primitives}/select/index.ts +0 -0
- /package/src/{primitives → core/primitives}/spinner/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/spinner/__workshop__/Props.tsx +0 -0
- /package/src/{primitives → core/primitives}/spinner/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/spinner/index.ts +0 -0
- /package/src/{primitives → core/primitives}/stack/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/stack/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/stack/__workshop__/plain.tsx +0 -0
- /package/src/{primitives → core/primitives}/stack/index.ts +0 -0
- /package/src/{primitives → core/primitives}/switch/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/switch/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/switch/index.ts +0 -0
- /package/src/{primitives → core/primitives}/text/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/text/__workshop__/example.tsx +0 -0
- /package/src/{primitives → core/primitives}/text/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/text/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{primitives → core/primitives}/text/index.ts +0 -0
- /package/src/{primitives → core/primitives}/textArea/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/textArea/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/textArea/index.ts +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/clearButton.tsx +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/customValidity.tsx +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/index.ts +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/multipleTones.tsx +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/readOnly.tsx +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/tones.tsx +0 -0
- /package/src/{primitives → core/primitives}/textInput/__workshop__/typed.tsx +0 -0
- /package/src/{primitives → core/primitives}/textInput/index.ts +0 -0
- /package/src/{primitives → core/primitives}/tooltip/__workshop__/.eslintrc +0 -0
- /package/src/{primitives → core/primitives}/tooltip/index.ts +0 -0
- /package/src/{primitives → core/primitives}/tooltip/tooltipDelayGroup/index.ts +0 -0
- /package/src/{primitives → core/primitives}/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -0
- /package/src/{primitives → core/primitives}/tooltip/tooltipDelayGroup/types.ts +0 -0
- /package/src/{primitives → core/primitives}/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -0
- /package/src/{styles → core/styles}/border/index.ts +0 -0
- /package/src/{styles → core/styles}/border/types.ts +0 -0
- /package/src/{styles → core/styles}/box/index.ts +0 -0
- /package/src/{styles → core/styles}/box/types.ts +0 -0
- /package/src/{styles → core/styles}/flex/index.ts +0 -0
- /package/src/{styles → core/styles}/flex/types.ts +0 -0
- /package/src/{styles → core/styles}/font/index.ts +0 -0
- /package/src/{styles → core/styles}/grid/index.ts +0 -0
- /package/src/{styles → core/styles}/grid/types.ts +0 -0
- /package/src/{styles → core/styles}/index.ts +0 -0
- /package/src/{styles → core/styles}/input/index.ts +0 -0
- /package/src/{styles → core/styles}/internal.ts +0 -0
- /package/src/{styles → core/styles}/margin/index.ts +0 -0
- /package/src/{styles → core/styles}/margin/types.ts +0 -0
- /package/src/{styles → core/styles}/padding/index.ts +0 -0
- /package/src/{styles → core/styles}/padding/types.ts +0 -0
- /package/src/{styles → core/styles}/radius/index.ts +0 -0
- /package/src/{styles → core/styles}/radius/types.ts +0 -0
- /package/src/{styles → core/styles}/shadow/index.ts +0 -0
- /package/src/{styles → core/styles}/shadow/types.ts +0 -0
- /package/src/{theme → core/theme}/__workshop__/.eslintrc +0 -0
- /package/src/{theme → core/theme}/__workshop__/layer.tsx +0 -0
- /package/src/{theme → core/theme}/__workshop__/nestedProvider.tsx +0 -0
- /package/src/{types → core/types}/box.ts +0 -0
- /package/src/{types → core/types}/dialog.ts +0 -0
- /package/src/{types → core/types}/flex.ts +0 -0
- /package/src/{types → core/types}/grid.ts +0 -0
- /package/src/{types → core/types}/gridItem.ts +0 -0
- /package/src/{types → core/types}/placement.ts +0 -0
- /package/src/{types → core/types}/popover.ts +0 -0
- /package/src/{types → core/types}/radius.ts +0 -0
- /package/src/{types → core/types}/text.ts +0 -0
- /package/src/{utils → core/utils}/boundaryElement/__workshop__/.eslintrc +0 -0
- /package/src/{utils → core/utils}/boundaryElement/__workshop__/index.ts +0 -0
- /package/src/{utils → core/utils}/boundaryElement/boundaryElementContext.ts +0 -0
- /package/src/{utils → core/utils}/boundaryElement/boundaryElementProvider.tsx +0 -0
- /package/src/{utils → core/utils}/boundaryElement/index.ts +0 -0
- /package/src/{utils → core/utils}/boundaryElement/types.ts +0 -0
- /package/src/{utils → core/utils}/boundaryElement/useBoundaryElement.ts +0 -0
- /package/src/{utils → core/utils}/elementQuery/__workshop__/.eslintrc +0 -0
- /package/src/{utils → core/utils}/elementQuery/__workshop__/index.ts +0 -0
- /package/src/{utils → core/utils}/elementQuery/helpers.ts +0 -0
- /package/src/{utils → core/utils}/elementQuery/index.ts +0 -0
- /package/src/{utils → core/utils}/errorBoundary.tsx +0 -0
- /package/src/{utils → core/utils}/layer/__workshop__/.eslintrc +0 -0
- /package/src/{utils → core/utils}/layer/__workshop__/index.ts +0 -0
- /package/src/{utils → core/utils}/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/{utils → core/utils}/layer/__workshop__/nested.tsx +0 -0
- /package/src/{utils → core/utils}/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/{utils → core/utils}/layer/getLayerContext.test.ts +0 -0
- /package/src/{utils → core/utils}/layer/getLayerContext.ts +0 -0
- /package/src/{utils → core/utils}/layer/index.ts +0 -0
- /package/src/{utils → core/utils}/layer/layer.tsx +0 -0
- /package/src/{utils → core/utils}/layer/layerContext.ts +0 -0
- /package/src/{utils → core/utils}/layer/layerProvider.tsx +0 -0
- /package/src/{utils → core/utils}/layer/types.ts +0 -0
- /package/src/{utils → core/utils}/layer/useLayer.ts +0 -0
- /package/src/{utils → core/utils}/portal/__workshop__/.eslintrc +0 -0
- /package/src/{utils → core/utils}/portal/__workshop__/index.ts +0 -0
- /package/src/{utils → core/utils}/portal/index.ts +0 -0
- /package/src/{utils → core/utils}/portal/portal.ts +0 -0
- /package/src/{utils → core/utils}/portal/portalContext.ts +0 -0
- /package/src/{utils → core/utils}/portal/portalProvider.tsx +0 -0
- /package/src/{utils → core/utils}/portal/types.ts +0 -0
- /package/src/{utils → core/utils}/portal/usePortal.ts +0 -0
- /package/src/{utils → core/utils}/srOnly/index.ts +0 -0
- /package/src/{utils → core/utils}/srOnly/srOnly.tsx +0 -0
- /package/src/{utils → core/utils}/virtualList/__workshop__/.eslintrc +0 -0
- /package/src/{utils → core/utils}/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/{utils → core/utils}/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/{utils → core/utils}/virtualList/__workshop__/index.ts +0 -0
- /package/src/{utils → core/utils}/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/{utils → core/utils}/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/{utils → core/utils}/virtualList/index.ts +0 -0
- /package/src/theme/{lib → build/lib}/color-fns/parse.ts +0 -0
- /package/src/theme/{lib → build/lib}/color-fns/types.ts +0 -0
- /package/src/theme/{lib/theme/fonts.ts → system/font.ts} +0 -0
|
@@ -4,7 +4,7 @@ import {isValidElementType} from 'react-is'
|
|
|
4
4
|
import {useArrayProp} from '../../hooks'
|
|
5
5
|
import {Box, Flex, Popover, PopoverProps, Text} from '../../primitives'
|
|
6
6
|
import {Selectable} from '../../primitives/_selectable'
|
|
7
|
-
import {
|
|
7
|
+
import {useRootTheme} from '../../theme'
|
|
8
8
|
import {Radius, SelectableTone} from '../../types'
|
|
9
9
|
import {Menu} from './menu'
|
|
10
10
|
import {useMenu} from './useMenu'
|
|
@@ -45,8 +45,8 @@ export function MenuGroup(
|
|
|
45
45
|
tone = 'default',
|
|
46
46
|
...restProps
|
|
47
47
|
} = props
|
|
48
|
-
const {scheme} = useToneContext()
|
|
49
48
|
const menu = useMenu()
|
|
49
|
+
const {scheme} = useRootTheme()
|
|
50
50
|
const {
|
|
51
51
|
activeElement,
|
|
52
52
|
mount,
|
|
@@ -12,8 +12,8 @@ import {useArrayProp, useForwardedRef} from '../../hooks'
|
|
|
12
12
|
import {Box, Flex, Text} from '../../primitives'
|
|
13
13
|
import {Selectable} from '../../primitives/_selectable'
|
|
14
14
|
import {ResponsivePaddingProps, ResponsiveRadiusProps} from '../../primitives/types'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import {useRootTheme} from '../../theme'
|
|
16
|
+
import {SelectableTone} from '../../types/selectable'
|
|
17
17
|
import {Hotkeys} from '../hotkeys'
|
|
18
18
|
import {useMenu} from './useMenu'
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@ export interface MenuItemProps extends ResponsivePaddingProps, ResponsiveRadiusP
|
|
|
30
30
|
selected?: boolean
|
|
31
31
|
space?: number | number[]
|
|
32
32
|
text?: React.ReactNode
|
|
33
|
-
tone?:
|
|
33
|
+
tone?: SelectableTone
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -65,7 +65,7 @@ export const MenuItem = forwardRef(function MenuItem(
|
|
|
65
65
|
tone = 'default',
|
|
66
66
|
...restProps
|
|
67
67
|
} = props
|
|
68
|
-
const {scheme} =
|
|
68
|
+
const {scheme} = useRootTheme()
|
|
69
69
|
const menu = useMenu()
|
|
70
70
|
const {
|
|
71
71
|
activeElement,
|
|
@@ -103,6 +103,8 @@ export const MenuItem = forwardRef(function MenuItem(
|
|
|
103
103
|
[padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft],
|
|
104
104
|
)
|
|
105
105
|
|
|
106
|
+
const hotkeysFontSize = useArrayProp(fontSize).map((s) => s - 1)
|
|
107
|
+
|
|
106
108
|
const setRef = useCallback(
|
|
107
109
|
(el: HTMLDivElement | null) => {
|
|
108
110
|
ref.current = el
|
|
@@ -151,7 +153,11 @@ export const MenuItem = forwardRef(function MenuItem(
|
|
|
151
153
|
)}
|
|
152
154
|
|
|
153
155
|
{hotkeys && (
|
|
154
|
-
<Hotkeys
|
|
156
|
+
<Hotkeys
|
|
157
|
+
fontSize={hotkeysFontSize}
|
|
158
|
+
keys={hotkeys}
|
|
159
|
+
style={{marginTop: -4, marginBottom: -4}}
|
|
160
|
+
/>
|
|
155
161
|
)}
|
|
156
162
|
|
|
157
163
|
{iconRight && (
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {css, keyframes} from 'styled-components'
|
|
2
|
-
import {cssVars} from '../../theme'
|
|
3
2
|
|
|
4
3
|
const keyframe = keyframes`
|
|
5
4
|
0% {
|
|
@@ -13,11 +12,11 @@ const keyframe = keyframes`
|
|
|
13
12
|
const animation = css`
|
|
14
13
|
background-image: linear-gradient(
|
|
15
14
|
to right,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
var(--card-skeleton-color-from),
|
|
16
|
+
var(--card-skeleton-color-to),
|
|
17
|
+
var(--card-skeleton-color-from),
|
|
18
|
+
var(--card-skeleton-color-from),
|
|
19
|
+
var(--card-skeleton-color-from)
|
|
21
20
|
);
|
|
22
21
|
background-position: 100%;
|
|
23
22
|
background-size: 200% 100%;
|
|
@@ -41,11 +40,11 @@ export const skeletonStyle = css<{$animated: boolean; $visible: boolean}>`
|
|
|
41
40
|
$animated
|
|
42
41
|
? animation
|
|
43
42
|
: css`
|
|
44
|
-
background-color:
|
|
43
|
+
background-color: var(--card-skeleton-color-from);
|
|
45
44
|
`}
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
@media screen and (prefers-reduced-motion: reduce) {
|
|
49
|
-
background-color:
|
|
48
|
+
background-color: var(--card-skeleton-color-from);
|
|
50
49
|
}
|
|
51
50
|
`
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
+
import {ThemeFontKey, getTheme_v2} from '@sanity/ui/theme'
|
|
1
2
|
import {forwardRef} from 'react'
|
|
2
3
|
import styled from 'styled-components'
|
|
3
4
|
import {useArrayProp} from '../../hooks'
|
|
4
|
-
import {_responsive} from '../../styles'
|
|
5
|
-
import {Theme, ThemeFontKey} from '../../theme'
|
|
5
|
+
import {ThemeProps, _responsive} from '../../styles'
|
|
6
6
|
import {Skeleton, SkeletonProps} from './skeleton'
|
|
7
7
|
|
|
8
|
-
const Root = styled(Skeleton)<{$size: number[]; $style: ThemeFontKey}>((
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
$style
|
|
15
|
-
theme
|
|
16
|
-
|
|
17
|
-
const {media} = theme.sanity
|
|
18
|
-
const font = theme.sanity.fonts[$style]
|
|
8
|
+
const Root = styled(Skeleton)<{$size: number[]; $style: ThemeFontKey}>((
|
|
9
|
+
props: {
|
|
10
|
+
$size: number[]
|
|
11
|
+
$style: ThemeFontKey
|
|
12
|
+
} & ThemeProps,
|
|
13
|
+
) => {
|
|
14
|
+
const {$size, $style} = props
|
|
15
|
+
const {font, media} = getTheme_v2(props.theme)
|
|
16
|
+
const fontStyle = font[$style]
|
|
19
17
|
|
|
20
18
|
const styles = _responsive(media, $size, (sizeIndex) => {
|
|
21
|
-
const fontSize =
|
|
19
|
+
const fontSize = fontStyle.sizes[sizeIndex]
|
|
22
20
|
const capHeight = fontSize.lineHeight - fontSize.ascenderHeight - fontSize.descenderHeight
|
|
23
21
|
|
|
24
22
|
return {height: capHeight}
|
|
@@ -31,7 +31,10 @@ const CustomButton = styled(Button)`
|
|
|
31
31
|
*/
|
|
32
32
|
export const Tab = forwardRef(function Tab(
|
|
33
33
|
props: TabProps &
|
|
34
|
-
Omit<
|
|
34
|
+
Omit<
|
|
35
|
+
React.HTMLProps<HTMLButtonElement>,
|
|
36
|
+
'aria-controls' | 'as' | 'id' | 'label' | 'type' | 'width'
|
|
37
|
+
>,
|
|
35
38
|
forwardedRef: React.ForwardedRef<HTMLButtonElement>,
|
|
36
39
|
) {
|
|
37
40
|
const {
|
|
@@ -88,7 +91,6 @@ export const Tab = forwardRef(function Tab(
|
|
|
88
91
|
onBlur={handleBlur}
|
|
89
92
|
onFocus={handleFocus}
|
|
90
93
|
padding={padding}
|
|
91
|
-
radius="full"
|
|
92
94
|
ref={setRef}
|
|
93
95
|
role="tab"
|
|
94
96
|
selected={selected}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jest-environment jsdom */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
|
|
4
|
-
import {render} from '
|
|
4
|
+
import {render} from '../../../../test'
|
|
5
5
|
import {ToastContext} from './toastContext'
|
|
6
6
|
import {ToastContextValue} from './types'
|
|
7
7
|
import {useToast} from './useToast'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {CloseIcon} from '@sanity/icons'
|
|
2
|
+
import {ThemeColorToneKey} from '@sanity/ui/theme'
|
|
2
3
|
import styled from 'styled-components'
|
|
3
4
|
import {Box, Button, Card, Flex, Stack, Text} from '../../primitives'
|
|
4
|
-
import {ThemeColorToneKey} from '../../theme'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
@@ -10,6 +10,7 @@ export interface ToastProps {
|
|
|
10
10
|
closable?: boolean
|
|
11
11
|
description?: React.ReactNode
|
|
12
12
|
onClose?: () => void
|
|
13
|
+
radius?: number | number[]
|
|
13
14
|
title?: React.ReactNode
|
|
14
15
|
status?: 'error' | 'warning' | 'success' | 'info'
|
|
15
16
|
}
|
|
@@ -37,12 +38,16 @@ const TextBox = styled(Flex)`
|
|
|
37
38
|
`
|
|
38
39
|
|
|
39
40
|
/**
|
|
41
|
+
* The `Toast` component gives feedback to users when an action has taken place.
|
|
42
|
+
*
|
|
43
|
+
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
44
|
+
*
|
|
40
45
|
* @public
|
|
41
46
|
*/
|
|
42
47
|
export function Toast(
|
|
43
48
|
props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title'>,
|
|
44
49
|
): React.ReactElement {
|
|
45
|
-
const {closable, description, onClose, title, status, ...restProps} = props
|
|
50
|
+
const {closable, description, onClose, radius = 3, title, status, ...restProps} = props
|
|
46
51
|
const cardTone = status ? STATUS_CARD_TONE[status] : 'default'
|
|
47
52
|
const role = status ? ROLES[status] : 'status'
|
|
48
53
|
|
|
@@ -52,14 +57,18 @@ export function Toast(
|
|
|
52
57
|
role={role}
|
|
53
58
|
{...restProps}
|
|
54
59
|
marginTop={3}
|
|
55
|
-
radius={
|
|
60
|
+
radius={radius}
|
|
56
61
|
shadow={2}
|
|
57
62
|
tone={cardTone}
|
|
58
63
|
>
|
|
59
64
|
<Flex align="flex-start">
|
|
60
65
|
<TextBox flex={1} padding={3}>
|
|
61
66
|
<Stack space={3}>
|
|
62
|
-
{title &&
|
|
67
|
+
{title && (
|
|
68
|
+
<Text size={1} weight="medium">
|
|
69
|
+
{title}
|
|
70
|
+
</Text>
|
|
71
|
+
)}
|
|
63
72
|
{description && (
|
|
64
73
|
<Text muted size={1}>
|
|
65
74
|
{description}
|
|
@@ -26,7 +26,7 @@ export default function BasicStory() {
|
|
|
26
26
|
return (
|
|
27
27
|
<Box padding={[4, 5, 6]}>
|
|
28
28
|
<Box paddingY={3}>
|
|
29
|
-
<Text>
|
|
29
|
+
<Text muted size={1}>
|
|
30
30
|
This example is to demonstrate that when you tab from an outside element (using the
|
|
31
31
|
keyboard to navigate), you can still access the tree and tree item. Press the input
|
|
32
32
|
beneath and start tabbing / using the arrow.
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
+
import {getTheme_v2} from '@sanity/ui/theme'
|
|
1
2
|
import {css} from 'styled-components'
|
|
2
3
|
import {rem, ThemeProps} from '../../styles'
|
|
3
|
-
import {
|
|
4
|
-
_colorVarStyleActive,
|
|
5
|
-
_colorVarStyleHover,
|
|
6
|
-
_colorVarStyleSelected,
|
|
7
|
-
} from '../../styles/colorVars'
|
|
8
|
-
import {cssVars} from '../../theme'
|
|
9
|
-
import {cardVariables} from '../../theme/lib/theme/color/cssVariables/cardVariables'
|
|
4
|
+
import {_cardColorStyle} from '../../styles/card'
|
|
10
5
|
|
|
11
6
|
export function treeItemRootStyle(): ReturnType<typeof css> {
|
|
12
7
|
return css`
|
|
@@ -15,6 +10,9 @@ export function treeItemRootStyle(): ReturnType<typeof css> {
|
|
|
15
10
|
cursor: default;
|
|
16
11
|
border-radius: 3px;
|
|
17
12
|
|
|
13
|
+
background-color: var(--card-bg-color);
|
|
14
|
+
color: var(--treeitem-fg-color);
|
|
15
|
+
|
|
18
16
|
&:focus {
|
|
19
17
|
position: relative;
|
|
20
18
|
}
|
|
@@ -26,6 +24,9 @@ export function treeItemRootStyle(): ReturnType<typeof css> {
|
|
|
26
24
|
& > div {
|
|
27
25
|
cursor: default;
|
|
28
26
|
border-radius: 3px;
|
|
27
|
+
|
|
28
|
+
background-color: var(--card-bg-color);
|
|
29
|
+
color: var(--treeitem-fg-color);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
&:focus > div {
|
|
@@ -35,51 +36,48 @@ export function treeItemRootStyle(): ReturnType<typeof css> {
|
|
|
35
36
|
`
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
export function treeItemRootColorStyle(): ReturnType<typeof css> {
|
|
39
|
+
export function treeItemRootColorStyle(props: ThemeProps): ReturnType<typeof css> {
|
|
40
|
+
const $tone = 'default'
|
|
41
|
+
const {color} = getTheme_v2(props.theme)
|
|
42
|
+
const tone = color.selectable[$tone]
|
|
43
|
+
|
|
39
44
|
return css`
|
|
40
|
-
/* <div role="none"><a data-ui="TreeItem__box" role="treeitem" tabIndex="0"></div> */
|
|
41
45
|
&[role='none'] {
|
|
42
46
|
& > [role='treeitem'] {
|
|
43
|
-
${
|
|
44
|
-
|
|
45
|
-
background-color:${cssVars.mutable['bg-color']};
|
|
46
|
-
color: var(--treeitem-fg-color);
|
|
47
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
&[data-selected] > [role='treeitem'] {
|
|
50
|
-
${
|
|
51
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
@media (hover: hover) {
|
|
54
55
|
&:not([data-selected]) > [role='treeitem']:not(:focus):hover {
|
|
55
|
-
${
|
|
56
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
& > [role='treeitem']:focus {
|
|
59
|
-
${
|
|
60
|
+
${_cardColorStyle(color, tone.selected)}
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
/* <div role="treeitem" tabIndex="0"><div data-ui="TreeItem__box"></div> */
|
|
65
65
|
&[role='treeitem'] {
|
|
66
66
|
& > [data-ui='TreeItem__box'] {
|
|
67
|
-
${
|
|
68
|
-
background-color: ${cssVars.mutable['bg-color']};
|
|
69
|
-
color: ${cssVars.mutable['fg-color']};
|
|
67
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
&[data-selected] > [data-ui='TreeItem__box'] {
|
|
73
|
-
${
|
|
71
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
@media (hover: hover) {
|
|
77
75
|
&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
|
|
78
|
-
${
|
|
76
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
79
77
|
}
|
|
80
78
|
|
|
81
79
|
&:focus > [data-ui='TreeItem__box'] {
|
|
82
|
-
${
|
|
80
|
+
${_cardColorStyle(color, tone.selected)}
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
}
|
|
@@ -93,8 +91,8 @@ export interface TreeItemBoxStyleProps {
|
|
|
93
91
|
export function treeItemBoxStyle(
|
|
94
92
|
props: TreeItemBoxStyleProps & ThemeProps,
|
|
95
93
|
): ReturnType<typeof css> {
|
|
96
|
-
const {$level
|
|
97
|
-
const {space} = theme
|
|
94
|
+
const {$level} = props
|
|
95
|
+
const {space} = getTheme_v2(props.theme)
|
|
98
96
|
|
|
99
97
|
return css`
|
|
100
98
|
padding-left: ${rem(space[2] * $level)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {ToggleArrowRightIcon} from '@sanity/icons'
|
|
2
|
+
import {ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
2
3
|
import {createElement, memo, useCallback, useEffect, useId, useMemo, useRef} from 'react'
|
|
3
4
|
import styled from 'styled-components'
|
|
4
5
|
import {Box, BoxProps, Flex, Text} from '../../primitives'
|
|
5
|
-
import {ThemeFontWeightKey} from '../../theme'
|
|
6
6
|
import {
|
|
7
7
|
treeItemRootStyle,
|
|
8
8
|
treeItemRootColorStyle,
|
|
@@ -50,14 +50,14 @@ export const TreeItem = memo(function TreeItem(
|
|
|
50
50
|
const {
|
|
51
51
|
children,
|
|
52
52
|
expanded: expandedProp = false,
|
|
53
|
-
fontSize,
|
|
53
|
+
fontSize = 1,
|
|
54
54
|
href,
|
|
55
55
|
icon,
|
|
56
56
|
id: idProp,
|
|
57
57
|
linkAs,
|
|
58
58
|
muted,
|
|
59
59
|
onClick,
|
|
60
|
-
padding =
|
|
60
|
+
padding = 2,
|
|
61
61
|
selected = false,
|
|
62
62
|
space = 2,
|
|
63
63
|
text,
|
|
@@ -21,7 +21,9 @@ export default function ExampleStory() {
|
|
|
21
21
|
<Card scheme="dark" style={{position: 'absolute', ...size}} />
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
|
-
<Code language="json"
|
|
24
|
+
<Code language="json" size={1}>
|
|
25
|
+
{JSON.stringify(size)}
|
|
26
|
+
</Code>
|
|
25
27
|
</Stack>
|
|
26
28
|
</Container>
|
|
27
29
|
</Box>
|
|
@@ -6,7 +6,7 @@ export default function TestStory() {
|
|
|
6
6
|
return (
|
|
7
7
|
<Card padding={[3, 4, 5]}>
|
|
8
8
|
<Stack space={2}>
|
|
9
|
-
<Text weight="
|
|
9
|
+
<Text weight="medium">The current media index is {mediaIndex}.</Text>
|
|
10
10
|
<Text muted>Try resizing the browser.</Text>
|
|
11
11
|
</Stack>
|
|
12
12
|
</Card>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jest-environment node */
|
|
2
|
+
import {defaultTheme} from '@sanity/ui/theme'
|
|
2
3
|
import {renderToString, renderToStaticMarkup} from 'react-dom/server'
|
|
3
|
-
import {
|
|
4
|
+
import {ThemeProvider} from '../../theme'
|
|
4
5
|
import {useMediaIndex} from './useMediaIndex'
|
|
5
6
|
|
|
6
7
|
function Log() {
|
|
@@ -13,7 +14,7 @@ describe('useMediaIndex', () => {
|
|
|
13
14
|
it(`SSR to static markup returns 0`, () => {
|
|
14
15
|
expect(
|
|
15
16
|
renderToStaticMarkup(
|
|
16
|
-
<ThemeProvider theme={
|
|
17
|
+
<ThemeProvider theme={defaultTheme}>
|
|
17
18
|
<Log />
|
|
18
19
|
</ThemeProvider>,
|
|
19
20
|
),
|
|
@@ -22,7 +23,7 @@ describe('useMediaIndex', () => {
|
|
|
22
23
|
it(`SSR to markup for hydration doesn't throw`, () => {
|
|
23
24
|
expect(
|
|
24
25
|
renderToString(
|
|
25
|
-
<ThemeProvider theme={
|
|
26
|
+
<ThemeProvider theme={defaultTheme}>
|
|
26
27
|
<Log />
|
|
27
28
|
</ThemeProvider>,
|
|
28
29
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {useSyncExternalStore} from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import {useTheme_v2} from '../../theme'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
@@ -96,8 +96,7 @@ function getServerSnapshot() {
|
|
|
96
96
|
* @beta
|
|
97
97
|
*/
|
|
98
98
|
export function useMediaIndex(): number {
|
|
99
|
-
const
|
|
100
|
-
const {media} = theme.sanity
|
|
99
|
+
const {media} = useTheme_v2()
|
|
101
100
|
|
|
102
101
|
let store = MEDIA_STORE_CACHE.get(media)
|
|
103
102
|
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import {getTheme_v2} from '@sanity/ui/theme'
|
|
1
2
|
import {css} from 'styled-components'
|
|
2
3
|
import {ThemeProps} from '../../styles'
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
_selectableVarStyle,
|
|
6
|
-
_selectableVarStyleDisabled,
|
|
7
|
-
} from '../../styles/colorVars'
|
|
8
|
-
|
|
9
|
-
import {ThemeColorSchemeKey, ThemeColorToneKey, createCssVars, cssVars} from '../../theme'
|
|
4
|
+
import {_cardColorStyle} from '../../styles/card'
|
|
5
|
+
import {SelectableTone} from '../../types'
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* @internal
|
|
13
9
|
*/
|
|
14
10
|
export interface SelectableStyleProps {
|
|
15
|
-
$tone:
|
|
16
|
-
$scheme: ThemeColorSchemeKey
|
|
11
|
+
$tone: SelectableTone
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
export function selectableBaseStyle(): ReturnType<typeof css> {
|
|
@@ -28,6 +23,8 @@ export function selectableBaseStyle(): ReturnType<typeof css> {
|
|
|
28
23
|
font: inherit;
|
|
29
24
|
text-align: inherit;
|
|
30
25
|
border: 0;
|
|
26
|
+
width: -moz-available;
|
|
27
|
+
width: -webkit-fill-available;
|
|
31
28
|
width: stretch;
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -41,41 +38,42 @@ export function selectableBaseStyle(): ReturnType<typeof css> {
|
|
|
41
38
|
export function selectableColorStyle(
|
|
42
39
|
props: SelectableStyleProps & ThemeProps,
|
|
43
40
|
): ReturnType<typeof css> {
|
|
44
|
-
const {
|
|
41
|
+
const {$tone} = props
|
|
42
|
+
const {color, style} = getTheme_v2(props.theme)
|
|
43
|
+
const tone = color.selectable[$tone]
|
|
45
44
|
|
|
46
45
|
return css`
|
|
47
|
-
${
|
|
48
|
-
${_selectableVarStyle($tone)}
|
|
46
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
49
47
|
|
|
50
|
-
background-color:
|
|
51
|
-
color:
|
|
48
|
+
background-color: var(--card-bg-color);
|
|
49
|
+
color: var(--card-fg-color);
|
|
52
50
|
outline: none;
|
|
53
51
|
|
|
54
|
-
/* &:is(button)
|
|
52
|
+
/* &:is(button) */
|
|
55
53
|
&[data-as='button'] {
|
|
56
54
|
&:disabled {
|
|
57
|
-
${
|
|
55
|
+
${_cardColorStyle(color, tone.disabled)}
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
&:not(:disabled) {
|
|
61
59
|
&[aria-pressed='true'] {
|
|
62
|
-
${
|
|
60
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
&[data-selected],
|
|
66
64
|
&[aria-selected='true'] > & {
|
|
67
|
-
${
|
|
65
|
+
${_cardColorStyle(color, tone.selected)}
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
@media (hover: hover) {
|
|
71
69
|
&:not([data-selected]) {
|
|
72
70
|
&[data-hovered],
|
|
73
71
|
&:hover {
|
|
74
|
-
${
|
|
72
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
75
73
|
}
|
|
76
74
|
|
|
77
75
|
&:active {
|
|
78
|
-
${
|
|
76
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
}
|
|
@@ -85,32 +83,32 @@ export function selectableColorStyle(
|
|
|
85
83
|
/* &:is(a) */
|
|
86
84
|
&[data-as='a'] {
|
|
87
85
|
&[data-disabled] {
|
|
88
|
-
${
|
|
86
|
+
${_cardColorStyle(color, tone.disabled)}
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
&:not([data-disabled]) {
|
|
92
90
|
&[data-pressed] {
|
|
93
|
-
${
|
|
91
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
&[data-selected] {
|
|
97
|
-
${
|
|
95
|
+
${_cardColorStyle(color, tone.selected)}
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
@media (hover: hover) {
|
|
101
99
|
&:not([data-selected]) {
|
|
102
100
|
&[data-hovered],
|
|
103
101
|
&:hover {
|
|
104
|
-
${
|
|
102
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
105
103
|
}
|
|
106
104
|
&:active {
|
|
107
|
-
${
|
|
105
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
108
106
|
}
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
${
|
|
112
|
+
${style?.card?.root}
|
|
115
113
|
`
|
|
116
114
|
}
|
|
@@ -3,7 +3,7 @@ import {useSelect} from '@sanity/ui-workshop'
|
|
|
3
3
|
import {WORKSHOP_AVATAR_SIZE_OPTIONS} from '../../../__workshop__/constants'
|
|
4
4
|
|
|
5
5
|
export default function AsButtonStory() {
|
|
6
|
-
const size = useSelect('Size', WORKSHOP_AVATAR_SIZE_OPTIONS,
|
|
6
|
+
const size = useSelect('Size', WORKSHOP_AVATAR_SIZE_OPTIONS, 1, 'Props')
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
9
|
<Flex align="center" height="fill" justify="center">
|
|
@@ -3,7 +3,7 @@ import {useSelect} from '@sanity/ui-workshop'
|
|
|
3
3
|
import {WORKSHOP_AVATAR_SIZE_OPTIONS} from '../../../__workshop__/constants'
|
|
4
4
|
|
|
5
5
|
export default function StackStory() {
|
|
6
|
-
const size = useSelect('Size', WORKSHOP_AVATAR_SIZE_OPTIONS,
|
|
6
|
+
const size = useSelect('Size', WORKSHOP_AVATAR_SIZE_OPTIONS, 1, 'Props')
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
9
|
<Flex align="center" height="fill" justify="center">
|