@seeqdev/qomponents 0.0.132 → 0.0.133
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/README.md +135 -135
- package/dist/Accordion/Accordion.js +8 -8
- package/dist/Accordion/Accordion.stories.js +114 -114
- package/dist/Accordion/Accordion.test.js +54 -54
- package/dist/Accordion/Accordion.types.js +1 -1
- package/dist/Accordion/index.js +1 -1
- package/dist/Alert/Alert.js +33 -33
- package/dist/Alert/Alert.stories.js +51 -51
- package/dist/Alert/Alert.test.js +50 -50
- package/dist/Alert/Alert.types.js +1 -1
- package/dist/Alert/index.js +1 -1
- package/dist/Button/Button.js +91 -91
- package/dist/Button/Button.stories.js +99 -99
- package/dist/Button/Button.test.js +48 -48
- package/dist/Button/Button.types.js +4 -4
- package/dist/Button/index.js +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +32 -32
- package/dist/ButtonGroup/ButtonGroup.stories.js +384 -384
- package/dist/ButtonGroup/ButtonGroup.test.js +66 -66
- package/dist/ButtonGroup/ButtonGroup.types.js +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonWithDropdown/ButtonWithDropdown.js +59 -59
- package/dist/ButtonWithDropdown/ButtonWithDropdown.stories.js +142 -142
- package/dist/ButtonWithDropdown/ButtonWithDropdown.test.js +92 -92
- package/dist/ButtonWithDropdown/ButtonWithDropdown.types.js +1 -1
- package/dist/ButtonWithDropdown/index.js +1 -1
- package/dist/ButtonWithPopover/ButtonWithPopover.js +61 -61
- package/dist/ButtonWithPopover/ButtonWithPopover.stories.js +74 -74
- package/dist/ButtonWithPopover/ButtonWithPopover.test.js +81 -81
- package/dist/ButtonWithPopover/ButtonWithPopover.types.js +1 -1
- package/dist/ButtonWithPopover/index.js +1 -1
- package/dist/Carousel/Carousel.js +66 -66
- package/dist/Carousel/Carousel.stories.js +114 -114
- package/dist/Carousel/Carousel.test.js +47 -47
- package/dist/Carousel/Carousel.types.js +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/Checkbox/Checkbox.js +25 -25
- package/dist/Checkbox/Checkbox.stories.js +33 -33
- package/dist/Checkbox/Checkbox.test.js +93 -93
- package/dist/Checkbox/Checkbox.types.js +1 -1
- package/dist/Checkbox/index.js +1 -1
- package/dist/Collapse/Collapse.js +17 -17
- package/dist/Collapse/Collapse.stories.js +36 -36
- package/dist/Collapse/Collapse.test.js +18 -18
- package/dist/Collapse/Collapse.types.js +1 -1
- package/dist/Collapse/index.js +1 -1
- package/dist/Icon/Icon.js +54 -54
- package/dist/Icon/Icon.stories.js +46 -46
- package/dist/Icon/Icon.test.js +54 -54
- package/dist/Icon/Icon.types.js +15 -15
- package/dist/Icon/index.js +1 -1
- package/dist/InputGroup/InputGroup.js +31 -31
- package/dist/InputGroup/InputGroup.stories.js +167 -167
- package/dist/InputGroup/InputGroup.test.js +42 -42
- package/dist/InputGroup/InputGroup.types.js +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/Modal/Modal.js +99 -99
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.stories.js +126 -126
- package/dist/Modal/Modal.test.js +107 -107
- package/dist/Modal/Modal.types.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/ProgressBar/ProgressBar.js +49 -29
- package/dist/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.stories.js +80 -72
- package/dist/ProgressBar/ProgressBar.stories.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.test.js +43 -37
- package/dist/ProgressBar/ProgressBar.test.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.types.d.ts +2 -0
- package/dist/ProgressBar/ProgressBar.types.js +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/SeeqActionDropdown/SeeqActionDropdown.js +47 -47
- package/dist/SeeqActionDropdown/SeeqActionDropdown.stories.js +79 -79
- package/dist/SeeqActionDropdown/SeeqActionDropdown.test.js +72 -72
- package/dist/SeeqActionDropdown/SeeqActionDropdown.types.js +1 -1
- package/dist/SeeqActionDropdown/index.js +1 -1
- package/dist/SeeqActionDropdown/variants.js +22 -22
- package/dist/Select/Select.js +173 -173
- package/dist/Select/Select.stories.js +79 -79
- package/dist/Select/Select.test.js +181 -181
- package/dist/Select/Select.types.js +1 -1
- package/dist/Select/index.js +2 -2
- package/dist/Slider/Slider.js +12 -12
- package/dist/Slider/Slider.stories.js +57 -57
- package/dist/Slider/Slider.test.js +32 -32
- package/dist/Slider/Slider.types.js +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/Tabs/Tabs.js +21 -21
- package/dist/Tabs/Tabs.stories.js +90 -90
- package/dist/Tabs/Tabs.test.js +90 -90
- package/dist/Tabs/Tabs.types.js +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/TextArea/TextArea.js +24 -24
- package/dist/TextArea/TextArea.stories.js +45 -45
- package/dist/TextArea/TextArea.test.js +67 -67
- package/dist/TextArea/TextArea.types.js +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/TextField/TextField.js +78 -78
- package/dist/TextField/TextField.stories.js +69 -69
- package/dist/TextField/TextField.test.js +38 -38
- package/dist/TextField/TextField.types.js +1 -1
- package/dist/TextField/index.js +1 -1
- package/dist/ToolbarButton/ToolbarButton.js +74 -74
- package/dist/ToolbarButton/ToolbarButton.stories.js +93 -93
- package/dist/ToolbarButton/ToolbarButton.test.js +92 -92
- package/dist/ToolbarButton/ToolbarButton.types.js +1 -1
- package/dist/ToolbarButton/index.js +1 -1
- package/dist/Tooltip/QTip.stories.js +44 -44
- package/dist/Tooltip/QTip.types.js +1 -1
- package/dist/Tooltip/QTipPerformance.stories.js +29 -29
- package/dist/Tooltip/Qtip.js +167 -167
- package/dist/Tooltip/Tooltip.js +35 -35
- package/dist/Tooltip/Tooltip.stories.js +31 -31
- package/dist/Tooltip/Tooltip.types.js +2 -2
- package/dist/Tooltip/TooltipPerformance.stories.js +29 -29
- package/dist/Tooltip/index.js +2 -2
- package/dist/Tooltip/qTip.utilities.js +10 -10
- package/dist/example/.eslintrc.cjs +14 -14
- package/dist/example/README.md +33 -33
- package/dist/example/index.html +13 -13
- package/dist/example/package.json +30 -30
- package/dist/example/src/ComplexSelectExample.tsx +81 -81
- package/dist/example/src/Example.tsx +408 -408
- package/dist/example/src/index.css +102 -102
- package/dist/example/src/main.tsx +10 -10
- package/dist/example/src/vite-env.d.ts +1 -1
- package/dist/example/tsconfig.json +33 -33
- package/dist/example/tsconfig.node.json +12 -12
- package/dist/example/vite.config.ts +12 -12
- package/dist/index.esm.js +1229 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1229 -31
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3714 -3709
- package/dist/types.js +1 -1
- package/dist/utils/browserId.js +28 -28
- package/dist/utils/svg.js +19 -19
- package/dist/utils/validateStyleDimension.js +13 -13
- package/dist/utils/validateStyleDimension.test.js +19 -19
- package/package.json +88 -86
package/dist/Modal/Modal.js
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import '../styles.css';
|
|
5
|
-
import Button from '../Button';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import TextField from '../TextField';
|
|
8
|
-
const Dialog = DialogPrimitive.Root;
|
|
9
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
10
|
-
const DialogClose = DialogPrimitive.Close;
|
|
11
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DialogPortal, null,
|
|
12
|
-
React.createElement("div", { className: "tw-select-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1009] tw-bg-sq-dark-background\
|
|
13
|
-
React.createElement(DialogPrimitive.Content, { ref: ref, className: `tw-fixed tw-left-[50%] tw-top-0 tw-my-6 tw-translate-x-[-50%] tw-z-[1010] tw-grid
|
|
14
|
-
tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
|
|
15
|
-
tw-rounded-lg ${className}`, ...props }, children))));
|
|
16
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
17
|
-
const DialogHeader = (props) => (React.createElement("div", { className: "tw-w-full tw-justify-between" },
|
|
18
|
-
React.createElement("div", { ...props })));
|
|
19
|
-
DialogHeader.displayName = 'DialogHeader';
|
|
20
|
-
const DialogFooter = (props) => React.createElement("div", { ...props });
|
|
21
|
-
DialogFooter.displayName = 'DialogFooter';
|
|
22
|
-
const DialogTitle = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Title, { ref: ref, ...props }));
|
|
23
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
24
|
-
const DialogDescription = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Description, { ref: ref, ...props }));
|
|
25
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
26
|
-
const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React.createElement(React.Fragment, null), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, }) => {
|
|
27
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
28
|
-
// the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (open) {
|
|
31
|
-
// Pushing the change to the end of the call stack
|
|
32
|
-
const timer = setTimeout(() => {
|
|
33
|
-
document.body.style.pointerEvents = '';
|
|
34
|
-
}, 0);
|
|
35
|
-
return () => clearTimeout(timer);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
document.body.style.pointerEvents = 'auto';
|
|
39
|
-
}
|
|
40
|
-
}, [open]);
|
|
41
|
-
const handleSubmit = async (e) => {
|
|
42
|
-
if (!onSubmit)
|
|
43
|
-
return;
|
|
44
|
-
try {
|
|
45
|
-
setIsLoading(true);
|
|
46
|
-
await onSubmit(e);
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
setIsLoading(false);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const renderTitle = () => {
|
|
53
|
-
let titleIconElement = React.createElement(React.Fragment, null);
|
|
54
|
-
if (titleIcon) {
|
|
55
|
-
if (typeof titleIcon === 'string') {
|
|
56
|
-
titleIconElement = (React.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
titleIconElement = React.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return (React.createElement(React.Fragment, null,
|
|
63
|
-
titleIcon && titleIconPosition === 'left' ? React.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) : React.createElement(React.Fragment, null),
|
|
64
|
-
React.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
|
|
65
|
-
React.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
|
|
66
|
-
titleError && React.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) : (customHeader ?? (React.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
|
|
67
|
-
React.createElement("div", { className: "tw-flex tw-items-center" },
|
|
68
|
-
React.createElement("h3", null, title),
|
|
69
|
-
titleSuffixLabel && React.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
|
|
70
|
-
subtitle && (React.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))))),
|
|
71
|
-
titleIcon && titleIconPosition === 'right' ? React.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React.createElement(React.Fragment, null)));
|
|
72
|
-
};
|
|
73
|
-
return open ? (React.createElement(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal },
|
|
74
|
-
React.createElement(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
|
|
75
|
-
'tw-max-w-xs': size === 'xs',
|
|
76
|
-
'tw-max-w-sm': size === 'sm',
|
|
77
|
-
'tw-max-w-md': size === 'md',
|
|
78
|
-
'tw-max-w-lg': size === 'lg',
|
|
79
|
-
'tw-max-w-xl': size === 'xl',
|
|
80
|
-
'tw-max-w-2xl': size === '2xl',
|
|
81
|
-
'tw-max-w-3xl': size === '3xl',
|
|
82
|
-
'tw-max-w-4xl': size === '4xl',
|
|
83
|
-
'tw-max-w-5xl': size === '5xl',
|
|
84
|
-
'tw-max-w-6xl': size === '6xl',
|
|
85
|
-
}, dialogClassName) },
|
|
86
|
-
React.createElement(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\
|
|
87
|
-
React.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
|
|
88
|
-
!hideCloseIcon && (React.createElement(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-cursor-pointer tw-ml-4", "data-testid": "closeButton" },
|
|
89
|
-
React.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7")))),
|
|
90
|
-
React.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
|
|
91
|
-
!hideFooterButtons && (React.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ?? (React.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
|
|
92
|
-
React.createElement("div", { className: "tw-flex tw-justify-start" }, customButton && (React.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant }))),
|
|
93
|
-
React.createElement("div", { className: "tw-flex tw-justify-end" },
|
|
94
|
-
React.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
|
|
95
|
-
!hideCancelButton && (React.createElement(DialogClose, { asChild: true },
|
|
96
|
-
React.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }))),
|
|
97
|
-
!hideSubmitButton && (React.createElement(Button, { label: submitButtonLabel, onClick: handleSubmit, disabled: disableSubmitButton || isLoading, variant: submitButtonVariant, stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, icon: isLoading ? 'fc-loading-notch tw-animate-spin' : undefined, iconPosition: "left", testId: "submitButton", extraClassNames: "tw-min-w-[100px]" })))))))))) : (React.createElement(React.Fragment, null));
|
|
98
|
-
};
|
|
99
|
-
export default Modal;
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import '../styles.css';
|
|
5
|
+
import Button from '../Button';
|
|
6
|
+
import Icon from '../Icon';
|
|
7
|
+
import TextField from '../TextField';
|
|
8
|
+
const Dialog = DialogPrimitive.Root;
|
|
9
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
10
|
+
const DialogClose = DialogPrimitive.Close;
|
|
11
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DialogPortal, null,
|
|
12
|
+
React.createElement("div", { className: "tw-select-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1009] tw-bg-sq-dark-background\n data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 " }),
|
|
13
|
+
React.createElement(DialogPrimitive.Content, { ref: ref, className: `tw-fixed tw-left-[50%] tw-top-0 tw-my-6 tw-translate-x-[-50%] tw-z-[1010] tw-grid
|
|
14
|
+
tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
|
|
15
|
+
tw-rounded-lg ${className}`, ...props }, children))));
|
|
16
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
17
|
+
const DialogHeader = (props) => (React.createElement("div", { className: "tw-w-full tw-justify-between" },
|
|
18
|
+
React.createElement("div", { ...props })));
|
|
19
|
+
DialogHeader.displayName = 'DialogHeader';
|
|
20
|
+
const DialogFooter = (props) => React.createElement("div", { ...props });
|
|
21
|
+
DialogFooter.displayName = 'DialogFooter';
|
|
22
|
+
const DialogTitle = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Title, { ref: ref, ...props }));
|
|
23
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
24
|
+
const DialogDescription = React.forwardRef((props, ref) => React.createElement(DialogPrimitive.Description, { ref: ref, ...props }));
|
|
25
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
26
|
+
const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, subtitle, children, open = false, onClose, customButton = false, customButtonLabel = 'Back', onClickCustomButton, submitButtonLabel = 'Submit', cancelButtonLabel = 'Cancel', disableSubmitButton = false, stopPropagationSubmitButton = false, onSubmit, isTitleEditable = false, onTitleChanged, inputExtraClassNames, hideCloseIcon = false, size = 'xl', titleIconPosition = 'left', hideFooterButtons = false, hideSubmitButton = false, hideCancelButton = false, testId = 'modal', modalFooter, dialogClassName, titlePlaceholder, titleRequired, titleError, submitButtonTooltip, cancelButtonTooltip, disableCustomButton, customHeader, middleFooterSection = React.createElement(React.Fragment, null), customButtonVariant = 'outline', submitButtonVariant = 'theme', keepFocusInsideModal = true, onPointerDownOutside, onInteractOutside, }) => {
|
|
27
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
28
|
+
// the Dialog is adding pointerEvents: none to body and the dropdowns from the modal does not work anymore
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (open) {
|
|
31
|
+
// Pushing the change to the end of the call stack
|
|
32
|
+
const timer = setTimeout(() => {
|
|
33
|
+
document.body.style.pointerEvents = '';
|
|
34
|
+
}, 0);
|
|
35
|
+
return () => clearTimeout(timer);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
document.body.style.pointerEvents = 'auto';
|
|
39
|
+
}
|
|
40
|
+
}, [open]);
|
|
41
|
+
const handleSubmit = async (e) => {
|
|
42
|
+
if (!onSubmit)
|
|
43
|
+
return;
|
|
44
|
+
try {
|
|
45
|
+
setIsLoading(true);
|
|
46
|
+
await onSubmit(e);
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
setIsLoading(false);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const renderTitle = () => {
|
|
53
|
+
let titleIconElement = React.createElement(React.Fragment, null);
|
|
54
|
+
if (titleIcon) {
|
|
55
|
+
if (typeof titleIcon === 'string') {
|
|
56
|
+
titleIconElement = (React.createElement(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
titleIconElement = React.createElement("div", { className: "tw-mt-1.5" }, titleIcon);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return (React.createElement(React.Fragment, null,
|
|
63
|
+
titleIcon && titleIconPosition === 'left' ? React.createElement("div", { className: "tw-flex tw-mr-2" }, titleIconElement) : React.createElement(React.Fragment, null),
|
|
64
|
+
React.createElement(DialogTitle, { asChild: true }, isTitleEditable ? (React.createElement("div", { className: "tw-flex tw-w-full tw-items-center" },
|
|
65
|
+
React.createElement(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }),
|
|
66
|
+
titleError && React.createElement("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0" }, titleError))) : (customHeader ?? (React.createElement("div", { "data-testid": "modalTitle", className: "modal-title" },
|
|
67
|
+
React.createElement("div", { className: "tw-flex tw-items-center" },
|
|
68
|
+
React.createElement("h3", null, title),
|
|
69
|
+
titleSuffixLabel && React.createElement("span", { className: "tw-text-xl tw-pl-0.5" }, titleSuffixLabel)),
|
|
70
|
+
subtitle && (React.createElement("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle" }, subtitle)))))),
|
|
71
|
+
titleIcon && titleIconPosition === 'right' ? React.createElement("div", { className: "tw-flex tw-ml-4" }, titleIconElement) : React.createElement(React.Fragment, null)));
|
|
72
|
+
};
|
|
73
|
+
return open ? (React.createElement(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal },
|
|
74
|
+
React.createElement(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
|
|
75
|
+
'tw-max-w-xs': size === 'xs',
|
|
76
|
+
'tw-max-w-sm': size === 'sm',
|
|
77
|
+
'tw-max-w-md': size === 'md',
|
|
78
|
+
'tw-max-w-lg': size === 'lg',
|
|
79
|
+
'tw-max-w-xl': size === 'xl',
|
|
80
|
+
'tw-max-w-2xl': size === '2xl',
|
|
81
|
+
'tw-max-w-3xl': size === '3xl',
|
|
82
|
+
'tw-max-w-4xl': size === '4xl',
|
|
83
|
+
'tw-max-w-5xl': size === '5xl',
|
|
84
|
+
'tw-max-w-6xl': size === '6xl',
|
|
85
|
+
}, dialogClassName) },
|
|
86
|
+
React.createElement(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\n dark:tw-border-sq-dark-disabled-gray tw-border-0 tw-border-b tw-px-6 tw-py-4" },
|
|
87
|
+
React.createElement("div", { className: "tw-flex tw-w-full" }, renderTitle()),
|
|
88
|
+
!hideCloseIcon && (React.createElement(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-cursor-pointer tw-ml-4", "data-testid": "closeButton" },
|
|
89
|
+
React.createElement("span", { className: "tw-cursor-pointer" }, "\u00D7")))),
|
|
90
|
+
React.createElement(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true }, children),
|
|
91
|
+
!hideFooterButtons && (React.createElement(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4" }, modalFooter ?? (React.createElement("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter" },
|
|
92
|
+
React.createElement("div", { className: "tw-flex tw-justify-start" }, customButton && (React.createElement(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant }))),
|
|
93
|
+
React.createElement("div", { className: "tw-flex tw-justify-end" },
|
|
94
|
+
React.createElement("div", { className: "tw-flex tw-items-center" }, middleFooterSection),
|
|
95
|
+
!hideCancelButton && (React.createElement(DialogClose, { asChild: true },
|
|
96
|
+
React.createElement(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }))),
|
|
97
|
+
!hideSubmitButton && (React.createElement(Button, { label: submitButtonLabel, onClick: handleSubmit, disabled: disableSubmitButton || isLoading, variant: submitButtonVariant, stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, icon: isLoading ? 'fc-loading-notch tw-animate-spin' : undefined, iconPosition: "left", testId: "submitButton", extraClassNames: "tw-min-w-[100px]" })))))))))) : (React.createElement(React.Fragment, null));
|
|
98
|
+
};
|
|
99
|
+
export default Modal;
|
|
100
100
|
//# sourceMappingURL=Modal.js.map
|
package/dist/Modal/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,eAAe,CAAC;AAEvB,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAEpC,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC;AAE5C,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAE1C,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,E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,SAAS,EAAC,sCAAsC,iBAAa,aAAa;gBAC7E,6BAAK,SAAS,EAAC,0BAA0B,IACtC,YAAY,IAAI,CACf,oBAAC,MAAM,IACL,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,mBAAmB,EAC7B,eAAe,EAAC,mCAAmC,EACnD,MAAM,EAAC,cAAc,EACrB,OAAO,EAAE,mBAAmB,GAC5B,CACH,CACG;gBACN,6BAAK,SAAS,EAAC,wBAAwB;oBACrC,6BAAK,SAAS,EAAC,yBAAyB,IAAE,mBAAmB,CAAO;oBACnE,CAAC,gBAAgB,IAAI,CACpB,oBAAC,WAAW,IAAC,OAAO;wBAClB,oBAAC,MAAM,IACL,KAAK,EAAE,iBAAiB,EACxB,eAAe,EAAC,0BAA0B,EAC1C,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAC,SAAS,EACjB,eAAe,EAAE,KAAK,EACtB,MAAM,EAAC,cAAc,GACrB,CACU,CACf;oBACA,CAAC,gBAAgB,IAAI,CACpB,oBAAC,MAAM,IACL,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,mBAAmB,IAAI,SAAS,EAC1C,OAAO,EAAE,mBAAmB,EAC5B,eAAe,EAAE,2BAA2B,EAC5C,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,SAAS,EAChE,YAAY,EAAC,MAAM,EACnB,MAAM,EAAC,cAAc,EACrB,eAAe,EAAC,kBAAkB,GAClC,CACH,CACG,CACF,CACP,CACY,CAChB,CACa,CACT,CACV,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import Modal from './Modal';
|
|
3
|
-
import Button from '../Button';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Modal',
|
|
6
|
-
};
|
|
7
|
-
const modalBody = (React.createElement("div", null, "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."));
|
|
8
|
-
const waitUntil = async (timeout) => {
|
|
9
|
-
return new Promise((resolve) => {
|
|
10
|
-
setTimeout(() => resolve('yes'), timeout);
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
const ModalComponent = ({ bodyClass = '', title: originalTitle, titleIcon, isTitleEditable, children, hideCloseIcon, disableSubmitButton, size, buttonLabel = 'Open Modal', customButton, customButtonLabel, submitButtonVariant, onSubmit, }) => {
|
|
14
|
-
const [open, setOpen] = useState(false);
|
|
15
|
-
const [title, setTitle] = useState(originalTitle);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
return () => {
|
|
18
|
-
document.body.className = '';
|
|
19
|
-
};
|
|
20
|
-
}, []);
|
|
21
|
-
const onClose = () => {
|
|
22
|
-
document.body.className = '';
|
|
23
|
-
setOpen(false);
|
|
24
|
-
};
|
|
25
|
-
return (React.createElement("div", { className: "tw-p-4" },
|
|
26
|
-
React.createElement(Button, { onClick: () => {
|
|
27
|
-
document.body.className = bodyClass;
|
|
28
|
-
setOpen(true);
|
|
29
|
-
}, label: buttonLabel }),
|
|
30
|
-
React.createElement(Modal, { open: open, onClose: onClose, title: title, titleIcon: titleIcon, isTitleEditable: isTitleEditable, onTitleChanged: (event) => setTitle(event.target.value), hideCloseIcon: hideCloseIcon, disableSubmitButton: disableSubmitButton, size: size, onSubmit: onSubmit, customButton: customButton, submitButtonVariant: submitButtonVariant, onPointerDownOutside: onClose, customButtonLabel: customButtonLabel }, children)));
|
|
31
|
-
};
|
|
32
|
-
export const AllModalsVariants = () => {
|
|
33
|
-
const colors = ['Topic', 'Analysis', 'Datalab', 'Vantage'];
|
|
34
|
-
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'];
|
|
35
|
-
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" }, colors.map((color) => (React.createElement("div", { key: color },
|
|
36
|
-
React.createElement("b", null,
|
|
37
|
-
color,
|
|
38
|
-
" colors"),
|
|
39
|
-
React.createElement("div", { className: "tw-p-4 light" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}`, bodyClass: `color_${color.toLowerCase()}`, title: "Modal example", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))),
|
|
40
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}_dark`, bodyClass: `color_${color.toLowerCase()} tw-dark color_${color.toLowerCase()}_dark`, title: "Modal example", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))))))));
|
|
41
|
-
};
|
|
42
|
-
export const ModalsWithDisabledSubmit = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
43
|
-
React.createElement("div", null,
|
|
44
|
-
React.createElement("b", null, "Topic Colors"),
|
|
45
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
46
|
-
React.createElement(ModalComponent, { bodyClass: "color_topic", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
47
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
48
|
-
React.createElement(ModalComponent, { bodyClass: "color_topic tw-dark color_analysis_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody }))),
|
|
49
|
-
React.createElement("div", null,
|
|
50
|
-
React.createElement("b", null, "Analysis Colors"),
|
|
51
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
52
|
-
React.createElement(ModalComponent, { bodyClass: "color_analysis", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
53
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
54
|
-
React.createElement(ModalComponent, { bodyClass: "color_analysis tw-dark color_analysis_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody }))),
|
|
55
|
-
React.createElement("div", null,
|
|
56
|
-
React.createElement("b", null, "Datalab Colors"),
|
|
57
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
58
|
-
React.createElement(ModalComponent, { bodyClass: "color_datalab", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
59
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
60
|
-
React.createElement(ModalComponent, { bodyClass: "color_datalab tw-dark color_analysis_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody }))),
|
|
61
|
-
React.createElement("div", null,
|
|
62
|
-
React.createElement("b", null, "Vantage Colors"),
|
|
63
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
64
|
-
React.createElement(ModalComponent, { bodyClass: "color_vantage", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
65
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
66
|
-
React.createElement(ModalComponent, { bodyClass: "color_vantage tw-dark color_vantage_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })))));
|
|
67
|
-
export const ModalsWithEditableTitle = () => {
|
|
68
|
-
const colors = ['Topic', 'Analysis', 'Datalab', 'Vantage'];
|
|
69
|
-
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'];
|
|
70
|
-
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" }, colors.map((color) => (React.createElement("div", { key: color },
|
|
71
|
-
React.createElement("b", null,
|
|
72
|
-
color,
|
|
73
|
-
" colors"),
|
|
74
|
-
React.createElement("div", { className: "tw-p-4 light" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}`, bodyClass: `color_${color.toLowerCase()}`, title: "Editable title example", isTitleEditable: true, titleIcon: "fc-check", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))),
|
|
75
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}_dark`, bodyClass: `color_${color.toLowerCase()} tw-dark color_${color.toLowerCase()}_dark`, title: "Editable title example", isTitleEditable: true, titleIcon: "fc-check", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))))))));
|
|
76
|
-
};
|
|
77
|
-
export const ModalsWithCustomButton = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
78
|
-
React.createElement("div", null,
|
|
79
|
-
React.createElement("b", null, "Topic Colors"),
|
|
80
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
81
|
-
React.createElement(ModalComponent, { bodyClass: "color_topic", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
82
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
83
|
-
React.createElement(ModalComponent, { bodyClass: "color_topic tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" }))),
|
|
84
|
-
React.createElement("div", null,
|
|
85
|
-
React.createElement("b", null, "Analysis Colors"),
|
|
86
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
87
|
-
React.createElement(ModalComponent, { bodyClass: "color_analysis", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
88
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
89
|
-
React.createElement(ModalComponent, { bodyClass: "color_analysis tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" }))),
|
|
90
|
-
React.createElement("div", null,
|
|
91
|
-
React.createElement("b", null, "Datalab Colors"),
|
|
92
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
93
|
-
React.createElement(ModalComponent, { bodyClass: "color_datalab", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
94
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
95
|
-
React.createElement(ModalComponent, { bodyClass: "color_datalab tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" }))),
|
|
96
|
-
React.createElement("div", null,
|
|
97
|
-
React.createElement("b", null, "Vantage Colors"),
|
|
98
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
99
|
-
React.createElement(ModalComponent, { bodyClass: "color_vantage", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
100
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
101
|
-
React.createElement(ModalComponent, { bodyClass: "color_vantage tw-dark color_vantage_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })))));
|
|
102
|
-
export const ModalsWithVariantButton = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
103
|
-
React.createElement("div", null,
|
|
104
|
-
React.createElement("b", null, "Topic Colors"),
|
|
105
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
106
|
-
React.createElement(ModalComponent, { bodyClass: "color_topic", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "theme" })),
|
|
107
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
108
|
-
React.createElement(ModalComponent, { bodyClass: "color_topic tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "theme-light" }))),
|
|
109
|
-
React.createElement("div", null,
|
|
110
|
-
React.createElement("b", null, "Analysis Colors"),
|
|
111
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
112
|
-
React.createElement(ModalComponent, { bodyClass: "color_analysis", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "warning" })),
|
|
113
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
114
|
-
React.createElement(ModalComponent, { bodyClass: "color_analysis tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, submitButtonVariant: "danger", customButtonLabel: "Back" }))),
|
|
115
|
-
React.createElement("div", null,
|
|
116
|
-
React.createElement("b", null, "Datalab Colors"),
|
|
117
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
118
|
-
React.createElement(ModalComponent, { bodyClass: "color_datalab", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "outline" })),
|
|
119
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
120
|
-
React.createElement(ModalComponent, { bodyClass: "color_datalab tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, submitButtonVariant: "no-border", customButtonLabel: "Back" }))),
|
|
121
|
-
React.createElement("div", null,
|
|
122
|
-
React.createElement("b", null, "Vantage Colors"),
|
|
123
|
-
React.createElement("div", { className: "tw-p-4 light" },
|
|
124
|
-
React.createElement(ModalComponent, { bodyClass: "color_vantage", title: "Modal with custom button", children: modalBody, customButton: true, submitButtonVariant: "theme", customButtonLabel: "Back" })),
|
|
125
|
-
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
126
|
-
React.createElement(ModalComponent, { bodyClass: "color_vantage tw-dark color_vantage_dark", title: "Modal with custom button", children: modalBody, submitButtonVariant: "outline", customButton: true, customButtonLabel: "Back" })))));
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import Modal from './Modal';
|
|
3
|
+
import Button from '../Button';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Modal',
|
|
6
|
+
};
|
|
7
|
+
const modalBody = (React.createElement("div", null, "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."));
|
|
8
|
+
const waitUntil = async (timeout) => {
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
setTimeout(() => resolve('yes'), timeout);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const ModalComponent = ({ bodyClass = '', title: originalTitle, titleIcon, isTitleEditable, children, hideCloseIcon, disableSubmitButton, size, buttonLabel = 'Open Modal', customButton, customButtonLabel, submitButtonVariant, onSubmit, }) => {
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
const [title, setTitle] = useState(originalTitle);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
return () => {
|
|
18
|
+
document.body.className = '';
|
|
19
|
+
};
|
|
20
|
+
}, []);
|
|
21
|
+
const onClose = () => {
|
|
22
|
+
document.body.className = '';
|
|
23
|
+
setOpen(false);
|
|
24
|
+
};
|
|
25
|
+
return (React.createElement("div", { className: "tw-p-4" },
|
|
26
|
+
React.createElement(Button, { onClick: () => {
|
|
27
|
+
document.body.className = bodyClass;
|
|
28
|
+
setOpen(true);
|
|
29
|
+
}, label: buttonLabel }),
|
|
30
|
+
React.createElement(Modal, { open: open, onClose: onClose, title: title, titleIcon: titleIcon, isTitleEditable: isTitleEditable, onTitleChanged: (event) => setTitle(event.target.value), hideCloseIcon: hideCloseIcon, disableSubmitButton: disableSubmitButton, size: size, onSubmit: onSubmit, customButton: customButton, submitButtonVariant: submitButtonVariant, onPointerDownOutside: onClose, customButtonLabel: customButtonLabel }, children)));
|
|
31
|
+
};
|
|
32
|
+
export const AllModalsVariants = () => {
|
|
33
|
+
const colors = ['Topic', 'Analysis', 'Datalab', 'Vantage'];
|
|
34
|
+
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'];
|
|
35
|
+
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" }, colors.map((color) => (React.createElement("div", { key: color },
|
|
36
|
+
React.createElement("b", null,
|
|
37
|
+
color,
|
|
38
|
+
" colors"),
|
|
39
|
+
React.createElement("div", { className: "tw-p-4 light" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}`, bodyClass: `color_${color.toLowerCase()}`, title: "Modal example", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))),
|
|
40
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}_dark`, bodyClass: `color_${color.toLowerCase()} tw-dark color_${color.toLowerCase()}_dark`, title: "Modal example", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))))))));
|
|
41
|
+
};
|
|
42
|
+
export const ModalsWithDisabledSubmit = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
43
|
+
React.createElement("div", null,
|
|
44
|
+
React.createElement("b", null, "Topic Colors"),
|
|
45
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
46
|
+
React.createElement(ModalComponent, { bodyClass: "color_topic", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
47
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
48
|
+
React.createElement(ModalComponent, { bodyClass: "color_topic tw-dark color_analysis_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody }))),
|
|
49
|
+
React.createElement("div", null,
|
|
50
|
+
React.createElement("b", null, "Analysis Colors"),
|
|
51
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
52
|
+
React.createElement(ModalComponent, { bodyClass: "color_analysis", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
53
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
54
|
+
React.createElement(ModalComponent, { bodyClass: "color_analysis tw-dark color_analysis_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody }))),
|
|
55
|
+
React.createElement("div", null,
|
|
56
|
+
React.createElement("b", null, "Datalab Colors"),
|
|
57
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
58
|
+
React.createElement(ModalComponent, { bodyClass: "color_datalab", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
59
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
60
|
+
React.createElement(ModalComponent, { bodyClass: "color_datalab tw-dark color_analysis_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody }))),
|
|
61
|
+
React.createElement("div", null,
|
|
62
|
+
React.createElement("b", null, "Vantage Colors"),
|
|
63
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
64
|
+
React.createElement(ModalComponent, { bodyClass: "color_vantage", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })),
|
|
65
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
66
|
+
React.createElement(ModalComponent, { bodyClass: "color_vantage tw-dark color_vantage_dark", title: "Disabled submit button example", disableSubmitButton: true, children: modalBody })))));
|
|
67
|
+
export const ModalsWithEditableTitle = () => {
|
|
68
|
+
const colors = ['Topic', 'Analysis', 'Datalab', 'Vantage'];
|
|
69
|
+
const sizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'];
|
|
70
|
+
return (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" }, colors.map((color) => (React.createElement("div", { key: color },
|
|
71
|
+
React.createElement("b", null,
|
|
72
|
+
color,
|
|
73
|
+
" colors"),
|
|
74
|
+
React.createElement("div", { className: "tw-p-4 light" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}`, bodyClass: `color_${color.toLowerCase()}`, title: "Editable title example", isTitleEditable: true, titleIcon: "fc-check", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))),
|
|
75
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" }, sizes.map((size) => (React.createElement(ModalComponent, { key: `${size}_${color}_dark`, bodyClass: `color_${color.toLowerCase()} tw-dark color_${color.toLowerCase()}_dark`, title: "Editable title example", isTitleEditable: true, titleIcon: "fc-check", children: modalBody, size: size, buttonLabel: `Open ${size} size modal` })))))))));
|
|
76
|
+
};
|
|
77
|
+
export const ModalsWithCustomButton = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
78
|
+
React.createElement("div", null,
|
|
79
|
+
React.createElement("b", null, "Topic Colors"),
|
|
80
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
81
|
+
React.createElement(ModalComponent, { bodyClass: "color_topic", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
82
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
83
|
+
React.createElement(ModalComponent, { bodyClass: "color_topic tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" }))),
|
|
84
|
+
React.createElement("div", null,
|
|
85
|
+
React.createElement("b", null, "Analysis Colors"),
|
|
86
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
87
|
+
React.createElement(ModalComponent, { bodyClass: "color_analysis", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
88
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
89
|
+
React.createElement(ModalComponent, { bodyClass: "color_analysis tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" }))),
|
|
90
|
+
React.createElement("div", null,
|
|
91
|
+
React.createElement("b", null, "Datalab Colors"),
|
|
92
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
93
|
+
React.createElement(ModalComponent, { bodyClass: "color_datalab", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
94
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
95
|
+
React.createElement(ModalComponent, { bodyClass: "color_datalab tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" }))),
|
|
96
|
+
React.createElement("div", null,
|
|
97
|
+
React.createElement("b", null, "Vantage Colors"),
|
|
98
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
99
|
+
React.createElement(ModalComponent, { bodyClass: "color_vantage", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })),
|
|
100
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
101
|
+
React.createElement(ModalComponent, { bodyClass: "color_vantage tw-dark color_vantage_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back" })))));
|
|
102
|
+
export const ModalsWithVariantButton = () => (React.createElement("div", { className: "tw-grid tw-grid-cols-4 tw-gap-4" },
|
|
103
|
+
React.createElement("div", null,
|
|
104
|
+
React.createElement("b", null, "Topic Colors"),
|
|
105
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
106
|
+
React.createElement(ModalComponent, { bodyClass: "color_topic", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "theme" })),
|
|
107
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
108
|
+
React.createElement(ModalComponent, { bodyClass: "color_topic tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "theme-light" }))),
|
|
109
|
+
React.createElement("div", null,
|
|
110
|
+
React.createElement("b", null, "Analysis Colors"),
|
|
111
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
112
|
+
React.createElement(ModalComponent, { bodyClass: "color_analysis", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "warning" })),
|
|
113
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
114
|
+
React.createElement(ModalComponent, { bodyClass: "color_analysis tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, submitButtonVariant: "danger", customButtonLabel: "Back" }))),
|
|
115
|
+
React.createElement("div", null,
|
|
116
|
+
React.createElement("b", null, "Datalab Colors"),
|
|
117
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
118
|
+
React.createElement(ModalComponent, { bodyClass: "color_datalab", title: "Modal with custom button", children: modalBody, customButton: true, customButtonLabel: "Back", submitButtonVariant: "outline" })),
|
|
119
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
120
|
+
React.createElement(ModalComponent, { bodyClass: "color_datalab tw-dark color_analysis_dark", title: "Modal with custom button", children: modalBody, customButton: true, submitButtonVariant: "no-border", customButtonLabel: "Back" }))),
|
|
121
|
+
React.createElement("div", null,
|
|
122
|
+
React.createElement("b", null, "Vantage Colors"),
|
|
123
|
+
React.createElement("div", { className: "tw-p-4 light" },
|
|
124
|
+
React.createElement(ModalComponent, { bodyClass: "color_vantage", title: "Modal with custom button", children: modalBody, customButton: true, submitButtonVariant: "theme", customButtonLabel: "Back" })),
|
|
125
|
+
React.createElement("div", { className: "tw-p-4 tw-dark tw-bg-sq-dark-background" },
|
|
126
|
+
React.createElement(ModalComponent, { bodyClass: "color_vantage tw-dark color_vantage_dark", title: "Modal with custom button", children: modalBody, submitButtonVariant: "outline", customButton: true, customButtonLabel: "Back" })))));
|
|
127
127
|
//# sourceMappingURL=Modal.stories.js.map
|