@sanity/ui 5.0.0-alpha.1 → 5.0.0-alpha.10

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 (76) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/install.js +2 -1
  3. package/dist/index.d.ts +362 -76
  4. package/dist/index.js +420 -158
  5. package/dist/index.js.map +1 -1
  6. package/dist/polyfills.d.ts +1 -0
  7. package/dist/polyfills.js +5 -0
  8. package/dist/polyfills.js.map +1 -0
  9. package/dist/styles.css +1 -1
  10. package/package.json +9 -3
  11. package/src/cli/install.ts +2 -1
  12. package/src/components/badge/Badge.tsx +53 -0
  13. package/src/components/badge/badge.css +6 -0
  14. package/src/components/badge/badge.props.ts +31 -0
  15. package/src/components/box/Box.tsx +6 -1
  16. package/src/components/box/box.props.ts +7 -2
  17. package/src/components/button/button.props.ts +27 -9
  18. package/src/components/card/card.props.ts +6 -2
  19. package/src/components/checkbox/Checkbox.tsx +3 -2
  20. package/src/components/checkbox/checkbox.props.ts +11 -3
  21. package/src/components/code/code.props.ts +10 -3
  22. package/src/components/container/container.props.ts +6 -2
  23. package/src/components/dialog/Dialog.tsx +139 -0
  24. package/src/components/dialog/dialog.css +49 -0
  25. package/src/components/dialog/dialog.props.ts +45 -0
  26. package/src/components/eyebrow/Eyebrow.tsx +1 -1
  27. package/src/components/eyebrow/eyebrow.props.ts +6 -2
  28. package/src/components/flex/Flex.tsx +6 -1
  29. package/src/components/flex/flex.props.ts +6 -2
  30. package/src/components/grid/Grid.tsx +6 -1
  31. package/src/components/grid/grid.props.ts +6 -2
  32. package/src/components/h-stack/hStack.props.ts +3 -1
  33. package/src/components/heading/Heading.tsx +1 -1
  34. package/src/components/heading/heading.props.ts +8 -2
  35. package/src/components/icon/icon.props.ts +6 -2
  36. package/src/components/icon-button/iconButton.props.ts +7 -2
  37. package/src/components/index.css +3 -0
  38. package/src/components/indicator/indicator.props.ts +6 -2
  39. package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
  40. package/src/components/inline/inline.props.ts +6 -2
  41. package/src/components/label/label.props.ts +7 -1
  42. package/src/components/link/link.props.ts +4 -4
  43. package/src/components/list/list.props.ts +27 -9
  44. package/src/components/popover/Popover.tsx +85 -0
  45. package/src/components/popover/popover.css +21 -0
  46. package/src/components/popover/popover.props.ts +38 -0
  47. package/src/components/press-area/pressArea.props.ts +3 -1
  48. package/src/components/radio/Radio.tsx +1 -1
  49. package/src/components/radio/radio.props.ts +7 -2
  50. package/src/components/skip-to-content/skipToContent.props.ts +9 -3
  51. package/src/components/spinner/Spinner.tsx +1 -1
  52. package/src/components/spinner/spinner.props.ts +3 -0
  53. package/src/components/switch/Switch.tsx +1 -1
  54. package/src/components/switch/switch.props.ts +7 -2
  55. package/src/components/text/Text.tsx +1 -1
  56. package/src/components/text/text.props.ts +6 -2
  57. package/src/components/tooltip/Tooltip.tsx +59 -55
  58. package/src/components/tooltip/tooltip.css +19 -40
  59. package/src/components/tooltip/tooltip.props.ts +24 -8
  60. package/src/components/tooltip-group/TooltipGroup.tsx +2 -5
  61. package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
  62. package/src/components/v-stack/vStack.props.ts +3 -1
  63. package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
  64. package/src/css/classes/generic/display.css +8 -8
  65. package/src/css/classes/generic/placement.css +31 -0
  66. package/src/css/classes/local/animation.css +4 -0
  67. package/src/css/classes/local/index.css +2 -0
  68. package/src/css/classes/local/top-anchor.css +4 -0
  69. package/src/css/global/reset.css +20 -18
  70. package/src/css/tokens/semantic.css +4 -0
  71. package/src/hooks/useIsClient.ts +10 -0
  72. package/src/index.ts +5 -0
  73. package/src/polyfills.ts +15 -0
  74. package/src/utils/mergeTriggerProps.ts +66 -0
  75. package/src/utils/renderPortal.tsx +14 -0
  76. package/src/version.ts +2 -2
package/README.md CHANGED
@@ -46,7 +46,7 @@ import '@sanity/ui/styles.css'
46
46
 
47
47
  ```tsx
48
48
  import {Box, Flex, Card, Heading, Text, Button} from '@sanity/ui'
49
- import {AddIcon} from '@sanity/icons'
49
+ import {AddIcon} from '@sanity/icons/Add'
50
50
 
51
51
  export default function App() {
52
52
  return (
@@ -23,7 +23,8 @@ function exactFromRange(range) {
23
23
  *
24
24
  * Icons is already a dependency, so the package manager installs it either way.
25
25
  * It is listed explicitly because apps import icons directly to pass to
26
- * components (`<Button iconStart={AddIcon} />`), and under pnpm an import that
26
+ * components (`import {AddIcon} from '@sanity/icons/Add'`, then
27
+ * `<Button iconStart={AddIcon} />`), and under pnpm an import that
27
28
  * isn't in the app's own package.json doesn't resolve. Dependencies the app
28
29
  * never imports itself (react-refractor, clsx) are left to the package manager.
29
30
  * React/react-dom are peers that belong to the host app, so they are left out