@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.
Files changed (216) hide show
  1. package/dist/_chunks-cjs/buildCommand.js +1387 -681
  2. package/dist/_chunks-cjs/buildCommand.js.map +1 -1
  3. package/dist/cli.js +4 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/css.d.mts +131 -12
  6. package/dist/css.d.ts +131 -12
  7. package/dist/css.esm.js +1450 -791
  8. package/dist/css.esm.js.map +1 -1
  9. package/dist/css.js +1449 -790
  10. package/dist/css.js.map +1 -1
  11. package/dist/css.mjs +1450 -791
  12. package/dist/css.mjs.map +1 -1
  13. package/dist/index.d.mts +84 -76
  14. package/dist/index.d.ts +84 -76
  15. package/dist/index.esm.js +2734 -3146
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +2733 -3145
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +2734 -3146
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/sanity-theme.css +1 -1
  22. package/dist/system.css +1590 -1158
  23. package/dist/theme.esm.js +1565 -452
  24. package/dist/theme.esm.js.map +1 -1
  25. package/dist/theme.js +1599 -484
  26. package/dist/theme.js.map +1 -1
  27. package/dist/theme.mjs +1565 -452
  28. package/dist/theme.mjs.map +1 -1
  29. package/package.json +22 -22
  30. package/src/core/__workshop__/constants.ts +14 -5
  31. package/src/core/__workshop__/fontsPlugin.tsx +1 -1
  32. package/src/core/_compat/index.ts +2 -0
  33. package/src/core/{styles → _compat/styles}/box/boxStyle.ts +1 -1
  34. package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
  35. package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -2
  36. package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
  37. package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
  38. package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
  39. package/src/core/{styles → _compat/styles}/helpers.ts +1 -1
  40. package/src/core/{styles → _compat/styles}/input/textInputStyle.ts +2 -2
  41. package/src/core/{styles → _compat/styles}/radius/types.ts +1 -1
  42. package/src/core/{styles → _compat/styles}/shadow/shadowStyle.ts +1 -1
  43. package/src/core/components/autocomplete/__workshop__/custom.tsx +5 -4
  44. package/src/core/components/autocomplete/__workshop__/example.tsx +3 -2
  45. package/src/core/components/autocomplete/autocomplete.tsx +5 -5
  46. package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
  47. package/src/core/components/dialog/__workshop__/props.tsx +2 -0
  48. package/src/core/components/dialog/dialog.tsx +1 -5
  49. package/src/core/components/hotkeys/hotkeys.tsx +1 -1
  50. package/src/core/components/menu/menu.tsx +8 -10
  51. package/src/core/components/menu/menuDivider.tsx +16 -0
  52. package/src/core/components/menu/menuGroup.tsx +2 -8
  53. package/src/core/components/menu/menuItem.tsx +1 -1
  54. package/src/core/components/skeleton/skeleton.tsx +14 -20
  55. package/src/core/components/skeleton/textSkeleton.tsx +72 -48
  56. package/src/core/components/tab/tab.tsx +0 -1
  57. package/src/core/components/tab/tabList.tsx +4 -21
  58. package/src/core/components/tab/tabPanel.tsx +1 -0
  59. package/src/core/components/toast/toast.tsx +27 -14
  60. package/src/core/components/toast/toastProvider.tsx +4 -13
  61. package/src/core/components/tree/tree.tsx +1 -2
  62. package/src/core/components/tree/treeGroup.tsx +4 -1
  63. package/src/core/components/tree/treeItem.tsx +11 -15
  64. package/src/core/hooks/useArrayProp.ts +1 -1
  65. package/src/core/index.ts +0 -1
  66. package/src/core/lib/styled/members.ts +2 -2
  67. package/src/core/primitives/avatar/avatar.tsx +0 -21
  68. package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
  69. package/src/core/primitives/avatar/avatarStack.tsx +1 -1
  70. package/src/core/primitives/avatar/styles.ts +2 -2
  71. package/src/core/primitives/box/box.tsx +4 -1
  72. package/src/core/primitives/button/__workshop__/props.tsx +2 -1
  73. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  74. package/src/core/primitives/button/__workshop__/stacked.tsx +2 -1
  75. package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
  76. package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
  77. package/src/core/primitives/button/styles.ts +3 -3
  78. package/src/core/primitives/card/__workshop__/props.tsx +2 -2
  79. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  80. package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
  81. package/src/core/primitives/card/card.tsx +7 -10
  82. package/src/core/primitives/code/code.tsx +2 -4
  83. package/src/core/primitives/container/styles.ts +1 -1
  84. package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
  85. package/src/core/primitives/flex/flex.tsx +1 -13
  86. package/src/core/primitives/grid/grid.tsx +5 -19
  87. package/src/core/primitives/heading/heading.tsx +8 -25
  88. package/src/core/primitives/heading/styles.ts +1 -1
  89. package/src/core/primitives/inline/inline.tsx +3 -12
  90. package/src/core/primitives/inline/styles.ts +1 -1
  91. package/src/core/primitives/label/label.tsx +4 -9
  92. package/src/core/primitives/label/styles.ts +1 -1
  93. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
  94. package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
  95. package/src/core/primitives/popover/popover.tsx +1 -1
  96. package/src/core/primitives/popover/popoverCard.tsx +1 -1
  97. package/src/core/primitives/radio/radio.tsx +1 -1
  98. package/src/core/primitives/radio/styles.ts +2 -2
  99. package/src/core/primitives/select/select.tsx +1 -1
  100. package/src/core/primitives/select/styles.ts +3 -3
  101. package/src/core/primitives/spinner/__workshop__/Props.tsx +2 -1
  102. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +16 -0
  103. package/src/core/primitives/spinner/spinner.tsx +2 -2
  104. package/src/core/primitives/stack/styles.ts +1 -1
  105. package/src/core/primitives/switch/styles.ts +2 -2
  106. package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
  107. package/src/core/primitives/text/styles.ts +1 -1
  108. package/src/core/primitives/text/text.tsx +1 -4
  109. package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
  110. package/src/core/primitives/textArea/textArea.tsx +3 -3
  111. package/src/core/primitives/textInput/__workshop__/plain.tsx +3 -2
  112. package/src/core/primitives/textInput/textInput.tsx +16 -83
  113. package/src/core/primitives/tooltip/tooltipCard.tsx +5 -5
  114. package/src/core/primitives/types.ts +1 -0
  115. package/src/core/theme/__workshop__/build/Root.tsx +1 -1
  116. package/src/core/theme/__workshop__/build/story.tsx +2 -4
  117. package/src/core/theme/themeProvider.tsx +1 -1
  118. package/src/core/types/box.ts +22 -16
  119. package/src/core/types/grid.ts +17 -12
  120. package/src/core/types/text.ts +7 -4
  121. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
  122. package/src/core/utils/layer/layer.tsx +2 -2
  123. package/src/core/utils/virtualList/virtualList.tsx +1 -1
  124. package/src/css/compile/{comileRules.ts → compileRules.ts} +2 -5
  125. package/src/css/compile/compileSystem.ts +1 -1
  126. package/src/css/compile/compileTheme.ts +4 -1
  127. package/src/css/components/breadcrumbs/rules.ts +18 -0
  128. package/src/css/components/menu/index.ts +1 -0
  129. package/src/css/components/menu/menu.ts +5 -0
  130. package/src/css/components/menu/rules.ts +10 -0
  131. package/src/css/components/skeleton/index.ts +2 -0
  132. package/src/css/components/skeleton/rules.ts +106 -0
  133. package/src/css/components/skeleton/skeleton.ts +31 -0
  134. package/src/css/components/skeleton/types.ts +24 -0
  135. package/src/css/components/toast/rules.ts +68 -0
  136. package/src/css/components/tree/rules.ts +115 -0
  137. package/src/css/index.ts +4 -0
  138. package/src/css/primitives/box/box.ts +5 -1
  139. package/src/css/primitives/box/types.ts +7 -8
  140. package/src/css/primitives/card/rules.ts +161 -13
  141. package/src/css/primitives/checkbox/__styles.ts +115 -113
  142. package/src/css/primitives/selectable/__style.ts +117 -115
  143. package/src/css/primitives/spinner/rules.ts +5 -7
  144. package/src/css/primitives/spinner/spinner.ts +4 -0
  145. package/src/css/primitives/textInput/index.ts +1 -0
  146. package/src/css/primitives/textInput/rules.ts +159 -64
  147. package/src/css/primitives/textInput/textInput.ts +11 -3
  148. package/src/css/primitives/textInput/types.ts +8 -0
  149. package/src/css/rules.ts +16 -38
  150. package/src/css/styles/font/font.ts +7 -2
  151. package/src/css/styles/font/rules.ts +23 -0
  152. package/src/css/styles/font/types.ts +6 -0
  153. package/src/css/styles/gap/rules.ts +6 -6
  154. package/src/css/styles/grid/grid.ts +13 -0
  155. package/src/css/styles/grid/index.ts +2 -0
  156. package/src/css/styles/grid/rules.ts +112 -1
  157. package/src/css/styles/grid/types.ts +29 -0
  158. package/src/css/styles/margin/rules.ts +58 -54
  159. package/src/css/styles/outline/rules.ts +7 -0
  160. package/src/css/styles/overflow/index.ts +2 -0
  161. package/src/css/styles/overflow/overflow.ts +11 -0
  162. package/src/css/styles/overflow/types.ts +11 -0
  163. package/src/css/styles/padding/rules.ts +50 -48
  164. package/src/css/types.ts +36 -1
  165. package/src/css/varNames.ts +1 -1
  166. package/src/css/vars.ts +86 -0
  167. package/dist/_chunks-cjs/getTheme_v2.js +0 -316
  168. package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
  169. package/dist/_chunks-es/getTheme_v2.mjs +0 -317
  170. package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
  171. package/dist/_legacy/getTheme_v2.esm.js +0 -317
  172. package/dist/_legacy/getTheme_v2.esm.js.map +0 -1
  173. package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -38
  174. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -17
  175. package/src/core/components/menu/menuDivider.ts +0 -13
  176. package/src/core/components/skeleton/styles.ts +0 -50
  177. package/src/core/components/toast/styles.ts +0 -61
  178. package/src/core/components/tree/style.ts +0 -104
  179. package/src/core/primitives/card/styles.ts +0 -146
  180. /package/src/core/{styles → _compat/styles}/border/borderStyle.ts +0 -0
  181. /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
  182. /package/src/core/{styles → _compat/styles}/border/types.ts +0 -0
  183. /package/src/core/{styles → _compat/styles}/box/index.ts +0 -0
  184. /package/src/core/{styles → _compat/styles}/card/index.ts +0 -0
  185. /package/src/core/{styles → _compat/styles}/flex/flexStyle.ts +0 -0
  186. /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
  187. /package/src/core/{styles → _compat/styles}/flex/types.ts +0 -0
  188. /package/src/core/{styles → _compat/styles}/focusRing/index.ts +0 -0
  189. /package/src/core/{styles → _compat/styles}/font/codeFontStyle.ts +0 -0
  190. /package/src/core/{styles → _compat/styles}/font/headingFontStyle.ts +0 -0
  191. /package/src/core/{styles → _compat/styles}/font/index.ts +0 -0
  192. /package/src/core/{styles → _compat/styles}/font/labelFontStyle.ts +0 -0
  193. /package/src/core/{styles → _compat/styles}/font/responsiveFont.ts +0 -0
  194. /package/src/core/{styles → _compat/styles}/font/textAlignStyle.ts +0 -0
  195. /package/src/core/{styles → _compat/styles}/font/textFontStyle.ts +0 -0
  196. /package/src/core/{styles → _compat/styles}/grid/gridItemStyle.ts +0 -0
  197. /package/src/core/{styles → _compat/styles}/grid/gridStyle.ts +0 -0
  198. /package/src/core/{styles → _compat/styles}/grid/index.ts +0 -0
  199. /package/src/core/{styles → _compat/styles}/index.ts +0 -0
  200. /package/src/core/{styles → _compat/styles}/input/index.ts +0 -0
  201. /package/src/core/{styles → _compat/styles}/input/responsiveInputPaddingStyle.ts +0 -0
  202. /package/src/core/{styles → _compat/styles}/internal.ts +0 -0
  203. /package/src/core/{styles → _compat/styles}/margin/index.ts +0 -0
  204. /package/src/core/{styles → _compat/styles}/margin/marginStyle.ts +0 -0
  205. /package/src/core/{styles → _compat/styles}/margin/marginsStyle.test.ts +0 -0
  206. /package/src/core/{styles → _compat/styles}/margin/types.ts +0 -0
  207. /package/src/core/{styles → _compat/styles}/padding/index.ts +0 -0
  208. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.test.ts +0 -0
  209. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.ts +0 -0
  210. /package/src/core/{styles → _compat/styles}/padding/types.ts +0 -0
  211. /package/src/core/{styles → _compat/styles}/radius/index.ts +0 -0
  212. /package/src/core/{styles → _compat/styles}/radius/radiusStyle.ts +0 -0
  213. /package/src/core/{styles → _compat/styles}/shadow/index.ts +0 -0
  214. /package/src/core/{styles → _compat/styles}/shadow/types.ts +0 -0
  215. /package/src/core/{styles → _compat/styles}/types.ts +0 -0
  216. /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
- return css`
8
- position: relative;
9
- display: inline-block;
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
- const {color, input, radius} = getTheme_v2(props.theme)
15
- const {focusRing} = input.checkbox
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
- 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;
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
- & + 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};
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
- & > svg {
44
- display: block;
45
- position: absolute;
46
- opacity: 0;
47
- height: 100%;
48
- width: 100%;
43
+ // & > svg {
44
+ // display: block;
45
+ // position: absolute;
46
+ // opacity: 0;
47
+ // height: 100%;
48
+ // width: 100%;
49
49
 
50
- & > path {
51
- vector-effect: non-scaling-stroke;
52
- stroke-width: 1.5px !important;
53
- }
54
- }
55
- }
50
+ // & > path {
51
+ // vector-effect: non-scaling-stroke;
52
+ // stroke-width: 1.5px !important;
53
+ // }
54
+ // }
55
+ // }
56
56
 
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
- }
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
- /* focus */
67
- &:not(:disabled):focus:focus-visible + span {
68
- box-shadow: ${focusRingStyle({focusRing})};
69
- }
66
+ // /* focus */
67
+ // &:not(:disabled):focus:focus-visible + span {
68
+ // box-shadow: ${focusRingStyle({focusRing})};
69
+ // }
70
70
 
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
- }
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
- &[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
- }
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
- &: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
- }
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
- &[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
- }
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
- &[data-read-only]&:checked + span {
117
- background-color: ${color.input.default.readOnly.muted.bg};
118
- }
116
+ // &[data-read-only]&:checked + span {
117
+ // background-color: ${color.input.default.readOnly.muted.bg};
118
+ // }
119
119
 
120
- &:checked + span > svg:first-child {
121
- opacity: 1;
122
- }
123
- &:indeterminate + span > svg:last-child {
124
- opacity: 1;
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 {css} from '../../../core/lib/styled'
3
- import {ThemeProps} from '../../../core/styles'
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
- }
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
  }
@@ -3,3 +3,7 @@ import {composeClassNames} from '../../composeClassNames'
3
3
  export function spinner(): string {
4
4
  return composeClassNames('spinner')
5
5
  }
6
+
7
+ export function animatedSpinnerIcon(): string {
8
+ return composeClassNames('animated-spinner-icon')
9
+ }
@@ -1 +1,2 @@
1
1
  export * from './textInput'
2
+ export * from './types'