@sanity/ui 2.0.0-alpha.5 → 2.0.0-alpha.7

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 (115) hide show
  1. package/dist/index.cjs.mjs +3 -1
  2. package/dist/index.d.ts +294 -407
  3. package/dist/index.esm.js +971 -2333
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +972 -2332
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/dialog/dialog.tsx +3 -3
  9. package/src/components/dialog/styles.ts +3 -4
  10. package/src/components/menu/__workshop__/closableMenuButton.tsx +2 -2
  11. package/src/components/menu/menuDivider.ts +2 -1
  12. package/src/components/menu/menuGroup.tsx +22 -23
  13. package/src/components/menu/menuItem.tsx +30 -36
  14. package/src/components/skeleton/styles.ts +8 -7
  15. package/src/components/tree/style.ts +19 -20
  16. package/src/primitives/_selectable/style.ts +25 -22
  17. package/src/primitives/avatar/avatar.tsx +8 -3
  18. package/src/primitives/avatar/avatarCounter.tsx +5 -4
  19. package/src/primitives/avatar/spotColors.ts +53 -0
  20. package/src/primitives/avatar/styles.ts +5 -7
  21. package/src/primitives/avatar/types.ts +14 -0
  22. package/src/primitives/badge/badge.tsx +4 -2
  23. package/src/primitives/badge/styles.ts +7 -8
  24. package/src/primitives/box/__workshop__/responsive.tsx +2 -2
  25. package/src/primitives/button/button.tsx +2 -2
  26. package/src/primitives/button/styles.ts +82 -16
  27. package/src/primitives/card/__workshop__/selected.tsx +8 -9
  28. package/src/primitives/card/card.tsx +43 -7
  29. package/src/primitives/card/styles.ts +30 -22
  30. package/src/primitives/card/types.ts +3 -1
  31. package/src/primitives/checkbox/styles.ts +20 -20
  32. package/src/primitives/code/code.tsx +15 -3
  33. package/src/primitives/code/styles.ts +51 -42
  34. package/src/primitives/heading/styles.ts +6 -5
  35. package/src/primitives/kbd/kbd.tsx +2 -1
  36. package/src/primitives/label/styles.ts +3 -2
  37. package/src/primitives/popover/popoverArrow.tsx +3 -2
  38. package/src/primitives/popover/popoverCard.tsx +6 -2
  39. package/src/primitives/radio/styles.ts +15 -15
  40. package/src/primitives/select/styles.ts +20 -22
  41. package/src/primitives/switch/styles.ts +13 -13
  42. package/src/primitives/text/__workshop__/colored.tsx +10 -11
  43. package/src/primitives/text/styles.ts +10 -9
  44. package/src/primitives/textArea/textArea.tsx +7 -11
  45. package/src/primitives/textInput/textInput.tsx +12 -12
  46. package/src/primitives/tooltip/__workshop__/props.tsx +20 -3
  47. package/src/primitives/tooltip/tooltipArrow.tsx +3 -2
  48. package/src/styles/border/borderStyle.ts +2 -1
  49. package/src/styles/colorVars/colorVarsStyle.ts +73 -32
  50. package/src/styles/focusRing/index.ts +6 -4
  51. package/src/styles/input/textInputStyle.ts +76 -93
  52. package/src/styles/margin/marginsStyle.test.ts +1 -2
  53. package/src/styles/padding/paddingStyle.test.ts +1 -2
  54. package/src/styles/shadow/shadowStyle.ts +5 -5
  55. package/src/theme/__workshop__/color.tsx +2 -2
  56. package/src/theme/__workshop__/index.ts +0 -5
  57. package/src/theme/lib/color-fns/blend/multiply.ts +2 -2
  58. package/src/theme/lib/color-fns/blend/screen.ts +2 -2
  59. package/src/theme/lib/color-fns/convert.ts +15 -1
  60. package/src/theme/lib/color-fns/parse.ts +7 -3
  61. package/src/theme/lib/color-fns/types.ts +11 -0
  62. package/src/theme/lib/theme/color/cssVariables/cardVariables.ts +92 -0
  63. package/src/theme/lib/theme/color/cssVariables/createCssVars.ts +31 -0
  64. package/src/theme/lib/theme/color/cssVariables/cssVars.test.ts +262 -0
  65. package/src/theme/lib/theme/color/cssVariables/index.ts +1 -0
  66. package/src/theme/lib/theme/color/cssVariables/tints.ts +312 -0
  67. package/src/theme/lib/theme/color/cssVariables/tones.ts +67 -0
  68. package/src/theme/lib/theme/color/cssVariables/utils.test.ts +15 -0
  69. package/src/theme/lib/theme/color/cssVariables/utils.ts +9 -0
  70. package/src/theme/lib/theme/color/index.ts +2 -12
  71. package/src/theme/lib/theme/color/types.ts +6 -37
  72. package/src/theme/studioTheme/color.ts +2 -641
  73. package/src/theme/studioTheme/helpers.ts +15 -1
  74. package/src/theme/studioTheme/theme.ts +9 -3
  75. package/src/theme/themeColorProvider.tsx +2 -0
  76. package/src/theme/themeProvider.tsx +27 -8
  77. package/src/theme/toneContext/toneContext.ts +12 -0
  78. package/src/theme/toneContext/toneProvider.tsx +31 -0
  79. package/src/theme/toneContext/types.ts +10 -0
  80. package/src/theme/toneContext/useToneContext.tsx +26 -0
  81. package/src/theme/types.ts +2 -4
  82. package/src/utils/elementQuery/__workshop__/customMedia.tsx +4 -3
  83. package/src/theme/__workshop__/canvas.tsx +0 -395
  84. package/src/theme/lib/theme/color/_generic/index.ts +0 -1
  85. package/src/theme/lib/theme/color/_generic/types.ts +0 -30
  86. package/src/theme/lib/theme/color/base/index.ts +0 -1
  87. package/src/theme/lib/theme/color/base/types.ts +0 -19
  88. package/src/theme/lib/theme/color/button/createButtonModes.ts +0 -20
  89. package/src/theme/lib/theme/color/button/createButtonTones.ts +0 -52
  90. package/src/theme/lib/theme/color/button/index.ts +0 -1
  91. package/src/theme/lib/theme/color/button/types.ts +0 -44
  92. package/src/theme/lib/theme/color/card/createCardStates.ts +0 -58
  93. package/src/theme/lib/theme/color/card/index.ts +0 -1
  94. package/src/theme/lib/theme/color/card/types.ts +0 -18
  95. package/src/theme/lib/theme/color/color.test.ts +0 -63
  96. package/src/theme/lib/theme/color/defaults.ts +0 -390
  97. package/src/theme/lib/theme/color/factory.ts +0 -138
  98. package/src/theme/lib/theme/color/input/createInputModes.ts +0 -84
  99. package/src/theme/lib/theme/color/input/index.ts +0 -1
  100. package/src/theme/lib/theme/color/input/types.ts +0 -28
  101. package/src/theme/lib/theme/color/muted/createMuted.ts +0 -56
  102. package/src/theme/lib/theme/color/muted/index.ts +0 -1
  103. package/src/theme/lib/theme/color/muted/types.ts +0 -24
  104. package/src/theme/lib/theme/color/selectable/createSelectableTones.ts +0 -73
  105. package/src/theme/lib/theme/color/selectable/index.ts +0 -1
  106. package/src/theme/lib/theme/color/selectable/types.ts +0 -29
  107. package/src/theme/lib/theme/color/solid/createSolidTones.ts +0 -56
  108. package/src/theme/lib/theme/color/solid/index.ts +0 -1
  109. package/src/theme/lib/theme/color/solid/types.ts +0 -24
  110. package/src/theme/lib/theme/color/spot/createSpot.ts +0 -21
  111. package/src/theme/lib/theme/color/spot/index.ts +0 -1
  112. package/src/theme/lib/theme/color/spot/types.ts +0 -28
  113. package/src/theme/lib/theme/color/syntax/index.ts +0 -1
  114. package/src/theme/lib/theme/color/syntax/types.ts +0 -41
  115. package/src/theme/studioTheme/tints.ts +0 -152
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
7
7
  var react = require('react');
8
8
  var ReactIs = require('react-is');
9
9
  var styled = require('styled-components');
10
- var color$1 = require('@sanity/color');
10
+ var color = require('@sanity/color');
11
11
  var icons = require('@sanity/icons');
12
12
  var Refractor = require('react-refractor');
13
13
  var reactDom$1 = require('@floating-ui/react-dom');
@@ -887,6 +887,15 @@ function hexToRgb(hex) {
887
887
  b: parseInt(hex.slice(5, 7), 16)
888
888
  };
889
889
  }
890
+ function rgbaToRGBA(rgba) {
891
+ const values = rgba.replace(/rgba\(|\)/g, "").split(",");
892
+ return {
893
+ r: parseInt(values[0]),
894
+ g: parseInt(values[1]),
895
+ b: parseInt(values[2]),
896
+ a: parseFloat(values[3])
897
+ };
898
+ }
890
899
  function rgbToHex(_ref2) {
891
900
  let {
892
901
  r,
@@ -1004,1915 +1013,416 @@ function parseColor(color) {
1004
1013
  if (color.startsWith("hsl(")) {
1005
1014
  return hslToRgb(parseHsl(color));
1006
1015
  }
1016
+ if (color.startsWith("rgba(")) {
1017
+ return rgbaToRGBA(color);
1018
+ }
1007
1019
  throw new Error('parseColor: unexpected color format: "'.concat(color, '"'));
1008
1020
  }
1009
1021
  function rgba(color, a) {
1010
1022
  const rgb = parseColor(color);
1011
1023
  return "rgba(".concat(rgb.r, ",").concat(rgb.g, ",").concat(rgb.b, ",").concat(a, ")");
1012
1024
  }
1013
- function createButtonTones(opts, base, dark, solid, muted, mode) {
1014
- return {
1015
- default: opts.button({
1016
- base,
1017
- dark,
1018
- solid: solid.default,
1019
- muted: muted.default,
1020
- mode
1021
- }),
1022
- primary: opts.button({
1023
- base,
1024
- dark,
1025
- solid: solid.primary,
1026
- muted: muted.primary,
1027
- mode
1028
- }),
1029
- positive: opts.button({
1030
- base,
1031
- dark,
1032
- solid: solid.positive,
1033
- muted: muted.positive,
1034
- mode
1035
- }),
1036
- caution: opts.button({
1037
- base,
1038
- dark,
1039
- solid: solid.caution,
1040
- muted: muted.caution,
1041
- mode
1042
- }),
1043
- critical: opts.button({
1044
- base,
1045
- dark,
1046
- solid: solid.critical,
1047
- muted: muted.critical,
1048
- mode
1049
- })
1050
- };
1051
- }
1052
- function createButtonModes(opts, base, dark, solid, muted) {
1053
- return {
1054
- default: createButtonTones(opts, base, dark, solid, muted, "default"),
1055
- ghost: createButtonTones(opts, base, dark, solid, muted, "ghost"),
1056
- bleed: createButtonTones(opts, base, dark, solid, muted, "bleed")
1057
- };
1058
- }
1059
- function createCardStates(opts, base, dark, name, solid, muted) {
1060
- return {
1061
- enabled: opts.card({
1062
- base,
1063
- dark,
1064
- name,
1065
- state: "enabled",
1066
- solid,
1067
- muted
1068
- }),
1069
- disabled: opts.card({
1070
- base,
1071
- dark,
1072
- name,
1073
- state: "disabled",
1074
- solid,
1075
- muted
1076
- }),
1077
- hovered: opts.card({
1078
- base,
1079
- dark,
1080
- name,
1081
- state: "hovered",
1082
- solid,
1083
- muted
1084
- }),
1085
- pressed: opts.card({
1086
- base,
1087
- dark,
1088
- name,
1089
- state: "pressed",
1090
- solid,
1091
- muted
1092
- }),
1093
- selected: opts.card({
1094
- base,
1095
- dark,
1096
- name,
1097
- state: "selected",
1098
- solid,
1099
- muted
1100
- })
1101
- };
1102
- }
1103
- const black = "hsl(0, 0%, 0%)";
1104
- const white = "hsl(0, 0%, 100%)";
1105
- const colors = {
1106
- default: {
1107
- lightest: "hsl(0, 0%, 95%)",
1108
- lighter: "hsl(0, 0%, 70%)",
1109
- light: "hsl(0, 0%, 65%)",
1110
- base: "hsl(0, 0%, 50%)",
1111
- dark: "hsl(0, 0%, 35%)",
1112
- darker: "hsl(0, 0%, 20%)",
1113
- darkest: "hsl(0, 0%, 5%)"
1114
- },
1115
- transparent: {
1116
- lightest: "hsl(240, 100%, 95%)",
1117
- lighter: "hsl(240, 100%, 70%)",
1118
- light: "hsl(240, 100%, 65%)",
1119
- base: "hsl(240, 100%, 50%)",
1120
- dark: "hsl(240, 100%, 35%)",
1121
- darker: "hsl(240, 100%, 20%)",
1122
- darkest: "hsl(240, 100%, 5%)"
1123
- },
1124
- primary: {
1125
- lightest: "hsl(240, 100%, 95%)",
1126
- lighter: "hsl(240, 100%, 70%)",
1127
- light: "hsl(240, 100%, 65%)",
1128
- base: "hsl(240, 100%, 50%)",
1129
- dark: "hsl(240, 100%, 35%)",
1130
- darker: "hsl(240, 100%, 20%)",
1131
- darkest: "hsl(240, 100%, 5%)"
1132
- },
1133
- positive: {
1134
- lightest: "hsl(120, 100%, 95%)",
1135
- lighter: "hsl(120, 100%, 70%)",
1136
- light: "hsl(120, 100%, 65%)",
1137
- base: "hsl(120, 100%, 50%)",
1138
- dark: "hsl(120, 100%, 35%)",
1139
- darker: "hsl(120, 100%, 20%)",
1140
- darkest: "hsl(120, 100%, 5%)"
1141
- },
1142
- caution: {
1143
- lightest: "hsl(60, 100%, 95%)",
1144
- lighter: "hsl(60, 100%, 70%)",
1145
- light: "hsl(60, 100%, 65%)",
1146
- base: "hsl(60, 100%, 50%)",
1147
- dark: "hsl(60, 100%, 35%)",
1148
- darker: "hsl(60, 100%, 20%)",
1149
- darkest: "hsl(60, 100%, 5%)"
1150
- },
1151
- critical: {
1152
- lightest: "hsl(0, 100%, 95%)",
1153
- lighter: "hsl(0, 100%, 70%)",
1154
- light: "hsl(0, 100%, 65%)",
1155
- base: "hsl(0, 100%, 50%)",
1156
- dark: "hsl(0, 100%, 35%)",
1157
- darker: "hsl(0, 100%, 20%)",
1158
- darkest: "hsl(0, 100%, 5%)"
1159
- }
1160
- };
1161
- const spots = {
1162
- gray: "hsl(0, 0%, 50%)",
1163
- red: "hsl(0, 100%, 50%)",
1164
- orange: "hsl(30, 100%, 50%)",
1165
- yellow: "hsl(60, 100%, 50%)",
1166
- green: "hsl(120, 100%, 50%)",
1167
- cyan: "hsl(180, 100%, 50%)",
1168
- blue: "hsl(240, 100%, 50%)",
1169
- purple: "hsl(270, 100%, 50%)",
1170
- magenta: "hsl(300, 100%, 50%)"
1171
- };
1172
- const tones$1 = {
1173
- transparent: {
1174
- bg: [colors.transparent.darkest, colors.transparent.lightest],
1175
- fg: [colors.transparent.lightest, colors.transparent.darkest],
1176
- border: [colors.transparent.darker, colors.transparent.lighter],
1177
- focusRing: [colors.transparent.base, colors.transparent.base]
1178
- },
1179
- primary: {
1180
- bg: [colors.primary.darkest, colors.primary.lightest],
1181
- fg: [colors.primary.lightest, colors.primary.darkest],
1182
- border: [colors.primary.darker, colors.primary.lighter],
1183
- focusRing: [colors.primary.base, colors.primary.base]
1184
- },
1185
- positive: {
1186
- bg: [colors.positive.darkest, colors.positive.lightest],
1187
- fg: [colors.positive.lightest, colors.positive.darkest],
1188
- border: [colors.positive.darker, colors.positive.lighter],
1189
- focusRing: [colors.positive.base, colors.positive.base]
1190
- },
1191
- caution: {
1192
- bg: [colors.caution.darkest, colors.caution.lightest],
1193
- fg: [colors.caution.lightest, colors.caution.darkest],
1194
- border: [colors.caution.darker, colors.caution.lighter],
1195
- focusRing: [colors.caution.base, colors.caution.base]
1196
- },
1197
- critical: {
1198
- bg: [colors.critical.darkest, colors.critical.lightest],
1199
- fg: [colors.critical.lightest, colors.critical.darkest],
1200
- border: [colors.critical.darker, colors.critical.lighter],
1201
- focusRing: [colors.critical.base, colors.critical.base]
1202
- }
1203
- };
1204
- const defaultOpts = {
1205
- base: _ref4 => {
1206
- let {
1207
- dark,
1208
- name
1209
- } = _ref4;
1210
- if (name === "default") {
1211
- return {
1212
- bg: dark ? black : white,
1213
- fg: dark ? white : black,
1214
- border: dark ? colors.default.darkest : colors.default.lightest,
1215
- focusRing: colors.primary.base,
1216
- shadow: {
1217
- outline: black,
1218
- umbra: black,
1219
- penumbra: black,
1220
- ambient: black
1221
- },
1222
- skeleton: {
1223
- from: dark ? white : black,
1224
- to: dark ? white : black
1225
- }
1226
- };
1227
- }
1228
- return {
1229
- bg: tones$1[name].bg[dark ? 0 : 1],
1230
- fg: tones$1[name].fg[dark ? 0 : 1],
1231
- border: tones$1[name].border[dark ? 0 : 1],
1232
- focusRing: tones$1[name].focusRing[dark ? 0 : 1],
1233
- shadow: {
1234
- outline: black,
1235
- umbra: black,
1236
- penumbra: black,
1237
- ambient: black
1238
- },
1239
- skeleton: {
1240
- from: dark ? white : black,
1241
- to: dark ? white : black
1242
- }
1243
- };
1244
- },
1245
- solid: _ref5 => {
1246
- let {
1247
- base,
1248
- dark,
1249
- state,
1250
- tone
1251
- } = _ref5;
1252
- const color = colors[tone];
1253
- if (state === "hovered") {
1254
- return {
1255
- bg: dark ? color.light : color.dark,
1256
- bg2: dark ? color.light : color.dark,
1257
- border: dark ? color.lighter : color.darker,
1258
- fg: dark ? color.darkest : color.lightest,
1259
- iconColor: dark ? color.darkest : color.lightest,
1260
- muted: {
1261
- fg: black
1262
- },
1263
- accent: {
1264
- fg: black
1265
- },
1266
- link: {
1267
- fg: black
1268
- },
1269
- code: {
1270
- bg: black,
1271
- fg: black
1272
- },
1273
- skeleton: base.skeleton
1274
- };
1275
- }
1276
- return {
1277
- bg: color.base,
1278
- bg2: color.base,
1279
- border: dark ? color.light : color.dark,
1280
- fg: dark ? color.darkest : color.lightest,
1281
- iconColor: dark ? color.darkest : color.lightest,
1282
- muted: {
1283
- fg: black
1284
- },
1285
- accent: {
1286
- fg: black
1287
- },
1288
- link: {
1289
- fg: black
1290
- },
1291
- code: {
1292
- bg: black,
1293
- fg: black
1294
- },
1295
- skeleton: base.skeleton
1296
- };
1297
- },
1298
- muted: _ref6 => {
1299
- let {
1300
- base,
1301
- dark,
1302
- state,
1303
- tone
1304
- } = _ref6;
1305
- const color = colors[tone];
1306
- if (state === "hovered") {
1307
- return {
1308
- bg: dark ? color.darker : color.lighter,
1309
- bg2: dark ? color.darker : color.lighter,
1310
- border: dark ? color.lighter : color.darker,
1311
- fg: dark ? color.lightest : color.darkest,
1312
- iconColor: dark ? color.lightest : color.darkest,
1313
- muted: {
1314
- fg: black
1315
- },
1316
- accent: {
1317
- fg: black
1318
- },
1319
- link: {
1320
- fg: black
1321
- },
1322
- code: {
1323
- bg: black,
1324
- fg: black
1325
- },
1326
- skeleton: base.skeleton
1327
- };
1328
- }
1329
- return {
1330
- bg: dark ? color.darkest : color.lightest,
1331
- bg2: dark ? color.darkest : color.lightest,
1332
- border: dark ? color.darker : color.lighter,
1333
- fg: dark ? color.lighter : color.darker,
1334
- iconColor: dark ? color.lighter : color.darker,
1335
- muted: {
1336
- fg: black
1337
- },
1338
- accent: {
1339
- fg: black
1340
- },
1341
- link: {
1342
- fg: black
1343
- },
1344
- code: {
1345
- bg: black,
1346
- fg: black
1347
- },
1348
- skeleton: base.skeleton
1349
- };
1350
- },
1351
- button: _ref7 => {
1352
- let {
1353
- base,
1354
- mode,
1355
- muted,
1356
- solid
1357
- } = _ref7;
1358
- if (mode === "bleed") {
1359
- return {
1360
- ...muted,
1361
- enabled: {
1362
- bg: "transparent",
1363
- bg2: "transparent",
1364
- fg: muted.enabled.fg,
1365
- iconColor: muted.enabled.fg,
1366
- border: "transparent",
1367
- muted: {
1368
- fg: black
1369
- },
1370
- accent: {
1371
- fg: black
1372
- },
1373
- link: {
1374
- fg: black
1375
- },
1376
- code: {
1377
- bg: black,
1378
- fg: black
1379
- },
1380
- skeleton: base.skeleton
1381
- },
1382
- hovered: {
1383
- bg: muted.enabled.bg,
1384
- bg2: muted.enabled.bg,
1385
- fg: muted.hovered.fg,
1386
- iconColor: muted.hovered.fg,
1387
- border: "transparent",
1388
- muted: {
1389
- fg: black
1390
- },
1391
- accent: {
1392
- fg: black
1393
- },
1394
- link: {
1395
- fg: black
1396
- },
1397
- code: {
1398
- bg: black,
1399
- fg: black
1400
- },
1401
- skeleton: base.skeleton
1402
- }
1403
- };
1404
- }
1405
- if (mode === "ghost") return {
1406
- ...solid,
1407
- enabled: muted.enabled
1408
- };
1409
- return solid;
1410
- },
1411
- card: _ref8 => {
1412
- let {
1413
- base
1414
- } = _ref8;
1415
- return {
1416
- bg: black,
1417
- bg2: black,
1418
- fg: black,
1419
- iconColor: black,
1420
- border: black,
1421
- muted: {
1422
- fg: black
1423
- },
1424
- accent: {
1425
- fg: black
1426
- },
1427
- link: {
1428
- fg: black
1429
- },
1430
- code: {
1431
- bg: black,
1432
- fg: black
1433
- },
1434
- skeleton: base.skeleton
1435
- };
1436
- },
1437
- input: () => {
1438
- return {
1439
- bg: black,
1440
- bg2: black,
1441
- fg: black,
1442
- border: black,
1443
- placeholder: black
1444
- };
1445
- },
1446
- selectable: _ref9 => {
1447
- let {
1448
- muted,
1449
- state,
1450
- tone
1451
- } = _ref9;
1452
- return muted[tone][state];
1453
- },
1454
- spot: _ref10 => {
1455
- let {
1456
- key
1457
- } = _ref10;
1458
- return spots[key];
1459
- },
1460
- syntax: () => ({
1461
- atrule: black,
1462
- attrName: black,
1463
- attrValue: black,
1464
- attribute: black,
1465
- boolean: black,
1466
- builtin: black,
1467
- cdata: black,
1468
- char: black,
1469
- class: black,
1470
- className: black,
1471
- comment: black,
1472
- constant: black,
1473
- deleted: black,
1474
- doctype: black,
1475
- entity: black,
1476
- function: black,
1477
- hexcode: black,
1478
- id: black,
1479
- important: black,
1480
- inserted: black,
1481
- keyword: black,
1482
- number: black,
1483
- operator: black,
1484
- prolog: black,
1485
- property: black,
1486
- pseudoClass: black,
1487
- pseudoElement: black,
1488
- punctuation: black,
1489
- regex: black,
1490
- selector: black,
1491
- string: black,
1492
- symbol: black,
1493
- tag: black,
1494
- unit: black,
1495
- url: black,
1496
- variable: black
1497
- })
1498
- };
1499
- function createInputModes(opts, base, dark, solid, muted) {
1500
- return {
1501
- default: {
1502
- enabled: opts.input({
1503
- base,
1504
- dark,
1505
- mode: "default",
1506
- state: "enabled",
1507
- solid: solid.default,
1508
- muted: muted.default
1509
- }),
1510
- disabled: opts.input({
1511
- base,
1512
- dark,
1513
- mode: "default",
1514
- state: "disabled",
1515
- solid: solid.default,
1516
- muted: muted.default
1517
- }),
1518
- hovered: opts.input({
1519
- base,
1520
- dark,
1521
- mode: "default",
1522
- state: "hovered",
1523
- solid: solid.default,
1524
- muted: muted.default
1525
- }),
1526
- readOnly: opts.input({
1527
- base,
1528
- dark,
1529
- mode: "default",
1530
- state: "readOnly",
1531
- solid: solid.default,
1532
- muted: muted.default
1533
- })
1534
- },
1535
- invalid: {
1536
- enabled: opts.input({
1537
- base,
1538
- dark,
1539
- mode: "invalid",
1540
- state: "enabled",
1541
- solid: solid.default,
1542
- muted: muted.default
1543
- }),
1544
- disabled: opts.input({
1545
- base,
1546
- dark,
1547
- mode: "invalid",
1548
- state: "disabled",
1549
- solid: solid.default,
1550
- muted: muted.default
1551
- }),
1552
- hovered: opts.input({
1553
- base,
1554
- dark,
1555
- mode: "invalid",
1556
- state: "hovered",
1557
- solid: solid.default,
1558
- muted: muted.default
1559
- }),
1560
- readOnly: opts.input({
1561
- base,
1562
- dark,
1563
- mode: "invalid",
1564
- state: "readOnly",
1565
- solid: solid.default,
1566
- muted: muted.default
1567
- })
1568
- }
1569
- };
1570
- }
1571
- function createMutedTones(opts, base, dark, name) {
1572
- return {
1573
- default: {
1574
- enabled: opts.muted({
1575
- base,
1576
- dark,
1577
- tone: "default",
1578
- name,
1579
- state: "enabled"
1580
- }),
1581
- disabled: opts.muted({
1582
- base,
1583
- dark,
1584
- tone: "default",
1585
- name,
1586
- state: "disabled"
1587
- }),
1588
- hovered: opts.muted({
1589
- base,
1590
- dark,
1591
- tone: "default",
1592
- name,
1593
- state: "hovered"
1594
- }),
1595
- pressed: opts.muted({
1596
- base,
1597
- dark,
1598
- tone: "default",
1599
- name,
1600
- state: "pressed"
1601
- }),
1602
- selected: opts.muted({
1603
- base,
1604
- dark,
1605
- tone: "default",
1606
- name,
1607
- state: "selected"
1608
- })
1609
- },
1610
- transparent: {
1611
- enabled: opts.muted({
1612
- base,
1613
- dark,
1614
- tone: "transparent",
1615
- name,
1616
- state: "enabled"
1617
- }),
1618
- disabled: opts.muted({
1619
- base,
1620
- dark,
1621
- tone: "transparent",
1622
- name,
1623
- state: "disabled"
1624
- }),
1625
- hovered: opts.muted({
1626
- base,
1627
- dark,
1628
- tone: "transparent",
1629
- name,
1630
- state: "hovered"
1631
- }),
1632
- pressed: opts.muted({
1633
- base,
1634
- dark,
1635
- tone: "transparent",
1636
- name,
1637
- state: "pressed"
1638
- }),
1639
- selected: opts.muted({
1640
- base,
1641
- dark,
1642
- tone: "transparent",
1643
- name,
1644
- state: "selected"
1645
- })
1646
- },
1647
- primary: {
1648
- enabled: opts.muted({
1649
- base,
1650
- dark,
1651
- tone: "primary",
1652
- name,
1653
- state: "enabled"
1654
- }),
1655
- disabled: opts.muted({
1656
- base,
1657
- dark,
1658
- tone: "primary",
1659
- name,
1660
- state: "disabled"
1661
- }),
1662
- hovered: opts.muted({
1663
- base,
1664
- dark,
1665
- tone: "primary",
1666
- name,
1667
- state: "hovered"
1668
- }),
1669
- pressed: opts.muted({
1670
- base,
1671
- dark,
1672
- tone: "primary",
1673
- name,
1674
- state: "pressed"
1675
- }),
1676
- selected: opts.muted({
1677
- base,
1678
- dark,
1679
- tone: "primary",
1680
- name,
1681
- state: "selected"
1682
- })
1683
- },
1684
- positive: {
1685
- enabled: opts.muted({
1686
- base,
1687
- dark,
1688
- tone: "positive",
1689
- name,
1690
- state: "enabled"
1691
- }),
1692
- disabled: opts.muted({
1693
- base,
1694
- dark,
1695
- tone: "positive",
1696
- name,
1697
- state: "disabled"
1698
- }),
1699
- hovered: opts.muted({
1700
- base,
1701
- dark,
1702
- tone: "positive",
1703
- name,
1704
- state: "hovered"
1705
- }),
1706
- pressed: opts.muted({
1707
- base,
1708
- dark,
1709
- tone: "positive",
1710
- name,
1711
- state: "pressed"
1712
- }),
1713
- selected: opts.muted({
1714
- base,
1715
- dark,
1716
- tone: "positive",
1717
- name,
1718
- state: "selected"
1719
- })
1720
- },
1721
- caution: {
1722
- enabled: opts.muted({
1723
- base,
1724
- dark,
1725
- tone: "caution",
1726
- name,
1727
- state: "enabled"
1728
- }),
1729
- disabled: opts.muted({
1730
- base,
1731
- dark,
1732
- tone: "caution",
1733
- name,
1734
- state: "disabled"
1735
- }),
1736
- hovered: opts.muted({
1737
- base,
1738
- dark,
1739
- tone: "caution",
1740
- name,
1741
- state: "hovered"
1742
- }),
1743
- pressed: opts.muted({
1744
- base,
1745
- dark,
1746
- tone: "caution",
1747
- name,
1748
- state: "pressed"
1749
- }),
1750
- selected: opts.muted({
1751
- base,
1752
- dark,
1753
- tone: "caution",
1754
- name,
1755
- state: "selected"
1756
- })
1757
- },
1758
- critical: {
1759
- enabled: opts.muted({
1760
- base,
1761
- dark,
1762
- tone: "critical",
1763
- name,
1764
- state: "enabled"
1765
- }),
1766
- disabled: opts.muted({
1767
- base,
1768
- dark,
1769
- tone: "critical",
1770
- name,
1771
- state: "disabled"
1772
- }),
1773
- hovered: opts.muted({
1774
- base,
1775
- dark,
1776
- tone: "critical",
1777
- name,
1778
- state: "hovered"
1779
- }),
1780
- pressed: opts.muted({
1781
- base,
1782
- dark,
1783
- tone: "critical",
1784
- name,
1785
- state: "pressed"
1786
- }),
1787
- selected: opts.muted({
1788
- base,
1789
- dark,
1790
- tone: "critical",
1791
- name,
1792
- state: "selected"
1793
- })
1794
- }
1795
- };
1796
- }
1797
- function createSelectableTones(opts, base, dark, solid, muted) {
1798
- return {
1799
- default: _createSelectableStates(opts, base, dark, solid, muted, "default"),
1800
- primary: _createSelectableStates(opts, base, dark, solid, muted, "primary"),
1801
- positive: _createSelectableStates(opts, base, dark, solid, muted, "positive"),
1802
- caution: _createSelectableStates(opts, base, dark, solid, muted, "caution"),
1803
- critical: _createSelectableStates(opts, base, dark, solid, muted, "critical")
1804
- };
1805
- }
1806
- function _createSelectableStates(opts, base, dark, solid, muted, tone) {
1807
- return {
1808
- enabled: opts.selectable({
1809
- base,
1810
- dark,
1811
- solid,
1812
- muted,
1813
- state: "enabled",
1814
- tone
1815
- }),
1816
- hovered: opts.selectable({
1817
- base,
1818
- dark,
1819
- solid,
1820
- muted,
1821
- state: "hovered",
1822
- tone
1823
- }),
1824
- pressed: opts.selectable({
1825
- base,
1826
- dark,
1827
- solid,
1828
- muted,
1829
- state: "pressed",
1830
- tone
1831
- }),
1832
- selected: opts.selectable({
1833
- base,
1834
- dark,
1835
- solid,
1836
- muted,
1837
- state: "selected",
1838
- tone
1839
- }),
1840
- disabled: opts.selectable({
1841
- base,
1842
- dark,
1843
- solid,
1844
- muted,
1845
- state: "disabled",
1846
- tone
1847
- })
1848
- };
1849
- }
1850
- function createSolidTones(opts, base, dark, name) {
1851
- return {
1852
- default: {
1853
- enabled: opts.solid({
1854
- base,
1855
- dark,
1856
- tone: "default",
1857
- name,
1858
- state: "enabled"
1859
- }),
1860
- disabled: opts.solid({
1861
- base,
1862
- dark,
1863
- tone: "default",
1864
- name,
1865
- state: "disabled"
1866
- }),
1867
- hovered: opts.solid({
1868
- base,
1869
- dark,
1870
- tone: "default",
1871
- name,
1872
- state: "hovered"
1873
- }),
1874
- pressed: opts.solid({
1875
- base,
1876
- dark,
1877
- tone: "default",
1878
- name,
1879
- state: "pressed"
1880
- }),
1881
- selected: opts.solid({
1882
- base,
1883
- dark,
1884
- tone: "default",
1885
- name,
1886
- state: "selected"
1887
- })
1888
- },
1889
- transparent: {
1890
- enabled: opts.solid({
1891
- base,
1892
- dark,
1893
- tone: "transparent",
1894
- name,
1895
- state: "enabled"
1896
- }),
1897
- disabled: opts.solid({
1898
- base,
1899
- dark,
1900
- tone: "transparent",
1901
- name,
1902
- state: "disabled"
1903
- }),
1904
- hovered: opts.solid({
1905
- base,
1906
- dark,
1907
- tone: "transparent",
1908
- name,
1909
- state: "hovered"
1910
- }),
1911
- pressed: opts.solid({
1912
- base,
1913
- dark,
1914
- tone: "transparent",
1915
- name,
1916
- state: "pressed"
1917
- }),
1918
- selected: opts.solid({
1919
- base,
1920
- dark,
1921
- tone: "transparent",
1922
- name,
1923
- state: "selected"
1924
- })
1925
- },
1926
- primary: {
1927
- enabled: opts.solid({
1928
- base,
1929
- dark,
1930
- tone: "primary",
1931
- name,
1932
- state: "enabled"
1933
- }),
1934
- disabled: opts.solid({
1935
- base,
1936
- dark,
1937
- tone: "primary",
1938
- name,
1939
- state: "disabled"
1940
- }),
1941
- hovered: opts.solid({
1942
- base,
1943
- dark,
1944
- tone: "primary",
1945
- name,
1946
- state: "hovered"
1947
- }),
1948
- pressed: opts.solid({
1949
- base,
1950
- dark,
1951
- tone: "primary",
1952
- name,
1953
- state: "pressed"
1954
- }),
1955
- selected: opts.solid({
1956
- base,
1957
- dark,
1958
- tone: "primary",
1959
- name,
1960
- state: "selected"
1961
- })
1962
- },
1963
- positive: {
1964
- enabled: opts.solid({
1965
- base,
1966
- dark,
1967
- tone: "positive",
1968
- name,
1969
- state: "enabled"
1970
- }),
1971
- disabled: opts.solid({
1972
- base,
1973
- dark,
1974
- tone: "positive",
1975
- name,
1976
- state: "disabled"
1977
- }),
1978
- hovered: opts.solid({
1979
- base,
1980
- dark,
1981
- tone: "positive",
1982
- name,
1983
- state: "hovered"
1984
- }),
1985
- pressed: opts.solid({
1986
- base,
1987
- dark,
1988
- tone: "positive",
1989
- name,
1990
- state: "pressed"
1991
- }),
1992
- selected: opts.solid({
1993
- base,
1994
- dark,
1995
- tone: "positive",
1996
- name,
1997
- state: "selected"
1998
- })
1999
- },
2000
- caution: {
2001
- enabled: opts.solid({
2002
- base,
2003
- dark,
2004
- tone: "caution",
2005
- name,
2006
- state: "enabled"
2007
- }),
2008
- disabled: opts.solid({
2009
- base,
2010
- dark,
2011
- tone: "caution",
2012
- name,
2013
- state: "disabled"
2014
- }),
2015
- hovered: opts.solid({
2016
- base,
2017
- dark,
2018
- tone: "caution",
2019
- name,
2020
- state: "hovered"
2021
- }),
2022
- pressed: opts.solid({
2023
- base,
2024
- dark,
2025
- tone: "caution",
2026
- name,
2027
- state: "pressed"
2028
- }),
2029
- selected: opts.solid({
2030
- base,
2031
- dark,
2032
- tone: "caution",
2033
- name,
2034
- state: "selected"
2035
- })
2036
- },
2037
- critical: {
2038
- enabled: opts.solid({
2039
- base,
2040
- dark,
2041
- tone: "critical",
2042
- name,
2043
- state: "enabled"
2044
- }),
2045
- disabled: opts.solid({
2046
- base,
2047
- dark,
2048
- tone: "critical",
2049
- name,
2050
- state: "disabled"
2051
- }),
2052
- hovered: opts.solid({
2053
- base,
2054
- dark,
2055
- tone: "critical",
2056
- name,
2057
- state: "hovered"
2058
- }),
2059
- pressed: opts.solid({
2060
- base,
2061
- dark,
2062
- tone: "critical",
2063
- name,
2064
- state: "pressed"
2065
- }),
2066
- selected: opts.solid({
2067
- base,
2068
- dark,
2069
- tone: "critical",
2070
- name,
2071
- state: "selected"
2072
- })
2073
- }
2074
- };
2075
- }
2076
- function createSpot(opts, base, dark) {
2077
- return {
2078
- gray: opts.spot({
2079
- base,
2080
- dark,
2081
- key: "gray"
2082
- }),
2083
- blue: opts.spot({
2084
- base,
2085
- dark,
2086
- key: "blue"
2087
- }),
2088
- purple: opts.spot({
2089
- base,
2090
- dark,
2091
- key: "purple"
2092
- }),
2093
- magenta: opts.spot({
2094
- base,
2095
- dark,
2096
- key: "magenta"
2097
- }),
2098
- red: opts.spot({
2099
- base,
2100
- dark,
2101
- key: "red"
2102
- }),
2103
- orange: opts.spot({
2104
- base,
2105
- dark,
2106
- key: "orange"
2107
- }),
2108
- yellow: opts.spot({
2109
- base,
2110
- dark,
2111
- key: "yellow"
2112
- }),
2113
- green: opts.spot({
2114
- base,
2115
- dark,
2116
- key: "green"
2117
- }),
2118
- cyan: opts.spot({
2119
- base,
2120
- dark,
2121
- key: "cyan"
2122
- })
2123
- };
2124
- }
2125
- function createColorTheme() {
2126
- let partialOpts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2127
- const builders = {
2128
- ...defaultOpts,
2129
- ...partialOpts
2130
- };
2131
- return {
2132
- light: _createColorScheme(builders, false),
2133
- dark: _createColorScheme(builders, true)
2134
- };
2135
- }
2136
- function _createColorScheme(opts, dark) {
2137
- return {
2138
- default: _createColor(opts, dark, "default"),
2139
- transparent: _createColor(opts, dark, "transparent"),
2140
- primary: _createColor(opts, dark, "primary"),
2141
- positive: _createColor(opts, dark, "positive"),
2142
- caution: _createColor(opts, dark, "caution"),
2143
- critical: _createColor(opts, dark, "critical")
2144
- };
2145
- }
2146
- function _createColor(opts, dark, name) {
2147
- const base = opts.base({
2148
- dark,
2149
- name
2150
- });
2151
- const solid = createSolidTones(opts, base, dark, name);
2152
- const muted = createMutedTones(opts, base, dark, name);
2153
- return {
2154
- base,
2155
- button: createButtonModes(opts, base, dark, solid, muted),
2156
- card: createCardStates(opts, base, dark, name, solid, muted),
2157
- dark,
2158
- input: createInputModes(opts, base, dark, solid, muted),
2159
- selectable: createSelectableTones(opts, base, dark, solid, muted),
2160
- spot: createSpot(opts, base, dark),
2161
- syntax: opts.syntax({
2162
- base,
2163
- dark
2164
- }),
2165
- solid,
2166
- muted
2167
- };
2168
- }
2169
1025
  function multiply(bg, fg) {
2170
1026
  const b = parseColor(bg);
2171
1027
  const s = parseColor(fg);
2172
1028
  const hex = rgbToHex(multiply$1(b, s));
1029
+ if (s.a) {
1030
+ return rgba(hex, s.a);
1031
+ }
2173
1032
  return hex;
2174
1033
  }
2175
1034
  function screen(bg, fg) {
2176
1035
  const b = parseColor(bg);
2177
1036
  const s = parseColor(fg);
2178
1037
  const hex = rgbToHex(screen$1(b, s));
1038
+ if (s.a) {
1039
+ return rgba(hex, s.a);
1040
+ }
2179
1041
  return hex;
2180
1042
  }
1043
+ const colorKeys = ["text-primary", "text-secondary", "text-inactive",
1044
+ // TODO: Can this be replaced by other of the text colors? It's used by the code html element if it's inside a text
1045
+ "text-code", "text-muted", "text-link", "text-accent", "bg-base", "bg-base-hover", "bg-base-active", "bg-accent", "bg-accent-hover", "bg-accent-active", "bg-tint",
1046
+ // TODO: Can we replace this with bg_tint? It's used by the code html element if it's inside a text
1047
+ "bg-tint-code", "icon-default", "icon-inverted", "border-base", "border-base-hover", "border-accent", "border-accent-inverted",
1048
+ // Colors starting with -base won't be affected by the mix function
1049
+ "base-bg-card",
1050
+ // This is used by the card when a tone is defined, it will also override the bg-base in the rest of the components.
1051
+ "base-bg-raw",
1052
+ // This is the same color as bg-base, but it won't be overridden by the card bg color, used in selectable items.
1053
+ "base-shadow-outline-color", "base-shadow-umbra-color", "base-shadow-penumbra-color", "base-shadow-ambient-color", "base-text-color",
1054
+ // Color used by the buttons for default mode text
1055
+ "skeleton-from", "skeleton-to"];
2181
1056
  const defaultTints = {
2182
1057
  light: {
2183
- text_primary: "900",
2184
- text_secondary: "600",
2185
- text_inactive: "500",
2186
- bg_base: color$1.white,
2187
- bg_base_hover: "50",
2188
- bg_base_active: "100",
2189
- bg_accent: "500",
2190
- bg_accent_hover: "600",
2191
- bg_accent_active: "700",
2192
- bg_tint: "50",
2193
- icon_default: "500",
2194
- icon_inverted: color$1.white,
2195
- border_base: "100",
2196
- border_accent: "500",
2197
- border_accent_inverted: color$1.white
2198
- },
2199
- dark: {
2200
- text_primary: "50",
2201
- text_secondary: "300",
2202
- text_inactive: "400",
2203
- bg_base: color$1.black,
2204
- bg_base_hover: "900",
2205
- bg_base_active: "800",
2206
- bg_accent: "500",
2207
- bg_accent_hover: "400",
2208
- bg_accent_active: "300",
2209
- bg_tint: "900",
2210
- icon_default: "300",
2211
- icon_inverted: color$1.hues.gray[900],
2212
- border_base: "800",
2213
- border_accent: "300",
2214
- border_accent_inverted: color$1.hues.gray[900]
2215
- }
2216
- };
2217
- const colorTints = {
2218
- light: {
2219
- default: {
2220
- ...defaultTints.light,
2221
- bg_accent: "900",
2222
- bg_accent_hover: "950",
2223
- bg_accent_active: color$1.black,
2224
- border_accent: "600"
1058
+ "text-primary": "900",
1059
+ "text-secondary": "600",
1060
+ "text-inactive": "500",
1061
+ "text-code": "600",
1062
+ "text-muted": "600",
1063
+ "text-link": {
1064
+ type: "colorTint",
1065
+ value: color.hues.blue["600"]
2225
1066
  },
2226
- primary: {
2227
- ...defaultTints.light,
2228
- bg_accent: "900",
2229
- bg_accent_hover: "950",
2230
- bg_accent_active: color$1.black,
2231
- border_accent: "600"
1067
+ "text-accent": {
1068
+ type: "colorTint",
1069
+ value: color.hues.red["500"]
2232
1070
  },
2233
- positive: {
2234
- ...defaultTints.light,
2235
- bg_base_hover: color$1.hues.gray[50],
2236
- bg_base_active: "50",
2237
- bg_accent: "400",
2238
- bg_accent_hover: "500",
2239
- bg_accent_active: "600",
2240
- border_accent: "400"
1071
+ "bg-base": {
1072
+ type: "colorTint",
1073
+ value: color.white
2241
1074
  },
2242
- transparent: defaultTints.light,
2243
- caution: defaultTints.light,
2244
- critical: defaultTints.light
2245
- },
2246
- dark: {
2247
- default: {
2248
- ...defaultTints.dark,
2249
- text_primary: color$1.white,
2250
- bg_accent: color$1.white,
2251
- bg_accent_hover: "50",
2252
- bg_accent_active: "100"
1075
+ "bg-base-hover": "50",
1076
+ "bg-base-active": "100",
1077
+ "bg-accent": "500",
1078
+ "bg-accent-hover": "600",
1079
+ "bg-accent-active": "700",
1080
+ "bg-tint": "50",
1081
+ "bg-tint-code": "50",
1082
+ "icon-default": "500",
1083
+ "icon-inverted": {
1084
+ type: "colorTint",
1085
+ value: color.white
2253
1086
  },
2254
- primary: {
2255
- ...defaultTints.dark,
2256
- text_primary: color$1.white,
2257
- bg_accent: color$1.white,
2258
- bg_accent_hover: "50",
2259
- bg_accent_active: "100"
1087
+ "border-base": "100",
1088
+ "border-base-hover": "200",
1089
+ "border-accent": "500",
1090
+ "border-accent-inverted": {
1091
+ type: "colorTint",
1092
+ value: color.white
2260
1093
  },
2261
- positive: {
2262
- ...defaultTints.dark,
2263
- bg_base_hover: color$1.hues.gray[900],
2264
- bg_base_active: "900",
2265
- bg_accent: "400",
2266
- bg_accent_hover: "300",
2267
- bg_accent_active: "200",
2268
- border_accent: "400"
1094
+ "base-bg-card": "50",
1095
+ "base-bg-raw": {
1096
+ type: "colorTint",
1097
+ value: color.white
2269
1098
  },
2270
- transparent: defaultTints.dark,
2271
- caution: defaultTints.dark,
2272
- critical: defaultTints.dark
2273
- }
2274
- };
2275
- const getColorValue = (tints, dark, tone, key) => {
2276
- const value = colorTints[dark ? "dark" : "light"][tone][key];
2277
- if (typeof value === "string") {
2278
- return tints[value];
2279
- }
2280
- return value;
2281
- };
2282
- const getColorHex = (tints, dark, tone, key) => {
2283
- return getColorValue(tints, dark, tone, key).hex;
2284
- };
2285
- const tones = {
2286
- default: color$1.hues.gray,
2287
- transparent: color$1.hues.gray,
2288
- primary: color$1.hues.gray,
2289
- positive: color$1.hues.cyan,
2290
- caution: color$1.hues.yellow,
2291
- critical: color$1.hues.red
2292
- };
2293
- const NEUTRAL_TONES = ["default", "transparent"];
2294
- const color = createColorTheme({
2295
- base: _ref11 => {
2296
- let {
2297
- dark,
2298
- name
2299
- } = _ref11;
2300
- if (name === "default") {
2301
- const tints2 = color$1.hues.gray;
2302
- const skeletonFrom2 = dark ? tints2[900].hex : tints2[100].hex;
2303
- return {
2304
- fg: dark ? color$1.white.hex : color$1.black.hex,
2305
- bg: getColorHex(tones["default"], dark, "default", "bg_base"),
2306
- border: getColorHex(tones["default"], dark, "default", "border_base"),
2307
- focusRing: getColorHex(tones["positive"], dark, "positive", "border_accent"),
2308
- shadow: {
2309
- outline: rgba(tints2[500].hex, 0.4),
2310
- umbra: dark ? rgba(tints2[950].hex, 0.4) : rgba(tints2[500].hex, 0.2),
2311
- penumbra: dark ? rgba(tints2[950].hex, 0.28) : rgba(tints2[500].hex, 0.14),
2312
- ambient: dark ? rgba(tints2[950].hex, 0.24) : rgba(tints2[500].hex, 0.12)
2313
- },
2314
- skeleton: {
2315
- from: skeletonFrom2,
2316
- to: rgba(skeletonFrom2, 0.5)
2317
- }
2318
- };
2319
- }
2320
- if (name === "transparent") {
2321
- const tints2 = tones.default;
2322
- const skeletonFrom2 = tints2[dark ? 800 : 200].hex;
2323
- return {
2324
- fg: tints2[dark ? 100 : 900].hex,
2325
- bg: tints2[dark ? 950 : 50].hex,
2326
- border: tints2[dark ? 800 : 300].hex,
2327
- focusRing: color$1.hues.blue[500].hex,
2328
- shadow: {
2329
- outline: rgba(tints2[500].hex, 0.4),
2330
- umbra: dark ? rgba(tints2[900].hex, 0.4) : rgba(tints2[500].hex, 0.2),
2331
- penumbra: dark ? rgba(tints2[900].hex, 0.28) : rgba(tints2[500].hex, 0.14),
2332
- ambient: dark ? rgba(tints2[900].hex, 0.24) : rgba(tints2[500].hex, 0.12)
2333
- },
2334
- skeleton: {
2335
- from: skeletonFrom2,
2336
- to: rgba(skeletonFrom2, 0.5)
2337
- }
2338
- };
2339
- }
2340
- const tints = tones[name] || tones.default;
2341
- const skeletonFrom = tints[dark ? 800 : 200].hex;
2342
- return {
2343
- fg: tints[dark ? 100 : 900].hex,
2344
- bg: getColorHex(tints, dark, name, "bg_base"),
2345
- border: getColorHex(tints, dark, name, "border_base"),
2346
- focusRing: getColorHex(tints, dark, name, "border_accent"),
2347
- shadow: {
2348
- outline: rgba(tints[500].hex, 0.4),
2349
- umbra: dark ? rgba(tints[900].hex, 0.4) : rgba(tints[500].hex, 0.2),
2350
- penumbra: dark ? rgba(tints[900].hex, 0.28) : rgba(tints[500].hex, 0.14),
2351
- ambient: dark ? rgba(tints[900].hex, 0.24) : rgba(tints[500].hex, 0.12)
2352
- },
2353
- skeleton: {
2354
- from: skeletonFrom,
2355
- to: rgba(skeletonFrom, 0.5)
2356
- }
2357
- };
2358
- },
2359
- solid: _ref12 => {
2360
- let {
2361
- base,
2362
- dark,
2363
- name,
2364
- state,
2365
- tone
2366
- } = _ref12;
2367
- const mix = dark ? screen : multiply;
2368
- const mix2 = dark ? multiply : screen;
2369
- const defaultTints = tones[name] || tones.default;
2370
- const isNeutral = NEUTRAL_TONES.includes(name) && NEUTRAL_TONES.includes(tone);
2371
- let tints = tones[tone === "default" ? name : tone] || defaultTints;
2372
- if (state === "disabled") {
2373
- tints = defaultTints;
2374
- const bg2 = getColorHex(tones.default, dark, "default", "bg_tint");
2375
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2376
- return {
2377
- bg: bg2,
2378
- bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2379
- border: getColorHex(tones.default, dark, "default", "bg_base"),
2380
- fg: getColorHex(tones.default, dark, "default", "text_inactive"),
2381
- iconColor: getColorHex(tones.default, dark, "default", "border_base"),
2382
- muted: {
2383
- fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2384
- },
2385
- accent: {
2386
- fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2387
- },
2388
- link: {
2389
- fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2390
- },
2391
- code: {
2392
- bg: bg2,
2393
- fg: mix(base.bg, tints[dark ? 950 : 50].hex)
2394
- },
2395
- skeleton: {
2396
- from: skeletonFrom2,
2397
- to: rgba(skeletonFrom2, 0.5)
2398
- }
2399
- };
2400
- }
2401
- if (state === "hovered") {
2402
- const bg2 = getColorHex(tints, dark, tone, "bg_accent_hover");
2403
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2404
- return {
2405
- bg: bg2,
2406
- bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2407
- border: bg2,
2408
- fg: getColorHex(tints, dark, "default", "bg_base"),
2409
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2410
- muted: {
2411
- fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2412
- },
2413
- accent: {
2414
- fg: mix2(bg2, color$1.hues.red[dark ? 800 : 200].hex)
2415
- },
2416
- link: {
2417
- fg: mix2(bg2, color$1.hues.blue[dark ? 800 : 200].hex)
2418
- },
2419
- code: {
2420
- bg: mix(bg2, tints[dark ? 950 : 50].hex),
2421
- fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2422
- },
2423
- skeleton: {
2424
- from: skeletonFrom2,
2425
- to: rgba(skeletonFrom2, 0.5)
2426
- }
2427
- };
2428
- }
2429
- if (state === "pressed") {
2430
- const bg2 = getColorHex(tints, dark, tone, "bg_accent_active");
2431
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 600].hex);
2432
- return {
2433
- bg: bg2,
2434
- bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2435
- border: bg2,
2436
- fg: getColorHex(tints, dark, "default", "bg_base"),
2437
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2438
- muted: {
2439
- fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2440
- },
2441
- accent: {
2442
- fg: mix2(bg2, color$1.hues.red[dark ? 800 : 200].hex)
2443
- },
2444
- link: {
2445
- fg: mix2(bg2, color$1.hues.blue[dark ? 800 : 200].hex)
2446
- },
2447
- code: {
2448
- bg: mix(bg2, tints[dark ? 950 : 50].hex),
2449
- fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2450
- },
2451
- skeleton: {
2452
- from: skeletonFrom2,
2453
- to: rgba(skeletonFrom2, 0.5)
2454
- }
2455
- };
2456
- }
2457
- if (state === "selected") {
2458
- if (isNeutral) {
2459
- tints = tones.primary;
2460
- }
2461
- const bg2 = mix(base.bg, tints[dark ? 200 : 800].hex);
2462
- const skeletonFrom2 = mix2(bg2, tints[dark ? 200 : 800].hex);
2463
- return {
2464
- bg: bg2,
2465
- bg2: mix2(bg2, tints[dark ? 50 : 950].hex),
2466
- border: bg2,
2467
- fg: getColorHex(tints, dark, "default", "bg_base"),
2468
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2469
- muted: {
2470
- fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2471
- },
2472
- accent: {
2473
- fg: mix2(bg2, color$1.hues.red[dark ? 800 : 200].hex)
2474
- },
2475
- link: {
2476
- fg: mix2(bg2, color$1.hues.blue[dark ? 800 : 200].hex)
2477
- },
2478
- code: {
2479
- bg: mix(bg2, tints[dark ? 950 : 50].hex),
2480
- fg: mix(base.bg, tints[dark ? 800 : 200].hex)
2481
- },
2482
- skeleton: {
2483
- from: skeletonFrom2,
2484
- to: rgba(skeletonFrom2, 0.5)
2485
- }
2486
- };
2487
- }
2488
- const bg = getColorHex(tints, dark, tone, "bg_accent");
2489
- const skeletonFrom = mix2(bg, tints[dark ? 200 : 800].hex);
2490
- return {
2491
- bg,
2492
- bg2: mix2(bg, tints[dark ? 50 : 950].hex),
2493
- border: bg,
2494
- fg: getColorHex(tints, dark, "default", "bg_base"),
2495
- iconColor: getColorHex(tints, dark, "default", "icon_inverted"),
2496
- muted: {
2497
- fg: mix(base.bg, tints[dark ? 900 : 100].hex)
2498
- },
2499
- accent: {
2500
- fg: mix2(bg, color$1.hues.red[dark ? 900 : 100].hex)
2501
- },
2502
- link: {
2503
- fg: mix2(bg, color$1.hues.blue[dark ? 900 : 100].hex)
2504
- },
2505
- code: {
2506
- bg: mix(bg, tints[dark ? 950 : 50].hex),
2507
- fg: mix(base.bg, tints[dark ? 900 : 100].hex)
2508
- },
2509
- skeleton: {
2510
- from: skeletonFrom,
2511
- to: rgba(skeletonFrom, 0.5)
2512
- }
2513
- };
2514
- },
2515
- muted: _ref13 => {
2516
- let {
2517
- base,
2518
- dark,
2519
- name,
2520
- state,
2521
- tone
2522
- } = _ref13;
2523
- const mix = dark ? screen : multiply;
2524
- const defaultTints = tones[name] || tones.default;
2525
- const isNeutral = NEUTRAL_TONES.includes(name) && NEUTRAL_TONES.includes(tone);
2526
- let tints = tones[tone === "default" ? name : tone] || defaultTints;
2527
- if (state === "disabled") {
2528
- tints = defaultTints;
2529
- const bg2 = base.bg;
2530
- const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2531
- return {
2532
- bg: bg2,
2533
- bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2534
- border: getColorHex(tones.default, dark, "default", "border_base"),
2535
- fg: getColorHex(tones.default, dark, "default", "text_inactive"),
2536
- iconColor: getColorHex(tones.default, dark, "default", "border_base"),
2537
- muted: {
2538
- fg: getColorHex(tones.default, dark, "default", "text_inactive")
2539
- },
2540
- accent: {
2541
- fg: getColorHex(tints, dark, tone, "text_secondary")
2542
- },
2543
- link: {
2544
- fg: getColorHex(tints, dark, tone, "text_secondary")
2545
- },
2546
- code: {
2547
- bg: bg2,
2548
- fg: getColorHex(tints, dark, tone, "text_secondary")
2549
- },
2550
- skeleton: {
2551
- from: rgba(skeletonFrom2, 0.5),
2552
- to: rgba(skeletonFrom2, 0.25)
2553
- }
2554
- };
2555
- }
2556
- if (state === "hovered") {
2557
- const bg2 = getColorHex(tints, dark, name, "bg_base_hover");
2558
- const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2559
- return {
2560
- bg: bg2,
2561
- bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2562
- border: mix(bg2, tints[dark ? 900 : 100].hex),
2563
- fg: getColorHex(tints, dark, tone, "text_primary"),
2564
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2565
- muted: {
2566
- fg: getColorHex(tints, dark, tone, "text_secondary")
2567
- },
2568
- accent: {
2569
- fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
2570
- },
2571
- link: {
2572
- fg: mix(base.bg, color$1.hues.blue[dark ? 400 : 600].hex)
2573
- },
2574
- code: {
2575
- bg: mix(bg2, tints[dark ? 950 : 50].hex),
2576
- fg: getColorHex(tints, dark, tone, "text_secondary")
2577
- },
2578
- skeleton: {
2579
- from: skeletonFrom2,
2580
- to: rgba(skeletonFrom2, 0.5)
2581
- }
2582
- };
2583
- }
2584
- if (state === "pressed") {
2585
- if (isNeutral) {
2586
- tints = tones.primary;
2587
- }
2588
- const bg2 = getColorHex(tints, dark, name, "bg_base_active");
2589
- const skeletonFrom2 = mix(bg2, getColorHex(tints, dark, name, "bg_base_active"));
2590
- return {
2591
- bg: bg2,
2592
- bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2593
- border: getColorHex(tints, dark, name, "border_base"),
2594
- fg: getColorHex(tints, dark, tone, "text_primary"),
2595
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2596
- muted: {
2597
- fg: getColorHex(tints, dark, tone, "text_secondary")
2598
- },
2599
- accent: {
2600
- fg: mix(bg2, color$1.hues.red[dark ? 400 : 500].hex)
2601
- },
2602
- link: {
2603
- fg: mix(bg2, color$1.hues.blue[dark ? 400 : 600].hex)
2604
- },
2605
- code: {
2606
- bg: mix(bg2, tints[dark ? 950 : 50].hex),
2607
- fg: getColorHex(tints, dark, tone, "text_secondary")
2608
- },
2609
- skeleton: {
2610
- from: skeletonFrom2,
2611
- to: rgba(skeletonFrom2, 0.5)
2612
- }
2613
- };
2614
- }
2615
- if (state === "selected") {
2616
- if (isNeutral) {
2617
- tints = tones.primary;
2618
- }
2619
- const bg2 = mix(base.bg, tints[dark ? 900 : 100].hex);
2620
- const skeletonFrom2 = mix(bg2, tints[dark ? 900 : 100].hex);
2621
- return {
2622
- bg: bg2,
2623
- bg2: mix(bg2, tints[dark ? 950 : 50].hex),
2624
- border: getColorHex(tints, dark, name, "border_base"),
2625
- fg: getColorHex(tints, dark, tone, "text_primary"),
2626
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2627
- muted: {
2628
- fg: getColorHex(tints, dark, tone, "text_secondary")
2629
- },
2630
- accent: {
2631
- fg: mix(bg2, color$1.hues.red[dark ? 400 : 500].hex)
2632
- },
2633
- link: {
2634
- fg: mix(bg2, color$1.hues.blue[dark ? 400 : 600].hex)
2635
- },
2636
- code: {
2637
- bg: mix(bg2, tints[dark ? 950 : 50].hex),
2638
- fg: getColorHex(tints, dark, tone, "text_secondary")
2639
- },
2640
- skeleton: {
2641
- from: skeletonFrom2,
2642
- to: rgba(skeletonFrom2, 0.5)
2643
- }
2644
- };
1099
+ "base-text-color": {
1100
+ type: "colorTint",
1101
+ value: color.white
1102
+ },
1103
+ "base-shadow-outline-color": {
1104
+ type: "colorWithOpacity",
1105
+ tint: "500",
1106
+ opacity: 0.2
1107
+ },
1108
+ "base-shadow-umbra-color": {
1109
+ type: "colorWithOpacity",
1110
+ tint: "500",
1111
+ opacity: 0.1
1112
+ },
1113
+ "base-shadow-penumbra-color": {
1114
+ type: "colorWithOpacity",
1115
+ tint: "500",
1116
+ opacity: 0.07
1117
+ },
1118
+ "base-shadow-ambient-color": {
1119
+ type: "colorWithOpacity",
1120
+ tint: "500",
1121
+ opacity: 0.06
1122
+ },
1123
+ "skeleton-from": "100",
1124
+ "skeleton-to": {
1125
+ type: "colorWithOpacity",
1126
+ tint: "50",
1127
+ opacity: 0.5
2645
1128
  }
2646
- const bg = base.bg;
2647
- const skeletonFrom = mix(bg, tints[dark ? 900 : 100].hex);
2648
- return {
2649
- bg,
2650
- bg2: mix(bg, tints[dark ? 950 : 50].hex),
2651
- border: mix(bg, getColorHex(tints, dark, name, "bg_base")),
2652
- fg: getColorHex(tints, dark, tone, "text_primary"),
2653
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2654
- muted: {
2655
- fg: getColorHex(tints, dark, tone, "text_secondary")
1129
+ },
1130
+ dark: {
1131
+ "text-primary": "50",
1132
+ "text-secondary": "300",
1133
+ "text-inactive": "400",
1134
+ "text-code": "400",
1135
+ "text-muted": "400",
1136
+ "text-link": {
1137
+ type: "colorTint",
1138
+ value: color.hues.blue["400"]
1139
+ },
1140
+ "text-accent": {
1141
+ type: "colorTint",
1142
+ value: color.hues.red["400"]
1143
+ },
1144
+ "bg-base": {
1145
+ type: "colorTint",
1146
+ value: color.black
1147
+ },
1148
+ "bg-base-hover": "900",
1149
+ "bg-base-active": "800",
1150
+ "bg-accent": "500",
1151
+ "bg-accent-hover": "400",
1152
+ "bg-accent-active": "300",
1153
+ "bg-tint": "900",
1154
+ "bg-tint-code": "950",
1155
+ "icon-default": "300",
1156
+ "icon-inverted": {
1157
+ type: "colorTint",
1158
+ value: color.hues.gray[900]
1159
+ },
1160
+ "border-base": "800",
1161
+ "border-base-hover": "700",
1162
+ "border-accent": "300",
1163
+ "border-accent-inverted": {
1164
+ type: "colorTint",
1165
+ value: color.hues.gray[900]
1166
+ },
1167
+ "base-bg-card": "950",
1168
+ "base-text-color": {
1169
+ type: "colorTint",
1170
+ value: color.black
1171
+ },
1172
+ "base-shadow-outline-color": {
1173
+ type: "colorWithOpacity",
1174
+ tint: "500",
1175
+ opacity: 0.4
1176
+ },
1177
+ "base-shadow-umbra-color": {
1178
+ type: "colorWithOpacity",
1179
+ tint: "900",
1180
+ opacity: 0.4
1181
+ },
1182
+ "base-shadow-penumbra-color": {
1183
+ type: "colorWithOpacity",
1184
+ tint: "900",
1185
+ opacity: 0.28
1186
+ },
1187
+ "base-shadow-ambient-color": {
1188
+ type: "colorWithOpacity",
1189
+ tint: "900",
1190
+ opacity: 0.24
1191
+ },
1192
+ "base-bg-raw": {
1193
+ type: "colorTint",
1194
+ value: color.black
1195
+ },
1196
+ "skeleton-from": "900",
1197
+ "skeleton-to": {
1198
+ type: "colorWithOpacity",
1199
+ tint: "50",
1200
+ opacity: 0.5
1201
+ }
1202
+ }
1203
+ };
1204
+ const colorTints = {
1205
+ light: {
1206
+ default: {
1207
+ ...defaultTints.light,
1208
+ "base-bg-card": {
1209
+ type: "colorTint",
1210
+ value: color.white
2656
1211
  },
2657
- accent: {
2658
- fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
1212
+ "bg-accent": "900",
1213
+ "bg-accent-hover": "950",
1214
+ "bg-accent-active": {
1215
+ type: "colorTint",
1216
+ value: color.black
2659
1217
  },
2660
- link: {
2661
- fg: mix(base.bg, color$1.hues.blue[dark ? 400 : 600].hex)
1218
+ "border-accent": "600"
1219
+ },
1220
+ primary: {
1221
+ ...defaultTints.light,
1222
+ "bg-accent": "900",
1223
+ "bg-accent-hover": "950",
1224
+ "bg-accent-active": {
1225
+ type: "colorTint",
1226
+ value: color.black
2662
1227
  },
2663
- code: {
2664
- bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2665
- fg: getColorHex(tints, dark, tone, "text_secondary")
1228
+ "border-accent": "600"
1229
+ },
1230
+ positive: {
1231
+ ...defaultTints.light,
1232
+ "bg-base-hover": {
1233
+ type: "colorTint",
1234
+ value: color.hues.gray[50]
2666
1235
  },
2667
- skeleton: {
2668
- from: skeletonFrom,
2669
- to: rgba(skeletonFrom, 0.5)
2670
- }
2671
- };
2672
- },
2673
- button: _ref14 => {
2674
- let {
2675
- base,
2676
- mode,
2677
- muted,
2678
- solid
2679
- } = _ref14;
2680
- if (mode === "bleed") {
2681
- return {
2682
- enabled: {
2683
- ...muted.enabled,
2684
- border: muted.enabled.bg
2685
- },
2686
- hovered: {
2687
- ...muted.hovered,
2688
- border: muted.hovered.bg
2689
- },
2690
- pressed: {
2691
- ...muted.pressed,
2692
- border: muted.pressed.bg
2693
- },
2694
- selected: {
2695
- ...muted.selected,
2696
- border: muted.selected.bg
2697
- },
2698
- disabled: {
2699
- ...muted.disabled,
2700
- border: muted.disabled.bg
2701
- }
2702
- };
2703
- }
2704
- if (mode === "ghost") {
2705
- return {
2706
- ...muted,
2707
- enabled: {
2708
- ...muted.enabled,
2709
- border: base.border
2710
- }
2711
- };
1236
+ "bg-base-active": "50",
1237
+ "bg-accent": "400",
1238
+ "bg-accent-hover": "500",
1239
+ "bg-accent-active": "600",
1240
+ "border-accent": "400"
1241
+ },
1242
+ transparent: defaultTints.light,
1243
+ caution: defaultTints.light,
1244
+ critical: {
1245
+ ...defaultTints.light,
1246
+ "text-inactive": "300"
2712
1247
  }
2713
- return solid;
2714
1248
  },
2715
- card: _ref15 => {
2716
- let {
2717
- base,
2718
- dark,
2719
- muted,
2720
- name,
2721
- solid,
2722
- state
2723
- } = _ref15;
2724
- if (state === "hovered") {
2725
- return muted[name].hovered;
2726
- }
2727
- if (state === "disabled") {
2728
- return muted[name].disabled;
2729
- }
2730
- const isNeutral = NEUTRAL_TONES.includes(name);
2731
- const tints = tones[name] || tones.default;
2732
- const mix = dark ? screen : multiply;
2733
- if (state === "pressed") {
2734
- if (isNeutral) {
2735
- return muted.primary.pressed;
2736
- }
2737
- return muted[name].pressed;
2738
- }
2739
- if (state === "selected") {
2740
- if (isNeutral) {
2741
- return solid.primary.enabled;
2742
- }
2743
- return solid[name].enabled;
2744
- }
2745
- const bg = base.bg;
2746
- const skeletonFrom = mix(base.bg, tints[dark ? 900 : 100].hex);
2747
- return {
2748
- bg,
2749
- bg2: mix(bg, tints[dark ? 950 : 50].hex),
2750
- fg: base.fg,
2751
- iconColor: getColorHex(tints, dark, name, "icon_default"),
2752
- border: base.border,
2753
- muted: {
2754
- fg: mix(base.bg, tints[dark ? 400 : 600].hex)
1249
+ dark: {
1250
+ default: {
1251
+ ...defaultTints.dark,
1252
+ "base-bg-card": {
1253
+ type: "colorTint",
1254
+ value: color.black
2755
1255
  },
2756
- accent: {
2757
- fg: mix(base.bg, color$1.hues.red[dark ? 400 : 500].hex)
1256
+ "text-primary": {
1257
+ type: "colorTint",
1258
+ value: color.white
2758
1259
  },
2759
- link: {
2760
- fg: mix(base.bg, color$1.hues.blue[dark ? 400 : 600].hex)
1260
+ "bg-accent": {
1261
+ type: "colorTint",
1262
+ value: color.white
2761
1263
  },
2762
- code: {
2763
- bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2764
- fg: tints[dark ? 400 : 600].hex
1264
+ "bg-accent-hover": "50",
1265
+ "bg-accent-active": "100",
1266
+ "base-shadow-umbra-color": {
1267
+ type: "colorWithOpacity",
1268
+ tint: "950",
1269
+ opacity: 0.4
2765
1270
  },
2766
- skeleton: {
2767
- from: skeletonFrom,
2768
- to: rgba(skeletonFrom, 0.5)
2769
- }
2770
- };
2771
- },
2772
- input: _ref16 => {
2773
- let {
2774
- base,
2775
- dark,
2776
- mode,
2777
- state
2778
- } = _ref16;
2779
- const mix = dark ? screen : multiply;
2780
- if (mode === "invalid") {
2781
- const tints = tones.critical;
2782
- return {
2783
- bg: mix(base.bg, tints[dark ? 950 : 50].hex),
2784
- bg2: getColorHex(tints, dark, "critical", "text_secondary"),
2785
- fg: mix(base.bg, tints[dark ? 400 : 600].hex),
2786
- border: getColorHex(tints, dark, "critical", "border_base"),
2787
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2788
- };
2789
- }
2790
- if (state === "hovered") {
2791
- return {
2792
- bg: base.bg,
2793
- bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2794
- fg: base.fg,
2795
- border: mix(base.bg, color$1.hues.gray[dark ? 700 : 300].hex),
2796
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2797
- };
2798
- }
2799
- if (state === "disabled") {
2800
- return {
2801
- bg: getColorHex(tones.default, dark, "default", "bg_tint"),
2802
- bg2: getColorHex(tones.default, dark, "default", "border_base"),
2803
- fg: getColorHex(tones.default, dark, "default", "text_secondary"),
2804
- border: getColorHex(tones.default, dark, "default", "border_base"),
2805
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2806
- };
2807
- }
2808
- if (state === "readOnly") {
2809
- return {
2810
- bg: getColorHex(tones.default, dark, "default", "bg_tint"),
2811
- bg2: getColorHex(tones.default, dark, "default", "border_base"),
2812
- fg: getColorHex(tones.default, dark, "default", "text_secondary"),
2813
- border: getColorHex(tones.default, dark, "default", "border_base"),
2814
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2815
- };
2816
- }
2817
- return {
2818
- bg: base.bg,
2819
- bg2: getColorHex(tones.default, dark, "default", "text_secondary"),
2820
- fg: base.fg,
2821
- border: base.border,
2822
- placeholder: getColorHex(tones.default, !dark, "default", "text_secondary")
2823
- };
2824
- },
2825
- selectable: _ref17 => {
2826
- let {
2827
- base,
2828
- muted,
2829
- tone,
2830
- solid,
2831
- state
2832
- } = _ref17;
2833
- if (state === "enabled") {
2834
- return {
2835
- ...muted[tone].enabled,
2836
- bg: base.bg
2837
- };
2838
- }
2839
- if (state === "pressed") {
2840
- if (tone === "default") {
2841
- return muted.primary.pressed;
2842
- }
2843
- return muted[tone].pressed;
2844
- }
2845
- if (state === "selected") {
2846
- if (tone === "default") {
2847
- return solid.primary.enabled;
1271
+ "base-shadow-penumbra-color": {
1272
+ type: "colorWithOpacity",
1273
+ tint: "950",
1274
+ opacity: 0.28
1275
+ },
1276
+ "base-shadow-ambient-color": {
1277
+ type: "colorWithOpacity",
1278
+ tint: "950",
1279
+ opacity: 0.24
2848
1280
  }
2849
- return solid[tone].enabled;
2850
- }
2851
- if (state === "disabled") {
2852
- return {
2853
- ...muted[tone].disabled,
2854
- bg: base.bg
2855
- };
1281
+ },
1282
+ primary: {
1283
+ ...defaultTints.dark,
1284
+ "text-primary": {
1285
+ type: "colorTint",
1286
+ value: color.white
1287
+ },
1288
+ "bg-accent": {
1289
+ type: "colorTint",
1290
+ value: color.white
1291
+ },
1292
+ "bg-accent-hover": "50",
1293
+ "bg-accent-active": "100"
1294
+ },
1295
+ positive: {
1296
+ ...defaultTints.dark,
1297
+ "bg-base-hover": {
1298
+ type: "colorTint",
1299
+ value: color.hues.gray[900]
1300
+ },
1301
+ "bg-base-active": "900",
1302
+ "bg-accent": "400",
1303
+ "bg-accent-hover": "300",
1304
+ "bg-accent-active": "200",
1305
+ "border-accent": "400"
1306
+ },
1307
+ transparent: defaultTints.dark,
1308
+ caution: defaultTints.dark,
1309
+ critical: {
1310
+ ...defaultTints.dark,
1311
+ "text-inactive": "700"
2856
1312
  }
2857
- return muted[tone][state];
2858
- },
2859
- spot: _ref18 => {
2860
- let {
2861
- base,
2862
- dark,
2863
- key
2864
- } = _ref18;
2865
- const mix = dark ? screen : multiply;
2866
- return mix(base.bg, color$1.hues[key][dark ? 400 : 500].hex);
2867
- },
2868
- syntax: _ref19 => {
2869
- let {
2870
- base,
2871
- dark
2872
- } = _ref19;
2873
- const mix = dark ? screen : multiply;
2874
- const mainShade = dark ? 400 : 600;
2875
- const secondaryShade = dark ? 600 : 400;
1313
+ }
1314
+ };
1315
+ const getColorValue = (tints, scheme, tone, key) => {
1316
+ const value = colorTints[scheme][tone][key];
1317
+ if (typeof value === "string") {
1318
+ return tints[value];
1319
+ }
1320
+ if (value.type === "colorWithOpacity") {
1321
+ const base = tints[value.tint];
2876
1322
  return {
2877
- atrule: mix(base.bg, color$1.hues.purple[mainShade].hex),
2878
- attrName: mix(base.bg, color$1.hues.green[mainShade].hex),
2879
- attrValue: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2880
- attribute: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2881
- boolean: mix(base.bg, color$1.hues.purple[mainShade].hex),
2882
- builtin: mix(base.bg, color$1.hues.purple[mainShade].hex),
2883
- cdata: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2884
- char: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2885
- class: mix(base.bg, color$1.hues.orange[mainShade].hex),
2886
- className: mix(base.bg, color$1.hues.cyan[mainShade].hex),
2887
- comment: mix(base.bg, color$1.hues.gray[secondaryShade].hex),
2888
- constant: mix(base.bg, color$1.hues.purple[mainShade].hex),
2889
- deleted: mix(base.bg, color$1.hues.red[mainShade].hex),
2890
- doctype: mix(base.bg, color$1.hues.gray[secondaryShade].hex),
2891
- entity: mix(base.bg, color$1.hues.red[mainShade].hex),
2892
- function: mix(base.bg, color$1.hues.green[mainShade].hex),
2893
- hexcode: mix(base.bg, color$1.hues.blue[mainShade].hex),
2894
- id: mix(base.bg, color$1.hues.purple[mainShade].hex),
2895
- important: mix(base.bg, color$1.hues.purple[mainShade].hex),
2896
- inserted: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2897
- keyword: mix(base.bg, color$1.hues.magenta[mainShade].hex),
2898
- number: mix(base.bg, color$1.hues.purple[mainShade].hex),
2899
- operator: mix(base.bg, color$1.hues.magenta[mainShade].hex),
2900
- prolog: mix(base.bg, color$1.hues.gray[secondaryShade].hex),
2901
- property: mix(base.bg, color$1.hues.blue[mainShade].hex),
2902
- pseudoClass: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2903
- pseudoElement: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2904
- punctuation: mix(base.bg, color$1.hues.gray[mainShade].hex),
2905
- regex: mix(base.bg, color$1.hues.blue[mainShade].hex),
2906
- selector: mix(base.bg, color$1.hues.red[mainShade].hex),
2907
- string: mix(base.bg, color$1.hues.yellow[mainShade].hex),
2908
- symbol: mix(base.bg, color$1.hues.purple[mainShade].hex),
2909
- tag: mix(base.bg, color$1.hues.red[mainShade].hex),
2910
- unit: mix(base.bg, color$1.hues.orange[mainShade].hex),
2911
- url: mix(base.bg, color$1.hues.red[mainShade].hex),
2912
- variable: mix(base.bg, color$1.hues.red[mainShade].hex)
1323
+ hex: rgba(base.hex, value.opacity),
1324
+ title: "".concat(base.title, " ").concat(Math.round(value.opacity * 100), "%")
2913
1325
  };
2914
1326
  }
2915
- });
1327
+ return value.value;
1328
+ };
1329
+ const getColorHex = (tints, scheme, tone, key) => {
1330
+ return getColorValue(tints, scheme, tone, key).hex;
1331
+ };
1332
+ const getToneCssVar = (tone, key) => "--".concat(tone, "-").concat(key);
1333
+ const createTonesVariables = function (scheme, tones) {
1334
+ let defaultTone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "default";
1335
+ let baseBg = arguments.length > 3 ? arguments[3] : undefined;
1336
+ const tonesVariables = {};
1337
+ const keys = Object.keys(tones);
1338
+ const mix = scheme === "dark" ? screen : multiply;
1339
+ const needsMixing = defaultTone !== "default";
1340
+ keys.forEach(_tone => {
1341
+ const tone = _tone == "default" ? defaultTone : _tone;
1342
+ const tint = tones[tone];
1343
+ colorKeys.forEach(key => {
1344
+ const colorHex = getColorHex(tint, scheme, tone, key);
1345
+ const varName = getToneCssVar(_tone, key);
1346
+ const willBeMixed = needsMixing && !key.startsWith("base-");
1347
+ tonesVariables[varName] = willBeMixed ? mix(baseBg, colorHex) : colorHex;
1348
+ });
1349
+ });
1350
+ if (defaultTone !== "default") {
1351
+ tonesVariables[getToneCssVar("default", "bg-base")] = tonesCssVariables.default["base-bg-card"];
1352
+ }
1353
+ return tonesVariables;
1354
+ };
1355
+ const themeNames = ["default", "transparent", "primary", "positive", "caution", "critical"];
1356
+ const tonesCssVariables = themeNames.reduce((acc, tone) => {
1357
+ acc[tone] = colorKeys.reduce((acc2, key) => {
1358
+ acc2[key] = "var(".concat(getToneCssVar(tone, key), ")");
1359
+ return acc2;
1360
+ }, {});
1361
+ return acc;
1362
+ }, {});
1363
+ const mutableCardVariables = {
1364
+ "bg-color": "--card-bg-color",
1365
+ "muted-fg-color": "--card-muted-fg-color",
1366
+ "icon-color": "--card-icon-color",
1367
+ "fg-color": "--card-fg-color",
1368
+ "bg-image": "--card-bg-image",
1369
+ "accent-color": "--card-accent-fg-color"
1370
+ };
1371
+ const mutableVariables = Object.keys(mutableCardVariables).reduce((acc, key) => {
1372
+ const item = key;
1373
+ acc[item] = "var(".concat(mutableCardVariables[item], ")");
1374
+ return acc;
1375
+ }, {});
1376
+ const cardVariables = {
1377
+ "--card-shadow-outline-color": tonesCssVariables.default["base-shadow-outline-color"],
1378
+ "--card-shadow-umbra-color": tonesCssVariables.default["base-shadow-umbra-color"],
1379
+ "--card-shadow-penumbra-color": tonesCssVariables.default["base-shadow-penumbra-color"],
1380
+ "--card-shadow-ambient-color": tonesCssVariables.default["base-shadow-ambient-color"],
1381
+ "--card-focus-ring-color": tonesCssVariables.positive["bg-accent"],
1382
+ "--card-icon-color": tonesCssVariables.default["icon-default"],
1383
+ "--card-bg-image": "inherit",
1384
+ // Card
1385
+ "--card-bg-color": tonesCssVariables.default["bg-base"],
1386
+ "--card-fg-color": tonesCssVariables.default["text-primary"],
1387
+ "--card-muted-fg-color": tonesCssVariables.default["text-secondary"],
1388
+ "--card-accent-fg-color": tonesCssVariables.default["text-accent"],
1389
+ "--card-link-fg-color": tonesCssVariables.default["text-link"],
1390
+ "--card-code-bg-color": tonesCssVariables.default["bg-tint-code"],
1391
+ "--card-code-fg-color": tonesCssVariables.default["text-code"],
1392
+ "--card-skeleton-color-from": tonesCssVariables.default["skeleton-from"],
1393
+ "--card-skeleton-color-to": tonesCssVariables.default["skeleton-to"],
1394
+ // @todo: deprecate
1395
+ "--card-link-color": tonesCssVariables.default["text-link"],
1396
+ "--card-hairline-soft-color": tonesCssVariables.default["border-base"],
1397
+ "--card-hairline-hard-color": tonesCssVariables.default["border-base"],
1398
+ // Card
1399
+ "--card-bg2-color": tonesCssVariables.default["bg-tint"]
1400
+ };
1401
+ const createCssVars = function (scheme, tones) {
1402
+ let defaultTone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "default";
1403
+ const baseBg = getColorHex(tones[defaultTone], scheme, defaultTone, "base-bg-card");
1404
+ const tonesVars = createTonesVariables(scheme, tones, defaultTone, baseBg);
1405
+ return {
1406
+ ...tonesVars,
1407
+ ...cardVariables
1408
+ };
1409
+ };
1410
+ const cssVars = {
1411
+ ...tonesCssVariables,
1412
+ /**
1413
+ * This variables are mutable, they can be updated by other components.
1414
+ * The main component that updates them is the card, these are the only ones that should be exposed for use from the cards.
1415
+ */
1416
+ mutable: mutableVariables
1417
+ };
1418
+ const tones = {
1419
+ default: color.hues.gray,
1420
+ transparent: color.hues.gray,
1421
+ primary: color.hues.gray,
1422
+ positive: color.hues.cyan,
1423
+ caution: color.hues.yellow,
1424
+ critical: color.hues.red
1425
+ };
2916
1426
  const fonts = {
2917
1427
  code: {
2918
1428
  family: "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
@@ -3132,7 +1642,14 @@ const studioTheme = {
3132
1642
  width: 1
3133
1643
  }
3134
1644
  },
3135
- color,
1645
+ color: {
1646
+ tones,
1647
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1648
+ // @ts-ignore This is necessary until workshop is updated.
1649
+ base: {
1650
+ bg: "#fffff"
1651
+ }
1652
+ },
3136
1653
  container: [320, 640, 960, 1280, 1600, 1920],
3137
1654
  focusRing: {
3138
1655
  offset: 1,
@@ -3146,9 +1663,9 @@ const studioTheme = {
3146
1663
  penumbra: [0, 0, 0, 0],
3147
1664
  ambient: [0, 0, 0, 0]
3148
1665
  }, {
3149
- umbra: [0, 3, 5, -1],
1666
+ umbra: [0, 3, 5, -2],
3150
1667
  penumbra: [0, 6, 10, 0],
3151
- ambient: [0, 1, 18, 0]
1668
+ ambient: [0, 1, 18, 1]
3152
1669
  }, {
3153
1670
  umbra: [0, 7, 8, -4],
3154
1671
  penumbra: [0, 12, 17, 2],
@@ -3231,6 +1748,11 @@ const DEFAULT_THEME_LAYER = {
3231
1748
  zOffset: 200
3232
1749
  }
3233
1750
  };
1751
+ function cssObjectToCssString(rules) {
1752
+ return Object.keys(rules).reduce((acc, key) => {
1753
+ return "".concat(acc).concat(key, ": ").concat(rules[key], "; ");
1754
+ }, "");
1755
+ }
3234
1756
  function getGlobalScope() {
3235
1757
  if (typeof globalThis !== "undefined") return globalThis;
3236
1758
  if (typeof window !== "undefined") return window;
@@ -3239,9 +1761,41 @@ function getGlobalScope() {
3239
1761
  throw new Error("@sanity/ui: could not locate global scope");
3240
1762
  }
3241
1763
  const globalScope = getGlobalScope();
3242
- const key$8 = Symbol.for("@sanity/ui/context/theme");
1764
+ const key$9 = Symbol.for("@sanity/ui/context/theme");
1765
+ globalScope[key$9] = globalScope[key$9] || react.createContext(null);
1766
+ const ThemeContext = globalScope[key$9];
1767
+ const key$8 = Symbol.for("@sanity/ui/context/toneContext");
3243
1768
  globalScope[key$8] = globalScope[key$8] || react.createContext(null);
3244
- const ThemeContext = globalScope[key$8];
1769
+ const ToneContext = globalScope[key$8];
1770
+ function ToneProvider(props) {
1771
+ const {
1772
+ children,
1773
+ scheme,
1774
+ tone
1775
+ } = props;
1776
+ const root = useRootTheme();
1777
+ const value = react.useMemo(() => ({
1778
+ version: 0,
1779
+ scheme: scheme || root.scheme,
1780
+ tone
1781
+ }), [root.scheme, scheme, tone]);
1782
+ return /* @__PURE__ */jsxRuntime.jsx(ToneContext.Provider, {
1783
+ value,
1784
+ children
1785
+ });
1786
+ }
1787
+ var __freeze$E = Object.freeze;
1788
+ var __defProp$F = Object.defineProperty;
1789
+ var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", {
1790
+ value: __freeze$E(raw || cooked.slice())
1791
+ }));
1792
+ var _a$E;
1793
+ const GlobalVariables = styled.createGlobalStyle(_a$E || (_a$E = __template$E(["\n :root {\n ", "\n }\n"])), _ref4 => {
1794
+ let {
1795
+ $vars
1796
+ } = _ref4;
1797
+ return $vars;
1798
+ });
3245
1799
  function ThemeProvider(props) {
3246
1800
  const parentTheme = react.useContext(ThemeContext);
3247
1801
  const {
@@ -3253,38 +1807,44 @@ function ThemeProvider(props) {
3253
1807
  const theme = react.useMemo(() => {
3254
1808
  if (!themeProp) return null;
3255
1809
  const {
3256
- color: rootColor,
3257
1810
  layer: rootLayer,
3258
1811
  ...restTheme
3259
1812
  } = themeProp;
3260
- const colorScheme = rootColor[scheme] || rootColor.light;
3261
- const color = colorScheme[tone] || colorScheme.default;
3262
1813
  const layer = rootLayer || DEFAULT_THEME_LAYER;
3263
1814
  return {
3264
1815
  sanity: {
3265
1816
  ...restTheme,
3266
- color,
3267
1817
  layer
3268
1818
  }
3269
1819
  };
3270
- }, [scheme, themeProp, tone]);
1820
+ }, [themeProp]);
3271
1821
  const value = react.useMemo(() => themeProp && {
3272
1822
  version: 0,
3273
1823
  theme: themeProp,
3274
1824
  scheme,
3275
1825
  tone
3276
1826
  }, [themeProp, scheme, tone]);
1827
+ const cssVariables = react.useMemo(() => {
1828
+ if (!(themeProp == null ? void 0 : themeProp.color.tones)) return;
1829
+ return cssObjectToCssString(createCssVars(scheme, themeProp == null ? void 0 : themeProp.color.tones));
1830
+ }, [scheme, themeProp == null ? void 0 : themeProp.color.tones]);
3277
1831
  if (!theme) {
3278
1832
  return /* @__PURE__ */jsxRuntime.jsx("pre", {
3279
1833
  children: 'ThemeProvider: no "theme" property provided'
3280
1834
  });
3281
1835
  }
3282
- return /* @__PURE__ */jsxRuntime.jsx(ThemeContext.Provider, {
1836
+ return /* @__PURE__ */jsxRuntime.jsxs(ThemeContext.Provider, {
3283
1837
  value,
3284
- children: /* @__PURE__ */jsxRuntime.jsx(styled.ThemeProvider, {
1838
+ children: [/* @__PURE__ */jsxRuntime.jsx(GlobalVariables, {
1839
+ $vars: cssVariables
1840
+ }), /* @__PURE__ */jsxRuntime.jsx(styled.ThemeProvider, {
3285
1841
  theme,
3286
- children
3287
- })
1842
+ children: /* @__PURE__ */jsxRuntime.jsx(ToneProvider, {
1843
+ tone,
1844
+ scheme,
1845
+ children
1846
+ })
1847
+ })]
3288
1848
  });
3289
1849
  }
3290
1850
  function isRecord(value) {
@@ -3451,7 +2011,17 @@ function useCustomValidity(ref, customValidity) {
3451
2011
  }
3452
2012
  }, [customValidity, ref]);
3453
2013
  }
3454
- const BORDER_VALUE = "1px solid var(--card-border-color)";
2014
+ function useToneContext() {
2015
+ const value = react.useContext(ToneContext);
2016
+ if (!value) {
2017
+ throw new Error("useToneContext(): missing context value");
2018
+ }
2019
+ if (!isRecord(value) || value.version !== 0) {
2020
+ throw new Error("useToneContext(): the context value is not compatible");
2021
+ }
2022
+ return value;
2023
+ }
2024
+ const BORDER_VALUE = "1px solid ".concat(cssVars.default["border-base"]);
3455
2025
  function responsiveBorderStyle() {
3456
2026
  return [border, borderTop, borderRight, borderBottom, borderLeft];
3457
2027
  }
@@ -3707,8 +2277,8 @@ function focusRingStyle(opts) {
3707
2277
  } = opts;
3708
2278
  const focusRingOutsetWidth = focusRing.offset + focusRing.width;
3709
2279
  const focusRingInsetWidth = 0 - focusRing.offset;
3710
- const bgColor = base ? base.bg : "var(--card-bg-color)";
3711
- return [focusRingInsetWidth > 0 && "inset 0 0 0 ".concat(focusRingInsetWidth, "px var(--card-focus-ring-color)"), border && focusRingBorderStyle(border), focusRingInsetWidth < 0 && "0 0 0 ".concat(0 - focusRingInsetWidth, "px ").concat(bgColor), focusRingOutsetWidth > 0 && "0 0 0 ".concat(focusRingOutsetWidth, "px var(--card-focus-ring-color)")].filter(Boolean).join(",");
2280
+ const bgColor = base ? base.bg : cssVars.mutable["bg-color"];
2281
+ return [focusRingInsetWidth > 0 && "inset 0 0 0 ".concat(focusRingInsetWidth, "px ").concat(cssVars.positive["border-accent"]), border && focusRingBorderStyle(border), focusRingInsetWidth < 0 && "0 0 0 ".concat(0 - focusRingInsetWidth, "px ").concat(bgColor), focusRingOutsetWidth > 0 && "0 0 0 ".concat(focusRingOutsetWidth, "px ").concat(cssVars.positive["border-accent"])].filter(Boolean).join(",");
3712
2282
  }
3713
2283
  const GRID_CSS = {
3714
2284
  "&&:not([hidden])": {
@@ -3973,13 +2543,11 @@ function textInputRootStyle() {
3973
2543
  function textInputBaseStyle(props) {
3974
2544
  const {
3975
2545
  theme,
3976
- $scheme,
3977
2546
  $tone,
3978
2547
  $weight
3979
2548
  } = props;
3980
2549
  const font = theme.sanity.fonts.text;
3981
- const color = theme.sanity.color.input;
3982
- return styled.css(_b$m || (_b$m = __template$D(["\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ", ";\n font-weight: ", ";\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome\u2019s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='", "'][data-tone='", "'] {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n }\n "])), font.family, $weight && font.weights[$weight] || font.weights.regular, $scheme, $tone, color.default.enabled.fg, color.default.enabled.placeholder, color.default.enabled.fg, color.default.enabled.placeholder, color.default.disabled.fg, color.default.disabled.placeholder, color.invalid.enabled.fg, color.invalid.enabled.placeholder, color.default.readOnly.fg, color.default.readOnly.placeholder);
2550
+ return styled.css(_b$m || (_b$m = __template$D(["\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ", ";\n font-weight: ", ";\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome\u2019s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n "])), font.family, $weight && font.weights[$weight] || font.weights.regular, cssVars[$tone]["text-primary"], cssVars[$tone]["text-inactive"], cssVars[$tone]["text-primary"], cssVars[$tone]["text-inactive"], cssVars[$tone]["text-primary"], cssVars[$tone]["text-inactive"], cssVars.critical["text-primary"], cssVars.critical["text-inactive"], cssVars[$tone]["text-primary"], cssVars[$tone]["text-inactive"]);
3983
2551
  }
3984
2552
  function textInputFontSizeStyle(props) {
3985
2553
  const {
@@ -4001,7 +2569,6 @@ function textInputRepresentationStyle(props) {
4001
2569
  const {
4002
2570
  $hasPrefix,
4003
2571
  $hasSuffix,
4004
- $scheme,
4005
2572
  $tone,
4006
2573
  theme
4007
2574
  } = props;
@@ -4011,26 +2578,22 @@ function textInputRepresentationStyle(props) {
4011
2578
  const {
4012
2579
  focusRing
4013
2580
  } = input.text;
4014
- const color = theme.sanity.color.input;
4015
- return styled.css(_c$d || (_c$d = __template$D(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
4016
- color: color.default.enabled.border,
2581
+ return styled.css(_c$d || (_c$d = __template$D(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: ", ";\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n ", ": ", ";\n ", ": ", ";\n\n /* enabled */\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n ", ": ", ";\n ", ": ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n ", ": ", " !important;\n ", ": ", " !important;\n }\n\n /* readOnly */\n *:read-only + & {\n ", ": ", " !important;\n ", ": ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), cssVars.mutable["bg-color"], $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, mutableCardVariables["bg-color"], cssVars[$tone]["bg-base"], mutableCardVariables["fg-color"], cssVars[$tone]["text-primary"], focusRingBorderStyle({
2582
+ color: cssVars[$tone]["border-base"],
4017
2583
  width: input.border.width
4018
- }), color.invalid.enabled.bg, color.invalid.enabled.fg, focusRingBorderStyle({
4019
- color: color.invalid.enabled.border,
2584
+ }), mutableCardVariables["bg-color"], cssVars.critical["bg-tint"], mutableCardVariables["fg-color"], cssVars.critical["text-primary"], focusRingBorderStyle({
2585
+ color: cssVars.critical["border-base"],
4020
2586
  width: input.border.width
4021
2587
  }), focusRingStyle({
4022
2588
  border: {
4023
- color: color.default.enabled.border,
2589
+ color: cssVars[$tone]["border-base"],
4024
2590
  width: input.border.width
4025
2591
  },
4026
2592
  focusRing
4027
2593
  }), focusRingStyle({
4028
2594
  focusRing
4029
- }), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
4030
- color: color.default.disabled.border,
4031
- width: input.border.width
4032
- }), color.default.readOnly.bg, color.default.readOnly.fg, color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
4033
- color: color.default.hovered.border,
2595
+ }), mutableCardVariables["bg-color"], cssVars.default["bg-tint"], mutableCardVariables["fg-color"], cssVars.default["text-primary"], mutableCardVariables["bg-color"], cssVars.default["bg-tint"], mutableCardVariables["fg-color"], cssVars.default["text-primary"], focusRingBorderStyle({
2596
+ color: cssVars.default["border-base-hover"],
4034
2597
  width: input.border.width
4035
2598
  }));
4036
2599
  }
@@ -4072,10 +2635,10 @@ function toBoxShadow(shadow, color) {
4072
2635
  }
4073
2636
  function shadowStyle(shadow) {
4074
2637
  if (!shadow) return EMPTY_RECORD;
4075
- const outline = "0 0 0 ".concat(rem(1), " var(--card-shadow-outline-color)");
4076
- const umbra = toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)");
4077
- const penumbra = toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)");
4078
- const ambient = toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)");
2638
+ const outline = "0 0 0 ".concat(rem(1), " ").concat(cssVars.default["base-shadow-outline-color"]);
2639
+ const umbra = toBoxShadow(shadow.umbra, cssVars.default["base-shadow-umbra-color"]);
2640
+ const penumbra = toBoxShadow(shadow.penumbra, cssVars.default["base-shadow-penumbra-color"]);
2641
+ const ambient = toBoxShadow(shadow.ambient, cssVars.default["base-shadow-ambient-color"]);
4079
2642
  return {
4080
2643
  boxShadow: "".concat(outline, ", ").concat(umbra, ", ").concat(penumbra, ", ").concat(ambient)
4081
2644
  };
@@ -4105,7 +2668,7 @@ function textBaseStyle(props) {
4105
2668
  const {
4106
2669
  weights
4107
2670
  } = theme.sanity.fonts.text;
4108
- return styled.css(_c$c || (_c$c = __template$C(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n }\n "])), $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
2671
+ return styled.css(_c$c || (_c$c = __template$C(["\n color: ", ";\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: ", ";\n color: ", ";\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: ", ";\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px ", ",\n 0 0 0 3px ", ";\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: ", ";\n }\n "])), cssVars.mutable["fg-color"], $accent && styled.css(_a$C || (_a$C = __template$C(["\n color: ", ";\n "])), cssVars.default["text-accent"]), $muted && styled.css(_b$l || (_b$l = __template$C(["\n color: ", ";\n "])), cssVars.mutable["muted-fg-color"]), theme.sanity.fonts.code.family, cssVars.default["bg-tint-code"], cssVars.default["text-code"], cssVars.default["text-link"], cssVars.mutable["bg-color"], cssVars.positive["border-accent"], weights.bold, cssVars.mutable["icon-color"]);
4109
2672
  }
4110
2673
  var __freeze$B = Object.freeze;
4111
2674
  var __defProp$C = Object.defineProperty;
@@ -4146,6 +2709,44 @@ const Text = react.forwardRef(function Text2(props, ref) {
4146
2709
  })
4147
2710
  });
4148
2711
  });
2712
+ const spotColor = {
2713
+ gray: {
2714
+ dark: color.gray["400"],
2715
+ light: color.gray["500"]
2716
+ },
2717
+ blue: {
2718
+ dark: color.blue["400"],
2719
+ light: color.blue["500"]
2720
+ },
2721
+ purple: {
2722
+ dark: color.purple["400"],
2723
+ light: color.purple["500"]
2724
+ },
2725
+ magenta: {
2726
+ dark: color.magenta["400"],
2727
+ light: color.magenta["500"]
2728
+ },
2729
+ red: {
2730
+ dark: color.red["400"],
2731
+ light: color.red["500"]
2732
+ },
2733
+ orange: {
2734
+ dark: color.orange["400"],
2735
+ light: color.orange["500"]
2736
+ },
2737
+ yellow: {
2738
+ dark: color.yellow["400"],
2739
+ light: color.yellow["500"]
2740
+ },
2741
+ green: {
2742
+ dark: color.green["400"],
2743
+ light: color.green["500"]
2744
+ },
2745
+ cyan: {
2746
+ dark: color.cyan["400"],
2747
+ light: color.cyan["500"]
2748
+ }
2749
+ };
4149
2750
  const avatarStyle = {
4150
2751
  root: avatarRootStyle,
4151
2752
  arrow: avatarArrowStyle,
@@ -4204,7 +2805,7 @@ function avatarRootStyle(props) {
4204
2805
  position: "relative",
4205
2806
  boxSizing: "border-box",
4206
2807
  userSelect: "none",
4207
- boxShadow: "0 0 0 1px var(--card-bg-color)",
2808
+ boxShadow: "0 0 0 1px ".concat(cssVars.mutable["bg-color"]),
4208
2809
  '&[data-status="inactive"]': {
4209
2810
  opacity: 0.5
4210
2811
  },
@@ -4258,17 +2859,11 @@ function responsiveAvatarSizeStyle(props) {
4258
2859
  };
4259
2860
  });
4260
2861
  }
4261
- function avatarInitialsStyle(props) {
4262
- const {
4263
- theme
4264
- } = props;
4265
- const {
4266
- base
4267
- } = theme.sanity.color;
2862
+ function avatarInitialsStyle() {
4268
2863
  return {
4269
2864
  width: "100%",
4270
2865
  height: "100%",
4271
- color: base.fg,
2866
+ color: cssVars.default["text-primary"],
4272
2867
  alignItems: "center",
4273
2868
  justifyContent: "center",
4274
2869
  textTransform: "uppercase",
@@ -4282,7 +2877,7 @@ function avatarInitialsStyle(props) {
4282
2877
  function avatarBgStrokeStyle() {
4283
2878
  return {
4284
2879
  strokeWidth: "4px",
4285
- stroke: "var(--card-bg-color)"
2880
+ stroke: cssVars.mutable["bg-color"]
4286
2881
  };
4287
2882
  }
4288
2883
  function avatarStrokeStyle() {
@@ -4316,7 +2911,10 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
4316
2911
  const as = ReactIs__default.default.isValidElementType(asProp) ? asProp : "div";
4317
2912
  const size = useArrayProp(sizeProp);
4318
2913
  const theme = useTheme();
4319
- const color = theme.sanity.color.spot[colorKey] || theme.sanity.color.spot.gray;
2914
+ const {
2915
+ scheme
2916
+ } = useToneContext();
2917
+ const color = spotColor[colorKey][scheme].hex;
4320
2918
  const avatarSize = theme.sanity.avatar.sizes[size[0]] || theme.sanity.avatar.sizes[0];
4321
2919
  const _sizeRem = avatarSize.size;
4322
2920
  const _radius = _sizeRem / 2;
@@ -4438,7 +3036,7 @@ function _avatarCounterBaseStyle(props) {
4438
3036
  const {
4439
3037
  theme
4440
3038
  } = props;
4441
- return styled.css(_a$A || (_a$A = __template$A(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: var(--card-fg-color);\n background: var(--card-bg-color);\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n inset 0 0 0 1.5px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(theme.sanity.space[2]));
3039
+ return styled.css(_a$A || (_a$A = __template$A(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: ", ";\n background: ", ";\n box-shadow:\n 0 0 0 1px ", ",\n inset 0 0 0 1.5px ", ");\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), cssVars.mutable["fg-color"], cssVars.mutable["bg-color"], cssVars.mutable["bg-color"], cssVars.default["border-base"], rem(theme.sanity.space[2]));
4442
3040
  }
4443
3041
  const Root$C = styled__default.default.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
4444
3042
  const AvatarCounter = react.forwardRef(function AvatarCounter2(props, ref) {
@@ -4594,83 +3192,22 @@ const Box = react.forwardRef(function Box2(props, ref) {
4594
3192
  children: props.children
4595
3193
  });
4596
3194
  });
4597
- var __freeze$y = Object.freeze;
4598
- var __defProp$z = Object.defineProperty;
4599
- var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
4600
- value: __freeze$y(raw || cooked.slice())
4601
- }));
4602
- var _a$y, _b$k, _c$b;
4603
- function labelBaseStyle(props) {
4604
- const {
4605
- $accent,
4606
- $muted,
4607
- theme
4608
- } = props;
4609
- const {
4610
- fonts
4611
- } = theme.sanity;
4612
- return styled.css(_c$b || (_c$b = __template$y(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$y || (_a$y = __template$y(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$k || (_b$k = __template$y(["\n color: var(--card-muted-fg-color);\n "]))), fonts.code.family);
4613
- }
4614
- var __freeze$x = Object.freeze;
4615
- var __defProp$y = Object.defineProperty;
4616
- var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
4617
- value: __freeze$x(raw || cooked.slice())
4618
- }));
4619
- var _a$x;
4620
- const Root$z = styled__default.default.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
4621
- const SpanWithTextOverflow$1 = styled__default.default.span(_a$x || (_a$x = __template$x(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
4622
- const Label = react.forwardRef(function Label2(props, ref) {
4623
- const {
4624
- accent,
4625
- align,
4626
- children: childrenProp,
4627
- muted = false,
4628
- size = 2,
4629
- textOverflow,
4630
- weight,
4631
- ...restProps
4632
- } = props;
4633
- let children = childrenProp;
4634
- if (textOverflow === "ellipsis") {
4635
- children = /* @__PURE__ */jsxRuntime.jsx(SpanWithTextOverflow$1, {
4636
- children
4637
- });
4638
- } else {
4639
- children = /* @__PURE__ */jsxRuntime.jsx("span", {
4640
- children
4641
- });
4642
- }
4643
- return /* @__PURE__ */jsxRuntime.jsx(Root$z, {
4644
- "data-ui": "Label",
4645
- ...restProps,
4646
- $accent: accent,
4647
- $align: useArrayProp(align),
4648
- $muted: muted,
4649
- $size: useArrayProp(size),
4650
- $weight: weight,
4651
- ref,
4652
- children
4653
- });
4654
- });
4655
3195
  function badgeStyle(props) {
4656
3196
  const {
4657
3197
  $mode,
4658
- $tone,
4659
- theme
3198
+ $tone
4660
3199
  } = props;
4661
- const palette = theme.sanity.color[$mode === "outline" ? "muted" : "solid"];
4662
- const color = palette[$tone] || palette.default;
4663
3200
  return {
4664
- backgroundColor: color.enabled.bg,
4665
- color: color.enabled.fg,
4666
- boxShadow: "inset 0 0 0 1px ".concat(color.enabled.border),
3201
+ backgroundColor: $mode === "outline" ? cssVars[$tone]["bg-base"] : cssVars[$tone]["bg-tint"],
3202
+ [mutableCardVariables["fg-color"]]: cssVars[$tone]["text-secondary"],
3203
+ boxShadow: $mode === "outline" ? "inset 0 0 0 1px ".concat(cssVars[$tone]["border-base"]) : void 0,
4667
3204
  cursor: "default",
4668
3205
  "&:not([hidden])": {
4669
3206
  display: "inline-block"
4670
3207
  }
4671
3208
  };
4672
3209
  }
4673
- const Root$y = styled__default.default(Box)(responsiveRadiusStyle, badgeStyle);
3210
+ const Root$z = styled__default.default(Box)(responsiveRadiusStyle, badgeStyle);
4674
3211
  const Badge = react.forwardRef(function Badge2(props, ref) {
4675
3212
  const {
4676
3213
  children,
@@ -4681,7 +3218,7 @@ const Badge = react.forwardRef(function Badge2(props, ref) {
4681
3218
  tone = "default",
4682
3219
  ...restProps
4683
3220
  } = props;
4684
- return /* @__PURE__ */jsxRuntime.jsx(Root$y, {
3221
+ return /* @__PURE__ */jsxRuntime.jsx(Root$z, {
4685
3222
  "data-ui": "Badge",
4686
3223
  ...restProps,
4687
3224
  $mode: mode,
@@ -4689,13 +3226,14 @@ const Badge = react.forwardRef(function Badge2(props, ref) {
4689
3226
  $radius: useArrayProp(radius),
4690
3227
  padding: useArrayProp(padding),
4691
3228
  ref,
4692
- children: /* @__PURE__ */jsxRuntime.jsx(Label, {
3229
+ children: /* @__PURE__ */jsxRuntime.jsx(Text, {
4693
3230
  size: fontSize,
3231
+ weight: "medium",
4694
3232
  children
4695
3233
  })
4696
3234
  });
4697
3235
  });
4698
- const Root$x = styled__default.default(Box)(flexItemStyle, responsiveFlexStyle);
3236
+ const Root$y = styled__default.default(Box)(flexItemStyle, responsiveFlexStyle);
4699
3237
  const Flex = react.forwardRef(function Flex2(props, ref) {
4700
3238
  const {
4701
3239
  align,
@@ -4709,7 +3247,7 @@ const Flex = react.forwardRef(function Flex2(props, ref) {
4709
3247
  return (
4710
3248
  // @ts-expect-error -- some dollar prefixed typings aren't inferred correctly https://github.com/styled-components/styled-components/issues/4062
4711
3249
  /* @__PURE__ */
4712
- jsxRuntime.jsx(Root$x, {
3250
+ jsxRuntime.jsx(Root$y, {
4713
3251
  "data-ui": "Flex",
4714
3252
  ...restProps,
4715
3253
  $align: useArrayProp(align),
@@ -4722,61 +3260,30 @@ const Flex = react.forwardRef(function Flex2(props, ref) {
4722
3260
  })
4723
3261
  );
4724
3262
  });
4725
- var __freeze$w = Object.freeze;
4726
- var __defProp$x = Object.defineProperty;
4727
- var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
4728
- value: __freeze$w(raw || cooked.slice())
3263
+ var __freeze$y = Object.freeze;
3264
+ var __defProp$z = Object.defineProperty;
3265
+ var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
3266
+ value: __freeze$y(raw || cooked.slice())
4729
3267
  }));
4730
- var _a$w, _b$j;
4731
- const rotate$1 = styled.keyframes(_a$w || (_a$w = __template$w(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
4732
- const Root$w = styled__default.default(Text)(_b$j || (_b$j = __template$w(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
3268
+ var _a$y, _b$k;
3269
+ const rotate$1 = styled.keyframes(_a$y || (_a$y = __template$y(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
3270
+ const Root$x = styled__default.default(Text)(_b$k || (_b$k = __template$y(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
4733
3271
  const Spinner = react.forwardRef(function Spinner2(props, ref) {
4734
- return /* @__PURE__ */jsxRuntime.jsx(Root$w, {
3272
+ return /* @__PURE__ */jsxRuntime.jsx(Root$x, {
4735
3273
  "data-ui": "Spinner",
4736
3274
  ...props,
4737
3275
  ref,
4738
3276
  children: /* @__PURE__ */jsxRuntime.jsx(icons.SpinnerIcon, {})
4739
3277
  });
4740
3278
  });
4741
- function _colorVarsStyle(base, color) {
4742
- let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
4743
- var _a, _b, _c, _d, _e, _f, _g, _h;
4744
- return {
4745
- // Base
4746
- // @todo: rename to "--base-"?
4747
- "--card-shadow-outline-color": base.shadow.outline,
4748
- "--card-shadow-umbra-color": base.shadow.umbra,
4749
- "--card-shadow-penumbra-color": base.shadow.penumbra,
4750
- "--card-shadow-ambient-color": base.shadow.ambient,
4751
- "--card-focus-ring-color": base.focusRing,
4752
- "--card-icon-color": color.iconColor,
4753
- // Card
4754
- "--card-bg-color": color.bg,
4755
- "--card-bg2-color": color.bg2,
4756
- "--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
4757
- "--card-fg-color": color.fg,
4758
- "--card-border-color": color.border,
4759
- "--card-muted-fg-color": (_a = color.muted) == null ? void 0 : _a.fg,
4760
- "--card-accent-fg-color": (_b = color.accent) == null ? void 0 : _b.fg,
4761
- "--card-link-fg-color": (_c = color.link) == null ? void 0 : _c.fg,
4762
- "--card-code-bg-color": (_d = color.code) == null ? void 0 : _d.bg,
4763
- "--card-code-fg-color": (_e = color.code) == null ? void 0 : _e.fg,
4764
- "--card-skeleton-color-from": (_f = color.skeleton) == null ? void 0 : _f.from,
4765
- "--card-skeleton-color-to": (_g = color.skeleton) == null ? void 0 : _g.to,
4766
- // @todo: deprecate
4767
- "--card-link-color": (_h = color.link) == null ? void 0 : _h.fg,
4768
- "--card-hairline-soft-color": color.border,
4769
- "--card-hairline-hard-color": color.border
4770
- };
4771
- }
4772
- var __freeze$v = Object.freeze;
4773
- var __defProp$w = Object.defineProperty;
4774
- var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
4775
- value: __freeze$v(raw || cooked.slice())
3279
+ var __freeze$x = Object.freeze;
3280
+ var __defProp$y = Object.defineProperty;
3281
+ var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
3282
+ value: __freeze$x(raw || cooked.slice())
4776
3283
  }));
4777
- var _a$v;
3284
+ var _a$x;
4778
3285
  function buttonBaseStyles() {
4779
- return styled.css(_a$v || (_a$v = __template$v(["\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])));
3286
+ return styled.css(_a$x || (_a$x = __template$x(["\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])));
4780
3287
  }
4781
3288
  const buttonTheme = {
4782
3289
  border: {
@@ -4794,32 +3301,60 @@ function buttonColorStyles(props) {
4794
3301
  var _a2, _b;
4795
3302
  const {
4796
3303
  $mode,
4797
- theme
3304
+ theme,
3305
+ $tone
4798
3306
  } = props;
4799
3307
  const {
4800
3308
  focusRing
4801
3309
  } = theme.sanity.button;
4802
3310
  const shadow = props.$mode !== "bleed";
4803
- const base = theme.sanity.color.base;
4804
- const mode = theme.sanity.color.button[$mode] || theme.sanity.color.button.default;
4805
- const color = mode[props.$tone] || mode.default;
4806
3311
  const border = {
4807
3312
  width: buttonTheme.border.width,
4808
- color: "var(--card-border-color)"
3313
+ color: $mode === "default" ? cssVars[$tone]["bg-accent"] : $mode === "ghost" ? cssVars[$tone]["border-base"] : cssVars[$tone]["bg-base"]
4809
3314
  };
4810
- return [_colorVarsStyle(base, color.enabled), {
4811
- backgroundColor: "var(--card-bg-color)",
4812
- color: "var(--card-fg-color)",
3315
+ return [{
3316
+ // This is going to be used by the text elements inside the button
3317
+ [mutableCardVariables["fg-color"]]: $mode === "default" ? cssVars[$tone]["base-text-color"] : cssVars[$tone]["text-primary"],
3318
+ [mutableCardVariables["muted-fg-color"]]: $mode === "default" ? cssVars[$tone]["base-text-color"] : cssVars[$tone]["text-secondary"],
3319
+ [mutableCardVariables["icon-color"]]: $mode === "default" ? cssVars[$tone]["icon-inverted"] : cssVars[$tone]["icon-default"],
3320
+ [mutableCardVariables["bg-color"]]: $mode === "default" ? cssVars[$tone]["bg-accent"] : cssVars[$tone]["bg-base"],
3321
+ // Override the default variables for elements used inside buttons
3322
+ [getToneCssVar("default", "bg-tint-code")]: $mode === "default" ? cssVars[$tone]["bg-accent"] : cssVars[$tone]["bg-tint-code"],
3323
+ ...($mode === "default" && {
3324
+ [getToneCssVar("default", "text-code")]: cssVars[$tone]["base-text-color"],
3325
+ [getToneCssVar("default", "text-code")]: cssVars[$tone]["base-text-color"],
3326
+ [getToneCssVar("default", "text-link")]: cssVars[$tone]["base-text-color"],
3327
+ [getToneCssVar("default", "text-accent")]: cssVars[$tone]["base-text-color"]
3328
+ }),
3329
+ '&:disabled, &[data-disabled="true"]': {
3330
+ /* Updates the variables for the */
3331
+ [mutableCardVariables["fg-color"]]: cssVars.primary["text-inactive"],
3332
+ [mutableCardVariables["muted-fg-color"]]: cssVars.primary["text-inactive"],
3333
+ [mutableCardVariables["icon-color"]]: cssVars.primary["border-base"],
3334
+ [mutableCardVariables["bg-color"]]: $mode === "default" ? cssVars.primary["bg-tint"] : cssVars.default["bg-base"]
3335
+ }
3336
+ }, {
3337
+ backgroundColor: $mode === "default" ? cssVars[$tone]["bg-accent"] : cssVars[$tone]["bg-base"],
3338
+ color: $mode === "default" ? cssVars[$tone]["base-text-color"] : cssVars[$tone]["text-primary"],
4813
3339
  boxShadow: focusRingBorderStyle(border),
4814
- '&:disabled, &[data-disabled="true"]': _colorVarsStyle(base, color.disabled),
3340
+ '&:disabled, &[data-disabled="true"]': {
3341
+ backgroundColor: $mode === "default" ? cssVars.primary["bg-tint"] : cssVars.default["bg-base"],
3342
+ color: cssVars.primary["text-inactive"],
3343
+ boxShadow: focusRingBorderStyle({
3344
+ ...border,
3345
+ color: $mode === "default" ? cssVars.primary["bg-tint"] : cssVars.primary["border-base"]
3346
+ })
3347
+ },
4815
3348
  "&:not([data-disabled='true'])": {
4816
3349
  boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0),
4817
3350
  "&:focus": {
4818
3351
  boxShadow: focusRingStyle({
4819
- base,
3352
+ base: {
3353
+ bg: cssVars.positive["border-accent"]
3354
+ },
4820
3355
  border: {
4821
3356
  width: 2,
4822
- color: base.bg
3357
+ color: cssVars.default["bg-base"]
4823
3358
  },
4824
3359
  focusRing
4825
3360
  })
@@ -4828,22 +3363,30 @@ function buttonColorStyles(props) {
4828
3363
  boxShadow: combineBoxShadow(focusRingBorderStyle(border), shadow ? defaultBoxShadow : void 0)
4829
3364
  },
4830
3365
  "@media (hover: hover)": {
4831
- "&:hover": _colorVarsStyle(base, color.hovered),
4832
- "&:active": _colorVarsStyle(base, color.pressed),
4833
- "&[data-hovered]": _colorVarsStyle(base, color.hovered)
3366
+ "&:hover": {
3367
+ backgroundColor: $mode === "default" ? cssVars[$tone]["bg-accent-hover"] : cssVars[$tone]["bg-base-hover"]
3368
+ },
3369
+ "&:active": {
3370
+ backgroundColor: $mode === "default" ? cssVars[$tone]["bg-accent-active"] : cssVars[$tone]["bg-base-active"]
3371
+ },
3372
+ "&[data-hovered]": {
3373
+ backgroundColor: $mode === "default" ? cssVars[$tone]["bg-accent-hover"] : cssVars[$tone]["bg-base-hover"]
3374
+ }
4834
3375
  },
4835
- "&[data-selected]": _colorVarsStyle(base, color.pressed)
3376
+ "&[data-selected]": {
3377
+ backgroundColor: $mode === "default" ? cssVars[$tone]["bg-accent-active"] : cssVars[$tone]["bg-base-active"]
3378
+ }
4836
3379
  }
4837
3380
  }, (_b = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.button) == null ? void 0 : _b.root].filter(Boolean);
4838
3381
  }
4839
- var __freeze$u = Object.freeze;
4840
- var __defProp$v = Object.defineProperty;
4841
- var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
4842
- value: __freeze$u(raw || cooked.slice())
3382
+ var __freeze$w = Object.freeze;
3383
+ var __defProp$x = Object.defineProperty;
3384
+ var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
3385
+ value: __freeze$w(raw || cooked.slice())
4843
3386
  }));
4844
- var _a$u;
4845
- const Root$v = styled__default.default.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
4846
- const LoadingBox = styled__default.default.div(_a$u || (_a$u = __template$u(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--card-bg-color);\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])));
3387
+ var _a$w;
3388
+ const Root$w = styled__default.default.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
3389
+ const LoadingBox = styled__default.default.div(_a$w || (_a$w = __template$w(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])), cssVars.mutable["bg-color"]);
4847
3390
  const Button = react.forwardRef(function Button2(props, ref) {
4848
3391
  const {
4849
3392
  children,
@@ -4892,7 +3435,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
4892
3435
  paddingLeft,
4893
3436
  paddingRight
4894
3437
  }), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
4895
- return /* @__PURE__ */jsxRuntime.jsxs(Root$v, {
3438
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$w, {
4896
3439
  "data-ui": "Button",
4897
3440
  ...restProps,
4898
3441
  $mode: mode,
@@ -4937,12 +3480,59 @@ const Button = react.forwardRef(function Button2(props, ref) {
4937
3480
  })]
4938
3481
  });
4939
3482
  });
4940
- var __freeze$t = Object.freeze;
4941
- var __defProp$u = Object.defineProperty;
4942
- var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
4943
- value: __freeze$t(raw || cooked.slice())
3483
+ function _colorVarStyleDisabled() {
3484
+ let checkered = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3485
+ return {
3486
+ [getToneCssVar("default", "text-link")]: cssVars.default["text-secondary"],
3487
+ [getToneCssVar("default", "text-accent")]: cssVars.default["text-secondary"],
3488
+ [getToneCssVar("default", "text-code")]: cssVars.default["text-secondary"],
3489
+ [getToneCssVar("default", "text-primary")]: cssVars.default["text-secondary"],
3490
+ [mutableCardVariables["fg-color"]]: cssVars.primary["text-secondary"],
3491
+ [mutableCardVariables["muted-fg-color"]]: cssVars.primary["text-secondary"],
3492
+ [mutableCardVariables["icon-color"]]: cssVars.primary["border-base"],
3493
+ [mutableCardVariables["accent-color"]]: cssVars.primary["base-bg-card"],
3494
+ [mutableCardVariables["bg-color"]]: cssVars.primary["bg-tint"],
3495
+ [mutableCardVariables["bg-image"]]: checkered ? "repeating-conic-gradient(".concat(cssVars.default["base-bg-card"], " 0% 25%, ").concat(cssVars.default["bg-tint"], " 0% 50%)") : void 0
3496
+ };
3497
+ }
3498
+ function _colorVarStyleSelected() {
3499
+ return {
3500
+ [mutableCardVariables["bg-color"]]: cssVars.default["bg-accent"],
3501
+ [mutableCardVariables["fg-color"]]: cssVars.default["bg-base"],
3502
+ [mutableCardVariables["muted-fg-color"]]: cssVars.default["base-bg-card"],
3503
+ [mutableCardVariables["accent-color"]]: cssVars.default["base-bg-card"],
3504
+ [mutableCardVariables["icon-color"]]: cssVars.primary["bg-base"]
3505
+ };
3506
+ }
3507
+ function _colorVarStyleHover() {
3508
+ return {
3509
+ [mutableCardVariables["bg-color"]]: cssVars.default["bg-base-hover"],
3510
+ [getToneCssVar("default", "bg-tint")]: cssVars.default["bg-base-active"]
3511
+ };
3512
+ }
3513
+ function _colorVarStyleActive() {
3514
+ return {
3515
+ [mutableCardVariables["bg-color"]]: cssVars.default["bg-base-active"]
3516
+ };
3517
+ }
3518
+ function _selectableVarStyle(tone) {
3519
+ return {
3520
+ [mutableCardVariables["bg-color"]]: "inherit",
3521
+ [mutableCardVariables["fg-color"]]: tone === "default" ? cssVars.default["text-primary"] : cssVars.default["text-secondary"]
3522
+ };
3523
+ }
3524
+ function _selectableVarStyleDisabled() {
3525
+ return {
3526
+ ..._colorVarStyleDisabled(),
3527
+ [mutableCardVariables["bg-color"]]: void 0
3528
+ };
3529
+ }
3530
+ var __freeze$v = Object.freeze;
3531
+ var __defProp$w = Object.defineProperty;
3532
+ var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
3533
+ value: __freeze$v(raw || cooked.slice())
4944
3534
  }));
4945
- var _a$t, _b$i, _c$a;
3535
+ var _a$v, _b$j, _c$b;
4946
3536
  function cardStyle(props) {
4947
3537
  return [cardBaseStyle(props), cardColorStyle(props)];
4948
3538
  }
@@ -4952,38 +3542,50 @@ function cardBaseStyle(props) {
4952
3542
  theme
4953
3543
  } = props;
4954
3544
  const space = theme.sanity.space;
4955
- return styled.css(_b$i || (_b$i = __template$t(["\n ", "\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])), $checkered && styled.css(_a$t || (_a$t = __template$t(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])), space[3], space[3]));
3545
+ return styled.css(_b$j || (_b$j = __template$v(["\n ", "\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])), $checkered && styled.css(_a$v || (_a$v = __template$v(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: ", ";\n "])), space[3], space[3], cssVars.mutable["bg-image"]));
4956
3546
  }
4957
3547
  function cardColorStyle(props) {
4958
3548
  var _a2, _b2;
4959
3549
  const {
4960
3550
  $checkered,
4961
3551
  $focusRing,
4962
- theme
3552
+ theme,
3553
+ $tone,
3554
+ $scheme,
3555
+ $updateCssVars
4963
3556
  } = props;
4964
3557
  const {
4965
3558
  focusRing
4966
3559
  } = theme.sanity.card;
4967
- const {
4968
- base,
4969
- card,
4970
- dark
4971
- } = theme.sanity.color;
4972
3560
  const border = {
4973
3561
  width: 0,
4974
- color: "var(--card-border-color)"
3562
+ color: cssVars.positive["border-accent"]
4975
3563
  };
4976
- return styled.css(_c$a || (_c$a = __template$t(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), dark ? "dark" : "light", _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
4977
- base,
3564
+ return styled.css(_c$b || (_c$b = __template$v(["\n /* A new css vars context is created, allowing for override of the default tone and changing the scheme */\n ", "\n color-scheme: ", ";\n ", "\n\n background-color: ", ";\n color: ", ";\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), $updateCssVars && createCssVars($scheme, theme.sanity.color.tones, $tone), $scheme === "dark" ? "dark" : "light", $checkered && "--card-bg-image: repeating-conic-gradient(".concat(cssVars.default["base-bg-card"], " 0% 25%, ").concat(cssVars.default["bg-tint"], " 0% 50%)"), cssVars.mutable["bg-color"], cssVars.default["text-primary"], _colorVarStyleDisabled($checkered), _colorVarStyleActive(), _colorVarStyleSelected(), _colorVarStyleHover(), _colorVarStyleActive(), $focusRing ? focusRingStyle({
4978
3565
  border,
4979
3566
  focusRing
4980
- }) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
4981
- base,
3567
+ }) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, _colorVarStyleDisabled($checkered), _colorVarStyleActive(), _colorVarStyleSelected(), _colorVarStyleHover(), _colorVarStyleActive(), $focusRing ? focusRingStyle({
4982
3568
  border,
4983
3569
  focusRing
4984
3570
  }) : void 0, $focusRing ? focusRingBorderStyle(border) : void 0, (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
4985
3571
  }
4986
- const Root$u = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
3572
+ const Root$v = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
3573
+ const Wrapper = _ref5 => {
3574
+ let {
3575
+ shouldAddContext,
3576
+ scheme,
3577
+ tone,
3578
+ children
3579
+ } = _ref5;
3580
+ if (shouldAddContext) {
3581
+ return /* @__PURE__ */jsxRuntime.jsx(ToneProvider, {
3582
+ scheme,
3583
+ tone,
3584
+ children
3585
+ });
3586
+ }
3587
+ return children;
3588
+ };
4987
3589
  const Card = react.forwardRef(function Card2(props, ref) {
4988
3590
  const {
4989
3591
  __unstable_checkered: checkered = false,
@@ -4996,23 +3598,28 @@ const Card = react.forwardRef(function Card2(props, ref) {
4996
3598
  borderLeft,
4997
3599
  pressed,
4998
3600
  radius = 0,
4999
- scheme,
3601
+ scheme: schemeProp,
5000
3602
  selected,
5001
3603
  shadow,
5002
3604
  tone: toneProp = "default",
3605
+ updateCssVars = false,
5003
3606
  ...restProps
5004
3607
  } = props;
5005
3608
  const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
5006
- const rootTheme = useRootTheme();
5007
- const tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
5008
- return /* @__PURE__ */jsxRuntime.jsx(ThemeColorProvider, {
3609
+ const toneContext = useToneContext();
3610
+ const tone = toneProp === "inherit" ? toneContext.tone : toneProp;
3611
+ const scheme = schemeProp != null ? schemeProp : toneContext.scheme;
3612
+ const shouldAddContext = scheme !== toneContext.scheme || tone !== toneContext.tone;
3613
+ return /* @__PURE__ */jsxRuntime.jsx(Wrapper, {
3614
+ shouldAddContext,
5009
3615
  scheme,
5010
3616
  tone,
5011
- children: /* @__PURE__ */jsxRuntime.jsx(Root$u, {
3617
+ children: /* @__PURE__ */jsxRuntime.jsx(Root$v, {
5012
3618
  "data-as": typeof as === "string" ? as : void 0,
5013
- "data-scheme": rootTheme.scheme,
3619
+ "data-scheme": scheme,
5014
3620
  "data-ui": "Card",
5015
3621
  "data-tone": tone,
3622
+ $scheme: scheme != null ? scheme : toneContext.scheme,
5016
3623
  ...restProps,
5017
3624
  $border: useArrayProp(border),
5018
3625
  $borderTop: useArrayProp(borderTop),
@@ -5024,6 +3631,7 @@ const Card = react.forwardRef(function Card2(props, ref) {
5024
3631
  $radius: useArrayProp(radius),
5025
3632
  $shadow: useArrayProp(shadow),
5026
3633
  $tone: tone,
3634
+ $updateCssVars: updateCssVars || shouldAddContext,
5027
3635
  "data-checkered": checkered ? "" : void 0,
5028
3636
  "data-pressed": pressed ? "" : void 0,
5029
3637
  "data-selected": selected ? "" : void 0,
@@ -5033,20 +3641,19 @@ const Card = react.forwardRef(function Card2(props, ref) {
5033
3641
  })
5034
3642
  });
5035
3643
  });
5036
- var __freeze$s = Object.freeze;
5037
- var __defProp$t = Object.defineProperty;
5038
- var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
5039
- value: __freeze$s(raw || cooked.slice())
3644
+ var __freeze$u = Object.freeze;
3645
+ var __defProp$v = Object.defineProperty;
3646
+ var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
3647
+ value: __freeze$u(raw || cooked.slice())
5040
3648
  }));
5041
- var _a$s, _b$h;
3649
+ var _a$u, _b$i;
5042
3650
  function checkboxBaseStyles() {
5043
- return styled.css(_a$s || (_a$s = __template$s(["\n position: relative;\n display: inline-block;\n "])));
3651
+ return styled.css(_a$u || (_a$u = __template$u(["\n position: relative;\n display: inline-block;\n "])));
5044
3652
  }
5045
3653
  function inputElementStyles(props) {
5046
3654
  const {
5047
3655
  theme
5048
3656
  } = props;
5049
- const color = theme.sanity.color.input;
5050
3657
  const {
5051
3658
  input,
5052
3659
  radius
@@ -5054,40 +3661,40 @@ function inputElementStyles(props) {
5054
3661
  const {
5055
3662
  focusRing
5056
3663
  } = input.checkbox;
5057
- return styled.css(_b$h || (_b$h = __template$s(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.2 !important;\n }\n }\n }\n &:checked + span {\n background: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ", ";\n }\n\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &[data-error]&:checked + span {\n background-color: ", ";\n color: ", ";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n &:disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &:disabled&:checked + span {\n background-color: ", ";\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ", ";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
5058
- color: color.default.enabled.border,
3664
+ return styled.css(_b$i || (_b$i = __template$u(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.2 !important;\n }\n }\n }\n &:checked + span {\n background: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ", ";\n }\n\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &[data-error]&:checked + span {\n background-color: ", ";\n color: ", ";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n &:disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &:disabled&:checked + span {\n background-color: ", ";\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ", ";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
3665
+ color: cssVars.default["border-base"],
5059
3666
  width: input.border.width
5060
- }), rem(radius[2]), color.default.enabled.bg, color.default.enabled.bg2, focusRingBorderStyle({
5061
- color: color.default.enabled.bg2,
3667
+ }), rem(radius[2]), cssVars.default["bg-base"], cssVars.default["text-secondary"], focusRingBorderStyle({
3668
+ color: cssVars.default["text-secondary"],
5062
3669
  width: input.border.width
5063
- }), color.default.enabled.bg, focusRingStyle({
3670
+ }), cssVars.default["bg-base"], focusRingStyle({
5064
3671
  focusRing
5065
3672
  }), focusRingStyle({
5066
3673
  focusRing: {
5067
3674
  width: 1,
5068
3675
  offset: 1
5069
3676
  }
5070
- }), color.invalid.enabled.border, focusRingBorderStyle({
3677
+ }), cssVars.critical["border-base"], focusRingBorderStyle({
5071
3678
  width: input.border.width,
5072
- color: color.invalid.enabled.bg2
5073
- }), color.default.disabled.fg, color.invalid.enabled.bg2, color.default.enabled.bg, focusRingStyle({
3679
+ color: cssVars.critical["text-secondary"]
3680
+ }), cssVars.default["text-secondary"], cssVars.critical["text-secondary"], cssVars.default["bg-base"], focusRingStyle({
5074
3681
  border: {
5075
3682
  width: input.border.width,
5076
- color: color.invalid.readOnly.bg2
3683
+ color: cssVars.critical["text-secondary"]
5077
3684
  },
5078
3685
  focusRing: {
5079
3686
  width: 1,
5080
3687
  offset: 1
5081
3688
  }
5082
- }), color.default.disabled.bg, focusRingBorderStyle({
3689
+ }), cssVars.default["bg-tint"], focusRingBorderStyle({
5083
3690
  width: input.border.width,
5084
- color: color.default.disabled.border
5085
- }), color.default.disabled.fg, color.default.disabled.bg2, color.default.readOnly.bg, focusRingBorderStyle({
3691
+ color: cssVars.default["border-base"]
3692
+ }), cssVars.default["text-secondary"], cssVars.default["border-base"], cssVars.default["bg-tint"], focusRingBorderStyle({
5086
3693
  width: input.border.width,
5087
- color: color.default.readOnly.border
5088
- }), color.default.readOnly.fg, color.default.readOnly.bg2);
3694
+ color: cssVars.default["border-base"]
3695
+ }), cssVars.default["text-secondary"], cssVars.default["border-base"]);
5089
3696
  }
5090
- const Root$t = styled__default.default.div(checkboxBaseStyles);
3697
+ const Root$u = styled__default.default.div(checkboxBaseStyles);
5091
3698
  const Input$5 = styled__default.default.input(inputElementStyles);
5092
3699
  const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
5093
3700
  const {
@@ -5107,7 +3714,7 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
5107
3714
  ref.current.indeterminate = indeterminate || false;
5108
3715
  }
5109
3716
  }, [indeterminate, ref]);
5110
- return /* @__PURE__ */jsxRuntime.jsxs(Root$t, {
3717
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$u, {
5111
3718
  className,
5112
3719
  "data-ui": "Checkbox",
5113
3720
  style,
@@ -5125,132 +3732,131 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
5125
3732
  })]
5126
3733
  });
5127
3734
  });
5128
- var __freeze$r = Object.freeze;
5129
- var __defProp$s = Object.defineProperty;
5130
- var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
5131
- value: __freeze$r(raw || cooked.slice())
3735
+ var __freeze$t = Object.freeze;
3736
+ var __defProp$u = Object.defineProperty;
3737
+ var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
3738
+ value: __freeze$t(raw || cooked.slice())
5132
3739
  }));
5133
- var _a$r;
5134
- function codeSyntaxHighlightingStyle(_ref20) {
5135
- let {
5136
- theme
5137
- } = _ref20;
5138
- const color = theme.sanity.color.syntax;
3740
+ var _a$t;
3741
+ function codeSyntaxHighlightingStyle(scheme) {
3742
+ const dark = scheme === "dark";
3743
+ const mainShade = dark ? 400 : 600;
3744
+ const secondaryShade = dark ? 600 : 400;
5139
3745
  return {
5140
3746
  "&.atrule": {
5141
- color: color.atrule
3747
+ color: color.purple[mainShade].hex
5142
3748
  },
5143
3749
  "&.attr-name": {
5144
- color: color.attrName
3750
+ color: color.green[mainShade].hex
5145
3751
  },
5146
3752
  "&.attr-value": {
5147
- color: color.attrValue
3753
+ color: color.yellow[mainShade].hex
5148
3754
  },
5149
3755
  "&.attribute": {
5150
- color: color.attribute
3756
+ color: color.yellow[mainShade].hex
5151
3757
  },
5152
3758
  "&.boolean": {
5153
- color: color.boolean
3759
+ color: color.purple[mainShade].hex
5154
3760
  },
5155
3761
  "&.builtin": {
5156
- color: color.builtin
3762
+ color: color.purple[mainShade].hex
5157
3763
  },
5158
3764
  "&.cdata": {
5159
- color: color.cdata
3765
+ color: color.yellow[mainShade].hex
5160
3766
  },
5161
3767
  "&.char": {
5162
- color: color.char
3768
+ color: color.yellow[mainShade].hex
5163
3769
  },
5164
3770
  "&.class": {
5165
- color: color.class
3771
+ color: color.orange[mainShade].hex
5166
3772
  },
5167
3773
  "&.class-name": {
5168
- color: color.className
3774
+ color: color.cyan[mainShade].hex
5169
3775
  },
5170
3776
  "&.comment": {
5171
- color: color.comment
3777
+ color: color.gray[secondaryShade].hex
5172
3778
  },
5173
3779
  "&.constant": {
5174
- color: color.constant
3780
+ color: color.purple[mainShade].hex
5175
3781
  },
5176
3782
  "&.deleted": {
5177
- color: color.deleted
3783
+ color: color.red[mainShade].hex
5178
3784
  },
5179
3785
  "&.doctype": {
5180
- color: color.doctype
3786
+ color: color.gray[secondaryShade].hex
5181
3787
  },
5182
3788
  "&.entity": {
5183
- color: color.entity
3789
+ color: color.red[mainShade].hex
5184
3790
  },
5185
3791
  "&.function": {
5186
- color: color.function
3792
+ color: color.green[mainShade].hex
5187
3793
  },
5188
3794
  "&.hexcode": {
5189
- color: color.hexcode
3795
+ color: color.blue[mainShade].hex
5190
3796
  },
5191
3797
  "&.id": {
5192
- color: color.id
3798
+ color: color.purple[mainShade].hex
5193
3799
  },
5194
3800
  "&.important": {
5195
- color: color.important
3801
+ color: color.purple[mainShade].hex
5196
3802
  },
5197
3803
  "&.inserted": {
5198
- color: color.inserted
3804
+ color: color.yellow[mainShade].hex
5199
3805
  },
5200
3806
  "&.keyword": {
5201
- color: color.keyword
3807
+ color: color.magenta[mainShade].hex
5202
3808
  },
5203
3809
  "&.number": {
5204
- color: color.number
3810
+ color: color.purple[mainShade].hex
5205
3811
  },
5206
3812
  "&.operator": {
5207
- color: color.operator
3813
+ color: color.magenta[mainShade].hex
5208
3814
  },
5209
3815
  "&.prolog": {
5210
- color: color.prolog
3816
+ color: color.gray[secondaryShade].hex
5211
3817
  },
5212
3818
  "&.property": {
5213
- color: color.property
3819
+ color: color.blue[mainShade].hex
5214
3820
  },
5215
3821
  "&.pseudo-class": {
5216
- color: color.pseudoClass
3822
+ color: color.yellow[mainShade].hex
5217
3823
  },
5218
3824
  "&.pseudo-element": {
5219
- color: color.pseudoElement
3825
+ color: color.yellow[mainShade].hex
5220
3826
  },
5221
3827
  "&.punctuation": {
5222
- color: color.punctuation
3828
+ color: color.gray[mainShade].hex
5223
3829
  },
5224
3830
  "&.regex": {
5225
- color: color.regex
3831
+ color: color.blue[mainShade].hex
5226
3832
  },
5227
3833
  "&.selector": {
5228
- color: color.selector
3834
+ color: color.red[mainShade].hex
5229
3835
  },
5230
3836
  "&.string": {
5231
- color: color.string
3837
+ color: color.yellow[mainShade].hex
5232
3838
  },
5233
3839
  "&.symbol": {
5234
- color: color.symbol
3840
+ color: color.purple[mainShade].hex
5235
3841
  },
5236
3842
  "&.tag": {
5237
- color: color.tag
3843
+ color: color.red[mainShade].hex
5238
3844
  },
5239
3845
  "&.unit": {
5240
- color: color.unit
3846
+ color: color.orange[mainShade].hex
5241
3847
  },
5242
3848
  "&.url": {
5243
- color: color.url
3849
+ color: color.red[mainShade].hex
5244
3850
  },
5245
3851
  "&.variable": {
5246
- color: color.variable
3852
+ color: color.red[mainShade].hex
5247
3853
  }
5248
3854
  };
5249
3855
  }
5250
- function codeBaseStyle() {
5251
- return styled.css(_a$r || (_a$r = __template$r(["\n color: var(--card-code-fg-color);\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ", "\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), codeSyntaxHighlightingStyle);
3856
+ function codeBaseStyle(props) {
3857
+ return styled.css(_a$t || (_a$t = __template$t(["\n color: ", ";\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ", "\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), cssVars.default["text-code"], codeSyntaxHighlightingStyle(props.$scheme));
5252
3858
  }
5253
- const Root$s = styled__default.default.pre(codeBaseStyle, responsiveCodeFontStyle);
3859
+ const Root$t = styled__default.default.pre(codeBaseStyle, responsiveCodeFontStyle);
5254
3860
  const Code = react.forwardRef(function Code2(props, ref) {
5255
3861
  const {
5256
3862
  children,
@@ -5261,12 +3867,16 @@ const Code = react.forwardRef(function Code2(props, ref) {
5261
3867
  } = props;
5262
3868
  const language = typeof languageProp === "string" ? languageProp : void 0;
5263
3869
  const registered = language ? Refractor__default.default.hasLanguage(language) : false;
5264
- return /* @__PURE__ */jsxRuntime.jsxs(Root$s, {
3870
+ const {
3871
+ scheme
3872
+ } = useToneContext();
3873
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$t, {
5265
3874
  "data-ui": "Code",
5266
3875
  ...restProps,
5267
3876
  $size: useArrayProp(size),
5268
3877
  $weight: weight,
5269
3878
  ref,
3879
+ $scheme: scheme,
5270
3880
  children: [!(language && registered) && /* @__PURE__ */jsxRuntime.jsx("code", {
5271
3881
  children
5272
3882
  }), language && registered && /* @__PURE__ */jsxRuntime.jsx(Refractor__default.default, {
@@ -5295,14 +3905,14 @@ function responsiveContainerWidthStyle(props) {
5295
3905
  maxWidth: val === "auto" ? "none" : rem(container[val])
5296
3906
  }));
5297
3907
  }
5298
- const Root$r = styled__default.default(Box)(containerBaseStyle, responsiveContainerWidthStyle);
3908
+ const Root$s = styled__default.default(Box)(containerBaseStyle, responsiveContainerWidthStyle);
5299
3909
  const Container = react.forwardRef(function Container2(props, ref) {
5300
3910
  const {
5301
3911
  as,
5302
3912
  width = 2,
5303
3913
  ...restProps
5304
3914
  } = props;
5305
- return /* @__PURE__ */jsxRuntime.jsx(Root$r, {
3915
+ return /* @__PURE__ */jsxRuntime.jsx(Root$s, {
5306
3916
  "data-ui": "Container",
5307
3917
  ...restProps,
5308
3918
  $width: useArrayProp(width),
@@ -5310,7 +3920,7 @@ const Container = react.forwardRef(function Container2(props, ref) {
5310
3920
  ref
5311
3921
  });
5312
3922
  });
5313
- const Root$q = styled__default.default(Box)(responsiveGridStyle);
3923
+ const Root$r = styled__default.default(Box)(responsiveGridStyle);
5314
3924
  const Grid = react.forwardRef(function Grid2(props, ref) {
5315
3925
  const {
5316
3926
  as,
@@ -5325,7 +3935,7 @@ const Grid = react.forwardRef(function Grid2(props, ref) {
5325
3935
  children,
5326
3936
  ...restProps
5327
3937
  } = props;
5328
- return /* @__PURE__ */jsxRuntime.jsx(Root$q, {
3938
+ return /* @__PURE__ */jsxRuntime.jsx(Root$r, {
5329
3939
  "data-as": typeof as === "string" ? as : void 0,
5330
3940
  "data-ui": "Grid",
5331
3941
  ...restProps,
@@ -5342,28 +3952,28 @@ const Grid = react.forwardRef(function Grid2(props, ref) {
5342
3952
  children
5343
3953
  });
5344
3954
  });
5345
- var __freeze$q = Object.freeze;
5346
- var __defProp$r = Object.defineProperty;
5347
- var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
5348
- value: __freeze$q(raw || cooked.slice())
3955
+ var __freeze$s = Object.freeze;
3956
+ var __defProp$t = Object.defineProperty;
3957
+ var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
3958
+ value: __freeze$s(raw || cooked.slice())
5349
3959
  }));
5350
- var _a$q, _b$g, _c$9;
3960
+ var _a$s, _b$h, _c$a;
5351
3961
  function headingBaseStyle(props) {
5352
3962
  const {
5353
3963
  $accent,
5354
3964
  $muted,
5355
3965
  theme
5356
3966
  } = props;
5357
- return styled.css(_c$9 || (_c$9 = __template$q(["\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$q || (_a$q = __template$q(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$g || (_b$g = __template$q(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family);
3967
+ return styled.css(_c$a || (_c$a = __template$s(["\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: ", ";\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px ", ",\n 0 0 0 3px ", ";\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$s || (_a$s = __template$s(["\n color: ", "};\n "])), cssVars.default["text-accent"]), $muted && styled.css(_b$h || (_b$h = __template$s(["\n color: ", ";\n "])), cssVars.mutable["muted-fg-color"]), theme.sanity.fonts.code.family, cssVars.default["text-link"], cssVars.mutable["bg-color"], cssVars.positive["border-accent"]);
5358
3968
  }
5359
- var __freeze$p = Object.freeze;
5360
- var __defProp$q = Object.defineProperty;
5361
- var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
5362
- value: __freeze$p(raw || cooked.slice())
3969
+ var __freeze$r = Object.freeze;
3970
+ var __defProp$s = Object.defineProperty;
3971
+ var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
3972
+ value: __freeze$r(raw || cooked.slice())
5363
3973
  }));
5364
- var _a$p;
5365
- const Root$p = styled__default.default.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
5366
- const SpanWithTextOverflow = styled__default.default.span(_a$p || (_a$p = __template$p(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
3974
+ var _a$r;
3975
+ const Root$q = styled__default.default.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
3976
+ const SpanWithTextOverflow$1 = styled__default.default.span(_a$r || (_a$r = __template$r(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
5367
3977
  const Heading = react.forwardRef(function Heading2(props, ref) {
5368
3978
  const {
5369
3979
  accent = false,
@@ -5377,11 +3987,11 @@ const Heading = react.forwardRef(function Heading2(props, ref) {
5377
3987
  } = props;
5378
3988
  let children = childrenProp;
5379
3989
  if (textOverflow === "ellipsis") {
5380
- children = /* @__PURE__ */jsxRuntime.jsx(SpanWithTextOverflow, {
3990
+ children = /* @__PURE__ */jsxRuntime.jsx(SpanWithTextOverflow$1, {
5381
3991
  children
5382
3992
  });
5383
3993
  }
5384
- return /* @__PURE__ */jsxRuntime.jsx(Root$p, {
3994
+ return /* @__PURE__ */jsxRuntime.jsx(Root$q, {
5385
3995
  "data-ui": "Heading",
5386
3996
  ...restProps,
5387
3997
  $accent: accent,
@@ -5421,7 +4031,7 @@ function inlineSpaceStyle(props) {
5421
4031
  };
5422
4032
  });
5423
4033
  }
5424
- const Root$o = styled__default.default(Box)(inlineBaseStyle, inlineSpaceStyle);
4034
+ const Root$p = styled__default.default(Box)(inlineBaseStyle, inlineSpaceStyle);
5425
4035
  const Inline = react.forwardRef(function Inline2(props, ref) {
5426
4036
  const {
5427
4037
  as,
@@ -5432,7 +4042,7 @@ const Inline = react.forwardRef(function Inline2(props, ref) {
5432
4042
  const children = react.useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsxRuntime.jsx("div", {
5433
4043
  children: child
5434
4044
  }, idx)), [childrenProp]);
5435
- return /* @__PURE__ */jsxRuntime.jsx(Root$o, {
4045
+ return /* @__PURE__ */jsxRuntime.jsx(Root$p, {
5436
4046
  "data-ui": "Inline",
5437
4047
  ...restProps,
5438
4048
  $space: useArrayProp(space),
@@ -5441,16 +4051,16 @@ const Inline = react.forwardRef(function Inline2(props, ref) {
5441
4051
  children
5442
4052
  });
5443
4053
  });
5444
- var __freeze$o = Object.freeze;
5445
- var __defProp$p = Object.defineProperty;
5446
- var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
5447
- value: __freeze$o(raw || cooked.slice())
4054
+ var __freeze$q = Object.freeze;
4055
+ var __defProp$r = Object.defineProperty;
4056
+ var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
4057
+ value: __freeze$q(raw || cooked.slice())
5448
4058
  }));
5449
- var _a$o;
4059
+ var _a$q;
5450
4060
  function kbdStyle() {
5451
- return styled.css(_a$o || (_a$o = __template$o(["\n background: var(--card-bg2-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
4061
+ return styled.css(_a$q || (_a$q = __template$q(["\n background: ", ";\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])), cssVars.default["bg-tint"]);
5452
4062
  }
5453
- const Root$n = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
4063
+ const Root$o = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
5454
4064
  const KBD = react.forwardRef(function KBD2(props, ref) {
5455
4065
  const {
5456
4066
  children,
@@ -5459,7 +4069,7 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
5459
4069
  radius = 2,
5460
4070
  ...restProps
5461
4071
  } = props;
5462
- return /* @__PURE__ */jsxRuntime.jsx(Root$n, {
4072
+ return /* @__PURE__ */jsxRuntime.jsx(Root$o, {
5463
4073
  "data-ui": "KBD",
5464
4074
  ...restProps,
5465
4075
  $radius: useArrayProp(radius),
@@ -5477,6 +4087,64 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
5477
4087
  })
5478
4088
  });
5479
4089
  });
4090
+ var __freeze$p = Object.freeze;
4091
+ var __defProp$q = Object.defineProperty;
4092
+ var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
4093
+ value: __freeze$p(raw || cooked.slice())
4094
+ }));
4095
+ var _a$p, _b$g, _c$9;
4096
+ function labelBaseStyle(props) {
4097
+ const {
4098
+ $accent,
4099
+ $muted,
4100
+ theme
4101
+ } = props;
4102
+ const {
4103
+ fonts
4104
+ } = theme.sanity;
4105
+ return styled.css(_c$9 || (_c$9 = __template$p(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && styled.css(_a$p || (_a$p = __template$p(["\n color: ", "};\n "])), cssVars.default["text-accent"]), $muted && styled.css(_b$g || (_b$g = __template$p(["\n color: ", ";\n "])), cssVars.mutable["muted-fg-color"]), fonts.code.family);
4106
+ }
4107
+ var __freeze$o = Object.freeze;
4108
+ var __defProp$p = Object.defineProperty;
4109
+ var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
4110
+ value: __freeze$o(raw || cooked.slice())
4111
+ }));
4112
+ var _a$o;
4113
+ const Root$n = styled__default.default.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
4114
+ const SpanWithTextOverflow = styled__default.default.span(_a$o || (_a$o = __template$o(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
4115
+ const Label = react.forwardRef(function Label2(props, ref) {
4116
+ const {
4117
+ accent,
4118
+ align,
4119
+ children: childrenProp,
4120
+ muted = false,
4121
+ size = 2,
4122
+ textOverflow,
4123
+ weight,
4124
+ ...restProps
4125
+ } = props;
4126
+ let children = childrenProp;
4127
+ if (textOverflow === "ellipsis") {
4128
+ children = /* @__PURE__ */jsxRuntime.jsx(SpanWithTextOverflow, {
4129
+ children
4130
+ });
4131
+ } else {
4132
+ children = /* @__PURE__ */jsxRuntime.jsx("span", {
4133
+ children
4134
+ });
4135
+ }
4136
+ return /* @__PURE__ */jsxRuntime.jsx(Root$n, {
4137
+ "data-ui": "Label",
4138
+ ...restProps,
4139
+ $accent: accent,
4140
+ $align: useArrayProp(align),
4141
+ $muted: muted,
4142
+ $size: useArrayProp(size),
4143
+ $weight: weight,
4144
+ ref,
4145
+ children
4146
+ });
4147
+ });
5480
4148
  const key$7 = Symbol.for("@sanity/ui/context/boundaryElement");
5481
4149
  globalScope[key$7] = globalScope[key$7] || react.createContext(null);
5482
4150
  const BoundaryElementContext = globalScope[key$7];
@@ -6188,8 +4856,8 @@ var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", {
6188
4856
  }));
6189
4857
  var _a$l, _b$e, _c$8;
6190
4858
  const Root$j = styled__default.default.div(_a$l || (_a$l = __template$l(["\n position: absolute;\n pointer-events: none;\n width: ", "px;\n height: ", "px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n transform-origin: ", "px ", "px;\n }\n\n [data-placement^='top'] > & {\n bottom: -", "px;\n }\n\n [data-placement^='right'] > & {\n left: -", "px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -", "px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -", "px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n"])), DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH / 2, DEFAULT_POPOVER_ARROW_WIDTH / 2, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH);
6191
- const BorderPath = styled__default.default.path(_b$e || (_b$e = __template$l(["\n fill: var(--card-shadow-outline-color);\n"])));
6192
- const ShapePath = styled__default.default.path(_c$8 || (_c$8 = __template$l(["\n fill: var(--card-bg-color);\n"])));
4859
+ const BorderPath = styled__default.default.path(_b$e || (_b$e = __template$l(["\n fill: ", ";\n"])), cssVars.default["base-shadow-outline-color"]);
4860
+ const ShapePath = styled__default.default.path(_c$8 || (_c$8 = __template$l(["\n fill: ", ";\n"])), cssVars.mutable["bg-color"]);
6193
4861
  const PopoverArrow = react.forwardRef(function PopoverArrow2(props, ref) {
6194
4862
  return /* @__PURE__ */jsxRuntime.jsx(Root$j, {
6195
4863
  "data-ui": "Popover__arrow",
@@ -6242,6 +4910,7 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
6242
4910
  const {
6243
4911
  zIndex
6244
4912
  } = useLayer();
4913
+ const toneContext = useToneContext();
6245
4914
  const margins = react.useMemo(() => marginsProp || DEFAULT_POPOVER_MARGINS, [marginsProp]);
6246
4915
  const x = (xProp != null ? xProp : 0) + margins[3];
6247
4916
  const y = (yProp != null ? yProp : 0) + margins[0];
@@ -6267,14 +4936,16 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
6267
4936
  return /* @__PURE__ */jsxRuntime.jsxs(Root$i, {
6268
4937
  "data-ui": "Popover",
6269
4938
  ...restProps,
4939
+ "data-tone": tone,
6270
4940
  "data-placement": placement,
6271
4941
  radius,
6272
4942
  ref,
6273
4943
  scheme,
6274
4944
  shadow,
6275
4945
  sizing: "border",
4946
+ updateCssVars: true,
4947
+ tone: tone === "inherit" ? toneContext.tone : tone,
6276
4948
  style: rootStyle,
6277
- tone,
6278
4949
  children: [/* @__PURE__ */jsxRuntime.jsx(Flex, {
6279
4950
  "data-ui": "Popover__wrapper",
6280
4951
  direction: "column",
@@ -6384,13 +5055,13 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
6384
5055
  }));
6385
5056
  if (constrainSize || matchReferenceWidth) {
6386
5057
  ret.push(size({
6387
- apply(_ref21) {
5058
+ apply(_ref6) {
6388
5059
  let {
6389
5060
  availableWidth,
6390
5061
  availableHeight,
6391
5062
  elements,
6392
5063
  referenceWidth
6393
- } = _ref21;
5064
+ } = _ref6;
6394
5065
  referenceWidthRef.current = referenceWidth;
6395
5066
  const _currentWidth = widthRef.current;
6396
5067
  const _maxWidth = maxWidthRef.current;
@@ -6538,24 +5209,23 @@ function inputElementStyle(props) {
6538
5209
  const {
6539
5210
  focusRing
6540
5211
  } = input.radio;
6541
- const color = theme.sanity.color.input;
6542
5212
  const dist = (input.radio.size - input.radio.markSize) / 2;
6543
- return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
6544
- color: color.default.enabled.border,
5213
+ return styled.css(_b$d || (_b$d = __template$k(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), cssVars.default["bg-base"], focusRingBorderStyle({
5214
+ color: cssVars.default["border-base"],
6545
5215
  width: input.border.width
6546
- }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.bg2, focusRingStyle({
5216
+ }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), cssVars.default["text-secondary"], focusRingStyle({
6547
5217
  border: {
6548
5218
  width: input.border.width,
6549
- color: color.default.enabled.border
5219
+ color: cssVars.default["border-base"]
6550
5220
  },
6551
5221
  focusRing
6552
5222
  }), focusRingBorderStyle({
6553
- color: color.default.enabled.border,
5223
+ color: cssVars.default["border-base"],
6554
5224
  width: input.border.width
6555
- }), color.invalid.enabled.border, focusRingBorderStyle({
5225
+ }), cssVars.critical["border-base"], focusRingBorderStyle({
6556
5226
  width: input.border.width,
6557
- color: color.invalid.enabled.bg2
6558
- }), color.invalid.enabled.bg2, color.default.readOnly.border, color.default.readOnly.bg, color.default.readOnly.border, color.default.disabled.border, color.default.disabled.bg, color.default.disabled.border);
5227
+ color: cssVars.critical["text-secondary"]
5228
+ }), cssVars.critical["text-secondary"], cssVars.default["border-base"], cssVars.default["bg-tint"], cssVars.default["border-base"], cssVars.default["border-base"], cssVars.default["bg-tint"], cssVars.default["border-base"]);
6559
5229
  }
6560
5230
  const Root$h = styled__default.default.div(radioBaseStyle);
6561
5231
  const Input$4 = styled__default.default.input(inputElementStyle);
@@ -6611,24 +5281,23 @@ function inputColorStyle(props) {
6611
5281
  const {
6612
5282
  focusRing
6613
5283
  } = input.select;
6614
- const color = theme.sanity.color.input;
6615
- return styled.css(_c$7 || (_c$7 = __template$j(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
6616
- color: color.default.enabled.border,
5284
+ return styled.css(_c$7 || (_c$7 = __template$j(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), cssVars.default["bg-base"], cssVars.default["text-primary"], focusRingBorderStyle({
5285
+ color: cssVars.default["border-base"],
6617
5286
  width: input.border.width
6618
- }), color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
6619
- color: color.default.hovered.border,
5287
+ }), cssVars.default["bg-base-hover"], cssVars.default["text-primary"], focusRingBorderStyle({
5288
+ color: cssVars.default["border-base-hover"],
6620
5289
  width: input.border.width
6621
5290
  }), focusRingStyle({
6622
5291
  border: {
6623
5292
  width: input.border.width,
6624
- color: color.default.enabled.border
5293
+ color: cssVars.default["border-base"]
6625
5294
  },
6626
5295
  focusRing
6627
- }), color.default.readOnly.bg, color.default.readOnly.fg, focusRingBorderStyle({
6628
- color: color.default.readOnly.border,
5296
+ }), cssVars.default["bg-tint"], cssVars.default["text-primary"], focusRingBorderStyle({
5297
+ color: cssVars.default["border-base"],
6629
5298
  width: input.border.width
6630
- }), color.default.disabled.bg, color.default.disabled.fg, focusRingBorderStyle({
6631
- color: color.default.disabled.border,
5299
+ }), cssVars.default["bg-tint"], cssVars.default["text-primary"], focusRingBorderStyle({
5300
+ color: cssVars.default["border-base"],
6632
5301
  width: input.border.width
6633
5302
  }));
6634
5303
  }
@@ -6651,12 +5320,8 @@ function inputTextSizeStyle(props) {
6651
5320
  function inputStyle() {
6652
5321
  return [responsiveRadiusStyle, inputBaseStyle, inputColorStyle, inputTextSizeStyle, responsiveInputPaddingIconRightStyle];
6653
5322
  }
6654
- function iconBoxStyle(props) {
6655
- const {
6656
- theme
6657
- } = props;
6658
- const color = theme.sanity.color.input;
6659
- return styled.css(_d$5 || (_d$5 = __template$j(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ", ";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ", ";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ", ";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ", ";\n }\n "])), color.default.enabled.fg, color.default.hovered.fg, color.default.disabled.fg, color.default.readOnly.fg);
5323
+ function iconBoxStyle() {
5324
+ return styled.css(_d$5 || (_d$5 = __template$j(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n ", ": ", ";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n ", ": ", ";\n }\n }\n\n /* disabled */\n select:disabled + && {\n ", ": ", ";\n }\n\n /* read-only */\n select[data-read-only] + && {\n ", ": ", ";\n }\n "])), mutableCardVariables["fg-color"], cssVars.default["text-primary"], mutableCardVariables["fg-color"], cssVars.default["text-primary"], mutableCardVariables["fg-color"], cssVars.default["text-primary"], mutableCardVariables["fg-color"], cssVars.default["text-primary"]);
6660
5325
  }
6661
5326
  const selectStyle = {
6662
5327
  root: rootStyle,
@@ -6765,10 +5430,9 @@ function switchRepresentationStyles(props) {
6765
5430
  const {
6766
5431
  focusRing
6767
5432
  } = input.switch;
6768
- const color = theme.sanity.color.input;
6769
- return styled.css(_c$6 || (_c$6 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: var(--card-focus-ring-color);\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: var(--card-focus-ring-color);\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.default.enabled.border, color.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
5433
+ return styled.css(_c$6 || (_c$6 = __template$i(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), cssVars.default["border-base"], cssVars.default["bg-base"], rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
6770
5434
  focusRing
6771
- }), color.default.enabled.bg, color.default.hovered.border, color.default.hovered.bg, color.default.enabled.bg, color.default.disabled.border, color.default.disabled.bg, color.default.readOnly.border, color.default.readOnly.bg);
5435
+ }), cssVars.positive["border-accent"], cssVars.positive["bg-base"], cssVars.default["border-base"], cssVars.default["bg-base"], cssVars.positive["border-accent"], cssVars.positive["bg-base"], cssVars.default["border-base"], cssVars.default["bg-tint"], cssVars.default["border-base"], cssVars.default["bg-tint"]);
6772
5436
  }
6773
5437
  function switchTrackStyles(props) {
6774
5438
  const {
@@ -6857,34 +5521,30 @@ const TextArea = react.forwardRef(function TextArea2(props, forwardedRef) {
6857
5521
  padding = 3,
6858
5522
  radius = 2,
6859
5523
  weight,
5524
+ tone = "default",
6860
5525
  ...restProps
6861
5526
  } = props;
6862
5527
  const ref = useForwardedRef(forwardedRef);
6863
- const rootTheme = useRootTheme();
6864
5528
  useCustomValidity(ref, customValidity);
6865
5529
  return /* @__PURE__ */jsxRuntime.jsx(Root$d, {
6866
5530
  "data-ui": "TextArea",
6867
5531
  children: /* @__PURE__ */jsxRuntime.jsxs(InputRoot$1, {
6868
5532
  children: [/* @__PURE__ */jsxRuntime.jsx(Input$1, {
6869
5533
  "data-as": "textarea",
6870
- "data-scheme": rootTheme.scheme,
6871
- "data-tone": rootTheme.tone,
5534
+ "data-tone": tone,
6872
5535
  ...restProps,
6873
5536
  $fontSize: useArrayProp(fontSize),
6874
5537
  $padding: useArrayProp(padding),
6875
- $scheme: rootTheme.scheme,
6876
5538
  $space: useArrayProp(0),
6877
- $tone: rootTheme.tone,
5539
+ $tone: tone,
6878
5540
  $weight: weight,
6879
5541
  disabled,
6880
5542
  ref
6881
5543
  }), /* @__PURE__ */jsxRuntime.jsx(Presentation$1, {
6882
5544
  $radius: useArrayProp(radius),
6883
- $scheme: rootTheme.scheme,
6884
- $tone: rootTheme.tone,
5545
+ $tone: tone,
6885
5546
  "data-border": border ? "" : void 0,
6886
- "data-scheme": rootTheme.scheme,
6887
- "data-tone": rootTheme.tone
5547
+ "data-tone": tone
6888
5548
  })]
6889
5549
  })
6890
5550
  });
@@ -6936,10 +5596,12 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
6936
5596
  customValidity,
6937
5597
  type = "text",
6938
5598
  weight,
5599
+ tone: toneProp = "default",
6939
5600
  ...restProps
6940
5601
  } = props;
6941
5602
  const ref = useForwardedRef(forwardedRef);
6942
- const rootTheme = useRootTheme();
5603
+ const toneContext = useToneContext();
5604
+ const tone = toneProp === "default" ? toneContext.tone : toneProp;
6943
5605
  const fontSize = useArrayProp(fontSizeProp);
6944
5606
  const padding = useArrayProp(paddingProp);
6945
5607
  const radius = useArrayProp(radiusProp);
@@ -6976,11 +5638,9 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
6976
5638
  $hasPrefix,
6977
5639
  $hasSuffix,
6978
5640
  $radius: radius,
6979
- $scheme: rootTheme.scheme,
6980
- $tone: rootTheme.tone,
5641
+ $tone: tone,
6981
5642
  "data-border": border ? "" : void 0,
6982
- "data-scheme": rootTheme.scheme,
6983
- "data-tone": rootTheme.tone,
5643
+ "data-tone": tone,
6984
5644
  children: [icon && /* @__PURE__ */jsxRuntime.jsx(LeftBox, {
6985
5645
  padding,
6986
5646
  children: /* @__PURE__ */jsxRuntime.jsxs(Text, {
@@ -6994,7 +5654,7 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
6994
5654
  children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
6995
5655
  })
6996
5656
  })]
6997
- }), [border, fontSize, icon, iconRight, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]);
5657
+ }), [border, fontSize, icon, iconRight, padding, radius, $hasClearButton, $hasPrefix, $hasSuffix, tone]);
6998
5658
  const clearButtonBoxPadding = react.useMemo(() => padding.map(v => {
6999
5659
  if (v === 0) return 0;
7000
5660
  if (v === 1) return 1;
@@ -7039,20 +5699,18 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
7039
5699
  }), [radius, suffix]);
7040
5700
  return /* @__PURE__ */jsxRuntime.jsxs(Root$c, {
7041
5701
  "data-ui": "TextInput",
7042
- tone: rootTheme.tone,
5702
+ tone,
7043
5703
  children: [prefixNode, /* @__PURE__ */jsxRuntime.jsxs(InputRoot, {
7044
5704
  children: [/* @__PURE__ */jsxRuntime.jsx(Input, {
7045
5705
  "data-as": "input",
7046
- "data-scheme": rootTheme.scheme,
7047
- "data-tone": rootTheme.tone,
5706
+ "data-tone": tone,
7048
5707
  ...restProps,
7049
5708
  $fontSize: fontSize,
7050
5709
  $iconLeft: $hasIcon,
7051
5710
  $iconRight: $hasIconRight || $hasClearButton,
7052
5711
  $padding: padding,
7053
- $scheme: rootTheme.scheme,
7054
5712
  $space: space,
7055
- $tone: rootTheme.tone,
5713
+ $tone: tone,
7056
5714
  $weight: weight,
7057
5715
  disabled,
7058
5716
  readOnly,
@@ -7099,8 +5757,8 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
7099
5757
  }));
7100
5758
  var _a$f, _b$9, _c$4;
7101
5759
  const Root$b = styled__default.default.div(_a$f || (_a$f = __template$f(["\n position: absolute;\n pointer-events: none;\n width: 15px;\n height: 15px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n transform-origin: 7.5px 7.5px;\n }\n\n /* position: absolute;\n width: 15px;\n height: 15px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n &:not([hidden]) {\n display: block;\n }\n transform-origin: 7.5px 7.5px;\n } */\n\n [data-placement^='top'] > & {\n bottom: -27px;\n }\n\n [data-placement^='right'] > & {\n left: -27px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -27px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -27px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n"])));
7102
- const Border = styled__default.default.path(_b$9 || (_b$9 = __template$f(["\n fill: var(--card-shadow-outline-color);\n"])));
7103
- const Shape = styled__default.default.path(_c$4 || (_c$4 = __template$f(["\n fill: var(--card-bg-color);\n"])));
5760
+ const Border = styled__default.default.path(_b$9 || (_b$9 = __template$f(["\n fill: ", ";\n"])), cssVars.default["base-shadow-outline-color"]);
5761
+ const Shape = styled__default.default.path(_c$4 || (_c$4 = __template$f(["\n fill: ", ";\n"])), cssVars.mutable["bg-color"]);
7104
5762
  const TooltipArrow = react.forwardRef(function TooltipArrow2(props, ref) {
7105
5763
  const {
7106
5764
  ...restProps
@@ -7199,12 +5857,12 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
7199
5857
  mainAxis: 3
7200
5858
  }));
7201
5859
  ret.push(reactDom$1.size({
7202
- apply(_ref22) {
5860
+ apply(_ref7) {
7203
5861
  let {
7204
5862
  availableWidth,
7205
5863
  availableHeight,
7206
5864
  elements
7207
- } = _ref22;
5865
+ } = _ref7;
7208
5866
  Object.assign(elements.floating.style, {
7209
5867
  maxWidth: "".concat(availableWidth - 4 * 2, "px"),
7210
5868
  // the padding is `4px`
@@ -7510,10 +6168,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
7510
6168
  query,
7511
6169
  value
7512
6170
  } = state;
7513
- const defaultRenderOption = react.useCallback(_ref23 => {
6171
+ const defaultRenderOption = react.useCallback(_ref8 => {
7514
6172
  let {
7515
6173
  value: value2
7516
- } = _ref23;
6174
+ } = _ref8;
7517
6175
  return /* @__PURE__ */jsxRuntime.jsx(Card, {
7518
6176
  "data-as": "button",
7519
6177
  padding: paddingProp,
@@ -7967,11 +6625,7 @@ const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
7967
6625
  });
7968
6626
  });
7969
6627
  const BORDER_OFFSET_X = 12;
7970
- function dialogStyle(_ref24) {
7971
- let {
7972
- theme
7973
- } = _ref24;
7974
- const color = theme.sanity.color.base;
6628
+ function dialogStyle() {
7975
6629
  return {
7976
6630
  "&:not([hidden])": {
7977
6631
  display: "flex"
@@ -7983,7 +6637,7 @@ function dialogStyle(_ref24) {
7983
6637
  alignItems: "center",
7984
6638
  justifyContent: "center",
7985
6639
  outline: "none",
7986
- background: color.shadow.umbra
6640
+ background: cssVars.default["base-shadow-umbra-color"]
7987
6641
  };
7988
6642
  }
7989
6643
  function responsiveDialogPositionStyle(props) {
@@ -8021,9 +6675,9 @@ const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyl
8021
6675
  const DialogContainer = styled__default.default(Container)(_a$b || (_a$b = __template$b(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n height: 100%;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"])));
8022
6676
  const DialogCardRoot = styled__default.default(Card)(_b$6 || (_b$6 = __template$b(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n min-height: 0;\n max-height: 100%;\n overflow: hidden;\n overflow: clip;\n"])));
8023
6677
  const DialogLayout = styled__default.default(Flex)(_c$2 || (_c$2 = __template$b(["\n flex: 1;\n min-height: 0;\n width: 100%;\n"])));
8024
- const DialogHeader = styled__default.default(Card)(_d$1 || (_d$1 = __template$b(["\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: ", "px;\n right: ", "px;\n bottom: -1px;\n border-bottom: 1px solid var(--card-border-color);\n width: auto;\n opacity: ", ";\n transition: opacity 200ms ease-in;\n }\n"])), BORDER_OFFSET_X, BORDER_OFFSET_X, props => props.$isContentScrollable && props.$hasScrolledFromTop ? 1 : 0);
6678
+ const DialogHeader = styled__default.default(Card)(_d$1 || (_d$1 = __template$b(["\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: ", "px;\n right: ", "px;\n bottom: -1px;\n border-bottom: 1px solid ", ";\n width: auto;\n opacity: ", ";\n transition: opacity 200ms ease-in;\n }\n"])), BORDER_OFFSET_X, BORDER_OFFSET_X, cssVars.default["border-base"], props => props.$isContentScrollable && props.$hasScrolledFromTop ? 1 : 0);
8025
6679
  const DialogContent = styled__default.default(Box)(_e || (_e = __template$b(["\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n"])));
8026
- const DialogFooter = styled__default.default(Box)(_f || (_f = __template$b(["\n position: relative;\n z-index: 3;\n\n &:before {\n content: '';\n display: block;\n position: absolute;\n left: ", "px;\n right: ", "px;\n top: -1px;\n border-top: 1px solid var(--card-border-color);\n width: auto;\n opacity: ", ";\n transition: opacity 200ms ease-in;\n }\n"])), BORDER_OFFSET_X, BORDER_OFFSET_X, props => props.$isContentScrollable && !props.$hasScrolledToBottom ? 1 : 0);
6680
+ const DialogFooter = styled__default.default(Box)(_f || (_f = __template$b(["\n position: relative;\n z-index: 3;\n\n &:before {\n content: '';\n display: block;\n position: absolute;\n left: ", "px;\n right: ", "px;\n top: -1px;\n border-top: 1px solid ", ";\n width: auto;\n opacity: ", ";\n transition: opacity 200ms ease-in;\n }\n"])), BORDER_OFFSET_X, BORDER_OFFSET_X, cssVars.default["border-base"], props => props.$isContentScrollable && !props.$hasScrolledToBottom ? 1 : 0);
8027
6681
  const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
8028
6682
  var _a2;
8029
6683
  const {
@@ -8765,7 +7419,7 @@ var __template$8 = (cooked, raw) => __freeze$8(__defProp$8(cooked, "raw", {
8765
7419
  value: __freeze$8(raw || cooked.slice())
8766
7420
  }));
8767
7421
  var _a$8;
8768
- const MenuDivider = styled__default.default.hr(_a$8 || (_a$8 = __template$8(["\n height: 1px;\n border: 0;\n background: var(--card-hairline-soft-color);\n margin: 0;\n"])));
7422
+ const MenuDivider = styled__default.default.hr(_a$8 || (_a$8 = __template$8(["\n height: 1px;\n border: 0;\n background: ", ";\n margin: 0;\n"])), cssVars.default["border-base"]);
8769
7423
  var __freeze$7 = Object.freeze;
8770
7424
  var __defProp$7 = Object.defineProperty;
8771
7425
  var __template$7 = (cooked, raw) => __freeze$7(__defProp$7(cooked, "raw", {
@@ -8778,16 +7432,11 @@ function selectableBaseStyle() {
8778
7432
  function selectableColorStyle(props) {
8779
7433
  var _a2, _b2;
8780
7434
  const {
7435
+ theme,
8781
7436
  $tone,
8782
- theme
7437
+ $scheme
8783
7438
  } = props;
8784
- const {
8785
- base,
8786
- muted,
8787
- selectable
8788
- } = theme.sanity.color;
8789
- const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
8790
- return styled.css(_b$4 || (_b$4 = __template$7(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
7439
+ return styled.css(_b$4 || (_b$4 = __template$7(["\n ", "\n ", "\n\n background-color: ", ";\n color: ", ";\n outline: none;\n\n /* &:is(button) - Looks like a button in default mode */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), $tone !== "default" && createCssVars($scheme, theme.sanity.color.tones, $tone), _selectableVarStyle($tone), cssVars.mutable["bg-color"], cssVars[$tone]["text-secondary"], _selectableVarStyleDisabled(), _colorVarStyleHover(), _colorVarStyleHover(), _colorVarStyleHover(), _colorVarStyleHover(), _selectableVarStyleDisabled(), _colorVarStyleHover(), _colorVarStyleHover(), _colorVarStyleHover(), _colorVarStyleHover(), (_b2 = (_a2 = theme.sanity.styles) == null ? void 0 : _a2.card) == null ? void 0 : _b2.root);
8791
7440
  }
8792
7441
  const Selectable = styled__default.default(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
8793
7442
  function useMenu() {
@@ -8804,7 +7453,7 @@ function MenuGroup(props) {
8804
7453
  const {
8805
7454
  as = "button",
8806
7455
  children,
8807
- fontSize,
7456
+ fontSize = 1,
8808
7457
  icon,
8809
7458
  onClick,
8810
7459
  padding = 3,
@@ -8815,6 +7464,9 @@ function MenuGroup(props) {
8815
7464
  tone = "default",
8816
7465
  ...restProps
8817
7466
  } = props;
7467
+ const {
7468
+ scheme
7469
+ } = useToneContext();
8818
7470
  const menu = useMenu();
8819
7471
  const {
8820
7472
  activeElement,
@@ -8904,34 +7556,31 @@ function MenuGroup(props) {
8904
7556
  "data-selected": !withinMenu && active ? "" : void 0,
8905
7557
  $radius: useArrayProp(radius),
8906
7558
  $tone: tone,
7559
+ $scheme: scheme,
8907
7560
  onClick: handleClick,
8908
7561
  onKeyDown: handleKeyDown,
8909
7562
  onMouseEnter: handleMouseEnter,
8910
7563
  ref: setRootElement,
8911
7564
  tabIndex: -1,
8912
7565
  type: as === "button" ? "button" : void 0,
8913
- children: /* @__PURE__ */jsxRuntime.jsx(Box, {
7566
+ children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
7567
+ gap: space,
8914
7568
  padding,
8915
- children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
8916
- children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
7569
+ children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
7570
+ size: fontSize,
7571
+ children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
7572
+ }), /* @__PURE__ */jsxRuntime.jsx(Box, {
7573
+ flex: 1,
7574
+ children: /* @__PURE__ */jsxRuntime.jsx(Text, {
8917
7575
  size: fontSize,
8918
- children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
8919
- }), /* @__PURE__ */jsxRuntime.jsx(Box, {
8920
- flex: 1,
8921
- marginLeft: icon ? space : void 0,
8922
- children: /* @__PURE__ */jsxRuntime.jsx(Text, {
8923
- size: fontSize,
8924
- textOverflow: "ellipsis",
8925
- children: text
8926
- })
8927
- }), /* @__PURE__ */jsxRuntime.jsx(Box, {
8928
- marginLeft: space,
8929
- children: /* @__PURE__ */jsxRuntime.jsx(Text, {
8930
- size: fontSize,
8931
- children: /* @__PURE__ */jsxRuntime.jsx(icons.ChevronRightIcon, {})
8932
- })
8933
- })]
8934
- })
7576
+ textOverflow: "ellipsis",
7577
+ weight: "medium",
7578
+ children: text
7579
+ })
7580
+ }), /* @__PURE__ */jsxRuntime.jsx(Text, {
7581
+ size: fontSize,
7582
+ children: /* @__PURE__ */jsxRuntime.jsx(icons.ChevronRightIcon, {})
7583
+ })]
8935
7584
  })
8936
7585
  })
8937
7586
  });
@@ -8961,6 +7610,9 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
8961
7610
  tone = "default",
8962
7611
  ...restProps
8963
7612
  } = props;
7613
+ const {
7614
+ scheme
7615
+ } = useToneContext();
8964
7616
  const menu = useMenu();
8965
7617
  const {
8966
7618
  activeElement,
@@ -9001,7 +7653,8 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
9001
7653
  forwardedAs: as,
9002
7654
  $radius: useArrayProp(radius),
9003
7655
  $padding: useArrayProp(0),
9004
- $tone: tone,
7656
+ $tone: disabled ? "default" : tone,
7657
+ $scheme: scheme,
9005
7658
  disabled,
9006
7659
  onClick: handleClick,
9007
7660
  onMouseEnter: onItemMouseEnter,
@@ -9010,38 +7663,33 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
9010
7663
  role: "menuitem",
9011
7664
  tabIndex: -1,
9012
7665
  type: as === "button" ? "button" : void 0,
9013
- children: [(icon || text || iconRight) && /* @__PURE__ */jsxRuntime.jsx(Box, {
7666
+ children: [(icon || text || iconRight) && /* @__PURE__ */jsxRuntime.jsxs(Flex, {
9014
7667
  as: "span",
7668
+ gap: space,
7669
+ align: "center",
9015
7670
  ...paddingProps,
9016
- children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
9017
- as: "span",
9018
- children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
9019
- size: fontSize,
9020
- children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
9021
- }), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
9022
- flex: 1,
9023
- marginLeft: icon ? space : void 0,
9024
- marginRight: iconRight ? space : void 0,
9025
- children: /* @__PURE__ */jsxRuntime.jsx(Text, {
9026
- size: fontSize,
9027
- textOverflow: "ellipsis",
9028
- children: text
9029
- })
9030
- }), hotkeys && /* @__PURE__ */jsxRuntime.jsx(Box, {
9031
- marginLeft: space,
9032
- style: {
9033
- marginTop: -4,
9034
- marginBottom: -4
9035
- },
9036
- children: /* @__PURE__ */jsxRuntime.jsx(Hotkeys, {
9037
- fontSize,
9038
- keys: hotkeys
9039
- })
9040
- }), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
7671
+ children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
7672
+ size: fontSize,
7673
+ children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
7674
+ }), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
7675
+ flex: 1,
7676
+ children: /* @__PURE__ */jsxRuntime.jsx(Text, {
9041
7677
  size: fontSize,
9042
- children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
9043
- })]
9044
- })
7678
+ textOverflow: "ellipsis",
7679
+ weight: "medium",
7680
+ children: text
7681
+ })
7682
+ }), hotkeys && /* @__PURE__ */jsxRuntime.jsx(Hotkeys, {
7683
+ fontSize,
7684
+ keys: hotkeys,
7685
+ style: {
7686
+ marginTop: -4,
7687
+ marginBottom: -4
7688
+ }
7689
+ }), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
7690
+ size: fontSize,
7691
+ children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
7692
+ })]
9045
7693
  }), children && /* @__PURE__ */jsxRuntime.jsx(Box, {
9046
7694
  as: "span",
9047
7695
  ...paddingProps,
@@ -9056,18 +7704,18 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
9056
7704
  }));
9057
7705
  var _a$6, _b$3, _c$1, _d;
9058
7706
  const keyframe = styled.keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
9059
- const animation = styled.css(_b$3 || (_b$3 = __template$6(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
9060
- const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref25 => {
7707
+ const animation = styled.css(_b$3 || (_b$3 = __template$6(["\n background-image: linear-gradient(\n to right,\n ", ",\n ", ",\n ", ",\n ", ",\n ", "\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), cssVars.default["skeleton-from"], cssVars.default["skeleton-to"], cssVars.default["skeleton-from"], cssVars.default["skeleton-from"], cssVars.default["skeleton-from"], keyframe);
7708
+ const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: ", ";\n }\n"])), _ref9 => {
9061
7709
  let {
9062
7710
  $visible
9063
- } = _ref25;
7711
+ } = _ref9;
9064
7712
  return $visible ? 1 : 0;
9065
- }, _ref26 => {
7713
+ }, _ref10 => {
9066
7714
  let {
9067
7715
  $animated
9068
- } = _ref26;
9069
- return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
9070
- });
7716
+ } = _ref10;
7717
+ return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: ", ";\n "])), cssVars.default["skeleton-from"]);
7718
+ }, cssVars.default["skeleton-from"]);
9071
7719
  const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
9072
7720
  const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
9073
7721
  const {
@@ -9096,12 +7744,12 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
9096
7744
  ref
9097
7745
  });
9098
7746
  });
9099
- const Root$3 = styled__default.default(Skeleton)(_ref27 => {
7747
+ const Root$3 = styled__default.default(Skeleton)(_ref11 => {
9100
7748
  let {
9101
7749
  $size,
9102
7750
  $style,
9103
7751
  theme
9104
- } = _ref27;
7752
+ } = _ref11;
9105
7753
  const {
9106
7754
  media
9107
7755
  } = theme.sanity;
@@ -9449,12 +8097,12 @@ function ToastProvider(props) {
9449
8097
  paddingY,
9450
8098
  children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
9451
8099
  initial: false,
9452
- children: state.map(_ref28 => {
8100
+ children: state.map(_ref12 => {
9453
8101
  let {
9454
8102
  dismiss,
9455
8103
  id,
9456
8104
  params
9457
- } = _ref28;
8105
+ } = _ref12;
9458
8106
  return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
9459
8107
  animate: {
9460
8108
  opacity: 1,
@@ -9747,18 +8395,8 @@ var _a$1, _b, _c;
9747
8395
  function treeItemRootStyle() {
9748
8396
  return styled.css(_a$1 || (_a$1 = __template$1(["\n &[role='none'] > [role='treeitem'] {\n outline: none;\n cursor: default;\n border-radius: 3px;\n\n &:focus {\n position: relative;\n }\n }\n\n &[role='treeitem'] {\n outline: none;\n\n & > div {\n cursor: default;\n border-radius: 3px;\n }\n\n &:focus > div {\n position: relative;\n }\n }\n "])));
9749
8397
  }
9750
- function treeItemRootColorStyle(props) {
9751
- const {
9752
- theme
9753
- } = props;
9754
- const $tone = "default";
9755
- const {
9756
- base,
9757
- muted,
9758
- selectable
9759
- } = theme.sanity.color;
9760
- const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
9761
- return styled.css(_b || (_b = __template$1(['\n /* <div role="none"><a data-ui="TreeItem__box" role="treeitem" tabIndex="0"></div> */\n &[role=\'none\'] {\n & > [role=\'treeitem\'] {\n ', "\n\n background-color: var(--card-bg-color);\n color: var(--treeitem-fg-color);\n }\n\n &[data-selected] > [role='treeitem'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) > [role='treeitem']:not(:focus):hover {\n ", "\n }\n\n & > [role='treeitem']:focus {\n ", '\n }\n }\n }\n\n /* <div role="treeitem" tabIndex="0"><div data-ui="TreeItem__box"></div> */\n &[role=\'treeitem\'] {\n & > [data-ui=\'TreeItem__box\'] {\n ', "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n }\n\n &[data-selected] > [data-ui='TreeItem__box'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {\n ", "\n }\n\n &:focus > [data-ui='TreeItem__box'] {\n ", "\n }\n }\n }\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.selected));
8398
+ function treeItemRootColorStyle() {
8399
+ return styled.css(_b || (_b = __template$1(['\n /* <div role="none"><a data-ui="TreeItem__box" role="treeitem" tabIndex="0"></div> */\n &[role=\'none\'] {\n & > [role=\'treeitem\'] {\n ', "\n\n background-color:", ";\n color: var(--treeitem-fg-color);\n }\n\n &[data-selected] > [role='treeitem'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) > [role='treeitem']:not(:focus):hover {\n ", "\n }\n\n & > [role='treeitem']:focus {\n ", '\n }\n }\n }\n\n /* <div role="treeitem" tabIndex="0"><div data-ui="TreeItem__box"></div> */\n &[role=\'treeitem\'] {\n & > [data-ui=\'TreeItem__box\'] {\n ', "\n background-color: ", ";\n color: ", ";\n }\n\n &[data-selected] > [data-ui='TreeItem__box'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {\n ", "\n }\n\n &:focus > [data-ui='TreeItem__box'] {\n ", "\n }\n }\n }\n "])), cardVariables, cssVars.mutable["bg-color"], _colorVarStyleActive(), _colorVarStyleHover(), _colorVarStyleSelected(), cardVariables, cssVars.mutable["bg-color"], cssVars.mutable["fg-color"], _colorVarStyleActive(), _colorVarStyleHover(), _colorVarStyleSelected());
9762
8400
  }
9763
8401
  function treeItemBoxStyle(props) {
9764
8402
  const {
@@ -10029,7 +8667,8 @@ exports._raf2 = _raf2;
10029
8667
  exports._responsive = _responsive;
10030
8668
  exports.attemptFocus = attemptFocus;
10031
8669
  exports.containsOrEqualsElement = containsOrEqualsElement;
10032
- exports.createColorTheme = createColorTheme;
8670
+ exports.createCssVars = createCssVars;
8671
+ exports.cssVars = cssVars;
10033
8672
  exports.focusFirstDescendant = focusFirstDescendant;
10034
8673
  exports.focusLastDescendant = focusLastDescendant;
10035
8674
  exports.hexToRgb = hexToRgb;
@@ -10052,6 +8691,7 @@ exports.responsiveTextFont = responsiveTextFont;
10052
8691
  exports.rgbToHex = rgbToHex;
10053
8692
  exports.rgbToHsl = rgbToHsl;
10054
8693
  exports.rgba = rgba;
8694
+ exports.rgbaToRGBA = rgbaToRGBA;
10055
8695
  exports.screen = screen$1;
10056
8696
  exports.studioTheme = studioTheme;
10057
8697
  exports.useArrayProp = useArrayProp;