@sanity/ui 2.0.0-beta.2 → 2.0.0-beta.21

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 (91) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +6 -3
  3. package/dist/index.cjs.mjs +11 -36
  4. package/dist/index.d.ts +247 -267
  5. package/dist/index.esm.js +477 -326
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +486 -539
  8. package/dist/index.js.map +1 -1
  9. package/dist/theme.cjs.mjs +1 -1
  10. package/dist/theme.d.ts +87 -115
  11. package/dist/theme.esm.js +348 -290
  12. package/dist/theme.esm.js.map +1 -1
  13. package/dist/theme.js +348 -290
  14. package/dist/theme.js.map +1 -1
  15. package/package.json +6 -3
  16. package/src/core/__workshop__/fontsPlugin.tsx +48 -8
  17. package/src/core/_compat.ts +236 -87
  18. package/src/core/components/dialog/dialog.tsx +1 -1
  19. package/src/core/components/dialog/styles.ts +2 -2
  20. package/src/core/components/menu/__workshop__/selectedItem.tsx +7 -2
  21. package/src/core/components/menu/menuButton.tsx +12 -1
  22. package/src/core/components/toast/toast.tsx +17 -2
  23. package/src/core/components/toast/toastProvider.tsx +20 -3
  24. package/src/core/constants.ts +37 -0
  25. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +6 -3
  26. package/src/core/middleware/origin.ts +47 -0
  27. package/src/core/primitives/badge/badge.tsx +1 -3
  28. package/src/core/primitives/button/button.tsx +9 -11
  29. package/src/core/primitives/heading/styles.ts +4 -0
  30. package/src/core/primitives/kbd/kbd.tsx +2 -0
  31. package/src/core/primitives/popover/popover.tsx +67 -13
  32. package/src/core/primitives/popover/popoverCard.tsx +31 -15
  33. package/src/core/primitives/select/select.tsx +1 -1
  34. package/src/core/primitives/switch/styles.ts +6 -1
  35. package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
  36. package/src/core/primitives/textInput/__workshop__/states.tsx +10 -2
  37. package/src/core/primitives/tooltip/tooltip.tsx +46 -56
  38. package/src/core/primitives/tooltip/tooltipCard.tsx +110 -0
  39. package/src/core/styles/card/_cardColorStyle.ts +2 -0
  40. package/src/core/styles/input/textInputStyle.ts +33 -2
  41. package/src/core/styles/margin/marginsStyle.test.ts +2 -2
  42. package/src/core/styles/padding/paddingStyle.test.ts +2 -2
  43. package/src/core/theme/__workshop__/build/Root.tsx +20 -3
  44. package/src/core/theme/__workshop__/build/story.tsx +16 -10
  45. package/src/core/theme/__workshop__/canvas.tsx +7 -7
  46. package/src/core/theme/__workshop__/debug/story.tsx +196 -0
  47. package/src/core/theme/__workshop__/index.ts +5 -0
  48. package/src/core/theme/theme.test.tsx +2 -2
  49. package/src/core/types/button.ts +1 -2
  50. package/src/core/{primitives/tooltip → utils/conditionalWrapper}/conditionalWrapper.tsx +3 -0
  51. package/src/core/utils/conditionalWrapper/index.ts +1 -0
  52. package/src/core/utils/index.ts +1 -0
  53. package/src/theme/build/_deprecated/color/factory.ts +3 -3
  54. package/src/theme/build/buildColorTheme.test.ts +2 -2
  55. package/src/theme/build/buildColorTheme.ts +16 -16
  56. package/src/theme/build/colorToken/colorToken.ts +19 -0
  57. package/src/theme/build/colorToken/compileColorToken.ts +21 -0
  58. package/src/theme/build/colorToken/index.ts +2 -0
  59. package/src/theme/build/colorToken/types.ts +6 -0
  60. package/src/theme/build/renderColorTheme.ts +14 -15
  61. package/src/theme/build/renderColorValue.ts +9 -2
  62. package/src/theme/config/system.ts +12 -10
  63. package/src/theme/config/tokens/color/types.ts +12 -1
  64. package/src/theme/config/tokens/parseTokenKey.ts +1 -0
  65. package/src/theme/config/tokens/parseTokenValue.test.ts +13 -16
  66. package/src/theme/config/tokens/parseTokenValue.ts +45 -14
  67. package/src/theme/config/tokens/types.ts +3 -2
  68. package/src/theme/defaults/colorTokens.ts +279 -253
  69. package/src/theme/defaults/config.ts +2 -2
  70. package/src/theme/getScopedTheme.ts +1 -0
  71. package/src/theme/index.ts +0 -7
  72. package/src/theme/system/color/_constants.ts +5 -2
  73. package/src/theme/system/color/_system.ts +2 -1
  74. package/src/theme/system/color/avatar.ts +2 -12
  75. package/src/theme/system/color/button.ts +4 -20
  76. package/src/theme/system/color/input.ts +3 -11
  77. package/src/theme/system/color/selectable.ts +3 -14
  78. package/src/theme/system/shadow.ts +0 -6
  79. package/src/theme/system/styles.ts +0 -6
  80. package/src/theme/system/theme.ts +11 -1
  81. package/src/theme/system/v0/avatar.ts +1 -1
  82. package/src/theme/system/v0/color/button.ts +4 -4
  83. package/src/theme/system/v0/color/card.ts +2 -2
  84. package/src/theme/system/v0/color/color.ts +0 -1
  85. package/src/theme/system/v0/color/input.ts +3 -3
  86. package/src/theme/system/v0/color/muted.ts +2 -2
  87. package/src/theme/system/v0/color/solid.ts +2 -2
  88. package/src/theme/versioning/getTheme_v2.ts +2 -1
  89. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  90. package/src/theme/versioning/v2_v0.ts +3 -2
  91. package/src/theme/build/colorToken.ts +0 -39
package/dist/index.js CHANGED
@@ -11,8 +11,8 @@ var styled = require('styled-components');
11
11
  var icons = require('@sanity/icons');
12
12
  var Refractor = require('react-refractor');
13
13
  var reactDom$1 = require('@floating-ui/react-dom');
14
- var reactDom = require('react-dom');
15
14
  var framerMotion = require('framer-motion');
15
+ var reactDom = require('react-dom');
16
16
  function _interopDefaultCompat(e) {
17
17
  return e && typeof e === 'object' && 'default' in e ? e : {
18
18
  default: e
@@ -21,8 +21,42 @@ function _interopDefaultCompat(e) {
21
21
  var ReactIs__default = /*#__PURE__*/_interopDefaultCompat(ReactIs);
22
22
  var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
23
23
  var Refractor__default = /*#__PURE__*/_interopDefaultCompat(Refractor);
24
+ const createColorTheme = theme.createColorTheme;
25
+ const hexToRgb = theme.hexToRgb;
26
+ const hslToRgb = theme.hslToRgb;
27
+ const multiply = theme.multiply;
28
+ const parseColor = theme.parseColor;
29
+ const rgbToHex = theme.rgbToHex;
30
+ const rgbToHsl = theme.rgbToHsl;
31
+ const rgba = theme.rgba;
32
+ const screen = theme.screen;
33
+ const studioTheme = theme.buildTheme();
24
34
  const EMPTY_ARRAY = [];
25
35
  const EMPTY_RECORD = {};
36
+ const POPOVER_MOTION_CONTENT_OPACITY_PROPERTY = "--motion-content-opacity";
37
+ const POPOVER_MOTION_PROPS = {
38
+ initial: {
39
+ opacity: 0.5,
40
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
41
+ scale: 0.97,
42
+ willChange: "transform"
43
+ },
44
+ animate: {
45
+ opacity: [null, 1, 1],
46
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [null, null, 1],
47
+ scale: 1
48
+ },
49
+ exit: {
50
+ // @ts-expect-error -- passing null a second time is valid: https://github.com/framer/motion/blob/b9ce4c42914c3916ea523609c5b032dfc72718bb/packages/framer-motion/src/animation/utils/keyframes.ts#L34C22-L34C22
51
+ opacity: [null, null, 0],
52
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [null, 0, 0],
53
+ scale: 0.97
54
+ },
55
+ transition: {
56
+ duration: 0.4,
57
+ type: "spring"
58
+ }
59
+ };
26
60
  function _fillCSSObject(keys, value) {
27
61
  return keys.reduce((style, key) => {
28
62
  style[key] = value;
@@ -1481,13 +1515,13 @@ function responsiveInputPaddingIconRightStyle(props) {
1481
1515
  $iconRight: true
1482
1516
  });
1483
1517
  }
1484
- var __freeze$D = Object.freeze;
1485
- var __defProp$E = Object.defineProperty;
1486
- var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", {
1487
- value: __freeze$D(raw || cooked.slice())
1518
+ var __freeze$F = Object.freeze;
1519
+ var __defProp$G = Object.defineProperty;
1520
+ var __template$F = (cooked, raw) => __freeze$F(__defProp$G(cooked, "raw", {
1521
+ value: __freeze$F(raw || cooked.slice())
1488
1522
  }));
1489
- var _a$D, _b$n, _c$c;
1490
- const ROOT_STYLE = styled.css(_a$D || (_a$D = __template$D(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));
1523
+ var _a$F, _b$n, _c$c;
1524
+ const ROOT_STYLE = styled.css(_a$F || (_a$F = __template$F(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));
1491
1525
  function textInputRootStyle() {
1492
1526
  return ROOT_STYLE;
1493
1527
  }
@@ -1501,7 +1535,7 @@ function textInputBaseStyle(props) {
1501
1535
  color,
1502
1536
  font
1503
1537
  } = theme.getTheme_v2(props.theme);
1504
- return styled.css(_b$n || (_b$n = __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.text.family, $weight && font.text.weights[$weight] || font.text.weights.regular, $scheme, $tone, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.disabled.fg, color.input.default.disabled.placeholder, color.input.invalid.enabled.fg, color.input.invalid.enabled.placeholder, color.input.default.readOnly.fg, color.input.default.readOnly.placeholder);
1538
+ return styled.css(_b$n || (_b$n = __template$F(["\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.text.family, $weight && font.text.weights[$weight] || font.text.weights.regular, $scheme, $tone, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.disabled.fg, color.input.default.disabled.placeholder, color.input.invalid.enabled.fg, color.input.invalid.enabled.placeholder, color.input.default.readOnly.fg, color.input.default.readOnly.placeholder);
1505
1539
  }
1506
1540
  function textInputFontSizeStyle(props) {
1507
1541
  const {
@@ -1528,7 +1562,7 @@ function textInputRepresentationStyle(props) {
1528
1562
  color,
1529
1563
  input
1530
1564
  } = theme.getTheme_v2(props.theme);
1531
- return styled.css(_c$c || (_c$c = __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.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
1565
+ return styled.css(_c$c || (_c$c = __template$F(["\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 *:not(:invalid):disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --card-icon-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --card-icon-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n *:invalid: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 *:invalid:not(:disabled):not(:read-only):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 *:invalid:not(:disabled):not(:read-only):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.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
1532
1566
  color: color.input.default.enabled.border,
1533
1567
  width: input.border.width
1534
1568
  }), color.input.invalid.enabled.bg, color.input.invalid.enabled.fg, focusRingBorderStyle({
@@ -1542,12 +1576,18 @@ function textInputRepresentationStyle(props) {
1542
1576
  focusRing: input.text.focusRing
1543
1577
  }), $unstableDisableFocusRing ? void 0 : focusRingStyle({
1544
1578
  focusRing: input.text.focusRing
1545
- }), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
1579
+ }), color.input.default.disabled.bg, color.input.default.disabled.fg, color.input.default.disabled.fg, focusRingBorderStyle({
1546
1580
  color: color.input.default.disabled.border,
1547
1581
  width: input.border.width
1548
- }), color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
1582
+ }), color.input.invalid.disabled.bg, color.input.invalid.disabled.fg, color.input.invalid.disabled.fg, focusRingBorderStyle({
1583
+ color: color.input.invalid.disabled.border,
1584
+ width: input.border.width
1585
+ }), color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.invalid.readOnly.bg, color.input.invalid.readOnly.fg, color.input.default.hovered.bg, color.input.default.hovered.fg, color.input.invalid.hovered.bg, color.input.invalid.hovered.fg, focusRingBorderStyle({
1549
1586
  color: color.input.default.hovered.border,
1550
1587
  width: input.border.width
1588
+ }), focusRingBorderStyle({
1589
+ color: color.input.invalid.hovered.border,
1590
+ width: input.border.width
1551
1591
  }));
1552
1592
  }
1553
1593
  function responsiveMarginStyle(props) {
@@ -1602,12 +1642,12 @@ function responsiveShadowStyle(props) {
1602
1642
  } = theme.getTheme_v2(props.theme);
1603
1643
  return _responsive(media, props.$shadow, index => shadowStyle(shadow[index], card.shadow.outline));
1604
1644
  }
1605
- var __freeze$C = Object.freeze;
1606
- var __defProp$D = Object.defineProperty;
1607
- var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", {
1608
- value: __freeze$C(raw || cooked.slice())
1645
+ var __freeze$E = Object.freeze;
1646
+ var __defProp$F = Object.defineProperty;
1647
+ var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", {
1648
+ value: __freeze$E(raw || cooked.slice())
1609
1649
  }));
1610
- var _a$C, _b$m, _c$b;
1650
+ var _a$E, _b$m, _c$b;
1611
1651
  function labelBaseStyle(props) {
1612
1652
  const {
1613
1653
  $accent,
@@ -1616,16 +1656,16 @@ function labelBaseStyle(props) {
1616
1656
  const {
1617
1657
  font
1618
1658
  } = theme.getTheme_v2(props.theme);
1619
- return styled.css(_c$b || (_c$b = __template$C(["\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$C || (_a$C = __template$C(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$m || (_b$m = __template$C(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
1659
+ return styled.css(_c$b || (_c$b = __template$E(["\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$E || (_a$E = __template$E(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$m || (_b$m = __template$E(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
1620
1660
  }
1621
- var __freeze$B = Object.freeze;
1622
- var __defProp$C = Object.defineProperty;
1623
- var __template$B = (cooked, raw) => __freeze$B(__defProp$C(cooked, "raw", {
1624
- value: __freeze$B(raw || cooked.slice())
1661
+ var __freeze$D = Object.freeze;
1662
+ var __defProp$E = Object.defineProperty;
1663
+ var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", {
1664
+ value: __freeze$D(raw || cooked.slice())
1625
1665
  }));
1626
- var _a$B;
1627
- const Root$D = styled__default.default.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
1628
- const SpanWithTextOverflow$2 = styled__default.default.span(_a$B || (_a$B = __template$B(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
1666
+ var _a$D;
1667
+ const Root$C = styled__default.default.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
1668
+ const SpanWithTextOverflow$2 = styled__default.default.span(_a$D || (_a$D = __template$D(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
1629
1669
  const Label = react.forwardRef(function Label2(props, ref) {
1630
1670
  const {
1631
1671
  accent,
@@ -1647,7 +1687,7 @@ const Label = react.forwardRef(function Label2(props, ref) {
1647
1687
  children
1648
1688
  });
1649
1689
  }
1650
- return /* @__PURE__ */jsxRuntime.jsx(Root$D, {
1690
+ return /* @__PURE__ */jsxRuntime.jsx(Root$C, {
1651
1691
  "data-ui": "Label",
1652
1692
  ...restProps,
1653
1693
  $accent: accent,
@@ -1806,7 +1846,7 @@ function avatarStrokeStyle() {
1806
1846
  }
1807
1847
  };
1808
1848
  }
1809
- const Root$C = styled__default.default.div(responsiveAvatarSizeStyle, avatarStyle.root);
1849
+ const Root$B = styled__default.default.div(responsiveAvatarSizeStyle, avatarStyle.root);
1810
1850
  const Arrow$1 = styled__default.default.div(avatarStyle.arrow);
1811
1851
  const BgStroke = styled__default.default.ellipse(avatarStyle.bgStroke);
1812
1852
  const Stroke = styled__default.default.ellipse(avatarStyle.stroke);
@@ -1862,7 +1902,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
1862
1902
  if (s === 3) return 5;
1863
1903
  return 0;
1864
1904
  }), [size]);
1865
- return /* @__PURE__ */jsxRuntime.jsxs(Root$C, {
1905
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$B, {
1866
1906
  as,
1867
1907
  "data-as": typeof as === "string" ? as : void 0,
1868
1908
  "data-ui": "Avatar",
@@ -1931,12 +1971,12 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
1931
1971
  })]
1932
1972
  });
1933
1973
  });
1934
- var __freeze$A = Object.freeze;
1935
- var __defProp$B = Object.defineProperty;
1936
- var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", {
1937
- value: __freeze$A(raw || cooked.slice())
1974
+ var __freeze$C = Object.freeze;
1975
+ var __defProp$D = Object.defineProperty;
1976
+ var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", {
1977
+ value: __freeze$C(raw || cooked.slice())
1938
1978
  }));
1939
- var _a$A;
1979
+ var _a$C;
1940
1980
  function _responsiveAvatarCounterSizeStyle(props) {
1941
1981
  const {
1942
1982
  avatar,
@@ -1956,9 +1996,9 @@ function _avatarCounterBaseStyle(props) {
1956
1996
  const {
1957
1997
  space
1958
1998
  } = theme.getTheme_v2(props.theme);
1959
- 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 1px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(space[2]));
1999
+ return styled.css(_a$C || (_a$C = __template$C(["\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 1px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(space[2]));
1960
2000
  }
1961
- const Root$B = styled__default.default.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
2001
+ const Root$A = styled__default.default.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
1962
2002
  const AvatarCounter = react.forwardRef(function AvatarCounter2(props, ref) {
1963
2003
  const {
1964
2004
  count,
@@ -1971,7 +2011,7 @@ const AvatarCounter = react.forwardRef(function AvatarCounter2(props, ref) {
1971
2011
  if (s === 3) return 5;
1972
2012
  return 0;
1973
2013
  }), [size]);
1974
- return /* @__PURE__ */jsxRuntime.jsx(Root$B, {
2014
+ return /* @__PURE__ */jsxRuntime.jsx(Root$A, {
1975
2015
  $size: size,
1976
2016
  "data-ui": "AvatarCounter",
1977
2017
  ref,
@@ -1987,13 +2027,13 @@ function childrenToElementArray(children) {
1987
2027
  const childrenArray = Array.isArray(children) ? children : [children];
1988
2028
  return childrenArray.filter(node => ReactIs.isElement(node) || ReactIs.isFragment(node) || typeof node === "string");
1989
2029
  }
1990
- var __freeze$z = Object.freeze;
1991
- var __defProp$A = Object.defineProperty;
1992
- var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", {
1993
- value: __freeze$z(raw || cooked.slice())
2030
+ var __freeze$B = Object.freeze;
2031
+ var __defProp$C = Object.defineProperty;
2032
+ var __template$B = (cooked, raw) => __freeze$B(__defProp$C(cooked, "raw", {
2033
+ value: __freeze$B(raw || cooked.slice())
1994
2034
  }));
1995
- var _a$z;
1996
- const BASE_STYLES = styled.css(_a$z || (_a$z = __template$z(["\n white-space: nowrap;\n\n & > div {\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n }\n"])));
2035
+ var _a$B;
2036
+ const BASE_STYLES = styled.css(_a$B || (_a$B = __template$B(["\n white-space: nowrap;\n\n & > div {\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n }\n"])));
1997
2037
  function avatarStackStyle() {
1998
2038
  return BASE_STYLES;
1999
2039
  }
@@ -2012,7 +2052,7 @@ function responsiveAvatarStackSizeStyle(props) {
2012
2052
  };
2013
2053
  });
2014
2054
  }
2015
- const Root$A = styled__default.default.div(responsiveAvatarStackSizeStyle, avatarStackStyle);
2055
+ const Root$z = styled__default.default.div(responsiveAvatarStackSizeStyle, avatarStackStyle);
2016
2056
  const AvatarStack = react.forwardRef(function AvatarStack2(props, ref) {
2017
2057
  const {
2018
2058
  children: childrenProp,
@@ -2027,7 +2067,7 @@ const AvatarStack = react.forwardRef(function AvatarStack2(props, ref) {
2027
2067
  const visibleCount = maxLength - 1;
2028
2068
  const extraCount = len - visibleCount;
2029
2069
  const visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
2030
- return /* @__PURE__ */jsxRuntime.jsxs(Root$A, {
2070
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$z, {
2031
2071
  "data-ui": "AvatarStack",
2032
2072
  ...restProps,
2033
2073
  ref,
@@ -2049,7 +2089,7 @@ const AvatarStack = react.forwardRef(function AvatarStack2(props, ref) {
2049
2089
  }, String(childIndex)))]
2050
2090
  });
2051
2091
  });
2052
- const Root$z = styled__default.default.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle);
2092
+ const Root$y = styled__default.default.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle);
2053
2093
  const Box = react.forwardRef(function Box2(props, ref) {
2054
2094
  const {
2055
2095
  as: asProp = "div",
@@ -2080,7 +2120,7 @@ const Box = react.forwardRef(function Box2(props, ref) {
2080
2120
  sizing,
2081
2121
  ...restProps
2082
2122
  } = props;
2083
- return /* @__PURE__ */jsxRuntime.jsx(Root$z, {
2123
+ return /* @__PURE__ */jsxRuntime.jsx(Root$y, {
2084
2124
  "data-as": typeof asProp === "string" ? asProp : void 0,
2085
2125
  "data-ui": "Box",
2086
2126
  ...restProps,
@@ -2114,12 +2154,12 @@ const Box = react.forwardRef(function Box2(props, ref) {
2114
2154
  children: props.children
2115
2155
  });
2116
2156
  });
2117
- var __freeze$y = Object.freeze;
2118
- var __defProp$z = Object.defineProperty;
2119
- var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
2120
- value: __freeze$y(raw || cooked.slice())
2157
+ var __freeze$A = Object.freeze;
2158
+ var __defProp$B = Object.defineProperty;
2159
+ var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", {
2160
+ value: __freeze$A(raw || cooked.slice())
2121
2161
  }));
2122
- var _a$y, _b$l, _c$a;
2162
+ var _a$A, _b$l, _c$a;
2123
2163
  function textBaseStyle(props) {
2124
2164
  const {
2125
2165
  $accent,
@@ -2128,16 +2168,16 @@ function textBaseStyle(props) {
2128
2168
  const {
2129
2169
  font
2130
2170
  } = theme.getTheme_v2(props.theme);
2131
- return styled.css(_c$a || (_c$a = __template$y(["\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 & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])), $accent && styled.css(_a$y || (_a$y = __template$y(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$y(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.text.weights.bold);
2171
+ return styled.css(_c$a || (_c$a = __template$A(["\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 & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])), $accent && styled.css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.text.weights.bold);
2132
2172
  }
2133
- var __freeze$x = Object.freeze;
2134
- var __defProp$y = Object.defineProperty;
2135
- var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
2136
- value: __freeze$x(raw || cooked.slice())
2173
+ var __freeze$z = Object.freeze;
2174
+ var __defProp$A = Object.defineProperty;
2175
+ var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", {
2176
+ value: __freeze$z(raw || cooked.slice())
2137
2177
  }));
2138
- var _a$x;
2139
- const Root$y = styled__default.default.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
2140
- 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"])));
2178
+ var _a$z;
2179
+ const Root$x = styled__default.default.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
2180
+ const SpanWithTextOverflow$1 = styled__default.default.span(_a$z || (_a$z = __template$z(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
2141
2181
  const Text = react.forwardRef(function Text2(props, ref) {
2142
2182
  const {
2143
2183
  accent = false,
@@ -2155,7 +2195,7 @@ const Text = react.forwardRef(function Text2(props, ref) {
2155
2195
  children
2156
2196
  });
2157
2197
  }
2158
- return /* @__PURE__ */jsxRuntime.jsx(Root$y, {
2198
+ return /* @__PURE__ */jsxRuntime.jsx(Root$x, {
2159
2199
  "data-ui": "Text",
2160
2200
  ...restProps,
2161
2201
  $accent: accent,
@@ -2184,7 +2224,7 @@ function badgeStyle(props) {
2184
2224
  }
2185
2225
  };
2186
2226
  }
2187
- const Root$x = styled__default.default(Box)(responsiveRadiusStyle, badgeStyle);
2227
+ const Root$w = styled__default.default(Box)(responsiveRadiusStyle, badgeStyle);
2188
2228
  const Badge = react.forwardRef(function Badge2(props, ref) {
2189
2229
  const {
2190
2230
  children,
@@ -2196,7 +2236,7 @@ const Badge = react.forwardRef(function Badge2(props, ref) {
2196
2236
  tone = "default",
2197
2237
  ...restProps
2198
2238
  } = props;
2199
- return /* @__PURE__ */jsxRuntime.jsx(Root$x, {
2239
+ return /* @__PURE__ */jsxRuntime.jsx(Root$w, {
2200
2240
  "data-ui": "Badge",
2201
2241
  ...restProps,
2202
2242
  $tone: tone,
@@ -2205,12 +2245,11 @@ const Badge = react.forwardRef(function Badge2(props, ref) {
2205
2245
  ref,
2206
2246
  children: /* @__PURE__ */jsxRuntime.jsx(Text, {
2207
2247
  size: fontSize,
2208
- weight: "medium",
2209
2248
  children
2210
2249
  })
2211
2250
  });
2212
2251
  });
2213
- const Root$w = styled__default.default(Box)(flexItemStyle, responsiveFlexStyle);
2252
+ const Root$v = styled__default.default(Box)(flexItemStyle, responsiveFlexStyle);
2214
2253
  const Flex = react.forwardRef(function Flex2(props, ref) {
2215
2254
  const {
2216
2255
  align,
@@ -2221,7 +2260,7 @@ const Flex = react.forwardRef(function Flex2(props, ref) {
2221
2260
  wrap,
2222
2261
  ...restProps
2223
2262
  } = props;
2224
- return /* @__PURE__ */jsxRuntime.jsx(Root$w, {
2263
+ return /* @__PURE__ */jsxRuntime.jsx(Root$v, {
2225
2264
  "data-ui": "Flex",
2226
2265
  ...restProps,
2227
2266
  $align: useArrayProp(align),
@@ -2233,16 +2272,16 @@ const Flex = react.forwardRef(function Flex2(props, ref) {
2233
2272
  ref
2234
2273
  });
2235
2274
  });
2236
- var __freeze$w = Object.freeze;
2237
- var __defProp$x = Object.defineProperty;
2238
- var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
2239
- value: __freeze$w(raw || cooked.slice())
2275
+ var __freeze$y = Object.freeze;
2276
+ var __defProp$z = Object.defineProperty;
2277
+ var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
2278
+ value: __freeze$y(raw || cooked.slice())
2240
2279
  }));
2241
- var _a$w, _b$k;
2242
- 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"])));
2243
- const Root$v = styled__default.default(Text)(_b$k || (_b$k = __template$w(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
2280
+ var _a$y, _b$k;
2281
+ 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"])));
2282
+ const Root$u = styled__default.default(Text)(_b$k || (_b$k = __template$y(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
2244
2283
  const Spinner = react.forwardRef(function Spinner2(props, ref) {
2245
- return /* @__PURE__ */jsxRuntime.jsx(Root$v, {
2284
+ return /* @__PURE__ */jsxRuntime.jsx(Root$u, {
2246
2285
  "data-ui": "Spinner",
2247
2286
  ...props,
2248
2287
  ref,
@@ -2253,6 +2292,7 @@ function _cardColorStyle(base, color) {
2253
2292
  let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2254
2293
  return {
2255
2294
  // from base
2295
+ "--card-backdrop-color": base.backdrop,
2256
2296
  "--card-focus-ring-color": base.focusRing,
2257
2297
  "--card-shadow-outline-color": base.shadow.outline,
2258
2298
  "--card-shadow-umbra-color": base.shadow.umbra,
@@ -2320,12 +2360,12 @@ function _cardColorStyle(base, color) {
2320
2360
  "--card-hairline-hard-color": color.border
2321
2361
  };
2322
2362
  }
2323
- var __freeze$v = Object.freeze;
2324
- var __defProp$w = Object.defineProperty;
2325
- var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
2326
- value: __freeze$v(raw || cooked.slice())
2363
+ var __freeze$x = Object.freeze;
2364
+ var __defProp$y = Object.defineProperty;
2365
+ var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
2366
+ value: __freeze$x(raw || cooked.slice())
2327
2367
  }));
2328
- var _a$v, _b$j;
2368
+ var _a$x, _b$j;
2329
2369
  function buttonBaseStyles(props) {
2330
2370
  const {
2331
2371
  $width
@@ -2333,7 +2373,7 @@ function buttonBaseStyles(props) {
2333
2373
  const {
2334
2374
  style
2335
2375
  } = theme.getTheme_v2(props.theme);
2336
- return styled.css(_b$j || (_b$j = __template$v(["\n ", ";\n\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 vertical-align: top;\n\n ", "\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 "])), style == null ? void 0 : style.button, $width === "fill" && styled.css(_a$v || (_a$v = __template$v(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
2376
+ return styled.css(_b$j || (_b$j = __template$x(["\n ", ";\n\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 vertical-align: top;\n\n ", "\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 "])), style == null ? void 0 : style.button, $width === "fill" && styled.css(_a$x || (_a$x = __template$x(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
2337
2377
  }
2338
2378
  function combineBoxShadow() {
2339
2379
  for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -2388,14 +2428,14 @@ function buttonColorStyles(props) {
2388
2428
  }
2389
2429
  }, (_a2 = style == null ? void 0 : style.button) == null ? void 0 : _a2.root].filter(Boolean);
2390
2430
  }
2391
- var __freeze$u = Object.freeze;
2392
- var __defProp$v = Object.defineProperty;
2393
- var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
2394
- value: __freeze$u(raw || cooked.slice())
2431
+ var __freeze$w = Object.freeze;
2432
+ var __defProp$x = Object.defineProperty;
2433
+ var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
2434
+ value: __freeze$w(raw || cooked.slice())
2395
2435
  }));
2396
- var _a$u;
2397
- const Root$u = styled__default.default.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
2398
- 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"])));
2436
+ var _a$w;
2437
+ const Root$t = styled__default.default.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
2438
+ 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: var(--card-bg-color);\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])));
2399
2439
  const Button = react.forwardRef(function Button2(props, ref) {
2400
2440
  const {
2401
2441
  children,
@@ -2447,7 +2487,7 @@ const Button = react.forwardRef(function Button2(props, ref) {
2447
2487
  paddingLeft,
2448
2488
  paddingRight
2449
2489
  }), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
2450
- return /* @__PURE__ */jsxRuntime.jsxs(Root$u, {
2490
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$t, {
2451
2491
  "data-ui": "Button",
2452
2492
  ...restProps,
2453
2493
  $mode: mode,
@@ -2471,16 +2511,13 @@ const Button = react.forwardRef(function Button2(props, ref) {
2471
2511
  children: [icon && /* @__PURE__ */jsxRuntime.jsxs(Text, {
2472
2512
  size: fontSize,
2473
2513
  children: [react.isValidElement(icon) && icon, ReactIs.isValidElementType(icon) && react.createElement(icon)]
2474
- }), text && /* @__PURE__ */jsxRuntime.jsx(Box, {
2475
- flex: iconRight ? 1 : void 0,
2476
- children: /* @__PURE__ */jsxRuntime.jsx(Text, {
2477
- muted,
2478
- align: textAlign,
2479
- size: fontSize,
2480
- textOverflow: "ellipsis",
2481
- weight: button.textWeight,
2482
- children: text
2483
- })
2514
+ }), text && /* @__PURE__ */jsxRuntime.jsx(Text, {
2515
+ muted,
2516
+ align: textAlign,
2517
+ size: fontSize,
2518
+ textOverflow: "ellipsis",
2519
+ weight: button.textWeight,
2520
+ children: text
2484
2521
  }), iconRight && /* @__PURE__ */jsxRuntime.jsxs(Text, {
2485
2522
  size: fontSize,
2486
2523
  children: [react.isValidElement(iconRight) && iconRight, ReactIs.isValidElementType(iconRight) && react.createElement(iconRight)]
@@ -2493,12 +2530,12 @@ const Button = react.forwardRef(function Button2(props, ref) {
2493
2530
  })]
2494
2531
  });
2495
2532
  });
2496
- var __freeze$t = Object.freeze;
2497
- var __defProp$u = Object.defineProperty;
2498
- var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
2499
- value: __freeze$t(raw || cooked.slice())
2533
+ var __freeze$v = Object.freeze;
2534
+ var __defProp$w = Object.defineProperty;
2535
+ var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
2536
+ value: __freeze$v(raw || cooked.slice())
2500
2537
  }));
2501
- var _a$t, _b$i, _c$9;
2538
+ var _a$v, _b$i, _c$9;
2502
2539
  function cardStyle(props) {
2503
2540
  return [cardBaseStyle(props), cardColorStyle(props)];
2504
2541
  }
@@ -2509,7 +2546,7 @@ function cardBaseStyle(props) {
2509
2546
  const {
2510
2547
  space
2511
2548
  } = theme.getTheme_v2(props.theme);
2512
- 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: -moz-available;\n width: -webkit-fill-available;\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]));
2549
+ return styled.css(_b$i || (_b$i = __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: -moz-available;\n width: -webkit-fill-available;\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: var(--card-bg-image);\n "])), space[3], space[3]));
2513
2550
  }
2514
2551
  function cardColorStyle(props) {
2515
2552
  var _a2;
@@ -2526,7 +2563,7 @@ function cardColorStyle(props) {
2526
2563
  width: card.border.width,
2527
2564
  color: "var(--card-border-color)"
2528
2565
  };
2529
- return styled.css(_c$9 || (_c$9 = __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-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-visible {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), color._dark ? "dark" : "light", _cardColorStyle(color, color, $checkered), _cardColorStyle(color, color.selectable.default.disabled, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), _cardColorStyle(color, color.selectable.default.selected, $checkered), _cardColorStyle(color, color.selectable.default.hovered, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), $focusRing ? focusRingStyle({
2566
+ return styled.css(_c$9 || (_c$9 = __template$v(["\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-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-visible {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), color._dark ? "dark" : "light", _cardColorStyle(color, color, $checkered), _cardColorStyle(color, color.selectable.default.disabled, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), _cardColorStyle(color, color.selectable.default.selected, $checkered), _cardColorStyle(color, color.selectable.default.hovered, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), $focusRing ? focusRingStyle({
2530
2567
  base: color,
2531
2568
  border,
2532
2569
  focusRing: card.focusRing
@@ -2536,7 +2573,7 @@ function cardColorStyle(props) {
2536
2573
  focusRing: card.focusRing
2537
2574
  }) : void 0, (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
2538
2575
  }
2539
- const Root$t = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
2576
+ const Root$s = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
2540
2577
  const Card = react.forwardRef(function Card2(props, ref) {
2541
2578
  const {
2542
2579
  __unstable_checkered: checkered = false,
@@ -2561,7 +2598,7 @@ const Card = react.forwardRef(function Card2(props, ref) {
2561
2598
  return /* @__PURE__ */jsxRuntime.jsx(ThemeColorProvider, {
2562
2599
  scheme,
2563
2600
  tone,
2564
- children: /* @__PURE__ */jsxRuntime.jsx(Root$t, {
2601
+ children: /* @__PURE__ */jsxRuntime.jsx(Root$s, {
2565
2602
  "data-as": typeof as === "string" ? as : void 0,
2566
2603
  "data-scheme": rootTheme.scheme,
2567
2604
  "data-ui": "Card",
@@ -2586,14 +2623,14 @@ const Card = react.forwardRef(function Card2(props, ref) {
2586
2623
  })
2587
2624
  });
2588
2625
  });
2589
- var __freeze$s = Object.freeze;
2590
- var __defProp$t = Object.defineProperty;
2591
- var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
2592
- value: __freeze$s(raw || cooked.slice())
2626
+ var __freeze$u = Object.freeze;
2627
+ var __defProp$v = Object.defineProperty;
2628
+ var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
2629
+ value: __freeze$u(raw || cooked.slice())
2593
2630
  }));
2594
- var _a$s, _b$h;
2631
+ var _a$u, _b$h;
2595
2632
  function checkboxBaseStyles() {
2596
- return styled.css(_a$s || (_a$s = __template$s(["\n position: relative;\n display: inline-block;\n "])));
2633
+ return styled.css(_a$u || (_a$u = __template$u(["\n position: relative;\n display: inline-block;\n "])));
2597
2634
  }
2598
2635
  function inputElementStyles(props) {
2599
2636
  const {
@@ -2604,7 +2641,7 @@ function inputElementStyles(props) {
2604
2641
  const {
2605
2642
  focusRing
2606
2643
  } = input.checkbox;
2607
- 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.5px !important;\n }\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({
2644
+ return styled.css(_b$h || (_b$h = __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.5px !important;\n }\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({
2608
2645
  color: color.input.default.enabled.border,
2609
2646
  width: input.border.width
2610
2647
  }), rem(radius[2]), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
@@ -2637,7 +2674,7 @@ function inputElementStyles(props) {
2637
2674
  color: color.input.default.readOnly.border
2638
2675
  }), color.input.default.readOnly.fg, color.input.default.readOnly.muted.bg);
2639
2676
  }
2640
- const Root$s = styled__default.default.div(checkboxBaseStyles);
2677
+ const Root$r = styled__default.default.div(checkboxBaseStyles);
2641
2678
  const Input$5 = styled__default.default.input(inputElementStyles);
2642
2679
  const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
2643
2680
  const {
@@ -2657,7 +2694,7 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
2657
2694
  ref.current.indeterminate = indeterminate || false;
2658
2695
  }
2659
2696
  }, [indeterminate, ref]);
2660
- return /* @__PURE__ */jsxRuntime.jsxs(Root$s, {
2697
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$r, {
2661
2698
  className,
2662
2699
  "data-ui": "Checkbox",
2663
2700
  style,
@@ -2675,12 +2712,12 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
2675
2712
  })]
2676
2713
  });
2677
2714
  });
2678
- var __freeze$r = Object.freeze;
2679
- var __defProp$s = Object.defineProperty;
2680
- var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
2681
- value: __freeze$r(raw || cooked.slice())
2715
+ var __freeze$t = Object.freeze;
2716
+ var __defProp$u = Object.defineProperty;
2717
+ var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
2718
+ value: __freeze$t(raw || cooked.slice())
2682
2719
  }));
2683
- var _a$r;
2720
+ var _a$t;
2684
2721
  function codeSyntaxHighlightingStyle(_ref2) {
2685
2722
  let {
2686
2723
  theme: theme$1
@@ -2802,9 +2839,9 @@ function codeSyntaxHighlightingStyle(_ref2) {
2802
2839
  };
2803
2840
  }
2804
2841
  function codeBaseStyle() {
2805
- 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);
2842
+ return styled.css(_a$t || (_a$t = __template$t(["\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);
2806
2843
  }
2807
- const Root$r = styled__default.default.pre(codeBaseStyle, responsiveCodeFontStyle);
2844
+ const Root$q = styled__default.default.pre(codeBaseStyle, responsiveCodeFontStyle);
2808
2845
  const Code = react.forwardRef(function Code2(props, ref) {
2809
2846
  const {
2810
2847
  children,
@@ -2815,7 +2852,7 @@ const Code = react.forwardRef(function Code2(props, ref) {
2815
2852
  } = props;
2816
2853
  const language = typeof languageProp === "string" ? languageProp : void 0;
2817
2854
  const registered = language ? Refractor__default.default.hasLanguage(language) : false;
2818
- return /* @__PURE__ */jsxRuntime.jsxs(Root$r, {
2855
+ return /* @__PURE__ */jsxRuntime.jsxs(Root$q, {
2819
2856
  "data-ui": "Code",
2820
2857
  ...restProps,
2821
2858
  $size: useArrayProp(size),
@@ -2846,14 +2883,14 @@ function responsiveContainerWidthStyle(props) {
2846
2883
  maxWidth: val === "auto" ? "none" : rem(container[val])
2847
2884
  }));
2848
2885
  }
2849
- const Root$q = styled__default.default(Box)(containerBaseStyle, responsiveContainerWidthStyle);
2886
+ const Root$p = styled__default.default(Box)(containerBaseStyle, responsiveContainerWidthStyle);
2850
2887
  const Container = react.forwardRef(function Container2(props, ref) {
2851
2888
  const {
2852
2889
  as,
2853
2890
  width = 2,
2854
2891
  ...restProps
2855
2892
  } = props;
2856
- return /* @__PURE__ */jsxRuntime.jsx(Root$q, {
2893
+ return /* @__PURE__ */jsxRuntime.jsx(Root$p, {
2857
2894
  "data-ui": "Container",
2858
2895
  ...restProps,
2859
2896
  $width: useArrayProp(width),
@@ -2861,7 +2898,7 @@ const Container = react.forwardRef(function Container2(props, ref) {
2861
2898
  ref
2862
2899
  });
2863
2900
  });
2864
- const Root$p = styled__default.default(Box)(responsiveGridStyle);
2901
+ const Root$o = styled__default.default(Box)(responsiveGridStyle);
2865
2902
  const Grid = react.forwardRef(function Grid2(props, ref) {
2866
2903
  const {
2867
2904
  as,
@@ -2876,7 +2913,7 @@ const Grid = react.forwardRef(function Grid2(props, ref) {
2876
2913
  children,
2877
2914
  ...restProps
2878
2915
  } = props;
2879
- return /* @__PURE__ */jsxRuntime.jsx(Root$p, {
2916
+ return /* @__PURE__ */jsxRuntime.jsx(Root$o, {
2880
2917
  "data-as": typeof as === "string" ? as : void 0,
2881
2918
  "data-ui": "Grid",
2882
2919
  ...restProps,
@@ -2893,12 +2930,12 @@ const Grid = react.forwardRef(function Grid2(props, ref) {
2893
2930
  children
2894
2931
  });
2895
2932
  });
2896
- var __freeze$q = Object.freeze;
2897
- var __defProp$r = Object.defineProperty;
2898
- var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
2899
- value: __freeze$q(raw || cooked.slice())
2933
+ var __freeze$s = Object.freeze;
2934
+ var __defProp$t = Object.defineProperty;
2935
+ var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
2936
+ value: __freeze$s(raw || cooked.slice())
2900
2937
  }));
2901
- var _a$q, _b$g, _c$8;
2938
+ var _a$s, _b$g, _c$8;
2902
2939
  function headingBaseStyle(props) {
2903
2940
  const {
2904
2941
  $accent,
@@ -2907,16 +2944,16 @@ function headingBaseStyle(props) {
2907
2944
  const {
2908
2945
  font
2909
2946
  } = theme.getTheme_v2(props.theme);
2910
- return styled.css(_c$8 || (_c$8 = __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 "]))), font.code.family);
2947
+ return styled.css(_c$8 || (_c$8 = __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: 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 }\n "])), $accent && styled.css(_a$s || (_a$s = __template$s(["\n color: var(--card-accent-fg-color);\n "]))), $muted && styled.css(_b$g || (_b$g = __template$s(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.heading.weights.bold);
2911
2948
  }
2912
- var __freeze$p = Object.freeze;
2913
- var __defProp$q = Object.defineProperty;
2914
- var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
2915
- value: __freeze$p(raw || cooked.slice())
2949
+ var __freeze$r = Object.freeze;
2950
+ var __defProp$s = Object.defineProperty;
2951
+ var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
2952
+ value: __freeze$r(raw || cooked.slice())
2916
2953
  }));
2917
- var _a$p;
2918
- const Root$o = styled__default.default.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
2919
- 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"])));
2954
+ var _a$r;
2955
+ const Root$n = styled__default.default.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
2956
+ const SpanWithTextOverflow = 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"])));
2920
2957
  const Heading = react.forwardRef(function Heading2(props, ref) {
2921
2958
  const {
2922
2959
  accent = false,
@@ -2934,7 +2971,7 @@ const Heading = react.forwardRef(function Heading2(props, ref) {
2934
2971
  children
2935
2972
  });
2936
2973
  }
2937
- return /* @__PURE__ */jsxRuntime.jsx(Root$o, {
2974
+ return /* @__PURE__ */jsxRuntime.jsx(Root$n, {
2938
2975
  "data-ui": "Heading",
2939
2976
  ...restProps,
2940
2977
  $accent: accent,
@@ -2975,7 +3012,7 @@ function inlineSpaceStyle(props) {
2975
3012
  };
2976
3013
  });
2977
3014
  }
2978
- const Root$n = styled__default.default(Box)(inlineBaseStyle, inlineSpaceStyle);
3015
+ const Root$m = styled__default.default(Box)(inlineBaseStyle, inlineSpaceStyle);
2979
3016
  const Inline = react.forwardRef(function Inline2(props, ref) {
2980
3017
  const {
2981
3018
  as,
@@ -2986,7 +3023,7 @@ const Inline = react.forwardRef(function Inline2(props, ref) {
2986
3023
  const children = react.useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsxRuntime.jsx("div", {
2987
3024
  children: child
2988
3025
  }, idx)), [childrenProp]);
2989
- return /* @__PURE__ */jsxRuntime.jsx(Root$n, {
3026
+ return /* @__PURE__ */jsxRuntime.jsx(Root$m, {
2990
3027
  "data-ui": "Inline",
2991
3028
  ...restProps,
2992
3029
  $space: useArrayProp(space),
@@ -2995,16 +3032,16 @@ const Inline = react.forwardRef(function Inline2(props, ref) {
2995
3032
  children
2996
3033
  });
2997
3034
  });
2998
- var __freeze$o = Object.freeze;
2999
- var __defProp$p = Object.defineProperty;
3000
- var __template$o = (cooked, raw) => __freeze$o(__defProp$p(cooked, "raw", {
3001
- value: __freeze$o(raw || cooked.slice())
3035
+ var __freeze$q = Object.freeze;
3036
+ var __defProp$r = Object.defineProperty;
3037
+ var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
3038
+ value: __freeze$q(raw || cooked.slice())
3002
3039
  }));
3003
- var _a$o;
3040
+ var _a$q;
3004
3041
  function kbdStyle() {
3005
- return styled.css(_a$o || (_a$o = __template$o(["\n --card-bg-color: var(--card-kbd-bg-color);\n --card-border-color: var(--card-kbd-border-color);\n --card-fg-color: var(--card-kbd-fg-color);\n\n box-shadow: inset 0 0 0 1px var(--card-border-color);\n background: var(--card-bg-color);\n font: inherit;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
3042
+ return styled.css(_a$q || (_a$q = __template$q(["\n --card-bg-color: var(--card-kbd-bg-color);\n --card-border-color: var(--card-kbd-border-color);\n --card-fg-color: var(--card-kbd-fg-color);\n\n box-shadow: inset 0 0 0 1px var(--card-border-color);\n background: var(--card-bg-color);\n font: inherit;\n\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
3006
3043
  }
3007
- const Root$m = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
3044
+ const Root$l = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
3008
3045
  const KBD = react.forwardRef(function KBD2(props, ref) {
3009
3046
  const {
3010
3047
  children,
@@ -3013,7 +3050,7 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
3013
3050
  radius = 2,
3014
3051
  ...restProps
3015
3052
  } = props;
3016
- return /* @__PURE__ */jsxRuntime.jsx(Root$m, {
3053
+ return /* @__PURE__ */jsxRuntime.jsx(Root$l, {
3017
3054
  "data-ui": "KBD",
3018
3055
  ...restProps,
3019
3056
  $radius: useArrayProp(radius),
@@ -3030,6 +3067,45 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
3030
3067
  })
3031
3068
  });
3032
3069
  });
3070
+ const origin = {
3071
+ name: "@sanity/ui/origin",
3072
+ fn(_ref3) {
3073
+ let {
3074
+ middlewareData,
3075
+ placement,
3076
+ rects
3077
+ } = _ref3;
3078
+ var _a, _b;
3079
+ const [side] = placement.split("-");
3080
+ const floatingWidth = rects.floating.width;
3081
+ const floatingHeight = rects.floating.height;
3082
+ const shiftX = ((_a = middlewareData.shift) == null ? void 0 : _a.x) || 0;
3083
+ const shiftY = ((_b = middlewareData.shift) == null ? void 0 : _b.y) || 0;
3084
+ if (floatingWidth <= 0 || floatingHeight <= 0) {
3085
+ return {};
3086
+ }
3087
+ const isVerticalPlacement = ["bottom", "top"].includes(side);
3088
+ const {
3089
+ originX,
3090
+ originY
3091
+ } = isVerticalPlacement ? {
3092
+ originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),
3093
+ originY: side === "bottom" ? 0 : 1
3094
+ } : {
3095
+ originX: side === "left" ? 1 : 0,
3096
+ originY: clamp(0.5 - shiftY / floatingHeight, 0, 1)
3097
+ };
3098
+ return {
3099
+ data: {
3100
+ originX,
3101
+ originY
3102
+ }
3103
+ };
3104
+ }
3105
+ };
3106
+ function clamp(num, min, max) {
3107
+ return Math.min(Math.max(num, min), max);
3108
+ }
3033
3109
  function moveTowardsLength(movingPoint, targetPoint, amount) {
3034
3110
  const width = targetPoint.x - movingPoint.x;
3035
3111
  const height = targetPoint.y - movingPoint.y;
@@ -3084,20 +3160,20 @@ function compileCommands(cmds) {
3084
3160
  return "";
3085
3161
  }).join(" ");
3086
3162
  }
3087
- var __freeze$n = Object.freeze;
3088
- var __defProp$o = Object.defineProperty;
3089
- var __template$n = (cooked, raw) => __freeze$n(__defProp$o(cooked, "raw", {
3090
- value: __freeze$n(raw || cooked.slice())
3163
+ var __freeze$p = Object.freeze;
3164
+ var __defProp$q = Object.defineProperty;
3165
+ var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
3166
+ value: __freeze$p(raw || cooked.slice())
3091
3167
  }));
3092
- var _a$n, _b$f, _c$7;
3093
- const Root$l = styled__default.default.div(_ref3 => {
3168
+ var _a$p, _b$f, _c$7;
3169
+ const Root$k = styled__default.default.div(_ref4 => {
3094
3170
  let {
3095
3171
  $w: w
3096
- } = _ref3;
3097
- return styled.css(_a$n || (_a$n = __template$n(["\n position: absolute;\n width: ", "px;\n height: ", "px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ", "px ", "px;\n }\n\n [data-placement^='top'] > & {\n bottom: -", "px;\n\n & > svg {\n transform: rotate(0);\n }\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 "])), w, w, w / 2, w / 2, w, w, w, w);
3172
+ } = _ref4;
3173
+ return styled.css(_a$p || (_a$p = __template$p(["\n position: absolute;\n width: ", "px;\n height: ", "px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ", "px ", "px;\n }\n\n [data-placement^='top'] > & {\n bottom: -", "px;\n\n & > svg {\n transform: rotate(0);\n }\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 "])), w, w, w / 2, w / 2, w, w, w, w);
3098
3174
  });
3099
- const StrokePath = styled__default.default.path(_b$f || (_b$f = __template$n(["\n stroke: var(--card-shadow-outline-color);\n"])));
3100
- const ShapePath = styled__default.default.path(_c$7 || (_c$7 = __template$n(["\n fill: var(--card-bg-color);\n"])));
3175
+ const StrokePath = styled__default.default.path(_b$f || (_b$f = __template$p(["\n stroke: var(--card-shadow-outline-color);\n"])));
3176
+ const ShapePath = styled__default.default.path(_c$7 || (_c$7 = __template$p(["\n fill: var(--card-bg-color);\n"])));
3101
3177
  const Arrow = react.forwardRef(function Arrow2(props, ref) {
3102
3178
  const {
3103
3179
  width: w,
@@ -3133,7 +3209,7 @@ const Arrow = react.forwardRef(function Arrow2(props, ref) {
3133
3209
  const path = compileCommands(cmds);
3134
3210
  const strokePath = "".concat(path);
3135
3211
  const fillPath = "".concat(path, " M ").concat(w, " -1 M 0 -1 Z");
3136
- return /* @__PURE__ */jsxRuntime.jsx(Root$l, {
3212
+ return /* @__PURE__ */jsxRuntime.jsx(Root$k, {
3137
3213
  ...restProps,
3138
3214
  $w: w,
3139
3215
  ref,
@@ -3191,6 +3267,17 @@ function useBoundaryElement() {
3191
3267
  }
3192
3268
  return value || DEFAULT_VALUE;
3193
3269
  }
3270
+ function ConditionalWrapper(_ref5) {
3271
+ let {
3272
+ children,
3273
+ condition,
3274
+ wrapper
3275
+ } = _ref5;
3276
+ if (!condition) {
3277
+ return children;
3278
+ }
3279
+ return wrapper(children);
3280
+ }
3194
3281
  function findMaxBreakpoints(media, width) {
3195
3282
  const ret = [];
3196
3283
  for (let i = 0; i < media.length; i += 1) {
@@ -3240,8 +3327,8 @@ const ElementQuery = react.forwardRef(function ElementQuery2(props, ref) {
3240
3327
  children
3241
3328
  });
3242
3329
  });
3243
- var __defProp$n = Object.defineProperty;
3244
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp$n(obj, key, {
3330
+ var __defProp$p = Object.defineProperty;
3331
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp$p(obj, key, {
3245
3332
  enumerable: true,
3246
3333
  configurable: true,
3247
3334
  writable: true,
@@ -3470,7 +3557,7 @@ function LayerProvider(props) {
3470
3557
  children
3471
3558
  });
3472
3559
  }
3473
- const Root$k = styled__default.default.div({
3560
+ const Root$j = styled__default.default.div({
3474
3561
  position: "relative"
3475
3562
  });
3476
3563
  const LayerChildren = react.forwardRef(function LayerChildren2(props, ref) {
@@ -3506,7 +3593,7 @@ const LayerChildren = react.forwardRef(function LayerChildren2(props, ref) {
3506
3593
  lastFocusedRef.current = target;
3507
3594
  }
3508
3595
  }, [forwardedRef, isTopLayer, onFocus]);
3509
- return /* @__PURE__ */jsxRuntime.jsx(Root$k, {
3596
+ return /* @__PURE__ */jsxRuntime.jsx(Root$j, {
3510
3597
  ...restProps,
3511
3598
  "data-ui": "Layer",
3512
3599
  onFocus: handleFocus,
@@ -3617,19 +3704,19 @@ function PortalProvider(props) {
3617
3704
  children
3618
3705
  });
3619
3706
  }
3620
- var __freeze$m = Object.freeze;
3621
- var __defProp$m = Object.defineProperty;
3622
- var __template$m = (cooked, raw) => __freeze$m(__defProp$m(cooked, "raw", {
3623
- value: __freeze$m(raw || cooked.slice())
3707
+ var __freeze$o = Object.freeze;
3708
+ var __defProp$o = Object.defineProperty;
3709
+ var __template$o = (cooked, raw) => __freeze$o(__defProp$o(cooked, "raw", {
3710
+ value: __freeze$o(raw || cooked.slice())
3624
3711
  }));
3625
- var _a$m;
3626
- const Root$j = styled__default.default.div(_a$m || (_a$m = __template$m(["\n display: block;\n width: 0;\n height: 0;\n position: absolute;\n overflow: hidden;\n overflow: clip;\n"])));
3712
+ var _a$o;
3713
+ const Root$i = styled__default.default.div(_a$o || (_a$o = __template$o(["\n display: block;\n width: 0;\n height: 0;\n position: absolute;\n overflow: hidden;\n overflow: clip;\n"])));
3627
3714
  const SrOnly = react.forwardRef(function SrOnly2(props, ref) {
3628
3715
  const {
3629
3716
  as,
3630
3717
  children
3631
3718
  } = props;
3632
- return /* @__PURE__ */jsxRuntime.jsx(Root$j, {
3719
+ return /* @__PURE__ */jsxRuntime.jsx(Root$i, {
3633
3720
  "aria-hidden": true,
3634
3721
  as,
3635
3722
  "data-ui": "SrOnly",
@@ -3637,14 +3724,14 @@ const SrOnly = react.forwardRef(function SrOnly2(props, ref) {
3637
3724
  children
3638
3725
  });
3639
3726
  });
3640
- var __freeze$l = Object.freeze;
3641
- var __defProp$l = Object.defineProperty;
3642
- var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", {
3643
- value: __freeze$l(raw || cooked.slice())
3727
+ var __freeze$n = Object.freeze;
3728
+ var __defProp$n = Object.defineProperty;
3729
+ var __template$n = (cooked, raw) => __freeze$n(__defProp$n(cooked, "raw", {
3730
+ value: __freeze$n(raw || cooked.slice())
3644
3731
  }));
3645
- var _a$l, _b$e;
3646
- const Root$i = styled__default.default.div(_a$l || (_a$l = __template$l(["\n position: relative;\n"])));
3647
- const ItemWrapper = styled__default.default.div(_b$e || (_b$e = __template$l(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
3732
+ var _a$n, _b$e;
3733
+ const Root$h = styled__default.default.div(_a$n || (_a$n = __template$n(["\n position: relative;\n"])));
3734
+ const ItemWrapper = styled__default.default.div(_b$e || (_b$e = __template$n(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
3648
3735
  const VirtualList = react.forwardRef(function VirtualList2(props, ref) {
3649
3736
  const {
3650
3737
  as = "div",
@@ -3750,7 +3837,7 @@ const VirtualList = react.forwardRef(function VirtualList2(props, ref) {
3750
3837
  const wrapperStyle = react.useMemo(() => ({
3751
3838
  height
3752
3839
  }), [height]);
3753
- return /* @__PURE__ */jsxRuntime.jsx(Root$i, {
3840
+ return /* @__PURE__ */jsxRuntime.jsx(Root$h, {
3754
3841
  as,
3755
3842
  "data-ui": "VirtualList",
3756
3843
  ...restProps,
@@ -3868,17 +3955,17 @@ function calcMaxWidth(params) {
3868
3955
  }
3869
3956
  return Math.min(currentWidth != null ? currentWidth : Infinity, (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2);
3870
3957
  }
3871
- const Root$h = styled__default.default(Card)({
3872
- "&:not([hidden])": {
3873
- display: "flex"
3874
- },
3875
- flexDirection: "column",
3876
- width: "max-content",
3877
- minWidth: "min-content"
3878
- });
3958
+ var __freeze$m = Object.freeze;
3959
+ var __defProp$m = Object.defineProperty;
3960
+ var __template$m = (cooked, raw) => __freeze$m(__defProp$m(cooked, "raw", {
3961
+ value: __freeze$m(raw || cooked.slice())
3962
+ }));
3963
+ var _a$m;
3964
+ const MotionCard$1 = styled__default.default(framerMotion.motion(Card))(_a$m || (_a$m = __template$m(["\n &:not([hidden]) {\n display: flex;\n }\n flex-direction: column;\n width: max-content;\n min-width: min-content;\n & > * {\n opacity: var(", ", 1);\n will-change: opacity;\n }\n"])), POPOVER_MOTION_CONTENT_OPACITY_PROPERTY);
3879
3965
  const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref) {
3880
3966
  const {
3881
3967
  __unstable_margins: marginsProp,
3968
+ animate,
3882
3969
  arrow,
3883
3970
  arrowRef,
3884
3971
  arrowX,
@@ -3886,6 +3973,8 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
3886
3973
  children,
3887
3974
  padding,
3888
3975
  placement,
3976
+ originX,
3977
+ originY,
3889
3978
  overflow,
3890
3979
  radius,
3891
3980
  scheme,
@@ -3905,20 +3994,23 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
3905
3994
  const x = (xProp != null ? xProp : 0) + margins[3];
3906
3995
  const y = (yProp != null ? yProp : 0) + margins[0];
3907
3996
  const rootStyle = react.useMemo(() => ({
3997
+ left: x,
3998
+ originX,
3999
+ originY,
3908
4000
  position: strategy,
3909
4001
  top: y,
3910
- left: x,
3911
4002
  width,
3912
4003
  zIndex,
4004
+ willChange: animate ? "transform" : void 0,
3913
4005
  ...style
3914
- }), [strategy, style, width, x, y, zIndex]);
4006
+ }), [animate, originX, originY, strategy, style, width, x, y, zIndex]);
3915
4007
  const arrowStyle = react.useMemo(() => ({
3916
4008
  left: arrowX !== null ? arrowX : void 0,
3917
4009
  top: arrowY !== null ? arrowY : void 0,
3918
4010
  right: void 0,
3919
4011
  bottom: void 0
3920
4012
  }), [arrowX, arrowY]);
3921
- return /* @__PURE__ */jsxRuntime.jsxs(Root$h, {
4013
+ return /* @__PURE__ */jsxRuntime.jsxs(MotionCard$1, {
3922
4014
  "data-ui": "Popover",
3923
4015
  ...restProps,
3924
4016
  "data-placement": placement,
@@ -3929,6 +4021,7 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
3929
4021
  sizing: "border",
3930
4022
  style: rootStyle,
3931
4023
  tone,
4024
+ ...(animate ? POPOVER_MOTION_PROPS : {}),
3932
4025
  children: [/* @__PURE__ */jsxRuntime.jsx(Flex, {
3933
4026
  "data-ui": "Popover__wrapper",
3934
4027
  direction: "column",
@@ -3951,7 +4044,7 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
3951
4044
  }));
3952
4045
  PopoverCard.displayName = "PopoverCard";
3953
4046
  const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
3954
- var _a, _b, _c, _d, _e, _f, _g, _h;
4047
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3955
4048
  const {
3956
4049
  container,
3957
4050
  layer
@@ -3959,6 +4052,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
3959
4052
  const boundaryElementContext = useBoundaryElement();
3960
4053
  const {
3961
4054
  __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
4055
+ animate = false,
3962
4056
  arrow: arrowProp = false,
3963
4057
  boundaryElement = boundaryElementContext.element,
3964
4058
  children: childProp,
@@ -4046,13 +4140,13 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4046
4140
  }));
4047
4141
  if (constrainSize || matchReferenceWidth) {
4048
4142
  ret.push(size({
4049
- apply(_ref4) {
4143
+ apply(_ref6) {
4050
4144
  let {
4051
4145
  availableWidth,
4052
4146
  availableHeight,
4053
4147
  elements,
4054
4148
  referenceWidth
4055
- } = _ref4;
4149
+ } = _ref6;
4056
4150
  referenceWidthRef.current = referenceWidth;
4057
4151
  const _currentWidth = widthRef.current;
4058
4152
  const _maxWidth = maxWidthRef.current;
@@ -4086,13 +4180,16 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4086
4180
  padding: DEFAULT_POPOVER_PADDING
4087
4181
  }));
4088
4182
  }
4183
+ if (animate) {
4184
+ ret.push(origin);
4185
+ }
4089
4186
  ret.push(reactDom$1.hide({
4090
4187
  boundary: referenceBoundary || void 0,
4091
4188
  padding: DEFAULT_POPOVER_PADDING,
4092
4189
  strategy: "referenceHidden"
4093
4190
  }));
4094
4191
  return ret;
4095
- }, [arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
4192
+ }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
4096
4193
  const {
4097
4194
  x,
4098
4195
  y,
@@ -4109,6 +4206,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4109
4206
  const referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden;
4110
4207
  const arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x;
4111
4208
  const arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y;
4209
+ const originX = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originX;
4210
+ const originY = (_j = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _j.originY;
4112
4211
  const setArrow = react.useCallback(arrowEl => {
4113
4212
  arrowRef.current = arrowEl;
4114
4213
  }, []);
@@ -4151,6 +4250,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4151
4250
  children: /* @__PURE__ */jsxRuntime.jsx(PopoverCard, {
4152
4251
  ...restProps,
4153
4252
  __unstable_margins: margins,
4253
+ animate,
4154
4254
  arrow: arrowProp,
4155
4255
  arrowRef: setArrow,
4156
4256
  arrowX,
@@ -4163,6 +4263,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4163
4263
  ref: setFloating,
4164
4264
  scheme,
4165
4265
  shadow,
4266
+ originX,
4267
+ originY,
4166
4268
  strategy,
4167
4269
  tone,
4168
4270
  width: matchReferenceWidth ? referenceWidthRef.current : width,
@@ -4172,23 +4274,31 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
4172
4274
  })
4173
4275
  });
4174
4276
  return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
4175
- children: [open && /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
4176
- children: portal ? /* @__PURE__ */jsxRuntime.jsx(Portal, {
4177
- __unstable_name: typeof portal === "string" ? portal : void 0,
4277
+ children: [/* @__PURE__ */jsxRuntime.jsx(ConditionalWrapper, {
4278
+ condition: animate,
4279
+ wrapper: children => /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
4280
+ children
4281
+ }),
4282
+ children: open && /* @__PURE__ */jsxRuntime.jsx(ConditionalWrapper, {
4283
+ condition: !!portal,
4284
+ wrapper: children => /* @__PURE__ */jsxRuntime.jsx(Portal, {
4285
+ __unstable_name: typeof portal === "string" ? portal : void 0,
4286
+ children
4287
+ }),
4178
4288
  children: popover
4179
- }) : popover
4289
+ })
4180
4290
  }), child]
4181
4291
  });
4182
4292
  }));
4183
4293
  Popover.displayName = "Popover";
4184
- var __freeze$k = Object.freeze;
4185
- var __defProp$k = Object.defineProperty;
4186
- var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", {
4187
- value: __freeze$k(raw || cooked.slice())
4294
+ var __freeze$l = Object.freeze;
4295
+ var __defProp$l = Object.defineProperty;
4296
+ var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", {
4297
+ value: __freeze$l(raw || cooked.slice())
4188
4298
  }));
4189
- var _a$k, _b$d;
4299
+ var _a$l, _b$d;
4190
4300
  function radioBaseStyle() {
4191
- return styled.css(_a$k || (_a$k = __template$k(["\n position: relative;\n\n &:not([hidden]) {\n display: inline-block;\n }\n\n &[data-read-only] {\n outline: 1px solid red;\n }\n "])));
4301
+ return styled.css(_a$l || (_a$l = __template$l(["\n position: relative;\n\n &:not([hidden]) {\n display: inline-block;\n }\n\n &[data-read-only] {\n outline: 1px solid red;\n }\n "])));
4192
4302
  }
4193
4303
  function inputElementStyle(props) {
4194
4304
  const {
@@ -4196,7 +4306,7 @@ function inputElementStyle(props) {
4196
4306
  input
4197
4307
  } = theme.getTheme_v2(props.theme);
4198
4308
  const dist = (input.radio.size - input.radio.markSize) / 2;
4199
- 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.input.default.enabled.bg, focusRingBorderStyle({
4309
+ return styled.css(_b$d || (_b$d = __template$l(["\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.input.default.enabled.bg, focusRingBorderStyle({
4200
4310
  color: color.input.default.enabled.border,
4201
4311
  width: input.border.width
4202
4312
  }), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.input.default.enabled.fg, focusRingStyle({
@@ -4241,27 +4351,27 @@ const Radio = react.forwardRef(function Radio2(props, forwardedRef) {
4241
4351
  }), /* @__PURE__ */jsxRuntime.jsx("span", {})]
4242
4352
  });
4243
4353
  });
4244
- var __freeze$j = Object.freeze;
4245
- var __defProp$j = Object.defineProperty;
4246
- var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", {
4247
- value: __freeze$j(raw || cooked.slice())
4354
+ var __freeze$k = Object.freeze;
4355
+ var __defProp$k = Object.defineProperty;
4356
+ var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", {
4357
+ value: __freeze$k(raw || cooked.slice())
4248
4358
  }));
4249
- var _a$j, _b$c, _c$6, _d$5;
4359
+ var _a$k, _b$c, _c$6, _d$5;
4250
4360
  function rootStyle() {
4251
- return styled.css(_a$j || (_a$j = __template$j(["\n position: relative;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
4361
+ return styled.css(_a$k || (_a$k = __template$k(["\n position: relative;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
4252
4362
  }
4253
4363
  function inputBaseStyle(props) {
4254
4364
  const {
4255
4365
  font
4256
4366
  } = theme.getTheme_v2(props.theme);
4257
- return styled.css(_b$c || (_b$c = __template$j(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ", ";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])), font.text.family);
4367
+ return styled.css(_b$c || (_b$c = __template$k(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ", ";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])), font.text.family);
4258
4368
  }
4259
4369
  function inputColorStyle(props) {
4260
4370
  const {
4261
4371
  color,
4262
4372
  input
4263
4373
  } = theme.getTheme_v2(props.theme);
4264
- return styled.css(_c$6 || (_c$6 = __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.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
4374
+ return styled.css(_c$6 || (_c$6 = __template$k(["\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.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
4265
4375
  color: color.input.default.enabled.border,
4266
4376
  width: input.border.width
4267
4377
  }), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
@@ -4304,7 +4414,7 @@ function iconBoxStyle(props) {
4304
4414
  const {
4305
4415
  color
4306
4416
  } = theme.getTheme_v2(props.theme);
4307
- 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.input.default.enabled.fg, color.input.default.hovered.fg, color.input.default.disabled.fg, color.input.default.readOnly.fg);
4417
+ return styled.css(_d$5 || (_d$5 = __template$k(["\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.input.default.enabled.fg, color.input.default.hovered.fg, color.input.default.disabled.fg, color.input.default.readOnly.fg);
4308
4418
  }
4309
4419
  const selectStyle = {
4310
4420
  root: rootStyle,
@@ -4321,7 +4431,7 @@ const Select = react.forwardRef(function Select2(props, forwardedRef) {
4321
4431
  disabled,
4322
4432
  fontSize = 2,
4323
4433
  padding = 3,
4324
- radius = 1,
4434
+ radius = 2,
4325
4435
  readOnly,
4326
4436
  space = 3,
4327
4437
  ...restProps
@@ -4388,32 +4498,32 @@ const Stack = react.forwardRef(function Stack2(props, ref) {
4388
4498
  ref
4389
4499
  });
4390
4500
  });
4391
- var __freeze$i = Object.freeze;
4392
- var __defProp$i = Object.defineProperty;
4393
- var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", {
4394
- value: __freeze$i(raw || cooked.slice())
4501
+ var __freeze$j = Object.freeze;
4502
+ var __defProp$j = Object.defineProperty;
4503
+ var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", {
4504
+ value: __freeze$j(raw || cooked.slice())
4395
4505
  }));
4396
- var _a$i, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
4506
+ var _a$j, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
4397
4507
  function switchBaseStyles() {
4398
- return styled.css(_a$i || (_a$i = __template$i(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
4508
+ return styled.css(_a$j || (_a$j = __template$j(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
4399
4509
  }
4400
4510
  function switchInputStyles() {
4401
- return styled.css(_b$b || (_b$b = __template$i(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n padding: 0;\n margin: 0;\n\n /* Place the input element above the representation element */\n z-index: 1;\n "])));
4511
+ return styled.css(_b$b || (_b$b = __template$j(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n padding: 0;\n margin: 0;\n\n /* Place the input element above the representation element */\n z-index: 1;\n "])));
4402
4512
  }
4403
4513
  function switchRepresentationStyles(props) {
4404
4514
  const {
4405
4515
  color,
4406
4516
  input
4407
4517
  } = theme.getTheme_v2(props.theme);
4408
- return styled.css(_c$5 || (_c$5 = __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 "])), color.input.default.enabled.border, color.input.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
4518
+ return styled.css(_c$5 || (_c$5 = __template$j(["\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\n input:checked[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.input.default.enabled.border, color.input.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
4409
4519
  focusRing: input.switch.focusRing
4410
- }), color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.hovered.border, color.input.default.hovered.bg, color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.disabled.border, color.input.default.disabled.bg, color.input.default.readOnly.border, color.input.default.readOnly.bg);
4520
+ }), color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.hovered.border, color.input.default.hovered.bg, color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.disabled.border, color.input.default.disabled.bg, color.input.default.readOnly.border, color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.default.readOnly.bg);
4411
4521
  }
4412
4522
  function switchTrackStyles(props) {
4413
4523
  const {
4414
4524
  input
4415
4525
  } = theme.getTheme_v2(props.theme);
4416
- return styled.css(_d$4 || (_d$4 = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "])), rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2));
4526
+ return styled.css(_d$4 || (_d$4 = __template$j(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "])), rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2));
4417
4527
  }
4418
4528
  function switchThumbStyles(props) {
4419
4529
  const {
@@ -4429,7 +4539,7 @@ function switchThumbStyles(props) {
4429
4539
  const checkedOffset = trackWidth - trackPadding * 2 - size;
4430
4540
  const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
4431
4541
  const checked = $indeterminate !== true && props.$checked === true;
4432
- return styled.css(_g || (_g = __template$i(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$i(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
4542
+ return styled.css(_g || (_g = __template$j(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_e$2 || (_e$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_f$2 || (_f$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
4433
4543
  }
4434
4544
  const Root$d = styled__default.default.span(switchBaseStyles);
4435
4545
  const Input$2 = styled__default.default.input(switchInputStyles);
@@ -4473,14 +4583,14 @@ const Switch = react.forwardRef(function Switch2(props, forwardedRef) {
4473
4583
  })]
4474
4584
  });
4475
4585
  });
4476
- var __freeze$h = Object.freeze;
4477
- var __defProp$h = Object.defineProperty;
4478
- var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", {
4479
- value: __freeze$h(raw || cooked.slice())
4586
+ var __freeze$i = Object.freeze;
4587
+ var __defProp$i = Object.defineProperty;
4588
+ var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", {
4589
+ value: __freeze$i(raw || cooked.slice())
4480
4590
  }));
4481
- var _a$h;
4591
+ var _a$i;
4482
4592
  const Root$c = styled__default.default.span(textInputRootStyle);
4483
- const InputRoot$1 = styled__default.default.span(_a$h || (_a$h = __template$h(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
4593
+ const InputRoot$1 = styled__default.default.span(_a$i || (_a$i = __template$i(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
4484
4594
  const Input$1 = styled__default.default.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
4485
4595
  const Presentation$1 = styled__default.default.div(responsiveRadiusStyle, textInputRepresentationStyle);
4486
4596
  const TextArea = react.forwardRef(function TextArea2(props, forwardedRef) {
@@ -4524,30 +4634,30 @@ const TextArea = react.forwardRef(function TextArea2(props, forwardedRef) {
4524
4634
  })
4525
4635
  });
4526
4636
  });
4527
- var __freeze$g = Object.freeze;
4528
- var __defProp$g = Object.defineProperty;
4529
- var __template$g = (cooked, raw) => __freeze$g(__defProp$g(cooked, "raw", {
4530
- value: __freeze$g(raw || cooked.slice())
4637
+ var __freeze$h = Object.freeze;
4638
+ var __defProp$h = Object.defineProperty;
4639
+ var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", {
4640
+ value: __freeze$h(raw || cooked.slice())
4531
4641
  }));
4532
- var _a$g, _b$a, _c$4, _d$3, _e$1, _f$1;
4642
+ var _a$h, _b$a, _c$4, _d$3, _e$1, _f$1;
4533
4643
  const CLEAR_BUTTON_BOX_STYLE = {
4534
4644
  zIndex: 2
4535
4645
  };
4536
4646
  const Root$b = styled__default.default(Card).attrs({
4537
4647
  forwardedAs: "span"
4538
4648
  })(textInputRootStyle);
4539
- const InputRoot = styled__default.default.span(_a$g || (_a$g = __template$g(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
4649
+ const InputRoot = styled__default.default.span(_a$h || (_a$h = __template$h(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
4540
4650
  const Prefix = styled__default.default(Card).attrs({
4541
4651
  forwardedAs: "span"
4542
- })(_b$a || (_b$a = __template$g(["\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
4652
+ })(_b$a || (_b$a = __template$h(["\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
4543
4653
  const Suffix = styled__default.default(Card).attrs({
4544
4654
  forwardedAs: "span"
4545
- })(_c$4 || (_c$4 = __template$g(["\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
4655
+ })(_c$4 || (_c$4 = __template$h(["\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
4546
4656
  const Input = styled__default.default.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
4547
4657
  const Presentation = styled__default.default.span(responsiveRadiusStyle, textInputRepresentationStyle);
4548
- const LeftBox = styled__default.default(Box)(_d$3 || (_d$3 = __template$g(["\n position: absolute;\n top: 0;\n left: 0;\n"])));
4549
- const RightBox = styled__default.default(Box)(_e$1 || (_e$1 = __template$g(["\n position: absolute;\n top: 0;\n right: 0;\n"])));
4550
- const RightCard = styled__default.default(Card)(_f$1 || (_f$1 = __template$g(["\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n"])));
4658
+ const LeftBox = styled__default.default(Box)(_d$3 || (_d$3 = __template$h(["\n position: absolute;\n top: 0;\n left: 0;\n"])));
4659
+ const RightBox = styled__default.default(Box)(_e$1 || (_e$1 = __template$h(["\n position: absolute;\n top: 0;\n right: 0;\n"])));
4660
+ const RightCard = styled__default.default(Card)(_f$1 || (_f$1 = __template$h(["\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n"])));
4551
4661
  const TextInputClearButton = styled__default.default(Button)({
4552
4662
  "&:not([hidden])": {
4553
4663
  display: "block"
@@ -4715,17 +4825,6 @@ function useDelayedState(initialState) {
4715
4825
  }, []);
4716
4826
  return [state, onStateChange];
4717
4827
  }
4718
- function ConditionalWrapper(_ref5) {
4719
- let {
4720
- children,
4721
- condition,
4722
- wrapper
4723
- } = _ref5;
4724
- if (!condition) {
4725
- return children;
4726
- }
4727
- return wrapper(children);
4728
- }
4729
4828
  const DEFAULT_TOOLTIP_ARROW_WIDTH = 15;
4730
4829
  const DEFAULT_TOOLTIP_ARROW_HEIGHT = 6;
4731
4830
  const DEFAULT_TOOLTIP_ARROW_RADIUS = 2;
@@ -4745,6 +4844,64 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
4745
4844
  "right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
4746
4845
  "right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
4747
4846
  };
4847
+ var __freeze$g = Object.freeze;
4848
+ var __defProp$g = Object.defineProperty;
4849
+ var __template$g = (cooked, raw) => __freeze$g(__defProp$g(cooked, "raw", {
4850
+ value: __freeze$g(raw || cooked.slice())
4851
+ }));
4852
+ var _a$g;
4853
+ const MotionCard = styled__default.default(framerMotion.motion(Card))(_a$g || (_a$g = __template$g(["\n & > * {\n opacity: var(", ", 1);\n will-change: opacity;\n }\n"])), POPOVER_MOTION_CONTENT_OPACITY_PROPERTY);
4854
+ const TooltipCard = react.memo(react.forwardRef(function TooltipCard2(props, ref) {
4855
+ const {
4856
+ animate,
4857
+ arrow,
4858
+ arrowRef,
4859
+ arrowX,
4860
+ arrowY,
4861
+ children,
4862
+ originX,
4863
+ originY,
4864
+ padding,
4865
+ placement,
4866
+ radius,
4867
+ scheme,
4868
+ shadow,
4869
+ style,
4870
+ ...restProps
4871
+ } = props;
4872
+ const rootStyle = react.useMemo(() => ({
4873
+ originX,
4874
+ originY,
4875
+ willChange: animate ? "transform" : void 0,
4876
+ ...style
4877
+ }), [animate, originX, originY, style]);
4878
+ const arrowStyle = react.useMemo(() => ({
4879
+ left: arrowX !== null ? arrowX : void 0,
4880
+ top: arrowY !== null ? arrowY : void 0,
4881
+ right: void 0,
4882
+ bottom: void 0
4883
+ }), [arrowX, arrowY]);
4884
+ return /* @__PURE__ */jsxRuntime.jsxs(MotionCard, {
4885
+ "data-ui": "Tooltip__card",
4886
+ ...restProps,
4887
+ "data-placement": placement,
4888
+ padding,
4889
+ radius,
4890
+ ref,
4891
+ scheme,
4892
+ shadow,
4893
+ style: rootStyle,
4894
+ ...(animate ? POPOVER_MOTION_PROPS : {}),
4895
+ children: [children, arrow && /* @__PURE__ */jsxRuntime.jsx(Arrow, {
4896
+ ref: arrowRef,
4897
+ style: arrowStyle,
4898
+ width: DEFAULT_TOOLTIP_ARROW_WIDTH,
4899
+ height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
4900
+ radius: DEFAULT_TOOLTIP_ARROW_RADIUS
4901
+ })]
4902
+ });
4903
+ }));
4904
+ TooltipCard.displayName = "TooltipCard";
4748
4905
  const key$4 = Symbol.for("@sanity/ui/context/tooltipDelayGroup");
4749
4906
  globalScope[key$4] = globalScope[key$4] || react.createContext(null);
4750
4907
  const TooltipDelayGroupContext = globalScope[key$4];
@@ -4781,19 +4938,20 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
4781
4938
  value: __freeze$f(raw || cooked.slice())
4782
4939
  }));
4783
4940
  var _a$f;
4784
- const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref6 => {
4941
+ const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref7 => {
4785
4942
  let {
4786
4943
  $maxWidth
4787
- } = _ref6;
4944
+ } = _ref7;
4788
4945
  return $maxWidth;
4789
4946
  });
4790
4947
  const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4791
- var _a2, _b, _c, _d, _e;
4948
+ var _a2, _b, _c, _d, _e, _f, _g;
4792
4949
  const boundaryElementContext = useBoundaryElement();
4793
4950
  const {
4794
4951
  layer
4795
4952
  } = useTheme_v2();
4796
4953
  const {
4954
+ animate = false,
4797
4955
  arrow: arrowProp = false,
4798
4956
  boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
4799
4957
  children: childProp,
@@ -4808,7 +4966,6 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4808
4966
  shadow = 2,
4809
4967
  zOffset = layer.tooltip.zOffset,
4810
4968
  delay,
4811
- animate = false,
4812
4969
  ...restProps
4813
4970
  } = props;
4814
4971
  const fallbackPlacements = useArrayProp(fallbackPlacementsProp);
@@ -4844,8 +5001,11 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4844
5001
  padding: DEFAULT_TOOLTIP_PADDING
4845
5002
  }));
4846
5003
  }
5004
+ if (animate) {
5005
+ ret.push(origin);
5006
+ }
4847
5007
  return ret;
4848
- }, [arrowProp, boundaryElement, fallbackPlacements]);
5008
+ }, [animate, arrowProp, boundaryElement, fallbackPlacements]);
4849
5009
  const {
4850
5010
  floatingStyles,
4851
5011
  placement,
@@ -4859,12 +5019,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4859
5019
  });
4860
5020
  const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
4861
5021
  const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
4862
- const arrowStyle = react.useMemo(() => ({
4863
- left: arrowX !== null ? arrowX : void 0,
4864
- top: arrowY !== null ? arrowY : void 0,
4865
- right: void 0,
4866
- bottom: void 0
4867
- }), [arrowX, arrowY]);
5022
+ const originX = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originX;
5023
+ const originY = (_g = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _g.originY;
4868
5024
  const tooltipId = react.useId();
4869
5025
  const [isOpen, setIsOpen] = useDelayedState(false);
4870
5026
  const delayGroupContext = useTooltipDelayGroup();
@@ -4986,53 +5142,33 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
4986
5142
  }, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
4987
5143
  if (!child) return /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {});
4988
5144
  if (disabled) return child;
4989
- const root = /* @__PURE__ */jsxRuntime.jsx(Root$a, {
5145
+ const tooltip = /* @__PURE__ */jsxRuntime.jsx(Root$a, {
4990
5146
  "data-ui": "Tooltip",
4991
5147
  ...restProps,
4992
5148
  ref: setFloating,
4993
5149
  style: floatingStyles,
4994
5150
  zOffset,
4995
5151
  $maxWidth: tooltipWidth,
4996
- children: /* @__PURE__ */jsxRuntime.jsx(ConditionalWrapper, {
4997
- condition: animate,
4998
- wrapper: children => /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
4999
- initial: {
5000
- opacity: 0.5,
5001
- scale: 0.95
5002
- },
5003
- animate: {
5004
- opacity: 1,
5005
- scale: 1
5006
- },
5007
- exit: {
5008
- opacity: 0,
5009
- scale: 0.95
5010
- },
5011
- transition: {
5012
- duration: 0.3,
5013
- type: "spring"
5014
- },
5015
- children
5016
- }),
5017
- children: /* @__PURE__ */jsxRuntime.jsxs(Card, {
5018
- "data-ui": "Tooltip__card",
5019
- "data-placement": placement,
5020
- padding,
5021
- radius,
5022
- scheme,
5023
- shadow,
5024
- children: [content, arrowProp && /* @__PURE__ */jsxRuntime.jsx(Arrow, {
5025
- ref: setArrow,
5026
- style: arrowStyle,
5027
- width: DEFAULT_TOOLTIP_ARROW_WIDTH,
5028
- height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
5029
- radius: DEFAULT_TOOLTIP_ARROW_RADIUS
5030
- })]
5031
- })
5152
+ children: /* @__PURE__ */jsxRuntime.jsx(TooltipCard, {
5153
+ ...restProps,
5154
+ animate,
5155
+ arrow: arrowProp,
5156
+ arrowRef: setArrow,
5157
+ arrowX,
5158
+ arrowY,
5159
+ originX,
5160
+ originY,
5161
+ padding,
5162
+ placement,
5163
+ radius,
5164
+ ref: setFloating,
5165
+ scheme,
5166
+ shadow,
5167
+ children: content
5032
5168
  })
5033
5169
  });
5034
5170
  return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
5035
- children: [child, /* @__PURE__ */jsxRuntime.jsx(ConditionalWrapper, {
5171
+ children: [/* @__PURE__ */jsxRuntime.jsx(ConditionalWrapper, {
5036
5172
  condition: animate,
5037
5173
  wrapper: children => /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
5038
5174
  children
@@ -5043,9 +5179,9 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
5043
5179
  __unstable_name: typeof portalProp === "string" ? portalProp : void 0,
5044
5180
  children
5045
5181
  }),
5046
- children: root
5182
+ children: tooltip
5047
5183
  })
5048
- })]
5184
+ }), child]
5049
5185
  });
5050
5186
  });
5051
5187
  var __freeze$e = Object.freeze;
@@ -5202,10 +5338,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
5202
5338
  query,
5203
5339
  value
5204
5340
  } = state;
5205
- const defaultRenderOption = react.useCallback(_ref7 => {
5341
+ const defaultRenderOption = react.useCallback(_ref8 => {
5206
5342
  let {
5207
5343
  value: value2
5208
- } = _ref7;
5344
+ } = _ref8;
5209
5345
  return /* @__PURE__ */jsxRuntime.jsx(Card, {
5210
5346
  "data-as": "button",
5211
5347
  padding: paddingProp,
@@ -5664,10 +5800,10 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
5664
5800
  value: __freeze$c(raw || cooked.slice())
5665
5801
  }));
5666
5802
  var _a$c, _b$7;
5667
- function dialogStyle(_ref8) {
5803
+ function dialogStyle(_ref9) {
5668
5804
  let {
5669
5805
  theme: theme$1
5670
- } = _ref8;
5806
+ } = _ref9;
5671
5807
  const {
5672
5808
  color
5673
5809
  } = theme.getTheme_v2(theme$1);
@@ -5696,7 +5832,7 @@ function responsiveDialogPositionStyle(props) {
5696
5832
  }));
5697
5833
  }
5698
5834
  function animationDialogStyle(props) {
5699
- if (!props.animate) return styled.css(_a$c || (_a$c = __template$c([""])));
5835
+ if (!props.$animate) return styled.css(_a$c || (_a$c = __template$c([""])));
5700
5836
  return styled.css(_b$7 || (_b$7 = __template$c(["\n @keyframes zoomIn {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n animation: fadeIn 200ms ease-out;\n // Animates the dialog card.\n & > [data-ui='DialogCard'] {\n animation: zoomIn 200ms ease-out;\n }\n "])));
5701
5837
  }
5702
5838
  const key$3 = Symbol.for("@sanity/ui/context/dialog");
@@ -5919,6 +6055,7 @@ const Dialog = react.forwardRef(function Dialog2(props, ref) {
5919
6055
  __unstable_name: portalProp,
5920
6056
  children: /* @__PURE__ */jsxRuntime.jsxs(Root$7, {
5921
6057
  ...restProps,
6058
+ $animate: animate,
5922
6059
  $padding: padding,
5923
6060
  $position: position,
5924
6061
  "aria-labelledby": labelId,
@@ -5931,7 +6068,6 @@ const Dialog = react.forwardRef(function Dialog2(props, ref) {
5931
6068
  ref,
5932
6069
  role: "dialog",
5933
6070
  zOffset,
5934
- animate,
5935
6071
  children: [/* @__PURE__ */jsxRuntime.jsx("div", {
5936
6072
  ref: preDivRef,
5937
6073
  tabIndex: 0
@@ -6335,6 +6471,9 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
6335
6471
  setOpen(v => !v);
6336
6472
  setShouldFocus(null);
6337
6473
  }, []);
6474
+ const handleMouseDown = react.useCallback(event => {
6475
+ if (open) event.preventDefault();
6476
+ }, [open]);
6338
6477
  const handleButtonKeyDown = react.useCallback(event => {
6339
6478
  if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
6340
6479
  event.preventDefault();
@@ -6418,11 +6557,12 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
6418
6557
  id,
6419
6558
  onClick: handleButtonClick,
6420
6559
  onKeyDown: handleButtonKeyDown,
6560
+ onMouseDown: handleMouseDown,
6421
6561
  "aria-haspopup": true,
6422
6562
  "aria-expanded": open,
6423
6563
  ref: setButtonRef,
6424
6564
  selected: open
6425
- }) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
6565
+ }) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef]);
6426
6566
  const popoverProps = react.useMemo(() => ({
6427
6567
  boundaryElement: deprecated_boundaryElement,
6428
6568
  overflow: "auto",
@@ -6737,15 +6877,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
6737
6877
  var _a$6, _b$3, _c$1, _d;
6738
6878
  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"])));
6739
6879
  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);
6740
- 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"])), _ref9 => {
6880
+ 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"])), _ref10 => {
6741
6881
  let {
6742
6882
  $visible
6743
- } = _ref9;
6883
+ } = _ref10;
6744
6884
  return $visible ? 1 : 0;
6745
- }, _ref10 => {
6885
+ }, _ref11 => {
6746
6886
  let {
6747
6887
  $animated
6748
- } = _ref10;
6888
+ } = _ref11;
6749
6889
  return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
6750
6890
  });
6751
6891
  const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
@@ -6977,13 +7117,19 @@ const STATUS_CARD_TONE = {
6977
7117
  success: "positive",
6978
7118
  info: "primary"
6979
7119
  };
7120
+ const BUTTON_TONE = {
7121
+ error: "critical",
7122
+ warning: "caution",
7123
+ success: "positive",
7124
+ info: "primary"
7125
+ };
6980
7126
  const ROLES = {
6981
7127
  error: "alert",
6982
7128
  warning: "alert",
6983
7129
  success: "alert",
6984
7130
  info: "alert"
6985
7131
  };
6986
- const Root$2 = styled__default.default(Card)(_a$3 || (_a$3 = __template$3(["\n pointer-events: all;\n"])));
7132
+ const Root$2 = styled__default.default(Card)(_a$3 || (_a$3 = __template$3(["\n pointer-events: all;\n & > * {\n opacity: var(", ", 1);\n will-change: opacity;\n }\n"])), POPOVER_MOTION_CONTENT_OPACITY_PROPERTY);
6987
7133
  const TextBox = styled__default.default(Flex)(_b$2 || (_b$2 = __template$3(["\n overflow-x: auto;\n"])));
6988
7134
  function Toast(props) {
6989
7135
  const {
@@ -6996,6 +7142,7 @@ function Toast(props) {
6996
7142
  ...restProps
6997
7143
  } = props;
6998
7144
  const cardTone = status ? STATUS_CARD_TONE[status] : "default";
7145
+ const buttonTone = status ? BUTTON_TONE[status] : "default";
6999
7146
  const role = status ? ROLES[status] : "status";
7000
7147
  return /* @__PURE__ */jsxRuntime.jsx(Root$2, {
7001
7148
  "data-ui": "Toast",
@@ -7029,6 +7176,7 @@ function Toast(props) {
7029
7176
  icon: icons.CloseIcon,
7030
7177
  mode: "bleed",
7031
7178
  padding: 2,
7179
+ tone: buttonTone,
7032
7180
  onClick: onClose,
7033
7181
  style: {
7034
7182
  verticalAlign: "top"
@@ -7130,20 +7278,22 @@ function ToastProvider(props) {
7130
7278
  paddingY,
7131
7279
  children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
7132
7280
  initial: false,
7133
- children: state.map(_ref11 => {
7281
+ children: state.map(_ref12 => {
7134
7282
  let {
7135
7283
  dismiss,
7136
7284
  id,
7137
7285
  params
7138
- } = _ref11;
7286
+ } = _ref12;
7139
7287
  return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
7140
7288
  animate: {
7141
- opacity: 1,
7289
+ opacity: [0, 1, 1],
7290
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
7142
7291
  y: 0,
7143
7292
  scale: 1
7144
7293
  },
7145
7294
  exit: {
7146
- opacity: 0,
7295
+ opacity: [1, 1, 0],
7296
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
7147
7297
  scale: 0.5,
7148
7298
  transition: {
7149
7299
  duration: 0.2
@@ -7151,8 +7301,10 @@ function ToastProvider(props) {
7151
7301
  },
7152
7302
  initial: {
7153
7303
  opacity: 0,
7304
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
7154
7305
  y: 32,
7155
- scale: 0.25
7306
+ scale: 0.25,
7307
+ willChange: "transform"
7156
7308
  },
7157
7309
  layout: "position",
7158
7310
  transition: {
@@ -7629,222 +7781,6 @@ const TreeItem = react.memo(function TreeItem2(props) {
7629
7781
  })]
7630
7782
  });
7631
7783
  });
7632
- Object.defineProperty(exports, 'COLOR_CONFIG_BLEND_KEYS', {
7633
- enumerable: true,
7634
- get: function () {
7635
- return theme.COLOR_CONFIG_BLEND_KEYS;
7636
- }
7637
- });
7638
- Object.defineProperty(exports, 'COLOR_CONFIG_CARD_KEYS', {
7639
- enumerable: true,
7640
- get: function () {
7641
- return theme.COLOR_CONFIG_CARD_KEYS;
7642
- }
7643
- });
7644
- Object.defineProperty(exports, 'COLOR_CONFIG_CARD_TONES', {
7645
- enumerable: true,
7646
- get: function () {
7647
- return theme.COLOR_CONFIG_CARD_TONES;
7648
- }
7649
- });
7650
- Object.defineProperty(exports, 'COLOR_CONFIG_STATE_KEYS', {
7651
- enumerable: true,
7652
- get: function () {
7653
- return theme.COLOR_CONFIG_STATE_KEYS;
7654
- }
7655
- });
7656
- Object.defineProperty(exports, 'COLOR_CONFIG_STATE_TONES', {
7657
- enumerable: true,
7658
- get: function () {
7659
- return theme.COLOR_CONFIG_STATE_TONES;
7660
- }
7661
- });
7662
- Object.defineProperty(exports, 'THEME_COLOR_BLEND_MODES', {
7663
- enumerable: true,
7664
- get: function () {
7665
- return theme.THEME_COLOR_BLEND_MODES;
7666
- }
7667
- });
7668
- Object.defineProperty(exports, 'THEME_COLOR_BUTTON_MODES', {
7669
- enumerable: true,
7670
- get: function () {
7671
- return theme.THEME_COLOR_BUTTON_MODES;
7672
- }
7673
- });
7674
- Object.defineProperty(exports, 'THEME_COLOR_CARD_TONES', {
7675
- enumerable: true,
7676
- get: function () {
7677
- return theme.THEME_COLOR_CARD_TONES;
7678
- }
7679
- });
7680
- Object.defineProperty(exports, 'THEME_COLOR_STATES', {
7681
- enumerable: true,
7682
- get: function () {
7683
- return theme.THEME_COLOR_STATES;
7684
- }
7685
- });
7686
- Object.defineProperty(exports, 'THEME_COLOR_STATE_TONES', {
7687
- enumerable: true,
7688
- get: function () {
7689
- return theme.THEME_COLOR_STATE_TONES;
7690
- }
7691
- });
7692
- Object.defineProperty(exports, 'buildTheme', {
7693
- enumerable: true,
7694
- get: function () {
7695
- return theme.buildTheme;
7696
- }
7697
- });
7698
- Object.defineProperty(exports, 'createColorTheme', {
7699
- enumerable: true,
7700
- get: function () {
7701
- return theme.createColorTheme;
7702
- }
7703
- });
7704
- Object.defineProperty(exports, 'hexToRgb', {
7705
- enumerable: true,
7706
- get: function () {
7707
- return theme.hexToRgb;
7708
- }
7709
- });
7710
- Object.defineProperty(exports, 'hslToRgb', {
7711
- enumerable: true,
7712
- get: function () {
7713
- return theme.hslToRgb;
7714
- }
7715
- });
7716
- Object.defineProperty(exports, 'isColorBlendModeValue', {
7717
- enumerable: true,
7718
- get: function () {
7719
- return theme.isColorBlendModeValue;
7720
- }
7721
- });
7722
- Object.defineProperty(exports, 'isColorButtonMode', {
7723
- enumerable: true,
7724
- get: function () {
7725
- return theme.isColorButtonMode;
7726
- }
7727
- });
7728
- Object.defineProperty(exports, 'isColorConfigBaseKey', {
7729
- enumerable: true,
7730
- get: function () {
7731
- return theme.isColorConfigBaseKey;
7732
- }
7733
- });
7734
- Object.defineProperty(exports, 'isColorConfigBaseTone', {
7735
- enumerable: true,
7736
- get: function () {
7737
- return theme.isColorConfigBaseTone;
7738
- }
7739
- });
7740
- Object.defineProperty(exports, 'isColorConfigBlendKey', {
7741
- enumerable: true,
7742
- get: function () {
7743
- return theme.isColorConfigBlendKey;
7744
- }
7745
- });
7746
- Object.defineProperty(exports, 'isColorConfigStateKey', {
7747
- enumerable: true,
7748
- get: function () {
7749
- return theme.isColorConfigStateKey;
7750
- }
7751
- });
7752
- Object.defineProperty(exports, 'isColorConfigStateTone', {
7753
- enumerable: true,
7754
- get: function () {
7755
- return theme.isColorConfigStateTone;
7756
- }
7757
- });
7758
- Object.defineProperty(exports, 'isColorHueKey', {
7759
- enumerable: true,
7760
- get: function () {
7761
- return theme.isColorHueKey;
7762
- }
7763
- });
7764
- Object.defineProperty(exports, 'isColorOpacityValue', {
7765
- enumerable: true,
7766
- get: function () {
7767
- return theme.isColorOpacityValue;
7768
- }
7769
- });
7770
- Object.defineProperty(exports, 'isColorTintKey', {
7771
- enumerable: true,
7772
- get: function () {
7773
- return theme.isColorTintKey;
7774
- }
7775
- });
7776
- Object.defineProperty(exports, 'isColorTokenValue', {
7777
- enumerable: true,
7778
- get: function () {
7779
- return theme.isColorTokenValue;
7780
- }
7781
- });
7782
- Object.defineProperty(exports, 'isColorValue', {
7783
- enumerable: true,
7784
- get: function () {
7785
- return theme.isColorValue;
7786
- }
7787
- });
7788
- Object.defineProperty(exports, 'multiply', {
7789
- enumerable: true,
7790
- get: function () {
7791
- return theme.multiply;
7792
- }
7793
- });
7794
- Object.defineProperty(exports, 'parseColor', {
7795
- enumerable: true,
7796
- get: function () {
7797
- return theme.parseColor;
7798
- }
7799
- });
7800
- Object.defineProperty(exports, 'parseTokenKey', {
7801
- enumerable: true,
7802
- get: function () {
7803
- return theme.parseTokenKey;
7804
- }
7805
- });
7806
- Object.defineProperty(exports, 'parseTokenValue', {
7807
- enumerable: true,
7808
- get: function () {
7809
- return theme.parseTokenValue;
7810
- }
7811
- });
7812
- Object.defineProperty(exports, 'rgbToHex', {
7813
- enumerable: true,
7814
- get: function () {
7815
- return theme.rgbToHex;
7816
- }
7817
- });
7818
- Object.defineProperty(exports, 'rgbToHsl', {
7819
- enumerable: true,
7820
- get: function () {
7821
- return theme.rgbToHsl;
7822
- }
7823
- });
7824
- Object.defineProperty(exports, 'rgba', {
7825
- enumerable: true,
7826
- get: function () {
7827
- return theme.rgba;
7828
- }
7829
- });
7830
- Object.defineProperty(exports, 'rgbaToRGBA', {
7831
- enumerable: true,
7832
- get: function () {
7833
- return theme.rgbaToRGBA;
7834
- }
7835
- });
7836
- Object.defineProperty(exports, 'screen', {
7837
- enumerable: true,
7838
- get: function () {
7839
- return theme.screen;
7840
- }
7841
- });
7842
- Object.defineProperty(exports, 'studioTheme', {
7843
- enumerable: true,
7844
- get: function () {
7845
- return theme.defaultTheme;
7846
- }
7847
- });
7848
7784
  exports.Arrow = Arrow;
7849
7785
  exports.Autocomplete = Autocomplete;
7850
7786
  exports.Avatar = Avatar;
@@ -7859,6 +7795,7 @@ exports.Card = Card;
7859
7795
  exports.Checkbox = Checkbox;
7860
7796
  exports.Code = Code;
7861
7797
  exports.CodeSkeleton = CodeSkeleton;
7798
+ exports.ConditionalWrapper = ConditionalWrapper;
7862
7799
  exports.Container = Container;
7863
7800
  exports.Dialog = Dialog;
7864
7801
  exports.DialogContext = DialogContext;
@@ -7921,8 +7858,11 @@ exports._raf2 = _raf2;
7921
7858
  exports._responsive = _responsive;
7922
7859
  exports.attemptFocus = attemptFocus;
7923
7860
  exports.containsOrEqualsElement = containsOrEqualsElement;
7861
+ exports.createColorTheme = createColorTheme;
7924
7862
  exports.focusFirstDescendant = focusFirstDescendant;
7925
7863
  exports.focusLastDescendant = focusLastDescendant;
7864
+ exports.hexToRgb = hexToRgb;
7865
+ exports.hslToRgb = hslToRgb;
7926
7866
  exports.isFocusable = isFocusable;
7927
7867
  exports.isHTMLAnchorElement = isHTMLAnchorElement;
7928
7868
  exports.isHTMLButtonElement = isHTMLButtonElement;
@@ -7930,12 +7870,19 @@ exports.isHTMLElement = isHTMLElement;
7930
7870
  exports.isHTMLInputElement = isHTMLInputElement;
7931
7871
  exports.isHTMLSelectElement = isHTMLSelectElement;
7932
7872
  exports.isHTMLTextAreaElement = isHTMLTextAreaElement;
7873
+ exports.multiply = multiply;
7874
+ exports.parseColor = parseColor;
7933
7875
  exports.rem = rem;
7934
7876
  exports.responsiveCodeFontStyle = responsiveCodeFontStyle;
7935
7877
  exports.responsiveHeadingFont = responsiveHeadingFont;
7936
7878
  exports.responsiveLabelFont = responsiveLabelFont;
7937
7879
  exports.responsiveTextAlignStyle = responsiveTextAlignStyle;
7938
7880
  exports.responsiveTextFont = responsiveTextFont;
7881
+ exports.rgbToHex = rgbToHex;
7882
+ exports.rgbToHsl = rgbToHsl;
7883
+ exports.rgba = rgba;
7884
+ exports.screen = screen;
7885
+ exports.studioTheme = studioTheme;
7939
7886
  exports.useArrayProp = useArrayProp;
7940
7887
  exports.useBoundaryElement = useBoundaryElement;
7941
7888
  exports.useClickOutside = useClickOutside;