impact-nova 2.1.0-alpha.7 → 2.1.0-alpha.9
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.types.d.ts +6 -0
- package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +78 -73
- package/dist/components/data/ag-grid-react/headers/custom-header.js +3 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +109 -100
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -2
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +4 -3
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
- package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
- package/dist/components/data/ag-grid-react/theme.js +93 -21
- package/dist/components/data/data-table/column-indicator.d.ts +1 -1
- package/dist/components/data/data-table/column-indicator.js +15 -11
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +9 -4
- package/dist/components/data/data-table/data-table-column-def-pin.js +38 -38
- package/dist/components/data/data-table/data-table-saved-views.js +37 -37
- package/dist/components/data/data-table/data-table.js +78 -73
- package/dist/components/data/data-table/data-table.types.d.ts +7 -1
- package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
- package/dist/components/data/data-table/indicator-legend.js +20 -17
- package/dist/components/data/data-table/pin-switch.js +9 -9
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +92 -89
- package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
- package/dist/components/data/nested-list/nested-list.js +107 -97
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +194 -189
- package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
- package/dist/components/data-display/chart/chart-palette.js +28 -0
- package/dist/components/data-display/chart/chart.js +121 -115
- package/dist/components/data-display/chart/chart.utils.js +9 -6
- package/dist/components/data-display/chart/index.d.ts +1 -0
- package/dist/components/data-display/chart/index.js +15 -9
- package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
- package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
- package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
- package/dist/components/data-display/statistics-card/statistics-card.js +127 -146
- package/dist/components/feedback/alert-dialog/alert-dialog.js +15 -15
- package/dist/components/feedback/dialog/dialog.js +3 -3
- package/dist/components/feedback/drawer/drawer.js +32 -32
- package/dist/components/feedback/sheet/sheet.js +8 -8
- package/dist/components/feedback/sheet/sheet.variants.js +1 -1
- package/dist/components/feedback/toast/toast.js +83 -92
- package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
- package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
- package/dist/components/flows/command-palette/command-palette.js +245 -258
- package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
- package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
- package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +99 -104
- package/dist/components/flows/filter-strip/filter-summary.js +41 -41
- package/dist/components/flows/filter-strip/filter-tag-list.js +48 -48
- package/dist/components/flows/wizard/wizard.js +32 -32
- package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
- package/dist/components/forms/choice-card/choice-card.js +156 -166
- package/dist/components/forms/combobox/combobox.js +70 -70
- package/dist/components/forms/date-picker/date-picker.js +31 -30
- package/dist/components/forms/file-upload/file-upload.js +146 -168
- package/dist/components/forms/prompt/prompt.js +47 -48
- package/dist/components/forms/select/components/SelectAllRow.js +14 -14
- package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
- package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
- package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
- package/dist/components/forms/select/components/SelectMenuPanel.js +8 -8
- package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
- package/dist/components/forms/select/select.d.ts +5 -4
- package/dist/components/forms/select/select.js +123 -120
- package/dist/components/forms/select/select.types.d.ts +95 -204
- package/dist/components/forms/slider/slider.js +17 -17
- package/dist/components/forms/smart-input/smart-input.js +49 -49
- package/dist/components/forms/textarea/textarea.js +25 -25
- package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
- package/dist/components/layout/header/header.d.ts +5 -17
- package/dist/components/layout/header/header.js +113 -116
- package/dist/components/layout/header/header.types.d.ts +3 -0
- package/dist/components/layout/sidebar/sidebar.js +5 -5
- package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
- package/dist/components/primitives/accordion/accordion.js +38 -41
- package/dist/components/primitives/kbd/kbd.variants.js +1 -1
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +6 -4
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova-base.scss +8 -5
- package/dist/impact-nova-components.css +2 -2
- package/dist/impact-nova-tokens.scss +346 -189
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +505 -499
- package/dist/lib/resolve-design-token-color.d.ts +5 -0
- package/dist/lib/resolve-design-token-color.js +12 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/tailwind.config.js +297 -0
- package/dist/theme/tailwind-colors.js +199 -0
- package/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
- package/dist/theme/tokens/chart-series-palette.json.js +7 -0
- package/package.json +32 -259
- package/tailwind.config.js +0 -335
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as e, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import { Checkmark as k } from "impact-nova-icons";
|
|
3
3
|
import { cn as m } from "../../../../lib/utils.js";
|
|
4
|
-
import { SELECT_ALL_INDEX as
|
|
4
|
+
import { SELECT_ALL_INDEX as v } from "../select.constants.js";
|
|
5
5
|
function j({
|
|
6
6
|
selectFieldId: b,
|
|
7
7
|
id: t,
|
|
8
8
|
highlightedIndex: p,
|
|
9
|
-
isDisabled:
|
|
10
|
-
isReadOnly:
|
|
11
|
-
maxSelectableOptions:
|
|
9
|
+
isDisabled: u,
|
|
10
|
+
isReadOnly: f,
|
|
11
|
+
maxSelectableOptions: i,
|
|
12
12
|
visibleStats: h,
|
|
13
13
|
selectAllLabel: o,
|
|
14
14
|
unselectAllLabel: d,
|
|
15
15
|
onSelectAll: x
|
|
16
16
|
}) {
|
|
17
|
-
const { totalVisible: a, selectedVisible: r } = h,
|
|
17
|
+
const { totalVisible: a, selectedVisible: r } = h, n = i ? Math.min(a, i) : a, s = a === 0 ? !1 : r > 0 && r < n ? "indeterminate" : r >= n, l = a > 0 && r >= n, c = u || f;
|
|
18
18
|
return /* @__PURE__ */ e(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
@@ -26,16 +26,16 @@ function j({
|
|
|
26
26
|
type: "button",
|
|
27
27
|
id: `${b}-option-select-all`,
|
|
28
28
|
className: m(
|
|
29
|
-
"flex items-center justify-between cursor-pointer rounded-md hover:bg-
|
|
30
|
-
p ===
|
|
31
|
-
|
|
29
|
+
"flex items-center justify-between cursor-pointer rounded-md hover:bg-canvas-muted transition-colors py-[6px] px-3 w-full border-0 bg-transparent text-start",
|
|
30
|
+
p === v && "ring-2 ring-inset ring-primary bg-accent",
|
|
31
|
+
c && "cursor-not-allowed opacity-75"
|
|
32
32
|
),
|
|
33
33
|
onClick: () => {
|
|
34
34
|
x();
|
|
35
35
|
},
|
|
36
|
-
disabled:
|
|
37
|
-
"aria-pressed":
|
|
38
|
-
"aria-label":
|
|
36
|
+
disabled: c,
|
|
37
|
+
"aria-pressed": l,
|
|
38
|
+
"aria-label": l ? d : o,
|
|
39
39
|
"data-testid": `select-select-all-button-${t || "default"}`,
|
|
40
40
|
children: /* @__PURE__ */ g("span", { className: "flex items-center flex-1", children: [
|
|
41
41
|
/* @__PURE__ */ e(
|
|
@@ -46,7 +46,7 @@ function j({
|
|
|
46
46
|
className: m(
|
|
47
47
|
"mr-[7px] flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-stroke-field bg-canvas-elevated",
|
|
48
48
|
(s === !0 || s === "indeterminate") && "border-brand bg-accent text-brand",
|
|
49
|
-
|
|
49
|
+
c && "opacity-50"
|
|
50
50
|
),
|
|
51
51
|
children: s === !0 ? /* @__PURE__ */ e(k, { className: "h-3.5 w-3.5" }) : s === "indeterminate" ? /* @__PURE__ */ e("span", { className: "block h-0.5 w-2.5 bg-current" }) : null
|
|
52
52
|
}
|
|
@@ -54,9 +54,9 @@ function j({
|
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
55
|
"span",
|
|
56
56
|
{
|
|
57
|
-
className: "text-sm font-medium text-
|
|
57
|
+
className: "text-sm font-medium text-content",
|
|
58
58
|
"data-testid": `select-select-all-label-${t || "default"}`,
|
|
59
|
-
children:
|
|
59
|
+
children: l ? d : o
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
] })
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { Info as
|
|
3
|
-
function
|
|
4
|
-
footerContent:
|
|
5
|
-
maxSelectableOptions:
|
|
6
|
-
optionCount:
|
|
2
|
+
import { Info as a } from "impact-nova-icons";
|
|
3
|
+
function o({
|
|
4
|
+
footerContent: r,
|
|
5
|
+
maxSelectableOptions: t,
|
|
6
|
+
optionCount: n
|
|
7
7
|
}) {
|
|
8
|
-
return !
|
|
9
|
-
/* @__PURE__ */ e(
|
|
8
|
+
return !r && !t && n <= 5e3 ? null : /* @__PURE__ */ e("div", { className: "sticky bottom-0 z-10 shrink-0 rounded-b-[12px] border-t border-solid border-stroke-subtle bg-canvas-elevated px-3 py-[10px]", children: t ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-content-secondary px-2", children: [
|
|
9
|
+
/* @__PURE__ */ e(a, { size: "12px", className: "text-content-icon" }),
|
|
10
10
|
/* @__PURE__ */ s("span", { className: "text-xs font-medium leading-4 text-secondary-foreground", children: [
|
|
11
11
|
"Maximum ",
|
|
12
|
-
|
|
12
|
+
t,
|
|
13
13
|
" selections"
|
|
14
14
|
] })
|
|
15
|
-
] }) :
|
|
16
|
-
/* @__PURE__ */ e(
|
|
15
|
+
] }) : n > 5e3 ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-content-secondary px-2", children: [
|
|
16
|
+
/* @__PURE__ */ e(a, { size: "12px", className: "text-content-icon" }),
|
|
17
17
|
/* @__PURE__ */ e("span", { className: "text-xs font-medium leading-4 text-secondary-foreground", children: "Large dataset detected. Operations might be slower." })
|
|
18
|
-
] }) :
|
|
18
|
+
] }) : r });
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
o as SelectMenuFooter
|
|
22
22
|
};
|
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Search as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { SelectAllRow as
|
|
2
|
+
import { Search as H } from "impact-nova-icons";
|
|
3
|
+
import { cn as $ } from "../../../../lib/utils.js";
|
|
4
|
+
import { SelectAllRow as y } from "./SelectAllRow.js";
|
|
5
5
|
import { hasSelectAllRow as D } from "../utils/getSelectableOptionIndices.js";
|
|
6
6
|
function F({
|
|
7
|
-
id:
|
|
8
|
-
selectFieldId:
|
|
9
|
-
isReadOnly:
|
|
10
|
-
isDisabled:
|
|
11
|
-
isMulti:
|
|
12
|
-
isSearchable:
|
|
7
|
+
id: o,
|
|
8
|
+
selectFieldId: c,
|
|
9
|
+
isReadOnly: t,
|
|
10
|
+
isDisabled: i,
|
|
11
|
+
isMulti: p,
|
|
12
|
+
isSearchable: d,
|
|
13
13
|
searchPosition: u,
|
|
14
|
-
fetchError:
|
|
14
|
+
fetchError: l,
|
|
15
15
|
isLoading: m,
|
|
16
16
|
isProcessing: x,
|
|
17
|
-
isSelectAllEnabled:
|
|
17
|
+
isSelectAllEnabled: h,
|
|
18
18
|
flatOptionsLength: f,
|
|
19
|
-
searchInputRef:
|
|
19
|
+
searchInputRef: b,
|
|
20
20
|
searchValue: v,
|
|
21
21
|
searchPlaceholder: g,
|
|
22
22
|
highlightedIndex: w,
|
|
23
23
|
maxSelectableOptions: N,
|
|
24
24
|
visibleStats: S,
|
|
25
25
|
selectAllLabel: k,
|
|
26
|
-
unselectAllLabel:
|
|
27
|
-
onSearchChange:
|
|
28
|
-
onSearchKeyDown:
|
|
29
|
-
onSelectAll:
|
|
26
|
+
unselectAllLabel: A,
|
|
27
|
+
onSearchChange: j,
|
|
28
|
+
onSearchKeyDown: z,
|
|
29
|
+
onSelectAll: B
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
31
|
+
const n = d && u === "menu" && !t && !l, r = D({
|
|
32
32
|
isLoading: !!m,
|
|
33
33
|
isProcessing: x,
|
|
34
|
-
fetchError:
|
|
35
|
-
isMulti:
|
|
36
|
-
isSelectAllEnabled:
|
|
37
|
-
isReadOnly:
|
|
34
|
+
fetchError: l,
|
|
35
|
+
isMulti: p,
|
|
36
|
+
isSelectAllEnabled: h,
|
|
37
|
+
isReadOnly: t,
|
|
38
38
|
flatOptionsLength: f
|
|
39
|
-
}),
|
|
40
|
-
return !
|
|
39
|
+
}), C = !l && (n || r);
|
|
40
|
+
return !n && !r ? null : /* @__PURE__ */ a(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
|
-
className:
|
|
43
|
+
className: $(
|
|
44
44
|
"sticky top-0 z-10 flex shrink-0 flex-col rounded-t-[12px] px-[6px] pt-[8px]",
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
t ? "bg-disabled-surface" : "bg-canvas-elevated",
|
|
46
|
+
C ? "border-b border-solid border-stroke-subtle" : ""
|
|
47
47
|
),
|
|
48
48
|
children: [
|
|
49
|
-
|
|
49
|
+
n ? /* @__PURE__ */ e(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
52
|
className: "p-0",
|
|
53
|
-
"data-testid": `select-search-container-${
|
|
53
|
+
"data-testid": `select-search-container-${o || "default"}`,
|
|
54
54
|
children: /* @__PURE__ */ a("div", { className: "relative", children: [
|
|
55
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 start-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 start-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ e(H, { size: "14px", className: "text-content-placeholder" }) }),
|
|
56
56
|
/* @__PURE__ */ e(
|
|
57
57
|
"input",
|
|
58
58
|
{
|
|
59
|
-
ref:
|
|
59
|
+
ref: b,
|
|
60
60
|
type: "text",
|
|
61
|
-
className: "block w-full ps-[34px] pe-4
|
|
61
|
+
className: "block h-[35px] w-full border-0 bg-transparent ps-[34px] pe-4 text-sm text-content outline-none placeholder:text-content-placeholder focus:ring-0 focus-visible:outline-none focus-visible:ring-0",
|
|
62
62
|
placeholder: g,
|
|
63
63
|
value: v,
|
|
64
|
-
onKeyDown:
|
|
65
|
-
onChange: (
|
|
66
|
-
|
|
64
|
+
onKeyDown: z,
|
|
65
|
+
onChange: (s) => {
|
|
66
|
+
j(s.target.value);
|
|
67
67
|
},
|
|
68
|
-
onClick: (
|
|
69
|
-
"data-testid": `select-search-input-${
|
|
68
|
+
onClick: (s) => s.stopPropagation(),
|
|
69
|
+
"data-testid": `select-search-input-${o || "default"}`
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] })
|
|
73
73
|
}
|
|
74
74
|
) : null,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
r ? /* @__PURE__ */ e(
|
|
76
|
+
y,
|
|
77
77
|
{
|
|
78
|
-
selectFieldId:
|
|
79
|
-
id:
|
|
78
|
+
selectFieldId: c,
|
|
79
|
+
id: o,
|
|
80
80
|
highlightedIndex: w,
|
|
81
|
-
isDisabled:
|
|
82
|
-
isReadOnly:
|
|
81
|
+
isDisabled: i,
|
|
82
|
+
isReadOnly: t,
|
|
83
83
|
maxSelectableOptions: N,
|
|
84
84
|
visibleStats: S,
|
|
85
85
|
selectAllLabel: k,
|
|
86
|
-
unselectAllLabel:
|
|
87
|
-
onSelectAll:
|
|
86
|
+
unselectAllLabel: A,
|
|
87
|
+
onSelectAll: B
|
|
88
88
|
}
|
|
89
89
|
) : null
|
|
90
90
|
]
|
|
@@ -4,16 +4,16 @@ import { isInvertedSelection as X, isOptionArray as Y } from "../utils/select.js
|
|
|
4
4
|
import { SelectOptionRow as Z } from "./SelectOptionRow.js";
|
|
5
5
|
function te({
|
|
6
6
|
fetchError: S,
|
|
7
|
-
onRefetch:
|
|
7
|
+
onRefetch: m,
|
|
8
8
|
flatOptions: p,
|
|
9
9
|
isLoading: h,
|
|
10
10
|
isProcessing: x,
|
|
11
11
|
isMulti: s,
|
|
12
12
|
isReadOnly: j,
|
|
13
|
-
enableGroups:
|
|
14
|
-
enableSubMenus:
|
|
13
|
+
enableGroups: o,
|
|
14
|
+
enableSubMenus: i,
|
|
15
15
|
showSequence: P,
|
|
16
|
-
maxSelectableOptions:
|
|
16
|
+
maxSelectableOptions: u,
|
|
17
17
|
listRef: k,
|
|
18
18
|
listboxId: w,
|
|
19
19
|
listboxLabel: B,
|
|
@@ -23,20 +23,20 @@ function te({
|
|
|
23
23
|
highlightedIndex: D,
|
|
24
24
|
activeSubmenu: E,
|
|
25
25
|
setActiveSubmenu: I,
|
|
26
|
-
internalValue:
|
|
26
|
+
internalValue: a,
|
|
27
27
|
selectionMode: L,
|
|
28
|
-
selectionSet:
|
|
28
|
+
selectionSet: f,
|
|
29
29
|
resolveOptionLabel: T,
|
|
30
30
|
getSequenceForOption: q,
|
|
31
31
|
renderOption: H,
|
|
32
32
|
onSelect: O,
|
|
33
|
-
getGroupStats:
|
|
33
|
+
getGroupStats: v,
|
|
34
34
|
emptyMessage: W = "No options found",
|
|
35
35
|
errorMessage: _ = "Something went wrong",
|
|
36
36
|
refetchLabel: $ = "Refetch"
|
|
37
37
|
}) {
|
|
38
38
|
const z = (n) => {
|
|
39
|
-
const e = p[n.index],
|
|
39
|
+
const e = p[n.index], g = s ? L === "exclude" ? !f.has(e.value) : f.has(e.value) : a?.value === e.value, c = a || [], F = s && u ? X(c) ? !1 : Y(c) && c.length >= u : !1, y = e.isDisabled || F && !g && !(o && e.isGroup) && !(i && e.isSubmenuParent), N = o && e.isGroup || i && e.isSubmenuParent ? v(e.original) : void 0, r = N?.selected || 0, J = N?.total || 0, K = r > 0 && r < J, Q = e.isParentSelectable !== !1, d = T(e), R = typeof d == "string" ? d : String(e.value || "");
|
|
40
40
|
return /* @__PURE__ */ t(
|
|
41
41
|
Z,
|
|
42
42
|
{
|
|
@@ -47,24 +47,24 @@ function te({
|
|
|
47
47
|
id: C,
|
|
48
48
|
isMulti: s,
|
|
49
49
|
isReadOnly: j,
|
|
50
|
-
enableGroups:
|
|
51
|
-
enableSubMenus:
|
|
50
|
+
enableGroups: o,
|
|
51
|
+
enableSubMenus: i,
|
|
52
52
|
showSequence: P,
|
|
53
|
-
selected:
|
|
54
|
-
isOptDisabled:
|
|
53
|
+
selected: g,
|
|
54
|
+
isOptDisabled: y,
|
|
55
55
|
indeterminate: K,
|
|
56
|
-
selectedCount:
|
|
56
|
+
selectedCount: r,
|
|
57
57
|
isParentSelectable: Q,
|
|
58
|
-
highlighted: D === n.index && !
|
|
58
|
+
highlighted: D === n.index && !y,
|
|
59
59
|
activeSubmenu: E,
|
|
60
60
|
setActiveSubmenu: I,
|
|
61
|
-
optionLabel:
|
|
61
|
+
optionLabel: d,
|
|
62
62
|
optionLabelString: R,
|
|
63
63
|
sequence: q(e),
|
|
64
|
-
internalValue:
|
|
64
|
+
internalValue: a,
|
|
65
65
|
renderOption: H,
|
|
66
66
|
onSelect: O,
|
|
67
|
-
getGroupStats:
|
|
67
|
+
getGroupStats: v
|
|
68
68
|
},
|
|
69
69
|
n.key
|
|
70
70
|
);
|
|
@@ -83,15 +83,15 @@ function te({
|
|
|
83
83
|
},
|
|
84
84
|
onWheel: (n) => n.stopPropagation(),
|
|
85
85
|
children: S ? /* @__PURE__ */ b("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
|
|
86
|
-
/* @__PURE__ */ t("p", { className: "text-sm text-
|
|
87
|
-
|
|
88
|
-
] }) : p.length === 0 && !h && !x ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center py-8 text-sm text-
|
|
86
|
+
/* @__PURE__ */ t("p", { className: "text-sm text-content-secondary font-medium mb-3", children: _ }),
|
|
87
|
+
m ? /* @__PURE__ */ t(U, { size: "sm", variant: "outline", onClick: () => m(), children: $ }) : null
|
|
88
|
+
] }) : p.length === 0 && !h && !x ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center py-8 text-sm text-content-secondary", children: W }) : h || x ? /* @__PURE__ */ t("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((n, e) => /* @__PURE__ */ b(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
91
|
className: "flex items-center gap-2 px-3 py-2 animate-pulse",
|
|
92
92
|
children: [
|
|
93
|
-
s ? /* @__PURE__ */ t("div", { className: "w-4 h-4 bg-
|
|
94
|
-
/* @__PURE__ */ t("div", { className: "h-4 bg-
|
|
93
|
+
s ? /* @__PURE__ */ t("div", { className: "w-4 h-4 bg-canvas-muted rounded shrink-0" }) : null,
|
|
94
|
+
/* @__PURE__ */ t("div", { className: "h-4 bg-canvas-muted rounded w-full" })
|
|
95
95
|
]
|
|
96
96
|
},
|
|
97
97
|
e
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "@radix-ui/react-popover";
|
|
3
3
|
import { cn as r } from "../../../../lib/utils.js";
|
|
4
|
-
function
|
|
4
|
+
function f({
|
|
5
5
|
menuRef: n,
|
|
6
|
-
menuMinHeight:
|
|
6
|
+
menuMinHeight: o,
|
|
7
7
|
menuWidth: l,
|
|
8
8
|
isReadOnly: a,
|
|
9
9
|
id: d,
|
|
10
10
|
menuLabel: s,
|
|
11
11
|
children: p
|
|
12
12
|
}) {
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ t(i.Portal, { children: /* @__PURE__ */ t(
|
|
14
14
|
i.Content,
|
|
15
15
|
{
|
|
16
16
|
ref: n,
|
|
@@ -28,12 +28,12 @@ function v({
|
|
|
28
28
|
maxHeight: "min(320px, var(--radix-popover-content-available-height, 320px))"
|
|
29
29
|
},
|
|
30
30
|
className: r(
|
|
31
|
-
"z-50 flex flex-col overflow-hidden rounded-[12px] p-0 text-base shadow-
|
|
31
|
+
"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",
|
|
32
32
|
a ? "bg-disabled-surface" : "bg-canvas-elevated"
|
|
33
33
|
),
|
|
34
34
|
"data-testid": `select-menu-${d || "default"}`,
|
|
35
35
|
"data-component": "select-menu",
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ t(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
39
|
className: r(
|
|
@@ -41,7 +41,7 @@ function v({
|
|
|
41
41
|
a ? "bg-disabled-surface" : "bg-canvas-elevated"
|
|
42
42
|
),
|
|
43
43
|
style: {
|
|
44
|
-
minHeight:
|
|
44
|
+
minHeight: o ? `${o}px` : void 0
|
|
45
45
|
},
|
|
46
46
|
children: p
|
|
47
47
|
}
|
|
@@ -50,5 +50,5 @@ function v({
|
|
|
50
50
|
) });
|
|
51
51
|
}
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
f as SelectMenuPanel
|
|
54
54
|
};
|
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Checkmark as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { selectOptionVariants as
|
|
6
|
-
import { isSelected as
|
|
7
|
-
import { LabelWithSequence as
|
|
8
|
-
import { Submenu as
|
|
9
|
-
function
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as z } from "react";
|
|
3
|
+
import { Checkmark as E, ChevronRight as W } from "impact-nova-icons";
|
|
4
|
+
import { cn as x } from "../../../../lib/utils.js";
|
|
5
|
+
import { selectOptionVariants as Y } from "../select.variants.js";
|
|
6
|
+
import { isSelected as B } from "../utils/select.js";
|
|
7
|
+
import { LabelWithSequence as F } from "./LabelWithSequence.js";
|
|
8
|
+
import { Submenu as G } from "./Submenu.js";
|
|
9
|
+
function H({
|
|
10
10
|
option: e,
|
|
11
|
-
virtualRow:
|
|
12
|
-
measureElement:
|
|
13
|
-
selectFieldId:
|
|
14
|
-
id:
|
|
11
|
+
virtualRow: s,
|
|
12
|
+
measureElement: S,
|
|
13
|
+
selectFieldId: y,
|
|
14
|
+
id: k,
|
|
15
15
|
isMulti: l,
|
|
16
16
|
isReadOnly: m,
|
|
17
|
-
enableGroups:
|
|
17
|
+
enableGroups: n,
|
|
18
18
|
enableSubMenus: t,
|
|
19
19
|
showSequence: j,
|
|
20
20
|
selected: a,
|
|
21
|
-
isOptDisabled:
|
|
21
|
+
isOptDisabled: c,
|
|
22
22
|
indeterminate: f,
|
|
23
|
-
selectedCount:
|
|
24
|
-
isParentSelectable:
|
|
23
|
+
selectedCount: p,
|
|
24
|
+
isParentSelectable: g,
|
|
25
25
|
highlighted: C,
|
|
26
26
|
activeSubmenu: I,
|
|
27
27
|
setActiveSubmenu: N,
|
|
28
28
|
optionLabel: v,
|
|
29
|
-
optionLabelString:
|
|
30
|
-
sequence:
|
|
31
|
-
internalValue:
|
|
29
|
+
optionLabelString: b,
|
|
30
|
+
sequence: V,
|
|
31
|
+
internalValue: q,
|
|
32
32
|
renderOption: w,
|
|
33
33
|
onSelect: $,
|
|
34
|
-
getGroupStats:
|
|
34
|
+
getGroupStats: P
|
|
35
35
|
}) {
|
|
36
|
-
const u =
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
const u = k || "default", o = String(e.value || "");
|
|
37
|
+
return /* @__PURE__ */ h(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
|
-
"data-index":
|
|
41
|
-
ref:
|
|
40
|
+
"data-index": s.index,
|
|
41
|
+
ref: S,
|
|
42
42
|
className: "absolute start-0 w-full pb-[2px]",
|
|
43
43
|
style: {
|
|
44
|
-
transform: `translateY(${
|
|
44
|
+
transform: `translateY(${s.start}px)`,
|
|
45
45
|
width: "100%"
|
|
46
46
|
},
|
|
47
|
-
"data-testid": `select-option-wrapper-${u}-${
|
|
47
|
+
"data-testid": `select-option-wrapper-${u}-${o}`,
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ r(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
|
-
id: `${
|
|
53
|
-
className:
|
|
54
|
-
|
|
55
|
-
disabled:
|
|
52
|
+
id: `${y}-option-${s.index}`,
|
|
53
|
+
className: x(
|
|
54
|
+
Y({
|
|
55
|
+
disabled: c,
|
|
56
56
|
readOnly: m,
|
|
57
|
-
selected: a && !
|
|
58
|
-
highlighted: C && !
|
|
57
|
+
selected: a && !c && !(n && e.isGroup) && !(t && e.isSubmenuParent),
|
|
58
|
+
highlighted: C && !c
|
|
59
59
|
})
|
|
60
60
|
),
|
|
61
61
|
style: {
|
|
62
62
|
paddingInlineStart: `${e.depth * 16 + 12}px`
|
|
63
63
|
},
|
|
64
64
|
onClick: () => {
|
|
65
|
-
|
|
65
|
+
c || (n && e.isGroup || t && e.isSubmenuParent) && !g || $(e);
|
|
66
66
|
},
|
|
67
67
|
onMouseEnter: () => {
|
|
68
68
|
t && e.isSubmenuParent ? N(e.value) : N(null);
|
|
69
69
|
},
|
|
70
|
-
"data-testid": `select-option-${u}-${
|
|
70
|
+
"data-testid": `select-option-${u}-${o}`,
|
|
71
71
|
"data-state": a ? "checked" : "unchecked",
|
|
72
|
-
"data-disabled":
|
|
72
|
+
"data-disabled": c || void 0,
|
|
73
73
|
"data-component": "select-option",
|
|
74
74
|
role: "option",
|
|
75
75
|
"aria-selected": a,
|
|
76
|
-
"aria-disabled":
|
|
76
|
+
"aria-disabled": c || void 0,
|
|
77
77
|
children: w ? w(
|
|
78
78
|
{
|
|
79
79
|
onClick: () => {
|
|
80
80
|
},
|
|
81
81
|
className: "w-full",
|
|
82
82
|
selected: a,
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: c
|
|
84
84
|
},
|
|
85
85
|
e
|
|
86
|
-
) : /* @__PURE__ */
|
|
87
|
-
l && (
|
|
86
|
+
) : /* @__PURE__ */ h("div", { className: "flex items-center flex-1 overflow-hidden", children: [
|
|
87
|
+
l && (n && e.isGroup || t && e.isSubmenuParent ? g : !0) && /* @__PURE__ */ r(
|
|
88
88
|
"span",
|
|
89
89
|
{
|
|
90
90
|
"aria-hidden": "true",
|
|
91
|
-
className:
|
|
91
|
+
className: x(
|
|
92
92
|
"mr-[7px] flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-stroke-field bg-canvas-elevated",
|
|
93
93
|
(a || f) && "border-brand bg-accent text-brand",
|
|
94
|
-
(
|
|
94
|
+
(c || m) && "opacity-50"
|
|
95
95
|
),
|
|
96
|
-
children: a && !f ? /* @__PURE__ */ r(
|
|
96
|
+
children: a && !f ? /* @__PURE__ */ r(E, { className: "h-3.5 w-3.5" }) : f ? /* @__PURE__ */ r("span", { className: "block h-0.5 w-2.5 bg-current" }) : null
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
j && !(
|
|
99
|
+
j && !(n && e.isGroup) && !(t && e.isSubmenuParent) ? /* @__PURE__ */ r(F, { label: v, sequence: V }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
|
|
100
100
|
/* @__PURE__ */ r(
|
|
101
101
|
"span",
|
|
102
102
|
{
|
|
103
|
-
className:
|
|
103
|
+
className: x(
|
|
104
104
|
"block truncate",
|
|
105
|
-
|
|
106
|
-
!(
|
|
105
|
+
n && e.isGroup ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : a && !(t && e.isSubmenuParent) ? "font-medium" : "font-normal",
|
|
106
|
+
!(n && e.isGroup) && "text-[14px]"
|
|
107
107
|
),
|
|
108
|
-
"data-testid": `select-option-label-${u}-${
|
|
108
|
+
"data-testid": `select-option-label-${u}-${o}`,
|
|
109
109
|
"data-state": a ? "checked" : "unchecked",
|
|
110
|
-
title:
|
|
110
|
+
title: b,
|
|
111
111
|
children: v
|
|
112
112
|
}
|
|
113
113
|
),
|
|
114
|
-
(
|
|
114
|
+
(n && e.isGroup || t && e.isSubmenuParent) && p > 0 && /* @__PURE__ */ r("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-brand-tint text-brand-on-subtle", children: p })
|
|
115
115
|
] }),
|
|
116
|
-
t && e.isSubmenuParent && /* @__PURE__ */ r(
|
|
116
|
+
t && e.isSubmenuParent && /* @__PURE__ */ r(W, { size: "12px", className: "text-content-icon" })
|
|
117
117
|
] })
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
120
|
t && I === e.value && e.isSubmenuParent && /* @__PURE__ */ r(
|
|
121
|
-
|
|
121
|
+
G,
|
|
122
122
|
{
|
|
123
123
|
parentOption: e,
|
|
124
124
|
isMulti: !!l,
|
|
125
125
|
isReadOnly: !!m,
|
|
126
|
-
isSelected: (
|
|
127
|
-
getIndeterminateState: (
|
|
128
|
-
const
|
|
129
|
-
return
|
|
126
|
+
isSelected: (d) => B(d, q, !!l),
|
|
127
|
+
getIndeterminateState: (d) => {
|
|
128
|
+
const i = P(d);
|
|
129
|
+
return i ? i.selected > 0 && i.selected < i.total : !1;
|
|
130
130
|
},
|
|
131
|
-
getSelectedCount: (
|
|
131
|
+
getSelectedCount: (d) => P(d)?.selected || 0,
|
|
132
132
|
handleSelect: $,
|
|
133
|
-
id:
|
|
133
|
+
id: k
|
|
134
134
|
}
|
|
135
135
|
)
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
|
-
|
|
138
|
+
s.key
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const _ = z(H);
|
|
142
142
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
_ as SelectOptionRow,
|
|
144
|
+
H as SelectOptionRowInner
|
|
145
145
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { SelectProps, Option, Group } from './select.types';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
displayName: string;
|
|
5
|
-
}
|
|
3
|
+
declare function Select<OptionType extends Option = Option, IsMulti extends boolean = false, GroupType extends Group = Group>(props: SelectProps<OptionType, IsMulti, GroupType>): React.ReactElement;
|
|
4
|
+
declare namespace Select {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
6
7
|
export { Select };
|
|
7
8
|
export type { SelectProps } from './select.types';
|