@phillips/seldon 1.145.0 → 1.146.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/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/components/Loader/Loader.test.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +39 -0
- package/dist/components/Toast/Toast.js +24 -0
- package/dist/components/Toast/Toast.stories.d.ts +16 -0
- package/dist/components/Toast/Toast.test.d.ts +1 -0
- package/dist/components/Toast/ToastContextProvider.d.ts +19 -0
- package/dist/components/Toast/ToastContextProvider.js +35 -0
- package/dist/components/Toast/ToastContextProvider.test.d.ts +1 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/useToast.d.ts +3 -0
- package/dist/components/Toast/useToast.js +10 -0
- package/dist/components/Toast/useToast.test.d.ts +1 -0
- package/dist/components/Toast/useToastContext.d.ts +7 -0
- package/dist/components/Toast/useToastContext.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +50 -44
- package/dist/node_modules/@radix-ui/react-toast/dist/index.js +447 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-context/dist/index.js +53 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +130 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/ics/dist/index.js +2 -2
- package/dist/node_modules/ics/dist/pipeline/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +13 -0
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +9 -0
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +15 -0
- package/dist/patterns/AccountPageHeader/AccountPageHeader.d.ts +2 -2
- package/dist/patterns/AccountPageHeader/AccountPageHeader.js +21 -21
- package/dist/patterns/AccountPageHeader/AccountPageHeader.stories.d.ts +1 -1
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Toast/_toast.scss +95 -0
- package/dist/scss/patterns/AccountPageHeader/_accountPageHeader.scss +6 -1
- package/package.json +5 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { composeEventHandlers as h } from "../../primitive/dist/index.js";
|
|
3
|
+
import { Primitive as w, dispatchDiscreteCustomEvent as z } from "../../react-primitive/dist/index.js";
|
|
4
|
+
import { useComposedRefs as R } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { useCallbackRef as g } from "../../react-use-callback-ref/dist/index.js";
|
|
6
|
+
import { useEscapeKeydown as H } from "../../react-use-escape-keydown/dist/index.js";
|
|
7
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
8
|
+
var M = "DismissableLayer", y = "dismissableLayer.update", K = "dismissableLayer.pointerDownOutside", j = "dismissableLayer.focusOutside", C, T = n.createContext({
|
|
9
|
+
layers: /* @__PURE__ */ new Set(),
|
|
10
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
11
|
+
branches: /* @__PURE__ */ new Set()
|
|
12
|
+
}), x = n.forwardRef(
|
|
13
|
+
(s, e) => {
|
|
14
|
+
const {
|
|
15
|
+
disableOutsidePointerEvents: r = !1,
|
|
16
|
+
onEscapeKeyDown: a,
|
|
17
|
+
onPointerDownOutside: i,
|
|
18
|
+
onFocusOutside: c,
|
|
19
|
+
onInteractOutside: f,
|
|
20
|
+
onDismiss: d,
|
|
21
|
+
...v
|
|
22
|
+
} = s, o = n.useContext(T), [u, S] = n.useState(null), l = u?.ownerDocument ?? globalThis?.document, [, W] = n.useState({}), A = R(e, (t) => S(t)), p = Array.from(o.layers), [N] = [...o.layersWithOutsidePointerEventsDisabled].slice(-1), _ = p.indexOf(N), b = u ? p.indexOf(u) : -1, k = o.layersWithOutsidePointerEventsDisabled.size > 0, D = b >= _, U = Y((t) => {
|
|
23
|
+
const E = t.target, P = [...o.branches].some((m) => m.contains(E));
|
|
24
|
+
!D || P || (i?.(t), f?.(t), t.defaultPrevented || d?.());
|
|
25
|
+
}, l), O = q((t) => {
|
|
26
|
+
const E = t.target;
|
|
27
|
+
[...o.branches].some((m) => m.contains(E)) || (c?.(t), f?.(t), t.defaultPrevented || d?.());
|
|
28
|
+
}, l);
|
|
29
|
+
return H((t) => {
|
|
30
|
+
b === o.layers.size - 1 && (a?.(t), !t.defaultPrevented && d && (t.preventDefault(), d()));
|
|
31
|
+
}, l), n.useEffect(() => {
|
|
32
|
+
if (u)
|
|
33
|
+
return r && (o.layersWithOutsidePointerEventsDisabled.size === 0 && (C = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), o.layersWithOutsidePointerEventsDisabled.add(u)), o.layers.add(u), L(), () => {
|
|
34
|
+
r && o.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = C);
|
|
35
|
+
};
|
|
36
|
+
}, [u, l, r, o]), n.useEffect(() => () => {
|
|
37
|
+
u && (o.layers.delete(u), o.layersWithOutsidePointerEventsDisabled.delete(u), L());
|
|
38
|
+
}, [u, o]), n.useEffect(() => {
|
|
39
|
+
const t = () => W({});
|
|
40
|
+
return document.addEventListener(y, t), () => document.removeEventListener(y, t);
|
|
41
|
+
}, []), /* @__PURE__ */ B(
|
|
42
|
+
w.div,
|
|
43
|
+
{
|
|
44
|
+
...v,
|
|
45
|
+
ref: A,
|
|
46
|
+
style: {
|
|
47
|
+
pointerEvents: k ? D ? "auto" : "none" : void 0,
|
|
48
|
+
...s.style
|
|
49
|
+
},
|
|
50
|
+
onFocusCapture: h(s.onFocusCapture, O.onFocusCapture),
|
|
51
|
+
onBlurCapture: h(s.onBlurCapture, O.onBlurCapture),
|
|
52
|
+
onPointerDownCapture: h(
|
|
53
|
+
s.onPointerDownCapture,
|
|
54
|
+
U.onPointerDownCapture
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
x.displayName = M;
|
|
61
|
+
var X = "DismissableLayerBranch", F = n.forwardRef((s, e) => {
|
|
62
|
+
const r = n.useContext(T), a = n.useRef(null), i = R(e, a);
|
|
63
|
+
return n.useEffect(() => {
|
|
64
|
+
const c = a.current;
|
|
65
|
+
if (c)
|
|
66
|
+
return r.branches.add(c), () => {
|
|
67
|
+
r.branches.delete(c);
|
|
68
|
+
};
|
|
69
|
+
}, [r.branches]), /* @__PURE__ */ B(w.div, { ...s, ref: i });
|
|
70
|
+
});
|
|
71
|
+
F.displayName = X;
|
|
72
|
+
function Y(s, e = globalThis?.document) {
|
|
73
|
+
const r = g(s), a = n.useRef(!1), i = n.useRef(() => {
|
|
74
|
+
});
|
|
75
|
+
return n.useEffect(() => {
|
|
76
|
+
const c = (d) => {
|
|
77
|
+
if (d.target && !a.current) {
|
|
78
|
+
let v = function() {
|
|
79
|
+
I(
|
|
80
|
+
K,
|
|
81
|
+
r,
|
|
82
|
+
o,
|
|
83
|
+
{ discrete: !0 }
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
const o = { originalEvent: d };
|
|
87
|
+
d.pointerType === "touch" ? (e.removeEventListener("click", i.current), i.current = v, e.addEventListener("click", i.current, { once: !0 })) : v();
|
|
88
|
+
} else
|
|
89
|
+
e.removeEventListener("click", i.current);
|
|
90
|
+
a.current = !1;
|
|
91
|
+
}, f = window.setTimeout(() => {
|
|
92
|
+
e.addEventListener("pointerdown", c);
|
|
93
|
+
}, 0);
|
|
94
|
+
return () => {
|
|
95
|
+
window.clearTimeout(f), e.removeEventListener("pointerdown", c), e.removeEventListener("click", i.current);
|
|
96
|
+
};
|
|
97
|
+
}, [e, r]), {
|
|
98
|
+
// ensures we check React component tree (not just DOM tree)
|
|
99
|
+
onPointerDownCapture: () => a.current = !0
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function q(s, e = globalThis?.document) {
|
|
103
|
+
const r = g(s), a = n.useRef(!1);
|
|
104
|
+
return n.useEffect(() => {
|
|
105
|
+
const i = (c) => {
|
|
106
|
+
c.target && !a.current && I(j, r, { originalEvent: c }, {
|
|
107
|
+
discrete: !1
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
|
|
111
|
+
}, [e, r]), {
|
|
112
|
+
onFocusCapture: () => a.current = !0,
|
|
113
|
+
onBlurCapture: () => a.current = !1
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function L() {
|
|
117
|
+
const s = new CustomEvent(y);
|
|
118
|
+
document.dispatchEvent(s);
|
|
119
|
+
}
|
|
120
|
+
function I(s, e, r, { discrete: a }) {
|
|
121
|
+
const i = r.originalEvent.target, c = new CustomEvent(s, { bubbles: !1, cancelable: !0, detail: r });
|
|
122
|
+
e && i.addEventListener(s, e, { once: !0 }), a ? z(i, c) : i.dispatchEvent(c);
|
|
123
|
+
}
|
|
124
|
+
var ee = x, te = F;
|
|
125
|
+
export {
|
|
126
|
+
te as Branch,
|
|
127
|
+
x as DismissableLayer,
|
|
128
|
+
F as DismissableLayerBranch,
|
|
129
|
+
ee as Root
|
|
130
|
+
};
|
package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-portal/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import n from "react-dom";
|
|
3
|
+
import { Primitive as s } from "../../react-primitive/dist/index.js";
|
|
4
|
+
import { useLayoutEffect as c } from "../../react-use-layout-effect/dist/index.js";
|
|
5
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
6
|
+
var l = "Portal", p = o.forwardRef((r, e) => {
|
|
7
|
+
const { container: a, ...f } = r, [i, m] = o.useState(!1);
|
|
8
|
+
c(() => m(!0), []);
|
|
9
|
+
const t = a || i && globalThis?.document?.body;
|
|
10
|
+
return t ? n.createPortal(/* @__PURE__ */ u(s.div, { ...f, ref: e }), t) : null;
|
|
11
|
+
});
|
|
12
|
+
p.displayName = l;
|
|
13
|
+
export {
|
|
14
|
+
p as Portal
|
|
15
|
+
};
|
package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-presence/dist/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { useComposedRefs as O } from "../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { useLayoutEffect as A } from "../../react-use-layout-effect/dist/index.js";
|
|
4
|
+
function E(n, e) {
|
|
5
|
+
return i.useReducer((t, r) => e[t][r] ?? t, n);
|
|
6
|
+
}
|
|
7
|
+
var T = (n) => {
|
|
8
|
+
const { present: e, children: t } = n, r = R(e), a = typeof t == "function" ? t({ present: r.isPresent }) : i.Children.only(t), c = O(r.ref, v(a));
|
|
9
|
+
return typeof t == "function" || r.isPresent ? i.cloneElement(a, { ref: c }) : null;
|
|
10
|
+
};
|
|
11
|
+
T.displayName = "Presence";
|
|
12
|
+
function R(n) {
|
|
13
|
+
const [e, t] = i.useState(), r = i.useRef(null), a = i.useRef(n), c = i.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = E(p, {
|
|
14
|
+
mounted: {
|
|
15
|
+
UNMOUNT: "unmounted",
|
|
16
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
17
|
+
},
|
|
18
|
+
unmountSuspended: {
|
|
19
|
+
MOUNT: "mounted",
|
|
20
|
+
ANIMATION_END: "unmounted"
|
|
21
|
+
},
|
|
22
|
+
unmounted: {
|
|
23
|
+
MOUNT: "mounted"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return i.useEffect(() => {
|
|
27
|
+
const o = l(r.current);
|
|
28
|
+
c.current = N === "mounted" ? o : "none";
|
|
29
|
+
}, [N]), A(() => {
|
|
30
|
+
const o = r.current, m = a.current;
|
|
31
|
+
if (m !== n) {
|
|
32
|
+
const f = c.current, u = l(o);
|
|
33
|
+
n ? s("MOUNT") : u === "none" || o?.display === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), a.current = n;
|
|
34
|
+
}
|
|
35
|
+
}, [n, s]), A(() => {
|
|
36
|
+
if (e) {
|
|
37
|
+
let o;
|
|
38
|
+
const m = e.ownerDocument.defaultView ?? window, d = (u) => {
|
|
39
|
+
const g = l(r.current).includes(u.animationName);
|
|
40
|
+
if (u.target === e && g && (s("ANIMATION_END"), !a.current)) {
|
|
41
|
+
const y = e.style.animationFillMode;
|
|
42
|
+
e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
|
|
43
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = y);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, f = (u) => {
|
|
47
|
+
u.target === e && (c.current = l(r.current));
|
|
48
|
+
};
|
|
49
|
+
return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
|
|
50
|
+
m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
|
|
51
|
+
};
|
|
52
|
+
} else
|
|
53
|
+
s("ANIMATION_END");
|
|
54
|
+
}, [e, s]), {
|
|
55
|
+
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
56
|
+
ref: i.useCallback((o) => {
|
|
57
|
+
r.current = o ? getComputedStyle(o) : null, t(o);
|
|
58
|
+
}, [])
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function l(n) {
|
|
62
|
+
return n?.animationName || "none";
|
|
63
|
+
}
|
|
64
|
+
function v(n) {
|
|
65
|
+
let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
|
|
66
|
+
return t ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
T as Presence
|
|
70
|
+
};
|
package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-primitive/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import * as p from "react-dom";
|
|
3
|
+
import { createSlot as c } from "../../react-slot/dist/index.js";
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
|
+
var u = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
], h = u.reduce((t, i) => {
|
|
24
|
+
const o = c(`Primitive.${i}`), r = f.forwardRef((e, m) => {
|
|
25
|
+
const { asChild: s, ...a } = e, n = s ? o : i;
|
|
26
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(n, { ...a, ref: m });
|
|
27
|
+
});
|
|
28
|
+
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
29
|
+
}, {});
|
|
30
|
+
function w(t, i) {
|
|
31
|
+
t && p.flushSync(() => t.dispatchEvent(i));
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
h as Primitive,
|
|
35
|
+
w as dispatchDiscreteCustomEvent
|
|
36
|
+
};
|
package/dist/node_modules/@radix-ui/react-toast/node_modules/@radix-ui/react-slot/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { composeRefs as m } from "../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
4
|
+
// @__NO_SIDE_EFFECTS__
|
|
5
|
+
function b(e) {
|
|
6
|
+
const r = /* @__PURE__ */ y(e), t = l.forwardRef((o, n) => {
|
|
7
|
+
const { children: i, ...c } = o, s = l.Children.toArray(i), f = s.find(E);
|
|
8
|
+
if (f) {
|
|
9
|
+
const a = f.props.children, d = s.map((p) => p === f ? l.Children.count(a) > 1 ? l.Children.only(null) : l.isValidElement(a) ? a.props.children : null : p);
|
|
10
|
+
return /* @__PURE__ */ u(r, { ...c, ref: n, children: l.isValidElement(a) ? l.cloneElement(a, void 0, d) : null });
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ u(r, { ...c, ref: n, children: i });
|
|
13
|
+
});
|
|
14
|
+
return t.displayName = `${e}.Slot`, t;
|
|
15
|
+
}
|
|
16
|
+
// @__NO_SIDE_EFFECTS__
|
|
17
|
+
function y(e) {
|
|
18
|
+
const r = l.forwardRef((t, o) => {
|
|
19
|
+
const { children: n, ...i } = t;
|
|
20
|
+
if (l.isValidElement(n)) {
|
|
21
|
+
const c = S(n), s = C(i, n.props);
|
|
22
|
+
return n.type !== l.Fragment && (s.ref = o ? m(o, c) : c), l.cloneElement(n, s);
|
|
23
|
+
}
|
|
24
|
+
return l.Children.count(n) > 1 ? l.Children.only(null) : null;
|
|
25
|
+
});
|
|
26
|
+
return r.displayName = `${e}.SlotClone`, r;
|
|
27
|
+
}
|
|
28
|
+
var g = Symbol("radix.slottable");
|
|
29
|
+
function E(e) {
|
|
30
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
|
|
31
|
+
}
|
|
32
|
+
function C(e, r) {
|
|
33
|
+
const t = { ...r };
|
|
34
|
+
for (const o in r) {
|
|
35
|
+
const n = e[o], i = r[o];
|
|
36
|
+
/^on[A-Z]/.test(o) ? n && i ? t[o] = (...s) => {
|
|
37
|
+
i(...s), n(...s);
|
|
38
|
+
} : n && (t[o] = n) : o === "style" ? t[o] = { ...n, ...i } : o === "className" && (t[o] = [n, i].filter(Boolean).join(" "));
|
|
39
|
+
}
|
|
40
|
+
return { ...e, ...t };
|
|
41
|
+
}
|
|
42
|
+
function S(e) {
|
|
43
|
+
let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning;
|
|
44
|
+
return t ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
b as createSlot
|
|
48
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { useLayoutEffect as m } from "../../react-use-layout-effect/dist/index.js";
|
|
3
|
+
var v = o[" useInsertionEffect ".trim().toString()] || m;
|
|
4
|
+
function w({
|
|
5
|
+
prop: e,
|
|
6
|
+
defaultProp: s,
|
|
7
|
+
onChange: t = () => {
|
|
8
|
+
},
|
|
9
|
+
caller: f
|
|
10
|
+
}) {
|
|
11
|
+
const [u, c, i] = R({
|
|
12
|
+
defaultProp: s,
|
|
13
|
+
onChange: t
|
|
14
|
+
}), n = e !== void 0, a = n ? e : u;
|
|
15
|
+
{
|
|
16
|
+
const r = o.useRef(e !== void 0);
|
|
17
|
+
o.useEffect(() => {
|
|
18
|
+
const l = r.current;
|
|
19
|
+
l !== n && console.warn(
|
|
20
|
+
`${f} is changing from ${l ? "controlled" : "uncontrolled"} to ${n ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
21
|
+
), r.current = n;
|
|
22
|
+
}, [n, f]);
|
|
23
|
+
}
|
|
24
|
+
const d = o.useCallback(
|
|
25
|
+
(r) => {
|
|
26
|
+
if (n) {
|
|
27
|
+
const l = C(r) ? r(e) : r;
|
|
28
|
+
l !== e && i.current?.(l);
|
|
29
|
+
} else
|
|
30
|
+
c(r);
|
|
31
|
+
},
|
|
32
|
+
[n, e, c, i]
|
|
33
|
+
);
|
|
34
|
+
return [a, d];
|
|
35
|
+
}
|
|
36
|
+
function R({
|
|
37
|
+
defaultProp: e,
|
|
38
|
+
onChange: s
|
|
39
|
+
}) {
|
|
40
|
+
const [t, f] = o.useState(e), u = o.useRef(t), c = o.useRef(s);
|
|
41
|
+
return v(() => {
|
|
42
|
+
c.current = s;
|
|
43
|
+
}, [s]), o.useEffect(() => {
|
|
44
|
+
u.current !== t && (c.current?.(t), u.current = t);
|
|
45
|
+
}, [t, u]), [t, f, c];
|
|
46
|
+
}
|
|
47
|
+
function C(e) {
|
|
48
|
+
return typeof e == "function";
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
w as useControllableState
|
|
52
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { useCallbackRef as s } from "../../react-use-callback-ref/dist/index.js";
|
|
3
|
+
function p(n, e = globalThis?.document) {
|
|
4
|
+
const t = s(n);
|
|
5
|
+
r.useEffect(() => {
|
|
6
|
+
const o = (a) => {
|
|
7
|
+
a.key === "Escape" && t(a);
|
|
8
|
+
};
|
|
9
|
+
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
10
|
+
}, [t, e]);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
p as useEscapeKeydown
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { Primitive as a } from "../../react-primitive/dist/index.js";
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
var t = Object.freeze({
|
|
5
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
6
|
+
position: "absolute",
|
|
7
|
+
border: 0,
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
padding: 0,
|
|
11
|
+
margin: -1,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
clip: "rect(0, 0, 0, 0)",
|
|
14
|
+
whiteSpace: "nowrap",
|
|
15
|
+
wordWrap: "normal"
|
|
16
|
+
}), d = "VisuallyHidden", l = i.forwardRef(
|
|
17
|
+
(r, e) => /* @__PURE__ */ o(
|
|
18
|
+
a.span,
|
|
19
|
+
{
|
|
20
|
+
...r,
|
|
21
|
+
ref: e,
|
|
22
|
+
style: { ...t, ...r.style }
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
l.displayName = d;
|
|
27
|
+
export {
|
|
28
|
+
t as VISUALLY_HIDDEN_STYLES,
|
|
29
|
+
l as VisuallyHidden
|
|
30
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __exports as l } from "../../../_virtual/
|
|
1
|
+
import { __exports as l } from "../../../_virtual/index5.js";
|
|
2
2
|
import "./pipeline/index.js";
|
|
3
|
-
import { __exports as _ } from "../../../_virtual/
|
|
3
|
+
import { __exports as _ } from "../../../_virtual/index6.js";
|
|
4
4
|
Object.defineProperty(l, "__esModule", {
|
|
5
5
|
value: !0
|
|
6
6
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index8.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.js";
|
|
4
4
|
var r;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
let t;
|
|
2
|
+
const e = new Uint8Array(16);
|
|
3
|
+
function o() {
|
|
4
|
+
if (!t) {
|
|
5
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
6
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
7
|
+
t = crypto.getRandomValues.bind(crypto);
|
|
8
|
+
}
|
|
9
|
+
return t(e);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
o as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const i = [];
|
|
2
|
+
for (let n = 0; n < 256; ++n)
|
|
3
|
+
i.push((n + 256).toString(16).slice(1));
|
|
4
|
+
function c(n, u = 0) {
|
|
5
|
+
return (i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]]).toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
c as unsafeStringify
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import f from "./native.js";
|
|
2
|
+
import e from "./rng.js";
|
|
3
|
+
import { unsafeStringify as m } from "./stringify.js";
|
|
4
|
+
function g(n, t, a) {
|
|
5
|
+
if (f.randomUUID && !t && !n)
|
|
6
|
+
return f.randomUUID();
|
|
7
|
+
n = n || {};
|
|
8
|
+
const r = n.random ?? n.rng?.() ?? e();
|
|
9
|
+
if (r.length < 16)
|
|
10
|
+
throw new Error("Random bytes length must be >= 16");
|
|
11
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, m(r);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
g as default
|
|
15
|
+
};
|
|
@@ -4,7 +4,7 @@ export interface AccountPageHeaderProps extends ComponentProps<'div'> {
|
|
|
4
4
|
/** The main title displayed at the top of the account page */
|
|
5
5
|
title: string;
|
|
6
6
|
/** Optional subtitle text that appears below the main title */
|
|
7
|
-
|
|
7
|
+
subtitle?: string;
|
|
8
8
|
/**
|
|
9
9
|
* Array of action buttons to display in the header
|
|
10
10
|
* @property {string} [label] - Optional text to display on the button
|
|
@@ -17,7 +17,7 @@ export interface AccountPageHeaderProps extends ComponentProps<'div'> {
|
|
|
17
17
|
label?: string;
|
|
18
18
|
ariaLabel: string;
|
|
19
19
|
icon: IconName;
|
|
20
|
-
onClick: () => void;
|
|
20
|
+
onClick: (e?: React.SyntheticEvent) => void;
|
|
21
21
|
isPrimary?: boolean;
|
|
22
22
|
}>;
|
|
23
23
|
/** Optional text displayed above the title */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
2
|
+
import { forwardRef as b } from "react";
|
|
3
|
+
import { getCommonProps as P } from "../../utils/index.js";
|
|
4
4
|
import k from "../../node_modules/classnames/index.js";
|
|
5
5
|
import l from "../../components/Text/Text.js";
|
|
6
6
|
import { TextVariants as c } from "../../components/Text/types.js";
|
|
@@ -8,31 +8,31 @@ import y from "../../components/Divider/Divider.js";
|
|
|
8
8
|
import x from "../../components/Button/Button.js";
|
|
9
9
|
import { ButtonVariants as L } from "../../components/Button/types.js";
|
|
10
10
|
import m from "../../components/Icon/Icon.js";
|
|
11
|
-
import
|
|
12
|
-
import { SSRMediaQuery as
|
|
13
|
-
const T =
|
|
14
|
-
({ className: _, title:
|
|
15
|
-
const { className:
|
|
16
|
-
d && /* @__PURE__ */ r(p, { children: d.map((a) => /* @__PURE__ */ r(
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */ r(
|
|
19
|
-
/* @__PURE__ */ r(m, { icon:
|
|
11
|
+
import f from "../../components/IconButton/IconButton.js";
|
|
12
|
+
import { SSRMediaQuery as h } from "../../providers/SeldonProvider/utils.js";
|
|
13
|
+
const T = b(
|
|
14
|
+
({ className: _, title: N, subtitle: t, actionButtons: o, overline: s, showDivider: v = !0, ...g }, u) => {
|
|
15
|
+
const { className: i, ...C } = P(g, "AccountPageHeader"), e = o?.find((a) => a.isPrimary), d = o?.filter((a) => !a.isPrimary), $ = () => /* @__PURE__ */ n("div", { className: `${i}__button-wrapper`, children: [
|
|
16
|
+
d && /* @__PURE__ */ r(p, { children: d.map((a) => /* @__PURE__ */ r(f, { onClick: a.onClick, "aria-label": a.ariaLabel, children: /* @__PURE__ */ r(m, { icon: a.icon, "aria-label": a.ariaLabel, title: a.ariaLabel }) }, `icon-button-${a.icon}`)) }),
|
|
17
|
+
e && /* @__PURE__ */ n(p, { children: [
|
|
18
|
+
/* @__PURE__ */ r(h.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ n(x, { variant: L.secondary, onClick: e.onClick, children: [
|
|
19
|
+
/* @__PURE__ */ r(m, { icon: e.icon }),
|
|
20
20
|
" ",
|
|
21
|
-
|
|
21
|
+
e.label
|
|
22
22
|
] }) }),
|
|
23
|
-
/* @__PURE__ */ r(
|
|
23
|
+
/* @__PURE__ */ r(h.Media, { lessThan: "md", children: /* @__PURE__ */ r(f, { onClick: e.onClick, "aria-label": e.ariaLabel, children: /* @__PURE__ */ r(m, { icon: e.icon, title: e.ariaLabel }) }) })
|
|
24
24
|
] })
|
|
25
25
|
] });
|
|
26
|
-
return /* @__PURE__ */ n("div", { ...C, className: k(
|
|
27
|
-
/* @__PURE__ */ n("div", { className: `${
|
|
28
|
-
s && /* @__PURE__ */ r(l, { variant: c.string2, className: `${
|
|
29
|
-
/* @__PURE__ */ n("div", { className: `${
|
|
30
|
-
/* @__PURE__ */ r(l, { variant: c.title1, children:
|
|
31
|
-
o && o.length > 0 &&
|
|
26
|
+
return /* @__PURE__ */ n("div", { ...C, className: k(i, _), ref: u, children: [
|
|
27
|
+
/* @__PURE__ */ n("div", { className: `${i}__container`, children: [
|
|
28
|
+
s && /* @__PURE__ */ r(l, { variant: c.string2, className: `${i}__overline`, children: s }),
|
|
29
|
+
/* @__PURE__ */ n("div", { className: `${i}__title-wrapper`, children: [
|
|
30
|
+
/* @__PURE__ */ r(l, { variant: c.title1, className: `${i}__title`, children: N }),
|
|
31
|
+
o && o.length > 0 && $()
|
|
32
32
|
] }),
|
|
33
|
-
t && /* @__PURE__ */ r(l, { variant: c.string2, className: `${
|
|
33
|
+
t && /* @__PURE__ */ r(l, { variant: c.string2, className: `${i}__subtitle`, children: t })
|
|
34
34
|
] }),
|
|
35
|
-
|
|
35
|
+
v && /* @__PURE__ */ r(y, { className: `${i}__divider` })
|
|
36
36
|
] });
|
|
37
37
|
}
|
|
38
38
|
);
|