@basic-ui/material 1.0.0-alpha.31 → 1.0.0-alpha.32
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/build/cjs/index.js +7 -3
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Switch/Switch.js +5 -5
- package/build/esm/Switch/Switch.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Switch/Switch.story.tsx +1 -1
- package/src/Switch/Switch.tsx +8 -2
package/build/cjs/index.js
CHANGED
|
@@ -5217,7 +5217,7 @@ const SwitchCircle = ({
|
|
|
5217
5217
|
|
|
5218
5218
|
const CheckBoxCore = core.CheckBox;
|
|
5219
5219
|
|
|
5220
|
-
function getSizeCssVariables(size) {
|
|
5220
|
+
function getSizeCssVariables(size, hasIcon) {
|
|
5221
5221
|
const multiplier = size === 'small' ? 0.75 : 1;
|
|
5222
5222
|
const BORDER_WIDTH = 2;
|
|
5223
5223
|
const TRAIL_WIDTH = 52 * multiplier;
|
|
@@ -5231,7 +5231,11 @@ function getSizeCssVariables(size) {
|
|
|
5231
5231
|
['--switch-thumb-size-checked-inactive']: polished.rem(TRAIL_HEIGHT - BORDER_WIDTH * 4),
|
|
5232
5232
|
['--switch-thumb-size-checked-active']: polished.rem(TRAIL_HEIGHT - BORDER_WIDTH * 2),
|
|
5233
5233
|
['--switch-thumb-size-unchecked-inactive']: polished.rem(TRAIL_HEIGHT / 2),
|
|
5234
|
-
['--switch-thumb-size-unchecked-active']: polished.rem(TRAIL_HEIGHT - BORDER_WIDTH * 2)
|
|
5234
|
+
['--switch-thumb-size-unchecked-active']: polished.rem(TRAIL_HEIGHT - BORDER_WIDTH * 2),
|
|
5235
|
+
...(hasIcon && {
|
|
5236
|
+
['--switch-thumb-size-unchecked-inactive']: 'var(--switch-thumb-size-checked-inactive)',
|
|
5237
|
+
['--switch-thumb-size-unchecked-active']: 'var(--switch-thumb-size-checked-active)'
|
|
5238
|
+
})
|
|
5235
5239
|
};
|
|
5236
5240
|
}
|
|
5237
5241
|
|
|
@@ -5252,7 +5256,7 @@ const SwitchInner = /*#__PURE__*/react$1.forwardRef(function SwitchInner(props,
|
|
|
5252
5256
|
display: "inline-block",
|
|
5253
5257
|
position: "relative",
|
|
5254
5258
|
minWidth: "auto",
|
|
5255
|
-
sx: getSizeCssVariables(size),
|
|
5259
|
+
sx: getSizeCssVariables(size, Boolean(icon)),
|
|
5256
5260
|
children: [/*#__PURE__*/jsxRuntime.jsx(SwitchTrail, {
|
|
5257
5261
|
checked: checked,
|
|
5258
5262
|
disabled: disabled
|