@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,127 +1,129 @@
|
|
|
1
|
-
import {getTheme_v2} from '@sanity/ui/theme'
|
|
2
|
-
import {css} from '../../../core/lib/styled'
|
|
3
|
-
import {rem, ThemeProps} from '../../../core/styles'
|
|
4
|
-
import {focusRingBorderStyle, focusRingStyle} from '../../../core/styles/internal'
|
|
1
|
+
// import {getTheme_v2} from '@sanity/ui/theme'
|
|
2
|
+
// import {css} from '../../../core/lib/styled'
|
|
3
|
+
// import {rem, ThemeProps} from '../../../core/styles'
|
|
4
|
+
// import {focusRingBorderStyle, focusRingStyle} from '../../../core/styles/internal'
|
|
5
5
|
|
|
6
|
-
export function checkboxBaseStyles(): ReturnType<typeof css> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
6
|
+
// export function checkboxBaseStyles(): ReturnType<typeof css> {
|
|
7
|
+
// return css`
|
|
8
|
+
// position: relative;
|
|
9
|
+
// display: inline-block;
|
|
10
|
+
// `
|
|
11
|
+
// }
|
|
12
12
|
|
|
13
|
-
export function inputElementStyles(props: ThemeProps): ReturnType<typeof css> {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// export function inputElementStyles(props: ThemeProps): ReturnType<typeof css> {
|
|
14
|
+
// const {color, input, radius} = getTheme_v2(props.theme)
|
|
15
|
+
// const {focusRing} = input.checkbox
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
// return css`
|
|
18
|
+
// position: absolute;
|
|
19
|
+
// top: 0;
|
|
20
|
+
// left: 0;
|
|
21
|
+
// width: 100%;
|
|
22
|
+
// height: 100%;
|
|
23
|
+
// outline: none;
|
|
24
|
+
// opacity: 0;
|
|
25
|
+
// z-index: 1;
|
|
26
|
+
// padding: 0;
|
|
27
|
+
// margin: 0;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
// & + span {
|
|
30
|
+
// position: relative;
|
|
31
|
+
// display: block;
|
|
32
|
+
// height: ${rem(input.checkbox.size)};
|
|
33
|
+
// width: ${rem(input.checkbox.size)};
|
|
34
|
+
// box-sizing: border-box;
|
|
35
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
36
|
+
// color: color.input.default.enabled.border,
|
|
37
|
+
// width: input.border.width,
|
|
38
|
+
// })};
|
|
39
|
+
// border-radius: ${rem(radius[2])};
|
|
40
|
+
// line-height: 1;
|
|
41
|
+
// background-color: ${color.input.default.enabled.bg};
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
// & > svg {
|
|
44
|
+
// display: block;
|
|
45
|
+
// position: absolute;
|
|
46
|
+
// opacity: 0;
|
|
47
|
+
// height: 100%;
|
|
48
|
+
// width: 100%;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
// & > path {
|
|
51
|
+
// vector-effect: non-scaling-stroke;
|
|
52
|
+
// stroke-width: 1.5px !important;
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
// }
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
// &:checked + span {
|
|
58
|
+
// background: ${color.input.default.enabled.fg};
|
|
59
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
60
|
+
// color: color.input.default.enabled.fg,
|
|
61
|
+
// width: input.border.width,
|
|
62
|
+
// })};
|
|
63
|
+
// color: ${color.input.default.enabled.bg};
|
|
64
|
+
// }
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
// /* focus */
|
|
67
|
+
// &:not(:disabled):focus:focus-visible + span {
|
|
68
|
+
// box-shadow: ${focusRingStyle({focusRing})};
|
|
69
|
+
// }
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
// /* focus when checked - uses a different offset */
|
|
72
|
+
// &:not(:disabled):focus:focus-visible&:checked + span {
|
|
73
|
+
// box-shadow: ${focusRingStyle({focusRing: {width: 1, offset: 1}})};
|
|
74
|
+
// }
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
76
|
+
// &[data-error] + span {
|
|
77
|
+
// background-color: ${color.input.invalid.enabled.border};
|
|
78
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
79
|
+
// width: input.border.width,
|
|
80
|
+
// color: color.input.invalid.enabled.muted.bg,
|
|
81
|
+
// })};
|
|
82
|
+
// color: ${color.input.default.disabled.fg};
|
|
83
|
+
// }
|
|
84
|
+
// &[data-error]&:checked + span {
|
|
85
|
+
// background-color: ${color.input.invalid.enabled.muted.bg};
|
|
86
|
+
// color: ${color.input.default.enabled.bg};
|
|
87
|
+
// }
|
|
88
|
+
// &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {
|
|
89
|
+
// box-shadow: ${focusRingStyle({
|
|
90
|
+
// border: {width: input.border.width, color: color.input.invalid.readOnly.muted.bg},
|
|
91
|
+
// focusRing: {width: 1, offset: 1},
|
|
92
|
+
// })};
|
|
93
|
+
// }
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
// &:disabled + span {
|
|
96
|
+
// background-color: ${color.input.default.disabled.bg};
|
|
97
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
98
|
+
// width: input.border.width,
|
|
99
|
+
// color: color.input.default.disabled.border,
|
|
100
|
+
// })};
|
|
101
|
+
// color: ${color.input.default.disabled.fg};
|
|
102
|
+
// }
|
|
103
|
+
// &:disabled&:checked + span {
|
|
104
|
+
// background-color: ${color.input.default.disabled.muted.bg};
|
|
105
|
+
// }
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
// &[data-read-only] + span {
|
|
108
|
+
// background-color: ${color.input.default.readOnly.bg};
|
|
109
|
+
// box-shadow: ${focusRingBorderStyle({
|
|
110
|
+
// width: input.border.width,
|
|
111
|
+
// color: color.input.default.readOnly.border,
|
|
112
|
+
// })};
|
|
113
|
+
// color: ${color.input.default.readOnly.fg};
|
|
114
|
+
// }
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
// &[data-read-only]&:checked + span {
|
|
117
|
+
// background-color: ${color.input.default.readOnly.muted.bg};
|
|
118
|
+
// }
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
120
|
+
// &:checked + span > svg:first-child {
|
|
121
|
+
// opacity: 1;
|
|
122
|
+
// }
|
|
123
|
+
// &:indeterminate + span > svg:last-child {
|
|
124
|
+
// opacity: 1;
|
|
125
|
+
// }
|
|
126
|
+
// `
|
|
127
|
+
// }
|
|
128
|
+
|
|
129
|
+
export {}
|
|
@@ -1,115 +1,117 @@
|
|
|
1
|
-
import {getTheme_v2} from '@sanity/ui/theme'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {_cardColorStyle} from '../../../core/styles/card'
|
|
5
|
-
import {SelectableTone} from '../../../core/types'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface SelectableStyleProps {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function selectableBaseStyle(): ReturnType<typeof css> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function selectableColorStyle(
|
|
40
|
-
|
|
41
|
-
): ReturnType<typeof css> {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
1
|
+
// import {getTheme_v2} from '@sanity/ui/theme'
|
|
2
|
+
// import {ThemeProps} from '../../../core/_compat'
|
|
3
|
+
// import {css} from '../../../core/lib/styled'
|
|
4
|
+
// import {_cardColorStyle} from '../../../core/styles/card'
|
|
5
|
+
// import {SelectableTone} from '../../../core/types'
|
|
6
|
+
|
|
7
|
+
// /**
|
|
8
|
+
// * @internal
|
|
9
|
+
// * @deprecated
|
|
10
|
+
// */
|
|
11
|
+
// export interface SelectableStyleProps {
|
|
12
|
+
// $tone: SelectableTone
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
// export function selectableBaseStyle(): ReturnType<typeof css> {
|
|
16
|
+
// return css`
|
|
17
|
+
// background-color: inherit;
|
|
18
|
+
// color: inherit;
|
|
19
|
+
|
|
20
|
+
// &[data-as='button'] {
|
|
21
|
+
// -webkit-font-smoothing: inherit;
|
|
22
|
+
// appearance: none;
|
|
23
|
+
// outline: none;
|
|
24
|
+
// font: inherit;
|
|
25
|
+
// text-align: inherit;
|
|
26
|
+
// border: 0;
|
|
27
|
+
// width: -moz-available;
|
|
28
|
+
// width: -webkit-fill-available;
|
|
29
|
+
// width: stretch;
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
// /* &:is(a) */
|
|
33
|
+
// &[data-as='a'] {
|
|
34
|
+
// text-decoration: none;
|
|
35
|
+
// }
|
|
36
|
+
// `
|
|
37
|
+
// }
|
|
38
|
+
|
|
39
|
+
// export function selectableColorStyle(
|
|
40
|
+
// props: SelectableStyleProps & ThemeProps,
|
|
41
|
+
// ): ReturnType<typeof css> {
|
|
42
|
+
// const {$tone} = props
|
|
43
|
+
// const {color, style} = getTheme_v2(props.theme)
|
|
44
|
+
// const tone = color.selectable[$tone]
|
|
45
|
+
|
|
46
|
+
// return css`
|
|
47
|
+
// ${_cardColorStyle(color, tone.enabled)}
|
|
48
|
+
|
|
49
|
+
// background-color: var(--card-bg-color);
|
|
50
|
+
// color: var(--card-fg-color);
|
|
51
|
+
// outline: none;
|
|
52
|
+
|
|
53
|
+
// /* &:is(button) */
|
|
54
|
+
// &[data-as='button'] {
|
|
55
|
+
// &:disabled {
|
|
56
|
+
// ${_cardColorStyle(color, tone.disabled)}
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// &:not(:disabled) {
|
|
60
|
+
// &[aria-pressed='true'] {
|
|
61
|
+
// ${_cardColorStyle(color, tone.pressed)}
|
|
62
|
+
// }
|
|
63
|
+
|
|
64
|
+
// &[data-selected],
|
|
65
|
+
// &[aria-selected='true'] > & {
|
|
66
|
+
// ${_cardColorStyle(color, tone.selected)}
|
|
67
|
+
// }
|
|
68
|
+
|
|
69
|
+
// @media (hover: hover) {
|
|
70
|
+
// &:not([data-selected]) {
|
|
71
|
+
// &[data-hovered],
|
|
72
|
+
// &:hover {
|
|
73
|
+
// ${_cardColorStyle(color, tone.hovered)}
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
// &:active {
|
|
77
|
+
// ${_cardColorStyle(color, tone.pressed)}
|
|
78
|
+
// }
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
|
|
84
|
+
// /* &:is(a) */
|
|
85
|
+
// &[data-as='a'] {
|
|
86
|
+
// &[data-disabled] {
|
|
87
|
+
// ${_cardColorStyle(color, tone.disabled)}
|
|
88
|
+
// }
|
|
89
|
+
|
|
90
|
+
// &:not([data-disabled]) {
|
|
91
|
+
// &[data-pressed] {
|
|
92
|
+
// ${_cardColorStyle(color, tone.pressed)}
|
|
93
|
+
// }
|
|
94
|
+
|
|
95
|
+
// &[data-selected] {
|
|
96
|
+
// ${_cardColorStyle(color, tone.selected)}
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
// @media (hover: hover) {
|
|
100
|
+
// &:not([data-selected]) {
|
|
101
|
+
// &[data-hovered],
|
|
102
|
+
// &:hover {
|
|
103
|
+
// ${_cardColorStyle(color, tone.hovered)}
|
|
104
|
+
// }
|
|
105
|
+
// &:active {
|
|
106
|
+
// ${_cardColorStyle(color, tone.pressed)}
|
|
107
|
+
// }
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
// }
|
|
111
|
+
// }
|
|
112
|
+
|
|
113
|
+
// ${style?.card?.root}
|
|
114
|
+
// `
|
|
115
|
+
// }
|
|
116
|
+
|
|
117
|
+
export {}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {Rules} from '../../types'
|
|
2
2
|
|
|
3
3
|
export const spinnerRules: Rules = {
|
|
4
|
-
spinner: {
|
|
4
|
+
'spinner': {},
|
|
5
|
+
|
|
6
|
+
'animated-spinner-icon': {
|
|
7
|
+
'animation': 'spinner-rotate 500ms linear infinite',
|
|
8
|
+
|
|
5
9
|
'@keyframes': {
|
|
6
10
|
'spinner-rotate': {
|
|
7
11
|
from: {
|
|
@@ -12,11 +16,5 @@ export const spinnerRules: Rules = {
|
|
|
12
16
|
},
|
|
13
17
|
},
|
|
14
18
|
},
|
|
15
|
-
|
|
16
|
-
'@nest': {
|
|
17
|
-
'& > span > svg': {
|
|
18
|
-
animation: 'spinner-rotate 500ms linear infinite',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
19
|
},
|
|
22
20
|
}
|