@sanity/ui 2.0.0-beta.10 → 2.0.0-beta.12
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/index.esm.js +16 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/dist/theme.esm.js +91 -73
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +91 -73
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/core/primitives/button/button.tsx +9 -11
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/states.tsx +10 -2
- package/src/core/styles/input/textInputStyle.ts +33 -2
- package/src/core/theme/__workshop__/debug/story.tsx +65 -28
- package/src/theme/build/buildColorTheme.test.ts +2 -2
- package/src/theme/defaults/colorTokens.ts +89 -71
package/dist/index.esm.js
CHANGED
|
@@ -1543,7 +1543,7 @@ function textInputRepresentationStyle(props) {
|
|
|
1543
1543
|
color,
|
|
1544
1544
|
input
|
|
1545
1545
|
} = getTheme_v2(props.theme);
|
|
1546
|
-
return css(_c$c || (_c$c = __template$F(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
1546
|
+
return css(_c$c || (_c$c = __template$F(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:not(:invalid):disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --card-icon-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --card-icon-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n *:invalid:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:invalid:not(:disabled):not(:read-only):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
1547
1547
|
color: color.input.default.enabled.border,
|
|
1548
1548
|
width: input.border.width
|
|
1549
1549
|
}), color.input.invalid.enabled.bg, color.input.invalid.enabled.fg, focusRingBorderStyle({
|
|
@@ -1557,12 +1557,18 @@ function textInputRepresentationStyle(props) {
|
|
|
1557
1557
|
focusRing: input.text.focusRing
|
|
1558
1558
|
}), $unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1559
1559
|
focusRing: input.text.focusRing
|
|
1560
|
-
}), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1560
|
+
}), color.input.default.disabled.bg, color.input.default.disabled.fg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1561
1561
|
color: color.input.default.disabled.border,
|
|
1562
1562
|
width: input.border.width
|
|
1563
|
-
}), color.input.
|
|
1563
|
+
}), color.input.invalid.disabled.bg, color.input.invalid.disabled.fg, color.input.invalid.disabled.fg, focusRingBorderStyle({
|
|
1564
|
+
color: color.input.invalid.disabled.border,
|
|
1565
|
+
width: input.border.width
|
|
1566
|
+
}), color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.invalid.readOnly.bg, color.input.invalid.readOnly.fg, color.input.default.hovered.bg, color.input.default.hovered.fg, color.input.invalid.hovered.bg, color.input.invalid.hovered.fg, focusRingBorderStyle({
|
|
1564
1567
|
color: color.input.default.hovered.border,
|
|
1565
1568
|
width: input.border.width
|
|
1569
|
+
}), focusRingBorderStyle({
|
|
1570
|
+
color: color.input.invalid.hovered.border,
|
|
1571
|
+
width: input.border.width
|
|
1566
1572
|
}));
|
|
1567
1573
|
}
|
|
1568
1574
|
function responsiveMarginStyle(props) {
|
|
@@ -2486,16 +2492,13 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2486
2492
|
children: [icon && /* @__PURE__ */jsxs(Text, {
|
|
2487
2493
|
size: fontSize,
|
|
2488
2494
|
children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
|
|
2489
|
-
}), text && /* @__PURE__ */jsx(
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
weight: button.textWeight,
|
|
2497
|
-
children: text
|
|
2498
|
-
})
|
|
2495
|
+
}), text && /* @__PURE__ */jsx(Text, {
|
|
2496
|
+
muted,
|
|
2497
|
+
align: textAlign,
|
|
2498
|
+
size: fontSize,
|
|
2499
|
+
textOverflow: "ellipsis",
|
|
2500
|
+
weight: button.textWeight,
|
|
2501
|
+
children: text
|
|
2499
2502
|
}), iconRight && /* @__PURE__ */jsxs(Text, {
|
|
2500
2503
|
size: fontSize,
|
|
2501
2504
|
children: [isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && createElement(iconRight)]
|