@televet/kibble-ui 1.14.1 → 1.14.2-beta.2v2u763.0

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/index.js CHANGED
@@ -1605,7 +1605,7 @@ var toTitleCase = function (s) {
1605
1605
  };
1606
1606
 
1607
1607
  var Button = React.forwardRef(function (props, ref) {
1608
- var _a = useTheme(), components = _a.components, fontWeights = _a.fontWeights;
1608
+ var _a = useTheme(), components = _a.components, fontWeights = _a.fontWeights, radii = _a.radii;
1609
1609
  var _b = components.Button[props.variant || 'primary'], variant = _b.variant, light = _b.light, dark = _b.dark;
1610
1610
  var modeColor = props.darkMode ? dark : light;
1611
1611
  var bg = react.useColorModeValue(modeColor.default, dark.default);
@@ -1631,7 +1631,7 @@ var Button = React.forwardRef(function (props, ref) {
1631
1631
  domProps[position] = ButtonIcon;
1632
1632
  }
1633
1633
  }
1634
- return (React__default["default"].createElement(react.Button, __assign({ fontWeight: fontWeights.semibold, ref: ref, _hover: hoverClass, _active: activeClass, iconSpacing: domProps.size === 'sm' || domProps.size === 'xs' ? '4px' : '8px' }, domProps), domProps.children));
1634
+ return (React__default["default"].createElement(react.Button, __assign({ fontWeight: fontWeights.semibold, ref: ref, _hover: hoverClass, _active: activeClass, iconSpacing: domProps.size === 'sm' || domProps.size === 'xs' ? '4px' : '8px', borderRadius: radii.base }, domProps), domProps.children));
1635
1635
  });
1636
1636
  Button.displayName = 'Button';
1637
1637
 
@@ -4612,20 +4612,24 @@ var Select = function (_a) {
4612
4612
  var options = _a.options; _a.isFieldInline; var useBrowserDefaultMenu = _a.useBrowserDefaultMenu, placeholder = _a.placeholder, listProps = _a.listProps, value = _a.value, _b = _a.shouldTruncateText, shouldTruncateText = _b === void 0 ? true : _b, size = _a.size, onChange = _a.onChange, domProps = __rest(_a, ["options", "isFieldInline", "useBrowserDefaultMenu", "placeholder", "listProps", "value", "shouldTruncateText", "size", "onChange"]);
4613
4613
  var colors = useTheme().colors;
4614
4614
  var selectRef = React.useRef(null);
4615
- var _c = __read(React.useState({
4615
+ var palceholderValue = React.useMemo(function () { return ({
4616
4616
  label: placeholder,
4617
4617
  value: '',
4618
4618
  leftElement: null,
4619
4619
  isPlaceholder: true,
4620
- }), 2), selectedOption = _c[0], setSelectedOption = _c[1];
4620
+ }); }, [placeholder]);
4621
+ var _c = __read(React.useState(palceholderValue), 2), selectedOption = _c[0], setSelectedOption = _c[1];
4621
4622
  React.useEffect(function () {
4622
4623
  if (value) {
4623
4624
  var defaultValue = options.find(function (option) { return option.value === value; });
4624
4625
  if (defaultValue) {
4625
4626
  setSelectedOption(defaultValue);
4626
4627
  }
4628
+ else {
4629
+ setSelectedOption(palceholderValue);
4630
+ }
4627
4631
  }
4628
- }, [value, options]);
4632
+ }, [value, options, palceholderValue]);
4629
4633
  var selectWidth = React.useMemo(function () {
4630
4634
  var _a;
4631
4635
  if (!selectRef.current) {