@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.
@@ -86,6 +86,8 @@ export var Chip = function Chip(_ref2) {
86
86
  size = _ref2$size === void 0 ? 'sm' : _ref2$size,
87
87
  className = _ref2.className,
88
88
  prefixIcon = _ref2.prefixIcon,
89
+ _ref2$truncate = _ref2.truncate,
90
+ truncate = _ref2$truncate === void 0 ? false : _ref2$truncate,
89
91
  disabled = _ref2.disabled,
90
92
  onClick = _ref2.onClick,
91
93
  onClose = _ref2.onClose,
@@ -122,7 +124,9 @@ export var Chip = function Chip(_ref2) {
122
124
  })
123
125
  }), /*#__PURE__*/React.createElement(Body, {
124
126
  size: size !== 'sm' ? 'base' : 'sm',
125
- className: "cop-m-0"
127
+ className: cn('cop-m-0', {
128
+ 'cop-truncate': truncate
129
+ })
126
130
  }, label), Boolean(onClose) ?
127
131
  /*#__PURE__*/
128
132
  // We intentionally attach both onClick and onTouch event
@@ -46,11 +46,11 @@ export function ListItem(_ref) {
46
46
  size: "sm",
47
47
  variant: 'rounded'
48
48
  }), /*#__PURE__*/React.createElement("div", {
49
- className: "cop-flex cop-flex-col cop-text-[10px]"
49
+ className: "cop-flex cop-min-w-0 cop-flex-col cop-text-[10px]"
50
50
  }, /*#__PURE__*/React.createElement(Body, {
51
51
  className: "cop-m-0 cop-truncate",
52
52
  size: "sm"
53
53
  }, option.label), companyName && /*#__PURE__*/React.createElement("span", {
54
- className: "cop-text-secondary"
54
+ className: "cop-truncate cop-text-secondary"
55
55
  }, companyName)));
56
56
  }
@@ -23,8 +23,9 @@ export function SelectedValueChip(props) {
23
23
  }
24
24
  };
25
25
  return /*#__PURE__*/React.createElement(Chip, {
26
- className: "!cop-rounded cop-border cop-border-solid cop-py-[5px]",
26
+ className: "!cop-rounded cop-border cop-border-solid cop-py-[5px] cop-max-w-[200px]",
27
27
  variant: "outlined",
28
+ truncate: true,
28
29
  onClose: handleRemove,
29
30
  prefixIcon: option.type === 'company' ? /*#__PURE__*/React.createElement(Avatar, {
30
31
  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;