@povio/ui 2.1.22 → 2.1.24
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/ActionModal.js +7 -6
- package/dist/Modal.js +2 -1
- package/dist/components/overlays/ActionModal/ActionModal.d.ts +6 -1
- package/dist/components/overlays/Modal/Modal.d.ts +2 -1
- package/dist/components/text/Typography/Typography.d.ts +1 -1
- package/dist/config/uiConfig.context.d.ts +2 -0
- package/dist/uiConfig.context.js +7 -0
- package/package.json +1 -1
package/dist/ActionModal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Typography } from "./Typography.js";
|
|
2
2
|
import { Button } from "./Button.js";
|
|
3
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
3
4
|
import { Modal } from "./Modal.js";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { clsx } from "clsx";
|
|
@@ -8,7 +9,8 @@ var textAlignClassMap = {
|
|
|
8
9
|
center: "text-center",
|
|
9
10
|
right: "text-right"
|
|
10
11
|
};
|
|
11
|
-
const ActionModal = ({ heading, description, primaryAction, secondaryAction, buttonSize = "m", textAlign = "left", modalClassName,...modalProps }) => {
|
|
12
|
+
const ActionModal = ({ heading, description, primaryAction, secondaryAction, buttonSize = "m", textAlign = "left", modalClassName, titleTypography, titleClassName, descriptionTypography, descriptionClassName,...modalProps }) => {
|
|
13
|
+
const ui = UIConfig.useConfig();
|
|
12
14
|
const textAlignClass = textAlignClassMap[textAlign];
|
|
13
15
|
return /* @__PURE__ */ jsxs(Modal, {
|
|
14
16
|
modalClassName: clsx("w-modal", modalClassName),
|
|
@@ -16,14 +18,13 @@ const ActionModal = ({ heading, description, primaryAction, secondaryAction, but
|
|
|
16
18
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
17
19
|
className: "flex flex-col gap-modal-gap-text",
|
|
18
20
|
children: [/* @__PURE__ */ jsx(Typography, {
|
|
19
|
-
|
|
20
|
-
variant: "prominent-1",
|
|
21
|
+
...titleTypography ?? ui.actionModal.titleTypography,
|
|
21
22
|
as: "h2",
|
|
22
|
-
className: clsx("text-text-default-1", textAlignClass),
|
|
23
|
+
className: clsx("text-text-default-1", textAlignClass, titleClassName),
|
|
23
24
|
children: heading
|
|
24
25
|
}), /* @__PURE__ */ jsx(Typography, {
|
|
25
|
-
|
|
26
|
-
className: clsx("text-text-default-1", textAlignClass),
|
|
26
|
+
...descriptionTypography ?? ui.actionModal.descriptionTypography,
|
|
27
|
+
className: clsx("text-text-default-1", textAlignClass, descriptionClassName),
|
|
27
28
|
children: description
|
|
28
29
|
})]
|
|
29
30
|
}), /* @__PURE__ */ jsxs("div", {
|
package/dist/Modal.js
CHANGED
|
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { Dialog, Modal, ModalOverlay } from "react-aria-components";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
const Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable = true, shouldCloseOnInteractOutside }) => {
|
|
10
|
+
const Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable = true, isKeyboardDismissable, shouldCloseOnInteractOutside }) => {
|
|
11
11
|
const { t } = useTranslation("ui");
|
|
12
12
|
const uiStyle = UIStyle.useConfig();
|
|
13
13
|
const modalMainCva = uiStyle?.modal?.mainCva ?? modalMain;
|
|
@@ -20,6 +20,7 @@ const Modal$1 = ({ isOpen, portalContainerRef, onClose, aside, children, modalCl
|
|
|
20
20
|
className: overlayClassName
|
|
21
21
|
}),
|
|
22
22
|
isDismissable,
|
|
23
|
+
isKeyboardDismissDisabled: !(isKeyboardDismissable ?? isDismissable),
|
|
23
24
|
isOpen,
|
|
24
25
|
shouldCloseOnInteractOutside: () => {
|
|
25
26
|
if (shouldCloseOnInteractOutside) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonVariantProps } from '../../buttons/Button/button.cva';
|
|
2
2
|
import { ModalProps } from '../Modal/Modal';
|
|
3
|
+
import { TypographyPropsCva } from '../../text/Typography/Typography';
|
|
3
4
|
interface ActionModalAction {
|
|
4
5
|
label: string;
|
|
5
6
|
onPress: () => void;
|
|
@@ -14,6 +15,10 @@ export interface ActionModalProps extends ModalProps {
|
|
|
14
15
|
secondaryAction?: ActionModalAction;
|
|
15
16
|
buttonSize?: ButtonVariantProps["size"];
|
|
16
17
|
textAlign?: "left" | "center" | "right";
|
|
18
|
+
titleTypography?: TypographyPropsCva;
|
|
19
|
+
titleClassName?: string;
|
|
20
|
+
descriptionTypography?: TypographyPropsCva;
|
|
21
|
+
descriptionClassName?: string;
|
|
17
22
|
}
|
|
18
|
-
export declare const ActionModal: ({ heading, description, primaryAction, secondaryAction, buttonSize, textAlign, modalClassName, ...modalProps }: ActionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ActionModal: ({ heading, description, primaryAction, secondaryAction, buttonSize, textAlign, modalClassName, titleTypography, titleClassName, descriptionTypography, descriptionClassName, ...modalProps }: ActionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
24
|
export {};
|
|
@@ -9,6 +9,7 @@ export interface ModalProps extends ModalVariantProps {
|
|
|
9
9
|
overlayClassName?: string;
|
|
10
10
|
showCloseIcon?: boolean;
|
|
11
11
|
isDismissable?: boolean;
|
|
12
|
+
isKeyboardDismissable?: boolean;
|
|
12
13
|
shouldCloseOnInteractOutside?: () => boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable, shouldCloseOnInteractOutside, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Modal: ({ isOpen, portalContainerRef, onClose, aside, children, modalClassName, closeIconClassName, overlayClassName, showCloseIcon, isDismissable, isKeyboardDismissable, shouldCloseOnInteractOutside, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, Ref } from 'react';
|
|
2
2
|
import { TypographyVariantProps } from './typography.cva';
|
|
3
3
|
type TypographyTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div";
|
|
4
|
-
interface TypographyPropsCva extends Omit<TypographyVariantProps, "size">, Required<Pick<TypographyVariantProps, "size">> {
|
|
4
|
+
export interface TypographyPropsCva extends Omit<TypographyVariantProps, "size">, Required<Pick<TypographyVariantProps, "size">> {
|
|
5
5
|
}
|
|
6
6
|
export interface TypographyProps extends TypographyPropsCva, HTMLAttributes<HTMLElement> {
|
|
7
7
|
ref?: Ref<HTMLHeadingElement>;
|
|
@@ -7,6 +7,7 @@ import { RadioGroupProps } from '../components/inputs/RadioGroup/RadioGroup';
|
|
|
7
7
|
import { SelectBaseProps } from '../components/inputs/Selection/shared/SelectBase';
|
|
8
8
|
import { SliderProps } from '../components/inputs/Slider/Slider';
|
|
9
9
|
import { ToggleProps } from '../components/inputs/Toggle/Toggle';
|
|
10
|
+
import { ActionModalProps } from '../components/overlays/ActionModal/ActionModal';
|
|
10
11
|
export declare namespace UIConfig {
|
|
11
12
|
type DeepRequired<T> = {
|
|
12
13
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
@@ -20,6 +21,7 @@ export declare namespace UIConfig {
|
|
|
20
21
|
toggle: Pick<ToggleProps, "variant">;
|
|
21
22
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
22
23
|
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry">;
|
|
24
|
+
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
23
25
|
}
|
|
24
26
|
interface ProviderProps {
|
|
25
27
|
config?: Partial<Options>;
|
package/dist/uiConfig.context.js
CHANGED
|
@@ -36,6 +36,13 @@ let UIConfig;
|
|
|
36
36
|
todayIcon: false,
|
|
37
37
|
shouldForceLeadingZeros: false,
|
|
38
38
|
disableManualEntry: false
|
|
39
|
+
},
|
|
40
|
+
actionModal: {
|
|
41
|
+
titleTypography: {
|
|
42
|
+
size: "title-5",
|
|
43
|
+
variant: "prominent-1"
|
|
44
|
+
},
|
|
45
|
+
descriptionTypography: { size: "body-3" }
|
|
39
46
|
}
|
|
40
47
|
};
|
|
41
48
|
const Context = createContext(DEFAULT_CONFIG);
|