@phillips/seldon 1.119.0 → 1.121.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/_commonjsHelpers.js +1 -1
- package/dist/components/Accordion/Accordion.js +18 -18
- package/dist/components/Accordion/AccordionItem.js +67 -68
- package/dist/components/Carousel/Carousel.js +49 -51
- package/dist/components/Carousel/CarouselDots.js +46 -47
- package/dist/components/ContentPeek/ContentPeek.js +47 -47
- package/dist/components/ErrorBoundary/ErrorBoundary.js +11 -12
- package/dist/components/Filter/Filter.js +40 -41
- package/dist/components/Filter/FilterHeader.js +24 -24
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +21 -20
- package/dist/components/Input/Input.stories.d.ts +7 -0
- package/dist/components/Link/utils.js +2 -2
- package/dist/components/LinkBlock/LinkBlock.js +12 -13
- package/dist/components/LinkList/LinkList.js +8 -11
- package/dist/components/Navigation/Navigation.js +21 -22
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +48 -50
- package/dist/components/Navigation/NavigationList/NavigationList.js +33 -35
- package/dist/components/Pagination/Pagination.js +7 -7
- package/dist/components/Pagination/utils.js +1 -1
- package/dist/components/PinchZoom/PinchZoom.js +40 -43
- package/dist/components/Search/Search.js +94 -98
- package/dist/components/Search/SearchButton.js +19 -19
- package/dist/components/SeldonImage/SeldonImage.js +1 -1
- package/dist/components/Select/Select.js +22 -14
- package/dist/components/Select/Select.stories.d.ts +15 -0
- package/dist/components/Tabs/TabTrigger.js +13 -13
- package/dist/node_modules/@artsy/fresnel/dist/Breakpoints.js +2 -2
- package/dist/node_modules/@artsy/fresnel/dist/DynamicResponsive.js +1 -1
- package/dist/node_modules/@artsy/fresnel/dist/Interactions.js +2 -2
- package/dist/node_modules/@artsy/fresnel/dist/Media.js +2 -2
- package/dist/node_modules/@artsy/fresnel/dist/MediaQueries.js +1 -1
- package/dist/node_modules/@artsy/fresnel/dist/Utils.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +2 -2
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +2 -2
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +5 -5
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +63 -67
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +35 -35
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +79 -83
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.js +5 -5
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.js +43 -45
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +86 -87
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.js +7 -8
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.js +56 -57
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +37 -42
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +18 -19
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +86 -87
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +7 -8
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +56 -57
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +10 -10
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +113 -115
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +33 -37
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +422 -439
- package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +1 -1
- package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +18 -19
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-context/dist/index.js +39 -41
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js +37 -42
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +7 -10
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +1 -1
- package/dist/node_modules/change-case/dist/index.js +41 -44
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
- package/dist/node_modules/date-fns/differenceInDays.js +9 -9
- package/dist/node_modules/date-fns/differenceInHours.js +11 -11
- package/dist/node_modules/date-fns/differenceInMinutes.js +8 -8
- package/dist/node_modules/date-fns/differenceInSeconds.js +7 -7
- package/dist/node_modules/date-fns/formatDuration.js +11 -12
- package/dist/node_modules/date-fns/isSameWeek.js +8 -8
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +5 -5
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/localize.js +10 -10
- package/dist/node_modules/date-fns/startOfDay.js +6 -6
- package/dist/node_modules/date-fns/startOfWeek.js +7 -8
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1 -1
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +1 -1
- package/dist/node_modules/exenv/index.js +2 -2
- package/dist/node_modules/get-nonce/dist/es2015/index.js +1 -1
- package/dist/node_modules/prop-types/checkPropTypes.js +2 -2
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +3 -3
- package/dist/node_modules/react-intersection-observer/dist/index.js +2 -2
- package/dist/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js +1 -1
- package/dist/node_modules/react-modal/lib/components/ModalPortal.js +1 -1
- package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +1 -1
- package/dist/node_modules/react-transition-group/esm/Transition.js +1 -1
- package/dist/node_modules/react-zoom-pan-pinch/dist/index.esm.js +14 -14
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +1 -1
- package/dist/node_modules/usehooks-ts/dist/index.js +1 -1
- package/dist/node_modules/warning/warning.js +1 -1
- package/dist/node_modules/wheel-gestures/dist/wheel-gestures.esm.js +1 -1
- package/dist/patterns/BidSnapshot/BidSnapshot.js +58 -58
- package/dist/patterns/DetailList/DetailList.js +22 -22
- package/dist/patterns/FilterMenu/FilterMenu.js +15 -15
- package/dist/patterns/LanguageSelector/LanguageSelector.js +23 -23
- package/dist/patterns/LanguageSelector/utils.js +2 -5
- package/dist/patterns/ObjectTile/ObjectTile.d.ts +4 -0
- package/dist/patterns/ObjectTile/ObjectTile.js +50 -48
- package/dist/patterns/ObjectTile/ObjectTile.stories.d.ts +2 -0
- package/dist/patterns/ViewingsList/StatefulViewingsList.js +16 -16
- package/dist/patterns/ViewingsList/ViewingsList.js +42 -42
- package/dist/patterns/ViewingsList/ViewingsListCard.js +122 -123
- package/dist/patterns/ViewingsList/ViewingsListCardForm.js +170 -170
- package/dist/scss/patterns/ObjectTile/_objectTile.scss +17 -1
- package/dist/site-furniture/Header/Header.js +32 -32
- package/package.json +2 -1
|
@@ -1,128 +1,127 @@
|
|
|
1
1
|
import * as n from "react";
|
|
2
|
-
import { composeEventHandlers as
|
|
3
|
-
import { Primitive as
|
|
4
|
-
import { useComposedRefs as
|
|
5
|
-
import { useCallbackRef as
|
|
6
|
-
import { useEscapeKeydown as
|
|
7
|
-
import { jsx as
|
|
8
|
-
var
|
|
2
|
+
import { composeEventHandlers as h } from "../../primitive/dist/index.js";
|
|
3
|
+
import { Primitive as w, dispatchDiscreteCustomEvent as k } from "../../react-primitive/dist/index.js";
|
|
4
|
+
import { useComposedRefs as g } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { useCallbackRef as R } from "../../../../../react-use-callback-ref/dist/index.js";
|
|
6
|
+
import { useEscapeKeydown as U } from "../../../../../react-use-escape-keydown/dist/index.js";
|
|
7
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
8
|
+
var z = "DismissableLayer", y = "dismissableLayer.update", H = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", C, B = n.createContext({
|
|
9
9
|
layers: /* @__PURE__ */ new Set(),
|
|
10
10
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
11
11
|
branches: /* @__PURE__ */ new Set()
|
|
12
|
-
}),
|
|
13
|
-
(
|
|
14
|
-
var C;
|
|
12
|
+
}), K = n.forwardRef(
|
|
13
|
+
(s, e) => {
|
|
15
14
|
const {
|
|
16
|
-
disableOutsidePointerEvents:
|
|
17
|
-
onEscapeKeyDown:
|
|
18
|
-
onPointerDownOutside:
|
|
19
|
-
onFocusOutside:
|
|
20
|
-
onInteractOutside:
|
|
15
|
+
disableOutsidePointerEvents: r = !1,
|
|
16
|
+
onEscapeKeyDown: a,
|
|
17
|
+
onPointerDownOutside: i,
|
|
18
|
+
onFocusOutside: c,
|
|
19
|
+
onInteractOutside: f,
|
|
21
20
|
onDismiss: d,
|
|
22
|
-
...
|
|
23
|
-
} =
|
|
24
|
-
const
|
|
25
|
-
!
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
[...
|
|
29
|
-
},
|
|
30
|
-
return
|
|
31
|
-
b ===
|
|
32
|
-
},
|
|
21
|
+
...E
|
|
22
|
+
} = s, o = n.useContext(B), [u, F] = n.useState(null), l = u?.ownerDocument ?? globalThis?.document, [, I] = n.useState({}), S = g(e, (t) => F(t)), p = Array.from(o.layers), [W] = [...o.layersWithOutsidePointerEventsDisabled].slice(-1), A = p.indexOf(W), b = u ? p.indexOf(u) : -1, N = o.layersWithOutsidePointerEventsDisabled.size > 0, D = b >= A, _ = Y((t) => {
|
|
23
|
+
const v = t.target, P = [...o.branches].some((m) => m.contains(v));
|
|
24
|
+
!D || P || (i?.(t), f?.(t), t.defaultPrevented || d?.());
|
|
25
|
+
}, l), O = q((t) => {
|
|
26
|
+
const v = t.target;
|
|
27
|
+
[...o.branches].some((m) => m.contains(v)) || (c?.(t), f?.(t), t.defaultPrevented || d?.());
|
|
28
|
+
}, l);
|
|
29
|
+
return U((t) => {
|
|
30
|
+
b === o.layers.size - 1 && (a?.(t), !t.defaultPrevented && d && (t.preventDefault(), d()));
|
|
31
|
+
}, l), n.useEffect(() => {
|
|
33
32
|
if (u)
|
|
34
|
-
return
|
|
35
|
-
|
|
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);
|
|
36
35
|
};
|
|
37
|
-
}, [u,
|
|
38
|
-
u && (
|
|
39
|
-
}, [u,
|
|
40
|
-
const
|
|
41
|
-
return document.addEventListener(y,
|
|
42
|
-
}, []), /* @__PURE__ */
|
|
43
|
-
|
|
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 = () => I({});
|
|
40
|
+
return document.addEventListener(y, t), () => document.removeEventListener(y, t);
|
|
41
|
+
}, []), /* @__PURE__ */ T(
|
|
42
|
+
w.div,
|
|
44
43
|
{
|
|
45
|
-
...
|
|
46
|
-
ref:
|
|
44
|
+
...E,
|
|
45
|
+
ref: S,
|
|
47
46
|
style: {
|
|
48
|
-
pointerEvents:
|
|
49
|
-
...
|
|
47
|
+
pointerEvents: N ? D ? "auto" : "none" : void 0,
|
|
48
|
+
...s.style
|
|
50
49
|
},
|
|
51
|
-
onFocusCapture:
|
|
52
|
-
onBlurCapture:
|
|
53
|
-
onPointerDownCapture:
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
onFocusCapture: h(s.onFocusCapture, O.onFocusCapture),
|
|
51
|
+
onBlurCapture: h(s.onBlurCapture, O.onBlurCapture),
|
|
52
|
+
onPointerDownCapture: h(
|
|
53
|
+
s.onPointerDownCapture,
|
|
54
|
+
_.onPointerDownCapture
|
|
56
55
|
)
|
|
57
56
|
}
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
59
|
);
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
const
|
|
60
|
+
K.displayName = z;
|
|
61
|
+
var j = "DismissableLayerBranch", X = n.forwardRef((s, e) => {
|
|
62
|
+
const r = n.useContext(B), a = n.useRef(null), i = g(e, a);
|
|
64
63
|
return n.useEffect(() => {
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
return
|
|
68
|
-
|
|
64
|
+
const c = a.current;
|
|
65
|
+
if (c)
|
|
66
|
+
return r.branches.add(c), () => {
|
|
67
|
+
r.branches.delete(c);
|
|
69
68
|
};
|
|
70
|
-
}, [
|
|
69
|
+
}, [r.branches]), /* @__PURE__ */ T(w.div, { ...s, ref: i });
|
|
71
70
|
});
|
|
72
|
-
|
|
73
|
-
function
|
|
74
|
-
const
|
|
71
|
+
X.displayName = j;
|
|
72
|
+
function Y(s, e = globalThis?.document) {
|
|
73
|
+
const r = R(s), a = n.useRef(!1), i = n.useRef(() => {
|
|
75
74
|
});
|
|
76
75
|
return n.useEffect(() => {
|
|
77
|
-
const
|
|
78
|
-
if (d.target && !
|
|
79
|
-
let
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
const c = (d) => {
|
|
77
|
+
if (d.target && !a.current) {
|
|
78
|
+
let E = function() {
|
|
79
|
+
x(
|
|
80
|
+
H,
|
|
81
|
+
r,
|
|
82
|
+
o,
|
|
84
83
|
{ discrete: !0 }
|
|
85
84
|
);
|
|
86
85
|
};
|
|
87
|
-
const
|
|
88
|
-
d.pointerType === "touch" ? (e.removeEventListener("click",
|
|
86
|
+
const o = { originalEvent: d };
|
|
87
|
+
d.pointerType === "touch" ? (e.removeEventListener("click", i.current), i.current = E, e.addEventListener("click", i.current, { once: !0 })) : E();
|
|
89
88
|
} else
|
|
90
|
-
e.removeEventListener("click",
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
e.addEventListener("pointerdown",
|
|
89
|
+
e.removeEventListener("click", i.current);
|
|
90
|
+
a.current = !1;
|
|
91
|
+
}, f = window.setTimeout(() => {
|
|
92
|
+
e.addEventListener("pointerdown", c);
|
|
94
93
|
}, 0);
|
|
95
94
|
return () => {
|
|
96
|
-
window.clearTimeout(
|
|
95
|
+
window.clearTimeout(f), e.removeEventListener("pointerdown", c), e.removeEventListener("click", i.current);
|
|
97
96
|
};
|
|
98
|
-
}, [e,
|
|
97
|
+
}, [e, r]), {
|
|
99
98
|
// ensures we check React component tree (not just DOM tree)
|
|
100
|
-
onPointerDownCapture: () =>
|
|
99
|
+
onPointerDownCapture: () => a.current = !0
|
|
101
100
|
};
|
|
102
101
|
}
|
|
103
|
-
function
|
|
104
|
-
const
|
|
102
|
+
function q(s, e = globalThis?.document) {
|
|
103
|
+
const r = R(s), a = n.useRef(!1);
|
|
105
104
|
return n.useEffect(() => {
|
|
106
|
-
const
|
|
107
|
-
|
|
105
|
+
const i = (c) => {
|
|
106
|
+
c.target && !a.current && x(M, r, { originalEvent: c }, {
|
|
108
107
|
discrete: !1
|
|
109
108
|
});
|
|
110
109
|
};
|
|
111
|
-
return e.addEventListener("focusin",
|
|
112
|
-
}, [e,
|
|
113
|
-
onFocusCapture: () =>
|
|
114
|
-
onBlurCapture: () =>
|
|
110
|
+
return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
|
|
111
|
+
}, [e, r]), {
|
|
112
|
+
onFocusCapture: () => a.current = !0,
|
|
113
|
+
onBlurCapture: () => a.current = !1
|
|
115
114
|
};
|
|
116
115
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
document.dispatchEvent(
|
|
116
|
+
function L() {
|
|
117
|
+
const s = new CustomEvent(y);
|
|
118
|
+
document.dispatchEvent(s);
|
|
120
119
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
e &&
|
|
120
|
+
function x(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 ? k(i, c) : i.dispatchEvent(c);
|
|
124
123
|
}
|
|
125
124
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
K as DismissableLayer,
|
|
126
|
+
X as DismissableLayerBranch
|
|
128
127
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as r from "react";
|
|
2
2
|
var t = 0;
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
var n, o;
|
|
3
|
+
function a() {
|
|
4
|
+
r.useEffect(() => {
|
|
6
5
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
7
|
-
return document.body.insertAdjacentElement("afterbegin",
|
|
8
|
-
t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((
|
|
6
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
|
|
7
|
+
t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
|
|
9
8
|
};
|
|
10
9
|
}, []);
|
|
11
10
|
}
|
|
12
|
-
function
|
|
11
|
+
function n() {
|
|
13
12
|
const e = document.createElement("span");
|
|
14
13
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
15
14
|
}
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
a as useFocusGuards
|
|
18
17
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as d from "react";
|
|
2
2
|
import { useComposedRefs as R } from "../../react-compose-refs/dist/index.js";
|
|
3
3
|
import { Primitive as M } from "../../react-primitive/dist/index.js";
|
|
4
|
-
import { useCallbackRef as
|
|
4
|
+
import { useCallbackRef as y } from "../../../../../react-use-callback-ref/dist/index.js";
|
|
5
5
|
import { jsx as _ } from "react/jsx-runtime";
|
|
6
|
-
var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount",
|
|
6
|
+
var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, t) => {
|
|
7
7
|
const {
|
|
8
|
-
loop:
|
|
8
|
+
loop: n = !1,
|
|
9
9
|
trapped: u = !1,
|
|
10
10
|
onMountAutoFocus: p,
|
|
11
11
|
onUnmountAutoFocus: L,
|
|
12
12
|
...g
|
|
13
|
-
} = e, [
|
|
13
|
+
} = e, [o, U] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), A = R(t, (s) => U(s)), a = d.useRef({
|
|
14
14
|
paused: !1,
|
|
15
15
|
pause() {
|
|
16
16
|
this.paused = !0;
|
|
@@ -21,82 +21,82 @@ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", y =
|
|
|
21
21
|
}).current;
|
|
22
22
|
d.useEffect(() => {
|
|
23
23
|
if (u) {
|
|
24
|
-
let
|
|
25
|
-
if (a.paused || !
|
|
24
|
+
let s = function(i) {
|
|
25
|
+
if (a.paused || !o) return;
|
|
26
26
|
const c = i.target;
|
|
27
|
-
|
|
27
|
+
o.contains(c) ? b.current = c : f(b.current, { select: !0 });
|
|
28
28
|
}, l = function(i) {
|
|
29
|
-
if (a.paused || !
|
|
29
|
+
if (a.paused || !o) return;
|
|
30
30
|
const c = i.relatedTarget;
|
|
31
|
-
c !== null && (
|
|
31
|
+
c !== null && (o.contains(c) || f(b.current, { select: !0 }));
|
|
32
32
|
}, r = function(i) {
|
|
33
33
|
if (document.activeElement === document.body)
|
|
34
34
|
for (const h of i)
|
|
35
|
-
h.removedNodes.length > 0 && f(
|
|
35
|
+
h.removedNodes.length > 0 && f(o);
|
|
36
36
|
};
|
|
37
|
-
document.addEventListener("focusin",
|
|
37
|
+
document.addEventListener("focusin", s), document.addEventListener("focusout", l);
|
|
38
38
|
const m = new MutationObserver(r);
|
|
39
|
-
return
|
|
40
|
-
document.removeEventListener("focusin",
|
|
39
|
+
return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
|
|
40
|
+
document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
}, [u,
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const r = new CustomEvent(F,
|
|
49
|
-
|
|
43
|
+
}, [u, o, a.paused]), d.useEffect(() => {
|
|
44
|
+
if (o) {
|
|
45
|
+
O.add(a);
|
|
46
|
+
const s = document.activeElement;
|
|
47
|
+
if (!o.contains(s)) {
|
|
48
|
+
const r = new CustomEvent(F, N);
|
|
49
|
+
o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(W(I(o)), { select: !0 }), document.activeElement === s && f(o));
|
|
50
50
|
}
|
|
51
51
|
return () => {
|
|
52
|
-
|
|
53
|
-
const r = new CustomEvent(T,
|
|
54
|
-
|
|
52
|
+
o.removeEventListener(F, E), setTimeout(() => {
|
|
53
|
+
const r = new CustomEvent(T, N);
|
|
54
|
+
o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), O.remove(a);
|
|
55
55
|
}, 0);
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
}, [
|
|
58
|
+
}, [o, E, v, a]);
|
|
59
59
|
const P = d.useCallback(
|
|
60
|
-
(
|
|
61
|
-
if (!
|
|
62
|
-
const l =
|
|
60
|
+
(s) => {
|
|
61
|
+
if (!n && !u || a.paused) return;
|
|
62
|
+
const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
|
|
63
63
|
if (l && r) {
|
|
64
|
-
const m =
|
|
65
|
-
i && c ? !
|
|
64
|
+
const m = s.currentTarget, [i, c] = x(m);
|
|
65
|
+
i && c ? !s.shiftKey && r === c ? (s.preventDefault(), n && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), n && f(c, { select: !0 })) : r === m && s.preventDefault();
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
[
|
|
68
|
+
[n, u, a.paused]
|
|
69
69
|
);
|
|
70
70
|
return /* @__PURE__ */ _(M.div, { tabIndex: -1, ...g, ref: A, onKeyDown: P });
|
|
71
71
|
});
|
|
72
72
|
k.displayName = K;
|
|
73
|
-
function w(e, { select:
|
|
74
|
-
const
|
|
73
|
+
function w(e, { select: t = !1 } = {}) {
|
|
74
|
+
const n = document.activeElement;
|
|
75
75
|
for (const u of e)
|
|
76
|
-
if (f(u, { select:
|
|
76
|
+
if (f(u, { select: t }), document.activeElement !== n) return;
|
|
77
77
|
}
|
|
78
78
|
function x(e) {
|
|
79
|
-
const
|
|
80
|
-
return [
|
|
79
|
+
const t = I(e), n = S(t, e), u = S(t.reverse(), e);
|
|
80
|
+
return [n, u];
|
|
81
81
|
}
|
|
82
82
|
function I(e) {
|
|
83
|
-
const
|
|
83
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
84
84
|
acceptNode: (u) => {
|
|
85
85
|
const p = u.tagName === "INPUT" && u.type === "hidden";
|
|
86
86
|
return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
for (;
|
|
90
|
-
return
|
|
89
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
90
|
+
return t;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
for (const
|
|
94
|
-
if (!D(
|
|
92
|
+
function S(e, t) {
|
|
93
|
+
for (const n of e)
|
|
94
|
+
if (!D(n, { upTo: t })) return n;
|
|
95
95
|
}
|
|
96
|
-
function D(e, { upTo:
|
|
96
|
+
function D(e, { upTo: t }) {
|
|
97
97
|
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
98
98
|
for (; e; ) {
|
|
99
|
-
if (
|
|
99
|
+
if (t !== void 0 && e === t) return !1;
|
|
100
100
|
if (getComputedStyle(e).display === "none") return !0;
|
|
101
101
|
e = e.parentElement;
|
|
102
102
|
}
|
|
@@ -105,32 +105,31 @@ function D(e, { upTo: n }) {
|
|
|
105
105
|
function H(e) {
|
|
106
106
|
return e instanceof HTMLInputElement && "select" in e;
|
|
107
107
|
}
|
|
108
|
-
function f(e, { select:
|
|
108
|
+
function f(e, { select: t = !1 } = {}) {
|
|
109
109
|
if (e && e.focus) {
|
|
110
|
-
const
|
|
111
|
-
e.focus({ preventScroll: !0 }), e !==
|
|
110
|
+
const n = document.activeElement;
|
|
111
|
+
e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
var
|
|
114
|
+
var O = V();
|
|
115
115
|
function V() {
|
|
116
116
|
let e = [];
|
|
117
117
|
return {
|
|
118
|
-
add(
|
|
119
|
-
const
|
|
120
|
-
|
|
118
|
+
add(t) {
|
|
119
|
+
const n = e[0];
|
|
120
|
+
t !== n && n?.pause(), e = C(e, t), e.unshift(t);
|
|
121
121
|
},
|
|
122
|
-
remove(
|
|
123
|
-
|
|
124
|
-
e = C(e, n), (t = e[0]) == null || t.resume();
|
|
122
|
+
remove(t) {
|
|
123
|
+
e = C(e, t), e[0]?.resume();
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
}
|
|
128
|
-
function C(e,
|
|
129
|
-
const
|
|
130
|
-
return u !== -1 &&
|
|
127
|
+
function C(e, t) {
|
|
128
|
+
const n = [...e], u = n.indexOf(t);
|
|
129
|
+
return u !== -1 && n.splice(u, 1), n;
|
|
131
130
|
}
|
|
132
131
|
function W(e) {
|
|
133
|
-
return e.filter((
|
|
132
|
+
return e.filter((t) => t.tagName !== "A");
|
|
134
133
|
}
|
|
135
134
|
export {
|
|
136
135
|
k as FocusScope
|
package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { Primitive as
|
|
4
|
-
import { useLayoutEffect as
|
|
5
|
-
import { jsx as
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return t ? s.createPortal(/* @__PURE__ */ l(c.div, { ...i, ref: a }), t) : null;
|
|
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;
|
|
12
11
|
});
|
|
13
|
-
|
|
12
|
+
p.displayName = l;
|
|
14
13
|
export {
|
|
15
|
-
|
|
14
|
+
p as Portal
|
|
16
15
|
};
|
package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { useComposedRefs as
|
|
3
|
-
import { useLayoutEffect as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
const o = e[r][t];
|
|
7
|
-
return o != null ? o : r;
|
|
8
|
-
}, n);
|
|
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);
|
|
9
6
|
}
|
|
10
|
-
var
|
|
11
|
-
const { present: e, children:
|
|
12
|
-
return typeof
|
|
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;
|
|
13
10
|
};
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
const [e,
|
|
11
|
+
T.displayName = "Presence";
|
|
12
|
+
function R(n) {
|
|
13
|
+
const [e, t] = i.useState(), r = i.useRef({}), a = i.useRef(n), c = i.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = E(p, {
|
|
17
14
|
mounted: {
|
|
18
15
|
UNMOUNT: "unmounted",
|
|
19
16
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -26,50 +23,48 @@ function v(n) {
|
|
|
26
23
|
MOUNT: "mounted"
|
|
27
24
|
}
|
|
28
25
|
});
|
|
29
|
-
return
|
|
30
|
-
const
|
|
31
|
-
c.current = N === "mounted" ?
|
|
32
|
-
}, [N]),
|
|
33
|
-
const
|
|
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;
|
|
34
31
|
if (m !== n) {
|
|
35
|
-
const
|
|
36
|
-
n ? s("MOUNT") :
|
|
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;
|
|
37
34
|
}
|
|
38
|
-
}, [n, s]),
|
|
39
|
-
var i;
|
|
35
|
+
}, [n, s]), A(() => {
|
|
40
36
|
if (e) {
|
|
41
|
-
let
|
|
42
|
-
const
|
|
43
|
-
const g = l(
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
e.style.animationFillMode = "forwards",
|
|
47
|
-
e.style.animationFillMode === "forwards" && (e.style.animationFillMode =
|
|
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);
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
|
-
},
|
|
51
|
-
|
|
46
|
+
}, f = (u) => {
|
|
47
|
+
u.target === e && (c.current = l(r.current));
|
|
52
48
|
};
|
|
53
|
-
return e.addEventListener("animationstart",
|
|
54
|
-
|
|
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);
|
|
55
51
|
};
|
|
56
52
|
} else
|
|
57
53
|
s("ANIMATION_END");
|
|
58
54
|
}, [e, s]), {
|
|
59
55
|
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
60
|
-
ref:
|
|
61
|
-
|
|
56
|
+
ref: i.useCallback((o) => {
|
|
57
|
+
o && (r.current = getComputedStyle(o)), t(o);
|
|
62
58
|
}, [])
|
|
63
59
|
};
|
|
64
60
|
}
|
|
65
61
|
function l(n) {
|
|
66
|
-
return
|
|
62
|
+
return n?.animationName || "none";
|
|
67
63
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return r ? n.ref : (e = (o = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : o.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
|
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);
|
|
72
67
|
}
|
|
73
68
|
export {
|
|
74
|
-
|
|
69
|
+
T as Presence
|
|
75
70
|
};
|
|
@@ -22,7 +22,7 @@ var c = [
|
|
|
22
22
|
], v = c.reduce((r, i) => {
|
|
23
23
|
const t = s.forwardRef((o, e) => {
|
|
24
24
|
const { asChild: m, ...a } = o, n = m ? p : i;
|
|
25
|
-
return typeof window
|
|
25
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(n, { ...a, ref: e });
|
|
26
26
|
});
|
|
27
27
|
return t.displayName = `Primitive.${i}`, { ...r, [i]: t };
|
|
28
28
|
}, {});
|