@caratlogic/design-system 0.1.36 → 0.1.37

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/dist/index.esm.js CHANGED
@@ -15931,7 +15931,7 @@ function PickListFilter({ options, value, onChange, ariaLabel, layout = 'list',
15931
15931
  });
15932
15932
  const radioName = useId$2();
15933
15933
  const scrollClassName = getOptionsScrollClassName(fill);
15934
- // Rows with a right-hand hint read best in one column.
15934
+ // Two-line rows (label + hint) read best in one column.
15935
15935
  const multiColumn = fill && !options.some((option) => option.hint);
15936
15936
  const wrapperClassName = fill ? FILL_WRAPPER_CLASS_NAME : undefined;
15937
15937
  const toggle = (option) => onChange(pickValue(value, option.value, single));
@@ -15944,7 +15944,9 @@ function PickListFilter({ options, value, onChange, ariaLabel, layout = 'list',
15944
15944
  ? getGridColumnsStyle(undefined, LIST_COLUMN_MIN_WIDTH)
15945
15945
  : undefined, wrapperClassName: wrapperClassName, children: visibleOptions.map((option) => (jsxs("label", { className: LIST_ROW_CLASS_NAME, children: [single ? (jsx("input", { type: "radio", name: radioName, checked: value.includes(option.value),
15946
15946
  // A click on the picked row clears it (radios can't be unticked natively).
15947
- onClick: () => toggle(option), onChange: () => undefined, className: LIST_RADIO_CLASS_NAME })) : (jsx(Checkbox, { className: LIST_CHECKBOX_CLASS_NAME, checked: value.includes(option.value), onCheckedChange: () => toggle(option) })), option.content ? (jsx("span", { className: "min-w-0 flex-1", children: option.content })) : (jsx(TruncatedLabel, { text: option.label, className: "flex-1" })), option.hint && (jsx("span", { className: "shrink-0 text-muted-foreground", children: option.hint })), jsx(OptionSwatch, { color: option.swatch }), option.count !== undefined && (jsx("span", { className: COUNT_BADGE_CLASS_NAME, children: formatOptionCount(option.count) }))] }, option.value))) })] }));
15947
+ onClick: () => toggle(option), onChange: () => undefined, className: LIST_RADIO_CLASS_NAME })) : (jsx(Checkbox, { className: LIST_CHECKBOX_CLASS_NAME, checked: value.includes(option.value), onCheckedChange: () => toggle(option) })), option.content ? (jsx("span", { className: "min-w-0 flex-1", children: option.content })) : option.hint ? (
15948
+ // The hint sits under the label so a long name keeps the row's full width.
15949
+ jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [jsx(TruncatedLabel, { text: option.label }), jsx(TruncatedLabel, { text: option.hint, className: "text-xs text-muted-foreground" })] })) : (jsx(TruncatedLabel, { text: option.label, className: "flex-1" })), jsx(OptionSwatch, { color: option.swatch }), option.count !== undefined && (jsx("span", { className: COUNT_BADGE_CLASS_NAME, children: formatOptionCount(option.count) }))] }, option.value))) })] }));
15948
15950
  }
15949
15951
  if (layout === 'tiles') {
15950
15952
  return (jsx(ScrollFade, { role: "group", "aria-label": ariaLabel, wrapperClassName: wrapperClassName, className: cn('grid content-start gap-1.5', scrollClassName), style: getGridColumnsStyle(columns), children: visibleOptions.map((option) => (jsxs("button", { type: "button", "aria-pressed": value.includes(option.value), onClick: () => toggle(option), className: getTileClassName(value.includes(option.value), option.count !== undefined), children: [jsx(TruncatedLabel, { text: option.label }), option.count !== undefined && (jsx("span", { className: getCountBadgeClassName(value.includes(option.value) ? 'tinted' : 'neutral'), children: formatOptionCount(option.count) }))] }, option.value))) }));