@sanity/ui 2.15.8 → 2.15.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.js +134 -134
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +134 -134
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +1 -1
- package/dist/_visual-editing.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +48 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -49
- package/dist/index.mjs.map +1 -1
- package/dist/theme.js +431 -40
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +393 -4
- package/dist/theme.mjs.map +1 -1
- package/exports/_visual-editing.ts +15 -15
- package/package.json +31 -27
- package/src/core/_compat.ts +11 -11
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -0
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/example.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -0
- package/src/core/components/autocomplete/autocomplete.styles.tsx +2 -1
- package/src/core/components/autocomplete/autocomplete.tsx +3 -2
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +7 -0
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
- package/src/core/components/dialog/__workshop__/activate.tsx +2 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -0
- package/src/core/components/dialog/__workshop__/position.tsx +1 -0
- package/src/core/components/dialog/__workshop__/props.tsx +1 -0
- package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -3
- package/src/core/components/dialog/dialog.tsx +3 -0
- package/src/core/components/dialog/dialogProvider.tsx +1 -0
- package/src/core/components/dialog/styles.ts +1 -0
- package/src/core/components/dialog/useDialog.ts +1 -0
- package/src/core/components/hotkeys/hotkeys.tsx +1 -0
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -0
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -0
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +1 -0
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -0
- package/src/core/components/menu/__workshop__/menuButton.tsx +1 -0
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -0
- package/src/core/components/menu/__workshop__/tones.tsx +1 -0
- package/src/core/components/menu/menu.test.tsx +1 -0
- package/src/core/components/menu/menu.tsx +1 -0
- package/src/core/components/menu/menuButton.tsx +4 -3
- package/src/core/components/menu/menuGroup.tsx +1 -0
- package/src/core/components/menu/menuItem.tsx +1 -1
- package/src/core/components/menu/useMenu.ts +1 -0
- package/src/core/components/menu/useMenuController.ts +1 -0
- package/src/core/components/skeleton/__workshop__/delay.tsx +1 -0
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +1 -0
- package/src/core/components/skeleton/skeleton.tsx +2 -2
- package/src/core/components/skeleton/textSkeleton.tsx +3 -2
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.tsx +2 -1
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/__workshop__/toast.tsx +1 -0
- package/src/core/components/toast/styles.ts +2 -1
- package/src/core/components/toast/toast.tsx +4 -4
- package/src/core/components/toast/toastLayer.tsx +1 -0
- package/src/core/components/toast/toastProvider.tsx +1 -0
- package/src/core/components/toast/useToast.ts +1 -0
- package/src/core/components/tree/__workshop__/basic.tsx +1 -0
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +2 -1
- package/src/core/components/tree/style.ts +1 -0
- package/src/core/components/tree/tree.tsx +1 -0
- package/src/core/components/tree/treeGroup.tsx +1 -0
- package/src/core/components/tree/treeItem.tsx +3 -2
- package/src/core/components/tree/useTree.ts +1 -0
- package/src/core/helpers/focus.ts +2 -2
- package/src/core/hooks/useArrayProp.ts +1 -0
- package/src/core/hooks/useClickOutside.test.tsx +0 -1
- package/src/core/hooks/useClickOutside.ts +1 -0
- package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -1
- package/src/core/hooks/useClickOutsideEvent.ts +1 -0
- package/src/core/hooks/useDelayed.test.ts +2 -1
- package/src/core/hooks/useDelayedState.ts +1 -2
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -0
- package/src/core/hooks/useElementSize.ts +2 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +1 -0
- package/src/core/hooks/usePrefersDark.test.tsx +2 -1
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +2 -1
- package/src/core/index.ts +1 -2
- package/src/core/lib/createGlobalScopedContext.ts +2 -1
- package/src/core/primitives/_selectable/selectable.tsx +1 -0
- package/src/core/primitives/_selectable/style.ts +1 -0
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -0
- package/src/core/primitives/avatar/avatar.tsx +2 -7
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -2
- package/src/core/primitives/avatar/avatarStack.tsx +3 -2
- package/src/core/primitives/avatar/styles.ts +2 -1
- package/src/core/primitives/avatar/types.ts +1 -0
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -0
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -0
- package/src/core/primitives/badge/badge.test.tsx +1 -0
- package/src/core/primitives/badge/badge.tsx +1 -0
- package/src/core/primitives/badge/styles.ts +1 -0
- package/src/core/primitives/box/__workshop__/props.tsx +1 -0
- package/src/core/primitives/box/box.tsx +3 -2
- package/src/core/primitives/button/__workshop__/custom.tsx +3 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +1 -0
- package/src/core/primitives/button/__workshop__/props.tsx +2 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +1 -0
- package/src/core/primitives/button/button.test.tsx +1 -0
- package/src/core/primitives/button/button.tsx +1 -0
- package/src/core/primitives/button/styles.ts +1 -0
- package/src/core/primitives/card/__workshop__/asButton.tsx +1 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -0
- package/src/core/primitives/card/__workshop__/props.tsx +3 -1
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/card/card.tsx +1 -0
- package/src/core/primitives/card/styles.ts +1 -0
- package/src/core/primitives/checkbox/checkbox.tsx +1 -0
- package/src/core/primitives/checkbox/styles.ts +1 -0
- package/src/core/primitives/code/__workshop__/props.tsx +1 -0
- package/src/core/primitives/code/code.tsx +2 -1
- package/src/core/primitives/container/__workshop__/example.tsx +1 -0
- package/src/core/primitives/container/container.tsx +1 -0
- package/src/core/primitives/container/styles.ts +2 -1
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -0
- package/src/core/primitives/flex/flex.tsx +2 -1
- package/src/core/primitives/grid/grid.tsx +1 -0
- package/src/core/primitives/heading/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +1 -0
- package/src/core/primitives/heading/styles.ts +1 -0
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/inline/inline.tsx +2 -1
- package/src/core/primitives/inline/styles.ts +2 -1
- package/src/core/primitives/kbd/kbd.tsx +2 -1
- package/src/core/primitives/label/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/label/label.tsx +1 -0
- package/src/core/primitives/label/styles.ts +1 -0
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +1 -0
- package/src/core/primitives/popover/floating-ui/size.ts +2 -1
- package/src/core/primitives/popover/popover.tsx +6 -7
- package/src/core/primitives/popover/popoverCard.tsx +2 -1
- package/src/core/primitives/radio/radio.tsx +2 -1
- package/src/core/primitives/radio/styles.ts +1 -0
- package/src/core/primitives/select/select.tsx +2 -1
- package/src/core/primitives/select/styles.ts +3 -3
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -0
- package/src/core/primitives/spinner/spinner.tsx +2 -1
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/stack/stack.tsx +2 -1
- package/src/core/primitives/stack/styles.ts +2 -1
- package/src/core/primitives/switch/styles.ts +1 -0
- package/src/core/primitives/switch/switch.tsx +2 -1
- package/src/core/primitives/text/__workshop__/colored.tsx +3 -2
- package/src/core/primitives/text/__workshop__/example.tsx +1 -0
- package/src/core/primitives/text/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +1 -0
- package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/textArea/textArea.tsx +6 -5
- package/src/core/primitives/textInput/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -0
- package/src/core/primitives/textInput/textInput.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/props.tsx +3 -2
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +4 -2
- package/src/core/primitives/tooltip/tooltip.tsx +6 -5
- package/src/core/primitives/tooltip/tooltipCard.tsx +2 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +1 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -0
- package/src/core/styles/border/borderStyle.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +1 -0
- package/src/core/styles/card/_cardColorStyle.ts +1 -2
- package/src/core/styles/flex/flexItemStyle.ts +1 -0
- package/src/core/styles/flex/flexStyle.ts +2 -1
- package/src/core/styles/flex/index.ts +1 -1
- package/src/core/styles/flex/types.ts +1 -0
- package/src/core/styles/font/codeFontStyle.ts +1 -0
- package/src/core/styles/font/headingFontStyle.ts +1 -0
- package/src/core/styles/font/labelFontStyle.ts +1 -0
- package/src/core/styles/font/responsiveFont.ts +3 -3
- package/src/core/styles/font/textAlignStyle.ts +1 -0
- package/src/core/styles/font/textFontStyle.ts +1 -0
- package/src/core/styles/font/types.ts +1 -0
- package/src/core/styles/grid/gridItemStyle.ts +1 -0
- package/src/core/styles/grid/gridStyle.ts +2 -1
- package/src/core/styles/grid/index.ts +1 -1
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -1
- package/src/core/styles/input/textInputStyle.ts +3 -3
- package/src/core/styles/margin/marginStyle.ts +1 -0
- package/src/core/styles/margin/marginsStyle.test.ts +1 -0
- package/src/core/styles/padding/paddingStyle.test.ts +1 -0
- package/src/core/styles/padding/paddingStyle.ts +1 -0
- package/src/core/styles/radius/radiusStyle.ts +1 -0
- package/src/core/styles/shadow/shadowStyle.ts +3 -3
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/__workshop__/build/story.tsx +18 -9
- package/src/core/theme/__workshop__/canvas.tsx +7 -6
- package/src/core/theme/__workshop__/debug/story.tsx +5 -3
- package/src/core/theme/index.ts +1 -1
- package/src/core/theme/theme.test.tsx +1 -0
- package/src/core/theme/themeColorProvider.tsx +1 -0
- package/src/core/theme/themeProvider.tsx +3 -2
- package/src/core/theme/useRootTheme.ts +1 -0
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +4 -3
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +1 -0
- package/src/core/utils/boundaryElement/index.ts +1 -1
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -0
- package/src/core/utils/elementQuery/elementQuery.tsx +1 -0
- package/src/core/utils/errorBoundary.tsx +1 -0
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +1 -0
- package/src/core/utils/layer/__workshop__/nested.tsx +1 -0
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +1 -0
- package/src/core/utils/layer/index.ts +1 -1
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/layerProvider.tsx +2 -1
- package/src/core/utils/layer/useLayer.ts +1 -0
- package/src/core/utils/portal/portal.ts +1 -0
- package/src/core/utils/portal/portalProvider.tsx +1 -0
- package/src/core/utils/portal/usePortal.ts +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +1 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +1 -1
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +1 -1
- package/src/theme/build/_deprecated/color/factory.ts +6 -6
- package/src/theme/build/buildColorTheme.ts +15 -15
- package/src/theme/build/colorToken/colorToken.ts +1 -1
- package/src/theme/build/mixThemeColor.ts +1 -1
- package/src/theme/build/renderColorTheme.ts +7 -6
- package/src/theme/build/renderColorValue.ts +3 -2
- package/src/theme/build/resolveColorTokens.ts +5 -4
- package/src/theme/config/helpers.ts +2 -2
- package/src/theme/config/system.ts +2 -1
- package/src/theme/config/tokens/color/types.ts +2 -1
- package/src/theme/config/tokens/types.ts +2 -1
- package/src/theme/config/types.ts +2 -1
- package/src/theme/system/color/_helpers.ts +1 -0
- package/src/theme/system/color/_system.ts +1 -1
- package/src/theme/system/color/color.ts +1 -1
- package/src/theme/system/index.ts +1 -2
- package/src/theme/system/theme.ts +2 -2
- package/src/theme/system/v0/color/index.ts +1 -1
- package/src/theme/system/v0/index.ts +1 -1
- package/src/theme/versioning/themeColor_v0_v2.ts +5 -5
- package/dist/_chunks-cjs/getTheme_v2.js +0 -397
- package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -398
- package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
- package/src/core/__workshop__/fontsPlugin.tsx +0 -76
- /package/src/core/components/autocomplete/{__fixtures__ → __mocks__}/countries.ts +0 -0
- /package/src/core/primitives/kbd/{index.tsx → index.ts} +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/** @jest-environment jsdom */
|
|
2
|
-
import {screen, act, fireEvent} from '@testing-library/react'
|
|
3
2
|
import '../../../../test/mocks/resizeObserver.mock'
|
|
4
3
|
import '../../../../test/mocks/matchMedia.mock'
|
|
4
|
+
|
|
5
|
+
import {act, fireEvent, screen} from '@testing-library/react'
|
|
6
|
+
|
|
5
7
|
import {render} from '../../../../test'
|
|
6
|
-
import {
|
|
8
|
+
import {Button, Text} from '../../primitives'
|
|
7
9
|
import {Tooltip, TooltipDelayGroupProvider} from '../tooltip'
|
|
8
10
|
|
|
9
11
|
// Fake timers using Jest
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
arrow,
|
|
3
3
|
autoUpdate,
|
|
4
4
|
flip,
|
|
5
|
+
type Middleware,
|
|
5
6
|
offset,
|
|
7
|
+
type RootBoundary,
|
|
6
8
|
shift,
|
|
7
9
|
useFloating,
|
|
8
|
-
type Middleware,
|
|
9
|
-
type RootBoundary,
|
|
10
10
|
} from '@floating-ui/react-dom'
|
|
11
11
|
import type {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
12
12
|
import {AnimatePresence} from 'framer-motion'
|
|
@@ -15,15 +15,16 @@ import {
|
|
|
15
15
|
forwardRef,
|
|
16
16
|
useCallback,
|
|
17
17
|
useEffect,
|
|
18
|
-
useMemo,
|
|
19
|
-
useRef,
|
|
20
|
-
useState,
|
|
21
18
|
useId,
|
|
22
19
|
useImperativeHandle,
|
|
23
20
|
useLayoutEffect,
|
|
21
|
+
useMemo,
|
|
22
|
+
useRef,
|
|
23
|
+
useState,
|
|
24
24
|
} from 'react'
|
|
25
25
|
import {styled} from 'styled-components'
|
|
26
26
|
import {useEffectEvent} from 'use-effect-event'
|
|
27
|
+
|
|
27
28
|
import {useArrayProp, usePrefersReducedMotion} from '../../hooks'
|
|
28
29
|
import {useDelayedState} from '../../hooks/useDelayedState'
|
|
29
30
|
import {origin} from '../../middleware/origin'
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
|
|
2
|
-
import {type MotionProps
|
|
2
|
+
import {motion, type MotionProps} from 'framer-motion'
|
|
3
3
|
import React, {CSSProperties, forwardRef, memo, useMemo} from 'react'
|
|
4
4
|
import {styled} from 'styled-components'
|
|
5
|
+
|
|
5
6
|
import {POPOVER_MOTION_PROPS} from '../../constants'
|
|
6
7
|
import {Placement, Radius} from '../../types'
|
|
7
8
|
import {Arrow} from '../../utils'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import {CSSObject, getTheme_v2, ThemeFontKey, ThemeFontSize} from '@sanity/ui/theme'
|
|
2
|
+
|
|
3
|
+
import {_responsive, rem} from '../helpers'
|
|
4
4
|
import {ThemeProps} from '../types'
|
|
5
5
|
import {ResponsiveFontStyleProps} from './types'
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {ThemeColorSchemeKey, ThemeFontWeightKey
|
|
2
|
-
import {CSSObject} from '@sanity/ui/theme'
|
|
1
|
+
import {CSSObject, getTheme_v2, ThemeColorSchemeKey, ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
3
2
|
import {css} from 'styled-components'
|
|
3
|
+
|
|
4
4
|
import {CardTone} from '../../types'
|
|
5
5
|
import {focusRingBorderStyle, focusRingStyle} from '../focusRing'
|
|
6
|
-
import {
|
|
6
|
+
import {_responsive, rem} from '../helpers'
|
|
7
7
|
import {ThemeProps} from '../types'
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {ThemeBoxShadow, ThemeShadow
|
|
2
|
-
|
|
1
|
+
import {CSSObject, getTheme_v2, ThemeBoxShadow, ThemeShadow} from '@sanity/ui/theme'
|
|
2
|
+
|
|
3
3
|
import {EMPTY_RECORD} from '../../constants'
|
|
4
|
-
import {
|
|
4
|
+
import {_responsive, rem} from '../helpers'
|
|
5
5
|
import {ThemeProps} from '../types'
|
|
6
6
|
import {ResponsiveShadowStyleProps} from './types'
|
|
7
7
|
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
ThemeColorCard_v2,
|
|
4
|
-
ThemeColorInputMode_v2,
|
|
5
|
-
ThemeColorState_v2,
|
|
6
|
-
} from '@sanity/ui/theme'
|
|
7
|
-
import {
|
|
2
|
+
buildTheme,
|
|
8
3
|
THEME_COLOR_BUTTON_MODES,
|
|
9
4
|
THEME_COLOR_CARD_TONES,
|
|
10
5
|
THEME_COLOR_INPUT_MODES,
|
|
11
6
|
THEME_COLOR_STATE_TONES,
|
|
7
|
+
ThemeColorButtonTone_v2,
|
|
8
|
+
ThemeColorCard_v2,
|
|
12
9
|
ThemeColorCardToneKey,
|
|
10
|
+
ThemeColorInputMode_v2,
|
|
13
11
|
ThemeColorInputModeKey,
|
|
12
|
+
ThemeColorState_v2,
|
|
14
13
|
} from '@sanity/ui/theme'
|
|
15
|
-
|
|
14
|
+
|
|
16
15
|
import {rem} from '../../../styles'
|
|
17
16
|
import {useTheme_v2} from '../../useTheme'
|
|
18
17
|
import {getCSSProps} from './helpers'
|
|
@@ -171,6 +170,7 @@ function StatePreview(props: {theme: ThemeColorState_v2}) {
|
|
|
171
170
|
display: 'flex',
|
|
172
171
|
gap: 'var(--space-1)',
|
|
173
172
|
}}
|
|
173
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
174
174
|
tabIndex={0}
|
|
175
175
|
>
|
|
176
176
|
<div style={{flex: 'none'}}>Card</div>
|
|
@@ -280,6 +280,7 @@ function ButtonPreview(props: {theme: ThemeColorButtonTone_v2}) {
|
|
|
280
280
|
<div
|
|
281
281
|
className="button"
|
|
282
282
|
style={{flex: 1, padding: 'var(--space-2)', display: 'flex', gap: 4}}
|
|
283
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
283
284
|
tabIndex={0}
|
|
284
285
|
>
|
|
285
286
|
<div style={{flex: 'none'}}>Button</div>
|
|
@@ -442,10 +443,18 @@ function InputPreview(props: {mode: ThemeColorInputModeKey; theme: ThemeColorInp
|
|
|
442
443
|
} as any
|
|
443
444
|
}
|
|
444
445
|
>
|
|
445
|
-
<div
|
|
446
|
+
<div
|
|
447
|
+
className="input"
|
|
448
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
449
|
+
tabIndex={0}
|
|
450
|
+
>
|
|
446
451
|
<span>Text ({mode})</span> <span className="placeholder">Placeholder</span>
|
|
447
452
|
</div>
|
|
448
|
-
<div
|
|
453
|
+
<div
|
|
454
|
+
className="input readOnly"
|
|
455
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
456
|
+
tabIndex={0}
|
|
457
|
+
>
|
|
449
458
|
<span>Text ({mode})</span>
|
|
450
459
|
</div>
|
|
451
460
|
<div className="input disabled">
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
useRootTheme,
|
|
11
11
|
} from '@sanity/ui'
|
|
12
12
|
import {
|
|
13
|
+
getContrastRatio,
|
|
14
|
+
mix,
|
|
15
|
+
parseColor,
|
|
16
|
+
rgbToHex,
|
|
17
|
+
ThemeColorButton_v2,
|
|
13
18
|
ThemeColorButtonMode_v2,
|
|
14
19
|
ThemeColorButtonTone_v2,
|
|
15
|
-
ThemeColorButton_v2,
|
|
16
20
|
ThemeColorCard_v2,
|
|
17
21
|
ThemeColorScheme_v2,
|
|
18
|
-
ThemeColorSelectableTone_v2,
|
|
19
22
|
ThemeColorSelectable_v2,
|
|
23
|
+
ThemeColorSelectableTone_v2,
|
|
20
24
|
ThemeColorState_v2,
|
|
21
|
-
getContrastRatio,
|
|
22
|
-
mix,
|
|
23
|
-
parseColor,
|
|
24
|
-
rgbToHex,
|
|
25
25
|
} from '@sanity/ui/theme'
|
|
26
26
|
import {useBoolean} from '@sanity/ui-workshop'
|
|
27
27
|
import {createContext, useContext} from 'react'
|
|
@@ -175,6 +175,7 @@ function ColorBase(props: {color: ThemeColorCard_v2}) {
|
|
|
175
175
|
|
|
176
176
|
<Text accent>Accent</Text>
|
|
177
177
|
<Text>
|
|
178
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
178
179
|
<a href="#">Link</a>
|
|
179
180
|
</Text>
|
|
180
181
|
<Text>
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {CropIcon} from '@sanity/icons'
|
|
2
2
|
import {
|
|
3
3
|
THEME_COLOR_BUTTON_MODES,
|
|
4
|
-
THEME_COLOR_STATES,
|
|
5
4
|
THEME_COLOR_STATE_TONES,
|
|
6
|
-
|
|
5
|
+
THEME_COLOR_STATES,
|
|
7
6
|
ThemeColorCard_v2,
|
|
8
|
-
|
|
7
|
+
ThemeColorCardToneKey,
|
|
9
8
|
ThemeColorScheme_v2,
|
|
9
|
+
ThemeColorSchemeKey,
|
|
10
10
|
ThemeColorState_v2,
|
|
11
11
|
} from '@sanity/ui/theme'
|
|
12
12
|
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
13
13
|
import {CSSProperties} from 'react'
|
|
14
|
+
|
|
14
15
|
import {Badge, Box, Flex, KBD, Stack, Text} from '../../../primitives'
|
|
15
16
|
import {useRootTheme} from '../../useRootTheme'
|
|
16
17
|
|
|
@@ -148,6 +149,7 @@ function DebugState() {
|
|
|
148
149
|
Accent
|
|
149
150
|
</Text>
|
|
150
151
|
<Text size={1}>
|
|
152
|
+
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
151
153
|
<a href="#" style={{color: 'var(--card-link-fg-color)'}}>
|
|
152
154
|
Link
|
|
153
155
|
</a>
|
package/src/core/theme/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getScopedTheme,
|
|
2
3
|
type RootTheme,
|
|
4
|
+
type Theme,
|
|
3
5
|
type ThemeColorCardToneKey,
|
|
4
6
|
type ThemeColorSchemeKey,
|
|
5
|
-
type Theme,
|
|
6
|
-
getScopedTheme,
|
|
7
7
|
} from '@sanity/ui/theme'
|
|
8
8
|
import {useContext, useMemo} from 'react'
|
|
9
9
|
import {ThemeProvider as StyledThemeProvider} from 'styled-components'
|
|
10
|
+
|
|
10
11
|
import {ThemeContext} from './themeContext'
|
|
11
12
|
import {ThemeContextValue} from './types'
|
|
12
13
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {ForwardedRef,
|
|
2
|
-
import {
|
|
1
|
+
import {ForwardedRef, forwardRef, HTMLProps} from 'react'
|
|
2
|
+
import {css, styled} from 'styled-components'
|
|
3
|
+
|
|
3
4
|
import {useTheme_v2} from '../../theme'
|
|
4
|
-
import {
|
|
5
|
+
import {compileCommands, getRoundedCommands, Point} from './cmds'
|
|
5
6
|
|
|
6
7
|
const StyledArrow = styled.div<{$w: number}>(
|
|
7
8
|
({$w: w}) => css`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {FocusEvent, forwardRef, useCallback, useEffect, useImperativeHandle, useRef} from 'react'
|
|
2
2
|
import {styled} from 'styled-components'
|
|
3
|
+
|
|
3
4
|
import {EMPTY_RECORD} from '../../constants'
|
|
4
5
|
import {containsOrEqualsElement, isHTMLElement} from '../../helpers'
|
|
5
6
|
import {LayerProvider} from './layerProvider'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {useCallback, useContext, useEffect, useMemo, useState} from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import {useArrayProp, useMediaIndex} from '../../hooks'
|
|
3
4
|
import {getLayerContext} from './getLayerContext'
|
|
4
5
|
import {LayerContext} from './layerContext'
|
|
5
6
|
import {LayerContextValue} from './types'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'
|
|
2
2
|
import {styled} from 'styled-components'
|
|
3
|
+
|
|
3
4
|
import {_isScrollable} from '../../helpers'
|
|
4
5
|
import {_ResizeObserver} from '../../observers'
|
|
5
6
|
import {StackProps} from '../../primitives'
|