@sanity/ui 3.0.0-static.6 → 3.0.0-static.8

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 (60) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +53 -53
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +54 -54
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/css.d.mts +207 -185
  7. package/dist/css.d.ts +207 -185
  8. package/dist/css.js +617 -547
  9. package/dist/css.js.map +1 -1
  10. package/dist/css.mjs +617 -547
  11. package/dist/css.mjs.map +1 -1
  12. package/dist/index.js +3 -13
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +3 -13
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/sanity-theme.css +1 -1
  17. package/dist/system.css +1334 -914
  18. package/dist/theme.d.mts +84 -76
  19. package/dist/theme.d.ts +84 -76
  20. package/dist/theme.js +148 -124
  21. package/dist/theme.js.map +1 -1
  22. package/dist/theme.mjs +148 -124
  23. package/dist/theme.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/src/css/aspects/index.ts +1 -0
  26. package/src/css/aspects/minWidth/index.ts +2 -0
  27. package/src/css/aspects/minWidth/minWidth.style.ts +13 -0
  28. package/src/css/aspects/minWidth/minWidth.ts +6 -0
  29. package/src/css/aspects/minWidth/types.ts +7 -0
  30. package/src/css/compile/compileRule.ts +1 -0
  31. package/src/css/compile/compileStyle.ts +1 -1
  32. package/src/css/compile/compileTheme_v3.ts +46 -37
  33. package/src/css/primitives/badge/badge.style.ts +1 -1
  34. package/src/css/primitives/box/box.style.ts +1 -1
  35. package/src/css/primitives/box/box.ts +2 -3
  36. package/src/css/primitives/box/types.ts +2 -0
  37. package/src/css/primitives/button/button.style.ts +20 -0
  38. package/src/css/primitives/card/card.style.ts +116 -44
  39. package/src/css/primitives/card/types.ts +0 -1
  40. package/src/css/primitives/kbd/kbd.style.ts +1 -1
  41. package/src/css/primitives/popover/popover.ts +4 -0
  42. package/src/css/primitives/switch/switch.style.ts +8 -83
  43. package/src/css/primitives/text/text.style.ts +11 -3
  44. package/src/css/system.style.ts +2 -0
  45. package/src/css/types.ts +200 -188
  46. package/src/css/varNames.ts +86 -76
  47. package/src/css/vars.ts +85 -76
  48. package/src/theme/v3/color/buildColor_v3.ts +43 -38
  49. package/src/theme/v3/color/card.ts +43 -38
  50. package/src/theme/v3/color/color.ts +42 -38
  51. package/src/theme/v3/defaults.ts +63 -47
  52. package/src/theme/v3/resolveTokens.ts +43 -38
  53. package/src/theme/versioning/themeColor_v3_v2.ts +1 -1
  54. package/src/ui/components/autocomplete/__workshop__/async.tsx +0 -1
  55. package/src/ui/components/autocomplete/autocomplete.tsx +2 -11
  56. package/src/ui/primitives/box/box.tsx +4 -3
  57. package/src/ui/primitives/card/card.tsx +2 -6
  58. package/src/ui/primitives/kbd/kbd.tsx +2 -2
  59. package/src/ui/primitives/popover/popoverCard.tsx +45 -39
  60. package/src/css/primitives/card/rules.ts +0 -473
package/dist/theme.js CHANGED
@@ -1597,6 +1597,48 @@ function buildColorCard_v3(tokens, options) {
1597
1597
  }, acc;
1598
1598
  }, {}),
1599
1599
  backdrop: renderColor(tokens.backdrop, context),
1600
+ code: {
1601
+ bg: renderColor(tokens.code.bg, context),
1602
+ fg: renderColor(tokens.code.fg, context),
1603
+ token: {
1604
+ atrule: renderColor(tokens.code.token.atrule, context),
1605
+ attrName: renderColor(tokens.code.token.attrName, context),
1606
+ attrValue: renderColor(tokens.code.token.attrValue, context),
1607
+ attribute: renderColor(tokens.code.token.attribute, context),
1608
+ boolean: renderColor(tokens.code.token.boolean, context),
1609
+ builtin: renderColor(tokens.code.token.builtin, context),
1610
+ cdata: renderColor(tokens.code.token.cdata, context),
1611
+ char: renderColor(tokens.code.token.char, context),
1612
+ class: renderColor(tokens.code.token.class, context),
1613
+ className: renderColor(tokens.code.token.className, context),
1614
+ comment: renderColor(tokens.code.token.comment, context),
1615
+ constant: renderColor(tokens.code.token.constant, context),
1616
+ deleted: renderColor(tokens.code.token.deleted, context),
1617
+ doctype: renderColor(tokens.code.token.doctype, context),
1618
+ entity: renderColor(tokens.code.token.entity, context),
1619
+ function: renderColor(tokens.code.token.function, context),
1620
+ hexcode: renderColor(tokens.code.token.hexcode, context),
1621
+ id: renderColor(tokens.code.token.id, context),
1622
+ important: renderColor(tokens.code.token.important, context),
1623
+ inserted: renderColor(tokens.code.token.inserted, context),
1624
+ keyword: renderColor(tokens.code.token.keyword, context),
1625
+ number: renderColor(tokens.code.token.number, context),
1626
+ operator: renderColor(tokens.code.token.operator, context),
1627
+ prolog: renderColor(tokens.code.token.prolog, context),
1628
+ property: renderColor(tokens.code.token.property, context),
1629
+ pseudoClass: renderColor(tokens.code.token.pseudoClass, context),
1630
+ pseudoElement: renderColor(tokens.code.token.pseudoElement, context),
1631
+ punctuation: renderColor(tokens.code.token.punctuation, context),
1632
+ regex: renderColor(tokens.code.token.regex, context),
1633
+ selector: renderColor(tokens.code.token.selector, context),
1634
+ string: renderColor(tokens.code.token.string, context),
1635
+ symbol: renderColor(tokens.code.token.symbol, context),
1636
+ tag: renderColor(tokens.code.token.tag, context),
1637
+ unit: renderColor(tokens.code.token.unit, context),
1638
+ url: renderColor(tokens.code.token.url, context),
1639
+ variable: renderColor(tokens.code.token.variable, context)
1640
+ }
1641
+ },
1600
1642
  focusRing: renderColor(tokens.focusRing, context),
1601
1643
  shadow: {
1602
1644
  outline: renderColor(tokens.shadow.outline, context),
@@ -1608,44 +1650,6 @@ function buildColorCard_v3(tokens, options) {
1608
1650
  from: renderColor(tokens.skeleton.from, context),
1609
1651
  to: renderColor(tokens.skeleton.to, context)
1610
1652
  },
1611
- token: {
1612
- atrule: renderColor(tokens.token.atrule, context),
1613
- attrName: renderColor(tokens.token.attrName, context),
1614
- attrValue: renderColor(tokens.token.attrValue, context),
1615
- attribute: renderColor(tokens.token.attribute, context),
1616
- boolean: renderColor(tokens.token.boolean, context),
1617
- builtin: renderColor(tokens.token.builtin, context),
1618
- cdata: renderColor(tokens.token.cdata, context),
1619
- char: renderColor(tokens.token.char, context),
1620
- class: renderColor(tokens.token.class, context),
1621
- className: renderColor(tokens.token.className, context),
1622
- comment: renderColor(tokens.token.comment, context),
1623
- constant: renderColor(tokens.token.constant, context),
1624
- deleted: renderColor(tokens.token.deleted, context),
1625
- doctype: renderColor(tokens.token.doctype, context),
1626
- entity: renderColor(tokens.token.entity, context),
1627
- function: renderColor(tokens.token.function, context),
1628
- hexcode: renderColor(tokens.token.hexcode, context),
1629
- id: renderColor(tokens.token.id, context),
1630
- important: renderColor(tokens.token.important, context),
1631
- inserted: renderColor(tokens.token.inserted, context),
1632
- keyword: renderColor(tokens.token.keyword, context),
1633
- number: renderColor(tokens.token.number, context),
1634
- operator: renderColor(tokens.token.operator, context),
1635
- prolog: renderColor(tokens.token.prolog, context),
1636
- property: renderColor(tokens.token.property, context),
1637
- pseudoClass: renderColor(tokens.token.pseudoClass, context),
1638
- pseudoElement: renderColor(tokens.token.pseudoElement, context),
1639
- punctuation: renderColor(tokens.token.punctuation, context),
1640
- regex: renderColor(tokens.token.regex, context),
1641
- selector: renderColor(tokens.token.selector, context),
1642
- string: renderColor(tokens.token.string, context),
1643
- symbol: renderColor(tokens.token.symbol, context),
1644
- tag: renderColor(tokens.token.tag, context),
1645
- unit: renderColor(tokens.token.unit, context),
1646
- url: renderColor(tokens.token.url, context),
1647
- variable: renderColor(tokens.token.variable, context)
1648
- },
1649
1653
  variant: {
1650
1654
  solid: {
1651
1655
  ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
@@ -1695,7 +1699,48 @@ const defaultTokens = {
1695
1699
  "*": {
1696
1700
  // backdrop: ['black/0.2', '200/0.2'],
1697
1701
  backdrop: ["black/0.5", "gray/100/0.5"],
1698
- focusRing: ["blue/500", "blue/300"],
1702
+ code: {
1703
+ bg: ["950", "50"],
1704
+ fg: ["300", "700"],
1705
+ token: {
1706
+ atrule: ["purple/300", "purple/600"],
1707
+ attrName: ["green/300", "green/600"],
1708
+ attrValue: ["yellow/300", "yellow/600"],
1709
+ attribute: ["yellow/300", "yellow/600"],
1710
+ boolean: ["purple/300", "purple/600"],
1711
+ builtin: ["purple/300", "purple/600"],
1712
+ cdata: ["yellow/300", "yellow/600"],
1713
+ char: ["yellow/300", "yellow/600"],
1714
+ class: ["orange/300", "orange/600"],
1715
+ className: ["cyan/300", "cyan/600"],
1716
+ comment: ["gray/600", "gray/300"],
1717
+ constant: ["purple/300", "purple/600"],
1718
+ deleted: ["red/300", "red/600"],
1719
+ entity: ["red/300", "red/600"],
1720
+ function: ["green/300", "green/600"],
1721
+ hexcode: ["blue/300", "blue/600"],
1722
+ id: ["purple/300", "purple/600"],
1723
+ important: ["purple/300", "purple/600"],
1724
+ inserted: ["green/300", "green/600"],
1725
+ keyword: ["magenta/300", "magenta/600"],
1726
+ number: ["purple/300", "purple/600"],
1727
+ operator: ["magenta/300", "magenta/600"],
1728
+ prolog: ["gray/300", "gray/600"],
1729
+ property: ["blue/300", "blue/600"],
1730
+ pseudoClass: ["yellow/300", "yellow/600"],
1731
+ pseudoElement: ["yellow/300", "yellow/600"],
1732
+ punctuation: ["gray/300", "gray/600"],
1733
+ regex: ["blue/300", "blue/600"],
1734
+ selector: ["red/300", "red/600"],
1735
+ string: ["yellow/300", "yellow/600"],
1736
+ symbol: ["purple/300", "purple/600"],
1737
+ tag: ["red/300", "red/600"],
1738
+ unit: ["orange/300", "orange/600"],
1739
+ url: ["red/300", "red/600"],
1740
+ variable: ["red/300", "red/600"]
1741
+ }
1742
+ },
1743
+ focusRing: ["blue/500", "blue/500"],
1699
1744
  link: {
1700
1745
  fg: ["blue/400", "blue/600"]
1701
1746
  },
@@ -1705,53 +1750,16 @@ const defaultTokens = {
1705
1750
  penumbra: ["black/0.14", "500/0.07"],
1706
1751
  ambient: ["black/0.12", "500/0.06"]
1707
1752
  },
1708
- token: {
1709
- atrule: ["purple/300", "purple/600"],
1710
- attrName: ["green/300", "green/600"],
1711
- attrValue: ["yellow/300", "yellow/600"],
1712
- attribute: ["yellow/300", "yellow/600"],
1713
- boolean: ["purple/300", "purple/600"],
1714
- builtin: ["purple/300", "purple/600"],
1715
- cdata: ["yellow/300", "yellow/600"],
1716
- char: ["yellow/300", "yellow/600"],
1717
- class: ["orange/300", "orange/600"],
1718
- className: ["cyan/300", "cyan/600"],
1719
- comment: ["gray/600", "gray/300"],
1720
- constant: ["purple/300", "purple/600"],
1721
- deleted: ["red/300", "red/600"],
1722
- entity: ["red/300", "red/600"],
1723
- function: ["green/300", "green/600"],
1724
- hexcode: ["blue/300", "blue/600"],
1725
- id: ["purple/300", "purple/600"],
1726
- important: ["purple/300", "purple/600"],
1727
- inserted: ["green/300", "green/600"],
1728
- keyword: ["magenta/300", "magenta/600"],
1729
- number: ["purple/300", "purple/600"],
1730
- operator: ["magenta/300", "magenta/600"],
1731
- prolog: ["gray/300", "gray/600"],
1732
- property: ["blue/300", "blue/600"],
1733
- pseudoClass: ["yellow/300", "yellow/600"],
1734
- pseudoElement: ["yellow/300", "yellow/600"],
1735
- punctuation: ["gray/300", "gray/600"],
1736
- regex: ["blue/300", "blue/600"],
1737
- selector: ["red/300", "red/600"],
1738
- string: ["yellow/300", "yellow/600"],
1739
- symbol: ["purple/300", "purple/600"],
1740
- tag: ["red/300", "red/600"],
1741
- unit: ["orange/300", "orange/600"],
1742
- url: ["red/300", "red/600"],
1743
- variable: ["red/300", "red/600"]
1744
- },
1745
1753
  variant: {
1746
1754
  tinted: {
1747
1755
  "*": {
1748
1756
  bg: {
1749
1757
  0: ["950", "50"],
1750
- 4: ["800", "100"]
1758
+ 4: ["800", "200"]
1751
1759
  },
1752
1760
  border: {
1753
- 0: ["800", "100"],
1754
- 4: ["600", "300"]
1761
+ 0: ["700", "100"],
1762
+ 4: ["500", "300"]
1755
1763
  },
1756
1764
  fg: {
1757
1765
  0: ["100", "900"],
@@ -1777,8 +1785,8 @@ const defaultTokens = {
1777
1785
  solid: {
1778
1786
  "*": {
1779
1787
  bg: {
1780
- 0: ["300", "500"],
1781
- 4: ["200", "600"]
1788
+ 0: ["400", "500"],
1789
+ 4: ["300", "600"]
1782
1790
  },
1783
1791
  border: {
1784
1792
  0: ["200", "400"],
@@ -1826,12 +1834,12 @@ const defaultTokens = {
1826
1834
  4: ["800", "300 50%"]
1827
1835
  },
1828
1836
  border: {
1829
- 0: ["900", "300 40%"],
1830
- 4: ["700", "300"]
1837
+ 0: ["800", "300 40%"],
1838
+ 4: ["600", "300"]
1831
1839
  },
1832
1840
  fg: {
1833
1841
  0: ["100", "black"],
1834
- 4: ["500", "600"]
1842
+ 4: ["400", "700"]
1835
1843
  }
1836
1844
  }
1837
1845
  }
@@ -1842,7 +1850,7 @@ const defaultTokens = {
1842
1850
  tinted: {
1843
1851
  "*": {
1844
1852
  bg: {
1845
- 0: ["gray/950", "white"],
1853
+ 0: ["950", "white"],
1846
1854
  4: ["800", "200"]
1847
1855
  },
1848
1856
  border: {
@@ -1857,6 +1865,18 @@ const defaultTokens = {
1857
1865
  }
1858
1866
  }
1859
1867
  },
1868
+ neutral: {
1869
+ variant: {
1870
+ tinted: {
1871
+ "*": {
1872
+ bg: {
1873
+ 0: ["900", "50"],
1874
+ 4: ["700", "200"]
1875
+ }
1876
+ }
1877
+ }
1878
+ }
1879
+ },
1860
1880
  primary: {
1861
1881
  _hue: "blue"
1862
1882
  },
@@ -1963,6 +1983,48 @@ function resolveCardColorTokens(tokens) {
1963
1983
  }
1964
1984
  },
1965
1985
  backdrop: tokens?.backdrop ?? ["900", "100"],
1986
+ code: {
1987
+ bg: tokens?.code?.bg ?? ["950", "50"],
1988
+ fg: tokens?.code?.fg ?? ["400", "600"],
1989
+ token: {
1990
+ atrule: tokens?.code?.token?.atrule ?? ["400", "600"],
1991
+ attribute: tokens?.code?.token?.attribute ?? ["400", "600"],
1992
+ attrName: tokens?.code?.token?.attrName ?? ["400", "600"],
1993
+ attrValue: tokens?.code?.token?.attrValue ?? ["400", "600"],
1994
+ boolean: tokens?.code?.token?.boolean ?? ["400", "600"],
1995
+ builtin: tokens?.code?.token?.builtin ?? ["400", "600"],
1996
+ cdata: tokens?.code?.token?.cdata ?? ["400", "600"],
1997
+ char: tokens?.code?.token?.char ?? ["400", "600"],
1998
+ class: tokens?.code?.token?.class ?? ["400", "600"],
1999
+ className: tokens?.code?.token?.className ?? ["400", "600"],
2000
+ comment: tokens?.code?.token?.comment ?? ["600", "400"],
2001
+ constant: tokens?.code?.token?.constant ?? ["400", "600"],
2002
+ deleted: tokens?.code?.token?.deleted ?? ["400", "600"],
2003
+ doctype: tokens?.code?.token?.doctype ?? ["400", "600"],
2004
+ entity: tokens?.code?.token?.entity ?? ["400", "600"],
2005
+ function: tokens?.code?.token?.function ?? ["400", "600"],
2006
+ hexcode: tokens?.code?.token?.hexcode ?? ["400", "600"],
2007
+ id: tokens?.code?.token?.id ?? ["400", "600"],
2008
+ important: tokens?.code?.token?.important ?? ["400", "600"],
2009
+ inserted: tokens?.code?.token?.inserted ?? ["400", "600"],
2010
+ keyword: tokens?.code?.token?.keyword ?? ["400", "600"],
2011
+ number: tokens?.code?.token?.number ?? ["400", "600"],
2012
+ operator: tokens?.code?.token?.operator ?? ["400", "600"],
2013
+ prolog: tokens?.code?.token?.prolog ?? ["400", "600"],
2014
+ property: tokens?.code?.token?.property ?? ["400", "600"],
2015
+ pseudoClass: tokens?.code?.token?.pseudoClass ?? ["400", "600"],
2016
+ pseudoElement: tokens?.code?.token?.pseudoElement ?? ["400", "600"],
2017
+ punctuation: tokens?.code?.token?.punctuation ?? ["400", "600"],
2018
+ regex: tokens?.code?.token?.regex ?? ["400", "600"],
2019
+ selector: tokens?.code?.token?.selector ?? ["400", "600"],
2020
+ string: tokens?.code?.token?.string ?? ["400", "600"],
2021
+ symbol: tokens?.code?.token?.symbol ?? ["400", "600"],
2022
+ tag: tokens?.code?.token?.tag ?? ["400", "600"],
2023
+ unit: tokens?.code?.token?.unit ?? ["400", "600"],
2024
+ url: tokens?.code?.token?.url ?? ["400", "600"],
2025
+ variable: tokens?.code?.token?.variable ?? ["400", "600"]
2026
+ }
2027
+ },
1966
2028
  focusRing: tokens?.focusRing ?? ["500", "500"],
1967
2029
  link: {
1968
2030
  fg: tokens?.link?.fg ?? ["400", "600"]
@@ -1977,44 +2039,6 @@ function resolveCardColorTokens(tokens) {
1977
2039
  from: tokens?.skeleton?.from ?? ["900", "100"],
1978
2040
  to: tokens?.skeleton?.to ?? ["950", "50"]
1979
2041
  },
1980
- token: {
1981
- atrule: tokens?.token?.atrule ?? ["400", "600"],
1982
- attribute: tokens?.token?.attribute ?? ["400", "600"],
1983
- attrName: tokens?.token?.attrName ?? ["400", "600"],
1984
- attrValue: tokens?.token?.attrValue ?? ["400", "600"],
1985
- boolean: tokens?.token?.boolean ?? ["400", "600"],
1986
- builtin: tokens?.token?.builtin ?? ["400", "600"],
1987
- cdata: tokens?.token?.cdata ?? ["400", "600"],
1988
- char: tokens?.token?.char ?? ["400", "600"],
1989
- class: tokens?.token?.class ?? ["400", "600"],
1990
- className: tokens?.token?.className ?? ["400", "600"],
1991
- comment: tokens?.token?.comment ?? ["600", "400"],
1992
- constant: tokens?.token?.constant ?? ["400", "600"],
1993
- deleted: tokens?.token?.deleted ?? ["400", "600"],
1994
- doctype: tokens?.token?.doctype ?? ["400", "600"],
1995
- entity: tokens?.token?.entity ?? ["400", "600"],
1996
- function: tokens?.token?.function ?? ["400", "600"],
1997
- hexcode: tokens?.token?.hexcode ?? ["400", "600"],
1998
- id: tokens?.token?.id ?? ["400", "600"],
1999
- important: tokens?.token?.important ?? ["400", "600"],
2000
- inserted: tokens?.token?.inserted ?? ["400", "600"],
2001
- keyword: tokens?.token?.keyword ?? ["400", "600"],
2002
- number: tokens?.token?.number ?? ["400", "600"],
2003
- operator: tokens?.token?.operator ?? ["400", "600"],
2004
- prolog: tokens?.token?.prolog ?? ["400", "600"],
2005
- property: tokens?.token?.property ?? ["400", "600"],
2006
- pseudoClass: tokens?.token?.pseudoClass ?? ["400", "600"],
2007
- pseudoElement: tokens?.token?.pseudoElement ?? ["400", "600"],
2008
- punctuation: tokens?.token?.punctuation ?? ["400", "600"],
2009
- regex: tokens?.token?.regex ?? ["400", "600"],
2010
- selector: tokens?.token?.selector ?? ["400", "600"],
2011
- string: tokens?.token?.string ?? ["400", "600"],
2012
- symbol: tokens?.token?.symbol ?? ["400", "600"],
2013
- tag: tokens?.token?.tag ?? ["400", "600"],
2014
- unit: tokens?.token?.unit ?? ["400", "600"],
2015
- url: tokens?.token?.url ?? ["400", "600"],
2016
- variable: tokens?.token?.variable ?? ["400", "600"]
2017
- },
2018
2042
  variant: {
2019
2043
  solid: {
2020
2044
  "*": resolveElementTokens(tokens?.variant?.solid?.["*"]),
@@ -2204,7 +2228,7 @@ function themeColor_v3_v2(options) {
2204
2228
  variant: "tinted"
2205
2229
  }), states), {}), tones2), {}),
2206
2230
  shadow: color2.shadow,
2207
- syntax: color2.token
2231
+ syntax: color2.code.token
2208
2232
  };
2209
2233
  }
2210
2234
  const stateShades = {