impact-nova 2.2.6 → 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/cell-renderers/link-with-batch-cell-renderer.js +96 -120
- package/dist/components/data/data-table/data-table-saved-views.js +70 -79
- package/dist/components/data-display/badge/badge.variants.d.ts +2 -2
- 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 +2 -0
- package/dist/components/feedback/tooltip/index.js +11 -9
- package/dist/components/feedback/tooltip/overflow-tooltip.js +73 -50
- package/dist/components/feedback/tooltip/overflow-tooltip.types.d.ts +5 -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.js +89 -35
- package/dist/components/flows/filter-panel/filter-panel.js +33 -29
- package/dist/components/flows/filter-strip/filter-summary.js +126 -137
- package/dist/components/flows/filter-strip/filter-tag-list.js +18 -18
- 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 +67 -64
- package/dist/components/forms/select/components/Submenu.js +40 -35
- 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/primitives/tag/tag.variants.d.ts +1 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +153 -151
- 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/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/providers/app-providers.js +18 -11
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { cn as O } from "../../../lib/utils.js";
|
|
|
4
4
|
import { HorizontalScroller as $ } from "../../layout/horizontal-scroller/horizontal-scroller.js";
|
|
5
5
|
import { TagGroup as A } from "../../primitives/tag-group/tag-group.js";
|
|
6
6
|
import { Tag as C } from "../../primitives/tag/tag.js";
|
|
7
|
-
import { Tooltip as
|
|
7
|
+
import { Tooltip as T, TooltipTrigger as k, TooltipContent as z } from "../../feedback/tooltip/tooltip.js";
|
|
8
8
|
import { OverflowTooltip as P } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
9
9
|
import { PopoverContent as j, Popover as R, PopoverTrigger as B } from "../../feedback/popover/popover.js";
|
|
10
10
|
import { Button as F } from "../../primitives/button/button.js";
|
|
@@ -12,7 +12,7 @@ import { Checkmark as I, Copy as L, Cross as V } from "impact-nova-icons";
|
|
|
12
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
13
|
remainingValues: a,
|
|
14
14
|
viewAllTrigger: c = "expand",
|
|
15
|
-
onViewAll:
|
|
15
|
+
onViewAll: u,
|
|
16
16
|
onItemRemove: v,
|
|
17
17
|
isRemovable: f,
|
|
18
18
|
isCopyable: e = !1,
|
|
@@ -20,8 +20,8 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
20
20
|
}) => {
|
|
21
21
|
const [s, g] = N.useState(!1), [n, d] = N.useState(null), x = (t, l, i) => {
|
|
22
22
|
navigator.clipboard.writeText(String(l)), d(i), t.currentTarget.blur(), setTimeout(() => d(null), 1500);
|
|
23
|
-
},
|
|
24
|
-
c === "custom" ?
|
|
23
|
+
}, w = s ? a : a.slice(0, 3), b = a.length > 3, h = () => {
|
|
24
|
+
c === "custom" ? u?.() : g(!0);
|
|
25
25
|
};
|
|
26
26
|
return /* @__PURE__ */ o(
|
|
27
27
|
j,
|
|
@@ -35,18 +35,18 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
className: `flex flex-col gap-1 mb-2 ${s ? "max-h-[180px] overflow-y-auto" : ""}`,
|
|
38
|
-
children:
|
|
38
|
+
children: w.map((t, l) => {
|
|
39
39
|
const i = String(t), y = !!(e || f);
|
|
40
40
|
return /* @__PURE__ */ r(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
|
-
className: "group relative
|
|
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
44
|
children: [
|
|
45
45
|
/* @__PURE__ */ o(
|
|
46
46
|
P,
|
|
47
47
|
{
|
|
48
48
|
triggerClassName: O(
|
|
49
|
-
"block min-w-0
|
|
49
|
+
"block min-w-0 flex-1 self-stretch truncate overflow-hidden",
|
|
50
50
|
y && "pe-0 group-hover:pe-10"
|
|
51
51
|
),
|
|
52
52
|
content: i,
|
|
@@ -88,7 +88,7 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
88
88
|
})
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
!s &&
|
|
91
|
+
!s && b && /* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
|
|
92
92
|
/* @__PURE__ */ o("div", { className: "h-px bg-stroke-hairline w-full" }),
|
|
93
93
|
/* @__PURE__ */ o(
|
|
94
94
|
F,
|
|
@@ -96,7 +96,7 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
96
96
|
variant: "secondary",
|
|
97
97
|
size: "md",
|
|
98
98
|
className: "w-full justify-center",
|
|
99
|
-
onClick:
|
|
99
|
+
onClick: h,
|
|
100
100
|
children: c === "custom" ? "View all" : `View all (${a.length})`
|
|
101
101
|
}
|
|
102
102
|
)
|
|
@@ -107,14 +107,14 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
107
107
|
}, X = ({
|
|
108
108
|
filters: a,
|
|
109
109
|
onFilterRemove: c,
|
|
110
|
-
onOverflowClick:
|
|
110
|
+
onOverflowClick: u,
|
|
111
111
|
onViewAll: v
|
|
112
112
|
}) => /* @__PURE__ */ o("div", { className: "flex flex-1 items-center min-w-0", children: /* @__PURE__ */ o(
|
|
113
113
|
$,
|
|
114
114
|
{
|
|
115
115
|
items: a,
|
|
116
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,
|
|
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}`;
|
|
118
118
|
return /* @__PURE__ */ r("div", { className: "flex items-center px-1", children: [
|
|
119
119
|
m > 0 && /* @__PURE__ */ o("div", { className: "mx-3 h-4 w-px bg-stroke-hairline shrink-0" }),
|
|
120
120
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
@@ -137,8 +137,8 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
137
137
|
}))
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
|
|
141
|
-
/* @__PURE__ */ o(
|
|
140
|
+
b && (d ? /* @__PURE__ */ r(T, { children: [
|
|
141
|
+
/* @__PURE__ */ o(k, { asChild: !0, children: /* @__PURE__ */ o(
|
|
142
142
|
C,
|
|
143
143
|
{
|
|
144
144
|
asButton: !0,
|
|
@@ -147,8 +147,8 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
147
147
|
shape: "rounded",
|
|
148
148
|
className: S,
|
|
149
149
|
"aria-label": `${e.overflow?.count || n.length} more filters for ${e.label}`,
|
|
150
|
-
onClick: () =>
|
|
151
|
-
children: x ||
|
|
150
|
+
onClick: () => u?.(e.id),
|
|
151
|
+
children: x || h
|
|
152
152
|
}
|
|
153
153
|
) }),
|
|
154
154
|
/* @__PURE__ */ r(z, { variant: "tertiary", side: "top", children: [
|
|
@@ -156,8 +156,8 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
156
156
|
" more filters"
|
|
157
157
|
] })
|
|
158
158
|
] }) : /* @__PURE__ */ r(R, { children: [
|
|
159
|
-
/* @__PURE__ */ r(
|
|
160
|
-
/* @__PURE__ */ o(
|
|
159
|
+
/* @__PURE__ */ r(T, { children: [
|
|
160
|
+
/* @__PURE__ */ o(k, { asChild: !0, children: /* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o(
|
|
161
161
|
C,
|
|
162
162
|
{
|
|
163
163
|
asButton: !0,
|
|
@@ -165,7 +165,7 @@ const S = "whitespace-nowrap bg-accent text-brand hover:bg-accent/80 border-0 px
|
|
|
165
165
|
size: "md",
|
|
166
166
|
shape: "rounded",
|
|
167
167
|
className: S,
|
|
168
|
-
children:
|
|
168
|
+
children: h
|
|
169
169
|
}
|
|
170
170
|
) }) }),
|
|
171
171
|
/* @__PURE__ */ r(z, { variant: "tertiary", side: "top", children: [
|
|
@@ -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,17 +1,18 @@
|
|
|
1
1
|
import { jsxs as w, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { memo as Y } from "react";
|
|
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";
|
|
6
7
|
import { cn as m } from "../../../../lib/utils.js";
|
|
7
|
-
import { selectOptionVariants as
|
|
8
|
-
import { isSelected as
|
|
9
|
-
import { Submenu as
|
|
10
|
-
function
|
|
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 _({
|
|
11
12
|
option: e,
|
|
12
|
-
virtualRow:
|
|
13
|
-
measureElement:
|
|
14
|
-
selectFieldId:
|
|
13
|
+
virtualRow: o,
|
|
14
|
+
measureElement: P,
|
|
15
|
+
selectFieldId: j,
|
|
15
16
|
id: v,
|
|
16
17
|
isMulti: f,
|
|
17
18
|
isReadOnly: u,
|
|
@@ -20,62 +21,64 @@ function U({
|
|
|
20
21
|
showSequence: I,
|
|
21
22
|
selected: r,
|
|
22
23
|
isOptDisabled: n,
|
|
23
|
-
indeterminate:
|
|
24
|
-
selectedCount:
|
|
25
|
-
isParentSelectable:
|
|
26
|
-
highlighted:
|
|
27
|
-
activeSubmenu:
|
|
28
|
-
setActiveSubmenu:
|
|
29
|
-
optionLabel:
|
|
30
|
-
optionLabelString:
|
|
31
|
-
sequence:
|
|
32
|
-
internalValue:
|
|
33
|
-
renderOption:
|
|
24
|
+
indeterminate: p,
|
|
25
|
+
selectedCount: S,
|
|
26
|
+
isParentSelectable: N,
|
|
27
|
+
highlighted: O,
|
|
28
|
+
activeSubmenu: z,
|
|
29
|
+
setActiveSubmenu: y,
|
|
30
|
+
optionLabel: B,
|
|
31
|
+
optionLabelString: T,
|
|
32
|
+
sequence: s,
|
|
33
|
+
internalValue: V,
|
|
34
|
+
renderOption: $,
|
|
34
35
|
onSelect: b,
|
|
35
|
-
getGroupStats:
|
|
36
|
+
getGroupStats: C
|
|
36
37
|
}) {
|
|
37
|
-
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
|
+
};
|
|
38
41
|
return /* @__PURE__ */ w(
|
|
39
42
|
"div",
|
|
40
43
|
{
|
|
41
|
-
"data-index":
|
|
42
|
-
ref:
|
|
44
|
+
"data-index": o.index,
|
|
45
|
+
ref: P,
|
|
43
46
|
className: "absolute start-0 w-full pb-[2px]",
|
|
44
47
|
style: {
|
|
45
|
-
transform: `translateY(${
|
|
48
|
+
transform: `translateY(${o.start}px)`,
|
|
46
49
|
width: "100%"
|
|
47
50
|
},
|
|
48
|
-
"data-testid": `select-option-wrapper-${
|
|
51
|
+
"data-testid": `select-option-wrapper-${h}-${x}`,
|
|
49
52
|
children: [
|
|
50
53
|
/* @__PURE__ */ t(
|
|
51
54
|
"div",
|
|
52
55
|
{
|
|
53
|
-
id: `${
|
|
56
|
+
id: `${j}-option-${o.index}`,
|
|
54
57
|
className: m(
|
|
55
|
-
|
|
58
|
+
W({
|
|
56
59
|
disabled: n,
|
|
57
60
|
readOnly: u,
|
|
58
61
|
selected: r && !n && !(c && e.isGroup) && !(a && e.isSubmenuParent),
|
|
59
|
-
highlighted:
|
|
62
|
+
highlighted: O && !n
|
|
60
63
|
})
|
|
61
64
|
),
|
|
62
65
|
style: {
|
|
63
66
|
paddingInlineStart: `${e.depth * 16 + 12}px`
|
|
64
67
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
onPointerDown: E,
|
|
69
|
+
onDoubleClick: F,
|
|
70
|
+
onClick: G(H),
|
|
68
71
|
onMouseEnter: () => {
|
|
69
|
-
a && e.isSubmenuParent ?
|
|
72
|
+
a && e.isSubmenuParent ? y(e.value) : y(null);
|
|
70
73
|
},
|
|
71
|
-
"data-testid": `select-option-${
|
|
74
|
+
"data-testid": `select-option-${h}-${x}`,
|
|
72
75
|
"data-state": r ? "checked" : "unchecked",
|
|
73
76
|
"data-disabled": n || void 0,
|
|
74
77
|
"data-component": "select-option",
|
|
75
78
|
role: "option",
|
|
76
79
|
"aria-selected": r,
|
|
77
80
|
"aria-disabled": n || void 0,
|
|
78
|
-
children:
|
|
81
|
+
children: $ ? $(
|
|
79
82
|
{
|
|
80
83
|
onClick: () => {
|
|
81
84
|
},
|
|
@@ -85,16 +88,16 @@ function U({
|
|
|
85
88
|
},
|
|
86
89
|
e
|
|
87
90
|
) : /* @__PURE__ */ w("div", { className: "flex items-center flex-1 overflow-hidden", children: [
|
|
88
|
-
f && (c && e.isGroup || a && e.isSubmenuParent ?
|
|
91
|
+
f && (c && e.isGroup || a && e.isSubmenuParent ? N : !0) && /* @__PURE__ */ t(
|
|
89
92
|
"span",
|
|
90
93
|
{
|
|
91
94
|
"aria-hidden": "true",
|
|
92
95
|
className: m(
|
|
93
96
|
"mr-[7px] flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-stroke-field bg-canvas-elevated",
|
|
94
|
-
(r ||
|
|
97
|
+
(r || p) && "border-brand bg-accent text-brand",
|
|
95
98
|
(n || u) && "opacity-50"
|
|
96
99
|
),
|
|
97
|
-
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
|
|
98
101
|
}
|
|
99
102
|
),
|
|
100
103
|
/* @__PURE__ */ w(
|
|
@@ -102,72 +105,72 @@ function U({
|
|
|
102
105
|
{
|
|
103
106
|
className: m(
|
|
104
107
|
"flex min-w-0 flex-1 items-center overflow-hidden",
|
|
105
|
-
|
|
108
|
+
g ? "justify-between gap-2" : "gap-2"
|
|
106
109
|
),
|
|
107
110
|
children: [
|
|
108
111
|
/* @__PURE__ */ t(
|
|
109
|
-
|
|
112
|
+
U,
|
|
110
113
|
{
|
|
111
114
|
triggerClassName: m(
|
|
112
|
-
"block min-w-0 truncate",
|
|
113
|
-
|
|
114
|
-
l ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : r && !
|
|
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",
|
|
115
118
|
!l && "text-[14px]"
|
|
116
119
|
),
|
|
117
|
-
content:
|
|
120
|
+
content: T,
|
|
118
121
|
side: "top",
|
|
119
122
|
variant: "tertiary",
|
|
120
123
|
children: /* @__PURE__ */ t(
|
|
121
124
|
"span",
|
|
122
125
|
{
|
|
123
|
-
"data-testid": `select-option-label-${
|
|
126
|
+
"data-testid": `select-option-label-${h}-${x}`,
|
|
124
127
|
"data-state": r ? "checked" : "unchecked",
|
|
125
|
-
children:
|
|
128
|
+
children: B
|
|
126
129
|
}
|
|
127
130
|
)
|
|
128
131
|
}
|
|
129
132
|
),
|
|
130
|
-
(l ||
|
|
131
|
-
|
|
132
|
-
|
|
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,
|
|
133
136
|
{
|
|
134
137
|
variant: "outline",
|
|
135
138
|
color: "primary",
|
|
136
139
|
size: "sm",
|
|
137
|
-
"data-testid": `select-option-sequence-${
|
|
138
|
-
children:
|
|
140
|
+
"data-testid": `select-option-sequence-${s}`,
|
|
141
|
+
children: s.toString()
|
|
139
142
|
}
|
|
140
143
|
) : null })
|
|
141
144
|
]
|
|
142
145
|
}
|
|
143
146
|
),
|
|
144
|
-
a && e.isSubmenuParent && /* @__PURE__ */ t(
|
|
147
|
+
a && e.isSubmenuParent && /* @__PURE__ */ t(L, { size: "12px", className: "text-content-icon" })
|
|
145
148
|
] })
|
|
146
149
|
}
|
|
147
150
|
),
|
|
148
|
-
a &&
|
|
149
|
-
|
|
151
|
+
a && z === e.value && e.isSubmenuParent && /* @__PURE__ */ t(
|
|
152
|
+
Z,
|
|
150
153
|
{
|
|
151
154
|
parentOption: e,
|
|
152
155
|
isMulti: !!f,
|
|
153
156
|
isReadOnly: !!u,
|
|
154
|
-
isSelected: (i) =>
|
|
157
|
+
isSelected: (i) => X(i, V, !!f),
|
|
155
158
|
getIndeterminateState: (i) => {
|
|
156
|
-
const
|
|
157
|
-
return
|
|
159
|
+
const d = C(i);
|
|
160
|
+
return d ? d.selected > 0 && d.selected < d.total : !1;
|
|
158
161
|
},
|
|
159
|
-
getSelectedCount: (i) =>
|
|
162
|
+
getSelectedCount: (i) => C(i)?.selected || 0,
|
|
160
163
|
handleSelect: b,
|
|
161
164
|
id: v
|
|
162
165
|
}
|
|
163
166
|
)
|
|
164
167
|
]
|
|
165
168
|
},
|
|
166
|
-
|
|
169
|
+
o.key
|
|
167
170
|
);
|
|
168
171
|
}
|
|
169
|
-
const
|
|
172
|
+
const ie = Y(_);
|
|
170
173
|
export {
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
ie as SelectOptionRow,
|
|
175
|
+
_ as SelectOptionRowInner
|
|
173
176
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "@radix-ui/react-popover";
|
|
3
|
-
import { Checkbox as
|
|
3
|
+
import { Checkbox as P } from "../../checkbox/checkbox.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { OverflowTooltip as y } from "../../../feedback/tooltip/overflow-tooltip.js";
|
|
6
|
-
import { ChevronRight as A, Checkmark as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { useOverlayPortalContainer as
|
|
9
|
-
import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as
|
|
10
|
-
|
|
6
|
+
import { ChevronRight as A, Checkmark as O } from "impact-nova-icons";
|
|
7
|
+
import { cn as v } from "../../../../lib/utils.js";
|
|
8
|
+
import { useOverlayPortalContainer as T } from "../../../../lib/overlay/overlay-portal-context.js";
|
|
9
|
+
import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as _ } from "../../../../lib/overlay/overlay-host.constants.js";
|
|
10
|
+
import { useSuppressOptionClickForTextSelection as E } from "../hooks/useSuppressOptionClickForTextSelection.js";
|
|
11
|
+
const R = ({
|
|
11
12
|
parentOption: n,
|
|
12
|
-
isMulti:
|
|
13
|
+
isMulti: u,
|
|
13
14
|
isReadOnly: l,
|
|
14
|
-
isSelected:
|
|
15
|
-
getIndeterminateState:
|
|
16
|
-
getSelectedCount:
|
|
17
|
-
handleSelect:
|
|
15
|
+
isSelected: x,
|
|
16
|
+
getIndeterminateState: g,
|
|
17
|
+
getSelectedCount: h,
|
|
18
|
+
handleSelect: C
|
|
18
19
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
20
|
+
const k = T(), { onOptionPointerDown: S, onOptionDoubleClick: N, createOptionClickHandler: w } = E(), d = "children" in n && Array.isArray(n.children) ? n.children : null;
|
|
21
|
+
if (!d) return null;
|
|
21
22
|
const c = String(n.value || "");
|
|
22
23
|
return /* @__PURE__ */ s(i.Root, { open: !0, children: [
|
|
23
24
|
/* @__PURE__ */ t(i.Anchor, { className: "absolute inset-0 pointer-events-none" }),
|
|
24
|
-
/* @__PURE__ */ t(i.Portal, { container:
|
|
25
|
+
/* @__PURE__ */ t(i.Portal, { container: k, children: /* @__PURE__ */ t(
|
|
25
26
|
i.Content,
|
|
26
27
|
{
|
|
27
28
|
side: "right",
|
|
@@ -33,35 +34,39 @@ const L = ({
|
|
|
33
34
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
34
35
|
onInteractOutside: (e) => e.preventDefault(),
|
|
35
36
|
onFocusOutside: (e) => e.preventDefault(),
|
|
36
|
-
className:
|
|
37
|
+
className: v(
|
|
37
38
|
"select-submenu-container z-50 min-w-[180px] max-h-[300px] overflow-auto rounded-xl bg-canvas-elevated py-1 shadow-elevation-floating",
|
|
38
|
-
|
|
39
|
+
_
|
|
39
40
|
),
|
|
40
41
|
"data-component": "select-menu",
|
|
41
|
-
children:
|
|
42
|
-
const
|
|
42
|
+
children: d.map((e) => {
|
|
43
|
+
const o = x(e), D = g(e), r = e.isDisabled, m = h(e), a = "children" in e && Array.isArray(e.children) && e.children.length > 0, p = e.isParentSelectable !== !1, b = String(e.value || "");
|
|
43
44
|
return /* @__PURE__ */ s(
|
|
44
45
|
"div",
|
|
45
46
|
{
|
|
46
|
-
className:
|
|
47
|
+
className: v(
|
|
47
48
|
"relative flex h-[35px] cursor-default select-none items-center justify-between gap-1.5 rounded-[8px] px-3",
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
r ? "cursor-not-allowed bg-canvas-readonly opacity-50" : l ? "cursor-default" : "cursor-pointer hover:bg-canvas-muted",
|
|
50
|
+
o && !r && !a ? "bg-brand-subtle text-content" : "text-content"
|
|
50
51
|
),
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
onPointerDown: S,
|
|
53
|
+
onDoubleClick: N,
|
|
54
|
+
onClick: (f) => {
|
|
55
|
+
f.stopPropagation(), w(() => {
|
|
56
|
+
!r && !l && p && C(e);
|
|
57
|
+
})(f);
|
|
53
58
|
},
|
|
54
59
|
"data-testid": `select-submenu-option-${c}-${b}`,
|
|
55
|
-
"data-state":
|
|
56
|
-
"data-disabled":
|
|
60
|
+
"data-state": o ? "checked" : "unchecked",
|
|
61
|
+
"data-disabled": r || void 0,
|
|
57
62
|
"data-component": "select-option",
|
|
58
63
|
children: [
|
|
59
64
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", children: [
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
u && p && /* @__PURE__ */ t(
|
|
66
|
+
P,
|
|
62
67
|
{
|
|
63
|
-
checked:
|
|
64
|
-
disabled:
|
|
68
|
+
checked: D ? "indeterminate" : o,
|
|
69
|
+
disabled: r || l,
|
|
65
70
|
onChange: () => {
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -69,7 +74,7 @@ const L = ({
|
|
|
69
74
|
/* @__PURE__ */ t(
|
|
70
75
|
y,
|
|
71
76
|
{
|
|
72
|
-
triggerClassName: "block truncate text-[14px] font-medium leading-5 min-w-0",
|
|
77
|
+
triggerClassName: "block truncate select-text text-[14px] font-medium leading-5 min-w-0",
|
|
73
78
|
content: String(e.label || ""),
|
|
74
79
|
side: "top",
|
|
75
80
|
variant: "tertiary",
|
|
@@ -77,20 +82,20 @@ const L = ({
|
|
|
77
82
|
"span",
|
|
78
83
|
{
|
|
79
84
|
"data-testid": `select-submenu-option-label-${c}-${b}`,
|
|
80
|
-
"data-state":
|
|
85
|
+
"data-state": o ? "checked" : "unchecked",
|
|
81
86
|
children: e.label
|
|
82
87
|
}
|
|
83
88
|
)
|
|
84
89
|
}
|
|
85
90
|
),
|
|
86
|
-
|
|
91
|
+
a && m > 0 && /* @__PURE__ */ s("span", { className: "text-xs text-secondary-foreground font-medium", children: [
|
|
87
92
|
"(",
|
|
88
93
|
m,
|
|
89
94
|
")"
|
|
90
95
|
] })
|
|
91
96
|
] }),
|
|
92
|
-
|
|
93
|
-
!
|
|
97
|
+
a && /* @__PURE__ */ t(A, { size: "sm", className: "text-content-icon" }),
|
|
98
|
+
!u && o && !a && /* @__PURE__ */ t(O, { className: "h-4 w-4 text-brand" })
|
|
94
99
|
]
|
|
95
100
|
},
|
|
96
101
|
e.value
|
|
@@ -101,5 +106,5 @@ const L = ({
|
|
|
101
106
|
] });
|
|
102
107
|
};
|
|
103
108
|
export {
|
|
104
|
-
|
|
109
|
+
R as Submenu
|
|
105
110
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useSuppressOptionClickForTextSelection(): {
|
|
2
|
+
onOptionPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
|
|
3
|
+
onOptionDoubleClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
4
|
+
createOptionClickHandler: (onOptionClick: () => void) => (event: React.MouseEvent<HTMLElement>) => void;
|
|
5
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useRef as u, useCallback as t } from "react";
|
|
2
|
+
import { shouldSuppressOptionClickForTextSelection as p } from "../utils/shouldSuppressOptionClickForTextSelection.js";
|
|
3
|
+
function a() {
|
|
4
|
+
const n = u(null), i = t(
|
|
5
|
+
(o) => {
|
|
6
|
+
o.button === 0 && (n.current = {
|
|
7
|
+
clientX: o.clientX,
|
|
8
|
+
clientY: o.clientY
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
[]
|
|
12
|
+
), e = t(
|
|
13
|
+
(o) => {
|
|
14
|
+
o.stopPropagation();
|
|
15
|
+
},
|
|
16
|
+
[]
|
|
17
|
+
), r = t(
|
|
18
|
+
(o) => (c) => {
|
|
19
|
+
const l = n.current;
|
|
20
|
+
n.current = null, !p(l, c) && o();
|
|
21
|
+
},
|
|
22
|
+
[]
|
|
23
|
+
);
|
|
24
|
+
return { onOptionPointerDown: i, onOptionDoubleClick: e, createOptionClickHandler: r };
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
a as useSuppressOptionClickForTextSelection
|
|
28
|
+
};
|