@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/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?: "location_on" | "search" | undefined;
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<HTMLAnchorElement | HTMLButtonElement>>;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -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
- containerAttributes?: React.HTMLAttributes<HTMLDivElement>;
20
- };
21
- export const Modal: React.FC<ExtendedModalProps> = props => {
22
- const {
23
- isOpen,
24
- onRequestClose,
25
- size,
26
- title,
27
- content,
28
- description,
29
- children,
30
- bodyClassName,
31
- containerAttributes,
32
- } = props;
33
-
34
- return (
35
- <Dialog.Root
36
- open={isOpen}
37
- onOpenChange={() => isOpen && onRequestClose?.()}
38
- >
39
- <Dialog.Portal>
40
- <motion.div
41
- initial="closed"
42
- animate={isOpen ? "open" : "closed"}
43
- variants={backdropAnimationVariants}
44
- transition={{ type: "tween", duration: 0.2, ease: "easeInOut" }}
45
- className="fixed inset-0 z-[1000] bg-scrim-bg-modal"
46
- >
47
- <Dialog.Overlay />
48
- </motion.div>
49
- <motion.div
50
- initial="closed"
51
- animate={isOpen ? "open" : "closed"}
52
- variants={contentAnimationVariants}
53
- transition={{ type: "tween", duration: 0.3, ease: "easeInOut" }}
54
- className="fixed left-1/2 top-1/2 z-[1001] w-auto -translate-x-1/2 -translate-y-1/2 focus:outline-none"
55
- >
56
- <Dialog.Content
57
- className={cx(
58
- "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",
59
- bodyClassName
60
- )}
61
- style={{ maxWidth: sizeToPixel[size || "lg"] }}
62
- >
63
- <div {...containerAttributes}>
64
- <Dialog.Close asChild={true}>
65
- <Button
66
- showButtonAs="unstyled"
67
- buttonClassName="absolute right-0 top-0 mr-2 mt-2 bg-bg"
68
- >
69
- <MaterialIcon name="close" />
70
- </Button>
71
- </Dialog.Close>
72
- <div className="custom-modal-body max-h-[85vh] overflow-visible">
73
- {title ? (
74
- <Text
75
- className={cx(
76
- "mx-auto mb-3 mt-5 text-center",
77
- "heading5 md:max-w-[80%] md:pt-0",
78
- "mb-5 md:mb-[60px]"
79
- )}
80
- as="h2"
81
- >
82
- {title}
83
- </Text>
84
- ) : null}
85
-
86
- {description ? <Text as="div">{description}</Text> : null}
87
-
88
- {content}
89
- {children ? children : null}
90
- </div>
91
- </div>
92
- </Dialog.Content>
93
- </motion.div>
94
- </Dialog.Portal>
95
- </Dialog.Root>
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
+ };