@sanity/ui 3.0.0-static.10 → 3.0.0-static.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/_chunks-cjs/_visual-editing.js +207 -286
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/buildCommand.js +1 -1
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/_chunks-cjs/refractor.js.map +1 -1
- package/dist/_chunks-cjs/v3_v2.js +251 -0
- package/dist/_chunks-cjs/v3_v2.js.map +1 -0
- package/dist/_chunks-es/_visual-editing.mjs +210 -289
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_chunks-es/refractor.mjs.map +1 -1
- package/dist/_chunks-es/v3_v2.mjs +252 -0
- package/dist/_chunks-es/v3_v2.mjs.map +1 -0
- package/dist/_visual-editing.d.mts +12 -17
- package/dist/_visual-editing.d.ts +12 -17
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +1089 -427
- package/dist/css.d.ts +1089 -427
- package/dist/css.js +2384 -2550
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +2385 -2551
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +14 -46
- package/dist/index.d.ts +14 -46
- package/dist/index.js +31 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -22
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-palette.css +9 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +3569 -23230
- package/dist/theme.d.mts +122 -88
- package/dist/theme.d.ts +122 -88
- package/dist/theme.js +217 -430
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +200 -411
- package/dist/theme.mjs.map +1 -1
- package/exports/_visual-editing.ts +27 -27
- package/exports/index.ts +1 -1
- package/package.json +40 -40
- package/src/cli/buildCommand.ts +2 -2
- package/src/{ui → core}/StyleTags.tsx +1 -1
- package/src/core/_compat/theme/themeContext.ts +10 -0
- package/src/{ui → core}/_compat/theme/themeProvider.tsx +3 -15
- package/src/{ui → core}/_compat/types.ts +1 -11
- package/src/{ui → core}/components/autocomplete/__workshop__/async.tsx +1 -1
- package/src/{ui → core}/components/autocomplete/__workshop__/constrainedHeight.tsx +13 -6
- package/src/{ui → core}/components/autocomplete/__workshop__/fullscreen.tsx +4 -3
- package/src/{ui → core}/components/autocomplete/autocomplete.tsx +10 -4
- package/src/{ui → core}/components/dialog/dialog.tsx +4 -3
- package/src/{ui → core}/components/hotkeys/hotkeys.tsx +10 -8
- package/src/{ui → core}/components/toast/toast.tsx +1 -0
- package/src/{ui → core}/constants.ts +0 -6
- package/src/core/hooks/useMatchMedia.ts +46 -0
- package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.ts +4 -4
- package/src/{ui → core}/primitives/box/box.tsx +1 -9
- package/src/{ui → core}/primitives/button/button.tsx +12 -14
- package/src/{ui → core}/primitives/card/card.tsx +19 -35
- package/src/core/primitives/card/index.ts +2 -0
- package/src/core/primitives/card/types.ts +12 -0
- package/src/{ui → core}/primitives/code/code.tsx +1 -1
- package/src/{ui → core}/primitives/heading/heading.tsx +1 -1
- package/src/{ui → core}/primitives/kbd/kbd.tsx +2 -2
- package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
- package/src/{ui → core}/primitives/popover/__workshop__/SidePanelStory.tsx +3 -7
- package/src/{ui → core}/primitives/popover/popover.tsx +70 -9
- package/src/{ui → core}/primitives/popover/popoverCard.tsx +38 -51
- package/src/{ui → core}/primitives/select/select.tsx +3 -3
- package/src/{ui → core}/primitives/stack/stack.tsx +5 -10
- package/src/{ui → core}/primitives/text/text.tsx +1 -1
- package/src/{ui → core}/primitives/textInput/textInput.tsx +1 -1
- package/src/{ui → core}/primitives/tooltip/tooltip.test.tsx +2 -2
- package/src/{ui → core}/primitives/tooltip/tooltip.tsx +3 -2
- package/src/{ui → core}/utils/layer/layerProvider.tsx +1 -1
- package/src/{ui → core}/utils/portal/portal.ts +2 -15
- package/src/{ui → core}/utils/virtualList/virtualList.tsx +1 -2
- package/src/css/_resp.ts +5 -12
- package/src/css/compile/compilePalette.ts +41 -8
- package/src/css/compile/compileRule.ts +1 -8
- package/src/css/compile/compileRules.test.ts +0 -1
- package/src/css/compile/compileRules.ts +3 -6
- package/src/css/compile/compileSystem.ts +3 -6
- package/src/css/compile/compileTheme_v3.ts +55 -46
- package/src/css/components/breadcrumbs/breadcrumbs.ts +2 -2
- package/src/css/components/dialog/dialog.ts +8 -9
- package/src/css/components/dialog/rules.ts +0 -2
- package/src/css/components/menu/menu.ts +3 -3
- package/src/css/components/skeleton/rules.ts +0 -1
- package/src/css/components/skeleton/skeleton.ts +7 -7
- package/src/css/components/skeleton/types.ts +1 -1
- package/src/css/components/toast/rules.ts +0 -1
- package/src/css/components/toast/toast.ts +6 -6
- package/src/css/components/tree/tree.ts +2 -2
- package/src/css/composeClassNames.ts +5 -9
- package/src/css/index.ts +2 -3
- package/src/css/primitives/_arrow/_arrow.ts +6 -6
- package/src/css/primitives/_arrow/{_arrow.style.ts → rules.ts} +5 -7
- package/src/css/primitives/_input/input.ts +12 -12
- package/src/css/primitives/_input/{_input.style.ts → rules.ts} +20 -19
- package/src/css/primitives/_input/types.ts +1 -1
- package/src/css/primitives/_selectable/_contants.ts +1 -1
- package/src/css/primitives/_selectable/{_selectable.style.ts → rules.ts} +3 -6
- package/src/css/primitives/_selectable/selectable.ts +3 -3
- package/src/css/primitives/_selectable/types.ts +1 -1
- package/src/css/primitives/avatar/avatar.ts +7 -7
- package/src/css/primitives/badge/badge.ts +3 -3
- package/src/css/primitives/badge/rules.ts +22 -0
- package/src/css/primitives/badge/types.ts +1 -1
- package/src/css/primitives/box/box.ts +6 -10
- package/src/css/primitives/box/rules.ts +28 -0
- package/src/css/primitives/box/types.ts +7 -5
- package/src/css/primitives/button/_constants.ts +1 -1
- package/src/css/primitives/button/button.ts +3 -3
- package/src/css/primitives/button/rules.ts +10 -19
- package/src/css/primitives/card/_constants.ts +2 -2
- package/src/css/primitives/card/card.ts +6 -4
- package/src/css/primitives/card/rules.ts +471 -0
- package/src/css/primitives/card/types.ts +2 -1
- package/src/css/primitives/checkbox/checkbox.ts +3 -3
- package/src/css/primitives/code/code.ts +3 -3
- package/src/css/primitives/code/types.ts +1 -1
- package/src/css/primitives/container/container.ts +3 -3
- package/src/css/primitives/heading/heading.ts +5 -5
- package/src/css/primitives/heading/types.ts +1 -1
- package/src/css/primitives/kbd/kbd.ts +3 -3
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.ts +3 -3
- package/src/css/primitives/label/types.ts +1 -1
- package/src/css/primitives/popover/popover.ts +2 -6
- package/src/css/primitives/radio/radio.ts +2 -2
- package/src/css/primitives/select/select.ts +2 -3
- package/src/css/primitives/spinner/rules.ts +0 -1
- package/src/css/primitives/spinner/spinner.ts +3 -3
- package/src/css/primitives/switch/switch.ts +6 -6
- package/src/css/primitives/text/text.ts +3 -3
- package/src/css/primitives/text/types.ts +1 -1
- package/src/css/primitives/textArea/textArea.ts +1 -2
- package/src/css/primitives/textInput/textInput.ts +2 -2
- package/src/css/primitives/tooltip/tooltip.ts +3 -3
- package/src/css/rules.ts +113 -0
- package/src/css/styles/border/border.ts +22 -0
- package/src/css/styles/border/rules.ts +24 -0
- package/src/css/styles/display/rules.ts +62 -0
- package/src/css/styles/flex/flex.ts +20 -0
- package/src/css/styles/flex/rules.ts +28 -0
- package/src/css/{aspects → styles}/flexItem/flexItem.ts +1 -1
- package/src/css/styles/flexItem/rules.ts +12 -0
- package/src/css/{aspects → styles}/flexItem/types.ts +1 -17
- package/src/css/{aspects → styles}/font/font.ts +7 -2
- package/src/css/{aspects/font/font.style.ts → styles/font/rules.ts} +25 -28
- package/src/css/styles/gap/rules.ts +34 -0
- package/src/css/{aspects → styles}/grid/grid.ts +2 -2
- package/src/css/styles/grid/rules.ts +146 -0
- package/src/css/{aspects → styles}/grid/types.ts +2 -2
- package/src/css/styles/gridItem/rules.ts +96 -0
- package/src/css/{aspects → styles}/index.ts +0 -2
- package/src/css/styles/inset/rules.ts +16 -0
- package/src/css/styles/margin/rules.ts +64 -0
- package/src/css/styles/maxWidth/rules.ts +13 -0
- package/src/css/{aspects → styles}/maxWidth/types.ts +1 -1
- package/src/css/styles/outline/rules.ts +7 -0
- package/src/css/styles/overflow/rules.ts +9 -0
- package/src/css/styles/padding/rules.ts +62 -0
- package/src/css/styles/pointerEvents/rules.ts +11 -0
- package/src/css/{aspects → styles}/position/position.ts +1 -1
- package/src/css/styles/position/rules.ts +24 -0
- package/src/css/styles/radius/rules.ts +13 -0
- package/src/css/{aspects → styles}/radius/types.ts +1 -1
- package/src/css/styles/shadow/rules.ts +53 -0
- package/src/css/styles/textOverflow/rules.ts +17 -0
- package/src/css/styles/textOverflow/textOverflow.ts +6 -0
- package/src/css/{aspects → styles}/width/rules.ts +0 -1
- package/src/css/{aspects → styles}/width/types.ts +1 -1
- package/src/css/types.ts +253 -311
- package/src/css/utils/srOnly/rules.ts +11 -0
- package/src/css/varNames.ts +81 -128
- package/src/css/vars.ts +76 -122
- package/src/theme/_constants.ts +1 -1
- package/src/theme/_types.ts +2 -2
- package/src/theme/build/buildTheme.ts +2 -2
- package/src/theme/defaults/colorTokens.ts +2 -2
- package/src/theme/defaults/config.ts +1 -1
- package/src/theme/defaults/fonts.ts +4 -4
- package/src/theme/palette/constants.ts +3 -1
- package/src/theme/palette/types.ts +12 -0
- package/src/theme/v3/buildTheme_v3.ts +2 -1
- package/src/theme/v3/color/buildColor_v3.ts +38 -43
- package/src/theme/v3/color/card.ts +38 -43
- package/src/theme/v3/color/color.ts +38 -42
- package/src/theme/v3/defaults.ts +72 -69
- package/src/theme/v3/resolveTokens.ts +38 -43
- package/src/theme/v3/types.ts +3 -0
- package/src/theme/versioning/themeColor_v3_v2.ts +1 -1
- package/src/css/_comp.test.ts +0 -7
- package/src/css/_comp.ts +0 -11
- package/src/css/_mergeStyles.ts +0 -31
- package/src/css/_responsiveRule.ts +0 -38
- package/src/css/aspects/border/border.style.ts +0 -13
- package/src/css/aspects/border/border.ts +0 -14
- package/src/css/aspects/display/display.style.ts +0 -34
- package/src/css/aspects/flex/flex.style.ts +0 -30
- package/src/css/aspects/flex/flex.ts +0 -13
- package/src/css/aspects/flex/flexAlign.style.ts +0 -12
- package/src/css/aspects/flex/flexDirection.style.ts +0 -11
- package/src/css/aspects/flex/flexJustify.style.ts +0 -13
- package/src/css/aspects/flex/flexWrap.style.ts +0 -10
- package/src/css/aspects/flexItem/flex.style.ts +0 -22
- package/src/css/aspects/gap/gap.style.ts +0 -21
- package/src/css/aspects/grid/gridAutoColumns.style.ts +0 -11
- package/src/css/aspects/grid/gridAutoFlow.style.ts +0 -11
- package/src/css/aspects/grid/gridAutoRows.style.ts +0 -11
- package/src/css/aspects/grid/gridColumns.style.ts +0 -18
- package/src/css/aspects/grid/gridRows.style.ts +0 -18
- package/src/css/aspects/gridItem/gridColumn.style.ts +0 -20
- package/src/css/aspects/gridItem/gridColumnEnd.style.ts +0 -20
- package/src/css/aspects/gridItem/gridColumnStart.style.ts +0 -20
- package/src/css/aspects/gridItem/gridRow.style.ts +0 -20
- package/src/css/aspects/gridItem/gridRowEnd.style.ts +0 -20
- package/src/css/aspects/gridItem/gridRowStart.style.ts +0 -20
- package/src/css/aspects/height/height.style.ts +0 -9
- package/src/css/aspects/height/height.ts +0 -17
- package/src/css/aspects/height/index.ts +0 -1
- package/src/css/aspects/inset/inset.style.ts +0 -12
- package/src/css/aspects/margin/margin.style.ts +0 -46
- package/src/css/aspects/maxWidth/maxWidth.style.ts +0 -16
- package/src/css/aspects/minWidth/index.ts +0 -2
- package/src/css/aspects/minWidth/minWidth.style.ts +0 -13
- package/src/css/aspects/minWidth/minWidth.ts +0 -6
- package/src/css/aspects/minWidth/types.ts +0 -7
- package/src/css/aspects/outline/outline.style.ts +0 -9
- package/src/css/aspects/overflow/overflow.style.ts +0 -11
- package/src/css/aspects/padding/padding.style.ts +0 -46
- package/src/css/aspects/pointerEvents/pointerEvents.style.ts +0 -13
- package/src/css/aspects/position/position.style.ts +0 -12
- package/src/css/aspects/radius/radius.style.ts +0 -16
- package/src/css/aspects/shadow/shadow.style.ts +0 -49
- package/src/css/aspects/textOverflow/textOverflow.style.ts +0 -21
- package/src/css/aspects/textOverflow/textOverflow.ts +0 -6
- package/src/css/aspects/width/width.style.ts +0 -11
- package/src/css/compile/compileStyle.ts +0 -148
- package/src/css/components/breadcrumbs/breadcrumbs.style.ts +0 -9
- package/src/css/components/dialog/dialog.style.ts +0 -79
- package/src/css/components/menu/menu.style.ts +0 -17
- package/src/css/components/skeleton/skeleton.style.ts +0 -96
- package/src/css/components/toast/toast.style.ts +0 -20
- package/src/css/components/tree/tree.style.ts +0 -55
- package/src/css/constants.ts +0 -1
- package/src/css/primitives/_input/__workshop__/customInput.tsx +0 -16
- package/src/css/primitives/_input/__workshop__/index.ts +0 -14
- package/src/css/primitives/avatar/avatar.style.ts +0 -175
- package/src/css/primitives/badge/badge.style.ts +0 -22
- package/src/css/primitives/box/box.style.ts +0 -31
- package/src/css/primitives/button/button.style.ts +0 -201
- package/src/css/primitives/card/card.style.ts +0 -270
- package/src/css/primitives/checkbox/checkbox.style.ts +0 -154
- package/src/css/primitives/code/code.style.ts +0 -62
- package/src/css/primitives/container/container.style.ts +0 -10
- package/src/css/primitives/heading/heading.style.ts +0 -47
- package/src/css/primitives/kbd/kbd.style.ts +0 -22
- package/src/css/primitives/label/label.style.ts +0 -48
- package/src/css/primitives/popover/popover.style.ts +0 -5
- package/src/css/primitives/radio/radio.style.ts +0 -123
- package/src/css/primitives/select/select.style.ts +0 -24
- package/src/css/primitives/spinner/spinner.style.ts +0 -22
- package/src/css/primitives/stack/stack.style.ts +0 -9
- package/src/css/primitives/stack/stack.ts +0 -6
- package/src/css/primitives/switch/switch.style.ts +0 -94
- package/src/css/primitives/text/text.style.ts +0 -64
- package/src/css/primitives/textArea/textArea.style.ts +0 -9
- package/src/css/primitives/textInput/textInput.style.ts +0 -167
- package/src/css/primitives/token/token.style.ts +0 -49
- package/src/css/primitives/tooltip/tooltip.style.ts +0 -21
- package/src/css/scopeClassName.ts +0 -6
- package/src/css/system.style.ts +0 -158
- package/src/css/utils/srOnly/srOnly.style.ts +0 -14
- package/src/ui/_compat/theme/themeContext.ts +0 -10
- package/src/ui/hooks/useMatchMedia.ts +0 -28
- package/src/ui/primitives/card/cardContext.ts +0 -10
- package/src/ui/primitives/card/cardProvider.tsx +0 -19
- package/src/ui/primitives/card/index.ts +0 -4
- package/src/ui/primitives/card/types.ts +0 -27
- package/src/ui/primitives/card/useCard.ts +0 -7
- package/src/ui/primitives/stack/index.ts +0 -1
- /package/src/{ui → core}/_compat/index.ts +0 -0
- /package/src/{ui → core}/_compat/styles/_responsive.ts +0 -0
- /package/src/{ui → core}/_compat/styles/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/theme.test.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeColorProvider.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/types.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useRootTheme.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useTheme.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/apiStore.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/countries.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/custom.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteOption.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteReducer.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/constants.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/types.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/breadcrumbs.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/activate.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/autoFocus.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/onScroll.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/panes.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/position.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/wrapped.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogContext.ts +0 -0
- /package/src/{ui → core}/components/dialog/dialogProvider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/useDialog.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/index.ts +0 -0
- /package/src/{ui → core}/components/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/avatarMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/closableMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/constrainedInBoundary.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customMenuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customSelectedState.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/disableFocusOnClose.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/groups.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuGroupRight.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/nestedMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/onCloseMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/selectedItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/shouldFocus.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/withoutArrow.tsx +0 -0
- /package/src/{ui → core}/components/menu/helpers.ts +0 -0
- /package/src/{ui → core}/components/menu/index.ts +0 -0
- /package/src/{ui → core}/components/menu/menu.test.tsx +0 -0
- /package/src/{ui → core}/components/menu/menu.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuContext.ts +0 -0
- /package/src/{ui → core}/components/menu/menuDivider.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuGroup.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/useMenu.ts +0 -0
- /package/src/{ui → core}/components/menu/useMenuController.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/textSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tab/index.ts +0 -0
- /package/src/{ui → core}/components/tab/tab.tsx +0 -0
- /package/src/{ui → core}/components/tab/tabList.tsx +0 -0
- /package/src/{ui → core}/components/tab/tabPanel.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/hook.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/index.ts +0 -0
- /package/src/{ui → core}/components/toast/toast.test.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastContext.ts +0 -0
- /package/src/{ui → core}/components/toast/toastLayer.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastProvider.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastState.ts +0 -0
- /package/src/{ui → core}/components/toast/types.ts +0 -0
- /package/src/{ui → core}/components/toast/useToast.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.perf.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.tsx +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/tabFromElement.tsx +0 -0
- /package/src/{ui → core}/components/tree/helpers.ts +0 -0
- /package/src/{ui → core}/components/tree/index.ts +0 -0
- /package/src/{ui → core}/components/tree/tree.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeContext.ts +0 -0
- /package/src/{ui → core}/components/tree/treeGroup.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeItem.tsx +0 -0
- /package/src/{ui → core}/components/tree/types.ts +0 -0
- /package/src/{ui → core}/components/tree/useTree.ts +0 -0
- /package/src/{ui → core}/global.ts +0 -0
- /package/src/{ui → core}/helpers/animation.ts +0 -0
- /package/src/{ui → core}/helpers/element.ts +0 -0
- /package/src/{ui → core}/helpers/focus.ts +0 -0
- /package/src/{ui → core}/helpers/index.ts +0 -0
- /package/src/{ui → core}/helpers/props.ts +0 -0
- /package/src/{ui → core}/helpers/scroll.ts +0 -0
- /package/src/{ui → core}/hooks/index.ts +0 -0
- /package/src/{ui → core}/hooks/useArrayProp.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.ts +0 -0
- /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayed.test.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayedState.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
- /package/src/{ui → core}/hooks/useElementSize.ts +0 -0
- /package/src/{ui → core}/hooks/useForwardedRef.ts +0 -0
- /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
- /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMounted.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
- /package/src/{ui → core}/index.ts +0 -0
- /package/src/{ui → core}/lib/createGlobalScopedContext.ts +0 -0
- /package/src/{ui → core}/lib/globalScope.ts +0 -0
- /package/src/{ui → core}/lib/isRecord.ts +0 -0
- /package/src/{ui → core}/middleware/origin.ts +0 -0
- /package/src/{ui → core}/observers/elementSizeObserver.ts +0 -0
- /package/src/{ui → core}/observers/index.ts +0 -0
- /package/src/{ui → core}/observers/resizeObserver.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/index.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/selectable.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/asButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatar.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarCounter.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarStack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/types.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.test.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/types.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/box/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/custom.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/customIcons.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/disabled.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/sanityUploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/stacked.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/uploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/button.test.tsx +0 -0
- /package/src/{ui → core}/primitives/button/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/allTones.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/asButton.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/checkered.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/interactive.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/listNavigation.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/selected.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/checkbox.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/code/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/refractor.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/container.tsx +0 -0
- /package/src/{ui → core}/primitives/container/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/types.ts +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/flex/flex.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/grid.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/index.ts +0 -0
- /package/src/{ui → core}/primitives/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/inline.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/types.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/kbd/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/label/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/label.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/AlignedStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/PlainStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/RecursiveStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/TestStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/constants.ts +0 -0
- /package/src/{ui → core}/primitives/popover/floating-ui/size.ts +0 -0
- /package/src/{ui → core}/primitives/popover/helpers.ts +0 -0
- /package/src/{ui → core}/primitives/popover/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/types.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/radio.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/select/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/Props.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/animatedSpinnerIcon.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/spinner.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/plain.tsx +0 -0
- /package/src/{css → core}/primitives/stack/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/switch.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/colored.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/text/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/textArea.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/customValidity.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/states.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/typed.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/customPortal.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/constants.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipCard.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -0
- /package/src/{ui → core}/primitives/types.ts +0 -0
- /package/src/{ui → core}/types/avatar.ts +0 -0
- /package/src/{ui → core}/types/badge.ts +0 -0
- /package/src/{ui → core}/types/box.ts +0 -0
- /package/src/{ui → core}/types/button.ts +0 -0
- /package/src/{ui → core}/types/card.ts +0 -0
- /package/src/{ui → core}/types/dialog.ts +0 -0
- /package/src/{ui → core}/types/flex.ts +0 -0
- /package/src/{ui → core}/types/grid.ts +0 -0
- /package/src/{ui → core}/types/gridItem.ts +0 -0
- /package/src/{ui → core}/types/index.ts +0 -0
- /package/src/{ui → core}/types/placement.ts +0 -0
- /package/src/{ui → core}/types/popover.ts +0 -0
- /package/src/{ui → core}/types/props.ts +0 -0
- /package/src/{ui → core}/types/radius.ts +0 -0
- /package/src/{ui → core}/types/selectable.ts +0 -0
- /package/src/{ui → core}/types/text.ts +0 -0
- /package/src/{ui → core}/utils/arrow/arrow.tsx +0 -0
- /package/src/{ui → core}/utils/arrow/cmds.ts +0 -0
- /package/src/{ui → core}/utils/arrow/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElement.test.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementContext.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementProvider.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/types.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/useBoundaryElement.ts +0 -0
- /package/src/{ui → core}/utils/conditionalWrapper/conditionalWrapper.tsx +0 -0
- /package/src/{ui → core}/utils/conditionalWrapper/index.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/customMedia.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/elementQuery.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/index.ts +0 -0
- /package/src/{ui → core}/utils/errorBoundary.tsx +0 -0
- /package/src/{ui → core}/utils/getElementRef.ts +0 -0
- /package/src/{ui → core}/utils/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/_debug.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.test.ts +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/layer.test.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layer.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/types.ts +0 -0
- /package/src/{ui → core}/utils/layer/useLayer.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/named.tsx +0 -0
- /package/src/{ui → core}/utils/portal/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/portal.test.tsx +0 -0
- /package/src/{ui → core}/utils/portal/portalContext.ts +0 -0
- /package/src/{ui → core}/utils/portal/portalProvider.tsx +0 -0
- /package/src/{ui → core}/utils/portal/types.ts +0 -0
- /package/src/{ui → core}/utils/portal/usePortal.ts +0 -0
- /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
- /package/src/{ui → core}/utils/srOnly/index.ts +0 -0
- /package/src/{ui → core}/utils/srOnly/srOnly.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/index.ts +0 -0
- /package/src/css/{aspects → styles}/border/index.ts +0 -0
- /package/src/css/{aspects → styles}/border/types.ts +0 -0
- /package/src/css/{aspects → styles}/display/display.ts +0 -0
- /package/src/css/{aspects → styles}/display/index.ts +0 -0
- /package/src/css/{aspects → styles}/display/types.ts +0 -0
- /package/src/css/{aspects → styles}/flex/index.ts +0 -0
- /package/src/css/{aspects → styles}/flex/types.ts +0 -0
- /package/src/css/{aspects → styles}/flexItem/index.ts +0 -0
- /package/src/css/{aspects → styles}/font/index.ts +0 -0
- /package/src/css/{aspects → styles}/font/types.ts +0 -0
- /package/src/css/{aspects → styles}/gap/gap.ts +0 -0
- /package/src/css/{aspects → styles}/gap/index.ts +0 -0
- /package/src/css/{aspects → styles}/gap/types.ts +0 -0
- /package/src/css/{aspects → styles}/grid/index.ts +0 -0
- /package/src/css/{aspects → styles}/gridItem/gridItem.ts +0 -0
- /package/src/css/{aspects → styles}/gridItem/index.ts +0 -0
- /package/src/css/{aspects → styles}/gridItem/types.ts +0 -0
- /package/src/css/{aspects → styles}/height/rules.ts +0 -0
- /package/src/css/{aspects → styles}/inset/index.ts +0 -0
- /package/src/css/{aspects → styles}/inset/inset.ts +0 -0
- /package/src/css/{aspects → styles}/inset/types.ts +0 -0
- /package/src/css/{aspects → styles}/margin/index.ts +0 -0
- /package/src/css/{aspects → styles}/margin/margin.ts +0 -0
- /package/src/css/{aspects → styles}/margin/types.ts +0 -0
- /package/src/css/{aspects → styles}/maxWidth/index.ts +0 -0
- /package/src/css/{aspects → styles}/maxWidth/maxWidth.ts +0 -0
- /package/src/css/{aspects → styles}/overflow/index.ts +0 -0
- /package/src/css/{aspects → styles}/overflow/overflow.ts +0 -0
- /package/src/css/{aspects → styles}/overflow/types.ts +0 -0
- /package/src/css/{aspects → styles}/padding/index.ts +0 -0
- /package/src/css/{aspects → styles}/padding/padding.ts +0 -0
- /package/src/css/{aspects → styles}/padding/types.ts +0 -0
- /package/src/css/{aspects → styles}/pointerEvents/index.ts +0 -0
- /package/src/css/{aspects → styles}/pointerEvents/pointerEvents.ts +0 -0
- /package/src/css/{aspects → styles}/pointerEvents/types.ts +0 -0
- /package/src/css/{aspects → styles}/position/index.ts +0 -0
- /package/src/css/{aspects → styles}/position/types.ts +0 -0
- /package/src/css/{aspects → styles}/radius/index.ts +0 -0
- /package/src/css/{aspects → styles}/radius/radius.ts +0 -0
- /package/src/css/{aspects → styles}/shadow/index.ts +0 -0
- /package/src/css/{aspects → styles}/shadow/shadow.ts +0 -0
- /package/src/css/{aspects → styles}/shadow/types.ts +0 -0
- /package/src/css/{aspects → styles}/textOverflow/index.ts +0 -0
- /package/src/css/{aspects → styles}/textOverflow/types.ts +0 -0
- /package/src/css/{aspects → styles}/width/index.ts +0 -0
- /package/src/css/{aspects → styles}/width/width.ts +0 -0
|
@@ -14,6 +14,7 @@ import {FontTextSize, Space} from '@sanity/ui/theme'
|
|
|
14
14
|
import {ElementType, ForwardedRef, forwardRef, isValidElement, ReactNode} from 'react'
|
|
15
15
|
import {isValidElementType} from 'react-is'
|
|
16
16
|
|
|
17
|
+
import {useTheme_v2} from '../../_compat'
|
|
17
18
|
import {ButtonMode, ButtonTextAlign, ButtonTone, Props} from '../../types'
|
|
18
19
|
import {Box} from '../box'
|
|
19
20
|
import {Spinner} from '../spinner'
|
|
@@ -89,7 +90,7 @@ export const Button = forwardRef(function Button(
|
|
|
89
90
|
text,
|
|
90
91
|
textAlign,
|
|
91
92
|
textOverflow = 'ellipsis',
|
|
92
|
-
textWeight
|
|
93
|
+
textWeight,
|
|
93
94
|
tone = 'default',
|
|
94
95
|
type = 'button',
|
|
95
96
|
muted = false,
|
|
@@ -97,7 +98,7 @@ export const Button = forwardRef(function Button(
|
|
|
97
98
|
wrap,
|
|
98
99
|
...restProps
|
|
99
100
|
} = props
|
|
100
|
-
|
|
101
|
+
const {button: buttonTheme} = useTheme_v2()
|
|
101
102
|
|
|
102
103
|
return (
|
|
103
104
|
<As
|
|
@@ -113,12 +114,12 @@ export const Button = forwardRef(function Button(
|
|
|
113
114
|
>
|
|
114
115
|
{Boolean(loading) && (
|
|
115
116
|
<Box
|
|
116
|
-
align=
|
|
117
|
+
align={align}
|
|
117
118
|
as="span"
|
|
118
119
|
className={buttonLoadingBox()}
|
|
119
120
|
display="flex"
|
|
120
121
|
flex={1}
|
|
121
|
-
justify=
|
|
122
|
+
justify={justify}
|
|
122
123
|
width="fill"
|
|
123
124
|
>
|
|
124
125
|
<Spinner size={fontSize} />
|
|
@@ -127,7 +128,6 @@ export const Button = forwardRef(function Button(
|
|
|
127
128
|
|
|
128
129
|
{(IconComponent || text || IconRightComponent) && (
|
|
129
130
|
<Box
|
|
130
|
-
// align={align}
|
|
131
131
|
as="span"
|
|
132
132
|
direction={direction}
|
|
133
133
|
display="flex"
|
|
@@ -143,8 +143,8 @@ export const Button = forwardRef(function Button(
|
|
|
143
143
|
paddingBottom={paddingBottom}
|
|
144
144
|
paddingLeft={paddingLeft}
|
|
145
145
|
paddingRight={paddingRight}
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
width="fill"
|
|
147
|
+
wrap={wrap}
|
|
148
148
|
>
|
|
149
149
|
{IconComponent && (
|
|
150
150
|
<Text as="span" flex="none" muted size={fontSize}>
|
|
@@ -161,7 +161,7 @@ export const Button = forwardRef(function Button(
|
|
|
161
161
|
muted={muted}
|
|
162
162
|
size={fontSize}
|
|
163
163
|
textOverflow={textOverflow}
|
|
164
|
-
weight={textWeight}
|
|
164
|
+
weight={textWeight ?? buttonTheme.textWeight}
|
|
165
165
|
>
|
|
166
166
|
{text}
|
|
167
167
|
</Text>
|
|
@@ -178,15 +178,13 @@ export const Button = forwardRef(function Button(
|
|
|
178
178
|
|
|
179
179
|
{children && (
|
|
180
180
|
<Box
|
|
181
|
-
// align={align}
|
|
182
181
|
as="span"
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
direction={direction}
|
|
183
|
+
display="flex"
|
|
185
184
|
flex={1}
|
|
186
185
|
gap={gap}
|
|
187
186
|
gapX={gapX}
|
|
188
187
|
gapY={gapY}
|
|
189
|
-
// justify={justify}
|
|
190
188
|
padding={padding}
|
|
191
189
|
paddingX={paddingX}
|
|
192
190
|
paddingY={paddingY}
|
|
@@ -194,8 +192,8 @@ export const Button = forwardRef(function Button(
|
|
|
194
192
|
paddingBottom={paddingBottom}
|
|
195
193
|
paddingLeft={paddingLeft}
|
|
196
194
|
paddingRight={paddingRight}
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
width="fill"
|
|
196
|
+
wrap={wrap}
|
|
199
197
|
>
|
|
200
198
|
{children}
|
|
201
199
|
</Box>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {card, CardStyleProps, composeClassNames} from '@sanity/ui/css'
|
|
2
|
-
import {
|
|
2
|
+
import {ForwardedRef, forwardRef} from 'react'
|
|
3
3
|
import {isValidElementType} from 'react-is'
|
|
4
4
|
|
|
5
|
+
import {ThemeColorProvider, useRootTheme} from '../../_compat'
|
|
5
6
|
import {Props} from '../../types'
|
|
6
7
|
import {Box, BoxProps} from '../box'
|
|
7
|
-
import {CardProvider} from './cardProvider'
|
|
8
|
-
import {useCard} from './useCard'
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @public
|
|
@@ -46,73 +45,58 @@ export const Card = forwardRef(function Card(
|
|
|
46
45
|
pressed,
|
|
47
46
|
radius = 0,
|
|
48
47
|
scheme: schemeProp,
|
|
49
|
-
|
|
48
|
+
selectable,
|
|
50
49
|
selected,
|
|
51
50
|
shadow,
|
|
52
51
|
style,
|
|
53
|
-
tone: toneProp
|
|
52
|
+
tone: toneProp,
|
|
54
53
|
...restProps
|
|
55
54
|
} = props
|
|
56
55
|
|
|
57
56
|
const as = isValidElementType(asProp) ? asProp : 'div'
|
|
58
57
|
|
|
59
|
-
const
|
|
58
|
+
const rootTheme = useRootTheme()
|
|
60
59
|
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
scheme: parent?.scheme ?? 'light',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const tone = toneProp === 'inherit' ? context.tone : toneProp
|
|
67
|
-
const scheme = schemeProp === undefined ? context.scheme : schemeProp
|
|
60
|
+
const tone = toneProp === 'inherit' ? rootTheme.tone : toneProp
|
|
61
|
+
const scheme = schemeProp === undefined ? rootTheme.scheme : schemeProp
|
|
68
62
|
|
|
69
|
-
|
|
63
|
+
const node = (
|
|
70
64
|
<Box
|
|
65
|
+
// data-as={typeof as === 'string' ? as : undefined}
|
|
71
66
|
data-ui="Card"
|
|
72
67
|
{...restProps}
|
|
73
68
|
as={as}
|
|
74
69
|
className={composeClassNames(
|
|
75
70
|
className,
|
|
76
71
|
card({
|
|
77
|
-
scheme: scheme ===
|
|
72
|
+
scheme: scheme === rootTheme.scheme ? undefined : scheme,
|
|
78
73
|
shadow,
|
|
79
|
-
tone,
|
|
74
|
+
tone: tone === rootTheme.tone ? undefined : tone,
|
|
80
75
|
}),
|
|
81
76
|
)}
|
|
82
77
|
data-checkered={checkered ? '' : undefined}
|
|
83
78
|
data-focus-ring={focusRing ? '' : undefined}
|
|
84
79
|
data-pressed={pressed ? '' : undefined}
|
|
80
|
+
data-selectable={selectable ? '' : undefined}
|
|
85
81
|
data-selected={selected ? '' : undefined}
|
|
86
82
|
radius={radius}
|
|
87
83
|
ref={ref}
|
|
84
|
+
// selected={selected}
|
|
88
85
|
style={style}
|
|
89
86
|
/>
|
|
90
87
|
)
|
|
91
88
|
|
|
92
|
-
if (scheme ===
|
|
89
|
+
if (scheme === rootTheme.scheme && tone === rootTheme.tone) {
|
|
93
90
|
return node
|
|
94
91
|
}
|
|
95
92
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
scheme={scheme}
|
|
101
|
-
tone={tone ?? context.tone}
|
|
102
|
-
>
|
|
93
|
+
return (
|
|
94
|
+
// Render a theme provider around the card if the scheme or tone differs from the root theme.
|
|
95
|
+
// This is needed for backwards compatibility with the legacy theme API.
|
|
96
|
+
<ThemeColorProvider scheme={scheme} tone={tone ?? rootTheme.tone}>
|
|
103
97
|
{node}
|
|
104
|
-
</
|
|
98
|
+
</ThemeColorProvider>
|
|
105
99
|
)
|
|
106
|
-
|
|
107
|
-
if (parent?.compat_provider) {
|
|
108
|
-
return createElement(parent.compat_provider, {
|
|
109
|
-
children: node,
|
|
110
|
-
scheme,
|
|
111
|
-
tone: tone ?? context.tone,
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return node
|
|
116
100
|
})
|
|
117
101
|
|
|
118
102
|
Card.displayName = 'ForwardRef(Card)'
|
|
@@ -28,7 +28,7 @@ export const KBD = forwardRef(function KBD(
|
|
|
28
28
|
children,
|
|
29
29
|
className,
|
|
30
30
|
display = 'inline-block',
|
|
31
|
-
fontSize =
|
|
31
|
+
fontSize = 1,
|
|
32
32
|
padding = 1,
|
|
33
33
|
radius = 2,
|
|
34
34
|
...restProps
|
|
@@ -45,7 +45,7 @@ export const KBD = forwardRef(function KBD(
|
|
|
45
45
|
padding={padding}
|
|
46
46
|
ref={ref}
|
|
47
47
|
>
|
|
48
|
-
<Text as="span" muted size={fontSize}
|
|
48
|
+
<Text as="span" muted size={fontSize}>
|
|
49
49
|
{children}
|
|
50
50
|
</Text>
|
|
51
51
|
</Box>
|
|
@@ -3,7 +3,7 @@ import {Button, Card, Popover, Text} from '@sanity/ui'
|
|
|
3
3
|
export default function OpenOnMountStory() {
|
|
4
4
|
return (
|
|
5
5
|
<Card height="fill" padding={3} sizing="border">
|
|
6
|
-
<Popover content={<Text size={1}>popover content</Text>} open padding={3}
|
|
6
|
+
<Popover content={<Text size={1}>popover content</Text>} open padding={3}>
|
|
7
7
|
<Button text="This button is the popover reference" />
|
|
8
8
|
</Popover>
|
|
9
9
|
</Card>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {useSelect} from '@sanity/ui-workshop'
|
|
2
2
|
import {useCallback, useEffect, useRef, useState} from 'react'
|
|
3
3
|
|
|
4
|
-
import {WORKSHOP_CARD_TONE_OPTIONS} from '../../../../../workshop/constants'
|
|
5
|
-
import {CardTone} from '../../../types'
|
|
6
4
|
import {BoundaryElementProvider} from '../../../utils'
|
|
7
5
|
import {Box} from '../../box'
|
|
8
6
|
import {Card} from '../../card'
|
|
@@ -23,7 +21,6 @@ export default function SidePanelStory() {
|
|
|
23
21
|
const sidePanelWidth = useSelect('Side panel width', SIDE_PANEL_WIDTH, SIDE_PANEL_WIDTH.md)
|
|
24
22
|
const [sidePanel, setSidePanel] = useState<HTMLDivElement | null>(null)
|
|
25
23
|
const updateRef = useRef<PopoverUpdateCallback>(undefined)
|
|
26
|
-
const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS) ?? 'inherit'
|
|
27
24
|
|
|
28
25
|
useEffect(() => updateRef.current?.(), [sidePanelWidth])
|
|
29
26
|
|
|
@@ -45,7 +42,7 @@ export default function SidePanelStory() {
|
|
|
45
42
|
|
|
46
43
|
<Card border padding={3}>
|
|
47
44
|
<Text size={1}>
|
|
48
|
-
Some editor <InlineObject
|
|
45
|
+
Some editor <InlineObject updateRef={updateRef} />
|
|
49
46
|
</Text>
|
|
50
47
|
</Card>
|
|
51
48
|
</Stack>
|
|
@@ -55,8 +52,8 @@ export default function SidePanelStory() {
|
|
|
55
52
|
)
|
|
56
53
|
}
|
|
57
54
|
|
|
58
|
-
function InlineObject(props: {
|
|
59
|
-
const {
|
|
55
|
+
function InlineObject(props: {updateRef?: PopoverProps['updateRef']}) {
|
|
56
|
+
const {updateRef} = props
|
|
60
57
|
const [open, setOpen] = useState(false)
|
|
61
58
|
|
|
62
59
|
const handleClick = useCallback(() => {
|
|
@@ -82,7 +79,6 @@ function InlineObject(props: {tone: CardTone; updateRef?: PopoverProps['updateRe
|
|
|
82
79
|
open={open}
|
|
83
80
|
overflow="auto"
|
|
84
81
|
portal
|
|
85
|
-
tone={tone}
|
|
86
82
|
width={0}
|
|
87
83
|
updateRef={updateRef}
|
|
88
84
|
>
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
useRef,
|
|
27
27
|
} from 'react'
|
|
28
28
|
|
|
29
|
-
import {
|
|
30
|
-
import {useArrayProp, usePrefersReducedMotion} from '../../hooks'
|
|
29
|
+
import {useTheme_v2} from '../../_compat'
|
|
30
|
+
import {useArrayProp, useElementSize, useMediaIndex, usePrefersReducedMotion} from '../../hooks'
|
|
31
31
|
import {origin} from '../../middleware/origin'
|
|
32
32
|
import {Placement, PopoverMargins, Props} from '../../types'
|
|
33
33
|
import {LayerProps, LayerProvider, Portal, useBoundaryElement, useLayer} from '../../utils'
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
DEFAULT_POPOVER_PADDING,
|
|
40
40
|
} from './constants'
|
|
41
41
|
import {size} from './floating-ui/size'
|
|
42
|
+
import {calcCurrentWidth, calcMaxWidth} from './helpers'
|
|
42
43
|
import {PopoverCard} from './popoverCard'
|
|
43
44
|
import {PopoverUpdateCallback} from './types'
|
|
44
45
|
|
|
@@ -61,7 +62,7 @@ export interface PopoverProps extends CardProps, LayerProps {
|
|
|
61
62
|
* When `true`, prevent overflow within the current boundary:
|
|
62
63
|
* - by flipping on its side axis
|
|
63
64
|
* - by resizing
|
|
64
|
-
|
|
65
|
+
/*
|
|
65
66
|
* Note that:
|
|
66
67
|
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
67
68
|
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
@@ -122,13 +123,13 @@ export const Popover = memo(
|
|
|
122
123
|
props: Props<PopoverProps, 'div'>,
|
|
123
124
|
forwardedRef: ForwardedRef<HTMLDivElement>,
|
|
124
125
|
): ReactElement {
|
|
126
|
+
const {container, layer} = useTheme_v2()
|
|
125
127
|
const boundaryElementContext = useBoundaryElement()
|
|
126
128
|
|
|
127
129
|
const {
|
|
128
130
|
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
129
131
|
animate: _animate = false,
|
|
130
132
|
arrow: arrowProp = false,
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
132
133
|
boundaryElement = boundaryElementContext.element,
|
|
133
134
|
children: childProp,
|
|
134
135
|
constrainSize = false,
|
|
@@ -154,13 +155,17 @@ export const Popover = memo(
|
|
|
154
155
|
shadow = 3,
|
|
155
156
|
tone = 'inherit',
|
|
156
157
|
width: widthProp = 'auto',
|
|
157
|
-
|
|
158
|
-
zOffset: zOffsetProp = Z_OFFSETS.popover,
|
|
158
|
+
zOffset: zOffsetProp = layer.popover.zOffset,
|
|
159
159
|
updateRef,
|
|
160
160
|
...restProps
|
|
161
161
|
} = props
|
|
162
162
|
const prefersReducedMotion = usePrefersReducedMotion()
|
|
163
163
|
const animate = prefersReducedMotion ? false : _animate
|
|
164
|
+
const boundarySize = useElementSize(boundaryElement)?.border
|
|
165
|
+
// const padding = useArrayProp(paddingProp)
|
|
166
|
+
// const radius = useArrayProp(radiusProp)
|
|
167
|
+
// const shadow = useArrayProp(shadowProp)
|
|
168
|
+
const widthArrayProp = useArrayProp(widthProp)
|
|
164
169
|
const zOffset = useArrayProp(zOffsetProp)
|
|
165
170
|
const ref = useRef<HTMLDivElement | null>(null)
|
|
166
171
|
const arrowRef = useRef<HTMLDivElement | null>(null)
|
|
@@ -171,9 +176,57 @@ export const Popover = memo(
|
|
|
171
176
|
() => ref.current,
|
|
172
177
|
)
|
|
173
178
|
|
|
179
|
+
const mediaIndex = useMediaIndex()
|
|
180
|
+
const boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : undefined
|
|
181
|
+
|
|
182
|
+
// Update width when
|
|
183
|
+
// - media index changes
|
|
184
|
+
// - `width` property changes
|
|
185
|
+
const width = calcCurrentWidth({
|
|
186
|
+
container,
|
|
187
|
+
mediaIndex,
|
|
188
|
+
width: widthArrayProp,
|
|
189
|
+
})
|
|
190
|
+
const widthRef = useRef(width)
|
|
191
|
+
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
widthRef.current = width
|
|
194
|
+
}, [width])
|
|
195
|
+
|
|
196
|
+
// Update max width when
|
|
197
|
+
// - boundary width changes
|
|
198
|
+
// - `width` property changes
|
|
199
|
+
const maxWidth = calcMaxWidth({boundaryWidth, currentWidth: width})
|
|
200
|
+
const maxWidthRef = useRef(maxWidth)
|
|
201
|
+
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
maxWidthRef.current = maxWidth
|
|
204
|
+
}, [maxWidth])
|
|
205
|
+
|
|
174
206
|
// Keep track of reference element width (see `size` middleware below)
|
|
175
207
|
const referenceWidthRef = useRef<number>(undefined)
|
|
176
208
|
|
|
209
|
+
// Force apply width & max width to floating element
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
const floatingElement = ref.current
|
|
212
|
+
|
|
213
|
+
if (!open || !floatingElement) return
|
|
214
|
+
|
|
215
|
+
const referenceWidth = referenceWidthRef.current
|
|
216
|
+
|
|
217
|
+
if (matchReferenceWidth) {
|
|
218
|
+
if (referenceWidth !== undefined) {
|
|
219
|
+
floatingElement.style.width = `${referenceWidth}px`
|
|
220
|
+
}
|
|
221
|
+
} else if (width !== undefined) {
|
|
222
|
+
floatingElement.style.width = `${width}px`
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (typeof maxWidth === 'number') {
|
|
226
|
+
floatingElement.style.maxWidth = `${maxWidth}px`
|
|
227
|
+
}
|
|
228
|
+
}, [width, matchReferenceWidth, maxWidth, open])
|
|
229
|
+
|
|
177
230
|
const middleware = useMemo(() => {
|
|
178
231
|
const ret: Middleware[] = []
|
|
179
232
|
|
|
@@ -201,12 +254,21 @@ export const Popover = memo(
|
|
|
201
254
|
|
|
202
255
|
referenceWidthRef.current = referenceWidth
|
|
203
256
|
|
|
257
|
+
const _currentWidth = widthRef.current
|
|
258
|
+
const _maxWidth = maxWidthRef.current
|
|
259
|
+
|
|
204
260
|
if (matchReferenceWidth) {
|
|
205
261
|
elements.floating.style.width = `${referenceWidth}px`
|
|
262
|
+
} else if (_currentWidth !== undefined) {
|
|
263
|
+
elements.floating.style.width = `${_currentWidth}px`
|
|
206
264
|
}
|
|
207
265
|
|
|
208
266
|
if (constrainSize) {
|
|
209
|
-
elements.floating.style.maxWidth = `${
|
|
267
|
+
elements.floating.style.maxWidth = `${Math.min(
|
|
268
|
+
availableWidth,
|
|
269
|
+
_maxWidth ?? Infinity,
|
|
270
|
+
)}px`
|
|
271
|
+
|
|
210
272
|
elements.floating.style.maxHeight = `${availableHeight}px`
|
|
211
273
|
}
|
|
212
274
|
},
|
|
@@ -350,13 +412,12 @@ export const Popover = memo(
|
|
|
350
412
|
arrowX={arrowX}
|
|
351
413
|
arrowY={arrowY}
|
|
352
414
|
hidden={referenceHidden}
|
|
353
|
-
maxWidth={widthProp}
|
|
354
415
|
overflow={overflow}
|
|
355
416
|
padding={padding}
|
|
356
417
|
placement={placement}
|
|
357
418
|
radius={radius}
|
|
358
419
|
ref={setFloating}
|
|
359
|
-
|
|
420
|
+
referenceWidth={matchReferenceWidth ? referenceWidthRef.current : width}
|
|
360
421
|
scheme={scheme}
|
|
361
422
|
shadow={shadow}
|
|
362
423
|
originX={originX}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {Strategy} from '@floating-ui/react-dom'
|
|
2
|
-
import {popoverCard} from '@sanity/ui/css'
|
|
3
2
|
import {motion, MotionProps} from 'framer-motion'
|
|
4
3
|
import {CSSProperties, ForwardedRef, forwardRef, memo, useMemo} from 'react'
|
|
5
4
|
|
|
6
5
|
import {POPOVER_MOTION_PROPS} from '../../constants'
|
|
7
6
|
import {Placement, PopoverMargins, Props} from '../../types'
|
|
8
7
|
import {Arrow, useLayer} from '../../utils'
|
|
9
|
-
import {Card, CardProps
|
|
8
|
+
import {Card, CardProps} from '../card'
|
|
10
9
|
import {Flex} from '../flex'
|
|
11
10
|
import {
|
|
12
11
|
DEFAULT_POPOVER_ARROW_HEIGHT,
|
|
@@ -51,7 +50,6 @@ export const PopoverCard = memo(
|
|
|
51
50
|
arrowX,
|
|
52
51
|
arrowY,
|
|
53
52
|
children,
|
|
54
|
-
maxWidth,
|
|
55
53
|
padding,
|
|
56
54
|
placement,
|
|
57
55
|
originX,
|
|
@@ -70,9 +68,7 @@ export const PopoverCard = memo(
|
|
|
70
68
|
...restProps
|
|
71
69
|
} = props
|
|
72
70
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
const layer = useLayer()
|
|
71
|
+
const {zIndex} = useLayer()
|
|
76
72
|
|
|
77
73
|
// Get margins: [top, right, bottom, left]
|
|
78
74
|
const margins: PopoverMargins = useMemo(
|
|
@@ -92,11 +88,11 @@ export const PopoverCard = memo(
|
|
|
92
88
|
position: strategy,
|
|
93
89
|
top: y,
|
|
94
90
|
width: referenceWidth,
|
|
95
|
-
zIndex
|
|
91
|
+
zIndex,
|
|
96
92
|
willChange: animate ? 'transform' : undefined,
|
|
97
93
|
...style,
|
|
98
94
|
}),
|
|
99
|
-
[animate,
|
|
95
|
+
[animate, originX, originY, referenceWidth, strategy, style, x, y, zIndex],
|
|
100
96
|
)
|
|
101
97
|
|
|
102
98
|
const arrowStyle: CSSProperties = useMemo(
|
|
@@ -110,51 +106,42 @@ export const PopoverCard = memo(
|
|
|
110
106
|
)
|
|
111
107
|
|
|
112
108
|
return (
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
data-ui="Popover__wrapper"
|
|
137
|
-
direction="column"
|
|
138
|
-
flex={1}
|
|
139
|
-
maxWidth={maxWidth}
|
|
140
|
-
overflow={overflow}
|
|
141
|
-
>
|
|
142
|
-
<Flex direction="column" flex={1} padding={padding}>
|
|
143
|
-
{children}
|
|
144
|
-
</Flex>
|
|
109
|
+
<MotionCard
|
|
110
|
+
className="popover-card"
|
|
111
|
+
data-ui="Popover"
|
|
112
|
+
{...(restProps as CardProps & MotionProps)}
|
|
113
|
+
data-placement={placement}
|
|
114
|
+
direction="column"
|
|
115
|
+
display="flex"
|
|
116
|
+
radius={radius}
|
|
117
|
+
ref={ref}
|
|
118
|
+
scheme={scheme}
|
|
119
|
+
shadow={shadow}
|
|
120
|
+
sizing="border"
|
|
121
|
+
style={rootStyle}
|
|
122
|
+
tone={tone}
|
|
123
|
+
variants={POPOVER_MOTION_PROPS.card}
|
|
124
|
+
transition={POPOVER_MOTION_PROPS.transition}
|
|
125
|
+
initial={animate ? ['hidden', 'initial'] : undefined}
|
|
126
|
+
animate={animate ? ['visible', 'scaleIn'] : undefined}
|
|
127
|
+
exit={animate ? ['hidden', 'scaleOut'] : undefined}
|
|
128
|
+
>
|
|
129
|
+
<Flex data-ui="Popover__wrapper" direction="column" flex={1} overflow={overflow}>
|
|
130
|
+
<Flex direction="column" flex={1} padding={padding}>
|
|
131
|
+
{children}
|
|
145
132
|
</Flex>
|
|
133
|
+
</Flex>
|
|
146
134
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
</CardProvider>
|
|
135
|
+
{arrow && (
|
|
136
|
+
<Arrow
|
|
137
|
+
ref={arrowRef}
|
|
138
|
+
style={arrowStyle}
|
|
139
|
+
width={DEFAULT_POPOVER_ARROW_WIDTH}
|
|
140
|
+
height={DEFAULT_POPOVER_ARROW_HEIGHT}
|
|
141
|
+
radius={DEFAULT_POPOVER_ARROW_RADIUS}
|
|
142
|
+
/>
|
|
143
|
+
)}
|
|
144
|
+
</MotionCard>
|
|
158
145
|
)
|
|
159
146
|
}),
|
|
160
147
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ResponsiveProp} from '@sanity/ui/css'
|
|
2
2
|
import {Space} from '@sanity/ui/theme'
|
|
3
3
|
import {ForwardedRef, forwardRef} from 'react'
|
|
4
4
|
|
|
@@ -8,11 +8,7 @@ import {Box, BoxProps} from '../box'
|
|
|
8
8
|
/**
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export interface StackProps
|
|
12
|
-
extends Omit<
|
|
13
|
-
BoxProps,
|
|
14
|
-
'align' | 'columns' | 'direction' | 'display' | 'gapX' | 'gapY' | 'justify'
|
|
15
|
-
> {
|
|
11
|
+
export interface StackProps extends Omit<BoxProps, 'direction' | 'display' | 'gapX' | 'gapY'> {
|
|
16
12
|
/** @deprecated Use `gap` instead. */
|
|
17
13
|
space?: ResponsiveProp<Space>
|
|
18
14
|
}
|
|
@@ -26,16 +22,15 @@ export const Stack = forwardRef(function Stack(
|
|
|
26
22
|
props: Props<StackProps, 'div'>,
|
|
27
23
|
ref: ForwardedRef<HTMLDivElement>,
|
|
28
24
|
) {
|
|
29
|
-
const {as,
|
|
25
|
+
const {as, gap, space, ...restProps} = props
|
|
30
26
|
|
|
31
27
|
return (
|
|
32
28
|
<Box
|
|
33
29
|
data-ui="Stack"
|
|
34
30
|
{...restProps}
|
|
35
31
|
as={as}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
display="grid"
|
|
32
|
+
direction="column"
|
|
33
|
+
display="flex"
|
|
39
34
|
gap={gap ?? space}
|
|
40
35
|
ref={ref}
|
|
41
36
|
/>
|