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.
Files changed (31) hide show
  1. package/dist/components/data/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +88 -76
  2. package/dist/components/data/data-table/index.d.ts +1 -0
  3. package/dist/components/data/data-table/index.js +16 -14
  4. package/dist/components/data/data-table/use-data-table-viewport.d.ts +10 -0
  5. package/dist/components/data/data-table/use-data-table-viewport.js +31 -0
  6. package/dist/components/flows/iris-chat/IrisChatHeaderWindowSizeButton.js +45 -36
  7. package/dist/components/flows/iris-chat/IrisChatSnapTile.d.ts +8 -0
  8. package/dist/components/flows/iris-chat/IrisChatSnapTile.js +30 -0
  9. package/dist/components/flows/iris-chat/IrisChatWindowSnapMenu.js +67 -53
  10. package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +2 -1
  11. package/dist/components/flows/iris-chat/iris-chat-frame.js +40 -31
  12. package/dist/components/flows/iris-chat/iris-chat-snap-presets.d.ts +4 -1
  13. package/dist/components/flows/iris-chat/iris-chat-snap-presets.js +49 -29
  14. package/dist/components/flows/iris-chat/iris-chat-thread.js +95 -96
  15. package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +3 -0
  16. package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +5 -2
  17. package/dist/components/flows/iris-chat/use-iris-chat-root.js +83 -88
  18. package/dist/components/primitives/stepper/stepper.js +29 -28
  19. package/dist/components/primitives/stepper/stepper.types.d.ts +2 -0
  20. package/dist/i18n/defaultMessages.d.ts +5 -0
  21. package/dist/i18n/defaultMessages.js +7 -2
  22. package/dist/i18n/locales/de.js +5 -0
  23. package/dist/i18n/locales/es.js +5 -0
  24. package/dist/i18n/locales/hi.js +5 -0
  25. package/dist/i18n/locales/kn.js +5 -0
  26. package/dist/impact-nova-components.css +16 -6
  27. package/dist/impact-nova.css +1 -1
  28. package/dist/index.js +132 -130
  29. package/dist/llms/rules/installation.js +1 -1
  30. package/dist/llms/rules/requirements.js +1 -1
  31. package/package.json +1 -1
@@ -1,32 +1,33 @@
1
- import { jsx as c, jsxs as j } from "react/jsx-runtime";
2
- import { useMemo as b, useCallback as T } from "react";
3
- import { Badge as V } from "../../../data-display/badge/badge.js";
4
- import { evaluateValidationRules as I, getFieldValue as m, mapBadgeVariant as L, mapBadgeColor as U } from "./cell-renderer-utils.js";
5
- import { resolveGridIcon as H } from "./gridIconResolver.js";
6
- import { Tooltip as _, TooltipTrigger as z, TooltipContent as G } from "../../../feedback/tooltip/tooltip.js";
7
- const M = (e, n, r, a) => {
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((i) => {
11
- const o = new RegExp(`\\$\\{${i}\\}`, "g");
12
- t = t.replace(o, String(n[i] ?? ""));
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
- }, Q = ({
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 i = m(e.iconField, e.icon, n);
22
- if (typeof i == "string" ? t = H(i, { size: 16 }) : t = i, !t) return null;
23
- const o = m(e.backgroundColorField, e.backgroundColor, n), s = m(e.colorField, e.color, n) ?? "var(--color-foreground-icon)", f = m(e.tooltipField, e.tooltip, n), h = /* @__PURE__ */ c(
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": o,
29
- "--icon-fg": s,
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(_, { children: [
38
- /* @__PURE__ */ c(z, { asChild: !0, children: h }),
39
- /* @__PURE__ */ c(G, { variant: "tertiary", side: e.tooltipSide || "top", children: f })
40
- ] }) : h;
41
- }, q = ({
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 i = m(e.colorField, e.color, n), o = m(e.variantField, e.variant, n);
50
- return /* @__PURE__ */ c(
51
- V,
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: U(i),
55
- variant: L(o),
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
- }, A = (e) => {
61
+ }, Z = (e) => {
61
62
  const {
62
63
  value: n,
63
64
  data: r,
64
65
  node: a,
65
66
  colDef: t,
66
- onClick: i,
67
- redirectUrl: o,
68
- updateQueryParams: s,
67
+ onClick: o,
68
+ redirectUrl: i,
69
+ updateQueryParams: d,
69
70
  navigate: f,
70
- setSearchParams: h,
71
- rightSideContent: y,
72
- valueFormatter: k,
71
+ setSearchParams: g,
72
+ rightSideContent: k,
73
+ valueFormatter: h,
73
74
  disableOnPinnedRows: S = !0,
74
75
  disableLinkStyle: w,
75
- validationRules: $
76
- } = e, v = a.id ?? String(r?.id ?? ""), d = t?.field ?? "", R = r && typeof r == "object" && "_isPinned" in r && r._isPinned === !0, E = b(() => w || S && R || I($, r) ? !1 : !!(s || o || i), [w, S, R, s, o, i, $, r]), N = T(
77
- (u) => {
78
- if (u.stopPropagation(), s && h)
79
- h((l) => {
80
- const g = new URLSearchParams(l);
81
- return Object.entries(s).forEach(([x, C]) => {
82
- let p = String(C);
83
- p = p.replace(/\$\{value\}/g, String(n ?? "")), p = p.replace(/\$\{field\}/g, d), r && Object.keys(r).forEach((P) => {
84
- const O = new RegExp(`\\$\\{${P}\\}`, "g");
85
- p = p.replace(O, String(r[P] ?? ""));
86
- }), g.set(x, p);
87
- }), g;
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 (o && f) {
90
- const l = M(o, r, d, n);
91
+ else if (i && f) {
92
+ const l = W(i, r, u, n);
91
93
  f(l);
92
- } else i && i({ rowId: v, field: d, rowData: r ?? {}, value: n });
94
+ } else o && o({ rowId: y, field: u, rowData: r ?? {}, value: n });
93
95
  },
94
- [s, h, o, f, i, r, d, n, v]
95
- ), B = b(() => k ? k(n, r ?? {}) : String(n ?? ""), [n, k, r]), F = b(() => {
96
- if (!y?.items || y.items.length === 0) return null;
97
- const u = [];
98
- return y.items.forEach((l, g) => {
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
- u.push(
101
- /* @__PURE__ */ c(
102
- Q,
111
+ c.push(
112
+ /* @__PURE__ */ s(
113
+ X,
103
114
  {
104
115
  iconConfig: l.icon,
105
116
  rowData: r,
106
- rowId: v,
107
- field: d
117
+ rowId: y,
118
+ field: u
108
119
  },
109
- `icon-${g}`
120
+ `icon-${v}`
110
121
  )
111
122
  );
112
123
  else if (l.type === "badge" && l.badge)
113
- u.push(
114
- /* @__PURE__ */ c(
115
- q,
124
+ c.push(
125
+ /* @__PURE__ */ s(
126
+ Y,
116
127
  {
117
128
  badgeConfig: l.badge,
118
129
  rowData: r,
119
- rowId: v,
120
- field: d
130
+ rowId: y,
131
+ field: u
121
132
  },
122
- `badge-${g}`
133
+ `badge-${v}`
123
134
  )
124
135
  );
125
136
  else if (l.type === "dynamic" && l.dynamic) {
126
- const x = typeof l.dynamic == "function" ? l.dynamic(r ?? {}) : l.dynamic;
127
- u.push(/* @__PURE__ */ c("span", { children: x }, `dyn-${g}`));
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
- }), u.length > 0 ? u : null;
130
- }, [y, r, v, d]);
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__ */ c(
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 ? N : void 0,
137
- children: B
148
+ onClick: E ? B : void 0,
149
+ children: C
138
150
  }
139
151
  ),
140
- F && /* @__PURE__ */ c("div", { className: "flex items-center gap-1 flex-shrink-0", children: F })
152
+ F && /* @__PURE__ */ s("div", { className: "flex items-center gap-1 flex-shrink-0", children: F })
141
153
  ] });
142
154
  };
143
- A.displayName = "LinkCellRenderer";
155
+ Z.displayName = "LinkCellRenderer";
144
156
  export {
145
- A as LinkCellRenderer
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 S, rebuildColumnTreeCacheFromGrid as D, scheduleColumnRuntimeStateGuard as b } from "./column-runtime-state-guard.js";
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 x } from "./data-table-column-list.js";
5
- import { DataTableContext as h, DataTableSheetPortalStoreContext as s, useDataTable as C, useDataTableSheetPortal as _, useDataTableSheetPortalStore as E } from "./data-table-context.js";
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 I, DataTableSheetContent as g, DataTableSheetHeader as w, DataTableSheetTrigger as V } from "./data-table-sheet.js";
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
- x as DataTableColumnList,
23
+ d as DataTableColumnList,
23
24
  r as DataTableContent,
24
- h as DataTableContext,
25
+ s as DataTableContext,
25
26
  L as DataTableFormatOptions,
26
27
  q as DataTableSavedViews,
27
- I as DataTableSheet,
28
+ w as DataTableSheet,
28
29
  M as DataTableSheetBody,
29
- g as DataTableSheetContent,
30
- w as DataTableSheetHeader,
31
- s as DataTableSheetPortalStoreContext,
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
- V as DataTableSheetTrigger,
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
- S as isColumnRuntimeStateGuardUpdating,
49
+ D as isColumnRuntimeStateGuardUpdating,
49
50
  te as mergePartialOrderedColumnState,
50
- D as rebuildColumnTreeCacheFromGrid,
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 f, jsx as e } from "react/jsx-runtime";
2
- import * as C from "react";
3
- import { HoverCard as u, HoverCardTrigger as I, HoverCardContent as z } from "../../feedback/hover-card/hover-card.js";
4
- import { ButtonIconTooltip as g } from "../../feedback/tooltip/button-icon-tooltip.js";
5
- import { Button as w } from "../../primitives/button/button.js";
6
- import { useImpactNovaI18n as S } from "../../../i18n/use-impact-nova-i18n.js";
7
- import { createComponent as b } from "../../../lib/primitives/create-component.js";
8
- import { cn as v } from "../../../lib/utils.js";
9
- import { IrisChatWindowSnapMenu as x } from "./IrisChatWindowSnapMenu.js";
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 y } from "./iris-chat-icons.js";
12
- import { readIrisChatFrameIsLarge as B } from "./iris-chat-snap-presets.js";
13
- import { readIrisChatViewport as N } from "./iris-chat-frame.js";
14
- const q = b("IrisChatHeaderWindowSizeButton", ({ label: a, onClick: s, className: m, ...l }, c) => {
15
- const { t: o } = S(), r = H(), [p, t] = C.useState(!1), i = r.placement === "minimized", d = B(r.frame, N()), n = a ?? o(i || !d ? "irisChat.larger" : "irisChat.smaller");
16
- return /* @__PURE__ */ f(u, { open: p, onOpenChange: t, openDelay: 200, closeDelay: 100, children: [
17
- /* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e("span", { className: v("inline-flex", m), children: /* @__PURE__ */ e(g, { label: n, children: /* @__PURE__ */ e(
18
- w,
19
- {
20
- ref: c,
21
- type: "button",
22
- variant: "secondary",
23
- size: "icon",
24
- "aria-label": n,
25
- "aria-pressed": i,
26
- "data-component": "iris-chat-window-size-button",
27
- className: "rounded-full text-content",
28
- onClick: (h) => {
29
- r.toggleWindowSize(), s?.(h);
30
- },
31
- ...l,
32
- children: /* @__PURE__ */ e(y, { size: 16 })
33
- }
34
- ) }) }) }),
35
- /* @__PURE__ */ e(z, { side: "bottom", align: "end", className: "w-[15rem] p-3", children: /* @__PURE__ */ e(x, { onPresetSelected: () => t(!1) }) })
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
- q as IrisChatHeaderWindowSizeButton
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
+ };