impact-nova 2.5.22 → 2.6.0
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 +2 -0
- package/dist/components/data/ag-grid-react/headers/components/header-info.d.ts +9 -3
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +69 -61
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +8 -8
- package/dist/components/flows/guidance/guidance-layer.js +34 -31
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +29 -20
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +74 -28
- package/dist/components/flows/guidance/renderers/guidance-action-tap-icon.d.ts +5 -0
- package/dist/components/flows/guidance/renderers/guidance-action-tap-icon.js +68 -0
- package/dist/components/flows/guidance/renderers/guidance-announcement-surface.d.ts +5 -0
- package/dist/components/flows/guidance/renderers/guidance-announcement-surface.js +76 -0
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +43 -2
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +322 -99
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +3 -0
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +189 -148
- package/dist/components/flows/guidance/renderers/guidance-shortcut-display.d.ts +9 -0
- package/dist/components/flows/guidance/renderers/guidance-shortcut-display.js +36 -0
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.d.ts +2 -1
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +152 -89
- package/dist/i18n/defaultMessages.d.ts +6 -0
- package/dist/i18n/defaultMessages.js +13 -9
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/kn.js +4 -0
- package/dist/impact-nova-tokens.scss +22 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/guidance/engine/guidance-engine.d.ts +9 -0
- package/dist/lib/guidance/engine/guidance-engine.js +127 -65
- package/dist/lib/guidance/engine/manifest-validator.js +37 -30
- package/dist/lib/guidance/targets/target-resolver.d.ts +1 -1
- package/dist/lib/guidance/targets/target-resolver.js +32 -30
- package/dist/lib/guidance/types/guidance.types.d.ts +41 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +2 -1
|
@@ -57,6 +57,8 @@ export interface ExtendedHeaderComponentParams extends Partial<IHeaderParams> {
|
|
|
57
57
|
infoData?: InfoContent;
|
|
58
58
|
/** How to display the information (tooltip or modal) */
|
|
59
59
|
displayMode?: 'tooltip' | 'modal';
|
|
60
|
+
/** Guidance target ID for the info icon (for guided tours) */
|
|
61
|
+
infoIconGuidanceTargetId?: string;
|
|
60
62
|
}
|
|
61
63
|
export type SectionType = 'TEXT' | 'KEY_VALUE' | 'BADGES' | 'LINK';
|
|
62
64
|
export interface UISectionBase {
|
|
@@ -4,30 +4,36 @@ import { ExtendedHeaderComponentParams, InfoContent } from '../../ag-grid.types'
|
|
|
4
4
|
/**
|
|
5
5
|
* Info Icon Trigger - native button for grid header info actions.
|
|
6
6
|
*/
|
|
7
|
-
export declare const InfoIconTrigger: ({ onClick, className, label, }: {
|
|
7
|
+
export declare const InfoIconTrigger: ({ onClick, className, label, guidanceTargetId, }: {
|
|
8
8
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
9
|
className?: string;
|
|
10
10
|
label: string;
|
|
11
|
+
/** Guidance target ID for guided tours (renders as data-guidance-target) */
|
|
12
|
+
guidanceTargetId?: string;
|
|
11
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
/**
|
|
13
15
|
* Tooltip-only Info Trigger
|
|
14
16
|
*/
|
|
15
|
-
export declare const TooltipInfoTrigger: ({ content, className, onInfoClick, label, }: {
|
|
17
|
+
export declare const TooltipInfoTrigger: ({ content, className, onInfoClick, label, guidanceTargetId, }: {
|
|
16
18
|
content: string;
|
|
17
19
|
className?: string;
|
|
18
20
|
onInfoClick?: (e: React.MouseEvent) => void;
|
|
19
21
|
label: string;
|
|
22
|
+
/** Guidance target ID for guided tours */
|
|
23
|
+
guidanceTargetId?: string;
|
|
20
24
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
25
|
/**
|
|
22
26
|
* Modal-enabled Info Trigger
|
|
23
27
|
* Only this component allocates a useState hook.
|
|
24
28
|
*/
|
|
25
|
-
export declare const ModalInfoTrigger: ({ infoData, displayName, className, onInfoClick, label, }: {
|
|
29
|
+
export declare const ModalInfoTrigger: ({ infoData, displayName, className, onInfoClick, label, guidanceTargetId, }: {
|
|
26
30
|
infoData?: InfoContent;
|
|
27
31
|
displayName?: string;
|
|
28
32
|
className?: string;
|
|
29
33
|
onInfoClick?: (e: React.MouseEvent) => void;
|
|
30
34
|
label: string;
|
|
35
|
+
/** Guidance target ID for guided tours */
|
|
36
|
+
guidanceTargetId?: string;
|
|
31
37
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
38
|
type HeaderInfoProps = (CustomHeaderProps | IHeaderGroupParams) & ExtendedHeaderComponentParams & {
|
|
33
39
|
className?: string;
|
|
@@ -1,112 +1,120 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Info as
|
|
5
|
-
import { useImpactNovaI18n as
|
|
6
|
-
import { LazyTooltip as
|
|
7
|
-
import { InfoModal as
|
|
8
|
-
import { resolveHeaderInfoParams as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k } from "react";
|
|
3
|
+
import { cn as u } from "../../../../../lib/utils.js";
|
|
4
|
+
import { Info as b } from "impact-nova-icons";
|
|
5
|
+
import { useImpactNovaI18n as p } from "../../../../../i18n/use-impact-nova-i18n.js";
|
|
6
|
+
import { LazyTooltip as I } from "./lazy-tooltip.js";
|
|
7
|
+
import { InfoModal as C } from "./info-modal.js";
|
|
8
|
+
import { resolveHeaderInfoParams as y } from "../resolve-header-info-params.js";
|
|
9
|
+
const g = ({
|
|
10
10
|
onClick: o,
|
|
11
|
-
className:
|
|
12
|
-
label: t
|
|
11
|
+
className: e,
|
|
12
|
+
label: t,
|
|
13
|
+
guidanceTargetId: n
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
15
|
+
const a = (i) => {
|
|
16
|
+
i.stopPropagation(), o?.(i);
|
|
16
17
|
};
|
|
17
18
|
return /* @__PURE__ */ r(
|
|
18
19
|
"button",
|
|
19
20
|
{
|
|
20
21
|
type: "button",
|
|
21
22
|
"aria-label": t,
|
|
22
|
-
className:
|
|
23
|
+
className: u(
|
|
23
24
|
"cursor-pointer flex items-center justify-center shrink-0 w-6 h-6 rounded-md transition-all duration-200 text-content-tertiary hover:bg-canvas-muted active:bg-stroke-hairline",
|
|
24
|
-
|
|
25
|
+
e
|
|
25
26
|
),
|
|
26
|
-
onClick:
|
|
27
|
-
|
|
27
|
+
onClick: a,
|
|
28
|
+
...n && { "data-guidance-target": n },
|
|
29
|
+
children: /* @__PURE__ */ r(b, { size: 16, "aria-hidden": !0 })
|
|
28
30
|
}
|
|
29
31
|
);
|
|
30
|
-
},
|
|
32
|
+
}, T = ({
|
|
31
33
|
content: o,
|
|
32
|
-
className:
|
|
34
|
+
className: e,
|
|
33
35
|
onInfoClick: t,
|
|
34
|
-
label:
|
|
35
|
-
|
|
36
|
+
label: n,
|
|
37
|
+
guidanceTargetId: a
|
|
38
|
+
}) => /* @__PURE__ */ r(I, { content: o, children: /* @__PURE__ */ r(g, { onClick: t, className: e, label: n, guidanceTargetId: a }) }), x = ({
|
|
36
39
|
infoData: o,
|
|
37
|
-
displayName:
|
|
40
|
+
displayName: e,
|
|
38
41
|
className: t,
|
|
39
|
-
onInfoClick:
|
|
40
|
-
label: a
|
|
42
|
+
onInfoClick: n,
|
|
43
|
+
label: a,
|
|
44
|
+
guidanceTargetId: i
|
|
41
45
|
}) => {
|
|
42
|
-
const { t: f } =
|
|
43
|
-
l.stopPropagation(),
|
|
46
|
+
const { t: f } = p(), [s, d] = k(!1), c = o ?? (e ? { title: e, sections: [] } : void 0), m = (l) => {
|
|
47
|
+
l.stopPropagation(), c && d(!0);
|
|
44
48
|
};
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */ r(
|
|
47
|
-
|
|
49
|
+
return /* @__PURE__ */ h(v, { children: [
|
|
50
|
+
/* @__PURE__ */ r(I, { content: f("gridHeader.clickForDetails"), children: /* @__PURE__ */ r(
|
|
51
|
+
g,
|
|
48
52
|
{
|
|
49
53
|
label: a,
|
|
50
54
|
onClick: (l) => {
|
|
51
|
-
|
|
55
|
+
m(l), n && n(l);
|
|
52
56
|
},
|
|
53
|
-
className:
|
|
57
|
+
className: u(
|
|
54
58
|
"hover:bg-canvas-muted hover:shadow-sm hover:text-brand-variant-hover hover:-translate-y-0.5 active:scale-95",
|
|
55
59
|
t
|
|
56
|
-
)
|
|
60
|
+
),
|
|
61
|
+
guidanceTargetId: i
|
|
57
62
|
}
|
|
58
63
|
) }),
|
|
59
|
-
s &&
|
|
64
|
+
s && c && // Stop propagation to prevent the click from bubbling to the header group
|
|
60
65
|
// regardless of whether the modal is portaled or not.
|
|
61
66
|
/* @__PURE__ */ r("div", { onClick: (l) => l.stopPropagation(), children: /* @__PURE__ */ r(
|
|
62
|
-
|
|
67
|
+
C,
|
|
63
68
|
{
|
|
64
69
|
open: s,
|
|
65
|
-
onClose: () =>
|
|
66
|
-
data:
|
|
70
|
+
onClose: () => d(!1),
|
|
71
|
+
data: c
|
|
67
72
|
}
|
|
68
73
|
) })
|
|
69
74
|
] });
|
|
70
|
-
},
|
|
71
|
-
const
|
|
75
|
+
}, F = (o) => {
|
|
76
|
+
const e = y(o, o.displayName), {
|
|
72
77
|
showInfoIcon: t,
|
|
73
|
-
displayName:
|
|
74
|
-
} =
|
|
75
|
-
return !t || !
|
|
78
|
+
displayName: n
|
|
79
|
+
} = e;
|
|
80
|
+
return !t || !n || n.trim() === "" ? null : /* @__PURE__ */ r(N, { ...o, ...e });
|
|
76
81
|
};
|
|
77
82
|
function N(o) {
|
|
78
|
-
const { t:
|
|
83
|
+
const { t: e } = p(), {
|
|
79
84
|
displayName: t,
|
|
80
|
-
displayMode:
|
|
85
|
+
displayMode: n = "tooltip",
|
|
81
86
|
infoTooltip: a,
|
|
82
|
-
infoData:
|
|
83
|
-
className:
|
|
84
|
-
onInfoClick:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
infoData: i,
|
|
88
|
+
className: f,
|
|
89
|
+
onInfoClick: s,
|
|
90
|
+
infoIconGuidanceTargetId: d
|
|
91
|
+
} = o, c = () => {
|
|
92
|
+
s && s(o);
|
|
93
|
+
}, m = a ? `${t}: ${a}` : `${t} ${e("gridHeader.information")}`;
|
|
94
|
+
return n === "modal" ? /* @__PURE__ */ r(
|
|
89
95
|
x,
|
|
90
96
|
{
|
|
91
|
-
infoData:
|
|
97
|
+
infoData: i,
|
|
92
98
|
displayName: t,
|
|
93
|
-
className:
|
|
94
|
-
onInfoClick:
|
|
95
|
-
label:
|
|
99
|
+
className: f,
|
|
100
|
+
onInfoClick: c,
|
|
101
|
+
label: m,
|
|
102
|
+
guidanceTargetId: d
|
|
96
103
|
}
|
|
97
104
|
) : /* @__PURE__ */ r(
|
|
98
|
-
|
|
105
|
+
T,
|
|
99
106
|
{
|
|
100
107
|
content: a || `Info about ${t}`,
|
|
101
|
-
className:
|
|
102
|
-
onInfoClick:
|
|
103
|
-
label:
|
|
108
|
+
className: f,
|
|
109
|
+
onInfoClick: c,
|
|
110
|
+
label: m,
|
|
111
|
+
guidanceTargetId: d
|
|
104
112
|
}
|
|
105
113
|
);
|
|
106
114
|
}
|
|
107
115
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
116
|
+
F as HeaderInfo,
|
|
117
|
+
g as InfoIconTrigger,
|
|
110
118
|
x as ModalInfoTrigger,
|
|
111
|
-
|
|
119
|
+
T as TooltipInfoTrigger
|
|
112
120
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Dialog as
|
|
3
|
+
import { Dialog as m, DialogContent as s, DialogHeader as p, DialogTitle as g, DialogBody as f } from "../../../../feedback/dialog/dialog.js";
|
|
4
4
|
import { useImpactNovaI18n as h } from "../../../../../i18n/use-impact-nova-i18n.js";
|
|
5
5
|
import { SectionRenderer as x } from "./section-renderers.js";
|
|
6
|
-
const H = ({ open:
|
|
6
|
+
const H = ({ open: i, onClose: l, data: r }) => {
|
|
7
7
|
const { t: n } = h();
|
|
8
8
|
if (!r) return null;
|
|
9
|
-
const { title:
|
|
10
|
-
return /* @__PURE__ */ e(
|
|
11
|
-
/* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(g, { children:
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
t.map((o,
|
|
9
|
+
const { title: c, sections: t = [] } = r;
|
|
10
|
+
return /* @__PURE__ */ e(m, { open: i, onOpenChange: (o) => !o && l(), children: /* @__PURE__ */ a(s, { className: "max-w-2xl", "data-guidance-target": "guidance.info-modal", children: [
|
|
11
|
+
/* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(g, { children: c || n("gridHeader.information") }) }),
|
|
12
|
+
/* @__PURE__ */ a(f, { className: "space-y-6 py-8", children: [
|
|
13
|
+
t.map((o, d) => /* @__PURE__ */ e(x, { section: o }, `${o.type}-${d}`)),
|
|
14
14
|
t.length === 0 && /* @__PURE__ */ e("p", { className: "text-sm text-secondary-foreground text-center py-4", children: n("gridHeader.noInformationAvailable") })
|
|
15
15
|
] })
|
|
16
16
|
] }) });
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as a, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
3
|
import { useSyncExternalStore as c } from "react";
|
|
4
|
-
import { useGuidanceContext as
|
|
5
|
-
import { SpotlightRenderer as
|
|
4
|
+
import { useGuidanceContext as f } from "./guidance-context.js";
|
|
5
|
+
import { SpotlightRenderer as k } from "./renderers/spotlight-renderer.js";
|
|
6
6
|
import { CoachMarkRenderer as b } from "./renderers/coach-mark-renderer.js";
|
|
7
7
|
import { AnnouncementRenderer as h } from "./renderers/announcement-renderer.js";
|
|
8
|
-
import { endTourScrollSnapshot as
|
|
8
|
+
import { endTourScrollSnapshot as x } from "./renderers/guidance-renderer-shared.js";
|
|
9
9
|
import { Button as d } from "../../primitives/button/button.js";
|
|
10
|
-
function
|
|
11
|
-
const
|
|
10
|
+
function S(e, o) {
|
|
11
|
+
const t = {
|
|
12
12
|
instruction: e,
|
|
13
|
-
...
|
|
13
|
+
...o
|
|
14
14
|
};
|
|
15
15
|
switch (e.renderer) {
|
|
16
16
|
case "spotlight":
|
|
17
|
-
return /* @__PURE__ */ n(
|
|
17
|
+
return /* @__PURE__ */ n(k, { ...t });
|
|
18
18
|
case "coach-mark":
|
|
19
|
-
return /* @__PURE__ */ n(b, { ...
|
|
19
|
+
return /* @__PURE__ */ n(b, { ...t });
|
|
20
20
|
case "announcement":
|
|
21
|
-
return /* @__PURE__ */ n(h, { ...
|
|
21
|
+
return /* @__PURE__ */ n(h, { ...t });
|
|
22
22
|
default:
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function z() {
|
|
27
|
-
const { engine: e } =
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const { engine: e } = f();
|
|
28
|
+
r.useEffect(() => e.on("guideEnd", () => {
|
|
29
|
+
x();
|
|
30
30
|
}), [e]);
|
|
31
|
-
const
|
|
32
|
-
(
|
|
31
|
+
const o = c(
|
|
32
|
+
(s) => e.subscribe(s),
|
|
33
33
|
() => e.state,
|
|
34
34
|
() => ({ status: "idle" })
|
|
35
|
-
),
|
|
36
|
-
(
|
|
35
|
+
), t = c(
|
|
36
|
+
(s) => e.subscribe(s),
|
|
37
37
|
() => e.getRenderInstruction(),
|
|
38
38
|
() => null
|
|
39
|
-
), l =
|
|
39
|
+
), l = r.useCallback(() => {
|
|
40
40
|
e.advanceStep();
|
|
41
|
-
}, [e]), u =
|
|
41
|
+
}, [e]), u = r.useCallback(() => {
|
|
42
|
+
e.skipStep();
|
|
43
|
+
}, [e]), i = r.useCallback(() => {
|
|
42
44
|
e.dismiss("session");
|
|
43
|
-
}, [e]),
|
|
44
|
-
e.
|
|
45
|
-
}, [e]),
|
|
45
|
+
}, [e]), m = r.useCallback(() => {
|
|
46
|
+
e.goToPreviousStep();
|
|
47
|
+
}, [e]), p = r.useCallback(() => {
|
|
46
48
|
e.retryCurrentStep();
|
|
47
49
|
}, [e]);
|
|
48
|
-
return
|
|
50
|
+
return o.status === "blocked" ? /* @__PURE__ */ a(
|
|
49
51
|
"div",
|
|
50
52
|
{
|
|
51
53
|
"data-component": "guidance-blocked",
|
|
52
54
|
className: "fixed bottom-4 left-1/2 z-50 -translate-x-1/2 rounded-md border border-border-default bg-surface-elevated px-4 py-3 shadow-lg",
|
|
53
55
|
role: "status",
|
|
54
56
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ a("p", { className: "text-sm text-content-secondary", children: [
|
|
56
58
|
"Guide step is blocked: ",
|
|
57
|
-
|
|
59
|
+
o.reason
|
|
58
60
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ n(d, { size: "sm", onClick:
|
|
61
|
-
/* @__PURE__ */ n(d, { variant: "secondary", size: "sm", onClick:
|
|
61
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex gap-2", children: [
|
|
62
|
+
/* @__PURE__ */ n(d, { size: "sm", onClick: p, children: "Retry" }),
|
|
63
|
+
/* @__PURE__ */ n(d, { variant: "secondary", size: "sm", onClick: i, children: "Dismiss" })
|
|
62
64
|
] })
|
|
63
65
|
]
|
|
64
66
|
}
|
|
65
|
-
) :
|
|
67
|
+
) : t ? S(t, {
|
|
66
68
|
onNext: l,
|
|
67
69
|
onSkip: u,
|
|
68
|
-
onDismiss:
|
|
70
|
+
onDismiss: i,
|
|
71
|
+
onBack: m
|
|
69
72
|
}) : null;
|
|
70
73
|
}
|
|
71
74
|
export {
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { beginTourScrollSnapshot as
|
|
3
|
-
import { hasRunningAnimations as
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { beginTourScrollSnapshot as v, needsGuidanceTargetScroll as R, scrollGuidanceTargetIntoView as r, getVisibleTargetRect as p } from "../renderers/guidance-renderer-shared.js";
|
|
3
|
+
import { hasRunningAnimations as w } from "../utils/motion-settle.js";
|
|
4
|
+
function S(e, n) {
|
|
5
|
+
return e instanceof HTMLElement ? !!(e === n || e.contains(n) || n.contains(e)) : !1;
|
|
6
|
+
}
|
|
7
|
+
function z(e, n) {
|
|
8
|
+
const [m, t] = d.useState(null);
|
|
9
|
+
return d.useEffect(() => {
|
|
7
10
|
if (!e) {
|
|
8
11
|
t(null);
|
|
9
12
|
return;
|
|
10
13
|
}
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
+
let s = !1, o = 0;
|
|
15
|
+
const i = () => {
|
|
16
|
+
s || t(p(e));
|
|
14
17
|
}, c = () => {
|
|
15
|
-
|
|
18
|
+
i(), !s && w(e) && (o = requestAnimationFrame(c));
|
|
16
19
|
};
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
v(e), R(e) && r(e), i(), o = requestAnimationFrame(c);
|
|
21
|
+
const u = new ResizeObserver(() => {
|
|
22
|
+
r(e), i();
|
|
20
23
|
});
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
+
u.observe(e);
|
|
25
|
+
const a = () => {
|
|
26
|
+
r(e), i();
|
|
27
|
+
}, f = (l) => {
|
|
28
|
+
if (S(l.target, e)) {
|
|
29
|
+
i();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
r(e), i();
|
|
24
33
|
};
|
|
25
|
-
return window.addEventListener("resize",
|
|
26
|
-
|
|
34
|
+
return window.addEventListener("resize", a), document.addEventListener("scroll", f, !0), () => {
|
|
35
|
+
s = !0, cancelAnimationFrame(o), u.disconnect(), window.removeEventListener("resize", a), document.removeEventListener("scroll", f, !0);
|
|
27
36
|
};
|
|
28
|
-
}, [
|
|
37
|
+
}, [n, e]), m;
|
|
29
38
|
}
|
|
30
39
|
export {
|
|
31
|
-
|
|
40
|
+
z as useGuidanceOverlayGeometry
|
|
32
41
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RendererProps } from '../../../../lib/guidance';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export declare function AnnouncementRenderer({ instruction, onNext, onSkip, }: RendererProps): React.ReactElement;
|
|
3
|
+
export declare function AnnouncementRenderer({ instruction, onNext, onSkip, onDismiss, onBack, }: RendererProps): React.ReactElement;
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { Badge as m } from "../../../data-display/badge/badge.js";
|
|
4
|
+
import { Dialog as i, DialogContent as x } from "../../../feedback/dialog/dialog.js";
|
|
5
|
+
import { GuidanceStepProgressBar as b, GuidanceTourActionFooter as g, GuidanceTourProgressAndNav as h } from "./guidance-card-shared.js";
|
|
6
|
+
import { GuidanceAnnouncementSurface as v } from "./guidance-announcement-surface.js";
|
|
7
|
+
function k({
|
|
6
8
|
instruction: e,
|
|
7
|
-
onNext:
|
|
8
|
-
onSkip:
|
|
9
|
+
onNext: r,
|
|
10
|
+
onSkip: c,
|
|
11
|
+
onDismiss: p,
|
|
12
|
+
onBack: o
|
|
9
13
|
}) {
|
|
10
|
-
const
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
14
|
+
const s = e.stepIndex + 1 >= e.totalSteps, d = e.content.badge?.trim(), l = e.interactionFooter === "keybinding";
|
|
15
|
+
return /* @__PURE__ */ a(i, { open: !0, children: /* @__PURE__ */ a(
|
|
16
|
+
x,
|
|
13
17
|
{
|
|
14
18
|
"data-component": "guidance-announcement",
|
|
19
|
+
"data-guidance-modal-behavior": e.modalBehavior,
|
|
15
20
|
hideClose: !0,
|
|
16
|
-
className: "max-w-[400px] gap-0 overflow-hidden p-0 sm:rounded-2xl sm:shadow-elevation-floating",
|
|
17
|
-
"aria-
|
|
21
|
+
className: "max-w-[400px] gap-0 overflow-hidden border-0 bg-canvas p-0 sm:rounded-2xl sm:shadow-elevation-floating",
|
|
22
|
+
"aria-labelledby": `guidance-announcement-title-${e.stepId}`,
|
|
23
|
+
"aria-describedby": e.content.body ? `guidance-announcement-body-${e.stepId}` : void 0,
|
|
18
24
|
onPointerDownOutside: (t) => {
|
|
19
25
|
t.preventDefault();
|
|
20
26
|
},
|
|
@@ -24,25 +30,65 @@ function f({
|
|
|
24
30
|
onEscapeKeyDown: (t) => {
|
|
25
31
|
t.preventDefault();
|
|
26
32
|
},
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
children: /* @__PURE__ */ n("div", { className: "relative overflow-hidden rounded-2xl", children: [
|
|
34
|
+
/* @__PURE__ */ a(v, {}),
|
|
35
|
+
/* @__PURE__ */ n("div", { className: "relative z-10 flex flex-col items-center px-8 pb-0 pt-10 text-center", children: [
|
|
36
|
+
d ? /* @__PURE__ */ a(m, { variant: "subtle", color: "primary", shape: "circle", size: "sm", children: d }) : null,
|
|
37
|
+
/* @__PURE__ */ a(
|
|
38
|
+
"h2",
|
|
39
|
+
{
|
|
40
|
+
id: `guidance-announcement-title-${e.stepId}`,
|
|
41
|
+
className: "mt-3 text-2xl font-bold leading-8 text-content",
|
|
42
|
+
children: e.content.title
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
e.content.body ? /* @__PURE__ */ a(
|
|
46
|
+
"p",
|
|
47
|
+
{
|
|
48
|
+
id: `guidance-announcement-body-${e.stepId}`,
|
|
49
|
+
className: "mt-2 max-w-[22rem] text-sm leading-snug text-content-secondary",
|
|
50
|
+
children: e.content.body
|
|
51
|
+
}
|
|
52
|
+
) : null
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ a("div", { className: "relative z-10 px-8 pb-8 pt-6", children: l ? /* @__PURE__ */ n("div", { className: "flex w-full flex-col gap-3", children: [
|
|
55
|
+
/* @__PURE__ */ a(
|
|
56
|
+
b,
|
|
57
|
+
{
|
|
58
|
+
activeStepIndex: e.stepIndex,
|
|
59
|
+
totalSteps: e.totalSteps
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
|
+
g,
|
|
64
|
+
{
|
|
65
|
+
hint: e.content.footer ?? "Press the shortcut to continue.",
|
|
66
|
+
keybinding: e.content.keybinding,
|
|
67
|
+
activeStepIndex: e.stepIndex,
|
|
68
|
+
showBack: e.canGoBack,
|
|
69
|
+
onBack: o
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }) : /* @__PURE__ */ a(
|
|
73
|
+
h,
|
|
74
|
+
{
|
|
75
|
+
activeStepIndex: e.stepIndex,
|
|
76
|
+
totalSteps: e.totalSteps,
|
|
77
|
+
skippable: e.skippable,
|
|
78
|
+
showSkip: !1,
|
|
79
|
+
showBack: e.canGoBack,
|
|
80
|
+
onBack: o,
|
|
81
|
+
primaryActionLabel: s ? "Done" : "Next",
|
|
82
|
+
onSkip: c,
|
|
83
|
+
onPrimaryAction: r,
|
|
84
|
+
onEndTour: p,
|
|
85
|
+
showPrimaryAction: !l && e.advanceOn !== "auto"
|
|
86
|
+
}
|
|
87
|
+
) })
|
|
88
|
+
] })
|
|
43
89
|
}
|
|
44
90
|
) });
|
|
45
91
|
}
|
|
46
92
|
export {
|
|
47
|
-
|
|
93
|
+
k as AnnouncementRenderer
|
|
48
94
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as c, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn as r } from "../../../../lib/utils.js";
|
|
4
|
+
function s({
|
|
5
|
+
className: l
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ c(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
viewBox: "0 0 256 256",
|
|
13
|
+
className: r(
|
|
14
|
+
"size-4 min-h-4 min-w-4 max-h-4 max-w-4 shrink-0",
|
|
15
|
+
l
|
|
16
|
+
),
|
|
17
|
+
children: /* @__PURE__ */ h(
|
|
18
|
+
"g",
|
|
19
|
+
{
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
fillRule: "nonzero",
|
|
22
|
+
transform: "translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ c(
|
|
25
|
+
"path",
|
|
26
|
+
{
|
|
27
|
+
d: "M 69.416 43.298 H 68.97 c -0.983 0 -1.917 0.216 -2.756 0.603 c -0.644 -2.975 -3.295 -5.21 -6.459 -5.21 h -0.447 c -1.128 0 -2.19 0.284 -3.12 0.784 c -1 -2.379 -3.355 -4.054 -6.094 -4.054 h -0.447 c -0.925 0 -1.807 0.191 -2.606 0.536 v -9.458 c 0 -3.644 -2.964 -6.607 -6.608 -6.607 h -0.447 c -3.643 0 -6.607 2.964 -6.607 6.607 v 24.261 l -3.005 2.281 c -2.394 1.817 -3.911 4.461 -4.273 7.444 c -0.362 2.984 0.479 5.914 2.37 8.251 l 9.378 11.594 v 4.608 c 0 2.791 2.271 5.063 5.062 5.063 h 23.411 c 2.791 0 5.063 -2.271 5.063 -5.063 l 0.001 -4.375 c 2.996 -3.766 4.639 -8.438 4.639 -13.242 V 49.905 C 76.023 46.262 73.06 43.298 69.416 43.298 z M 72.023 67.32 c 0 4.102 -1.478 8.088 -4.159 11.224 c -0.311 0.362 -0.48 0.823 -0.48 1.3 v 5.094 c 0 0.586 -0.477 1.063 -1.063 1.063 H 42.911 c -0.585 0 -1.062 -0.477 -1.062 -1.063 v -5.316 c 0 -0.458 -0.157 -0.902 -0.445 -1.258 L 31.581 66.22 c -1.204 -1.488 -1.74 -3.354 -1.509 -5.254 c 0.23 -1.899 1.197 -3.583 2.721 -4.74 l 0.586 -0.444 v 5.495 c 0 1.104 0.896 2 2 2 s 2 -0.896 2 -2 v -9.506 c 0 -0.014 0 -0.026 0 -0.04 V 26.498 c 0 -1.438 1.169 -2.607 2.607 -2.607 h 0.447 c 1.438 0 2.607 1.17 2.607 2.607 v 15.53 c 0 0 0 0 0 0.001 s 0 0 0 0.001 l 0.01 12.917 c 0.001 1.104 0.896 1.998 2 1.998 c 0 0 0.001 0 0.001 0 c 1.104 -0.001 1.999 -0.896 1.998 -2.002 L 47.04 42.028 c 0 -1.438 1.169 -2.607 2.606 -2.607 h 0.447 c 1.438 0 2.607 1.17 2.607 2.607 v 3.27 c 0 0 0 0.001 0 0.001 c 0 0 0 0.001 0 0.001 l 0.009 9.647 c 0.001 1.104 0.896 1.998 2 1.998 c 0.001 0 0.001 0 0.002 0 c 1.104 -0.001 1.999 -0.897 1.998 -2.002 l -0.009 -9.646 c 0 -1.438 1.169 -2.607 2.606 -2.607 h 0.447 c 1.438 0 2.607 1.17 2.607 2.607 v 4.088 c -0.006 0.066 -0.02 0.13 -0.02 0.197 l 0.01 5.366 c 0.002 1.104 0.897 1.996 2 1.996 c 0.001 0 0.002 0 0.004 0 c 1.104 -0.002 1.998 -0.899 1.996 -2.004 l -0.009 -4.852 c 0.006 -0.062 0.019 -0.121 0.019 -0.184 c 0 -1.438 1.17 -2.607 2.607 -2.607 h 0.446 c 1.438 0 2.607 1.17 2.607 2.607 V 67.32 z"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ c(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
d: "M 63.994 25.511 H 51.79 c -1.104 0 -2 -0.896 -2 -2 s 0.896 -2 2 -2 h 12.204 c 1.104 0 2 0.896 2 2 S 65.099 25.511 63.994 25.511 z"
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ c(
|
|
37
|
+
"path",
|
|
38
|
+
{
|
|
39
|
+
d: "M 39.985 16.204 c -1.104 0 -2 -0.896 -2 -2 V 2 c 0 -1.104 0.896 -2 2 -2 s 2 0.896 2 2 v 12.204 C 41.985 15.309 41.09 16.204 39.985 16.204 z"
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ c(
|
|
43
|
+
"path",
|
|
44
|
+
{
|
|
45
|
+
d: "M 48.558 18.441 c -0.512 0 -1.023 -0.195 -1.414 -0.586 c -0.781 -0.781 -0.781 -2.047 0 -2.828 l 8.63 -8.629 c 0.781 -0.781 2.047 -0.781 2.828 0 c 0.781 0.781 0.781 2.047 0 2.828 l -8.63 8.629 C 49.581 18.246 49.069 18.441 48.558 18.441 z"
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ c(
|
|
49
|
+
"path",
|
|
50
|
+
{
|
|
51
|
+
d: "M 28.181 25.511 H 15.977 c -1.104 0 -2 -0.896 -2 -2 s 0.896 -2 2 -2 h 12.204 c 1.104 0 2 0.896 2 2 S 29.285 25.511 28.181 25.511 z"
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ c(
|
|
55
|
+
"path",
|
|
56
|
+
{
|
|
57
|
+
d: "M 31.413 18.441 c -0.512 0 -1.024 -0.195 -1.414 -0.586 L 21.37 9.226 c -0.781 -0.781 -0.781 -2.047 0 -2.828 c 0.78 -0.781 2.048 -0.781 2.828 0 l 8.629 8.629 c 0.781 0.781 0.781 2.047 0 2.828 C 32.437 18.246 31.925 18.441 31.413 18.441 z"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
s as GuidanceActionTapIcon
|
|
68
|
+
};
|