@phillips/seldon 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +39 -34
- package/dist/components/Drawer/Drawer.d.ts +23 -0
- package/dist/components/Drawer/Drawer.js +46 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +34 -32
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +6 -6
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +67 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +260 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +137 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +62 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll/node_modules/tslib/tslib.es6.js +27 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
- package/dist/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js +21 -0
- package/dist/scss/_vars.scss +2 -0
- package/dist/scss/components/Drawer/_drawer.scss +66 -0
- package/dist/scss/components/Subscribe/_subscribe.scss +1 -0
- package/dist/scss/styles.scss +1 -0
- package/package.json +7 -6
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-context/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.js +0 -31
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-context/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-id/dist/index.js +0 -13
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-primitive/dist/index.js +0 -31
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -13
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -32
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context/dist/index.js +0 -52
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/primitive → primitive}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-compose-refs → react-compose-refs}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-id → react-id}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-collapsible/node_modules/@radix-ui/react-presence → react-presence}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-slot → react-slot}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-callback-ref → react-use-callback-ref}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-controllable-state → react-use-controllable-state}/dist/index.js +0 -0
- /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-layout-effect → react-use-layout-effect}/dist/index.js +0 -0
|
@@ -37,5 +37,5 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
37
37
|
*
|
|
38
38
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-button--overview)
|
|
39
39
|
*/
|
|
40
|
-
declare const Button: (
|
|
40
|
+
declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
41
41
|
export default Button;
|
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import p from "../../node_modules/classnames/index.js";
|
|
3
3
|
import { getCommonProps as u } from "../../utils/index.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
4
|
+
import { forwardRef as d } from "react";
|
|
5
|
+
const $ = d(
|
|
6
|
+
({
|
|
7
|
+
buttonType: t = "primary",
|
|
8
|
+
size: a = "md",
|
|
9
|
+
children: m,
|
|
10
|
+
className: r,
|
|
11
|
+
isIconLast: e = !1,
|
|
12
|
+
type: n = "button",
|
|
13
|
+
isDisabled: l = !1,
|
|
14
|
+
...s
|
|
15
|
+
}, f) => {
|
|
16
|
+
const { className: o, ...i } = u(s, "Button");
|
|
17
|
+
return /* @__PURE__ */ c(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
...i,
|
|
21
|
+
ref: f,
|
|
22
|
+
type: n,
|
|
23
|
+
className: p(
|
|
24
|
+
`${o}`,
|
|
25
|
+
`${o}--${a}`,
|
|
26
|
+
`${o}--${t}`,
|
|
27
|
+
{
|
|
28
|
+
[`${o}--icon-last`]: e
|
|
29
|
+
},
|
|
30
|
+
r
|
|
31
|
+
),
|
|
32
|
+
disabled: l,
|
|
33
|
+
...s,
|
|
34
|
+
children: m
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
$.displayName = "Button";
|
|
35
40
|
export {
|
|
36
|
-
|
|
41
|
+
$ as default
|
|
37
42
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the drawer is open or not
|
|
5
|
+
*/
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Callback when the drawer is closed
|
|
9
|
+
*/
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* The content of the drawer
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ## Overview
|
|
18
|
+
*
|
|
19
|
+
* A component for displaying a drawer.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
declare const Drawer: ({ className, isOpen, onClose, children, ...props }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default Drawer;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { getCommonProps as d, noOp as p } from "../../utils/index.js";
|
|
3
|
+
import a from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { Root as f, Portal as C, Overlay as h, Content as N, Title as u, Description as v, Close as w } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
5
|
+
import _ from "../../assets/close.svg.js";
|
|
6
|
+
import g from "../IconButton/IconButton.js";
|
|
7
|
+
const j = ({ className: l, isOpen: i = !1, onClose: r = p, children: m, ...s }) => {
|
|
8
|
+
const { className: o, ...n } = d(s, "Drawer");
|
|
9
|
+
return /* @__PURE__ */ e(
|
|
10
|
+
f,
|
|
11
|
+
{
|
|
12
|
+
open: i,
|
|
13
|
+
onOpenChange: (c) => {
|
|
14
|
+
c || r();
|
|
15
|
+
},
|
|
16
|
+
children: /* @__PURE__ */ t(C, { children: [
|
|
17
|
+
/* @__PURE__ */ e(
|
|
18
|
+
h,
|
|
19
|
+
{
|
|
20
|
+
onClick: r,
|
|
21
|
+
className: a(`${o}__overlay`),
|
|
22
|
+
"data-testid": "drawer-overlay"
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ t(N, { className: a(o, l), id: s.id, ...n, children: [
|
|
26
|
+
/* @__PURE__ */ e(u, {}),
|
|
27
|
+
/* @__PURE__ */ e(v, {}),
|
|
28
|
+
/* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
|
|
29
|
+
g,
|
|
30
|
+
{
|
|
31
|
+
onClick: r,
|
|
32
|
+
className: a(`${o}__close`),
|
|
33
|
+
"aria-label": "Close",
|
|
34
|
+
"data-testid": "drawer-close",
|
|
35
|
+
children: /* @__PURE__ */ e(_, {})
|
|
36
|
+
}
|
|
37
|
+
) }),
|
|
38
|
+
m
|
|
39
|
+
] })
|
|
40
|
+
] })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
j as default
|
|
46
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { SubscriptionState } from './components/Subscribe/types';
|
|
|
27
27
|
export { default as Social, type SocialProps } from './components/Social/Social';
|
|
28
28
|
export { default as ViewingsList, type ViewingsListProps } from './components/ViewingsList/ViewingsList';
|
|
29
29
|
export { default as Modal, type ModalProps } from './components/Modal/Modal';
|
|
30
|
+
export { default as Drawer } from './components/Drawer/Drawer';
|
|
30
31
|
export { default as StatefulViewingsList, type StatefulViewingsListProps, } from './components/ViewingsList/StatefulViewingsList';
|
|
31
32
|
export * from './components/Text';
|
|
32
33
|
export * from './components/Accordion';
|
package/dist/index.js
CHANGED
|
@@ -6,42 +6,44 @@ import { default as I } from "./components/ErrorBoundary/ErrorBoundary.js";
|
|
|
6
6
|
import { default as B } from "./components/Footer/Footer.js";
|
|
7
7
|
import { Grid as P } from "./components/Grid/Grid.js";
|
|
8
8
|
import { default as b } from "./components/Header/Header.js";
|
|
9
|
-
import { default as
|
|
9
|
+
import { default as w } from "./components/Navigation/Navigation.js";
|
|
10
10
|
import { default as A } from "./components/Navigation/NavigationItem/NavigationItem.js";
|
|
11
11
|
import { default as C } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
|
|
12
12
|
import { default as M } from "./components/Navigation/NavigationList/NavigationList.js";
|
|
13
13
|
import { default as y } from "./components/HeroBanner/HeroBanner.js";
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { LinkVariants as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
14
|
+
import { default as D } from "./components/Input/Input.js";
|
|
15
|
+
import { default as F } from "./components/Link/Link.js";
|
|
16
|
+
import { LinkVariants as R } from "./components/Link/utils.js";
|
|
17
|
+
import { default as Y } from "./components/LinkBlock/LinkBlock.js";
|
|
18
|
+
import { default as q } from "./components/LinkList/LinkList.js";
|
|
19
19
|
import { default as K } from "./components/Row/Row.js";
|
|
20
20
|
import { default as W } from "./components/GridItem/GridItem.js";
|
|
21
21
|
import { GridItemAlign as Z } from "./components/GridItem/types.js";
|
|
22
22
|
import { default as $ } from "./components/Search/Search.js";
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
23
|
+
import { default as re } from "./components/Select/Select.js";
|
|
24
|
+
import { default as te } from "./components/SplitPanel/SplitPanel.js";
|
|
25
25
|
import { default as fe } from "./components/Subscribe/Subscribe.js";
|
|
26
26
|
import { SubscriptionState as pe } from "./components/Subscribe/types.js";
|
|
27
27
|
import { default as de } from "./components/Social/Social.js";
|
|
28
28
|
import { default as ue } from "./components/ViewingsList/ViewingsList.js";
|
|
29
29
|
import { default as xe } from "./components/Modal/Modal.js";
|
|
30
|
-
import { default as ge } from "./components/
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import { default as Be } from "./components/
|
|
34
|
-
import { default as Pe } from "./components/Accordion/
|
|
35
|
-
import { default as be } from "./components/
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
30
|
+
import { default as ge } from "./components/Drawer/Drawer.js";
|
|
31
|
+
import { default as Le } from "./components/ViewingsList/StatefulViewingsList.js";
|
|
32
|
+
import { TextVariants as Ie } from "./components/Text/types.js";
|
|
33
|
+
import { default as Be } from "./components/Text/Text.js";
|
|
34
|
+
import { default as Pe } from "./components/Accordion/Accordion.js";
|
|
35
|
+
import { default as be } from "./components/Accordion/AccordionItem.js";
|
|
36
|
+
import { default as we } from "./components/UserManagement/UserManagement.js";
|
|
37
|
+
import { SupportedLanguages as Ae } from "./types/commonTypes.js";
|
|
38
|
+
import { default as Ce } from "./components/Breadcrumb/Breadcrumb.js";
|
|
38
39
|
import "react/jsx-runtime";
|
|
39
40
|
import "./node_modules/classnames/index.js";
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
Pe as Accordion,
|
|
43
|
+
be as AccordionItem,
|
|
44
|
+
Ce as Breadcrumb,
|
|
44
45
|
g as Button,
|
|
46
|
+
ge as Drawer,
|
|
45
47
|
I as ErrorBoundary,
|
|
46
48
|
B as Footer,
|
|
47
49
|
P as Grid,
|
|
@@ -50,13 +52,13 @@ export {
|
|
|
50
52
|
b as Header,
|
|
51
53
|
y as HeroBanner,
|
|
52
54
|
L as IconButton,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
D as Input,
|
|
56
|
+
F as Link,
|
|
57
|
+
Y as LinkBlock,
|
|
58
|
+
q as LinkList,
|
|
59
|
+
R as LinkVariants,
|
|
58
60
|
xe as Modal,
|
|
59
|
-
|
|
61
|
+
w as Navigation,
|
|
60
62
|
A as NavigationItem,
|
|
61
63
|
C as NavigationItemTrigger,
|
|
62
64
|
M as NavigationList,
|
|
@@ -64,16 +66,16 @@ export {
|
|
|
64
66
|
x as Page,
|
|
65
67
|
K as Row,
|
|
66
68
|
$ as Search,
|
|
67
|
-
|
|
69
|
+
re as Select,
|
|
68
70
|
de as Social,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
te as SplitPanel,
|
|
72
|
+
Le as StatefulViewingsList,
|
|
71
73
|
fe as Subscribe,
|
|
72
74
|
pe as SubscriptionState,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
Ae as SupportedLanguages,
|
|
76
|
+
Be as Text,
|
|
77
|
+
Ie as TextVariants,
|
|
78
|
+
we as UserManagement,
|
|
77
79
|
ue as ViewingsList,
|
|
78
80
|
f as defaultYear,
|
|
79
81
|
m as emailValidation,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import s from "react";
|
|
2
|
-
import { createContextScope as W } from "
|
|
2
|
+
import { createContextScope as W } from "../../react-context/dist/index.js";
|
|
3
3
|
import { createCollection as X } from "../../react-collection/dist/index.js";
|
|
4
|
-
import { useComposedRefs as Z } from "
|
|
5
|
-
import { composeEventHandlers as $ } from "
|
|
6
|
-
import { useControllableState as M } from "
|
|
7
|
-
import { Primitive as V } from "
|
|
4
|
+
import { useComposedRefs as Z } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { composeEventHandlers as $ } from "../../primitive/dist/index.js";
|
|
6
|
+
import { useControllableState as M } from "../../react-use-controllable-state/dist/index.js";
|
|
7
|
+
import { Primitive as V } from "../../react-primitive/dist/index.js";
|
|
8
8
|
import { createCollapsibleScope as H, Root as oo, Trigger as eo, Content as ro } from "../../react-collapsible/dist/index.js";
|
|
9
|
-
import { useId as to } from "
|
|
9
|
+
import { useId as to } from "../../react-id/dist/index.js";
|
|
10
10
|
import { useDirection as no } from "../../react-direction/dist/index.js";
|
|
11
11
|
import { jsx as n } from "react/jsx-runtime";
|
|
12
12
|
var f = "Accordion", co = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [y, io, ao] = X(f), [b, No] = W(f, [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as o from "react";
|
|
2
|
-
import { composeEventHandlers as T } from "
|
|
3
|
-
import { createContextScope as S } from "
|
|
4
|
-
import { useControllableState as D } from "
|
|
5
|
-
import { useLayoutEffect as L } from "
|
|
6
|
-
import { useComposedRefs as M } from "
|
|
7
|
-
import { Primitive as b } from "
|
|
8
|
-
import { Presence as k } from "
|
|
9
|
-
import { useId as F } from "
|
|
2
|
+
import { composeEventHandlers as T } from "../../primitive/dist/index.js";
|
|
3
|
+
import { createContextScope as S } from "../../react-context/dist/index.js";
|
|
4
|
+
import { useControllableState as D } from "../../react-use-controllable-state/dist/index.js";
|
|
5
|
+
import { useLayoutEffect as L } from "../../react-use-layout-effect/dist/index.js";
|
|
6
|
+
import { useComposedRefs as M } from "../../react-compose-refs/dist/index.js";
|
|
7
|
+
import { Primitive as b } from "../../react-primitive/dist/index.js";
|
|
8
|
+
import { Presence as k } from "../../react-presence/dist/index.js";
|
|
9
|
+
import { useId as F } from "../../react-id/dist/index.js";
|
|
10
10
|
import { jsx as c } from "react/jsx-runtime";
|
|
11
11
|
var v = "Collapsible", [B, W] = S(v), [G, g] = B(v), w = o.forwardRef(
|
|
12
12
|
(e, a) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import n from "react";
|
|
2
|
-
import { createContextScope as O } from "
|
|
3
|
-
import { useComposedRefs as S } from "
|
|
4
|
-
import { Slot as x } from "
|
|
2
|
+
import { createContextScope as O } from "../../react-context/dist/index.js";
|
|
3
|
+
import { useComposedRefs as S } from "../../react-compose-refs/dist/index.js";
|
|
4
|
+
import { Slot as x } from "../../react-slot/dist/index.js";
|
|
5
5
|
import { jsx as d } from "react/jsx-runtime";
|
|
6
6
|
function h(s) {
|
|
7
7
|
const f = s + "CollectionProvider", [A, N] = O(f), [_, m] = A(
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
3
|
+
function $(e, c) {
|
|
4
|
+
const o = u.createContext(c);
|
|
5
|
+
function a(r) {
|
|
6
|
+
const { children: t, ...n } = r, s = u.useMemo(() => n, Object.values(n));
|
|
7
|
+
return /* @__PURE__ */ C(o.Provider, { value: s, children: t });
|
|
8
|
+
}
|
|
9
|
+
function i(r) {
|
|
10
|
+
const t = u.useContext(o);
|
|
11
|
+
if (t) return t;
|
|
12
|
+
if (c !== void 0) return c;
|
|
13
|
+
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
14
|
+
}
|
|
15
|
+
return a.displayName = e + "Provider", [a, i];
|
|
16
|
+
}
|
|
17
|
+
function w(e, c = []) {
|
|
18
|
+
let o = [];
|
|
19
|
+
function a(r, t) {
|
|
20
|
+
const n = u.createContext(t), s = o.length;
|
|
21
|
+
o = [...o, t];
|
|
22
|
+
function m(d) {
|
|
23
|
+
const { scope: x, children: p, ...f } = d, S = (x == null ? void 0 : x[e][s]) || n, h = u.useMemo(() => f, Object.values(f));
|
|
24
|
+
return /* @__PURE__ */ C(S.Provider, { value: h, children: p });
|
|
25
|
+
}
|
|
26
|
+
function v(d, x) {
|
|
27
|
+
const p = (x == null ? void 0 : x[e][s]) || n, f = u.useContext(p);
|
|
28
|
+
if (f) return f;
|
|
29
|
+
if (t !== void 0) return t;
|
|
30
|
+
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
31
|
+
}
|
|
32
|
+
return m.displayName = r + "Provider", [m, v];
|
|
33
|
+
}
|
|
34
|
+
const i = () => {
|
|
35
|
+
const r = o.map((t) => u.createContext(t));
|
|
36
|
+
return function(n) {
|
|
37
|
+
const s = (n == null ? void 0 : n[e]) || r;
|
|
38
|
+
return u.useMemo(
|
|
39
|
+
() => ({ [`__scope${e}`]: { ...n, [e]: s } }),
|
|
40
|
+
[n, s]
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
return i.scopeName = e, [a, P(i, ...c)];
|
|
45
|
+
}
|
|
46
|
+
function P(...e) {
|
|
47
|
+
const c = e[0];
|
|
48
|
+
if (e.length === 1) return c;
|
|
49
|
+
const o = () => {
|
|
50
|
+
const a = e.map((i) => ({
|
|
51
|
+
useScope: i(),
|
|
52
|
+
scopeName: i.scopeName
|
|
53
|
+
}));
|
|
54
|
+
return function(r) {
|
|
55
|
+
const t = a.reduce((n, { useScope: s, scopeName: m }) => {
|
|
56
|
+
const d = s(r)[`__scope${m}`];
|
|
57
|
+
return { ...n, ...d };
|
|
58
|
+
}, {});
|
|
59
|
+
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
return o.scopeName = c.scopeName, o;
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
$ as createContext,
|
|
66
|
+
w as createContextScope
|
|
67
|
+
};
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { composeEventHandlers as p } from "../../primitive/dist/index.js";
|
|
3
|
+
import { useComposedRefs as R } from "../../react-compose-refs/dist/index.js";
|
|
4
|
+
import { createContextScope as H, createContext as V } from "../../react-context/dist/index.js";
|
|
5
|
+
import { useId as C } from "../../react-id/dist/index.js";
|
|
6
|
+
import { useControllableState as q } from "../../react-use-controllable-state/dist/index.js";
|
|
7
|
+
import { DismissableLayer as K } from "../../react-dismissable-layer/dist/index.js";
|
|
8
|
+
import { FocusScope as U } from "../../react-focus-scope/dist/index.js";
|
|
9
|
+
import { Portal as Y } from "../../react-portal/dist/index.js";
|
|
10
|
+
import { Presence as _ } from "../../react-presence/dist/index.js";
|
|
11
|
+
import { Primitive as m } from "../../react-primitive/dist/index.js";
|
|
12
|
+
import { useFocusGuards as Z } from "../../react-focus-guards/dist/index.js";
|
|
13
|
+
import z from "../../../react-remove-scroll/dist/es2015/Combination.js";
|
|
14
|
+
import { hideOthers as J } from "../../../aria-hidden/dist/es2015/index.js";
|
|
15
|
+
import { Slot as Q } from "../../react-slot/dist/index.js";
|
|
16
|
+
import { jsx as i, jsxs as y, Fragment as I } from "react/jsx-runtime";
|
|
17
|
+
var h = "Dialog", [O, Ne] = H(h), [X, u] = O(h), x = (e) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeDialog: o,
|
|
20
|
+
children: n,
|
|
21
|
+
open: a,
|
|
22
|
+
defaultOpen: r,
|
|
23
|
+
onOpenChange: t,
|
|
24
|
+
modal: c = !0
|
|
25
|
+
} = e, l = s.useRef(null), d = s.useRef(null), [g = !1, v] = q({
|
|
26
|
+
prop: a,
|
|
27
|
+
defaultProp: r,
|
|
28
|
+
onChange: t
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ i(
|
|
31
|
+
X,
|
|
32
|
+
{
|
|
33
|
+
scope: o,
|
|
34
|
+
triggerRef: l,
|
|
35
|
+
contentRef: d,
|
|
36
|
+
contentId: C(),
|
|
37
|
+
titleId: C(),
|
|
38
|
+
descriptionId: C(),
|
|
39
|
+
open: g,
|
|
40
|
+
onOpenChange: v,
|
|
41
|
+
onOpenToggle: s.useCallback(() => v((j) => !j), [v]),
|
|
42
|
+
modal: c,
|
|
43
|
+
children: n
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
x.displayName = h;
|
|
48
|
+
var A = "DialogTrigger", ee = s.forwardRef(
|
|
49
|
+
(e, o) => {
|
|
50
|
+
const { __scopeDialog: n, ...a } = e, r = u(A, n), t = R(o, r.triggerRef);
|
|
51
|
+
return /* @__PURE__ */ i(
|
|
52
|
+
m.button,
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
"aria-haspopup": "dialog",
|
|
56
|
+
"aria-expanded": r.open,
|
|
57
|
+
"aria-controls": r.contentId,
|
|
58
|
+
"data-state": P(r.open),
|
|
59
|
+
...a,
|
|
60
|
+
ref: t,
|
|
61
|
+
onClick: p(e.onClick, r.onOpenToggle)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
ee.displayName = A;
|
|
67
|
+
var E = "DialogPortal", [te, T] = O(E, {
|
|
68
|
+
forceMount: void 0
|
|
69
|
+
}), b = (e) => {
|
|
70
|
+
const { __scopeDialog: o, forceMount: n, children: a, container: r } = e, t = u(E, o);
|
|
71
|
+
return /* @__PURE__ */ i(te, { scope: o, forceMount: n, children: s.Children.map(a, (c) => /* @__PURE__ */ i(_, { present: n || t.open, children: /* @__PURE__ */ i(Y, { asChild: !0, container: r, children: c }) })) });
|
|
72
|
+
};
|
|
73
|
+
b.displayName = E;
|
|
74
|
+
var D = "DialogOverlay", M = s.forwardRef(
|
|
75
|
+
(e, o) => {
|
|
76
|
+
const n = T(D, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(D, e.__scopeDialog);
|
|
77
|
+
return t.modal ? /* @__PURE__ */ i(_, { present: a || t.open, children: /* @__PURE__ */ i(oe, { ...r, ref: o }) }) : null;
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
M.displayName = D;
|
|
81
|
+
var oe = s.forwardRef(
|
|
82
|
+
(e, o) => {
|
|
83
|
+
const { __scopeDialog: n, ...a } = e, r = u(D, n);
|
|
84
|
+
return (
|
|
85
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
86
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
87
|
+
/* @__PURE__ */ i(z, { as: Q, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
88
|
+
m.div,
|
|
89
|
+
{
|
|
90
|
+
"data-state": P(r.open),
|
|
91
|
+
...a,
|
|
92
|
+
ref: o,
|
|
93
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
), f = "DialogContent", w = s.forwardRef(
|
|
99
|
+
(e, o) => {
|
|
100
|
+
const n = T(f, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(f, e.__scopeDialog);
|
|
101
|
+
return /* @__PURE__ */ i(_, { present: a || t.open, children: t.modal ? /* @__PURE__ */ i(re, { ...r, ref: o }) : /* @__PURE__ */ i(ne, { ...r, ref: o }) });
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
w.displayName = f;
|
|
105
|
+
var re = s.forwardRef(
|
|
106
|
+
(e, o) => {
|
|
107
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(null), r = R(o, n.contentRef, a);
|
|
108
|
+
return s.useEffect(() => {
|
|
109
|
+
const t = a.current;
|
|
110
|
+
if (t) return J(t);
|
|
111
|
+
}, []), /* @__PURE__ */ i(
|
|
112
|
+
F,
|
|
113
|
+
{
|
|
114
|
+
...e,
|
|
115
|
+
ref: r,
|
|
116
|
+
trapFocus: n.open,
|
|
117
|
+
disableOutsidePointerEvents: !0,
|
|
118
|
+
onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
|
|
119
|
+
var c;
|
|
120
|
+
t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
121
|
+
}),
|
|
122
|
+
onPointerDownOutside: p(e.onPointerDownOutside, (t) => {
|
|
123
|
+
const c = t.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
124
|
+
(c.button === 2 || l) && t.preventDefault();
|
|
125
|
+
}),
|
|
126
|
+
onFocusOutside: p(
|
|
127
|
+
e.onFocusOutside,
|
|
128
|
+
(t) => t.preventDefault()
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
), ne = s.forwardRef(
|
|
134
|
+
(e, o) => {
|
|
135
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
136
|
+
return /* @__PURE__ */ i(
|
|
137
|
+
F,
|
|
138
|
+
{
|
|
139
|
+
...e,
|
|
140
|
+
ref: o,
|
|
141
|
+
trapFocus: !1,
|
|
142
|
+
disableOutsidePointerEvents: !1,
|
|
143
|
+
onCloseAutoFocus: (t) => {
|
|
144
|
+
var c, l;
|
|
145
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, t), t.defaultPrevented || (a.current || (l = n.triggerRef.current) == null || l.focus(), t.preventDefault()), a.current = !1, r.current = !1;
|
|
146
|
+
},
|
|
147
|
+
onInteractOutside: (t) => {
|
|
148
|
+
var d, g;
|
|
149
|
+
(d = e.onInteractOutside) == null || d.call(e, t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
150
|
+
const c = t.target;
|
|
151
|
+
((g = n.triggerRef.current) == null ? void 0 : g.contains(c)) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && r.current && t.preventDefault();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
), F = s.forwardRef(
|
|
157
|
+
(e, o) => {
|
|
158
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: t, ...c } = e, l = u(f, n), d = s.useRef(null), g = R(o, d);
|
|
159
|
+
return Z(), /* @__PURE__ */ y(I, { children: [
|
|
160
|
+
/* @__PURE__ */ i(
|
|
161
|
+
U,
|
|
162
|
+
{
|
|
163
|
+
asChild: !0,
|
|
164
|
+
loop: !0,
|
|
165
|
+
trapped: a,
|
|
166
|
+
onMountAutoFocus: r,
|
|
167
|
+
onUnmountAutoFocus: t,
|
|
168
|
+
children: /* @__PURE__ */ i(
|
|
169
|
+
K,
|
|
170
|
+
{
|
|
171
|
+
role: "dialog",
|
|
172
|
+
id: l.contentId,
|
|
173
|
+
"aria-describedby": l.descriptionId,
|
|
174
|
+
"aria-labelledby": l.titleId,
|
|
175
|
+
"data-state": P(l.open),
|
|
176
|
+
...c,
|
|
177
|
+
ref: g,
|
|
178
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ y(I, { children: [
|
|
184
|
+
/* @__PURE__ */ i(ae, { titleId: l.titleId }),
|
|
185
|
+
/* @__PURE__ */ i(se, { contentRef: d, descriptionId: l.descriptionId })
|
|
186
|
+
] })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
), N = "DialogTitle", S = s.forwardRef(
|
|
190
|
+
(e, o) => {
|
|
191
|
+
const { __scopeDialog: n, ...a } = e, r = u(N, n);
|
|
192
|
+
return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
S.displayName = N;
|
|
196
|
+
var W = "DialogDescription", k = s.forwardRef(
|
|
197
|
+
(e, o) => {
|
|
198
|
+
const { __scopeDialog: n, ...a } = e, r = u(W, n);
|
|
199
|
+
return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
k.displayName = W;
|
|
203
|
+
var G = "DialogClose", L = s.forwardRef(
|
|
204
|
+
(e, o) => {
|
|
205
|
+
const { __scopeDialog: n, ...a } = e, r = u(G, n);
|
|
206
|
+
return /* @__PURE__ */ i(
|
|
207
|
+
m.button,
|
|
208
|
+
{
|
|
209
|
+
type: "button",
|
|
210
|
+
...a,
|
|
211
|
+
ref: o,
|
|
212
|
+
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
L.displayName = G;
|
|
218
|
+
function P(e) {
|
|
219
|
+
return e ? "open" : "closed";
|
|
220
|
+
}
|
|
221
|
+
var $ = "DialogTitleWarning", [Pe, B] = V($, {
|
|
222
|
+
contentName: f,
|
|
223
|
+
titleName: N,
|
|
224
|
+
docsSlug: "dialog"
|
|
225
|
+
}), ae = ({ titleId: e }) => {
|
|
226
|
+
const o = B($), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
|
|
227
|
+
|
|
228
|
+
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
229
|
+
|
|
230
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
|
|
231
|
+
return s.useEffect(() => {
|
|
232
|
+
e && (document.getElementById(e) || console.error(n));
|
|
233
|
+
}, [n, e]), null;
|
|
234
|
+
}, ie = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: o }) => {
|
|
235
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(ie).contentName}}.`;
|
|
236
|
+
return s.useEffect(() => {
|
|
237
|
+
var t;
|
|
238
|
+
const r = (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby");
|
|
239
|
+
o && r && (document.getElementById(o) || console.warn(a));
|
|
240
|
+
}, [a, e, o]), null;
|
|
241
|
+
}, ye = x, Ie = b, Oe = M, xe = w, Ae = S, Te = k, be = L;
|
|
242
|
+
export {
|
|
243
|
+
be as Close,
|
|
244
|
+
xe as Content,
|
|
245
|
+
Te as Description,
|
|
246
|
+
x as Dialog,
|
|
247
|
+
L as DialogClose,
|
|
248
|
+
w as DialogContent,
|
|
249
|
+
k as DialogDescription,
|
|
250
|
+
M as DialogOverlay,
|
|
251
|
+
b as DialogPortal,
|
|
252
|
+
S as DialogTitle,
|
|
253
|
+
ee as DialogTrigger,
|
|
254
|
+
Oe as Overlay,
|
|
255
|
+
Ie as Portal,
|
|
256
|
+
ye as Root,
|
|
257
|
+
Ae as Title,
|
|
258
|
+
Pe as WarningProvider,
|
|
259
|
+
Ne as createDialogScope
|
|
260
|
+
};
|