@assembly-js/design-system 3.1.10 → 3.1.11

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.
@@ -101,6 +101,8 @@
101
101
  size = _ref2$size === void 0 ? 'sm' : _ref2$size,
102
102
  className = _ref2.className,
103
103
  prefixIcon = _ref2.prefixIcon,
104
+ _ref2$truncate = _ref2.truncate,
105
+ truncate = _ref2$truncate === void 0 ? false : _ref2$truncate,
104
106
  disabled = _ref2.disabled,
105
107
  onClick = _ref2.onClick,
106
108
  onClose = _ref2.onClose,
@@ -137,7 +139,9 @@
137
139
  })
138
140
  }), /*#__PURE__*/_react["default"].createElement(_Typography.Body, {
139
141
  size: size !== 'sm' ? 'base' : 'sm',
140
- className: "cop-m-0"
142
+ className: (0, _utils.cn)('cop-m-0', {
143
+ 'cop-truncate': truncate
144
+ })
141
145
  }, label), Boolean(onClose) ?
142
146
  /*#__PURE__*/
143
147
  // We intentionally attach both onClick and onTouch event
@@ -62,12 +62,12 @@
62
62
  size: "sm",
63
63
  variant: 'rounded'
64
64
  }), /*#__PURE__*/_react["default"].createElement("div", {
65
- className: "cop-flex cop-flex-col cop-text-[10px]"
65
+ className: "cop-flex cop-min-w-0 cop-flex-col cop-text-[10px]"
66
66
  }, /*#__PURE__*/_react["default"].createElement(_Typography.Body, {
67
67
  className: "cop-m-0 cop-truncate",
68
68
  size: "sm"
69
69
  }, option.label), companyName && /*#__PURE__*/_react["default"].createElement("span", {
70
- className: "cop-text-secondary"
70
+ className: "cop-truncate cop-text-secondary"
71
71
  }, companyName)));
72
72
  }
73
73
  });
@@ -39,8 +39,9 @@
39
39
  }
40
40
  };
41
41
  return /*#__PURE__*/_react["default"].createElement(_Chip.Chip, {
42
- className: "!cop-rounded cop-border cop-border-solid cop-py-[5px]",
42
+ className: "!cop-rounded cop-border cop-border-solid cop-py-[5px] cop-max-w-[200px]",
43
43
  variant: "outlined",
44
+ truncate: true,
44
45
  onClose: handleRemove,
45
46
  prefixIcon: option.type === 'company' ? /*#__PURE__*/_react["default"].createElement(_Avatar.Avatar, {
46
47
  src: (_option$avatarSrc = option.avatarSrc) !== null && _option$avatarSrc !== void 0 ? _option$avatarSrc : '',
@@ -16,11 +16,12 @@ export interface ChipProps extends VariantProps<typeof chipStyles> {
16
16
  label: string;
17
17
  className?: string;
18
18
  prefixIcon?: IconType | Exclude<React.ReactNode, string>;
19
+ truncate?: boolean;
19
20
  onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
20
21
  onClose?: (event: React.KeyboardEvent | React.MouseEvent | React.TouchEvent) => void;
21
22
  'aria-pressed'?: AriaAttributes['aria-pressed'];
22
23
  }
23
- export declare const Chip: ({ color, variant, label, size, className, prefixIcon, disabled, onClick, onClose, "aria-pressed": ariaPressed, }: ChipProps & {
24
+ export declare const Chip: ({ color, variant, label, size, className, prefixIcon, truncate, disabled, onClick, onClose, "aria-pressed": ariaPressed, }: ChipProps & {
24
25
  color?: string;
25
26
  }) => React.JSX.Element;
26
27
  export {};
@@ -12,6 +12,7 @@ export declare const WithSingleSelection: Story;
12
12
  export declare const WithPlaceholder: Story;
13
13
  export declare const WithAutoFocus: Story;
14
14
  export declare const WithLongOptionLabel: Story;
15
+ export declare const WithLongCompanyName: Story;
15
16
  export declare const WithCustomLabels: Story;
16
17
  export declare const WithListHeading: Story;
17
18
  export declare const WithAvatarFallbackColor: Story;