@basic-ui/material 0.1.6 → 0.1.7
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 +12 -9
- package/build/cjs/index.js.map +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/List/List.d.ts +2 -1
- package/build/esm/List/List.js +3 -2
- package/build/esm/List/List.js.map +1 -1
- package/build/esm/ListItem/ListItem.d.ts +2 -1
- package/build/esm/ListItem/ListItem.js +3 -2
- package/build/esm/ListItem/ListItem.js.map +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Select/Select.d.ts +1 -1
- package/build/esm/Select/Select.js +1 -1
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/defaultRender.d.ts +1 -1
- package/build/esm/Select/defaultRender.js +1 -1
- package/build/esm/Select/defaultRender.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.js +4 -3
- package/build/esm/SelectItem/SelectItem.js.map +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/tsconfig.tsbuildinfo +1886 -1886
- package/package.json +2 -3
- package/src/List/List.tsx +3 -1
- package/src/ListItem/ListItem.tsx +3 -1
- package/src/Menu/Menu.story.tsx +27 -3
- package/src/Select/Select.story.tsx +45 -2
- package/src/Select/Select.tsx +3 -4
- package/src/Select/defaultRender.ts +2 -2
- package/src/SelectItem/SelectItem.tsx +6 -4
package/build/cjs/index.js
CHANGED
|
@@ -2481,6 +2481,7 @@ const TextField = /*#__PURE__*/react$1.forwardRef(function TextField(props, forw
|
|
|
2481
2481
|
const List = /*#__PURE__*/react$1.forwardRef(function List(props, forwardedRef) {
|
|
2482
2482
|
const {
|
|
2483
2483
|
as = 'div',
|
|
2484
|
+
innerAs,
|
|
2484
2485
|
elevation = 0,
|
|
2485
2486
|
py = 2,
|
|
2486
2487
|
px = 0,
|
|
@@ -2488,10 +2489,10 @@ const List = /*#__PURE__*/react$1.forwardRef(function List(props, forwardedRef)
|
|
|
2488
2489
|
variant = 'square',
|
|
2489
2490
|
__css = {}
|
|
2490
2491
|
} = props,
|
|
2491
|
-
otherProps = _objectWithoutPropertiesLoose__default['default'](props, ["as", "elevation", "py", "px", "outlined", "variant", "__css"]);
|
|
2492
|
+
otherProps = _objectWithoutPropertiesLoose__default['default'](props, ["as", "innerAs", "elevation", "py", "px", "outlined", "variant", "__css"]);
|
|
2492
2493
|
|
|
2493
2494
|
return /*#__PURE__*/jsxRuntime.jsx(Paper, _extends__default['default']({
|
|
2494
|
-
as: as,
|
|
2495
|
+
as: innerAs || as,
|
|
2495
2496
|
ref: forwardedRef,
|
|
2496
2497
|
py: py,
|
|
2497
2498
|
px: px,
|
|
@@ -2515,6 +2516,7 @@ const useListItemContext = () => react$1.useContext(listitemContext);
|
|
|
2515
2516
|
const ListItem = /*#__PURE__*/react$1.forwardRef(function ListItem(props, forwardedRef) {
|
|
2516
2517
|
const {
|
|
2517
2518
|
as = 'div',
|
|
2519
|
+
innerAs,
|
|
2518
2520
|
children,
|
|
2519
2521
|
selected: selectedProp = false,
|
|
2520
2522
|
'aria-selected': ariaSelectedProp = false,
|
|
@@ -2523,7 +2525,7 @@ const ListItem = /*#__PURE__*/react$1.forwardRef(function ListItem(props, forwar
|
|
|
2523
2525
|
rippleColor,
|
|
2524
2526
|
__css
|
|
2525
2527
|
} = props,
|
|
2526
|
-
otherProps = _objectWithoutPropertiesLoose__default['default'](props, ["as", "children", "selected", "aria-selected", "disabled", "color", "rippleColor", "__css"]);
|
|
2528
|
+
otherProps = _objectWithoutPropertiesLoose__default['default'](props, ["as", "innerAs", "children", "selected", "aria-selected", "disabled", "color", "rippleColor", "__css"]);
|
|
2527
2529
|
|
|
2528
2530
|
const selected = ariaSelectedProp || selectedProp;
|
|
2529
2531
|
const color = colorProp ? colorProp : selected ? 'primary' : 'on.surface';
|
|
@@ -2535,7 +2537,7 @@ const ListItem = /*#__PURE__*/react$1.forwardRef(function ListItem(props, forwar
|
|
|
2535
2537
|
},
|
|
2536
2538
|
children: /*#__PURE__*/jsxRuntime.jsx(RippleBox, _extends__default['default']({
|
|
2537
2539
|
ref: forwardedRef,
|
|
2538
|
-
as: as,
|
|
2540
|
+
as: innerAs || as,
|
|
2539
2541
|
theme: theme,
|
|
2540
2542
|
display: "flex",
|
|
2541
2543
|
"data-disabled": disabled ? '' : undefined,
|
|
@@ -3811,7 +3813,7 @@ const makeDefaultRender = children => val => {
|
|
|
3811
3813
|
}
|
|
3812
3814
|
}
|
|
3813
3815
|
|
|
3814
|
-
return val ||
|
|
3816
|
+
return val || undefined;
|
|
3815
3817
|
};
|
|
3816
3818
|
|
|
3817
3819
|
const componentMap = {
|
|
@@ -3873,8 +3875,8 @@ const Select = /*#__PURE__*/react$1.forwardRef(function Select(props, forwardedR
|
|
|
3873
3875
|
const id = idProp || fallbackId;
|
|
3874
3876
|
const inputId = `${id}-text-field`;
|
|
3875
3877
|
const helperTextId = helperText ? `${id}-helper-text` : undefined;
|
|
3876
|
-
const labelIsFloating = hasFocus || open || typeof value === 'string' && value.length > 0;
|
|
3877
3878
|
const renderValue = renderValueProp || makeDefaultRender(children);
|
|
3879
|
+
const labelIsFloating = hasFocus || open || renderValue(value) !== undefined;
|
|
3878
3880
|
const Comp = native ? Select$1 : SelectButton;
|
|
3879
3881
|
react$1.useEffect(() => {
|
|
3880
3882
|
// right after mounting, if the default value in the select element
|
|
@@ -3963,6 +3965,7 @@ const Select = /*#__PURE__*/react$1.forwardRef(function Select(props, forwardedR
|
|
|
3963
3965
|
});
|
|
3964
3966
|
});
|
|
3965
3967
|
|
|
3968
|
+
const ZERO_WIDTH_SPACE = '\u200b';
|
|
3966
3969
|
const SelectItem = /*#__PURE__*/react$1.forwardRef(function SelectItem(props, forwardedRef) {
|
|
3967
3970
|
const {
|
|
3968
3971
|
as: Comp = MenuItem,
|
|
@@ -3978,7 +3981,7 @@ const SelectItem = /*#__PURE__*/react$1.forwardRef(function SelectItem(props, fo
|
|
|
3978
3981
|
onSelect,
|
|
3979
3982
|
value: selectedValue
|
|
3980
3983
|
} = useSelectContext();
|
|
3981
|
-
const value = valueProp !== undefined ? String(valueProp) : children;
|
|
3984
|
+
const value = valueProp !== undefined && valueProp !== null ? String(valueProp) : children;
|
|
3982
3985
|
|
|
3983
3986
|
if (native) {
|
|
3984
3987
|
return /*#__PURE__*/jsxRuntime.jsx("option", _extends__default['default']({
|
|
@@ -3990,7 +3993,7 @@ const SelectItem = /*#__PURE__*/react$1.forwardRef(function SelectItem(props, fo
|
|
|
3990
3993
|
}));
|
|
3991
3994
|
}
|
|
3992
3995
|
|
|
3993
|
-
if (
|
|
3996
|
+
if (children === undefined && disabled) {
|
|
3994
3997
|
return null;
|
|
3995
3998
|
}
|
|
3996
3999
|
|
|
@@ -4004,7 +4007,7 @@ const SelectItem = /*#__PURE__*/react$1.forwardRef(function SelectItem(props, fo
|
|
|
4004
4007
|
role: "option",
|
|
4005
4008
|
selected: selected
|
|
4006
4009
|
}, otherProps, {
|
|
4007
|
-
children: children
|
|
4010
|
+
children: children || ZERO_WIDTH_SPACE
|
|
4008
4011
|
}));
|
|
4009
4012
|
});
|
|
4010
4013
|
|