@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
|
@@ -16,26 +16,19 @@ export type FilterPillsProps = {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Partner row for FilterDropdown — active filter pills.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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.
|
|
20
|
-
*
|
|
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
|
-
<
|
|
30
|
-
|
|
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
|
|
42
|
-
classNames?.
|
|
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
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
);
|