@windstream/react-shared-components 0.1.24 → 0.1.26
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/contentful/index.d.ts +2 -1
- package/dist/contentful/index.esm.js +3 -3
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +1 -1
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +2 -2
- package/package.json +1 -1
- package/src/contentful/blocks/modal/index.tsx +99 -97
package/dist/core.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
|
|
|
63
63
|
size?: "slim" | "medium" | "large" | undefined;
|
|
64
64
|
label?: string | undefined;
|
|
65
65
|
errorText?: string | undefined;
|
|
66
|
-
prefixIconName?: "
|
|
66
|
+
prefixIconName?: "search" | "location_on" | undefined;
|
|
67
67
|
prefixIconSize?: 20 | 24 | 40 | 48 | undefined;
|
|
68
68
|
prefixIconFill?: boolean | undefined;
|
|
69
69
|
suffixIconFill?: boolean | undefined;
|
|
@@ -345,7 +345,7 @@ type ButtonAsAnchor = ButtonCustomProps & Omit<AnchorHTMLAttributes<HTMLAnchorEl
|
|
|
345
345
|
};
|
|
346
346
|
type ButtonProps = ButtonAsButton | ButtonAsAnchor;
|
|
347
347
|
|
|
348
|
-
declare const BrandButton: React__default.ForwardRefExoticComponent<ButtonProps$2 & React__default.RefAttributes<
|
|
348
|
+
declare const BrandButton: React__default.ForwardRefExoticComponent<ButtonProps$2 & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
349
349
|
|
|
350
350
|
declare const Checklist: React__default.FC<ChecklistProps>;
|
|
351
351
|
|
package/package.json
CHANGED
|
@@ -1,97 +1,99 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import {
|
|
5
|
-
backdropAnimationVariants,
|
|
6
|
-
contentAnimationVariants,
|
|
7
|
-
sizeToPixel,
|
|
8
|
-
} from "./constants";
|
|
9
|
-
import { ModalProps } from "./types";
|
|
10
|
-
import { motion } from "framer-motion";
|
|
11
|
-
|
|
12
|
-
import * as Dialog from "@radix-ui/react-dialog";
|
|
13
|
-
import { MaterialIcon } from "@shared/components/material-icon";
|
|
14
|
-
import { Text } from "@shared/components/text";
|
|
15
|
-
import { Button } from "@shared/contentful/blocks/button";
|
|
16
|
-
import { cx } from "@shared/utils";
|
|
17
|
-
|
|
18
|
-
type ExtendedModalProps = ModalProps & {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"mb-5
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import {
|
|
5
|
+
backdropAnimationVariants,
|
|
6
|
+
contentAnimationVariants,
|
|
7
|
+
sizeToPixel,
|
|
8
|
+
} from "./constants";
|
|
9
|
+
import { ModalProps } from "./types";
|
|
10
|
+
import { motion } from "framer-motion";
|
|
11
|
+
|
|
12
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
13
|
+
import { MaterialIcon } from "@shared/components/material-icon";
|
|
14
|
+
import { Text } from "@shared/components/text";
|
|
15
|
+
import { Button } from "@shared/contentful/blocks/button";
|
|
16
|
+
import { cx } from "@shared/utils";
|
|
17
|
+
|
|
18
|
+
type ExtendedModalProps = ModalProps & {
|
|
19
|
+
type?: "modal";
|
|
20
|
+
index?: 0;
|
|
21
|
+
};
|
|
22
|
+
export const Modal: React.FC<ExtendedModalProps> = props => {
|
|
23
|
+
const {
|
|
24
|
+
isOpen,
|
|
25
|
+
onRequestClose,
|
|
26
|
+
size,
|
|
27
|
+
title,
|
|
28
|
+
content,
|
|
29
|
+
description,
|
|
30
|
+
children,
|
|
31
|
+
bodyClassName,
|
|
32
|
+
type,
|
|
33
|
+
index,
|
|
34
|
+
} = props;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Dialog.Root
|
|
38
|
+
open={isOpen}
|
|
39
|
+
onOpenChange={() => isOpen && onRequestClose?.()}
|
|
40
|
+
>
|
|
41
|
+
<Dialog.Portal>
|
|
42
|
+
<motion.div
|
|
43
|
+
initial="closed"
|
|
44
|
+
animate={isOpen ? "open" : "closed"}
|
|
45
|
+
variants={backdropAnimationVariants}
|
|
46
|
+
transition={{ type: "tween", duration: 0.2, ease: "easeInOut" }}
|
|
47
|
+
className="fixed inset-0 z-[1000] bg-scrim-bg-modal"
|
|
48
|
+
>
|
|
49
|
+
<Dialog.Overlay />
|
|
50
|
+
</motion.div>
|
|
51
|
+
<motion.div
|
|
52
|
+
initial="closed"
|
|
53
|
+
animate={isOpen ? "open" : "closed"}
|
|
54
|
+
variants={contentAnimationVariants}
|
|
55
|
+
transition={{ type: "tween", duration: 0.3, ease: "easeInOut" }}
|
|
56
|
+
className="fixed left-1/2 top-1/2 z-[1001] w-auto -translate-x-1/2 -translate-y-1/2 focus:outline-none"
|
|
57
|
+
>
|
|
58
|
+
<Dialog.Content
|
|
59
|
+
className={cx(
|
|
60
|
+
"fixed left-[50%] top-[50%] w-[90vw] translate-x-[-50%] translate-y-[-50%] rounded-[6px] bg-bg p-[25px] shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] focus:outline-none",
|
|
61
|
+
bodyClassName
|
|
62
|
+
)}
|
|
63
|
+
style={{ maxWidth: sizeToPixel[size || "lg"] }}
|
|
64
|
+
>
|
|
65
|
+
<div data-section-type={type} data-section-index={index}>
|
|
66
|
+
<Dialog.Close asChild={true}>
|
|
67
|
+
<Button
|
|
68
|
+
showButtonAs="unstyled"
|
|
69
|
+
buttonClassName="absolute right-0 top-0 mr-2 mt-2 bg-bg"
|
|
70
|
+
>
|
|
71
|
+
<MaterialIcon name="close" />
|
|
72
|
+
</Button>
|
|
73
|
+
</Dialog.Close>
|
|
74
|
+
<div className="custom-modal-body max-h-[85vh] overflow-visible">
|
|
75
|
+
{title ? (
|
|
76
|
+
<Text
|
|
77
|
+
className={cx(
|
|
78
|
+
"mx-auto mb-3 mt-5 text-center",
|
|
79
|
+
"heading5 md:max-w-[80%] md:pt-0",
|
|
80
|
+
"mb-5 md:mb-[60px]"
|
|
81
|
+
)}
|
|
82
|
+
as="h2"
|
|
83
|
+
>
|
|
84
|
+
{title}
|
|
85
|
+
</Text>
|
|
86
|
+
) : null}
|
|
87
|
+
|
|
88
|
+
{description ? <Text as="div">{description}</Text> : null}
|
|
89
|
+
|
|
90
|
+
{content}
|
|
91
|
+
{children ? children : null}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</Dialog.Content>
|
|
95
|
+
</motion.div>
|
|
96
|
+
</Dialog.Portal>
|
|
97
|
+
</Dialog.Root>
|
|
98
|
+
);
|
|
99
|
+
};
|