@lateralus-ai/shipping-ui 2.0.0-dev.21 → 2.0.0-dev.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lateralus-ai/shipping-ui",
3
- "version": "2.0.0-dev.21",
3
+ "version": "2.0.0-dev.22",
4
4
  "description": "Shared UI theme and components for Lateralus shipping applications",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.esm.js",
@@ -16,26 +16,19 @@ export type FilterPillsProps = {
16
16
 
17
17
  /**
18
18
  * Partner row for FilterDropdown — active filter pills.
19
- * Lives outside the dropdown DOM so callers can place it anywhere
20
- * (same row, new row, sticky footer, etc.).
21
- *
22
- * Multi-select chip *content* (when to show, label format) is owned by the
23
- * consumer; use `formatActiveFilterChipLabel` for audit-prep-style labels.
19
+ * Always renders the row wrapper (even when empty) so sibling filter
20
+ * triggers can stay pinned with `ml-auto` / flex layouts.
24
21
  */
25
- export const FilterPills = ({ chips, className }: FilterPillsProps) => {
26
- if (chips.length === 0) return null;
27
-
28
- return (
29
- <div className={cn("flex flex-wrap items-start gap-2", className)}>
30
- {chips.map((chip) => (
31
- <FilteredPill
32
- key={chip.key}
33
- label={chip.label}
34
- onRemove={chip.onRemove}
35
- removeAriaLabel={chip.removeAriaLabel}
36
- classNames={chip.classNames}
37
- />
38
- ))}
39
- </div>
40
- );
41
- };
22
+ export const FilterPills = ({ chips, className }: FilterPillsProps) => (
23
+ <div className={cn("flex min-w-0 flex-wrap items-start gap-2", className)}>
24
+ {chips.map((chip) => (
25
+ <FilteredPill
26
+ key={chip.key}
27
+ label={chip.label}
28
+ onRemove={chip.onRemove}
29
+ removeAriaLabel={chip.removeAriaLabel}
30
+ classNames={chip.classNames}
31
+ />
32
+ ))}
33
+ </div>
34
+ );
@@ -1,12 +1,13 @@
1
1
  import { cn } from "../../utils/cn";
2
2
  import { ClearIcon } from "../../icons";
3
+ import { Tooltip } from "../../primitives/Tooltip";
3
4
 
4
5
  export type FilteredPillProps = {
5
6
  label: string;
6
7
  onRemove: () => void;
7
8
  removeAriaLabel?: string;
8
9
  className?: string;
9
- /** Optional tone overrides (e.g. criticality-colored chips). */
10
+ /** Optional tone overrides. Prefer default beige unless a product needs a custom tone. */
10
11
  classNames?: {
11
12
  root?: string;
12
13
  label?: string;
@@ -16,8 +17,8 @@ export type FilteredPillProps = {
16
17
 
17
18
  /**
18
19
  * Active filter value pill — Figma Filtered (6154:149787).
19
- * Clear control on the left, label on the right. Partner to FilterDropdown;
20
- * render via FilterPills outside the dropdown DOM.
20
+ * Clear control on the left, label on the right. Max 300px with ellipsis;
21
+ * full label in a tooltip on hover.
21
22
  */
22
23
  export const FilteredPill = ({
23
24
  label,
@@ -26,31 +27,33 @@ export const FilteredPill = ({
26
27
  className,
27
28
  classNames,
28
29
  }: FilteredPillProps) => (
29
- <div
30
- className={cn(
31
- "inline-flex min-h-9 items-center justify-center gap-2.5 rounded-full bg-background-secondary px-3 py-1",
32
- classNames?.root,
33
- className,
34
- )}
35
- >
36
- <button
37
- type="button"
38
- onClick={onRemove}
39
- aria-label={removeAriaLabel ?? `Remove ${label} filter`}
30
+ <Tooltip content={label} hint side="top">
31
+ <div
40
32
  className={cn(
41
- "inline-flex size-4 shrink-0 items-center justify-center rounded-control text-display-on-light-secondary transition-colors hover:text-display-on-light-primary",
42
- classNames?.remove,
33
+ "inline-flex max-w-[300px] min-h-9 items-center justify-center gap-2.5 rounded-full bg-background-secondary px-3 py-1",
34
+ classNames?.root,
35
+ className,
43
36
  )}
44
37
  >
45
- <ClearIcon size="xs" />
46
- </button>
47
- <span
48
- className={cn(
49
- "text-caption-2-em text-display-on-light-primary whitespace-nowrap",
50
- classNames?.label,
51
- )}
52
- >
53
- {label}
54
- </span>
55
- </div>
38
+ <button
39
+ type="button"
40
+ onClick={onRemove}
41
+ aria-label={removeAriaLabel ?? `Remove ${label} filter`}
42
+ className={cn(
43
+ "inline-flex size-4 shrink-0 items-center justify-center rounded-control text-display-on-light-secondary transition-colors hover:text-display-on-light-primary",
44
+ classNames?.remove,
45
+ )}
46
+ >
47
+ <ClearIcon size="xs" />
48
+ </button>
49
+ <span
50
+ className={cn(
51
+ "min-w-0 truncate text-caption-2-em text-display-on-light-primary",
52
+ classNames?.label,
53
+ )}
54
+ >
55
+ {label}
56
+ </span>
57
+ </div>
58
+ </Tooltip>
56
59
  );