@sanity/ui 2.0.0-beta.6 → 2.0.0-beta.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Sanity.io
3
+ Copyright (c) 2023–2024 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -6,7 +6,7 @@ The Sanity UI components.
6
6
  npm install @sanity/ui
7
7
 
8
8
  # Install peer dependencies
9
- npm install react react-dom react-is styled-components
9
+ npm install react react-dom styled-components
10
10
  ```
11
11
 
12
12
  [![npm version](https://img.shields.io/npm/v/@sanity/ui.svg?style=flat-square)](https://www.npmjs.com/package/@sanity/ui)
@@ -14,12 +14,15 @@ npm install react react-dom react-is styled-components
14
14
  ## Usage
15
15
 
16
16
  ```jsx
17
- import {Button, ThemeProvider, studioTheme} from '@sanity/ui'
17
+ import {Button, ThemeProvider} from '@sanity/ui'
18
+ import {buildTheme} from '@sanity/ui/theme'
18
19
  import {createRoot} from 'react-dom/client'
19
20
 
20
21
  const root = createRoot(document.getElementById('root'))
22
+ const theme = buildTheme()
23
+
21
24
  root.render(
22
- <ThemeProvider theme={studioTheme}>
25
+ <ThemeProvider theme={theme}>
23
26
  <Button text="Hello, world" />
24
27
  </ThemeProvider>,
25
28
  )
package/dist/index.esm.js CHANGED
@@ -4859,7 +4859,7 @@ function switchThumbStyles(props) {
4859
4859
  const checkedOffset = trackWidth - trackPadding * 2 - size;
4860
4860
  const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
4861
4861
  const checked = $indeterminate !== true && props.$checked === true;
4862
- return 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.1);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && css(_e$2 || (_e$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && css(_f$2 || (_f$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
4862
+ return 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 && css(_e$2 || (_e$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && css(_f$2 || (_f$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
4863
4863
  }
4864
4864
  const Root$d = styled.span(switchBaseStyles);
4865
4865
  const Input$2 = styled.input(switchInputStyles);