@janiscommerce/ui-web 0.6.0 → 0.6.1

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/index.umd.js CHANGED
@@ -19401,10 +19401,14 @@
19401
19401
  Chip: styled__default["default"].button.withConfig({
19402
19402
  displayName: "styles__Chip",
19403
19403
  componentId: "sc-1vnh4co-0"
19404
- })(["padding:0 12px;cursor:", ";font-size:13px;color:", ";height:32px;min-width:36px;max-width:150px;border-radius:50px;display:inline-flex;justify-content:center;align-items:center;pointer-events:", ";white-space:nowrap;.chip-icon{margin-right:8px;}", " ", ";", " ", " ", " ", ""], function (props) {
19404
+ })(["padding:", ";cursor:", ";font-size:13px;color:", ";height:32px;min-width:36px;max-width:150px;border-radius:50px;display:inline-flex;justify-content:center;align-items:center;pointer-events:", ";white-space:nowrap;.chip-icon{", ";}", " ", ";", " ", " ", " ", ""], function (props) {
19405
+ return !props.onlyIcon ? '0 12px' : '0';
19406
+ }, function (props) {
19405
19407
  return props.clickable ? 'pointer' : 'default';
19406
19408
  }, palette.black.main, function (props) {
19407
19409
  return props.clickable || props.hasLink ? 'auto' : 'none';
19410
+ }, function (props) {
19411
+ return !props.onlyIcon && 'margin-right: 8px';
19408
19412
  }, function (props) {
19409
19413
  switch (props.variant) {
19410
19414
  case 'outlined':
@@ -19457,7 +19461,7 @@
19457
19461
  hasLink = _ref.hasLink,
19458
19462
  props = _objectWithoutProperties(_ref, _excluded$4);
19459
19463
 
19460
- if (!children) return null;
19464
+ if (!children && !icon) return null;
19461
19465
  return /*#__PURE__*/React__default["default"].createElement(styled$8.Chip, _extends$1({
19462
19466
  as: props.onClick ? 'button' : 'div',
19463
19467
  backgroundColor: backgroundColor,
@@ -19470,13 +19474,14 @@
19470
19474
  textColor: textColor,
19471
19475
  variant: variant,
19472
19476
  iconColor: iconColor,
19473
- hasLink: hasLink
19477
+ hasLink: hasLink,
19478
+ onlyIcon: !children && icon
19474
19479
  }, props), icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
19475
19480
  className: "chip-icon",
19476
19481
  name: icon,
19477
19482
  color: iconColor,
19478
19483
  pathStyles: styled$8.iconPathStyles
19479
- }), /*#__PURE__*/React__default["default"].createElement(styled$8.Children, null, children), onDelete && /*#__PURE__*/React__default["default"].createElement(styled$8.DeleteButton, {
19484
+ }), children && /*#__PURE__*/React__default["default"].createElement(styled$8.Children, null, children), onDelete && /*#__PURE__*/React__default["default"].createElement(styled$8.DeleteButton, {
19480
19485
  type: "button",
19481
19486
  onClick: onDelete
19482
19487
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {