@storybook/addon-onboarding 10.1.0-alpha.12 → 10.1.0-alpha.14
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/_browser-chunks/{Onboarding-WWQZBI4C.js → Onboarding-4UKVZPT6.js} +346 -461
- package/dist/_browser-chunks/Survey-RTIK67MQ.js +35 -0
- package/dist/_browser-chunks/chunk-BTSM33XX.js +181 -0
- package/dist/_browser-chunks/chunk-VFOIHBP2.js +8 -0
- package/dist/manager.js +24 -22
- package/dist/preset.js +9 -9
- package/package.json +2 -2
- package/dist/_browser-chunks/chunk-BG2SBT4L.js +0 -7
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IntentSurvey
|
|
3
|
+
} from "./chunk-BTSM33XX.js";
|
|
1
4
|
import {
|
|
2
5
|
ADDON_CONTROLS_ID,
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
6
|
+
ADDON_ONBOARDING_CHANNEL
|
|
7
|
+
} from "./chunk-VFOIHBP2.js";
|
|
5
8
|
import {
|
|
6
9
|
__commonJS,
|
|
7
10
|
__toESM
|
|
@@ -43,8 +46,8 @@ var require_scroll = __commonJS({
|
|
|
43
46
|
// ../../node_modules/scrollparent/scrollparent.js
|
|
44
47
|
var require_scrollparent = __commonJS({
|
|
45
48
|
"../../node_modules/scrollparent/scrollparent.js"(exports, module) {
|
|
46
|
-
(function(
|
|
47
|
-
typeof define == "function" && define.amd ? define([], factory) : typeof module == "object" && module.exports ? module.exports = factory() :
|
|
49
|
+
(function(root2, factory) {
|
|
50
|
+
typeof define == "function" && define.amd ? define([], factory) : typeof module == "object" && module.exports ? module.exports = factory() : root2.Scrollparent = factory();
|
|
48
51
|
})(exports, function() {
|
|
49
52
|
function isScrolling(node) {
|
|
50
53
|
var overflow = getComputedStyle(node, null).getPropertyValue("overflow");
|
|
@@ -847,142 +850,78 @@ var require_prop_types = __commonJS({
|
|
|
847
850
|
});
|
|
848
851
|
|
|
849
852
|
// src/Onboarding.tsx
|
|
850
|
-
import
|
|
853
|
+
import React14, { useCallback as useCallback3, useEffect as useEffect5, useState as useState3 } from "react";
|
|
851
854
|
import { SyntaxHighlighter } from "storybook/internal/components";
|
|
852
855
|
import { SAVE_STORY_RESPONSE } from "storybook/internal/core-events";
|
|
853
|
-
import { ThemeProvider, convert, styled as
|
|
856
|
+
import { ThemeProvider as ThemeProvider2, convert as convert2, styled as styled4, themes as themes2 } from "storybook/theming";
|
|
854
857
|
|
|
855
|
-
// src/components/
|
|
856
|
-
import
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
function y(y2, z2 = {}) {
|
|
862
|
-
let { colors: A2 = a, duration: H2 = o, force: F2 = n, particleCount: O = i, particleShape: j = c, particleSize: E = s, particleClass: $ = l, destroyAfterDone: q = d, stageHeight: D = p, stageWidth: J = u } = z2;
|
|
863
|
-
(function(e2) {
|
|
864
|
-
if (document.querySelector("style[data-neoconfetti]")) return;
|
|
865
|
-
let t2 = W("style");
|
|
866
|
-
t2.dataset.neoconfetti = "", t2.textContent = e2, _(document.head, t2);
|
|
867
|
-
})(e), y2.classList.add(r), y2.style.setProperty("--sh", D + "px");
|
|
868
|
-
let I = [], G = [], K = () => P(b() * (N - 1)), Q = (e2, t2) => j !== "rectangles" && (e2 === "circles" || k(t2));
|
|
869
|
-
function R(e2, t2) {
|
|
870
|
-
let r2 = K(), a2 = Q(j, r2), o2 = (t3, r3) => e2.style.setProperty(t3, r3 + "");
|
|
871
|
-
o2("--xlp", C(x(L(t2, 90) - 180), 0, 180, -J / 2, J / 2) + "px"), o2("--dc", H2 - P(1e3 * b()) + "ms");
|
|
872
|
-
let n2 = b() < m ? w(b() * h, 2) : 0;
|
|
873
|
-
o2("--x1", n2), o2("--x2", -1 * n2), o2("--x3", n2), o2("--x4", w(x(C(x(L(t2, 90) - 180), 0, 180, -1, 1)), 4)), o2("--y1", w(b() * v, 4)), o2("--y2", w(b() * F2 * (M() ? 1 : -1), 4)), o2("--y3", v), o2("--y4", w(B(C(x(t2 - 180), 0, 180, F2, -F2), 0), 4)), o2("--w", (a2 ? E : P(4 * b()) + E / 2) + "px"), o2("--h", (a2 ? E : P(2 * b()) + E) + "px");
|
|
874
|
-
let i2 = r2.toString(2).padStart(3, "0").split("");
|
|
875
|
-
o2("--hr", i2.map(((e3) => +e3 / 2 + "")).join(" ")), o2("--r", i2.join(" ")), o2("--rd", w(b() * (g - f) + f) + "ms"), o2("--br", a2 ? "50%" : 0);
|
|
876
|
-
}
|
|
877
|
-
let U;
|
|
878
|
-
function V() {
|
|
879
|
-
y2.innerHTML = "", clearTimeout(U), I = S(O, A2), G = (function(e2, r2 = [], a2) {
|
|
880
|
-
let o2 = [];
|
|
881
|
-
for (let { color: n2 } of r2) {
|
|
882
|
-
let r3 = W("div");
|
|
883
|
-
r3.className = `${t} ${a2}`, r3.style.setProperty("--bgc", n2);
|
|
884
|
-
let i2 = W("div");
|
|
885
|
-
_(r3, i2), _(e2, r3), o2.push(r3);
|
|
886
|
-
}
|
|
887
|
-
return o2;
|
|
888
|
-
})(y2, I, $);
|
|
889
|
-
for (let [e2, t2] of T(G)) R(t2, I[+e2].degree);
|
|
890
|
-
U = setTimeout((() => {
|
|
891
|
-
q && (y2.innerHTML = "");
|
|
892
|
-
}), H2);
|
|
893
|
-
}
|
|
894
|
-
return V(), { update(e2) {
|
|
895
|
-
let r2 = e2.particleCount ?? i, f2 = e2.particleShape ?? c, g2 = e2.particleSize ?? s, m2 = e2.particleClass ?? l, h2 = e2.colors ?? a, v2 = e2.stageHeight ?? p, x2 = e2.duration ?? o, b2 = e2.force ?? n, P2 = e2.stageWidth ?? u, B2 = e2.destroyAfterDone ?? d;
|
|
896
|
-
I = S(r2, h2);
|
|
897
|
-
let W2 = !1;
|
|
898
|
-
if (r2 === O) {
|
|
899
|
-
G = Array.from(y2.querySelectorAll(`.${t}`));
|
|
900
|
-
for (let [e3, { color: t2 }] of T(I)) {
|
|
901
|
-
let r3 = G[+e3];
|
|
902
|
-
JSON.stringify(A2) !== JSON.stringify(h2) && r3.style.setProperty("--bgc", t2), f2 !== j && r3.style.setProperty("--br", Q(f2, K()) ? "50%" : "0"), m2 !== $ && ($ && r3.classList.remove($), m2 && r3.classList.add(m2));
|
|
903
|
-
}
|
|
904
|
-
} else W2 = !0;
|
|
905
|
-
q && !B2 && clearTimeout(U), y2.style.setProperty("--sh", v2 + "px"), H2 = x2, A2 = h2, F2 = b2, O = r2, j = f2, E = g2, $ = m2, q = B2, D = v2, J = P2, W2 && V();
|
|
906
|
-
}, destroy() {
|
|
907
|
-
y2.innerHTML = "", clearTimeout(U);
|
|
908
|
-
} };
|
|
909
|
-
}
|
|
910
|
-
var f = 200, g = 800, m = 0.1, h = 0.3, v = 0.5, x = Math.abs, b = Math.random, P = Math.round, B = Math.max, W = (e2) => document.createElement(e2), _ = (e2, t2) => e2.appendChild(t2), S = (e2, t2) => Array.from({ length: e2 }, ((r2, a2) => ({ color: t2[a2 % t2.length], degree: 360 * a2 / e2 }))), w = (e2, t2 = 2) => P((e2 + Number.EPSILON) * 10 ** t2) / 10 ** t2, C = (e2, t2, r2, a2, o2) => (e2 - t2) * (o2 - a2) / (r2 - t2) + a2, L = (e2, t2) => e2 + t2 > 360 ? e2 + t2 - 360 : e2 + t2, M = () => b() > 0.5, T = Object.entries, N = 6, k = (e2) => e2 !== 1 && M();
|
|
911
|
-
function F({ class: e2, ...t2 }) {
|
|
912
|
-
let r2 = H(null), a2 = H();
|
|
913
|
-
return A((() => {
|
|
914
|
-
if (typeof window < "u" && r2.current) {
|
|
915
|
-
if (a2.current) return a2.current.update(t2), a2.current.destroy;
|
|
916
|
-
a2.current = y(r2.current, t2);
|
|
858
|
+
// ../../core/src/manager/components/TourGuide/HighlightElement.tsx
|
|
859
|
+
import { useEffect } from "react";
|
|
860
|
+
var HIGHLIGHT_KEYFRAMES_ID = "storybook-highlight-element-keyframes", keyframes = `
|
|
861
|
+
@keyframes sb-highlight-pulsate {
|
|
862
|
+
0% {
|
|
863
|
+
box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0.7), 0 0 0 0 rgba(2, 156, 253, 0.4);
|
|
917
864
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
// src/components/Confetti/Confetti.tsx
|
|
922
|
-
import { styled } from "storybook/theming";
|
|
923
|
-
var Wrapper = styled.div({
|
|
924
|
-
zIndex: 9999,
|
|
925
|
-
position: "fixed",
|
|
926
|
-
top: 0,
|
|
927
|
-
left: "50%",
|
|
928
|
-
width: "50%",
|
|
929
|
-
height: "100%",
|
|
930
|
-
pointerEvents: "none"
|
|
931
|
-
}), Confetti = React.memo(function({
|
|
932
|
-
timeToFade = 5e3,
|
|
933
|
-
colors = ["#CA90FF", "#FC521F", "#66BF3C", "#FF4785", "#FFAE00", "#1EA7FD"],
|
|
934
|
-
...confettiProps
|
|
935
|
-
}) {
|
|
936
|
-
return React.createElement(Wrapper, null, React.createElement(
|
|
937
|
-
F,
|
|
938
|
-
{
|
|
939
|
-
colors,
|
|
940
|
-
particleCount: 200,
|
|
941
|
-
duration: 5e3,
|
|
942
|
-
stageHeight: window.innerHeight,
|
|
943
|
-
stageWidth: window.innerWidth,
|
|
944
|
-
destroyAfterDone: !0,
|
|
945
|
-
...confettiProps
|
|
865
|
+
50% {
|
|
866
|
+
box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 20px rgba(2, 156, 253, 0), 0 0 0 40px rgba(2, 156, 253, 0);
|
|
946
867
|
}
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
868
|
+
100% {
|
|
869
|
+
box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0), 0 0 0 0 rgba(2, 156, 253, 0);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
`, createOverlay = (element) => {
|
|
873
|
+
let overlay = document.createElement("div");
|
|
874
|
+
return overlay.id = "storybook-highlight-element", overlay.style.position = "fixed", overlay.style.pointerEvents = "none", overlay.style.zIndex = "2147483647", overlay.style.transition = "opacity 0.2s ease-in-out", requestAnimationFrame(() => {
|
|
875
|
+
updateOverlayStyles(element, overlay), element.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
876
|
+
}), overlay;
|
|
877
|
+
}, updateOverlayStyles = (element, overlay) => {
|
|
878
|
+
let rect = element.getBoundingClientRect(), computedStyle = window.getComputedStyle(element);
|
|
879
|
+
overlay.style.top = `${rect.top}px`, overlay.style.left = `${rect.left}px`, overlay.style.width = `${rect.width}px`, overlay.style.height = `${rect.height}px`, overlay.style.borderRadius = computedStyle.borderRadius;
|
|
880
|
+
}, findScrollableAncestors = (element) => {
|
|
881
|
+
let scrollableAncestors = [window], parent = element.parentElement;
|
|
882
|
+
for (; parent; ) {
|
|
883
|
+
let style = window.getComputedStyle(parent);
|
|
884
|
+
(style.overflow === "auto" || style.overflow === "scroll" || style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll") && scrollableAncestors.push(parent), parent = parent.parentElement;
|
|
885
|
+
}
|
|
886
|
+
return scrollableAncestors;
|
|
887
|
+
};
|
|
952
888
|
function HighlightElement({
|
|
953
889
|
targetSelector,
|
|
954
890
|
pulsating = !1
|
|
955
891
|
}) {
|
|
956
892
|
return useEffect(() => {
|
|
957
893
|
let element = document.querySelector(targetSelector);
|
|
958
|
-
if (element)
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
894
|
+
if (!element || !element.parentElement)
|
|
895
|
+
return;
|
|
896
|
+
let overlay = document.body.appendChild(createOverlay(element));
|
|
897
|
+
if (pulsating) {
|
|
898
|
+
if (!document.getElementById(HIGHLIGHT_KEYFRAMES_ID)) {
|
|
899
|
+
let style = document.createElement("style");
|
|
900
|
+
style.id = HIGHLIGHT_KEYFRAMES_ID, style.innerHTML = keyframes, document.head.appendChild(style);
|
|
901
|
+
}
|
|
902
|
+
overlay.style.animation = "sb-highlight-pulsate 3s infinite", overlay.style.transformOrigin = "center", overlay.style.animationTimingFunction = "ease-in-out";
|
|
903
|
+
} else
|
|
904
|
+
overlay.style.boxShadow = "rgba(2,156,253,1) 0 0 2px 1px";
|
|
905
|
+
let scrollTimeout = null, handleScroll = () => {
|
|
906
|
+
overlay.parentElement && overlay.remove(), scrollTimeout !== null && clearTimeout(scrollTimeout), scrollTimeout = window.setTimeout(() => {
|
|
907
|
+
element && (updateOverlayStyles(element, overlay), overlay.style.opacity = "0", document.body.appendChild(overlay), requestAnimationFrame(() => overlay.style.opacity = "1"));
|
|
908
|
+
}, 150);
|
|
909
|
+
}, resizeObserver = new ResizeObserver(
|
|
910
|
+
() => overlay.parentElement && updateOverlayStyles(element, overlay)
|
|
911
|
+
);
|
|
912
|
+
resizeObserver.observe(window.document.body), resizeObserver.observe(element);
|
|
913
|
+
let scrollContainers = findScrollableAncestors(element);
|
|
914
|
+
return scrollContainers.forEach(
|
|
915
|
+
(el) => el.addEventListener("scroll", handleScroll, { passive: !0 })
|
|
916
|
+
), scrollContainers.filter((el) => el !== window).forEach((el) => resizeObserver.observe(el)), () => {
|
|
917
|
+
scrollTimeout !== null && clearTimeout(scrollTimeout), overlay.parentElement && overlay.remove(), scrollContainers.forEach((el) => el.removeEventListener("scroll", handleScroll)), resizeObserver.disconnect();
|
|
980
918
|
};
|
|
981
919
|
}, [targetSelector, pulsating]), null;
|
|
982
920
|
}
|
|
983
921
|
|
|
984
|
-
// src/
|
|
985
|
-
import
|
|
922
|
+
// ../../core/src/manager/components/TourGuide/TourGuide.tsx
|
|
923
|
+
import React11, { useCallback, useEffect as useEffect3, useMemo, useRef, useState } from "react";
|
|
924
|
+
import { createRoot } from "react-dom/client";
|
|
986
925
|
|
|
987
926
|
// ../../node_modules/@babel/runtime/helpers/esm/extends.js
|
|
988
927
|
function _extends() {
|
|
@@ -1365,13 +1304,13 @@ function colorToInt(color2) {
|
|
|
1365
1304
|
function convertToInt(red, green, blue) {
|
|
1366
1305
|
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
1367
1306
|
}
|
|
1368
|
-
function hslToRgb(hue, saturation, lightness,
|
|
1369
|
-
if (
|
|
1370
|
-
return
|
|
1307
|
+
function hslToRgb(hue, saturation, lightness, convert3) {
|
|
1308
|
+
if (convert3 === void 0 && (convert3 = convertToInt), saturation === 0)
|
|
1309
|
+
return convert3(lightness, lightness, lightness);
|
|
1371
1310
|
var huePrime = (hue % 360 + 360) % 360 / 60, chroma = (1 - Math.abs(2 * lightness - 1)) * saturation, secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)), red = 0, green = 0, blue = 0;
|
|
1372
1311
|
huePrime >= 0 && huePrime < 1 ? (red = chroma, green = secondComponent) : huePrime >= 1 && huePrime < 2 ? (red = secondComponent, green = chroma) : huePrime >= 2 && huePrime < 3 ? (green = chroma, blue = secondComponent) : huePrime >= 3 && huePrime < 4 ? (green = secondComponent, blue = chroma) : huePrime >= 4 && huePrime < 5 ? (red = secondComponent, blue = chroma) : huePrime >= 5 && huePrime < 6 && (red = chroma, blue = secondComponent);
|
|
1373
1312
|
var lightnessModification = lightness - chroma / 2, finalRed = red + lightnessModification, finalGreen = green + lightnessModification, finalBlue = blue + lightnessModification;
|
|
1374
|
-
return
|
|
1313
|
+
return convert3(finalRed, finalGreen, finalBlue);
|
|
1375
1314
|
}
|
|
1376
1315
|
var namedColorMap = {
|
|
1377
1316
|
aliceblue: "f0f8ff",
|
|
@@ -2157,7 +2096,7 @@ import { cloneElement, isValidElement } from "react";
|
|
|
2157
2096
|
import { createPortal } from "react-dom";
|
|
2158
2097
|
var import_deepmerge2 = __toESM(require_cjs(), 1);
|
|
2159
2098
|
var import_deepmerge3 = __toESM(require_cjs(), 1);
|
|
2160
|
-
import * as
|
|
2099
|
+
import * as React2 from "react";
|
|
2161
2100
|
import * as React3 from "react";
|
|
2162
2101
|
import * as React32 from "react";
|
|
2163
2102
|
import * as ReactDOM2 from "react-dom";
|
|
@@ -2165,7 +2104,7 @@ import * as React8 from "react";
|
|
|
2165
2104
|
|
|
2166
2105
|
// ../../node_modules/react-floater/es/index.js
|
|
2167
2106
|
var import_prop_types = __toESM(require_prop_types());
|
|
2168
|
-
import
|
|
2107
|
+
import React from "react";
|
|
2169
2108
|
|
|
2170
2109
|
// ../../node_modules/popper.js/dist/esm/popper.js
|
|
2171
2110
|
var isBrowser = typeof window < "u" && typeof document < "u" && typeof navigator < "u", timeoutDuration = (function() {
|
|
@@ -4025,7 +3964,7 @@ var ReactFloaterPortal = (function(_React$Component) {
|
|
|
4025
3964
|
var _this$props2 = this.props, children = _this$props2.children, setRef = _this$props2.setRef;
|
|
4026
3965
|
if (this.node || this.appendNode(), isReact16)
|
|
4027
3966
|
return ReactDOM.createPortal(children, this.node);
|
|
4028
|
-
var portal = ReactDOM.unstable_renderSubtreeIntoContainer(this, children.length > 1 ?
|
|
3967
|
+
var portal = ReactDOM.unstable_renderSubtreeIntoContainer(this, children.length > 1 ? React.createElement("div", null, children) : children[0], this.node);
|
|
4029
3968
|
return setRef(portal), null;
|
|
4030
3969
|
} }, { key: "renderReact16", value: function() {
|
|
4031
3970
|
var _this$props3 = this.props, hasChildren = _this$props3.hasChildren, placement = _this$props3.placement, target = _this$props3.target;
|
|
@@ -4033,7 +3972,7 @@ var ReactFloaterPortal = (function(_React$Component) {
|
|
|
4033
3972
|
} }, { key: "render", value: function() {
|
|
4034
3973
|
return isReact16 ? this.renderReact16() : null;
|
|
4035
3974
|
} }]), ReactFloaterPortal2;
|
|
4036
|
-
})(
|
|
3975
|
+
})(React.Component);
|
|
4037
3976
|
_defineProperty(ReactFloaterPortal, "propTypes", { children: import_prop_types.default.oneOfType([import_prop_types.default.element, import_prop_types.default.array]), hasChildren: import_prop_types.default.bool, id: import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.number]), placement: import_prop_types.default.string, setRef: import_prop_types.default.func.isRequired, target: import_prop_types.default.oneOfType([import_prop_types.default.object, import_prop_types.default.string]), zIndex: import_prop_types.default.number });
|
|
4038
3977
|
var FloaterArrow = (function(_React$Component) {
|
|
4039
3978
|
_inherits(FloaterArrow2, _React$Component);
|
|
@@ -4046,19 +3985,19 @@ var FloaterArrow = (function(_React$Component) {
|
|
|
4046
3985
|
return placement.startsWith("top") ? (arrow2.bottom = 0, arrow2.left = 0, arrow2.right = 0, arrow2.height = length) : placement.startsWith("bottom") ? (arrow2.left = 0, arrow2.right = 0, arrow2.top = 0, arrow2.height = length) : placement.startsWith("left") ? (arrow2.right = 0, arrow2.top = 0, arrow2.bottom = 0) : placement.startsWith("right") && (arrow2.left = 0, arrow2.top = 0), arrow2;
|
|
4047
3986
|
} }, { key: "render", value: function() {
|
|
4048
3987
|
var _this$props2 = this.props, placement = _this$props2.placement, setArrowRef = _this$props2.setArrowRef, styles = _this$props2.styles, _styles$arrow = styles.arrow, color2 = _styles$arrow.color, display = _styles$arrow.display, length = _styles$arrow.length, margin = _styles$arrow.margin, position = _styles$arrow.position, spread = _styles$arrow.spread, arrowStyles = { display, position }, points, x2 = spread, y2 = length;
|
|
4049
|
-
return placement.startsWith("top") ? (points = "0,0 ".concat(x2 / 2, ",").concat(y2, " ").concat(x2, ",0"), arrowStyles.bottom = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("bottom") ? (points = "".concat(x2, ",").concat(y2, " ").concat(x2 / 2, ",0 0,").concat(y2), arrowStyles.top = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("left") ? (y2 = spread, x2 = length, points = "0,0 ".concat(x2, ",").concat(y2 / 2, " 0,").concat(y2), arrowStyles.right = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin) : placement.startsWith("right") && (y2 = spread, x2 = length, points = "".concat(x2, ",").concat(y2, " ").concat(x2, ",0 0,").concat(y2 / 2), arrowStyles.left = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin),
|
|
3988
|
+
return placement.startsWith("top") ? (points = "0,0 ".concat(x2 / 2, ",").concat(y2, " ").concat(x2, ",0"), arrowStyles.bottom = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("bottom") ? (points = "".concat(x2, ",").concat(y2, " ").concat(x2 / 2, ",0 0,").concat(y2), arrowStyles.top = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("left") ? (y2 = spread, x2 = length, points = "0,0 ".concat(x2, ",").concat(y2 / 2, " 0,").concat(y2), arrowStyles.right = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin) : placement.startsWith("right") && (y2 = spread, x2 = length, points = "".concat(x2, ",").concat(y2, " ").concat(x2, ",0 0,").concat(y2 / 2), arrowStyles.left = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin), React.createElement("div", { className: "__floater__arrow", style: this.parentStyle }, React.createElement("span", { ref: setArrowRef, style: arrowStyles }, React.createElement("svg", { width: x2, height: y2, version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, React.createElement("polygon", { points, fill: color2 }))));
|
|
4050
3989
|
} }]), FloaterArrow2;
|
|
4051
|
-
})(
|
|
3990
|
+
})(React.Component);
|
|
4052
3991
|
_defineProperty(FloaterArrow, "propTypes", { placement: import_prop_types.default.string.isRequired, setArrowRef: import_prop_types.default.func.isRequired, styles: import_prop_types.default.object.isRequired });
|
|
4053
3992
|
var _excluded$1 = ["color", "height", "width"];
|
|
4054
3993
|
function FloaterCloseBtn(_ref) {
|
|
4055
3994
|
var handleClick = _ref.handleClick, styles = _ref.styles, color2 = styles.color, height = styles.height, width = styles.width, style = _objectWithoutProperties(styles, _excluded$1);
|
|
4056
|
-
return
|
|
3995
|
+
return React.createElement("button", { "aria-label": "close", onClick: handleClick, style, type: "button" }, React.createElement("svg", { width: "".concat(width, "px"), height: "".concat(height, "px"), viewBox: "0 0 18 18", version: "1.1", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid" }, React.createElement("g", null, React.createElement("path", { d: "M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z", fill: color2 }))));
|
|
4057
3996
|
}
|
|
4058
3997
|
FloaterCloseBtn.propTypes = { handleClick: import_prop_types.default.func.isRequired, styles: import_prop_types.default.object.isRequired };
|
|
4059
3998
|
function FloaterContainer(_ref) {
|
|
4060
|
-
var content = _ref.content, footer = _ref.footer, handleClick = _ref.handleClick, open = _ref.open, positionWrapper = _ref.positionWrapper, showCloseButton = _ref.showCloseButton, title = _ref.title, styles = _ref.styles, output = { content:
|
|
4061
|
-
return title && (output.title =
|
|
3999
|
+
var content = _ref.content, footer = _ref.footer, handleClick = _ref.handleClick, open = _ref.open, positionWrapper = _ref.positionWrapper, showCloseButton = _ref.showCloseButton, title = _ref.title, styles = _ref.styles, output = { content: React.isValidElement(content) ? content : React.createElement("div", { className: "__floater__content", style: styles.content }, content) };
|
|
4000
|
+
return title && (output.title = React.isValidElement(title) ? title : React.createElement("div", { className: "__floater__title", style: styles.title }, title)), footer && (output.footer = React.isValidElement(footer) ? footer : React.createElement("div", { className: "__floater__footer", style: styles.footer }, footer)), (showCloseButton || positionWrapper) && !esm_default.boolean(open) && (output.close = React.createElement(FloaterCloseBtn, { styles: styles.close, handleClick })), React.createElement("div", { className: "__floater__container", style: styles.container }, output.close, output.title, output.content, output.footer);
|
|
4062
4001
|
}
|
|
4063
4002
|
FloaterContainer.propTypes = { content: import_prop_types.default.node.isRequired, footer: import_prop_types.default.node, handleClick: import_prop_types.default.func.isRequired, open: import_prop_types.default.bool, positionWrapper: import_prop_types.default.bool.isRequired, showCloseButton: import_prop_types.default.bool.isRequired, styles: import_prop_types.default.object.isRequired, title: import_prop_types.default.node };
|
|
4064
4003
|
var Floater = (function(_React$Component) {
|
|
@@ -4072,9 +4011,9 @@ var Floater = (function(_React$Component) {
|
|
|
4072
4011
|
return hideArrow || (placement.startsWith("top") ? element.padding = "0 0 ".concat(length, "px") : placement.startsWith("bottom") ? element.padding = "".concat(length, "px 0 0") : placement.startsWith("left") ? element.padding = "0 ".concat(length, "px 0 0") : placement.startsWith("right") && (element.padding = "0 0 0 ".concat(length, "px"))), [STATUS.OPENING, STATUS.OPEN].indexOf(status) !== -1 && (element = _objectSpread2(_objectSpread2({}, element), floaterOpening)), status === STATUS.CLOSING && (element = _objectSpread2(_objectSpread2({}, element), floaterClosing)), status === STATUS.OPEN && !disableAnimation && (element = _objectSpread2(_objectSpread2({}, element), floaterWithAnimation)), placement === "center" && (element = _objectSpread2(_objectSpread2({}, element), floaterCentered)), component && (element = _objectSpread2(_objectSpread2({}, element), floaterWithComponent)), _objectSpread2(_objectSpread2({}, floater), element);
|
|
4073
4012
|
} }, { key: "render", value: function() {
|
|
4074
4013
|
var _this$props2 = this.props, component = _this$props2.component, closeFn = _this$props2.handleClick, hideArrow = _this$props2.hideArrow, setFloaterRef = _this$props2.setFloaterRef, status = _this$props2.status, output = {}, classes = ["__floater"];
|
|
4075
|
-
return component ?
|
|
4014
|
+
return component ? React.isValidElement(component) ? output.content = React.cloneElement(component, { closeFn }) : output.content = component({ closeFn }) : output.content = React.createElement(FloaterContainer, this.props), status === STATUS.OPEN && classes.push("__floater__open"), hideArrow || (output.arrow = React.createElement(FloaterArrow, this.props)), React.createElement("div", { ref: setFloaterRef, className: classes.join(" "), style: this.style }, React.createElement("div", { className: "__floater__body" }, output.content, output.arrow));
|
|
4076
4015
|
} }]), Floater2;
|
|
4077
|
-
})(
|
|
4016
|
+
})(React.Component);
|
|
4078
4017
|
_defineProperty(Floater, "propTypes", { component: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.element]), content: import_prop_types.default.node, disableAnimation: import_prop_types.default.bool.isRequired, footer: import_prop_types.default.node, handleClick: import_prop_types.default.func.isRequired, hideArrow: import_prop_types.default.bool.isRequired, open: import_prop_types.default.bool, placement: import_prop_types.default.string.isRequired, positionWrapper: import_prop_types.default.bool.isRequired, setArrowRef: import_prop_types.default.func.isRequired, setFloaterRef: import_prop_types.default.func.isRequired, showCloseButton: import_prop_types.default.bool, status: import_prop_types.default.string.isRequired, styles: import_prop_types.default.object.isRequired, title: import_prop_types.default.node });
|
|
4079
4018
|
var ReactFloaterWrapper = (function(_React$Component) {
|
|
4080
4019
|
_inherits(ReactFloaterWrapper2, _React$Component);
|
|
@@ -4085,18 +4024,18 @@ var ReactFloaterWrapper = (function(_React$Component) {
|
|
|
4085
4024
|
return _createClass(ReactFloaterWrapper2, [{ key: "render", value: function() {
|
|
4086
4025
|
var _this$props = this.props, children = _this$props.children, handleClick = _this$props.handleClick, handleMouseEnter = _this$props.handleMouseEnter, handleMouseLeave = _this$props.handleMouseLeave, setChildRef = _this$props.setChildRef, setWrapperRef = _this$props.setWrapperRef, style = _this$props.style, styles = _this$props.styles, element;
|
|
4087
4026
|
if (children)
|
|
4088
|
-
if (
|
|
4089
|
-
if (!
|
|
4090
|
-
element =
|
|
4027
|
+
if (React.Children.count(children) === 1)
|
|
4028
|
+
if (!React.isValidElement(children))
|
|
4029
|
+
element = React.createElement("span", null, children);
|
|
4091
4030
|
else {
|
|
4092
4031
|
var refProp = esm_default.function(children.type) ? "innerRef" : "ref";
|
|
4093
|
-
element =
|
|
4032
|
+
element = React.cloneElement(React.Children.only(children), _defineProperty({}, refProp, setChildRef));
|
|
4094
4033
|
}
|
|
4095
4034
|
else
|
|
4096
4035
|
element = children;
|
|
4097
|
-
return element ?
|
|
4036
|
+
return element ? React.createElement("span", { ref: setWrapperRef, style: _objectSpread2(_objectSpread2({}, styles), style), onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, element) : null;
|
|
4098
4037
|
} }]), ReactFloaterWrapper2;
|
|
4099
|
-
})(
|
|
4038
|
+
})(React.Component);
|
|
4100
4039
|
_defineProperty(ReactFloaterWrapper, "propTypes", { children: import_prop_types.default.node, handleClick: import_prop_types.default.func.isRequired, handleMouseEnter: import_prop_types.default.func.isRequired, handleMouseLeave: import_prop_types.default.func.isRequired, setChildRef: import_prop_types.default.func.isRequired, setWrapperRef: import_prop_types.default.func.isRequired, style: import_prop_types.default.object, styles: import_prop_types.default.object.isRequired });
|
|
4101
4040
|
var defaultOptions = { zIndex: 100 };
|
|
4102
4041
|
function getStyles(styles) {
|
|
@@ -4230,10 +4169,10 @@ var _excluded = ["arrow", "flip", "offset"], POSITIONING_PROPS = ["position", "t
|
|
|
4230
4169
|
var target = this.props.target;
|
|
4231
4170
|
return target ? esm_default.domElement(target) ? target : document.querySelector(target) : this.childRef || this.wrapperRef;
|
|
4232
4171
|
} }, { key: "render", value: function() {
|
|
4233
|
-
var _this$state4 = this.state, currentPlacement = _this$state4.currentPlacement, positionWrapper = _this$state4.positionWrapper, status = _this$state4.status, _this$props9 = this.props, children = _this$props9.children, component = _this$props9.component, content = _this$props9.content, disableAnimation = _this$props9.disableAnimation, footer = _this$props9.footer, hideArrow = _this$props9.hideArrow, id = _this$props9.id, open = _this$props9.open, showCloseButton = _this$props9.showCloseButton, style = _this$props9.style, target = _this$props9.target, title = _this$props9.title, wrapper =
|
|
4234
|
-
return positionWrapper ? output.wrapperInPortal = wrapper : output.wrapperAsChildren = wrapper,
|
|
4172
|
+
var _this$state4 = this.state, currentPlacement = _this$state4.currentPlacement, positionWrapper = _this$state4.positionWrapper, status = _this$state4.status, _this$props9 = this.props, children = _this$props9.children, component = _this$props9.component, content = _this$props9.content, disableAnimation = _this$props9.disableAnimation, footer = _this$props9.footer, hideArrow = _this$props9.hideArrow, id = _this$props9.id, open = _this$props9.open, showCloseButton = _this$props9.showCloseButton, style = _this$props9.style, target = _this$props9.target, title = _this$props9.title, wrapper = React.createElement(ReactFloaterWrapper, { handleClick: this.handleClick, handleMouseEnter: this.handleMouseEnter, handleMouseLeave: this.handleMouseLeave, setChildRef: this.setChildRef, setWrapperRef: this.setWrapperRef, style, styles: this.styles.wrapper }, children), output = {};
|
|
4173
|
+
return positionWrapper ? output.wrapperInPortal = wrapper : output.wrapperAsChildren = wrapper, React.createElement("span", null, React.createElement(ReactFloaterPortal, { hasChildren: !!children, id, placement: currentPlacement, setRef: this.setFloaterRef, target, zIndex: this.styles.options.zIndex }, React.createElement(Floater, { component, content, disableAnimation, footer, handleClick: this.handleClick, hideArrow: hideArrow || currentPlacement === "center", open, placement: currentPlacement, positionWrapper, setArrowRef: this.setArrowRef, setFloaterRef: this.setFloaterRef, showCloseButton, status, styles: this.styles, title }), output.wrapperInPortal), output.wrapperAsChildren);
|
|
4235
4174
|
} }]), ReactFloater2;
|
|
4236
|
-
})(
|
|
4175
|
+
})(React.Component);
|
|
4237
4176
|
_defineProperty(ReactFloater, "propTypes", { autoOpen: import_prop_types.default.bool, callback: import_prop_types.default.func, children: import_prop_types.default.node, component: isRequiredIf(import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.element]), function(props) {
|
|
4238
4177
|
return !props.content;
|
|
4239
4178
|
}), content: isRequiredIf(import_prop_types.default.node, function(props) {
|
|
@@ -4948,7 +4887,7 @@ function JoyrideSpotlight({ styles }) {
|
|
|
4948
4887
|
}
|
|
4949
4888
|
);
|
|
4950
4889
|
}
|
|
4951
|
-
var Spotlight_default = JoyrideSpotlight, JoyrideOverlay = class extends
|
|
4890
|
+
var Spotlight_default = JoyrideSpotlight, JoyrideOverlay = class extends React2.Component {
|
|
4952
4891
|
constructor() {
|
|
4953
4892
|
super(...arguments), __publicField(this, "isActive", !1), __publicField(this, "resizeTimeout"), __publicField(this, "scrollTimeout"), __publicField(this, "scrollParent"), __publicField(this, "state", {
|
|
4954
4893
|
isScrolling: !1,
|
|
@@ -5040,12 +4979,12 @@ var Spotlight_default = JoyrideSpotlight, JoyrideOverlay = class extends React22
|
|
|
5040
4979
|
let { showSpotlight } = this.state, { onClickOverlay, placement } = this.props, { hideSpotlight, overlayStyles, spotlightStyles } = this;
|
|
5041
4980
|
if (hideSpotlight())
|
|
5042
4981
|
return null;
|
|
5043
|
-
let spotlight2 = placement !== "center" && showSpotlight &&
|
|
4982
|
+
let spotlight2 = placement !== "center" && showSpotlight && React2.createElement(Spotlight_default, { styles: spotlightStyles });
|
|
5044
4983
|
if (getBrowser() === "safari") {
|
|
5045
4984
|
let { mixBlendMode, zIndex, ...safariOverlay } = overlayStyles;
|
|
5046
|
-
spotlight2 =
|
|
4985
|
+
spotlight2 = React2.createElement("div", { style: { ...safariOverlay } }, spotlight2), delete overlayStyles.backgroundColor;
|
|
5047
4986
|
}
|
|
5048
|
-
return
|
|
4987
|
+
return React2.createElement(
|
|
5049
4988
|
"div",
|
|
5050
4989
|
{
|
|
5051
4990
|
className: "react-joyride__overlay",
|
|
@@ -5698,87 +5637,57 @@ var Container_default = JoyrideTooltipContainer, JoyrideTooltip = class extends
|
|
|
5698
5637
|
__publicField(Joyride, "defaultProps", defaultProps);
|
|
5699
5638
|
var components_default = Joyride;
|
|
5700
5639
|
|
|
5701
|
-
// src/
|
|
5640
|
+
// ../../core/src/manager/components/TourGuide/TourGuide.tsx
|
|
5702
5641
|
import { useTheme } from "storybook/theming";
|
|
5642
|
+
import { ThemeProvider, convert, themes } from "storybook/theming";
|
|
5703
5643
|
|
|
5704
|
-
// src/
|
|
5705
|
-
import
|
|
5706
|
-
import { Button
|
|
5644
|
+
// ../../core/src/manager/components/TourGuide/TourTooltip.tsx
|
|
5645
|
+
import React10, { useEffect as useEffect2 } from "react";
|
|
5646
|
+
import { Button } from "storybook/internal/components";
|
|
5707
5647
|
import { CloseAltIcon } from "@storybook/icons";
|
|
5708
|
-
import { color, styled
|
|
5709
|
-
|
|
5710
|
-
// src/components/Button/Button.tsx
|
|
5711
|
-
import React10, { forwardRef } from "react";
|
|
5712
|
-
import { styled as styled2 } from "storybook/theming";
|
|
5713
|
-
var StyledButton = styled2.button(({ theme: theme2, variant }) => ({
|
|
5714
|
-
all: "unset",
|
|
5715
|
-
boxSizing: "border-box",
|
|
5716
|
-
border: 0,
|
|
5717
|
-
borderRadius: "4px",
|
|
5718
|
-
cursor: "pointer",
|
|
5719
|
-
display: "inline-flex",
|
|
5720
|
-
alignItems: "center",
|
|
5721
|
-
justifyContent: "center",
|
|
5722
|
-
padding: "0 0.75rem",
|
|
5723
|
-
background: variant === "secondary" ? theme2.button.background : variant === "outline" ? "transparent" : variant === "white" ? theme2.color.lightest : theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary),
|
|
5724
|
-
color: variant === "secondary" || variant === "outline" ? theme2.color.defaultText : variant === "white" ? theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary) : theme2.color.lightest,
|
|
5725
|
-
boxShadow: variant === "secondary" ? `${theme2.button.border} 0 0 0 1px inset` : variant === "outline" ? `${theme2.button.border} 0 0 0 1px inset` : "none",
|
|
5726
|
-
height: "32px",
|
|
5727
|
-
fontSize: "0.8125rem",
|
|
5728
|
-
fontWeight: "700",
|
|
5729
|
-
fontFamily: theme2.typography.fonts.base,
|
|
5730
|
-
transition: "background-color, box-shadow, color, opacity",
|
|
5731
|
-
transitionDuration: "0.16s",
|
|
5732
|
-
transitionTimingFunction: "ease-in-out",
|
|
5733
|
-
textDecoration: "none",
|
|
5734
|
-
"&:hover, &:focus": {
|
|
5735
|
-
background: variant === "secondary" || variant === "outline" ? curriedTransparentize$1(0.93, theme2.color.secondary) : variant === "white" ? curriedTransparentize$1(0.1, theme2.color.lightest) : theme2.base === "light" ? curriedLighten$1(0.1, theme2.color.secondary) : curriedDarken$1(0.3, theme2.color.secondary),
|
|
5736
|
-
color: variant === "secondary" || variant === "outline" ? theme2.barSelectedColor : variant === "white" ? theme2.base === "light" ? curriedLighten$1(0.1, theme2.color.secondary) : curriedDarken$1(0.3, theme2.color.secondary) : theme2.color.lightest,
|
|
5737
|
-
boxShadow: variant === "secondary" || variant === "outline" || variant === "white" ? `inset 0 0 0 1px ${theme2.barSelectedColor}` : "none"
|
|
5738
|
-
},
|
|
5739
|
-
"&:focus-visible": {
|
|
5740
|
-
outline: `solid ${theme2.color.secondary}`,
|
|
5741
|
-
outlineOffset: "2px",
|
|
5742
|
-
outlineWidth: "2px"
|
|
5743
|
-
}
|
|
5744
|
-
})), Button = forwardRef(function({ children, onClick, variant = "primary", ...rest }, ref) {
|
|
5745
|
-
return React10.createElement(StyledButton, { ref, onClick, variant, ...rest }, children);
|
|
5746
|
-
});
|
|
5747
|
-
|
|
5748
|
-
// src/features/GuidedTour/Tooltip.tsx
|
|
5749
|
-
var TooltipBody = styled3.div`
|
|
5648
|
+
import { color, styled } from "storybook/theming";
|
|
5649
|
+
var ONBOARDING_ARROW_STYLE_ID = "storybook-onboarding-arrow-style", TooltipBody = styled.div`
|
|
5750
5650
|
padding: 15px;
|
|
5751
5651
|
border-radius: 5px;
|
|
5752
|
-
`,
|
|
5652
|
+
`, Wrapper = styled.div`
|
|
5753
5653
|
display: flex;
|
|
5754
5654
|
flex-direction: column;
|
|
5755
5655
|
align-items: flex-start;
|
|
5756
|
-
`, TooltipHeader =
|
|
5656
|
+
`, TooltipHeader = styled.div`
|
|
5757
5657
|
display: flex;
|
|
5758
5658
|
align-items: center;
|
|
5759
5659
|
align-self: stretch;
|
|
5760
5660
|
justify-content: space-between;
|
|
5761
5661
|
margin: -5px -5px 5px 0;
|
|
5762
|
-
`, TooltipTitle =
|
|
5662
|
+
`, TooltipTitle = styled.div`
|
|
5763
5663
|
line-height: 18px;
|
|
5764
5664
|
font-weight: 700;
|
|
5765
5665
|
font-size: 14px;
|
|
5766
5666
|
margin: 5px 5px 5px 0;
|
|
5767
|
-
`, TooltipContent =
|
|
5667
|
+
`, TooltipContent = styled.p`
|
|
5768
5668
|
font-size: 14px;
|
|
5769
5669
|
line-height: 18px;
|
|
5770
5670
|
text-align: start;
|
|
5771
5671
|
text-wrap: balance;
|
|
5772
5672
|
margin: 0;
|
|
5773
5673
|
margin-top: 5px;
|
|
5774
|
-
`, TooltipFooter =
|
|
5674
|
+
`, TooltipFooter = styled.div`
|
|
5775
5675
|
display: flex;
|
|
5776
5676
|
align-items: center;
|
|
5777
5677
|
justify-content: space-between;
|
|
5778
5678
|
margin-top: 15px;
|
|
5779
|
-
`, Count =
|
|
5679
|
+
`, Count = styled.span`
|
|
5780
5680
|
font-size: 13px;
|
|
5781
|
-
`,
|
|
5681
|
+
`, NextButton = styled(Button)(({ theme: theme2 }) => ({
|
|
5682
|
+
background: theme2.color.lightest,
|
|
5683
|
+
border: "none",
|
|
5684
|
+
boxShadow: "none",
|
|
5685
|
+
color: theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary),
|
|
5686
|
+
"&:hover, &:focus": {
|
|
5687
|
+
background: curriedTransparentize$1(0.1, theme2.color.lightest),
|
|
5688
|
+
color: theme2.base === "light" ? curriedLighten$1(0.1, theme2.color.secondary) : curriedDarken$1(0.3, theme2.color.secondary)
|
|
5689
|
+
}
|
|
5690
|
+
})), TourTooltip = ({
|
|
5782
5691
|
index,
|
|
5783
5692
|
size,
|
|
5784
5693
|
step,
|
|
@@ -5787,7 +5696,7 @@ var TooltipBody = styled3.div`
|
|
|
5787
5696
|
tooltipProps
|
|
5788
5697
|
}) => (useEffect2(() => {
|
|
5789
5698
|
let style = document.createElement("style");
|
|
5790
|
-
return style.id =
|
|
5699
|
+
return style.id = ONBOARDING_ARROW_STYLE_ID, style.innerHTML = `
|
|
5791
5700
|
.__floater__arrow { container-type: size; }
|
|
5792
5701
|
.__floater__arrow span { background: ${color.secondary}; }
|
|
5793
5702
|
.__floater__arrow span::before, .__floater__arrow span::after {
|
|
@@ -5803,12 +5712,9 @@ var TooltipBody = styled3.div`
|
|
|
5803
5712
|
@container (min-height: 1px) {
|
|
5804
5713
|
.__floater__arrow span { flex-direction: column; }
|
|
5805
5714
|
}
|
|
5806
|
-
`, document.head.appendChild(style), () =>
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
};
|
|
5810
|
-
}, []), React11.createElement(TooltipBody, { ...tooltipProps, style: step.styles?.tooltip }, React11.createElement(Wrapper2, null, React11.createElement(TooltipHeader, null, step.title && React11.createElement(TooltipTitle, null, step.title), React11.createElement(
|
|
5811
|
-
Button3,
|
|
5715
|
+
`, document.head.appendChild(style), () => document.getElementById(ONBOARDING_ARROW_STYLE_ID)?.remove();
|
|
5716
|
+
}, []), React10.createElement(TooltipBody, { ...tooltipProps, style: step.styles?.tooltip }, React10.createElement(Wrapper, null, React10.createElement(TooltipHeader, null, step.title && React10.createElement(TooltipTitle, null, step.title), React10.createElement(
|
|
5717
|
+
Button,
|
|
5812
5718
|
{
|
|
5813
5719
|
...closeProps,
|
|
5814
5720
|
onClick: closeProps.onClick,
|
|
@@ -5816,44 +5722,53 @@ var TooltipBody = styled3.div`
|
|
|
5816
5722
|
padding: "small",
|
|
5817
5723
|
ariaLabel: "Close"
|
|
5818
5724
|
},
|
|
5819
|
-
|
|
5820
|
-
)),
|
|
5821
|
-
Button,
|
|
5822
|
-
{
|
|
5823
|
-
...primaryProps,
|
|
5824
|
-
onClick: step.onNextButtonClick || primaryProps.onClick,
|
|
5825
|
-
variant: "white"
|
|
5826
|
-
},
|
|
5827
|
-
index + 1 === size ? "Done" : "Next"
|
|
5828
|
-
))));
|
|
5725
|
+
React10.createElement(CloseAltIcon, null)
|
|
5726
|
+
)), React10.createElement(TooltipContent, null, step.content)), React10.createElement(TooltipFooter, { id: "buttonNext" }, React10.createElement(Count, null, index + 1, " of ", size), !step.hideNextButton && React10.createElement(NextButton, { ...primaryProps }, index + 1 === size ? "Done" : "Next"))));
|
|
5829
5727
|
|
|
5830
|
-
// src/
|
|
5831
|
-
|
|
5728
|
+
// ../../core/src/manager/components/TourGuide/TourGuide.tsx
|
|
5729
|
+
var TourGuide = ({
|
|
5832
5730
|
step,
|
|
5833
5731
|
steps,
|
|
5834
|
-
|
|
5835
|
-
onComplete
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5732
|
+
onNext,
|
|
5733
|
+
onComplete,
|
|
5734
|
+
onDismiss
|
|
5735
|
+
}) => {
|
|
5736
|
+
let [stepIndex, setStepIndex] = useState(step ? null : 0), theme2 = useTheme(), timeoutRef = useRef(void 0), updateStepIndex = useCallback((index) => {
|
|
5737
|
+
clearTimeout(timeoutRef.current), setStepIndex((current) => index === -1 ? null : current === null || current === index ? index : (timeoutRef.current = setTimeout(setStepIndex, 300, index), null));
|
|
5738
|
+
}, []);
|
|
5739
|
+
useEffect3(
|
|
5740
|
+
() => step ? updateStepIndex(steps.findIndex(({ key }) => key === step)) : void 0,
|
|
5741
|
+
[step, steps, updateStepIndex]
|
|
5742
|
+
);
|
|
5743
|
+
let mappedSteps = useMemo(() => steps.map((step2, index) => {
|
|
5744
|
+
let next = () => updateStepIndex(index + 1);
|
|
5745
|
+
return {
|
|
5746
|
+
disableBeacon: !0,
|
|
5747
|
+
disableOverlay: !0,
|
|
5748
|
+
spotlightClicks: !0,
|
|
5749
|
+
offset: 0,
|
|
5750
|
+
...step2,
|
|
5751
|
+
content: React11.createElement(React11.Fragment, null, step2.content, step2.highlight && React11.createElement(HighlightElement, { targetSelector: step2.highlight, pulsating: !0 })),
|
|
5752
|
+
onNext: step2.onNext ? () => step2.onNext?.({ next }) : onNext && (() => onNext?.({ next }))
|
|
5753
|
+
};
|
|
5754
|
+
}), [steps, onNext, updateStepIndex]), callback = useCallback(
|
|
5755
|
+
(data) => {
|
|
5756
|
+
data.action === ACTIONS.NEXT && data.lifecycle === "complete" && (data.index === data.size - 1 ? onComplete?.() : data.step?.onNext ? data.step.onNext() : updateStepIndex(data.index + 1)), data.action === ACTIONS.CLOSE && onDismiss?.();
|
|
5757
|
+
},
|
|
5758
|
+
[onComplete, onDismiss, updateStepIndex]
|
|
5759
|
+
);
|
|
5760
|
+
return stepIndex === null ? null : React11.createElement(
|
|
5845
5761
|
components_default,
|
|
5846
5762
|
{
|
|
5847
5763
|
continuous: !0,
|
|
5848
|
-
steps,
|
|
5764
|
+
steps: mappedSteps,
|
|
5849
5765
|
stepIndex,
|
|
5850
5766
|
spotlightPadding: 0,
|
|
5851
5767
|
disableCloseOnEsc: !0,
|
|
5852
5768
|
disableOverlayClose: !0,
|
|
5853
5769
|
disableScrolling: !0,
|
|
5854
|
-
callback
|
|
5855
|
-
|
|
5856
|
-
},
|
|
5770
|
+
callback,
|
|
5771
|
+
tooltipComponent: TourTooltip,
|
|
5857
5772
|
floaterProps: {
|
|
5858
5773
|
disableAnimation: !0,
|
|
5859
5774
|
styles: {
|
|
@@ -5866,7 +5781,6 @@ function GuidedTour({
|
|
|
5866
5781
|
}
|
|
5867
5782
|
}
|
|
5868
5783
|
},
|
|
5869
|
-
tooltipComponent: Tooltip,
|
|
5870
5784
|
styles: {
|
|
5871
5785
|
overlay: {
|
|
5872
5786
|
mixBlendMode: "unset",
|
|
@@ -5890,198 +5804,132 @@ function GuidedTour({
|
|
|
5890
5804
|
}
|
|
5891
5805
|
}
|
|
5892
5806
|
);
|
|
5893
|
-
}
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5807
|
+
}, root = null;
|
|
5808
|
+
TourGuide.render = (props) => {
|
|
5809
|
+
let container = document.getElementById("storybook-tour");
|
|
5810
|
+
container || (container = document.createElement("div"), container.id = "storybook-tour", document.body.appendChild(container)), root = root ?? createRoot(container), root.render(
|
|
5811
|
+
React11.createElement(ThemeProvider, { theme: convert(themes.light) }, React11.createElement(
|
|
5812
|
+
TourGuide,
|
|
5813
|
+
{
|
|
5814
|
+
...props,
|
|
5815
|
+
onComplete: () => {
|
|
5816
|
+
props.onComplete?.(), root?.render(null), root = null;
|
|
5817
|
+
},
|
|
5818
|
+
onDismiss: () => {
|
|
5819
|
+
props.onDismiss?.(), root?.render(null), root = null;
|
|
5820
|
+
}
|
|
5821
|
+
}
|
|
5822
|
+
))
|
|
5823
|
+
);
|
|
5824
|
+
};
|
|
5899
5825
|
|
|
5900
|
-
//
|
|
5901
|
-
|
|
5902
|
-
let windowToCheck = windowArg || typeof window < "u" && window;
|
|
5903
|
-
return !!(windowToCheck && (windowToCheck.navigator.userAgent.match(/Chromatic/) || windowToCheck.location.href.match(/chromatic=true/)));
|
|
5904
|
-
}
|
|
5826
|
+
// src/components/Confetti/Confetti.tsx
|
|
5827
|
+
import React12 from "react";
|
|
5905
5828
|
|
|
5906
|
-
//
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
cursor: "pointer"
|
|
5829
|
+
// ../../node_modules/@neoconfetti/react/dist/min/index.js
|
|
5830
|
+
import { createElement as z, useEffect as A, useRef as H } from "react";
|
|
5831
|
+
var e = '@keyframes Bc2PgW_ya{to{translate:0 var(--sh)}}@keyframes Bc2PgW_xa{to{translate:var(--xlp)0}}@keyframes Bc2PgW_r{50%{rotate:var(--hr)180deg}to{rotate:var(--r)360deg}}.Bc2PgW_c{z-index:1200;width:0;height:0;position:relative;overflow:visible}.Bc2PgW_p{animation:xa var(--dc)forwards cubic-bezier(var(--x1),var(--x2),var(--x3),var(--x4));animation-name:Bc2PgW_xa}.Bc2PgW_p>div{animation:ya var(--dc)forwards cubic-bezier(var(--y1),var(--y2),var(--y3),var(--y4));width:var(--w);height:var(--h);animation-name:Bc2PgW_ya;position:absolute;top:0;left:0}.Bc2PgW_p>div:before{content:"";background-color:var(--bgc);animation:r var(--rd)infinite linear;border-radius:var(--br);width:100%;height:100%;animation-name:Bc2PgW_r;display:block}', t = "Bc2PgW_p", r = "Bc2PgW_c", a = ["#FFC700", "#FF0000", "#2E3191", "#41BBC7"], o = 3500, n = 0.5, i = 150, c = "mix", s = 12, l = "", d = !0, p = 800, u = 1600;
|
|
5832
|
+
function y(y2, z2 = {}) {
|
|
5833
|
+
let { colors: A2 = a, duration: H2 = o, force: F2 = n, particleCount: O = i, particleShape: j = c, particleSize: E = s, particleClass: $ = l, destroyAfterDone: q = d, stageHeight: D = p, stageWidth: J = u } = z2;
|
|
5834
|
+
(function(e2) {
|
|
5835
|
+
if (document.querySelector("style[data-neoconfetti]")) return;
|
|
5836
|
+
let t2 = W("style");
|
|
5837
|
+
t2.dataset.neoconfetti = "", t2.textContent = e2, _(document.head, t2);
|
|
5838
|
+
})(e), y2.classList.add(r), y2.style.setProperty("--sh", D + "px");
|
|
5839
|
+
let I = [], G = [], K = () => P(b() * (N - 1)), Q = (e2, t2) => j !== "rectangles" && (e2 === "circles" || k(t2));
|
|
5840
|
+
function R(e2, t2) {
|
|
5841
|
+
let r2 = K(), a2 = Q(j, r2), o2 = (t3, r3) => e2.style.setProperty(t3, r3 + "");
|
|
5842
|
+
o2("--xlp", C(x(L(t2, 90) - 180), 0, 180, -J / 2, J / 2) + "px"), o2("--dc", H2 - P(1e3 * b()) + "ms");
|
|
5843
|
+
let n2 = b() < m ? w(b() * h, 2) : 0;
|
|
5844
|
+
o2("--x1", n2), o2("--x2", -1 * n2), o2("--x3", n2), o2("--x4", w(x(C(x(L(t2, 90) - 180), 0, 180, -1, 1)), 4)), o2("--y1", w(b() * v, 4)), o2("--y2", w(b() * F2 * (M() ? 1 : -1), 4)), o2("--y3", v), o2("--y4", w(B(C(x(t2 - 180), 0, 180, F2, -F2), 0), 4)), o2("--w", (a2 ? E : P(4 * b()) + E / 2) + "px"), o2("--h", (a2 ? E : P(2 * b()) + E) + "px");
|
|
5845
|
+
let i2 = r2.toString(2).padStart(3, "0").split("");
|
|
5846
|
+
o2("--hr", i2.map(((e3) => +e3 / 2 + "")).join(" ")), o2("--r", i2.join(" ")), o2("--rd", w(b() * (g - f) + f) + "ms"), o2("--br", a2 ? "50%" : 0);
|
|
5925
5847
|
}
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
}
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
building: {
|
|
5936
|
-
label: "What are you building?",
|
|
5937
|
-
type: "checkbox",
|
|
5938
|
-
required: !0,
|
|
5939
|
-
options: shuffleObject({
|
|
5940
|
-
"design-system": { label: "Design system" },
|
|
5941
|
-
"application-ui": { label: "Application UI" }
|
|
5942
|
-
}),
|
|
5943
|
-
values: {
|
|
5944
|
-
"design-system": !1,
|
|
5945
|
-
"application-ui": !1
|
|
5946
|
-
}
|
|
5947
|
-
},
|
|
5948
|
-
interest: {
|
|
5949
|
-
label: "Which of these are you interested in?",
|
|
5950
|
-
type: "checkbox",
|
|
5951
|
-
required: !0,
|
|
5952
|
-
options: shuffleObject({
|
|
5953
|
-
"ui-documentation": { label: "Generating UI docs" },
|
|
5954
|
-
"functional-testing": { label: "Functional testing" },
|
|
5955
|
-
"accessibility-testing": { label: "Accessibility testing" },
|
|
5956
|
-
"visual-testing": { label: "Visual testing" },
|
|
5957
|
-
"ai-augmented-development": { label: "Building UI with AI" },
|
|
5958
|
-
"team-collaboration": { label: "Team collaboration" },
|
|
5959
|
-
"design-handoff": { label: "Design handoff" }
|
|
5960
|
-
}),
|
|
5961
|
-
values: {
|
|
5962
|
-
"ui-documentation": !1,
|
|
5963
|
-
"functional-testing": !1,
|
|
5964
|
-
"accessibility-testing": !1,
|
|
5965
|
-
"visual-testing": !1,
|
|
5966
|
-
"ai-augmented-development": !1,
|
|
5967
|
-
"team-collaboration": !1,
|
|
5968
|
-
"design-handoff": !1
|
|
5969
|
-
}
|
|
5970
|
-
},
|
|
5971
|
-
referrer: {
|
|
5972
|
-
label: "How did you discover Storybook?",
|
|
5973
|
-
type: "select",
|
|
5974
|
-
required: !0,
|
|
5975
|
-
options: shuffleObject({
|
|
5976
|
-
"we-use-it-at-work": { label: "We use it at work" },
|
|
5977
|
-
"via-friend-or-colleague": { label: "Via friend or colleague" },
|
|
5978
|
-
"via-social-media": { label: "Via social media" },
|
|
5979
|
-
youtube: { label: "YouTube" },
|
|
5980
|
-
"web-search": { label: "Web Search" },
|
|
5981
|
-
"ai-agent": { label: "AI Agent (e.g. ChatGPT)" }
|
|
5982
|
-
}),
|
|
5983
|
-
values: {
|
|
5984
|
-
"we-use-it-at-work": !1,
|
|
5985
|
-
"via-friend-or-colleague": !1,
|
|
5986
|
-
"via-social-media": !1,
|
|
5987
|
-
youtube: !1,
|
|
5988
|
-
"web-search": !1,
|
|
5989
|
-
"ai-agent": !1
|
|
5990
|
-
}
|
|
5991
|
-
}
|
|
5992
|
-
}), updateFormData = (key, optionOrValue, value) => {
|
|
5993
|
-
let field = formFields[key];
|
|
5994
|
-
setFormFields((fields) => {
|
|
5995
|
-
if (field.type === "checkbox") {
|
|
5996
|
-
let values = { ...field.values, [optionOrValue]: !!value };
|
|
5997
|
-
return { ...fields, [key]: { ...field, values } };
|
|
5998
|
-
}
|
|
5999
|
-
if (field.type === "select") {
|
|
6000
|
-
let values = Object.fromEntries(
|
|
6001
|
-
Object.entries(field.values).map(([opt]) => [opt, opt === optionOrValue])
|
|
6002
|
-
);
|
|
6003
|
-
return { ...fields, [key]: { ...field, values } };
|
|
6004
|
-
}
|
|
6005
|
-
return fields;
|
|
6006
|
-
});
|
|
6007
|
-
}, isValid = Object.values(formFields).every((field) => field.required ? Object.values(field.values).some((value) => value === !0) : !0);
|
|
6008
|
-
return React13.createElement(
|
|
6009
|
-
Modal,
|
|
6010
|
-
{
|
|
6011
|
-
ariaLabel: "Storybook user survey",
|
|
6012
|
-
defaultOpen: !0,
|
|
6013
|
-
width: 420,
|
|
6014
|
-
onOpenChange: (isOpen) => {
|
|
6015
|
-
isOpen || onDismiss();
|
|
5848
|
+
let U;
|
|
5849
|
+
function V() {
|
|
5850
|
+
y2.innerHTML = "", clearTimeout(U), I = S(O, A2), G = (function(e2, r2 = [], a2) {
|
|
5851
|
+
let o2 = [];
|
|
5852
|
+
for (let { color: n2 } of r2) {
|
|
5853
|
+
let r3 = W("div");
|
|
5854
|
+
r3.className = `${t} ${a2}`, r3.style.setProperty("--bgc", n2);
|
|
5855
|
+
let i2 = W("div");
|
|
5856
|
+
_(r3, i2), _(e2, r3), o2.push(r3);
|
|
6016
5857
|
}
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
)
|
|
6022
|
-
}
|
|
6023
|
-
let field = formFields[key];
|
|
6024
|
-
return React13.createElement(React13.Fragment, { key }, React13.createElement(Question, null, field.label), field.type === "checkbox" && React13.createElement(Row, null, Object.entries(field.options).map(([opt, option]) => {
|
|
6025
|
-
let id = `${key}:${opt}`;
|
|
6026
|
-
return React13.createElement("div", { key: id }, React13.createElement(Label, { htmlFor: id }, React13.createElement(
|
|
6027
|
-
Checkbox,
|
|
6028
|
-
{
|
|
6029
|
-
name: id,
|
|
6030
|
-
id,
|
|
6031
|
-
checked: field.values[opt],
|
|
6032
|
-
disabled: isSubmitting,
|
|
6033
|
-
onChange: (e2) => updateFormData(key, opt, e2.target.checked)
|
|
6034
|
-
}
|
|
6035
|
-
), option.label));
|
|
6036
|
-
})), field.type === "select" && React13.createElement(
|
|
6037
|
-
Form.Select,
|
|
6038
|
-
{
|
|
6039
|
-
name: key,
|
|
6040
|
-
id: key,
|
|
6041
|
-
value: Object.entries(field.values).find(([, isSelected]) => isSelected)?.[0] || "",
|
|
6042
|
-
required: field.required,
|
|
6043
|
-
disabled: isSubmitting,
|
|
6044
|
-
onChange: (e2) => updateFormData(key, e2.target.value)
|
|
6045
|
-
},
|
|
6046
|
-
React13.createElement("option", { disabled: !0, hidden: !0, value: "" }, "Select an option..."),
|
|
6047
|
-
Object.entries(field.options).map(([opt, option]) => React13.createElement("option", { key: opt, value: opt }, option.label))
|
|
6048
|
-
));
|
|
6049
|
-
}), React13.createElement(Actions, null, React13.createElement(
|
|
6050
|
-
Button4,
|
|
6051
|
-
{
|
|
6052
|
-
ariaLabel: !1,
|
|
6053
|
-
disabled: isSubmitting || !isValid,
|
|
6054
|
-
size: "medium",
|
|
6055
|
-
type: "submit",
|
|
6056
|
-
variant: "solid"
|
|
6057
|
-
},
|
|
6058
|
-
"Submit"
|
|
6059
|
-
))))
|
|
6060
|
-
);
|
|
6061
|
-
};
|
|
6062
|
-
function shuffle(array) {
|
|
6063
|
-
for (let i2 = array.length - 1; i2 > 0; i2--) {
|
|
6064
|
-
let j = Math.floor(Math.random() * (i2 + 1));
|
|
6065
|
-
[array[i2], array[j]] = [array[j], array[i2]];
|
|
5858
|
+
return o2;
|
|
5859
|
+
})(y2, I, $);
|
|
5860
|
+
for (let [e2, t2] of T(G)) R(t2, I[+e2].degree);
|
|
5861
|
+
U = setTimeout((() => {
|
|
5862
|
+
q && (y2.innerHTML = "");
|
|
5863
|
+
}), H2);
|
|
6066
5864
|
}
|
|
6067
|
-
return
|
|
5865
|
+
return V(), { update(e2) {
|
|
5866
|
+
let r2 = e2.particleCount ?? i, f2 = e2.particleShape ?? c, g2 = e2.particleSize ?? s, m2 = e2.particleClass ?? l, h2 = e2.colors ?? a, v2 = e2.stageHeight ?? p, x2 = e2.duration ?? o, b2 = e2.force ?? n, P2 = e2.stageWidth ?? u, B2 = e2.destroyAfterDone ?? d;
|
|
5867
|
+
I = S(r2, h2);
|
|
5868
|
+
let W2 = !1;
|
|
5869
|
+
if (r2 === O) {
|
|
5870
|
+
G = Array.from(y2.querySelectorAll(`.${t}`));
|
|
5871
|
+
for (let [e3, { color: t2 }] of T(I)) {
|
|
5872
|
+
let r3 = G[+e3];
|
|
5873
|
+
JSON.stringify(A2) !== JSON.stringify(h2) && r3.style.setProperty("--bgc", t2), f2 !== j && r3.style.setProperty("--br", Q(f2, K()) ? "50%" : "0"), m2 !== $ && ($ && r3.classList.remove($), m2 && r3.classList.add(m2));
|
|
5874
|
+
}
|
|
5875
|
+
} else W2 = !0;
|
|
5876
|
+
q && !B2 && clearTimeout(U), y2.style.setProperty("--sh", v2 + "px"), H2 = x2, A2 = h2, F2 = b2, O = r2, j = f2, E = g2, $ = m2, q = B2, D = v2, J = P2, W2 && V();
|
|
5877
|
+
}, destroy() {
|
|
5878
|
+
y2.innerHTML = "", clearTimeout(U);
|
|
5879
|
+
} };
|
|
6068
5880
|
}
|
|
6069
|
-
|
|
6070
|
-
|
|
5881
|
+
var f = 200, g = 800, m = 0.1, h = 0.3, v = 0.5, x = Math.abs, b = Math.random, P = Math.round, B = Math.max, W = (e2) => document.createElement(e2), _ = (e2, t2) => e2.appendChild(t2), S = (e2, t2) => Array.from({ length: e2 }, ((r2, a2) => ({ color: t2[a2 % t2.length], degree: 360 * a2 / e2 }))), w = (e2, t2 = 2) => P((e2 + Number.EPSILON) * 10 ** t2) / 10 ** t2, C = (e2, t2, r2, a2, o2) => (e2 - t2) * (o2 - a2) / (r2 - t2) + a2, L = (e2, t2) => e2 + t2 > 360 ? e2 + t2 - 360 : e2 + t2, M = () => b() > 0.5, T = Object.entries, N = 6, k = (e2) => e2 !== 1 && M();
|
|
5882
|
+
function F({ class: e2, ...t2 }) {
|
|
5883
|
+
let r2 = H(null), a2 = H();
|
|
5884
|
+
return A((() => {
|
|
5885
|
+
if (typeof window < "u" && r2.current) {
|
|
5886
|
+
if (a2.current) return a2.current.update(t2), a2.current.destroy;
|
|
5887
|
+
a2.current = y(r2.current, t2);
|
|
5888
|
+
}
|
|
5889
|
+
}), [t2]), z("div", { ref: r2, className: e2 });
|
|
6071
5890
|
}
|
|
6072
5891
|
|
|
5892
|
+
// src/components/Confetti/Confetti.tsx
|
|
5893
|
+
import { styled as styled2 } from "storybook/theming";
|
|
5894
|
+
var Wrapper2 = styled2.div({
|
|
5895
|
+
zIndex: 9999,
|
|
5896
|
+
position: "fixed",
|
|
5897
|
+
top: 0,
|
|
5898
|
+
left: "50%",
|
|
5899
|
+
width: "50%",
|
|
5900
|
+
height: "100%",
|
|
5901
|
+
pointerEvents: "none"
|
|
5902
|
+
}), Confetti = React12.memo(function({
|
|
5903
|
+
timeToFade = 5e3,
|
|
5904
|
+
colors = ["#CA90FF", "#FC521F", "#66BF3C", "#FF4785", "#FFAE00", "#1EA7FD"],
|
|
5905
|
+
...confettiProps
|
|
5906
|
+
}) {
|
|
5907
|
+
return React12.createElement(Wrapper2, null, React12.createElement(
|
|
5908
|
+
F,
|
|
5909
|
+
{
|
|
5910
|
+
colors,
|
|
5911
|
+
particleCount: 200,
|
|
5912
|
+
duration: 5e3,
|
|
5913
|
+
stageHeight: window.innerHeight,
|
|
5914
|
+
stageWidth: window.innerWidth,
|
|
5915
|
+
destroyAfterDone: !0,
|
|
5916
|
+
...confettiProps
|
|
5917
|
+
}
|
|
5918
|
+
));
|
|
5919
|
+
});
|
|
5920
|
+
|
|
6073
5921
|
// src/features/SplashScreen/SplashScreen.tsx
|
|
6074
|
-
import
|
|
5922
|
+
import React13, { useCallback as useCallback2, useEffect as useEffect4, useState as useState2 } from "react";
|
|
6075
5923
|
import { ArrowRightIcon } from "@storybook/icons";
|
|
6076
|
-
import { keyframes, styled as
|
|
6077
|
-
var fadeIn =
|
|
5924
|
+
import { keyframes as keyframes2, styled as styled3 } from "storybook/theming";
|
|
5925
|
+
var fadeIn = keyframes2({
|
|
6078
5926
|
from: {
|
|
6079
5927
|
opacity: 0
|
|
6080
5928
|
},
|
|
6081
5929
|
to: {
|
|
6082
5930
|
opacity: 1
|
|
6083
5931
|
}
|
|
6084
|
-
}), slideIn =
|
|
5932
|
+
}), slideIn = keyframes2({
|
|
6085
5933
|
from: {
|
|
6086
5934
|
transform: "translate(0, 20px)",
|
|
6087
5935
|
opacity: 0
|
|
@@ -6090,7 +5938,7 @@ var fadeIn = keyframes({
|
|
|
6090
5938
|
transform: "translate(0, 0)",
|
|
6091
5939
|
opacity: 1
|
|
6092
5940
|
}
|
|
6093
|
-
}), scaleIn =
|
|
5941
|
+
}), scaleIn = keyframes2({
|
|
6094
5942
|
from: {
|
|
6095
5943
|
opacity: 0,
|
|
6096
5944
|
transform: "scale(0.8)"
|
|
@@ -6099,14 +5947,14 @@ var fadeIn = keyframes({
|
|
|
6099
5947
|
opacity: 1,
|
|
6100
5948
|
transform: "scale(1)"
|
|
6101
5949
|
}
|
|
6102
|
-
}), rotate =
|
|
5950
|
+
}), rotate = keyframes2({
|
|
6103
5951
|
"0%": {
|
|
6104
5952
|
transform: "rotate(0deg)"
|
|
6105
5953
|
},
|
|
6106
5954
|
"100%": {
|
|
6107
5955
|
transform: "rotate(360deg)"
|
|
6108
5956
|
}
|
|
6109
|
-
}), Wrapper3 =
|
|
5957
|
+
}), Wrapper3 = styled3.div(({ visible }) => ({
|
|
6110
5958
|
position: "fixed",
|
|
6111
5959
|
top: 0,
|
|
6112
5960
|
left: 0,
|
|
@@ -6118,7 +5966,7 @@ var fadeIn = keyframes({
|
|
|
6118
5966
|
justifyContent: "center",
|
|
6119
5967
|
zIndex: 1e3,
|
|
6120
5968
|
transition: "opacity 1s 0.5s"
|
|
6121
|
-
})), Backdrop =
|
|
5969
|
+
})), Backdrop = styled3.div({
|
|
6122
5970
|
position: "absolute",
|
|
6123
5971
|
top: 0,
|
|
6124
5972
|
left: 0,
|
|
@@ -6144,7 +5992,7 @@ var fadeIn = keyframes({
|
|
|
6144
5992
|
height: "calc(100vw + 100vh)",
|
|
6145
5993
|
animation: `${rotate} 12s linear infinite`
|
|
6146
5994
|
}
|
|
6147
|
-
}),
|
|
5995
|
+
}), Content = styled3.div(({ visible }) => ({
|
|
6148
5996
|
position: "absolute",
|
|
6149
5997
|
top: "50%",
|
|
6150
5998
|
left: "50%",
|
|
@@ -6161,7 +6009,7 @@ var fadeIn = keyframes({
|
|
|
6161
6009
|
fontWeight: "bold",
|
|
6162
6010
|
animation: `${slideIn} 1.5s 1s backwards`
|
|
6163
6011
|
}
|
|
6164
|
-
})), Features =
|
|
6012
|
+
})), Features = styled3.div({
|
|
6165
6013
|
display: "flex",
|
|
6166
6014
|
marginTop: 40,
|
|
6167
6015
|
div: {
|
|
@@ -6183,7 +6031,7 @@ var fadeIn = keyframes({
|
|
|
6183
6031
|
svg: {
|
|
6184
6032
|
marginBottom: 10
|
|
6185
6033
|
}
|
|
6186
|
-
}), RadialButton =
|
|
6034
|
+
}), RadialButton = styled3.button({
|
|
6187
6035
|
display: "inline-flex",
|
|
6188
6036
|
position: "relative",
|
|
6189
6037
|
alignItems: "center",
|
|
@@ -6202,10 +6050,10 @@ var fadeIn = keyframes({
|
|
|
6202
6050
|
"&:hover, &:focus": {
|
|
6203
6051
|
background: "rgba(255, 255, 255, 0.4)"
|
|
6204
6052
|
}
|
|
6205
|
-
}), ArrowIcon =
|
|
6053
|
+
}), ArrowIcon = styled3(ArrowRightIcon)({
|
|
6206
6054
|
width: 30,
|
|
6207
6055
|
color: "white"
|
|
6208
|
-
}), ProgressCircle =
|
|
6056
|
+
}), ProgressCircle = styled3.svg(({ progress }) => ({
|
|
6209
6057
|
position: "absolute",
|
|
6210
6058
|
top: -1,
|
|
6211
6059
|
left: -1,
|
|
@@ -6224,7 +6072,7 @@ var fadeIn = keyframes({
|
|
|
6224
6072
|
strokeDasharray: Math.PI * 48
|
|
6225
6073
|
}
|
|
6226
6074
|
})), SplashScreen = ({ onDismiss, duration = 6e3 }) => {
|
|
6227
|
-
let [progress, setProgress] =
|
|
6075
|
+
let [progress, setProgress] = useState2(-4e5 / duration), [visible, setVisible] = useState2(!0), ready = progress >= 100, dismiss = useCallback2(() => {
|
|
6228
6076
|
setVisible(!1);
|
|
6229
6077
|
let timeout = setTimeout(onDismiss, 1500);
|
|
6230
6078
|
return () => clearTimeout(timeout);
|
|
@@ -6236,26 +6084,26 @@ var fadeIn = keyframes({
|
|
|
6236
6084
|
return () => clearInterval(interval);
|
|
6237
6085
|
}, [duration]), useEffect4(() => {
|
|
6238
6086
|
ready && dismiss();
|
|
6239
|
-
}, [ready, dismiss]),
|
|
6087
|
+
}, [ready, dismiss]), React13.createElement(Wrapper3, { visible }, React13.createElement(Backdrop, null), React13.createElement(Content, { visible }, React13.createElement("h1", null, "Meet your new frontend workshop"), React13.createElement(Features, null, React13.createElement("div", null, React13.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "33", height: "32" }, React13.createElement(
|
|
6240
6088
|
"path",
|
|
6241
6089
|
{
|
|
6242
6090
|
d: "M4.06 0H32.5v28.44h-3.56V32H.5V3.56h3.56V0Zm21.33 7.11H4.06v21.33h21.33V7.11Z",
|
|
6243
6091
|
fill: "currentColor"
|
|
6244
6092
|
}
|
|
6245
|
-
)), "Development"),
|
|
6093
|
+
)), "Development"), React13.createElement("div", null, React13.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32" }, React13.createElement(
|
|
6246
6094
|
"path",
|
|
6247
6095
|
{
|
|
6248
6096
|
d: "M15.95 32c-1.85 0-3.1-1.55-3.1-3.54 0-1.1.45-2.78 1.35-5.03.9-2.3 1.35-4.51 1.35-6.81a22.21 22.21 0 0 0-5.1 3.67c-2.5 2.47-4.95 4.9-7.55 4.9-1.6 0-2.9-1.1-2.9-2.43 0-1.46 1.35-2.91 4.3-3.62 1.45-.36 3.1-.75 4.95-1.06 1.8-.31 3.8-1.02 5.9-2.08a23.77 23.77 0 0 0-6.1-2.12C5.3 13.18 2.3 12.6 1 11.28.35 10.6 0 9.9 0 9.14 0 7.82 1.2 6.8 2.95 6.8c2.65 0 5.75 3.1 7.95 5.3 1.1 1.1 2.65 2.21 4.65 3.27v-.57c0-1.77-.15-3.23-.55-4.3-.8-2.11-2.05-5.43-2.05-6.97 0-2.04 1.3-3.54 3.1-3.54 1.75 0 3.1 1.41 3.1 3.54 0 1.06-.45 2.78-1.35 5.12-.9 2.35-1.35 4.6-1.35 6.72 2.85-1.59 2.5-1.41 4.95-3.5 2.35-2.29 4-3.7 4.9-4.23.95-.58 1.9-.84 2.9-.84 1.6 0 2.8.97 2.8 2.34 0 1.5-1.25 2.78-4.15 3.62-1.4.4-3.05.75-4.9 1.1-1.9.36-3.9 1.07-6.1 2.13a23.3 23.3 0 0 0 5.95 2.08c3.65.7 6.75 1.32 8.15 2.6.7.67 1.05 1.33 1.05 2.08 0 1.33-1.2 2.43-2.95 2.43-2.95 0-6.75-4.15-8.2-5.61-.7-.7-2.2-1.72-4.4-2.96v.57c0 1.9.45 4.03 1.3 6.32.85 2.3 1.3 3.94 1.3 4.95 0 2.08-1.35 3.54-3.1 3.54Z",
|
|
6249
6097
|
fill: "currentColor"
|
|
6250
6098
|
}
|
|
6251
|
-
)), "Testing"),
|
|
6099
|
+
)), "Testing"), React13.createElement("div", null, React13.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "33", height: "32" }, React13.createElement(
|
|
6252
6100
|
"path",
|
|
6253
6101
|
{
|
|
6254
6102
|
d: "M.5 16a16 16 0 1 1 32 0 16 16 0 0 1-32 0Zm16 12.44A12.44 12.44 0 0 1 4.3 13.53a8 8 0 1 0 9.73-9.73 12.44 12.44 0 1 1 2.47 24.64ZM12.06 16a4.44 4.44 0 1 1 0-8.89 4.44 4.44 0 0 1 0 8.89Z",
|
|
6255
6103
|
fill: "currentColor",
|
|
6256
6104
|
fillRule: "evenodd"
|
|
6257
6105
|
}
|
|
6258
|
-
)), "Documentation")),
|
|
6106
|
+
)), "Documentation")), React13.createElement(RadialButton, { onClick: dismiss }, React13.createElement(ArrowIcon, null), React13.createElement(ProgressCircle, { xmlns: "http://www.w3.org/2000/svg" }, React13.createElement("circle", null)), React13.createElement(ProgressCircle, { xmlns: "http://www.w3.org/2000/svg", progress: !0 }, React13.createElement(
|
|
6259
6107
|
"circle",
|
|
6260
6108
|
{
|
|
6261
6109
|
strokeDashoffset: Math.PI * 48 * (1 - Math.max(0, Math.min(progress, 100)) / 100)
|
|
@@ -6264,7 +6112,7 @@ var fadeIn = keyframes({
|
|
|
6264
6112
|
};
|
|
6265
6113
|
|
|
6266
6114
|
// src/Onboarding.tsx
|
|
6267
|
-
var SpanHighlight =
|
|
6115
|
+
var SpanHighlight = styled4.span(({ theme: theme2 }) => ({
|
|
6268
6116
|
display: "inline-flex",
|
|
6269
6117
|
borderRadius: 3,
|
|
6270
6118
|
padding: "0 5px",
|
|
@@ -6277,7 +6125,7 @@ var SpanHighlight = styled6.span(({ theme: theme2 }) => ({
|
|
|
6277
6125
|
backgroundColor: theme2.base === "dark" ? "black" : theme2.color.light,
|
|
6278
6126
|
boxSizing: "border-box",
|
|
6279
6127
|
lineHeight: "17px"
|
|
6280
|
-
})), CodeWrapper =
|
|
6128
|
+
})), CodeWrapper = styled4.div(({ theme: theme2 }) => ({
|
|
6281
6129
|
background: theme2.background.content,
|
|
6282
6130
|
borderRadius: 3,
|
|
6283
6131
|
marginTop: 15,
|
|
@@ -6286,9 +6134,12 @@ var SpanHighlight = styled6.span(({ theme: theme2 }) => ({
|
|
|
6286
6134
|
".linenumber": {
|
|
6287
6135
|
opacity: 0.5
|
|
6288
6136
|
}
|
|
6289
|
-
})), theme =
|
|
6290
|
-
function Onboarding({
|
|
6291
|
-
|
|
6137
|
+
})), theme = convert2();
|
|
6138
|
+
function Onboarding({
|
|
6139
|
+
api,
|
|
6140
|
+
hasCompletedSurvey
|
|
6141
|
+
}) {
|
|
6142
|
+
let [enabled, setEnabled] = useState3(!0), [showConfetti, setShowConfetti] = useState3(!1), [step, setStep] = useState3("1:Intro"), [primaryControl, setPrimaryControl] = useState3(), [saveFromControls, setSaveFromControls] = useState3(), [createNewStoryForm, setCreateNewStoryForm] = useState3(), [createdStory, setCreatedStory] = useState3(), userAgent = globalThis?.navigator?.userAgent, selectStory = useCallback3(
|
|
6292
6143
|
(storyId) => {
|
|
6293
6144
|
try {
|
|
6294
6145
|
let { id, refId } = api.getCurrentStoryData() || {};
|
|
@@ -6297,22 +6148,26 @@ function Onboarding({ api }) {
|
|
|
6297
6148
|
}
|
|
6298
6149
|
},
|
|
6299
6150
|
[api]
|
|
6300
|
-
), disableOnboarding =
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
api.emit(STORYBOOK_ADDON_ONBOARDING_CHANNEL, {
|
|
6306
|
-
step: "7:FinishedOnboarding",
|
|
6307
|
-
type: "telemetry",
|
|
6151
|
+
), disableOnboarding = useCallback3(
|
|
6152
|
+
(dismissedStep) => {
|
|
6153
|
+
dismissedStep && api.emit(ADDON_ONBOARDING_CHANNEL, {
|
|
6154
|
+
dismissedStep,
|
|
6155
|
+
type: "dismiss",
|
|
6308
6156
|
userAgent
|
|
6309
|
-
})
|
|
6157
|
+
});
|
|
6158
|
+
let url = new URL(window.location.href);
|
|
6159
|
+
url.searchParams.set("onboarding", "false"), history.replaceState({}, "", url.href), api.setQueryParams({ onboarding: "false" }), setEnabled(!1);
|
|
6160
|
+
},
|
|
6161
|
+
[api, setEnabled, userAgent]
|
|
6162
|
+
), completeSurvey = useCallback3(
|
|
6163
|
+
(answers) => {
|
|
6164
|
+
api.emit(ADDON_ONBOARDING_CHANNEL, {
|
|
6310
6165
|
answers,
|
|
6311
6166
|
type: "survey",
|
|
6312
6167
|
userAgent
|
|
6313
|
-
}), selectStory("configure-your-project--docs")
|
|
6168
|
+
}), setStep("7:FinishedOnboarding"), selectStory("configure-your-project--docs");
|
|
6314
6169
|
},
|
|
6315
|
-
[api, selectStory,
|
|
6170
|
+
[api, selectStory, userAgent]
|
|
6316
6171
|
);
|
|
6317
6172
|
if (useEffect5(() => {
|
|
6318
6173
|
api.setQueryParams({ onboarding: "true" }), selectStory("example-button--primary"), api.togglePanel(!0), api.togglePanelPosition("bottom"), api.setSelectedPanel(ADDON_CONTROLS_ID);
|
|
@@ -6322,27 +6177,27 @@ function Onboarding({ api }) {
|
|
|
6322
6177
|
});
|
|
6323
6178
|
return observer.observe(document.body, { childList: !0, subtree: !0 }), () => observer.disconnect();
|
|
6324
6179
|
}, []), useEffect5(() => {
|
|
6325
|
-
setStep((current) => ["1:Intro", "5:StoryCreated", "6:IntentSurvey", "7:FinishedOnboarding"].includes(current) ? current : createNewStoryForm ? "4:CreateStory" : saveFromControls ? "3:SaveFromControls" : primaryControl ? "2:Controls" : "1:Intro");
|
|
6326
|
-
}, [createNewStoryForm, primaryControl, saveFromControls]), useEffect5(() => api.on(SAVE_STORY_RESPONSE, ({ payload, success }) => {
|
|
6180
|
+
setStep((current) => hasCompletedSurvey && current === "6:IntentSurvey" ? "7:FinishedOnboarding" : ["1:Intro", "5:StoryCreated", "6:IntentSurvey", "7:FinishedOnboarding"].includes(current) ? current : createNewStoryForm ? "4:CreateStory" : saveFromControls ? "3:SaveFromControls" : primaryControl || current === "2:Controls" ? "2:Controls" : "1:Intro");
|
|
6181
|
+
}, [hasCompletedSurvey, createNewStoryForm, primaryControl, saveFromControls]), useEffect5(() => api.on(SAVE_STORY_RESPONSE, ({ payload, success }) => {
|
|
6327
6182
|
!success || !payload?.newStoryName || (setCreatedStory(payload), setShowConfetti(!0), setStep("5:StoryCreated"), setTimeout(() => api.clearNotification("save-story-success")), setTimeout(() => setShowConfetti(!1), 1e4));
|
|
6328
6183
|
}), [api]), useEffect5(
|
|
6329
|
-
() => api.emit(
|
|
6184
|
+
() => api.emit(ADDON_ONBOARDING_CHANNEL, { step, type: "telemetry", userAgent }),
|
|
6330
6185
|
[api, step, userAgent]
|
|
6331
6186
|
), !enabled)
|
|
6332
6187
|
return null;
|
|
6333
6188
|
let source = createdStory?.sourceFileContent, startIndex = source?.lastIndexOf(`export const ${createdStory?.newStoryExportName}`), snippet = source?.slice(startIndex).trim(), startingLineNumber = source?.slice(0, startIndex).split(`
|
|
6334
|
-
`).length,
|
|
6189
|
+
`).length, controlsTour = [
|
|
6335
6190
|
{
|
|
6336
6191
|
key: "2:Controls",
|
|
6337
6192
|
target: "#control-primary",
|
|
6338
6193
|
title: "Interactive story playground",
|
|
6339
|
-
content:
|
|
6194
|
+
content: React14.createElement(React14.Fragment, null, "See how a story renders with different data and state without touching code. Try it out by toggling this button.", React14.createElement(HighlightElement, { targetSelector: "#control-primary", pulsating: !0 })),
|
|
6340
6195
|
offset: 20,
|
|
6341
6196
|
placement: "right",
|
|
6342
6197
|
disableBeacon: !0,
|
|
6343
6198
|
disableOverlay: !0,
|
|
6344
6199
|
spotlightClicks: !0,
|
|
6345
|
-
|
|
6200
|
+
onNext: () => {
|
|
6346
6201
|
document.querySelector("#control-primary").click();
|
|
6347
6202
|
}
|
|
6348
6203
|
},
|
|
@@ -6350,13 +6205,13 @@ function Onboarding({ api }) {
|
|
|
6350
6205
|
key: "3:SaveFromControls",
|
|
6351
6206
|
target: 'button[aria-label="Create new story with these settings"]',
|
|
6352
6207
|
title: "Save your changes as a new story",
|
|
6353
|
-
content:
|
|
6208
|
+
content: React14.createElement(React14.Fragment, null, "Great! Storybook stories represent the key states of each of your components. After modifying a story, you can save your changes from here or reset it.", React14.createElement(HighlightElement, { targetSelector: "button[aria-label='Create new story with these settings']" })),
|
|
6354
6209
|
offset: 6,
|
|
6355
6210
|
placement: "top",
|
|
6356
6211
|
disableBeacon: !0,
|
|
6357
6212
|
disableOverlay: !0,
|
|
6358
6213
|
spotlightClicks: !0,
|
|
6359
|
-
|
|
6214
|
+
onNext: () => {
|
|
6360
6215
|
document.querySelector(
|
|
6361
6216
|
'button[aria-label="Create new story with these settings"]'
|
|
6362
6217
|
).click();
|
|
@@ -6371,7 +6226,7 @@ function Onboarding({ api }) {
|
|
|
6371
6226
|
key: "5:StoryCreated",
|
|
6372
6227
|
target: '#storybook-explorer-tree [data-selected="true"]',
|
|
6373
6228
|
title: "You just added your first story!",
|
|
6374
|
-
content:
|
|
6229
|
+
content: React14.createElement(React14.Fragment, null, "Well done! You just created your first story from the Storybook manager. This automatically added a few lines of code in", " ", React14.createElement(SpanHighlight, null, createdStory?.sourceFileName), ".", snippet && React14.createElement(ThemeProvider2, { theme: convert2(themes2.dark) }, React14.createElement(CodeWrapper, null, React14.createElement(
|
|
6375
6230
|
SyntaxHighlighter,
|
|
6376
6231
|
{
|
|
6377
6232
|
language: "jsx",
|
|
@@ -6390,14 +6245,44 @@ function Onboarding({ api }) {
|
|
|
6390
6245
|
}
|
|
6391
6246
|
}
|
|
6392
6247
|
}
|
|
6248
|
+
], checklistTour = [
|
|
6249
|
+
{
|
|
6250
|
+
key: "7:FinishedOnboarding",
|
|
6251
|
+
target: "#storybook-checklist-module",
|
|
6252
|
+
title: "Continue at your own pace using the guide",
|
|
6253
|
+
content: React14.createElement(React14.Fragment, null, "Nice! You've got the essentials. You can continue at your own pace using the guide to discover more of Storybook's capabilities.", React14.createElement(HighlightElement, { targetSelector: "#storybook-checklist-module", pulsating: !0 })),
|
|
6254
|
+
offset: 0,
|
|
6255
|
+
placement: "right-start",
|
|
6256
|
+
disableBeacon: !0,
|
|
6257
|
+
disableOverlay: !0,
|
|
6258
|
+
styles: {
|
|
6259
|
+
tooltip: {
|
|
6260
|
+
width: 350
|
|
6261
|
+
}
|
|
6262
|
+
}
|
|
6263
|
+
}
|
|
6393
6264
|
];
|
|
6394
|
-
return
|
|
6395
|
-
|
|
6265
|
+
return React14.createElement(ThemeProvider2, { theme }, showConfetti && React14.createElement(Confetti, null), step === "1:Intro" ? React14.createElement(SplashScreen, { onDismiss: () => setStep("2:Controls") }) : step === "6:IntentSurvey" ? React14.createElement(
|
|
6266
|
+
IntentSurvey,
|
|
6267
|
+
{
|
|
6268
|
+
onComplete: completeSurvey,
|
|
6269
|
+
onDismiss: () => disableOnboarding("6:IntentSurvey")
|
|
6270
|
+
}
|
|
6271
|
+
) : step === "7:FinishedOnboarding" ? React14.createElement(
|
|
6272
|
+
TourGuide,
|
|
6273
|
+
{
|
|
6274
|
+
step,
|
|
6275
|
+
steps: checklistTour,
|
|
6276
|
+
onComplete: () => disableOnboarding(),
|
|
6277
|
+
onDismiss: () => disableOnboarding(step)
|
|
6278
|
+
}
|
|
6279
|
+
) : React14.createElement(
|
|
6280
|
+
TourGuide,
|
|
6396
6281
|
{
|
|
6397
6282
|
step,
|
|
6398
|
-
steps,
|
|
6399
|
-
|
|
6400
|
-
|
|
6283
|
+
steps: controlsTour,
|
|
6284
|
+
onComplete: () => setStep(hasCompletedSurvey ? "7:FinishedOnboarding" : "6:IntentSurvey"),
|
|
6285
|
+
onDismiss: () => disableOnboarding(step)
|
|
6401
6286
|
}
|
|
6402
6287
|
));
|
|
6403
6288
|
}
|