impact-nova 1.8.0 → 1.8.2
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/components/ui/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +6 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/default-text-cell-renderer.js +9 -0
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.d.ts +5 -6
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +19 -19
- package/dist/components/ui/ag-grid-react/index.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/index.js +164 -165
- package/dist/components/ui/button-group.d.ts +10 -6
- package/dist/components/ui/button-group.js +1 -2
- package/dist/components/ui/combobox.js +32 -25
- package/dist/components/ui/expandable-sku/expandable-sku.js +2 -1
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +46 -42
- package/dist/components/ui/filter-strip/filter-tag-list.d.ts +2 -1
- package/dist/components/ui/filter-strip/filter-tag-list.js +87 -69
- package/dist/components/ui/input.js +12 -13
- package/dist/components/ui/smart-input.d.ts +2 -2
- package/dist/components/ui/smart-input.js +52 -51
- package/dist/components/ui/textarea.d.ts +10 -8
- package/dist/components/ui/textarea.js +52 -52
- package/dist/components/ui/types/ag-grid.types.d.ts +5 -0
- package/dist/components/ui/types/button-group.types.d.ts +1 -1
- package/dist/components/ui/types/filter-strip.types.d.ts +9 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +425 -426
- package/package.json +1 -1
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { HelperTextPosition } from './types/helper-text.types';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
3
4
|
import * as React from "react";
|
|
4
|
-
/**
|
|
5
|
-
* Button group — IA Design System v3.1 (Figma: Button group).
|
|
6
|
-
* - Fused (`spacing="none"`): shared #C3C8D4 borders, 8px outer radius; selected = #ECEEFD fill + #4259EE border/text.
|
|
7
|
-
* - Spaced: independent 8px rounded segments with gap (Figma “split” row).
|
|
8
|
-
*/
|
|
9
5
|
declare const buttonGroupVariants: (props?: {
|
|
10
6
|
orientation?: "horizontal" | "vertical";
|
|
11
7
|
spacing?: "sm" | "md" | "lg" | "none";
|
|
12
8
|
} & import('class-variance-authority/types').ClassProp) => string;
|
|
9
|
+
export interface ButtonOption {
|
|
10
|
+
label: string | ReactNode;
|
|
11
|
+
value: string;
|
|
12
|
+
icon?: string | ReactNode;
|
|
13
|
+
iconPosition?: 'left' | 'right';
|
|
14
|
+
iconSize?: number;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
}
|
|
13
17
|
export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof buttonGroupVariants> {
|
|
14
18
|
value?: string;
|
|
15
19
|
onValueChange?: (value: string) => void;
|
|
@@ -24,4 +28,4 @@ export interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
|
24
28
|
"aria-label"?: string;
|
|
25
29
|
}
|
|
26
30
|
declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
-
export { ButtonGroup
|
|
31
|
+
export { ButtonGroup };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as v, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as fe from "react";
|
|
3
|
-
import { useMemo as
|
|
3
|
+
import { useMemo as B, useState as I, useRef as M, useCallback as x, useEffect as me } from "react";
|
|
4
4
|
import * as V from "@radix-ui/react-popover";
|
|
5
5
|
import { cn as a } from "../../lib/utils.js";
|
|
6
6
|
import { Info as X } from "../../icons/index.js";
|
|
@@ -34,9 +34,9 @@ const Y = {
|
|
|
34
34
|
defaultValue: L = "",
|
|
35
35
|
value: h,
|
|
36
36
|
onChange: A,
|
|
37
|
-
onBlur:
|
|
37
|
+
onBlur: F,
|
|
38
38
|
placeholder: Z,
|
|
39
|
-
label:
|
|
39
|
+
label: K,
|
|
40
40
|
helperText: w,
|
|
41
41
|
helperTextPosition: j = "absolute",
|
|
42
42
|
isError: m,
|
|
@@ -48,42 +48,42 @@ const Y = {
|
|
|
48
48
|
allowFreeText: R = !1,
|
|
49
49
|
required: ee
|
|
50
50
|
}, y) => {
|
|
51
|
-
const U =
|
|
51
|
+
const U = B(
|
|
52
52
|
() => xe({ options: c, min: u, max: d, step: f }),
|
|
53
53
|
[c, u, d, f]
|
|
54
|
-
),
|
|
54
|
+
), P = h !== void 0, [te, oe] = I(L), S = P ? h : te, [ne, W] = I(""), [r, C] = I(!1), n = r ? ne : S, [O, g] = I(-1), q = M(-1), [se, k] = I("keyboard"), G = M(null), H = M(null), re = x(
|
|
55
55
|
(e) => {
|
|
56
|
-
|
|
56
|
+
G.current = e, typeof y == "function" ? y(e) : y && (y.current = e);
|
|
57
57
|
},
|
|
58
58
|
[y]
|
|
59
|
-
), s =
|
|
59
|
+
), s = B(
|
|
60
60
|
() => pe(U, n),
|
|
61
61
|
[U, n]
|
|
62
|
-
),
|
|
62
|
+
), J = M(s), ie = B(() => {
|
|
63
63
|
if (!r || !n) return -1;
|
|
64
64
|
const e = s.findIndex(
|
|
65
65
|
(t) => t.toLowerCase() === n.toLowerCase()
|
|
66
66
|
);
|
|
67
67
|
return e >= 0 ? e : -1;
|
|
68
|
-
}, [r, n, s]), N =
|
|
68
|
+
}, [r, n, s]), N = O >= 0 ? O : ie, Q = O >= 0 ? se : "mouse";
|
|
69
69
|
me(() => {
|
|
70
|
-
|
|
70
|
+
q.current = N, J.current = s, r && N >= 0 && H.current && H.current.querySelectorAll("[data-combobox-item]")[N]?.scrollIntoView({ block: "nearest" });
|
|
71
71
|
}, [N, r, s]);
|
|
72
72
|
const l = x(
|
|
73
73
|
(e) => {
|
|
74
|
-
|
|
74
|
+
P || oe(e), A?.(e), C(!1), g(-1);
|
|
75
75
|
},
|
|
76
|
-
[
|
|
76
|
+
[P, A]
|
|
77
77
|
), D = x(() => {
|
|
78
78
|
C(!1), g(-1);
|
|
79
79
|
}, []), ae = x(
|
|
80
80
|
(e) => {
|
|
81
81
|
const t = e.target.value;
|
|
82
|
-
|
|
82
|
+
W(t), g(-1), k("mouse"), r || C(!0);
|
|
83
83
|
},
|
|
84
84
|
[r]
|
|
85
85
|
), le = x(() => {
|
|
86
|
-
p || (
|
|
86
|
+
p || (W(S), C(!0));
|
|
87
87
|
}, [p, S]), ce = x(
|
|
88
88
|
(e) => {
|
|
89
89
|
const t = e.relatedTarget;
|
|
@@ -94,10 +94,10 @@ const Y = {
|
|
|
94
94
|
);
|
|
95
95
|
i ? l(i) : s.length === 1 ? l(s[0]) : R && n ? l(n) : D();
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
F?.(e);
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
[r, s, n, l, D, R,
|
|
100
|
+
[r, s, n, l, D, R, F]
|
|
101
101
|
), ue = x(
|
|
102
102
|
(e) => {
|
|
103
103
|
if (!r) {
|
|
@@ -122,12 +122,12 @@ const Y = {
|
|
|
122
122
|
}
|
|
123
123
|
if (e.key === "Enter" || e.key === "Tab") {
|
|
124
124
|
e.preventDefault();
|
|
125
|
-
const t =
|
|
125
|
+
const t = q.current, i = J.current;
|
|
126
126
|
if (t >= 0 && t < i.length)
|
|
127
127
|
l(i[t]);
|
|
128
128
|
else {
|
|
129
129
|
const b = i.find(
|
|
130
|
-
(
|
|
130
|
+
(_) => _.toLowerCase() === n.toLowerCase()
|
|
131
131
|
);
|
|
132
132
|
b ? l(b) : i.length === 1 ? l(i[0]) : R && n ? l(n) : D();
|
|
133
133
|
}
|
|
@@ -137,7 +137,7 @@ const Y = {
|
|
|
137
137
|
[r, s, n, l, D, R]
|
|
138
138
|
), de = x(
|
|
139
139
|
(e) => {
|
|
140
|
-
l(e), setTimeout(() =>
|
|
140
|
+
l(e), setTimeout(() => G.current?.focus(), 0);
|
|
141
141
|
},
|
|
142
142
|
[l]
|
|
143
143
|
);
|
|
@@ -148,7 +148,7 @@ const Y = {
|
|
|
148
148
|
"data-numeric": z || void 0,
|
|
149
149
|
className: a("flex w-full flex-col gap-[6px]", E),
|
|
150
150
|
children: [
|
|
151
|
-
|
|
151
|
+
K && /* @__PURE__ */ v(
|
|
152
152
|
"label",
|
|
153
153
|
{
|
|
154
154
|
className: a(
|
|
@@ -157,7 +157,7 @@ const Y = {
|
|
|
157
157
|
m && "text-destructive"
|
|
158
158
|
),
|
|
159
159
|
children: [
|
|
160
|
-
|
|
160
|
+
K,
|
|
161
161
|
" ",
|
|
162
162
|
ee && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
|
|
163
163
|
]
|
|
@@ -219,13 +219,19 @@ const Y = {
|
|
|
219
219
|
V.Content,
|
|
220
220
|
{
|
|
221
221
|
align: "start",
|
|
222
|
+
side: "bottom",
|
|
222
223
|
sideOffset: 4,
|
|
224
|
+
avoidCollisions: !0,
|
|
225
|
+
collisionPadding: 8,
|
|
223
226
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
224
227
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
225
228
|
onInteractOutside: () => {
|
|
226
229
|
},
|
|
230
|
+
onWheel: (e) => e.stopPropagation(),
|
|
227
231
|
className: "z-[9999] overflow-hidden rounded-[12px] bg-white text-base shadow-[0px_1px_6px_0px_rgba(26,39,124,0.14)] focus:outline-none sm:text-sm flex flex-col border-none w-[var(--radix-popover-trigger-width)]",
|
|
228
|
-
style: {
|
|
232
|
+
style: {
|
|
233
|
+
maxHeight: "var(--radix-popover-content-available-height)"
|
|
234
|
+
},
|
|
229
235
|
children: /* @__PURE__ */ o(
|
|
230
236
|
"div",
|
|
231
237
|
{
|
|
@@ -233,6 +239,7 @@ const Y = {
|
|
|
233
239
|
className: "flex-1 overflow-auto py-1 px-[6px]",
|
|
234
240
|
style: { maxHeight: 240, overscrollBehavior: "contain" },
|
|
235
241
|
role: "listbox",
|
|
242
|
+
onWheel: (e) => e.stopPropagation(),
|
|
236
243
|
onMouseLeave: () => {
|
|
237
244
|
k("mouse"), g(-1);
|
|
238
245
|
},
|
|
@@ -247,10 +254,10 @@ const Y = {
|
|
|
247
254
|
className: a(
|
|
248
255
|
"cursor-default select-none py-[6px] px-3 flex items-center transition-colors rounded-md",
|
|
249
256
|
z ? "justify-end text-right" : "justify-between",
|
|
250
|
-
i &&
|
|
257
|
+
i && Q === "keyboard" ? "ring-2 ring-inset ring-primary bg-[#edf0ff] text-[#1f2b4d]" : i && Q === "mouse" ? "bg-gray-100 text-[#1f2b4d]" : b ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d] hover:bg-gray-100 cursor-pointer"
|
|
251
258
|
),
|
|
252
|
-
onMouseDown: (
|
|
253
|
-
|
|
259
|
+
onMouseDown: (_) => {
|
|
260
|
+
_.preventDefault(), de(e);
|
|
254
261
|
},
|
|
255
262
|
onMouseEnter: () => {
|
|
256
263
|
k("mouse"), g(t);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FilterStripProps } from '../types/filter-strip.types';
|
|
2
|
-
declare const FilterStrip: ({ filters, onFilterRemove, onAllFiltersClick, savedFilters, recentFilters, onApplySavedFilter, onSavedFilterSearch, onSavedFiltersScroll, onViewAll, onOverflowClick, selectedFilter, onSelectedFilterChange, onDropdownOpenChange, isLoadingFilterPreferencesList, isLoading, onEditSavedFilter, onDeleteSavedFilter, onSetDefaultSavedFilter, className, allFiltersKeybinding, allFiltersShortcutId, }: FilterStripProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const FilterStrip: ({ filters, onFilterRemove, onAllFiltersClick, savedFilters, recentFilters, onApplySavedFilter, onSavedFilterSearch, onSavedFiltersScroll, onViewAll, onOverflowClick, selectedFilter, onSelectedFilterChange, onDropdownOpenChange, isLoadingFilterPreferencesList, isLoading, onEditSavedFilter, onDeleteSavedFilter, onSetDefaultSavedFilter, className, allFiltersKeybinding, allFiltersShortcutId, showAllFiltersButton, showSavedFilters, }: FilterStripProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { FilterStrip };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { ListFilter as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { ListFilter as A } from "lucide-react";
|
|
3
3
|
import { cn as l } from "../../../lib/utils.js";
|
|
4
|
-
import { Button as
|
|
4
|
+
import { Button as B } from "../button.js";
|
|
5
5
|
import { Skeleton as t } from "../skeleton.js";
|
|
6
|
-
import { FilterSummary as
|
|
7
|
-
import { FilterTagList as
|
|
8
|
-
import { useImpactNovaI18n as
|
|
9
|
-
const
|
|
6
|
+
import { FilterSummary as C } from "./filter-summary.js";
|
|
7
|
+
import { FilterTagList as K } from "./filter-tag-list.js";
|
|
8
|
+
import { useImpactNovaI18n as M } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
9
|
+
const O = ({
|
|
10
10
|
filters: s,
|
|
11
11
|
onFilterRemove: n,
|
|
12
12
|
onAllFiltersClick: m,
|
|
@@ -14,23 +14,25 @@ const G = ({
|
|
|
14
14
|
recentFilters: c,
|
|
15
15
|
onApplySavedFilter: p,
|
|
16
16
|
onSavedFilterSearch: h,
|
|
17
|
-
onSavedFiltersScroll:
|
|
18
|
-
onViewAll:
|
|
17
|
+
onSavedFiltersScroll: d,
|
|
18
|
+
onViewAll: f,
|
|
19
19
|
onOverflowClick: w,
|
|
20
20
|
selectedFilter: x,
|
|
21
21
|
onSelectedFilterChange: N,
|
|
22
22
|
onDropdownOpenChange: v,
|
|
23
23
|
isLoadingFilterPreferencesList: g,
|
|
24
|
-
isLoading:
|
|
25
|
-
onEditSavedFilter:
|
|
24
|
+
isLoading: u,
|
|
25
|
+
onEditSavedFilter: k,
|
|
26
26
|
onDeleteSavedFilter: b,
|
|
27
|
-
onSetDefaultSavedFilter:
|
|
27
|
+
onSetDefaultSavedFilter: F,
|
|
28
28
|
className: a,
|
|
29
|
-
allFiltersKeybinding:
|
|
30
|
-
allFiltersShortcutId:
|
|
29
|
+
allFiltersKeybinding: S,
|
|
30
|
+
allFiltersShortcutId: y,
|
|
31
|
+
showAllFiltersButton: j = !0,
|
|
32
|
+
showSavedFilters: I = !0
|
|
31
33
|
}) => {
|
|
32
|
-
const { t: r } =
|
|
33
|
-
return
|
|
34
|
+
const { t: r } = M();
|
|
35
|
+
return u ? /* @__PURE__ */ e(
|
|
34
36
|
"div",
|
|
35
37
|
{
|
|
36
38
|
"data-component": "filter-strip",
|
|
@@ -71,45 +73,47 @@ const G = ({
|
|
|
71
73
|
a
|
|
72
74
|
),
|
|
73
75
|
children: [
|
|
76
|
+
I && /* @__PURE__ */ i(L, { children: [
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
C,
|
|
79
|
+
{
|
|
80
|
+
selectedFilter: x,
|
|
81
|
+
onSelectedFilterChange: N,
|
|
82
|
+
savedFilters: o,
|
|
83
|
+
recentFilters: c,
|
|
84
|
+
onApplySavedFilter: p,
|
|
85
|
+
onSavedFilterSearch: h,
|
|
86
|
+
onSavedFiltersScroll: d,
|
|
87
|
+
onDropdownOpenChange: v,
|
|
88
|
+
isLoadingFilterPreferencesList: g,
|
|
89
|
+
onEditSavedFilter: k,
|
|
90
|
+
onDeleteSavedFilter: b,
|
|
91
|
+
onSetDefaultSavedFilter: F
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-[1px] bg-stroke-hairline mx-1 shrink-0" })
|
|
95
|
+
] }),
|
|
74
96
|
/* @__PURE__ */ e(
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
selectedFilter: x,
|
|
78
|
-
onSelectedFilterChange: N,
|
|
79
|
-
savedFilters: o,
|
|
80
|
-
recentFilters: c,
|
|
81
|
-
onApplySavedFilter: p,
|
|
82
|
-
onSavedFilterSearch: h,
|
|
83
|
-
onSavedFiltersScroll: f,
|
|
84
|
-
onDropdownOpenChange: v,
|
|
85
|
-
isLoadingFilterPreferencesList: g,
|
|
86
|
-
onEditSavedFilter: u,
|
|
87
|
-
onDeleteSavedFilter: b,
|
|
88
|
-
onSetDefaultSavedFilter: S
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ e("div", { className: "h-4 w-[1px] bg-stroke-hairline mx-1 shrink-0" }),
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
-
A,
|
|
97
|
+
K,
|
|
94
98
|
{
|
|
95
99
|
filters: s,
|
|
96
100
|
onFilterRemove: n,
|
|
97
101
|
onOverflowClick: w,
|
|
98
|
-
onViewAll:
|
|
102
|
+
onViewAll: f
|
|
99
103
|
}
|
|
100
104
|
),
|
|
101
|
-
/* @__PURE__ */ i(
|
|
102
|
-
|
|
105
|
+
j && /* @__PURE__ */ i(
|
|
106
|
+
B,
|
|
103
107
|
{
|
|
104
108
|
variant: "tertiary",
|
|
105
109
|
onClick: m,
|
|
106
110
|
"data-component": "filter-strip-all-filters",
|
|
107
111
|
"aria-label": r("filterStrip.allFilters"),
|
|
108
112
|
tooltipSide: "bottom",
|
|
109
|
-
tooltipKeybinding:
|
|
110
|
-
"data-shortcut-id":
|
|
113
|
+
tooltipKeybinding: S,
|
|
114
|
+
"data-shortcut-id": y,
|
|
111
115
|
children: [
|
|
112
|
-
/* @__PURE__ */ e(
|
|
116
|
+
/* @__PURE__ */ e(A, { className: "h-4 w-4" }),
|
|
113
117
|
r("filterStrip.allFilters")
|
|
114
118
|
]
|
|
115
119
|
}
|
|
@@ -119,5 +123,5 @@ const G = ({
|
|
|
119
123
|
);
|
|
120
124
|
};
|
|
121
125
|
export {
|
|
122
|
-
|
|
126
|
+
O as FilterStrip
|
|
123
127
|
};
|
|
@@ -5,12 +5,13 @@ interface FilterTagListProps {
|
|
|
5
5
|
onOverflowClick?: (id: string) => void;
|
|
6
6
|
onViewAll?: () => void;
|
|
7
7
|
}
|
|
8
|
-
declare const FilterPopoverContent: ({ remainingValues, viewAllTrigger, onViewAll, onItemRemove, isRemovable }: {
|
|
8
|
+
declare const FilterPopoverContent: ({ remainingValues, viewAllTrigger, onViewAll, onItemRemove, isRemovable, isCopyable }: {
|
|
9
9
|
remainingValues: (string | number)[];
|
|
10
10
|
viewAllTrigger?: "expand" | "custom";
|
|
11
11
|
onViewAll?: () => void;
|
|
12
12
|
onItemRemove: (val: string | number) => void;
|
|
13
13
|
isRemovable?: boolean;
|
|
14
|
+
isCopyable?: boolean;
|
|
14
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
declare const FilterTagList: ({ filters, onFilterRemove: _onFilterRemove, onOverflowClick, onViewAll, }: FilterTagListProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export { FilterTagList, FilterPopoverContent };
|
|
@@ -1,55 +1,72 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import * as N from "react";
|
|
3
|
-
import
|
|
4
|
-
import { TagGroup as
|
|
5
|
-
import { Tag as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Button as
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
3
|
+
import k from "../horizontal-scroller/horizontal-scroller.js";
|
|
4
|
+
import { TagGroup as S } from "../tag-group.js";
|
|
5
|
+
import { Tag as C } from "../tag.js";
|
|
6
|
+
import { Tooltip as v, TooltipTrigger as b, TooltipContent as y } from "../tooltip.js";
|
|
7
|
+
import { Popover as T, PopoverTrigger as z, PopoverContent as $ } from "../popover.js";
|
|
8
|
+
import { Button as j } from "../button.js";
|
|
9
|
+
import { Check as I, Copy as P, X as A } from "lucide-react";
|
|
10
|
+
const F = ({
|
|
11
11
|
remainingValues: l,
|
|
12
12
|
viewAllTrigger: s = "expand",
|
|
13
|
-
onViewAll:
|
|
14
|
-
onItemRemove:
|
|
15
|
-
isRemovable:
|
|
13
|
+
onViewAll: d,
|
|
14
|
+
onItemRemove: h,
|
|
15
|
+
isRemovable: w,
|
|
16
|
+
isCopyable: e = !1
|
|
16
17
|
}) => {
|
|
17
|
-
const [
|
|
18
|
-
|
|
18
|
+
const [c, p] = N.useState(!1), [u, n] = N.useState(null), m = (a, t, i) => {
|
|
19
|
+
navigator.clipboard.writeText(String(t)), n(i), a.currentTarget.blur(), setTimeout(() => n(null), 1500);
|
|
20
|
+
}, x = c ? l : l.slice(0, 3), g = l.length > 3, f = () => {
|
|
21
|
+
s === "custom" ? d?.() : p(!0);
|
|
19
22
|
};
|
|
20
23
|
return /* @__PURE__ */ r(
|
|
21
|
-
|
|
24
|
+
$,
|
|
22
25
|
{
|
|
23
26
|
className: "w-[200px] p-0 rounded-[8px] bg-white shadow-[0_0_4px_0_rgba(0,0,0,0.12)] border-none",
|
|
24
27
|
align: "start",
|
|
25
28
|
sideOffset: 8,
|
|
29
|
+
onOpenAutoFocus: (a) => a.preventDefault(),
|
|
26
30
|
children: /* @__PURE__ */ o("div", { className: "flex flex-col py-2 px-[6px]", children: [
|
|
27
|
-
/* @__PURE__ */ r("div", { className: `flex flex-col gap-1 mb-2 ${
|
|
28
|
-
/* @__PURE__ */ o(
|
|
29
|
-
/* @__PURE__ */ r(
|
|
30
|
-
/* @__PURE__ */ r(
|
|
31
|
+
/* @__PURE__ */ r("div", { className: `flex flex-col gap-1 mb-2 ${c ? "max-h-[180px] overflow-y-auto" : ""}`, children: x.map((a, t) => /* @__PURE__ */ o("div", { className: "flex items-center justify-between text-[14px] font-medium leading-[20px] text-[#1f2b4d] px-3 py-2 overflow-hidden hover:bg-slate-50 rounded group shrink-0", children: [
|
|
32
|
+
/* @__PURE__ */ o(v, { children: [
|
|
33
|
+
/* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r("span", { className: "truncate", children: String(a) }) }),
|
|
34
|
+
/* @__PURE__ */ r(y, { variant: "tertiary", side: "right", children: String(a) })
|
|
31
35
|
] }),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
/* @__PURE__ */ o("div", { className: "flex items-center shrink-0", children: [
|
|
37
|
+
e && /* @__PURE__ */ r(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
onClick: (i) => {
|
|
41
|
+
i.stopPropagation(), m(i, a, t);
|
|
42
|
+
},
|
|
43
|
+
"aria-label": `Copy ${String(a)}`,
|
|
44
|
+
className: "ml-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-gray-400 hover:bg-black/5 hover:text-gray-600 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity",
|
|
45
|
+
children: u === t ? /* @__PURE__ */ r(I, { size: 12, className: "text-green-500" }) : /* @__PURE__ */ r(P, { size: 12 })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
w && /* @__PURE__ */ r(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
onClick: (i) => {
|
|
52
|
+
i.stopPropagation(), h(a);
|
|
53
|
+
},
|
|
54
|
+
"aria-label": `Remove ${String(a)}`,
|
|
55
|
+
className: "ml-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-gray-400 hover:bg-black/5 hover:text-gray-600 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity",
|
|
56
|
+
children: /* @__PURE__ */ r(A, { size: 12 })
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] })
|
|
60
|
+
] }, t)) }),
|
|
61
|
+
!c && g && /* @__PURE__ */ o("div", { className: "flex flex-col gap-2", children: [
|
|
45
62
|
/* @__PURE__ */ r("div", { className: "h-[1px] bg-[#e6e8f0] w-full" }),
|
|
46
63
|
/* @__PURE__ */ r(
|
|
47
|
-
|
|
64
|
+
j,
|
|
48
65
|
{
|
|
49
66
|
variant: "secondary",
|
|
50
67
|
size: "sm",
|
|
51
68
|
className: "w-full justify-center",
|
|
52
|
-
onClick:
|
|
69
|
+
onClick: f,
|
|
53
70
|
children: s === "custom" ? "View all" : `View all (${l.length})`
|
|
54
71
|
}
|
|
55
72
|
)
|
|
@@ -57,19 +74,19 @@ const j = ({
|
|
|
57
74
|
] })
|
|
58
75
|
}
|
|
59
76
|
);
|
|
60
|
-
},
|
|
77
|
+
}, q = ({
|
|
61
78
|
filters: l,
|
|
62
79
|
onFilterRemove: s,
|
|
63
|
-
onOverflowClick:
|
|
64
|
-
onViewAll:
|
|
80
|
+
onOverflowClick: d,
|
|
81
|
+
onViewAll: h
|
|
65
82
|
}) => /* @__PURE__ */ r("div", { className: "flex flex-1 items-center min-w-0", children: /* @__PURE__ */ r(
|
|
66
|
-
|
|
83
|
+
k,
|
|
67
84
|
{
|
|
68
85
|
items: l,
|
|
69
|
-
renderItem: (e,
|
|
70
|
-
const
|
|
86
|
+
renderItem: (e, c) => {
|
|
87
|
+
const p = Array.isArray(e.value) ? e.value : [e.value], u = p.slice(0, 2), n = p.slice(2), m = !!e.overflow, x = e.overflow?.label ? e.overflow.label : e.overflow?.count ? `+${e.overflow.count}` : null, g = n.length > 0, f = m || g, a = `+${n.length}`;
|
|
71
88
|
return /* @__PURE__ */ o("div", { className: "flex items-center px-1", children: [
|
|
72
|
-
|
|
89
|
+
c > 0 && /* @__PURE__ */ r("div", { className: "mx-3 h-4 w-[1px] bg-[#e6e8f0] shrink-0" }),
|
|
73
90
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
74
91
|
/* @__PURE__ */ o("span", { className: "text-xs font-medium leading-[21px] text-[#60697d] whitespace-nowrap", children: [
|
|
75
92
|
e.label,
|
|
@@ -77,71 +94,72 @@ const j = ({
|
|
|
77
94
|
] }),
|
|
78
95
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
|
|
79
96
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
97
|
+
S,
|
|
81
98
|
{
|
|
82
99
|
spacing: "sm",
|
|
83
|
-
tags:
|
|
84
|
-
label: String(
|
|
100
|
+
tags: u.map((t) => ({
|
|
101
|
+
label: String(t),
|
|
85
102
|
variant: "secondary",
|
|
86
103
|
size: "md",
|
|
87
104
|
shape: "rounded",
|
|
88
105
|
removable: e.removable,
|
|
89
|
-
onRemove: () => s(e.id,
|
|
106
|
+
onRemove: () => s(e.id, t)
|
|
90
107
|
}))
|
|
91
108
|
}
|
|
92
109
|
),
|
|
93
|
-
|
|
110
|
+
f && (m ? (
|
|
94
111
|
// Server-side overflow: Simple tag, no popover
|
|
95
|
-
/* @__PURE__ */ o(
|
|
96
|
-
/* @__PURE__ */ r(
|
|
97
|
-
|
|
112
|
+
/* @__PURE__ */ o(v, { children: [
|
|
113
|
+
/* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(
|
|
114
|
+
C,
|
|
98
115
|
{
|
|
99
116
|
variant: "secondary",
|
|
100
117
|
size: "md",
|
|
101
118
|
shape: "rounded",
|
|
102
119
|
className: "whitespace-nowrap bg-[#eceefd] text-[#4259ee] hover:bg-[#dce1fc] border-0 h-5 px-2 text-xs font-medium font-['Manrope'] cursor-pointer",
|
|
103
|
-
onClick: () =>
|
|
120
|
+
onClick: () => d?.(e.id),
|
|
104
121
|
tabIndex: 0,
|
|
105
122
|
role: "button",
|
|
106
|
-
"aria-label": `${e.overflow?.count ||
|
|
107
|
-
onKeyDown: (
|
|
108
|
-
(
|
|
123
|
+
"aria-label": `${e.overflow?.count || n.length} more filters for ${e.label}`,
|
|
124
|
+
onKeyDown: (t) => {
|
|
125
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), d?.(e.id));
|
|
109
126
|
},
|
|
110
|
-
children:
|
|
127
|
+
children: x || a
|
|
111
128
|
}
|
|
112
129
|
) }),
|
|
113
|
-
/* @__PURE__ */ o(
|
|
114
|
-
e.overflow?.count ||
|
|
130
|
+
/* @__PURE__ */ o(y, { variant: "tertiary", side: "top", children: [
|
|
131
|
+
e.overflow?.count || n.length,
|
|
115
132
|
" more filters"
|
|
116
133
|
] })
|
|
117
134
|
] })
|
|
118
135
|
) : (
|
|
119
136
|
// Client-side overflow: Popover
|
|
120
|
-
/* @__PURE__ */ o(
|
|
121
|
-
/* @__PURE__ */ o(
|
|
122
|
-
/* @__PURE__ */ r(
|
|
123
|
-
|
|
137
|
+
/* @__PURE__ */ o(T, { children: [
|
|
138
|
+
/* @__PURE__ */ o(v, { children: [
|
|
139
|
+
/* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(z, { asChild: !0, children: /* @__PURE__ */ r(
|
|
140
|
+
C,
|
|
124
141
|
{
|
|
125
142
|
variant: "secondary",
|
|
126
143
|
size: "md",
|
|
127
144
|
shape: "rounded",
|
|
128
145
|
className: "whitespace-nowrap bg-[#eceefd] text-[#4259ee] hover:bg-[#dce1fc] border-0 h-5 px-2 text-xs font-medium font-['Manrope'] cursor-pointer",
|
|
129
|
-
children:
|
|
146
|
+
children: a
|
|
130
147
|
}
|
|
131
148
|
) }) }),
|
|
132
|
-
/* @__PURE__ */ o(
|
|
133
|
-
|
|
149
|
+
/* @__PURE__ */ o(y, { variant: "tertiary", side: "top", children: [
|
|
150
|
+
n.length,
|
|
134
151
|
" more filters"
|
|
135
152
|
] })
|
|
136
153
|
] }),
|
|
137
154
|
/* @__PURE__ */ r(
|
|
138
|
-
|
|
155
|
+
F,
|
|
139
156
|
{
|
|
140
|
-
remainingValues:
|
|
157
|
+
remainingValues: n,
|
|
141
158
|
viewAllTrigger: e.viewAllTrigger,
|
|
142
|
-
onViewAll:
|
|
143
|
-
onItemRemove: (
|
|
144
|
-
isRemovable: e.removable
|
|
159
|
+
onViewAll: h,
|
|
160
|
+
onItemRemove: (t) => s(e.id, t),
|
|
161
|
+
isRemovable: e.removable,
|
|
162
|
+
isCopyable: e.copyable
|
|
145
163
|
}
|
|
146
164
|
)
|
|
147
165
|
] })
|
|
@@ -155,6 +173,6 @@ const j = ({
|
|
|
155
173
|
}
|
|
156
174
|
) });
|
|
157
175
|
export {
|
|
158
|
-
|
|
159
|
-
|
|
176
|
+
F as FilterPopoverContent,
|
|
177
|
+
q as FilterTagList
|
|
160
178
|
};
|