@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 +1 -1
- package/README.md +6 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +6 -3
- package/dist/theme.esm.js +127 -152
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +127 -152
- package/dist/theme.js.map +1 -1
- package/package.json +3 -3
- package/src/core/primitives/switch/styles.ts +1 -1
- package/src/theme/build/colorToken/compileColorToken.ts +4 -0
- package/src/theme/build/renderColorValue.ts +8 -1
- package/src/theme/config/system.ts +3 -1
- package/src/theme/config/tokens/parseTokenValue.test.ts +13 -16
- package/src/theme/config/tokens/parseTokenValue.ts +44 -14
- package/src/theme/config/tokens/types.ts +3 -2
- package/src/theme/defaults/colorTokens.ts +83 -136
- package/src/theme/defaults/config.ts +1 -1
package/LICENSE
CHANGED
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
|
|
9
|
+
npm install react react-dom styled-components
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
[](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
|
|
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={
|
|
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.
|
|
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);
|