@sanity/ui 2.0.0-alpha.36 → 2.0.0-alpha.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/theme.js CHANGED
@@ -1684,7 +1684,10 @@ function getTheme_v2(theme) {
1684
1684
  if (cached_v2) return cached_v2;
1685
1685
  const v2 = {
1686
1686
  _version: 2,
1687
- avatar: theme.sanity.avatar,
1687
+ avatar: {
1688
+ ...defaultThemeConfig.avatar,
1689
+ ...theme.sanity.avatar
1690
+ },
1688
1691
  button: {
1689
1692
  ...defaultThemeConfig.button,
1690
1693
  ...theme.sanity.button
@@ -1693,7 +1696,22 @@ function getTheme_v2(theme) {
1693
1696
  color: themeColor_v0_v2(theme.sanity.color),
1694
1697
  container: theme.sanity.container,
1695
1698
  font: theme.sanity.fonts,
1696
- input: theme.sanity.input,
1699
+ input: {
1700
+ ...defaultThemeConfig.input,
1701
+ ...theme.sanity.input,
1702
+ checkbox: {
1703
+ ...defaultThemeConfig.input.checkbox,
1704
+ ...theme.sanity.input.checkbox
1705
+ },
1706
+ radio: {
1707
+ ...defaultThemeConfig.input.radio,
1708
+ ...theme.sanity.input.radio
1709
+ },
1710
+ switch: {
1711
+ ...defaultThemeConfig.input.switch,
1712
+ ...theme.sanity.input.switch
1713
+ }
1714
+ },
1697
1715
  layer: (_a = theme.sanity.layer) != null ? _a : defaultThemeConfig.layer,
1698
1716
  media: theme.sanity.media,
1699
1717
  radius: theme.sanity.radius,
@@ -1733,7 +1751,10 @@ function v0_v2(v0) {
1733
1751
  } = v0;
1734
1752
  const v2 = {
1735
1753
  _version: 2,
1736
- avatar,
1754
+ avatar: {
1755
+ ...defaultThemeConfig.avatar,
1756
+ ...avatar
1757
+ },
1737
1758
  button: {
1738
1759
  ...defaultThemeConfig.button,
1739
1760
  ...button
@@ -1759,7 +1780,22 @@ function v0_v2(v0) {
1759
1780
  },
1760
1781
  container,
1761
1782
  font,
1762
- input,
1783
+ input: {
1784
+ ...defaultThemeConfig.input,
1785
+ ...input,
1786
+ checkbox: {
1787
+ ...defaultThemeConfig.input.checkbox,
1788
+ ...input.checkbox
1789
+ },
1790
+ radio: {
1791
+ ...defaultThemeConfig.input.radio,
1792
+ ...input.radio
1793
+ },
1794
+ switch: {
1795
+ ...defaultThemeConfig.input.switch,
1796
+ ...input.switch
1797
+ }
1798
+ },
1763
1799
  layer: layer != null ? layer : defaultThemeConfig.layer,
1764
1800
  media,
1765
1801
  radius,
@@ -4245,9 +4281,14 @@ function buildTheme(config) {
4245
4281
  avatar: (_a = config == null ? void 0 : config.avatar) != null ? _a : defaultThemeConfig.avatar,
4246
4282
  button: (_b = config == null ? void 0 : config.button) != null ? _b : defaultThemeConfig.button,
4247
4283
  card: (_c = config == null ? void 0 : config.card) != null ? _c : defaultThemeConfig.card,
4284
+ // How colors are generated:
4285
+ // 1. Merge custom tokens with default tokens
4286
+ // 2. Generate tree of color keys (gray/500, black, white, etc.)
4287
+ // 3. Apply mixing and render to hex values
4288
+ // render(build(mergeWithDefaults()))
4248
4289
  color: renderThemeColorSchemes(colorTheme, config),
4249
4290
  container: (_d = config == null ? void 0 : config.container) != null ? _d : defaultThemeConfig.container,
4250
- font: (_e = config == null ? void 0 : config.fonts) != null ? _e : defaultThemeFonts,
4291
+ font: (_e = config == null ? void 0 : config.font) != null ? _e : defaultThemeFonts,
4251
4292
  input: (_f = config == null ? void 0 : config.input) != null ? _f : defaultThemeConfig.input,
4252
4293
  layer: (_g = config == null ? void 0 : config.layer) != null ? _g : defaultThemeConfig.layer,
4253
4294
  media: (_h = config == null ? void 0 : config.media) != null ? _h : defaultThemeConfig.media,