impact-nova 3.0.0-alpha.10 → 3.0.0-alpha.12
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 +88 -76
- package/dist/components/data/data-table/index.d.ts +1 -0
- package/dist/components/data/data-table/index.js +16 -14
- package/dist/components/data/data-table/use-data-table-viewport.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-viewport.js +31 -0
- package/dist/components/flows/iris-chat/IrisChatHeaderWindowSizeButton.js +45 -36
- package/dist/components/flows/iris-chat/IrisChatSnapTile.d.ts +8 -0
- package/dist/components/flows/iris-chat/IrisChatSnapTile.js +30 -0
- package/dist/components/flows/iris-chat/IrisChatWindowSnapMenu.js +67 -53
- package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +2 -1
- package/dist/components/flows/iris-chat/iris-chat-frame.js +40 -31
- package/dist/components/flows/iris-chat/iris-chat-snap-presets.d.ts +4 -1
- package/dist/components/flows/iris-chat/iris-chat-snap-presets.js +49 -29
- package/dist/components/flows/iris-chat/iris-chat-thread.js +95 -96
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +5 -2
- package/dist/components/flows/iris-chat/use-iris-chat-root.js +83 -88
- package/dist/components/primitives/stepper/stepper.js +29 -28
- package/dist/components/primitives/stepper/stepper.types.d.ts +2 -0
- package/dist/i18n/defaultMessages.d.ts +5 -0
- package/dist/i18n/defaultMessages.js +7 -2
- package/dist/i18n/locales/de.js +5 -0
- package/dist/i18n/locales/es.js +5 -0
- package/dist/i18n/locales/hi.js +5 -0
- package/dist/i18n/locales/kn.js +5 -0
- package/dist/impact-nova-components.css +16 -6
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +132 -130
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as s, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as L, useMemo as x, useCallback as U } from "react";
|
|
3
|
+
import { useAgGridTruncationTooltip as G } from "../use-ag-grid-truncation-tooltip.js";
|
|
4
|
+
import { Badge as H } from "../../../data-display/badge/badge.js";
|
|
5
|
+
import { evaluateValidationRules as _, getFieldValue as m, mapBadgeVariant as z, mapBadgeColor as A } from "./cell-renderer-utils.js";
|
|
6
|
+
import { resolveGridIcon as M } from "./gridIconResolver.js";
|
|
7
|
+
import { Tooltip as Q, TooltipTrigger as q, TooltipContent as J } from "../../../feedback/tooltip/tooltip.js";
|
|
8
|
+
const W = (e, n, r, a) => {
|
|
8
9
|
if (!n) return e;
|
|
9
10
|
let t = e;
|
|
10
|
-
return t = t.replace(/\$\{value\}/g, String(a ?? "")), t = t.replace(/\$\{field\}/g, String(r ?? "")), Object.keys(n).forEach((
|
|
11
|
-
const
|
|
12
|
-
t = t.replace(
|
|
11
|
+
return t = t.replace(/\$\{value\}/g, String(a ?? "")), t = t.replace(/\$\{field\}/g, String(r ?? "")), Object.keys(n).forEach((o) => {
|
|
12
|
+
const i = new RegExp(`\\$\\{${o}\\}`, "g");
|
|
13
|
+
t = t.replace(i, String(n[o] ?? ""));
|
|
13
14
|
}), t;
|
|
14
|
-
},
|
|
15
|
+
}, X = ({
|
|
15
16
|
iconConfig: e,
|
|
16
17
|
rowData: n,
|
|
17
18
|
rowId: r,
|
|
18
19
|
field: a
|
|
19
20
|
}) => {
|
|
20
21
|
let t = null;
|
|
21
|
-
const
|
|
22
|
-
if (typeof
|
|
23
|
-
const
|
|
22
|
+
const o = m(e.iconField, e.icon, n);
|
|
23
|
+
if (typeof o == "string" ? t = M(o, { size: 16 }) : t = o, !t) return null;
|
|
24
|
+
const i = m(e.backgroundColorField, e.backgroundColor, n), d = m(e.colorField, e.color, n) ?? "var(--color-foreground-icon)", f = m(e.tooltipField, e.tooltip, n), g = /* @__PURE__ */ s(
|
|
24
25
|
"div",
|
|
25
26
|
{
|
|
26
27
|
className: `flex shrink-0 items-center justify-center bg-[var(--icon-bg)] text-[var(--icon-fg)] ${e.onClick ? "cursor-pointer" : ""} ${e.showOnHover ? "max-w-0 min-w-0 overflow-hidden p-0 opacity-0 pointer-events-none group-hover:max-w-none group-hover:min-w-[18px] group-hover:p-0.5 group-hover:opacity-100 group-hover:pointer-events-auto" : "p-0.5 min-w-[18px]"}`,
|
|
27
28
|
style: {
|
|
28
|
-
"--icon-bg":
|
|
29
|
-
"--icon-fg":
|
|
29
|
+
"--icon-bg": i,
|
|
30
|
+
"--icon-fg": d,
|
|
30
31
|
borderRadius: "4px",
|
|
31
32
|
minHeight: "18px"
|
|
32
33
|
},
|
|
@@ -34,11 +35,11 @@ const M = (e, n, r, a) => {
|
|
|
34
35
|
children: t
|
|
35
36
|
}
|
|
36
37
|
);
|
|
37
|
-
return f ? /* @__PURE__ */ j(
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
] }) :
|
|
41
|
-
},
|
|
38
|
+
return f ? /* @__PURE__ */ j(Q, { children: [
|
|
39
|
+
/* @__PURE__ */ s(q, { asChild: !0, children: g }),
|
|
40
|
+
/* @__PURE__ */ s(J, { variant: "tertiary", side: e.tooltipSide || "top", children: f })
|
|
41
|
+
] }) : g;
|
|
42
|
+
}, Y = ({
|
|
42
43
|
badgeConfig: e,
|
|
43
44
|
rowData: n,
|
|
44
45
|
rowId: r,
|
|
@@ -46,101 +47,112 @@ const M = (e, n, r, a) => {
|
|
|
46
47
|
}) => {
|
|
47
48
|
const t = m(e.labelField, e.label, n);
|
|
48
49
|
if (!t) return null;
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
50
|
+
const o = m(e.colorField, e.color, n), i = m(e.variantField, e.variant, n);
|
|
51
|
+
return /* @__PURE__ */ s(
|
|
52
|
+
H,
|
|
52
53
|
{
|
|
53
54
|
className: "font-medium",
|
|
54
|
-
color:
|
|
55
|
-
variant:
|
|
55
|
+
color: A(o),
|
|
56
|
+
variant: z(i),
|
|
56
57
|
onClick: e.onClick ? () => e.onClick?.({ rowId: r, field: a, rowData: n ?? {} }) : void 0,
|
|
57
58
|
children: t
|
|
58
59
|
}
|
|
59
60
|
);
|
|
60
|
-
},
|
|
61
|
+
}, Z = (e) => {
|
|
61
62
|
const {
|
|
62
63
|
value: n,
|
|
63
64
|
data: r,
|
|
64
65
|
node: a,
|
|
65
66
|
colDef: t,
|
|
66
|
-
onClick:
|
|
67
|
-
redirectUrl:
|
|
68
|
-
updateQueryParams:
|
|
67
|
+
onClick: o,
|
|
68
|
+
redirectUrl: i,
|
|
69
|
+
updateQueryParams: d,
|
|
69
70
|
navigate: f,
|
|
70
|
-
setSearchParams:
|
|
71
|
-
rightSideContent:
|
|
72
|
-
valueFormatter:
|
|
71
|
+
setSearchParams: g,
|
|
72
|
+
rightSideContent: k,
|
|
73
|
+
valueFormatter: h,
|
|
73
74
|
disableOnPinnedRows: S = !0,
|
|
74
75
|
disableLinkStyle: w,
|
|
75
|
-
validationRules:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
p =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
validationRules: R,
|
|
77
|
+
setTooltip: N
|
|
78
|
+
} = e, $ = L(null), y = a.id ?? String(r?.id ?? ""), u = t?.field ?? "", T = r && typeof r == "object" && "_isPinned" in r && r._isPinned === !0, E = x(() => w || S && T || _(R, r) ? !1 : !!(d || i || o), [w, S, T, d, i, o, R, r]), B = U(
|
|
79
|
+
(c) => {
|
|
80
|
+
if (c.stopPropagation(), d && g)
|
|
81
|
+
g((l) => {
|
|
82
|
+
const v = new URLSearchParams(l);
|
|
83
|
+
return Object.entries(d).forEach(([b, V]) => {
|
|
84
|
+
let p = String(V);
|
|
85
|
+
p = p.replace(/\$\{value\}/g, String(n ?? "")), p = p.replace(/\$\{field\}/g, u), r && Object.keys(r).forEach((P) => {
|
|
86
|
+
const I = new RegExp(`\\$\\{${P}\\}`, "g");
|
|
87
|
+
p = p.replace(I, String(r[P] ?? ""));
|
|
88
|
+
}), v.set(b, p);
|
|
89
|
+
}), v;
|
|
88
90
|
});
|
|
89
|
-
else if (
|
|
90
|
-
const l =
|
|
91
|
+
else if (i && f) {
|
|
92
|
+
const l = W(i, r, u, n);
|
|
91
93
|
f(l);
|
|
92
|
-
} else
|
|
94
|
+
} else o && o({ rowId: y, field: u, rowData: r ?? {}, value: n });
|
|
93
95
|
},
|
|
94
|
-
[
|
|
95
|
-
),
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
[d, g, i, f, o, r, u, n, y]
|
|
97
|
+
), C = x(() => h ? h(n, r ?? {}) : String(n ?? ""), [n, h, r]), O = x(() => {
|
|
98
|
+
if (h) {
|
|
99
|
+
const c = h(n, r ?? {});
|
|
100
|
+
if (typeof c == "string" || typeof c == "number")
|
|
101
|
+
return String(c);
|
|
102
|
+
}
|
|
103
|
+
return String(n ?? "");
|
|
104
|
+
}, [n, h, r]);
|
|
105
|
+
G(N, O, $, "ellipsis");
|
|
106
|
+
const F = x(() => {
|
|
107
|
+
if (!k?.items || k.items.length === 0) return null;
|
|
108
|
+
const c = [];
|
|
109
|
+
return k.items.forEach((l, v) => {
|
|
99
110
|
if (l.type === "icon" && l.icon)
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
111
|
+
c.push(
|
|
112
|
+
/* @__PURE__ */ s(
|
|
113
|
+
X,
|
|
103
114
|
{
|
|
104
115
|
iconConfig: l.icon,
|
|
105
116
|
rowData: r,
|
|
106
|
-
rowId:
|
|
107
|
-
field:
|
|
117
|
+
rowId: y,
|
|
118
|
+
field: u
|
|
108
119
|
},
|
|
109
|
-
`icon-${
|
|
120
|
+
`icon-${v}`
|
|
110
121
|
)
|
|
111
122
|
);
|
|
112
123
|
else if (l.type === "badge" && l.badge)
|
|
113
|
-
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
124
|
+
c.push(
|
|
125
|
+
/* @__PURE__ */ s(
|
|
126
|
+
Y,
|
|
116
127
|
{
|
|
117
128
|
badgeConfig: l.badge,
|
|
118
129
|
rowData: r,
|
|
119
|
-
rowId:
|
|
120
|
-
field:
|
|
130
|
+
rowId: y,
|
|
131
|
+
field: u
|
|
121
132
|
},
|
|
122
|
-
`badge-${
|
|
133
|
+
`badge-${v}`
|
|
123
134
|
)
|
|
124
135
|
);
|
|
125
136
|
else if (l.type === "dynamic" && l.dynamic) {
|
|
126
|
-
const
|
|
127
|
-
|
|
137
|
+
const b = typeof l.dynamic == "function" ? l.dynamic(r ?? {}) : l.dynamic;
|
|
138
|
+
c.push(/* @__PURE__ */ s("span", { children: b }, `dyn-${v}`));
|
|
128
139
|
}
|
|
129
|
-
}),
|
|
130
|
-
}, [
|
|
140
|
+
}), c.length > 0 ? c : null;
|
|
141
|
+
}, [k, r, y, u]);
|
|
131
142
|
return /* @__PURE__ */ j("div", { className: "w-full h-full flex items-center justify-between gap-2 group ag-cell-inner-padding", children: [
|
|
132
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ s(
|
|
133
144
|
"div",
|
|
134
145
|
{
|
|
146
|
+
ref: $,
|
|
135
147
|
className: `flex-1 truncate min-w-0 ${E ? "text-brand cursor-pointer hover:underline font-medium" : ""}`,
|
|
136
|
-
onClick: E ?
|
|
137
|
-
children:
|
|
148
|
+
onClick: E ? B : void 0,
|
|
149
|
+
children: C
|
|
138
150
|
}
|
|
139
151
|
),
|
|
140
|
-
F && /* @__PURE__ */
|
|
152
|
+
F && /* @__PURE__ */ s("div", { className: "flex items-center gap-1 flex-shrink-0", children: F })
|
|
141
153
|
] });
|
|
142
154
|
};
|
|
143
|
-
|
|
155
|
+
Z.displayName = "LinkCellRenderer";
|
|
144
156
|
export {
|
|
145
|
-
|
|
157
|
+
Z as LinkCellRenderer
|
|
146
158
|
};
|
|
@@ -14,4 +14,5 @@ export * from './column-indicator';
|
|
|
14
14
|
export * from './indicator-legend';
|
|
15
15
|
export * from './column-savability';
|
|
16
16
|
export { mergePartialOrderedColumnState } from './data-table-column-state';
|
|
17
|
+
export { useDataTableViewport } from './use-data-table-viewport';
|
|
17
18
|
export type { SavedTableViewItem, TableViewTypeOption, DataTableSavedViewsProps, DataTableSavedViewsActionContext, DataTableSavedViewsCancelContext, } from '../data-table/data-table-saved-views.types';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DataTable as t, DataTableContent as r, DataTableToolbar as o } from "./data-table.js";
|
|
2
|
-
import { deferColumnRuntimeStateGuard as T, isColumnRuntimeStateGuardDeferred as n, isColumnRuntimeStateGuardUpdating as
|
|
2
|
+
import { deferColumnRuntimeStateGuard as T, isColumnRuntimeStateGuardDeferred as n, isColumnRuntimeStateGuardUpdating as D, rebuildColumnTreeCacheFromGrid as S, scheduleColumnRuntimeStateGuard as b } from "./column-runtime-state-guard.js";
|
|
3
3
|
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as i, DATA_TABLE_SHEET_SLIDE_TRANSITION_MS as u, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as p } from "./data-table-constants.js";
|
|
4
|
-
import { DataTableColumnList as
|
|
5
|
-
import { DataTableContext as
|
|
4
|
+
import { DataTableColumnList as d } from "./data-table-column-list.js";
|
|
5
|
+
import { DataTableContext as s, DataTableSheetPortalStoreContext as h, useDataTable as C, useDataTableSheetPortal as _, useDataTableSheetPortalStore as E } from "./data-table-context.js";
|
|
6
6
|
import { DataTableFormatOptions as L } from "./data-table-format-options.js";
|
|
7
|
-
import { DataTableSheet as
|
|
7
|
+
import { DataTableSheet as w, DataTableSheetContent as I, DataTableSheetHeader as V, DataTableSheetTrigger as g } from "./data-table-sheet.js";
|
|
8
8
|
import { DataTableSheetBody as M, DataTableSheetSection as c, DataTableSheetTabPanel as G, DataTableSheetTabs as O, DataTableSheetTabsList as R } from "./data-table-sheet-layout.js";
|
|
9
9
|
import { useDataTableSheet as N, useDataTableSheetApi as v } from "./data-table-sheet-context.js";
|
|
10
10
|
import { DataTableViewMenuContent as F, DataTableViewMenuDensity as X, DataTableViewMenuSettingsItem as U, DataTableViewMenuTrigger as W, DataTableViewMenuViewportExpand as j } from "./data-table-view-menu.js";
|
|
@@ -14,26 +14,27 @@ import { ColumnIndicator as Q } from "./column-indicator.js";
|
|
|
14
14
|
import { IndicatorLegend as Z } from "./indicator-legend.js";
|
|
15
15
|
import { resolveColumnSavability as ee } from "./column-savability.js";
|
|
16
16
|
import { mergePartialOrderedColumnState as te } from "./data-table-column-state.js";
|
|
17
|
+
import { useDataTableViewport as oe } from "./use-data-table-viewport.js";
|
|
17
18
|
export {
|
|
18
19
|
Q as ColumnIndicator,
|
|
19
20
|
i as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
|
|
20
21
|
u as DATA_TABLE_SHEET_SLIDE_TRANSITION_MS,
|
|
21
22
|
t as DataTable,
|
|
22
|
-
|
|
23
|
+
d as DataTableColumnList,
|
|
23
24
|
r as DataTableContent,
|
|
24
|
-
|
|
25
|
+
s as DataTableContext,
|
|
25
26
|
L as DataTableFormatOptions,
|
|
26
27
|
q as DataTableSavedViews,
|
|
27
|
-
|
|
28
|
+
w as DataTableSheet,
|
|
28
29
|
M as DataTableSheetBody,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
I as DataTableSheetContent,
|
|
31
|
+
V as DataTableSheetHeader,
|
|
32
|
+
h as DataTableSheetPortalStoreContext,
|
|
32
33
|
c as DataTableSheetSection,
|
|
33
34
|
G as DataTableSheetTabPanel,
|
|
34
35
|
O as DataTableSheetTabs,
|
|
35
36
|
R as DataTableSheetTabsList,
|
|
36
|
-
|
|
37
|
+
g as DataTableSheetTrigger,
|
|
37
38
|
o as DataTableToolbar,
|
|
38
39
|
F as DataTableViewMenuContent,
|
|
39
40
|
X as DataTableViewMenuDensity,
|
|
@@ -45,14 +46,15 @@ export {
|
|
|
45
46
|
p as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS,
|
|
46
47
|
T as deferColumnRuntimeStateGuard,
|
|
47
48
|
n as isColumnRuntimeStateGuardDeferred,
|
|
48
|
-
|
|
49
|
+
D as isColumnRuntimeStateGuardUpdating,
|
|
49
50
|
te as mergePartialOrderedColumnState,
|
|
50
|
-
|
|
51
|
+
S as rebuildColumnTreeCacheFromGrid,
|
|
51
52
|
ee as resolveColumnSavability,
|
|
52
53
|
b as scheduleColumnRuntimeStateGuard,
|
|
53
54
|
C as useDataTable,
|
|
54
55
|
N as useDataTableSheet,
|
|
55
56
|
v as useDataTableSheetApi,
|
|
56
57
|
_ as useDataTableSheetPortal,
|
|
57
|
-
E as useDataTableSheetPortalStore
|
|
58
|
+
E as useDataTableSheetPortalStore,
|
|
59
|
+
oe as useDataTableViewport
|
|
58
60
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function useDataTableViewport(): {
|
|
2
|
+
tableShellRef: import('react').RefObject<HTMLDivElement | null>;
|
|
3
|
+
viewMenuViewportExpandProps: {
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
6
|
+
};
|
|
7
|
+
isViewportExpanded: boolean;
|
|
8
|
+
setViewportExpanded: (expanded: boolean) => void;
|
|
9
|
+
isViewportExpandedRef: import('react').RefObject<boolean>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useRef as r, useState as l, useCallback as i, useLayoutEffect as u, useMemo as E } from "react";
|
|
2
|
+
import { TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as c } from "./data-table-constants.js";
|
|
3
|
+
function w() {
|
|
4
|
+
const n = r(null), [e, a] = l(!1), o = r(!1), s = i((t) => {
|
|
5
|
+
o.current = t, a(t);
|
|
6
|
+
}, []);
|
|
7
|
+
u(() => {
|
|
8
|
+
const t = n.current;
|
|
9
|
+
t && t.classList.toggle(
|
|
10
|
+
c,
|
|
11
|
+
e
|
|
12
|
+
);
|
|
13
|
+
}, [e]);
|
|
14
|
+
const p = E(
|
|
15
|
+
() => ({
|
|
16
|
+
expanded: e,
|
|
17
|
+
onExpandedChange: s
|
|
18
|
+
}),
|
|
19
|
+
[e, s]
|
|
20
|
+
);
|
|
21
|
+
return {
|
|
22
|
+
tableShellRef: n,
|
|
23
|
+
viewMenuViewportExpandProps: p,
|
|
24
|
+
isViewportExpanded: e,
|
|
25
|
+
setViewportExpanded: s,
|
|
26
|
+
isViewportExpandedRef: o
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
w as useDataTableViewport
|
|
31
|
+
};
|
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { HoverCard as
|
|
4
|
-
import { ButtonIconTooltip as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { useImpactNovaI18n as
|
|
7
|
-
import { createComponent as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { IrisChatWindowSnapMenu as
|
|
1
|
+
import { jsxs as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { HoverCard as h, HoverCardTrigger as I, HoverCardContent as u } from "../../feedback/hover-card/hover-card.js";
|
|
4
|
+
import { ButtonIconTooltip as S } from "../../feedback/tooltip/button-icon-tooltip.js";
|
|
5
|
+
import { Button as _ } from "../../primitives/button/button.js";
|
|
6
|
+
import { useImpactNovaI18n as N } from "../../../i18n/use-impact-nova-i18n.js";
|
|
7
|
+
import { createComponent as z } from "../../../lib/primitives/create-component.js";
|
|
8
|
+
import { cn as g } from "../../../lib/utils.js";
|
|
9
|
+
import { IrisChatWindowSnapMenu as w } from "./IrisChatWindowSnapMenu.js";
|
|
10
10
|
import { useIrisChat as H } from "./iris-chat-context.js";
|
|
11
|
-
import { IrisChatMinimizeIcon as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
15
|
-
const { t
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
import { IrisChatMinimizeIcon as b } from "./iris-chat-icons.js";
|
|
12
|
+
import { readIrisChatFrameIsCompact as A } from "./iris-chat-snap-presets.js";
|
|
13
|
+
import { IRIS_CHAT_SNAP_MENU_CLOSE_DELAY_MS as E, IRIS_CHAT_SNAP_MENU_OPEN_DELAY_MS as M } from "./iris-chat-window-chrome.js";
|
|
14
|
+
const U = z("IrisChatHeaderWindowSizeButton", ({ label: a, onClick: s, className: m, ...c }, l) => {
|
|
15
|
+
const { t } = N(), o = H(), [p, r] = f.useState(!1), n = A(o.frame, o.placement), i = a ?? t(n ? "irisChat.larger" : "irisChat.smaller");
|
|
16
|
+
return /* @__PURE__ */ C(
|
|
17
|
+
h,
|
|
18
|
+
{
|
|
19
|
+
open: p,
|
|
20
|
+
onOpenChange: r,
|
|
21
|
+
openDelay: M,
|
|
22
|
+
closeDelay: E,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e("span", { className: g("inline-flex", m), children: /* @__PURE__ */ e(S, { label: i, children: /* @__PURE__ */ e(
|
|
25
|
+
_,
|
|
26
|
+
{
|
|
27
|
+
ref: l,
|
|
28
|
+
type: "button",
|
|
29
|
+
variant: "secondary",
|
|
30
|
+
size: "icon",
|
|
31
|
+
"aria-label": i,
|
|
32
|
+
"aria-pressed": n,
|
|
33
|
+
"data-component": "iris-chat-window-size-button",
|
|
34
|
+
className: "rounded-full text-content",
|
|
35
|
+
onClick: (d) => {
|
|
36
|
+
o.toggleWindowSize(), s?.(d);
|
|
37
|
+
},
|
|
38
|
+
...c,
|
|
39
|
+
children: /* @__PURE__ */ e(b, { size: 16 })
|
|
40
|
+
}
|
|
41
|
+
) }) }) }),
|
|
42
|
+
/* @__PURE__ */ e(u, { side: "bottom", align: "end", className: "w-[15rem] p-3", children: /* @__PURE__ */ e(w, { onPresetSelected: () => r(!1) }) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
37
46
|
});
|
|
38
47
|
export {
|
|
39
|
-
|
|
48
|
+
U as IrisChatHeaderWindowSizeButton
|
|
40
49
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IrisChatSnapPreset } from './iris-chat-snap-presets';
|
|
3
|
+
export declare function IrisChatSnapTile(props: {
|
|
4
|
+
label: string;
|
|
5
|
+
preset: IrisChatSnapPreset;
|
|
6
|
+
onSelect: (preset: IrisChatSnapPreset) => void;
|
|
7
|
+
previewClassName: string;
|
|
8
|
+
}): ReactElement;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
3
|
+
function l(e) {
|
|
4
|
+
return /* @__PURE__ */ a(
|
|
5
|
+
"button",
|
|
6
|
+
{
|
|
7
|
+
type: "button",
|
|
8
|
+
"data-testid": `iris-chat-snap-${e.preset}`,
|
|
9
|
+
"aria-label": e.label,
|
|
10
|
+
className: "flex flex-col items-center gap-1 rounded-lg p-1.5 text-content-secondary hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
11
|
+
onClick: () => e.onSelect(e.preset),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
"aria-hidden": !0,
|
|
17
|
+
className: n(
|
|
18
|
+
"box-border h-7 w-9 rounded border border-border bg-surface-elevated",
|
|
19
|
+
e.previewClassName
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: e.label })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
l as IrisChatSnapTile
|
|
30
|
+
};
|