@sanity/ui 3.0.0-static.0 → 3.0.0-static.1
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/buildCommand.js +1387 -681
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/css.d.mts +131 -12
- package/dist/css.d.ts +131 -12
- package/dist/css.esm.js +1450 -791
- package/dist/css.esm.js.map +1 -1
- package/dist/css.js +1449 -790
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +1450 -791
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +84 -76
- package/dist/index.d.ts +84 -76
- package/dist/index.esm.js +2734 -3146
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2733 -3145
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2734 -3146
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +1590 -1158
- package/dist/theme.esm.js +1565 -452
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +1599 -484
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1565 -452
- package/dist/theme.mjs.map +1 -1
- package/package.json +22 -22
- package/src/core/__workshop__/constants.ts +14 -5
- package/src/core/__workshop__/fontsPlugin.tsx +1 -1
- package/src/core/_compat/index.ts +2 -0
- package/src/core/{styles → _compat/styles}/box/boxStyle.ts +1 -1
- package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -2
- package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
- package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/helpers.ts +1 -1
- package/src/core/{styles → _compat/styles}/input/textInputStyle.ts +2 -2
- package/src/core/{styles → _compat/styles}/radius/types.ts +1 -1
- package/src/core/{styles → _compat/styles}/shadow/shadowStyle.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +5 -4
- package/src/core/components/autocomplete/__workshop__/example.tsx +3 -2
- package/src/core/components/autocomplete/autocomplete.tsx +5 -5
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/__workshop__/props.tsx +2 -0
- package/src/core/components/dialog/dialog.tsx +1 -5
- package/src/core/components/hotkeys/hotkeys.tsx +1 -1
- package/src/core/components/menu/menu.tsx +8 -10
- package/src/core/components/menu/menuDivider.tsx +16 -0
- package/src/core/components/menu/menuGroup.tsx +2 -8
- package/src/core/components/menu/menuItem.tsx +1 -1
- package/src/core/components/skeleton/skeleton.tsx +14 -20
- package/src/core/components/skeleton/textSkeleton.tsx +72 -48
- package/src/core/components/tab/tab.tsx +0 -1
- package/src/core/components/tab/tabList.tsx +4 -21
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/toast.tsx +27 -14
- package/src/core/components/toast/toastProvider.tsx +4 -13
- package/src/core/components/tree/tree.tsx +1 -2
- package/src/core/components/tree/treeGroup.tsx +4 -1
- package/src/core/components/tree/treeItem.tsx +11 -15
- package/src/core/hooks/useArrayProp.ts +1 -1
- package/src/core/index.ts +0 -1
- package/src/core/lib/styled/members.ts +2 -2
- package/src/core/primitives/avatar/avatar.tsx +0 -21
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- package/src/core/primitives/avatar/styles.ts +2 -2
- package/src/core/primitives/box/box.tsx +4 -1
- package/src/core/primitives/button/__workshop__/props.tsx +2 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +2 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/styles.ts +3 -3
- package/src/core/primitives/card/__workshop__/props.tsx +2 -2
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +7 -10
- package/src/core/primitives/code/code.tsx +2 -4
- package/src/core/primitives/container/styles.ts +1 -1
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -13
- package/src/core/primitives/grid/grid.tsx +5 -19
- package/src/core/primitives/heading/heading.tsx +8 -25
- package/src/core/primitives/heading/styles.ts +1 -1
- package/src/core/primitives/inline/inline.tsx +3 -12
- package/src/core/primitives/inline/styles.ts +1 -1
- package/src/core/primitives/label/label.tsx +4 -9
- package/src/core/primitives/label/styles.ts +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
- package/src/core/primitives/popover/popover.tsx +1 -1
- package/src/core/primitives/popover/popoverCard.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +2 -2
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +3 -3
- package/src/core/primitives/spinner/__workshop__/Props.tsx +2 -1
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +16 -0
- package/src/core/primitives/spinner/spinner.tsx +2 -2
- package/src/core/primitives/stack/styles.ts +1 -1
- package/src/core/primitives/switch/styles.ts +2 -2
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/styles.ts +1 -1
- package/src/core/primitives/text/text.tsx +1 -4
- package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/textArea/textArea.tsx +3 -3
- package/src/core/primitives/textInput/__workshop__/plain.tsx +3 -2
- package/src/core/primitives/textInput/textInput.tsx +16 -83
- package/src/core/primitives/tooltip/tooltipCard.tsx +5 -5
- package/src/core/primitives/types.ts +1 -0
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/__workshop__/build/story.tsx +2 -4
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/types/box.ts +22 -16
- package/src/core/types/grid.ts +17 -12
- package/src/core/types/text.ts +7 -4
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +2 -2
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/css/compile/{comileRules.ts → compileRules.ts} +2 -5
- package/src/css/compile/compileSystem.ts +1 -1
- package/src/css/compile/compileTheme.ts +4 -1
- package/src/css/components/breadcrumbs/rules.ts +18 -0
- package/src/css/components/menu/index.ts +1 -0
- package/src/css/components/menu/menu.ts +5 -0
- package/src/css/components/menu/rules.ts +10 -0
- package/src/css/components/skeleton/index.ts +2 -0
- package/src/css/components/skeleton/rules.ts +106 -0
- package/src/css/components/skeleton/skeleton.ts +31 -0
- package/src/css/components/skeleton/types.ts +24 -0
- package/src/css/components/toast/rules.ts +68 -0
- package/src/css/components/tree/rules.ts +115 -0
- package/src/css/index.ts +4 -0
- package/src/css/primitives/box/box.ts +5 -1
- package/src/css/primitives/box/types.ts +7 -8
- package/src/css/primitives/card/rules.ts +161 -13
- package/src/css/primitives/checkbox/__styles.ts +115 -113
- package/src/css/primitives/selectable/__style.ts +117 -115
- package/src/css/primitives/spinner/rules.ts +5 -7
- package/src/css/primitives/spinner/spinner.ts +4 -0
- package/src/css/primitives/textInput/index.ts +1 -0
- package/src/css/primitives/textInput/rules.ts +159 -64
- package/src/css/primitives/textInput/textInput.ts +11 -3
- package/src/css/primitives/textInput/types.ts +8 -0
- package/src/css/rules.ts +16 -38
- package/src/css/styles/font/font.ts +7 -2
- package/src/css/styles/font/rules.ts +23 -0
- package/src/css/styles/font/types.ts +6 -0
- package/src/css/styles/gap/rules.ts +6 -6
- package/src/css/styles/grid/grid.ts +13 -0
- package/src/css/styles/grid/index.ts +2 -0
- package/src/css/styles/grid/rules.ts +112 -1
- package/src/css/styles/grid/types.ts +29 -0
- package/src/css/styles/margin/rules.ts +58 -54
- package/src/css/styles/outline/rules.ts +7 -0
- package/src/css/styles/overflow/index.ts +2 -0
- package/src/css/styles/overflow/overflow.ts +11 -0
- package/src/css/styles/overflow/types.ts +11 -0
- package/src/css/styles/padding/rules.ts +50 -48
- package/src/css/types.ts +36 -1
- package/src/css/varNames.ts +1 -1
- package/src/css/vars.ts +86 -0
- package/dist/_chunks-cjs/getTheme_v2.js +0 -316
- package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -317
- package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
- package/dist/_legacy/getTheme_v2.esm.js +0 -317
- package/dist/_legacy/getTheme_v2.esm.js.map +0 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -38
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -17
- package/src/core/components/menu/menuDivider.ts +0 -13
- package/src/core/components/skeleton/styles.ts +0 -50
- package/src/core/components/toast/styles.ts +0 -61
- package/src/core/components/tree/style.ts +0 -104
- package/src/core/primitives/card/styles.ts +0 -146
- /package/src/core/{styles → _compat/styles}/border/borderStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/border/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/box/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/card/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/flex/flexStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/flex/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/focusRing/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/codeFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/headingFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/labelFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/responsiveFont.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/textAlignStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/font/textFontStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/grid/gridItemStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/grid/gridStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/grid/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/input/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/input/responsiveInputPaddingStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/internal.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/marginStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/marginsStyle.test.ts +0 -0
- /package/src/core/{styles → _compat/styles}/margin/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/paddingStyle.test.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/paddingStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/padding/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/radius/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/radius/radiusStyle.ts +0 -0
- /package/src/core/{styles → _compat/styles}/shadow/index.ts +0 -0
- /package/src/core/{styles → _compat/styles}/shadow/types.ts +0 -0
- /package/src/core/{styles → _compat/styles}/types.ts +0 -0
- /package/src/core/{_compat.ts → _compat/types.ts} +0 -0
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import {getTheme_v2} from '@sanity/ui/theme'
|
|
2
|
-
import {css} from '../../lib/styled'
|
|
3
|
-
import {ThemeProps} from '../../styles'
|
|
4
|
-
import {_cardColorStyle} from '../../styles/card'
|
|
5
|
-
import {focusRingStyle} from '../../styles/focusRing'
|
|
6
|
-
import {CardStyleProps} from './types'
|
|
7
|
-
|
|
8
|
-
export function cardStyle(
|
|
9
|
-
props: CardStyleProps & ThemeProps,
|
|
10
|
-
): Array<ReturnType<typeof css> | (() => ReturnType<typeof css>)> {
|
|
11
|
-
return [cardBaseStyle(props), cardColorStyle(props)]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function cardBaseStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {
|
|
15
|
-
const {$checkered} = props
|
|
16
|
-
const {space} = getTheme_v2(props.theme)
|
|
17
|
-
|
|
18
|
-
return css`
|
|
19
|
-
${$checkered &&
|
|
20
|
-
css`
|
|
21
|
-
background-size: ${space[3]}px ${space[3]}px;
|
|
22
|
-
background-position: 50% 50%;
|
|
23
|
-
background-image: var(--card-bg-image);
|
|
24
|
-
`}
|
|
25
|
-
|
|
26
|
-
&[data-as='button'] {
|
|
27
|
-
-webkit-font-smoothing: inherit;
|
|
28
|
-
appearance: none;
|
|
29
|
-
outline: none;
|
|
30
|
-
font: inherit;
|
|
31
|
-
text-align: inherit;
|
|
32
|
-
border: 0;
|
|
33
|
-
width: -moz-available;
|
|
34
|
-
width: -webkit-fill-available;
|
|
35
|
-
width: stretch;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* &:is(a) */
|
|
39
|
-
&[data-as='a'] {
|
|
40
|
-
outline: none;
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* &:is(pre) */
|
|
45
|
-
&[data-as='pre'] {
|
|
46
|
-
font: inherit;
|
|
47
|
-
}
|
|
48
|
-
`
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function cardColorStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {
|
|
52
|
-
const {$checkered, $focusRing, $muted} = props
|
|
53
|
-
const {card, color, style} = getTheme_v2(props.theme)
|
|
54
|
-
const border = {width: card.border.width, color: 'var(--card-border-color)'}
|
|
55
|
-
|
|
56
|
-
return css`
|
|
57
|
-
color-scheme: ${color._dark ? 'dark' : 'light'};
|
|
58
|
-
|
|
59
|
-
${_cardColorStyle(color, color, $checkered)}
|
|
60
|
-
|
|
61
|
-
background-color: ${$muted ? 'var(--card-muted-bg-color)' : 'var(--card-bg-color)'};
|
|
62
|
-
color: var(--card-fg-color);
|
|
63
|
-
|
|
64
|
-
/* &:is(button) */
|
|
65
|
-
&[data-as='button'] {
|
|
66
|
-
--card-focus-ring-box-shadow: none;
|
|
67
|
-
|
|
68
|
-
cursor: default;
|
|
69
|
-
box-shadow: var(--card-focus-ring-box-shadow);
|
|
70
|
-
|
|
71
|
-
&:disabled {
|
|
72
|
-
${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:not(:disabled) {
|
|
76
|
-
&[data-pressed] {
|
|
77
|
-
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&[data-selected] {
|
|
81
|
-
${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@media (hover: hover) {
|
|
85
|
-
&:not([data-pressed]):not([data-selected]) {
|
|
86
|
-
&[data-hovered],
|
|
87
|
-
&:hover {
|
|
88
|
-
${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&:active {
|
|
92
|
-
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&:focus-visible {
|
|
98
|
-
--card-focus-ring-box-shadow: ${$focusRing
|
|
99
|
-
? focusRingStyle({base: color, border, focusRing: card.focusRing})
|
|
100
|
-
: undefined};
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/* &:is(a) */
|
|
106
|
-
&[data-as='a'] {
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
box-shadow: var(--card-focus-ring-box-shadow);
|
|
109
|
-
|
|
110
|
-
&[data-disabled] {
|
|
111
|
-
${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
&:not([data-disabled]) {
|
|
115
|
-
&[data-pressed] {
|
|
116
|
-
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&[data-selected] {
|
|
120
|
-
${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@media (hover: hover) {
|
|
124
|
-
&:not([data-pressed]):not([data-selected]) {
|
|
125
|
-
&[data-hovered],
|
|
126
|
-
&:hover {
|
|
127
|
-
${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
&:active {
|
|
131
|
-
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&:focus-visible {
|
|
137
|
-
--card-focus-ring-box-shadow: ${$focusRing
|
|
138
|
-
? focusRingStyle({base: color, border, focusRing: card.focusRing})
|
|
139
|
-
: undefined};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
${style?.card?.root}
|
|
145
|
-
`
|
|
146
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|