impact-nova 2.2.5 → 2.2.7
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/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +2 -1
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +12 -11
- package/dist/components/data/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +54 -56
- package/dist/components/data/ag-grid-react/index.d.ts +2 -0
- package/dist/components/data/ag-grid-react/index.js +41 -36
- package/dist/components/data/data-table/data-table-saved-views.js +223 -207
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +44 -30
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +158 -184
- package/dist/components/data-display/badge/badge.variants.d.ts +2 -2
- package/dist/components/data-display/statistics-card/statistics-card.js +138 -111
- package/dist/components/feedback/alert/alert.variants.d.ts +1 -1
- package/dist/components/feedback/tooltip/badge-overflow-tooltip.d.ts +19 -0
- package/dist/components/feedback/tooltip/badge-overflow-tooltip.js +48 -0
- package/dist/components/feedback/tooltip/index.d.ts +5 -0
- package/dist/components/feedback/tooltip/index.js +16 -10
- package/dist/components/feedback/tooltip/overflow-tooltip.d.ts +2 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.js +92 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.types.d.ts +42 -0
- package/dist/components/feedback/tooltip/tooltip.d.ts +2 -2
- package/dist/components/feedback/tooltip/tooltip.js +65 -28
- package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
- package/dist/components/feedback/tooltip/use-overflow-tooltip.d.ts +3 -0
- package/dist/components/feedback/tooltip/use-overflow-tooltip.js +109 -0
- package/dist/components/flows/command-palette/shortcut-settings.js +85 -66
- package/dist/components/flows/filter-panel/filter-panel.js +94 -83
- package/dist/components/flows/filter-strip/filter-summary.js +187 -177
- package/dist/components/flows/filter-strip/filter-tag-list.js +123 -107
- package/dist/components/forms/prompt/prompt.variants.d.ts +1 -1
- package/dist/components/forms/select/components/SelectMenuPanel.js +26 -22
- package/dist/components/forms/select/components/SelectOptionRow.js +77 -66
- package/dist/components/forms/select/components/SelectTriggerValue.js +49 -20
- package/dist/components/forms/select/components/Submenu.js +53 -39
- package/dist/components/forms/select/hooks/useSuppressOptionClickForTextSelection.d.ts +5 -0
- package/dist/components/forms/select/hooks/useSuppressOptionClickForTextSelection.js +28 -0
- package/dist/components/forms/select/select.js +121 -120
- package/dist/components/forms/select/utils/shouldSuppressOptionClickForTextSelection.d.ts +5 -0
- package/dist/components/forms/select/utils/shouldSuppressOptionClickForTextSelection.js +16 -0
- package/dist/components/layout/horizontal-scroller/index.d.ts +4 -0
- package/dist/components/layout/horizontal-scroller/index.js +6 -2
- package/dist/components/layout/horizontal-scroller/scroll-overflow-affordance.d.ts +10 -0
- package/dist/components/layout/horizontal-scroller/scroll-overflow-affordance.js +124 -0
- package/dist/components/layout/horizontal-scroller/use-horizontal-scroll-overflow.d.ts +13 -0
- package/dist/components/layout/horizontal-scroller/use-horizontal-scroll-overflow.js +40 -0
- package/dist/components/primitives/stepper/stepper.js +61 -42
- package/dist/components/primitives/tag/tag.variants.d.ts +1 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +473 -463
- package/dist/lib/overflow/is-text-overflowing.d.ts +3 -0
- package/dist/lib/overflow/is-text-overflowing.js +6 -0
- package/dist/lib/overlay/prevent-dismiss-on-tooltip-outside.d.ts +3 -0
- package/dist/lib/overlay/prevent-dismiss-on-tooltip-outside.js +34 -0
- package/dist/lib/tooltip/tooltip-content-interaction.d.ts +4 -0
- package/dist/lib/tooltip/tooltip-content-interaction.js +21 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/llms/rules/troubleshooting.js +1 -1
- package/dist/providers/app-providers.js +18 -11
- package/package.json +1 -1
|
@@ -1,171 +1,187 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import * as N from "react";
|
|
3
|
+
import { cn as O } from "../../../lib/utils.js";
|
|
4
|
+
import { HorizontalScroller as $ } from "../../layout/horizontal-scroller/horizontal-scroller.js";
|
|
5
|
+
import { TagGroup as A } from "../../primitives/tag-group/tag-group.js";
|
|
6
|
+
import { Tag as C } from "../../primitives/tag/tag.js";
|
|
7
|
+
import { Tooltip as T, TooltipTrigger as k, TooltipContent as z } from "../../feedback/tooltip/tooltip.js";
|
|
8
|
+
import { OverflowTooltip as P } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
9
|
+
import { PopoverContent as j, Popover as R, PopoverTrigger as B } from "../../feedback/popover/popover.js";
|
|
10
|
+
import { Button as F } from "../../primitives/button/button.js";
|
|
11
|
+
import { Checkmark as I, Copy as L, Cross as V } from "impact-nova-icons";
|
|
12
|
+
const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px-2 text-xs font-medium font-['Manrope'] cursor-pointer focus:!ring-inset focus:!ring-offset-0 focus:!ring-brand data-[state=open]:!ring-inset data-[state=open]:!ring-offset-0 data-[state=open]:!ring-brand", E = ({
|
|
13
|
+
remainingValues: a,
|
|
12
14
|
viewAllTrigger: c = "expand",
|
|
13
|
-
onViewAll:
|
|
14
|
-
onItemRemove:
|
|
15
|
-
isRemovable:
|
|
16
|
-
isCopyable:
|
|
15
|
+
onViewAll: u,
|
|
16
|
+
onItemRemove: v,
|
|
17
|
+
isRemovable: f,
|
|
18
|
+
isCopyable: e = !1,
|
|
17
19
|
externalCopyFunction: m
|
|
18
20
|
}) => {
|
|
19
|
-
const [
|
|
20
|
-
navigator.clipboard.writeText(String(l)), d(
|
|
21
|
-
},
|
|
22
|
-
c === "custom" ?
|
|
21
|
+
const [s, g] = N.useState(!1), [n, d] = N.useState(null), x = (t, l, i) => {
|
|
22
|
+
navigator.clipboard.writeText(String(l)), d(i), t.currentTarget.blur(), setTimeout(() => d(null), 1500);
|
|
23
|
+
}, w = s ? a : a.slice(0, 3), b = a.length > 3, h = () => {
|
|
24
|
+
c === "custom" ? u?.() : g(!0);
|
|
23
25
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
26
|
+
return /* @__PURE__ */ o(
|
|
27
|
+
j,
|
|
26
28
|
{
|
|
27
29
|
className: "w-[200px] p-0 rounded-[8px] bg-canvas-elevated shadow-elevation-floating border-none",
|
|
28
30
|
align: "start",
|
|
29
31
|
sideOffset: 8,
|
|
30
|
-
onOpenAutoFocus: (
|
|
32
|
+
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
31
33
|
children: /* @__PURE__ */ r("div", { className: "flex flex-col py-2 px-[6px]", children: [
|
|
32
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ o(
|
|
33
35
|
"div",
|
|
34
36
|
{
|
|
35
|
-
className: `flex flex-col gap-1 mb-2 ${
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */ r("div", { className: "flex items-center shrink-0", children: [
|
|
46
|
-
t && /* @__PURE__ */ e(
|
|
47
|
-
"button",
|
|
37
|
+
className: `flex flex-col gap-1 mb-2 ${s ? "max-h-[180px] overflow-y-auto" : ""}`,
|
|
38
|
+
children: w.map((t, l) => {
|
|
39
|
+
const i = String(t), y = !!(e || f);
|
|
40
|
+
return /* @__PURE__ */ r(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: "group relative flex min-w-0 items-stretch overflow-hidden rounded px-3 py-2 text-[14px] font-medium leading-[20px] text-foreground hover:bg-secondary",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ o(
|
|
46
|
+
P,
|
|
48
47
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
triggerClassName: O(
|
|
49
|
+
"block min-w-0 flex-1 self-stretch truncate overflow-hidden",
|
|
50
|
+
y && "pe-0 group-hover:pe-10"
|
|
51
|
+
),
|
|
52
|
+
content: i,
|
|
53
|
+
side: "right",
|
|
54
|
+
variant: "tertiary",
|
|
55
|
+
children: i
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
y ? /* @__PURE__ */ r("div", { className: "pointer-events-none absolute end-2 top-1/2 z-10 flex -translate-y-1/2 items-center gap-1 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100", children: [
|
|
59
|
+
e ? /* @__PURE__ */ o(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
type: "button",
|
|
63
|
+
onClick: (p) => {
|
|
64
|
+
p.stopPropagation(), m ? m({ e: p, val: t, index: l }) : x(p, t, l);
|
|
65
|
+
},
|
|
66
|
+
"aria-label": `Copy ${i}`,
|
|
67
|
+
className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-content-icon hover:bg-scrim-hover hover:text-content-secondary",
|
|
68
|
+
children: n === l ? /* @__PURE__ */ o(I, { size: 12, className: "text-success" }) : /* @__PURE__ */ o(L, { size: 12 })
|
|
69
|
+
}
|
|
70
|
+
) : null,
|
|
71
|
+
f ? /* @__PURE__ */ o(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
type: "button",
|
|
75
|
+
onClick: (p) => {
|
|
76
|
+
p.stopPropagation(), v(t);
|
|
77
|
+
},
|
|
78
|
+
"aria-label": `Remove ${i}`,
|
|
79
|
+
className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-content-icon hover:bg-scrim-hover hover:text-content-secondary",
|
|
80
|
+
children: /* @__PURE__ */ o(V, { size: 12 })
|
|
81
|
+
}
|
|
82
|
+
) : null
|
|
83
|
+
] }) : null
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
l
|
|
87
|
+
);
|
|
88
|
+
})
|
|
73
89
|
}
|
|
74
90
|
),
|
|
75
|
-
!
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
91
|
+
!s && b && /* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
|
|
92
|
+
/* @__PURE__ */ o("div", { className: "h-px bg-stroke-hairline w-full" }),
|
|
93
|
+
/* @__PURE__ */ o(
|
|
94
|
+
F,
|
|
79
95
|
{
|
|
80
96
|
variant: "secondary",
|
|
81
97
|
size: "md",
|
|
82
98
|
className: "w-full justify-center",
|
|
83
|
-
onClick:
|
|
84
|
-
children: c === "custom" ? "View all" : `View all (${
|
|
99
|
+
onClick: h,
|
|
100
|
+
children: c === "custom" ? "View all" : `View all (${a.length})`
|
|
85
101
|
}
|
|
86
102
|
)
|
|
87
103
|
] })
|
|
88
104
|
] })
|
|
89
105
|
}
|
|
90
106
|
);
|
|
91
|
-
},
|
|
92
|
-
filters:
|
|
107
|
+
}, X = ({
|
|
108
|
+
filters: a,
|
|
93
109
|
onFilterRemove: c,
|
|
94
|
-
onOverflowClick:
|
|
95
|
-
onViewAll:
|
|
96
|
-
}) => /* @__PURE__ */
|
|
97
|
-
|
|
110
|
+
onOverflowClick: u,
|
|
111
|
+
onViewAll: v
|
|
112
|
+
}) => /* @__PURE__ */ o("div", { className: "flex flex-1 items-center min-w-0", children: /* @__PURE__ */ o(
|
|
113
|
+
$,
|
|
98
114
|
{
|
|
99
|
-
items:
|
|
100
|
-
renderItem: (
|
|
101
|
-
const
|
|
115
|
+
items: a,
|
|
116
|
+
renderItem: (e, m) => {
|
|
117
|
+
const s = Array.isArray(e.value) ? e.value : [e.value], g = s.slice(0, 2), n = s.slice(2), d = !!e.overflow, x = e.overflow?.label ? e.overflow.label : e.overflow?.count ? `+${e.overflow.count}` : null, w = n.length > 0, b = d || w, h = `+${n.length}`;
|
|
102
118
|
return /* @__PURE__ */ r("div", { className: "flex items-center px-1", children: [
|
|
103
|
-
m > 0 && /* @__PURE__ */
|
|
119
|
+
m > 0 && /* @__PURE__ */ o("div", { className: "mx-3 h-4 w-px bg-stroke-hairline shrink-0" }),
|
|
104
120
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
105
121
|
/* @__PURE__ */ r("span", { className: "text-xs font-medium leading-[21px] text-secondary-foreground whitespace-nowrap", children: [
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
e.label,
|
|
123
|
+
e.required && /* @__PURE__ */ o("span", { className: "text-validation ms-0.5", children: "*" })
|
|
108
124
|
] }),
|
|
109
125
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
126
|
+
/* @__PURE__ */ o(
|
|
127
|
+
A,
|
|
112
128
|
{
|
|
113
129
|
spacing: "sm",
|
|
114
|
-
tags:
|
|
115
|
-
label: String(
|
|
130
|
+
tags: g.map((t) => ({
|
|
131
|
+
label: String(t),
|
|
116
132
|
variant: "secondary",
|
|
117
133
|
size: "md",
|
|
118
134
|
shape: "rounded",
|
|
119
|
-
removable:
|
|
120
|
-
onRemove: () => c(
|
|
135
|
+
removable: e.removable,
|
|
136
|
+
onRemove: () => c(e.id, t)
|
|
121
137
|
}))
|
|
122
138
|
}
|
|
123
139
|
),
|
|
124
|
-
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
140
|
+
b && (d ? /* @__PURE__ */ r(T, { children: [
|
|
141
|
+
/* @__PURE__ */ o(k, { asChild: !0, children: /* @__PURE__ */ o(
|
|
142
|
+
C,
|
|
127
143
|
{
|
|
128
144
|
asButton: !0,
|
|
129
145
|
variant: "secondary",
|
|
130
146
|
size: "md",
|
|
131
147
|
shape: "rounded",
|
|
132
|
-
className:
|
|
133
|
-
"aria-label": `${
|
|
134
|
-
onClick: () =>
|
|
135
|
-
children:
|
|
148
|
+
className: S,
|
|
149
|
+
"aria-label": `${e.overflow?.count || n.length} more filters for ${e.label}`,
|
|
150
|
+
onClick: () => u?.(e.id),
|
|
151
|
+
children: x || h
|
|
136
152
|
}
|
|
137
153
|
) }),
|
|
138
|
-
/* @__PURE__ */ r(
|
|
139
|
-
|
|
154
|
+
/* @__PURE__ */ r(z, { variant: "tertiary", side: "top", children: [
|
|
155
|
+
e.overflow?.count || n.length,
|
|
140
156
|
" more filters"
|
|
141
157
|
] })
|
|
142
|
-
] }) : /* @__PURE__ */ r(
|
|
143
|
-
/* @__PURE__ */ r(
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
158
|
+
] }) : /* @__PURE__ */ r(R, { children: [
|
|
159
|
+
/* @__PURE__ */ r(T, { children: [
|
|
160
|
+
/* @__PURE__ */ o(k, { asChild: !0, children: /* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o(
|
|
161
|
+
C,
|
|
146
162
|
{
|
|
147
163
|
asButton: !0,
|
|
148
164
|
variant: "secondary",
|
|
149
165
|
size: "md",
|
|
150
166
|
shape: "rounded",
|
|
151
|
-
className:
|
|
152
|
-
children:
|
|
167
|
+
className: S,
|
|
168
|
+
children: h
|
|
153
169
|
}
|
|
154
170
|
) }) }),
|
|
155
|
-
/* @__PURE__ */ r(
|
|
171
|
+
/* @__PURE__ */ r(z, { variant: "tertiary", side: "top", children: [
|
|
156
172
|
n.length,
|
|
157
173
|
" more filters"
|
|
158
174
|
] })
|
|
159
175
|
] }),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
|
|
176
|
+
/* @__PURE__ */ o(
|
|
177
|
+
E,
|
|
162
178
|
{
|
|
163
179
|
remainingValues: n,
|
|
164
|
-
viewAllTrigger:
|
|
165
|
-
onViewAll:
|
|
166
|
-
onItemRemove: (
|
|
167
|
-
isRemovable:
|
|
168
|
-
isCopyable:
|
|
180
|
+
viewAllTrigger: e.viewAllTrigger,
|
|
181
|
+
onViewAll: v,
|
|
182
|
+
onItemRemove: (t) => c(e.id, t),
|
|
183
|
+
isRemovable: e.removable,
|
|
184
|
+
isCopyable: e.copyable
|
|
169
185
|
}
|
|
170
186
|
)
|
|
171
187
|
] }))
|
|
@@ -178,6 +194,6 @@ const T = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
178
194
|
}
|
|
179
195
|
) });
|
|
180
196
|
export {
|
|
181
|
-
|
|
182
|
-
|
|
197
|
+
E as FilterPopoverContent,
|
|
198
|
+
X as FilterTagList
|
|
183
199
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const promptVariants: (props?: ({
|
|
2
|
-
variant?: "default" | "
|
|
2
|
+
variant?: "default" | "success" | "warning" | "destructive" | "info" | null | undefined;
|
|
3
3
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,58 +1,62 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import * as n from "@radix-ui/react-popover";
|
|
3
|
+
import { cn as a } from "../../../../lib/utils.js";
|
|
4
|
+
import { preventDismissOnTooltipOutside as t } from "../../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
|
|
5
|
+
import { useOverlayPortalContainer as v } from "../../../../lib/overlay/overlay-portal-context.js";
|
|
6
|
+
import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as f } from "../../../../lib/overlay/overlay-host.constants.js";
|
|
7
|
+
function O({
|
|
8
|
+
menuRef: l,
|
|
9
|
+
menuMinHeight: i,
|
|
10
|
+
menuWidth: s,
|
|
10
11
|
isReadOnly: r,
|
|
11
12
|
id: d,
|
|
12
|
-
menuLabel:
|
|
13
|
-
children:
|
|
13
|
+
menuLabel: p,
|
|
14
|
+
children: m
|
|
14
15
|
}) {
|
|
15
|
-
const c =
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
17
|
-
|
|
16
|
+
const c = v();
|
|
17
|
+
return /* @__PURE__ */ o(n.Portal, { container: c, children: /* @__PURE__ */ o(
|
|
18
|
+
n.Content,
|
|
18
19
|
{
|
|
19
|
-
ref:
|
|
20
|
+
ref: l,
|
|
20
21
|
side: "bottom",
|
|
21
22
|
sideOffset: 4,
|
|
22
23
|
align: "start",
|
|
23
24
|
avoidCollisions: !0,
|
|
24
25
|
collisionPadding: 8,
|
|
25
|
-
"aria-label":
|
|
26
|
+
"aria-label": p,
|
|
26
27
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
28
|
+
onPointerDownOutside: t,
|
|
29
|
+
onInteractOutside: t,
|
|
30
|
+
onFocusOutside: t,
|
|
27
31
|
onWheel: (e) => e.stopPropagation(),
|
|
28
32
|
style: {
|
|
29
|
-
width:
|
|
33
|
+
width: s ?? "var(--radix-popover-trigger-width)",
|
|
30
34
|
minWidth: "var(--radix-popover-trigger-width)",
|
|
31
35
|
maxHeight: "min(320px, var(--radix-popover-content-available-height, 320px))"
|
|
32
36
|
},
|
|
33
|
-
className:
|
|
37
|
+
className: a(
|
|
34
38
|
"z-50 flex flex-col overflow-hidden rounded-[12px] p-0 text-base shadow-elevation-select focus:outline-none sm:text-sm border-none pointer-events-auto",
|
|
35
39
|
r ? "bg-disabled-surface" : "bg-canvas-elevated",
|
|
36
|
-
|
|
40
|
+
f
|
|
37
41
|
),
|
|
38
42
|
"data-testid": `select-menu-${d || "default"}`,
|
|
39
43
|
"data-component": "select-menu",
|
|
40
44
|
children: /* @__PURE__ */ o(
|
|
41
45
|
"div",
|
|
42
46
|
{
|
|
43
|
-
className:
|
|
47
|
+
className: a(
|
|
44
48
|
"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px]",
|
|
45
49
|
r ? "bg-disabled-surface" : "bg-canvas-elevated"
|
|
46
50
|
),
|
|
47
51
|
style: {
|
|
48
|
-
minHeight:
|
|
52
|
+
minHeight: i ? `${i}px` : void 0
|
|
49
53
|
},
|
|
50
|
-
children:
|
|
54
|
+
children: m
|
|
51
55
|
}
|
|
52
56
|
)
|
|
53
57
|
}
|
|
54
58
|
) });
|
|
55
59
|
}
|
|
56
60
|
export {
|
|
57
|
-
|
|
61
|
+
O as SelectMenuPanel
|
|
58
62
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsxs as w, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { memo as Y } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
3
|
+
import { useSuppressOptionClickForTextSelection as J } from "../hooks/useSuppressOptionClickForTextSelection.js";
|
|
4
|
+
import { Checkmark as K, ChevronRight as L } from "impact-nova-icons";
|
|
5
|
+
import { Badge as Q } from "../../../data-display/badge/badge.js";
|
|
6
|
+
import { OverflowTooltip as U } from "../../../feedback/tooltip/overflow-tooltip.js";
|
|
7
|
+
import { cn as m } from "../../../../lib/utils.js";
|
|
8
|
+
import { selectOptionVariants as W } from "../select.variants.js";
|
|
9
|
+
import { isSelected as X } from "../utils/select.js";
|
|
10
|
+
import { Submenu as Z } from "./Submenu.js";
|
|
11
|
+
function _({
|
|
10
12
|
option: e,
|
|
11
|
-
virtualRow:
|
|
12
|
-
measureElement:
|
|
13
|
-
selectFieldId:
|
|
13
|
+
virtualRow: o,
|
|
14
|
+
measureElement: P,
|
|
15
|
+
selectFieldId: j,
|
|
14
16
|
id: v,
|
|
15
17
|
isMulti: f,
|
|
16
18
|
isReadOnly: u,
|
|
@@ -19,62 +21,64 @@ function T({
|
|
|
19
21
|
showSequence: I,
|
|
20
22
|
selected: r,
|
|
21
23
|
isOptDisabled: n,
|
|
22
|
-
indeterminate:
|
|
23
|
-
selectedCount:
|
|
24
|
-
isParentSelectable:
|
|
25
|
-
highlighted:
|
|
26
|
-
activeSubmenu:
|
|
24
|
+
indeterminate: p,
|
|
25
|
+
selectedCount: S,
|
|
26
|
+
isParentSelectable: N,
|
|
27
|
+
highlighted: O,
|
|
28
|
+
activeSubmenu: z,
|
|
27
29
|
setActiveSubmenu: y,
|
|
28
|
-
optionLabel:
|
|
29
|
-
optionLabelString:
|
|
30
|
-
sequence:
|
|
31
|
-
internalValue:
|
|
32
|
-
renderOption:
|
|
30
|
+
optionLabel: B,
|
|
31
|
+
optionLabelString: T,
|
|
32
|
+
sequence: s,
|
|
33
|
+
internalValue: V,
|
|
34
|
+
renderOption: $,
|
|
33
35
|
onSelect: b,
|
|
34
|
-
getGroupStats:
|
|
36
|
+
getGroupStats: C
|
|
35
37
|
}) {
|
|
36
|
-
const
|
|
38
|
+
const h = v || "default", x = String(e.value || ""), l = c && e.isGroup, k = a && e.isSubmenuParent, g = I && !l && !k, { onOptionPointerDown: E, onOptionDoubleClick: F, createOptionClickHandler: G } = J(), H = () => {
|
|
39
|
+
n || (c && e.isGroup || a && e.isSubmenuParent) && !N || b(e);
|
|
40
|
+
};
|
|
37
41
|
return /* @__PURE__ */ w(
|
|
38
42
|
"div",
|
|
39
43
|
{
|
|
40
|
-
"data-index":
|
|
41
|
-
ref:
|
|
44
|
+
"data-index": o.index,
|
|
45
|
+
ref: P,
|
|
42
46
|
className: "absolute start-0 w-full pb-[2px]",
|
|
43
47
|
style: {
|
|
44
|
-
transform: `translateY(${
|
|
48
|
+
transform: `translateY(${o.start}px)`,
|
|
45
49
|
width: "100%"
|
|
46
50
|
},
|
|
47
|
-
"data-testid": `select-option-wrapper-${
|
|
51
|
+
"data-testid": `select-option-wrapper-${h}-${x}`,
|
|
48
52
|
children: [
|
|
49
53
|
/* @__PURE__ */ t(
|
|
50
54
|
"div",
|
|
51
55
|
{
|
|
52
|
-
id: `${
|
|
53
|
-
className:
|
|
54
|
-
|
|
56
|
+
id: `${j}-option-${o.index}`,
|
|
57
|
+
className: m(
|
|
58
|
+
W({
|
|
55
59
|
disabled: n,
|
|
56
60
|
readOnly: u,
|
|
57
61
|
selected: r && !n && !(c && e.isGroup) && !(a && e.isSubmenuParent),
|
|
58
|
-
highlighted:
|
|
62
|
+
highlighted: O && !n
|
|
59
63
|
})
|
|
60
64
|
),
|
|
61
65
|
style: {
|
|
62
66
|
paddingInlineStart: `${e.depth * 16 + 12}px`
|
|
63
67
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
onPointerDown: E,
|
|
69
|
+
onDoubleClick: F,
|
|
70
|
+
onClick: G(H),
|
|
67
71
|
onMouseEnter: () => {
|
|
68
72
|
a && e.isSubmenuParent ? y(e.value) : y(null);
|
|
69
73
|
},
|
|
70
|
-
"data-testid": `select-option-${
|
|
74
|
+
"data-testid": `select-option-${h}-${x}`,
|
|
71
75
|
"data-state": r ? "checked" : "unchecked",
|
|
72
76
|
"data-disabled": n || void 0,
|
|
73
77
|
"data-component": "select-option",
|
|
74
78
|
role: "option",
|
|
75
79
|
"aria-selected": r,
|
|
76
80
|
"aria-disabled": n || void 0,
|
|
77
|
-
children:
|
|
81
|
+
children: $ ? $(
|
|
78
82
|
{
|
|
79
83
|
onClick: () => {
|
|
80
84
|
},
|
|
@@ -84,82 +88,89 @@ function T({
|
|
|
84
88
|
},
|
|
85
89
|
e
|
|
86
90
|
) : /* @__PURE__ */ w("div", { className: "flex items-center flex-1 overflow-hidden", children: [
|
|
87
|
-
f && (c && e.isGroup || a && e.isSubmenuParent ?
|
|
91
|
+
f && (c && e.isGroup || a && e.isSubmenuParent ? N : !0) && /* @__PURE__ */ t(
|
|
88
92
|
"span",
|
|
89
93
|
{
|
|
90
94
|
"aria-hidden": "true",
|
|
91
|
-
className:
|
|
95
|
+
className: m(
|
|
92
96
|
"mr-[7px] flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-stroke-field bg-canvas-elevated",
|
|
93
|
-
(r ||
|
|
97
|
+
(r || p) && "border-brand bg-accent text-brand",
|
|
94
98
|
(n || u) && "opacity-50"
|
|
95
99
|
),
|
|
96
|
-
children: r && !
|
|
100
|
+
children: r && !p ? /* @__PURE__ */ t(K, { className: "h-3.5 w-3.5" }) : p ? /* @__PURE__ */ t("span", { className: "block h-0.5 w-2.5 bg-current" }) : null
|
|
97
101
|
}
|
|
98
102
|
),
|
|
99
103
|
/* @__PURE__ */ w(
|
|
100
104
|
"div",
|
|
101
105
|
{
|
|
102
|
-
className:
|
|
106
|
+
className: m(
|
|
103
107
|
"flex min-w-0 flex-1 items-center overflow-hidden",
|
|
104
|
-
|
|
108
|
+
g ? "justify-between gap-2" : "gap-2"
|
|
105
109
|
),
|
|
106
110
|
children: [
|
|
107
111
|
/* @__PURE__ */ t(
|
|
108
|
-
|
|
112
|
+
U,
|
|
109
113
|
{
|
|
110
|
-
|
|
111
|
-
"block min-w-0 truncate",
|
|
112
|
-
|
|
113
|
-
l ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : r && !
|
|
114
|
+
triggerClassName: m(
|
|
115
|
+
"block min-w-0 truncate select-text",
|
|
116
|
+
g && "flex-1",
|
|
117
|
+
l ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : r && !k ? "font-medium" : "font-normal",
|
|
114
118
|
!l && "text-[14px]"
|
|
115
119
|
),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
children:
|
|
120
|
+
content: T,
|
|
121
|
+
side: "top",
|
|
122
|
+
variant: "tertiary",
|
|
123
|
+
children: /* @__PURE__ */ t(
|
|
124
|
+
"span",
|
|
125
|
+
{
|
|
126
|
+
"data-testid": `select-option-label-${h}-${x}`,
|
|
127
|
+
"data-state": r ? "checked" : "unchecked",
|
|
128
|
+
children: B
|
|
129
|
+
}
|
|
130
|
+
)
|
|
120
131
|
}
|
|
121
132
|
),
|
|
122
|
-
(l ||
|
|
123
|
-
|
|
124
|
-
|
|
133
|
+
(l || k) && S > 0 && /* @__PURE__ */ t("span", { className: "inline-flex shrink-0 items-center justify-center rounded-full bg-brand-tint px-1.5 py-0.5 text-xs font-medium text-brand-on-subtle", children: S }),
|
|
134
|
+
g && /* @__PURE__ */ t("span", { className: "flex h-5 w-6 shrink-0 items-center justify-center", children: s !== void 0 && s > 0 ? /* @__PURE__ */ t(
|
|
135
|
+
Q,
|
|
125
136
|
{
|
|
126
137
|
variant: "outline",
|
|
127
138
|
color: "primary",
|
|
128
139
|
size: "sm",
|
|
129
|
-
"data-testid": `select-option-sequence-${
|
|
130
|
-
children:
|
|
140
|
+
"data-testid": `select-option-sequence-${s}`,
|
|
141
|
+
children: s.toString()
|
|
131
142
|
}
|
|
132
143
|
) : null })
|
|
133
144
|
]
|
|
134
145
|
}
|
|
135
146
|
),
|
|
136
|
-
a && e.isSubmenuParent && /* @__PURE__ */ t(
|
|
147
|
+
a && e.isSubmenuParent && /* @__PURE__ */ t(L, { size: "12px", className: "text-content-icon" })
|
|
137
148
|
] })
|
|
138
149
|
}
|
|
139
150
|
),
|
|
140
|
-
a &&
|
|
141
|
-
|
|
151
|
+
a && z === e.value && e.isSubmenuParent && /* @__PURE__ */ t(
|
|
152
|
+
Z,
|
|
142
153
|
{
|
|
143
154
|
parentOption: e,
|
|
144
155
|
isMulti: !!f,
|
|
145
156
|
isReadOnly: !!u,
|
|
146
|
-
isSelected: (i) =>
|
|
157
|
+
isSelected: (i) => X(i, V, !!f),
|
|
147
158
|
getIndeterminateState: (i) => {
|
|
148
|
-
const
|
|
149
|
-
return
|
|
159
|
+
const d = C(i);
|
|
160
|
+
return d ? d.selected > 0 && d.selected < d.total : !1;
|
|
150
161
|
},
|
|
151
|
-
getSelectedCount: (i) =>
|
|
162
|
+
getSelectedCount: (i) => C(i)?.selected || 0,
|
|
152
163
|
handleSelect: b,
|
|
153
164
|
id: v
|
|
154
165
|
}
|
|
155
166
|
)
|
|
156
167
|
]
|
|
157
168
|
},
|
|
158
|
-
|
|
169
|
+
o.key
|
|
159
170
|
);
|
|
160
171
|
}
|
|
161
|
-
const
|
|
172
|
+
const ie = Y(_);
|
|
162
173
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
ie as SelectOptionRow,
|
|
175
|
+
_ as SelectOptionRowInner
|
|
165
176
|
};
|