@sanity/ui 3.0.0-static.26 → 3.0.0-static.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +674 -804
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/refractor.cjs +2 -2
- package/dist/_chunks-cjs/refractor.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +652 -781
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/refractor.js +1 -1
- package/dist/_visual-editing.d.cts +1 -0
- package/dist/_visual-editing.d.ts +1 -0
- package/dist/css/layers.css +4 -0
- package/dist/css/primitives/popover/popover.css +4 -0
- package/dist/css.cjs +59 -50
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +14 -6
- package/dist/css.d.ts +14 -6
- package/dist/css.js +59 -50
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +1995 -1813
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.cts +35 -17
- package/dist/index.d.ts +35 -17
- package/dist/index.js +2013 -1832
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +2605 -1075
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +2689 -1159
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +2 -2
- package/package.json +20 -38
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +13 -17
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/core/components/autocomplete/constants.ts +3 -1
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +8 -3
- package/src/core/components/dialog/__workshop__/activate.tsx +11 -3
- package/src/core/components/dialog/__workshop__/panes.tsx +12 -5
- package/src/core/components/dialog/dialog.tsx +12 -13
- package/src/core/components/dialog/dialogCard.tsx +89 -53
- package/src/core/components/dialog/dialogContext.ts +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +1 -1
- package/src/core/components/dialog/index.ts +1 -0
- package/src/core/components/dialog/isTargetWithinScope.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +3 -2
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +12 -6
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -5
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -2
- package/src/core/components/menu/helpers.ts +1 -1
- package/src/core/components/menu/menu.tsx +6 -4
- package/src/core/components/menu/menuButton.tsx +5 -3
- package/src/core/components/menu/menuDivider.tsx +1 -1
- package/src/core/components/menu/menuGroup.tsx +8 -4
- package/src/core/components/menu/menuItem.tsx +4 -2
- package/src/core/components/tab/tab.tsx +2 -2
- package/src/core/components/tab/tabList.tsx +2 -2
- package/src/core/components/tab/tabPanel.tsx +2 -2
- package/src/core/components/toast/toast.tsx +7 -2
- package/src/core/components/toast/toastLayer.tsx +2 -2
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/tree.tsx +2 -2
- package/src/core/components/tree/treeGroup.tsx +2 -2
- package/src/core/components/tree/treeItem.tsx +13 -6
- package/src/core/components/tree/types.ts +0 -1
- package/src/core/{utils → components}/virtualList/__workshop__/index.ts +1 -1
- package/src/core/{utils → components}/virtualList/virtualList.tsx +10 -5
- package/src/core/helpers/focus.ts +0 -8
- package/src/core/hooks/useArrayProp.ts +1 -1
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -3
- package/src/core/hooks/useElementSize.ts +1 -1
- package/src/core/hooks/useResponsiveProp.ts +1 -1
- package/src/core/index.ts +83 -7
- package/src/core/observers/{elementSizeObserver.ts → elementSize.ts} +1 -1
- package/src/core/primitives/_selectable/index.ts +1 -0
- package/src/core/primitives/_selectable/selectable.tsx +13 -3
- package/src/core/{types/selectable.ts → primitives/_selectable/types.ts} +1 -1
- package/src/core/{utils → primitives}/arrow/arrow.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +4 -3
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -3
- package/src/core/primitives/avatar/avatarStack.tsx +4 -4
- package/src/core/primitives/avatar/types.ts +17 -0
- package/src/core/primitives/badge/badge.tsx +4 -2
- package/src/core/primitives/badge/types.ts +11 -2
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -1
- package/src/core/primitives/box/box.tsx +1 -1
- package/src/core/primitives/box/index.ts +1 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +37 -51
- package/src/core/primitives/button/__workshop__/index.ts +5 -0
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +13 -0
- package/src/core/primitives/button/button.tsx +15 -14
- package/src/core/primitives/button/index.ts +1 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +2 -2
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/types.ts +3 -0
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +9 -1
- package/src/core/primitives/checkbox/checkbox.tsx +3 -4
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +17 -42
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/container/container.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -1
- package/src/core/primitives/flex/index.ts +1 -0
- package/src/core/primitives/grid/grid.tsx +1 -1
- package/src/core/primitives/grid/index.ts +1 -0
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +1 -1
- package/src/core/primitives/kbd/kbd.tsx +1 -1
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/{utils → primitives}/layer/__workshop__/index.ts +1 -1
- package/src/core/{utils → primitives}/layer/layer.test.tsx +1 -1
- package/src/core/{utils → primitives}/layer/layer.tsx +2 -2
- package/src/core/{utils → primitives}/layer/layerCard.tsx +3 -3
- package/src/core/{utils → primitives}/layer/layerProvider.tsx +2 -1
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +12 -9
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +9 -8
- package/src/core/primitives/popover/constants.ts +1 -1
- package/src/core/primitives/popover/floating-ui/size.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +8 -4
- package/src/core/primitives/popover/popoverLayer.tsx +4 -2
- package/src/core/primitives/popover/types.ts +5 -0
- package/src/core/primitives/radio/radio.tsx +2 -2
- package/src/core/primitives/select/select.tsx +2 -2
- package/src/core/{components → primitives}/skeleton/__workshop__/index.ts +1 -1
- package/src/core/{components → primitives}/skeleton/codeSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/headingSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/labelSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/skeleton.tsx +7 -8
- package/src/core/{components → primitives}/skeleton/textSkeleton.tsx +1 -1
- package/src/core/primitives/spinner/spinner.tsx +1 -1
- package/src/core/{utils → primitives}/srOnly/srOnly.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +2 -1
- package/src/core/primitives/switch/switch.tsx +2 -7
- package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +17 -42
- package/src/core/primitives/text/text.tsx +3 -1
- package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/textArea/textArea.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +3 -2
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +6 -3
- package/src/core/primitives/tooltip/tooltipLayer.tsx +3 -2
- package/src/core/primitives/types.ts +8 -10
- package/src/core/types/radius.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +9 -5
- package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
- package/src/core/utils/getElementRef.ts +1 -0
- package/src/core/utils/portal/portal.tsx +1 -1
- package/src/css/components/dialog/dialog.css.ts +26 -1
- package/src/css/components/dialog/dialog.ts +27 -7
- package/src/css/components/skeleton/skeleton.ts +3 -1
- package/src/css/components/skeleton/types.ts +3 -1
- package/src/css/index.ts +75 -5
- package/src/css/primitives/_input/input.ts +2 -1
- package/src/css/primitives/_input/types.ts +2 -1
- package/src/css/primitives/_selectable/_selectable.css.ts +32 -24
- package/src/css/primitives/_selectable/selectable.ts +1 -1
- package/src/css/primitives/_selectable/types.ts +1 -1
- package/src/css/primitives/avatar/avatar.css.ts +11 -2
- package/src/css/primitives/avatar/avatar.ts +1 -1
- package/src/css/primitives/badge/badge.css.ts +2 -1
- package/src/css/primitives/badge/types.ts +0 -2
- package/src/css/primitives/box/box.ts +35 -37
- package/src/css/primitives/box/types.ts +34 -36
- package/src/css/primitives/button/button.css.ts +4 -0
- package/src/css/primitives/button/button.ts +5 -2
- package/src/css/primitives/button/types.ts +4 -11
- package/src/css/primitives/card/__workshop__/color.tsx +70 -0
- package/src/css/primitives/card/__workshop__/index.ts +14 -0
- package/src/css/primitives/card/card.css.ts +4 -0
- package/src/css/primitives/code/code.ts +3 -1
- package/src/css/primitives/code/types.ts +2 -1
- package/src/css/primitives/container/container.ts +3 -1
- package/src/css/primitives/heading/heading.ts +4 -1
- package/src/css/primitives/heading/types.ts +3 -1
- package/src/css/primitives/kbd/kbd.ts +1 -1
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.css.ts +1 -0
- package/src/css/primitives/label/label.ts +4 -1
- package/src/css/primitives/label/types.ts +3 -1
- package/src/css/primitives/switch/switch.css.ts +1 -1
- package/src/css/primitives/text/text.ts +6 -1
- package/src/css/primitives/text/types.ts +5 -2
- package/src/css/props/width/types.ts +1 -1
- package/src/css/props/width/width.css.ts +3 -0
- package/src/theme/v2/build/buildTheme.test.ts +8 -8
- package/src/theme/v2/build/buildTheme.ts +32 -7
- package/src/theme/v3/defaultFonts.ts +6 -6
- package/src/theme/v3/defaultTokens.ts +1 -1
- package/bin/sanity-ui.cjs +0 -5
- package/dist/ui.css +0 -1
- package/src/cli/buildCommand.ts +0 -10
- package/src/cli/index.ts +0 -26
- package/src/core/components/autocomplete/index.ts +0 -2
- package/src/core/components/index.ts +0 -9
- package/src/core/helpers/index.ts +0 -5
- package/src/core/hooks/index.ts +0 -13
- package/src/core/observers/index.ts +0 -2
- package/src/core/primitives/index.ts +0 -27
- package/src/core/types/avatar.ts +0 -16
- package/src/core/types/card.ts +0 -4
- package/src/core/types/index.ts +0 -15
- package/src/core/types/popover.ts +0 -4
- package/src/core/utils/index.ts +0 -8
- package/src/css/__theme/index.ts +0 -16
- package/src/css/__theme/lib/contract/buildVarContract.ts +0 -78
- package/src/css/__theme/lib/contract/index.ts +0 -4
- package/src/css/__theme/lib/contract/types.ts +0 -17
- package/src/css/__theme/resolveTheme.ts +0 -865
- package/src/css/components/index.ts +0 -6
- package/src/css/primitives/index.ts +0 -24
- package/src/css/props/index.ts +0 -37
- package/src/css/utils/srOnly/index.ts +0 -1
- /package/src/core/{global.ts → __DEV__.ts} +0 -0
- /package/src/core/{types/dialog.ts → components/dialog/types.ts} +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/index.ts +0 -0
- /package/src/core/observers/{resizeObserver.ts → resize.ts} +0 -0
- /package/src/core/{utils → primitives}/arrow/cmds.ts +0 -0
- /package/src/core/{utils → primitives}/arrow/index.ts +0 -0
- /package/src/core/{types/badge.ts → primitives/badge/types2.ts} +0 -0
- /package/src/core/{types/box.ts → primitives/box/types.ts} +0 -0
- /package/src/core/{types/button.ts → primitives/button/types.ts} +0 -0
- /package/src/core/{types/flex.ts → primitives/flex/types.ts} +0 -0
- /package/src/core/{types/grid.ts → primitives/grid/types.ts} +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/_debug.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/nested.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/getLayerContext.test.ts +0 -0
- /package/src/core/{utils → primitives}/layer/getLayerContext.ts +0 -0
- /package/src/core/{utils → primitives}/layer/index.ts +0 -0
- /package/src/core/{utils → primitives}/layer/layerContext.ts +0 -0
- /package/src/core/{utils → primitives}/layer/types.ts +0 -0
- /package/src/core/{utils → primitives}/layer/useLayer.ts +0 -0
- /package/src/core/{components → primitives}/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/core/{components → primitives}/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/core/{components → primitives}/skeleton/index.ts +0 -0
- /package/src/core/{utils → primitives}/srOnly/index.ts +0 -0
- /package/src/core/types/{text.ts → textAlign.ts} +0 -0
- /package/src/css/{utils → primitives/srOnly}/index.ts +0 -0
- /package/src/css/{utils → primitives}/srOnly/srOnly.css.ts +0 -0
- /package/src/css/{utils → primitives}/srOnly/srOnly.ts +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
2
|
import {_responsiveClassName} from '../../_responsiveClassName'
|
|
3
|
-
import {display
|
|
3
|
+
import {display} from '../../props/display'
|
|
4
|
+
import {flex} from '../../props/flex'
|
|
5
|
+
import {font} from '../../props/font'
|
|
6
|
+
import {textAlign} from '../../props/textAlign'
|
|
4
7
|
import {muted, root, sizes} from './label.css'
|
|
5
8
|
import type {LabelStyleProps} from './types'
|
|
6
9
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type {FontLabelSize} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import type {FlexStyleProps
|
|
3
|
+
import type {FlexStyleProps} from '../../props/flex'
|
|
4
|
+
import type {FontStyleProps} from '../../props/font'
|
|
5
|
+
import type {TextAlignStyleProps} from '../../props/textAlign'
|
|
4
6
|
import type {ResponsiveProp} from '../../types'
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -55,7 +55,7 @@ export const presentation = _style(layers.primitives, {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
-
[`${input}
|
|
58
|
+
[`${input}:indeterminate + &`]: {
|
|
59
59
|
vars: {
|
|
60
60
|
[vars.input.switch.thumb.offset]:
|
|
61
61
|
`calc(${vars.input.switch.width} / 2 - ${vars.input.switch.thumb.size} / 2 - ${vars.input.switch.padding})`,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
2
|
import {_responsiveClassName} from '../../_responsiveClassName'
|
|
3
|
-
import {display
|
|
3
|
+
import {display} from '../../props/display'
|
|
4
|
+
import {flex} from '../../props/flex'
|
|
5
|
+
import {font} from '../../props/font'
|
|
6
|
+
import {maxWidth} from '../../props/maxWidth'
|
|
7
|
+
import {textAlign} from '../../props/textAlign'
|
|
4
8
|
import {muted, root, sizes} from './text.css'
|
|
5
9
|
import type {TextStyleProps} from './types'
|
|
6
10
|
|
|
@@ -14,6 +18,7 @@ export function text(props: TextStyleProps): string | undefined {
|
|
|
14
18
|
display({display: 'block'}),
|
|
15
19
|
flex(props),
|
|
16
20
|
font(props),
|
|
21
|
+
maxWidth(props),
|
|
17
22
|
textAlign({textAlign: props.align}),
|
|
18
23
|
)
|
|
19
24
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type {FlexStyleProps
|
|
1
|
+
import type {FlexStyleProps} from '../../props/flex'
|
|
2
|
+
import type {FontStyleProps} from '../../props/font'
|
|
3
|
+
import type {MaxWidthStyleProps} from '../../props/maxWidth'
|
|
4
|
+
import type {TextAlignStyleProps} from '../../props/textAlign'
|
|
2
5
|
import type {ResponsiveProp} from '../../types'
|
|
3
6
|
|
|
4
7
|
/** @public */
|
|
5
8
|
export type TextSize = number
|
|
6
9
|
|
|
7
10
|
/** @public */
|
|
8
|
-
export interface TextStyleProps extends FlexStyleProps, FontStyleProps {
|
|
11
|
+
export interface TextStyleProps extends FlexStyleProps, FontStyleProps, MaxWidthStyleProps {
|
|
9
12
|
/**
|
|
10
13
|
* @deprecated Will be removed in next major version
|
|
11
14
|
*/
|
|
@@ -3,7 +3,7 @@ import type {ContainerWidth} from '@sanity/ui/theme'
|
|
|
3
3
|
import type {ResponsiveProp} from '../../types'
|
|
4
4
|
|
|
5
5
|
/** @public */
|
|
6
|
-
export type Width = ContainerWidth | 'auto' | 'fill' | 'stretch'
|
|
6
|
+
export type Width = ContainerWidth | 'auto' | 'fill' | 'stretch' | 'min'
|
|
7
7
|
|
|
8
8
|
/** @public */
|
|
9
9
|
export interface WidthStyleProps {
|
|
@@ -14,6 +14,9 @@ export const options: ResponsiveRuleOptions<Width> = {
|
|
|
14
14
|
fill: _responsiveStyle(layers.props, {
|
|
15
15
|
width: '100%',
|
|
16
16
|
}),
|
|
17
|
+
min: _responsiveStyle(layers.props, {
|
|
18
|
+
width: 'min-content',
|
|
19
|
+
}),
|
|
17
20
|
stretch: _responsiveStyle(layers.props, {
|
|
18
21
|
width: 'stretch',
|
|
19
22
|
}),
|
|
@@ -59,31 +59,31 @@ test('build theme', () => {
|
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
}).toEqual({
|
|
62
|
-
|
|
63
|
-
bg: '
|
|
62
|
+
light: {
|
|
63
|
+
bg: 'rgba(255,255,255,0)',
|
|
64
|
+
fg: '#000000',
|
|
64
65
|
default: {
|
|
65
66
|
button: {
|
|
66
67
|
ghost: {
|
|
67
68
|
enabled: {
|
|
68
|
-
border: '
|
|
69
|
+
border: 'rgba(246,246,248,0)',
|
|
69
70
|
},
|
|
70
71
|
},
|
|
71
72
|
},
|
|
72
73
|
},
|
|
73
|
-
fg: '#ffffff',
|
|
74
74
|
},
|
|
75
|
-
|
|
76
|
-
bg: '
|
|
75
|
+
dark: {
|
|
76
|
+
bg: 'rgba(0,0,0,0)',
|
|
77
|
+
fg: '#ffffff',
|
|
77
78
|
default: {
|
|
78
79
|
button: {
|
|
79
80
|
ghost: {
|
|
80
81
|
enabled: {
|
|
81
|
-
border: '
|
|
82
|
+
border: 'rgba(19,20,27,0)',
|
|
82
83
|
},
|
|
83
84
|
},
|
|
84
85
|
},
|
|
85
86
|
},
|
|
86
|
-
fg: '#000000',
|
|
87
87
|
},
|
|
88
88
|
})
|
|
89
89
|
})
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {buildTheme_v3} from '../../v3'
|
|
1
|
+
import type {RootTheme} from '../../types'
|
|
3
2
|
import {v2_v0} from '../../versioning/v2_v0'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import type {ThemeConfig} from '../config'
|
|
4
|
+
import {defaultThemeConfig} from '../defaults/config'
|
|
5
|
+
import {defaultThemeFonts} from '../defaults/fonts'
|
|
6
|
+
import type {RootTheme_v2} from '../theme'
|
|
7
|
+
import {buildColorTheme} from './buildColorTheme'
|
|
8
|
+
import {renderThemeColorSchemes} from './renderColorTheme'
|
|
6
9
|
|
|
7
10
|
/** @internal */
|
|
8
|
-
export function buildTheme(
|
|
9
|
-
const
|
|
11
|
+
export function buildTheme(config?: ThemeConfig): RootTheme {
|
|
12
|
+
const colorTheme = buildColorTheme(config)
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
const v2: RootTheme_v2 = {
|
|
15
|
+
_version: 2,
|
|
16
|
+
avatar: config?.avatar ?? defaultThemeConfig.avatar,
|
|
17
|
+
button: config?.button ?? defaultThemeConfig.button,
|
|
18
|
+
card: config?.card ?? defaultThemeConfig.card,
|
|
19
|
+
// How colors are generated:
|
|
20
|
+
// 1. Merge custom tokens with default tokens
|
|
21
|
+
// 2. Generate tree of color keys (gray/500, black, white, etc.)
|
|
22
|
+
// 3. Apply mixing and render to hex values
|
|
23
|
+
// render(build(mergeWithDefaults()))
|
|
24
|
+
color: renderThemeColorSchemes(colorTheme, config),
|
|
25
|
+
container: config?.container ?? defaultThemeConfig.container,
|
|
26
|
+
font: config?.font ?? defaultThemeFonts,
|
|
27
|
+
input: config?.input ?? defaultThemeConfig.input,
|
|
28
|
+
layer: config?.layer ?? defaultThemeConfig.layer,
|
|
29
|
+
media: config?.media ?? defaultThemeConfig.media,
|
|
30
|
+
radius: config?.radius ?? defaultThemeConfig.radius,
|
|
31
|
+
shadow: config?.shadow ?? defaultThemeConfig.shadow,
|
|
32
|
+
space: config?.space ?? defaultThemeConfig.space,
|
|
33
|
+
style: config?.style ?? defaultThemeConfig.style,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return v2_v0(v2)
|
|
12
37
|
}
|
|
@@ -40,7 +40,7 @@ export const defaultThemeFonts: ThemeFonts_v3 = {
|
|
|
40
40
|
{
|
|
41
41
|
ascenderHeight: 7,
|
|
42
42
|
descenderHeight: 7,
|
|
43
|
-
fontSize:
|
|
43
|
+
fontSize: 18.75,
|
|
44
44
|
iconSize: 29,
|
|
45
45
|
lineHeight: 27,
|
|
46
46
|
letterSpacing: 0,
|
|
@@ -49,7 +49,7 @@ export const defaultThemeFonts: ThemeFonts_v3 = {
|
|
|
49
49
|
{
|
|
50
50
|
ascenderHeight: 8,
|
|
51
51
|
descenderHeight: 8,
|
|
52
|
-
fontSize:
|
|
52
|
+
fontSize: 21.5,
|
|
53
53
|
iconSize: 33,
|
|
54
54
|
lineHeight: 31,
|
|
55
55
|
letterSpacing: 0,
|
|
@@ -203,7 +203,7 @@ export const defaultThemeFonts: ThemeFonts_v3 = {
|
|
|
203
203
|
{
|
|
204
204
|
ascenderHeight: 4,
|
|
205
205
|
descenderHeight: 4,
|
|
206
|
-
fontSize:
|
|
206
|
+
fontSize: 9.75,
|
|
207
207
|
iconSize: 17,
|
|
208
208
|
lineHeight: 15,
|
|
209
209
|
letterSpacing: 0,
|
|
@@ -212,7 +212,7 @@ export const defaultThemeFonts: ThemeFonts_v3 = {
|
|
|
212
212
|
{
|
|
213
213
|
ascenderHeight: 5,
|
|
214
214
|
descenderHeight: 5,
|
|
215
|
-
fontSize:
|
|
215
|
+
fontSize: 12.5,
|
|
216
216
|
iconSize: 21,
|
|
217
217
|
lineHeight: 19,
|
|
218
218
|
letterSpacing: 0,
|
|
@@ -221,7 +221,7 @@ export const defaultThemeFonts: ThemeFonts_v3 = {
|
|
|
221
221
|
{
|
|
222
222
|
ascenderHeight: 6,
|
|
223
223
|
descenderHeight: 6,
|
|
224
|
-
fontSize: 15,
|
|
224
|
+
fontSize: 15.25,
|
|
225
225
|
iconSize: 25,
|
|
226
226
|
lineHeight: 23,
|
|
227
227
|
letterSpacing: 0,
|
|
@@ -239,7 +239,7 @@ export const defaultThemeFonts: ThemeFonts_v3 = {
|
|
|
239
239
|
{
|
|
240
240
|
ascenderHeight: 8,
|
|
241
241
|
descenderHeight: 8,
|
|
242
|
-
fontSize:
|
|
242
|
+
fontSize: 20.75,
|
|
243
243
|
iconSize: 33,
|
|
244
244
|
lineHeight: 31,
|
|
245
245
|
letterSpacing: 0,
|