@integrigo/integrigo-ui 1.6.18-a → 1.6.18-b
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/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/src/components/organisms/Modal/Modal.d.ts +1 -0
- package/lib/src/components/organisms/Modal/Modal.stories.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/organisms/Modal/Modal.stories.tsx +14 -1
- package/src/components/organisms/Modal/Modal.tsx +41 -17
@@ -3,3 +3,4 @@ import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
3
|
declare const _default: ComponentMeta<import("react").FCS<import("react").PropsWithChildren<import("./Modal").ModalProps>> & import("./Modal").ModalStaticProps>;
|
4
4
|
export default _default;
|
5
5
|
export declare const Basic: ComponentStory<import("react").FCS<import("react").PropsWithChildren<import("./Modal").ModalProps>> & import("./Modal").ModalStaticProps>;
|
6
|
+
export declare const WithSuffix: ComponentStory<import("react").FCS<import("react").PropsWithChildren<import("./Modal").ModalProps>> & import("./Modal").ModalStaticProps>;
|
package/package.json
CHANGED
@@ -16,7 +16,7 @@ export default {
|
|
16
16
|
const Template: ComponentStory<typeof Modal> = (args) => (
|
17
17
|
<>
|
18
18
|
Some other content
|
19
|
-
<Modal
|
19
|
+
<Modal {...args}>
|
20
20
|
hey
|
21
21
|
<Modal.Divider />
|
22
22
|
hey hey
|
@@ -26,3 +26,16 @@ const Template: ComponentStory<typeof Modal> = (args) => (
|
|
26
26
|
|
27
27
|
export const Basic = Template.bind({});
|
28
28
|
Basic.args = {};
|
29
|
+
|
30
|
+
export const WithSuffix = Template.bind({});
|
31
|
+
WithSuffix.args = {
|
32
|
+
suffix: (
|
33
|
+
<div>
|
34
|
+
This is a suffix
|
35
|
+
<p>a</p>
|
36
|
+
<p>b</p>
|
37
|
+
<p>c</p>
|
38
|
+
<p>d</p>
|
39
|
+
</div>
|
40
|
+
)
|
41
|
+
};
|
@@ -9,25 +9,33 @@ export interface ModalStaticProps {
|
|
9
9
|
|
10
10
|
export interface ModalProps {
|
11
11
|
show: boolean;
|
12
|
+
suffix?: React.ReactNode;
|
12
13
|
onClose: () => void;
|
13
14
|
}
|
14
15
|
|
15
16
|
export const Modal: React.FCS<PropsWithChildren<ModalProps>> &
|
16
|
-
ModalStaticProps = ({ className, children, show, onClose }) => {
|
17
|
+
ModalStaticProps = ({ className, children, show, suffix, onClose }) => {
|
17
18
|
if (!show) {
|
18
19
|
return null;
|
19
20
|
}
|
20
21
|
|
22
|
+
console.log(suffix);
|
23
|
+
|
21
24
|
return (
|
22
25
|
<Root>
|
23
|
-
<
|
24
|
-
<
|
25
|
-
<
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
<PageCenter>
|
27
|
+
<Content>
|
28
|
+
<ModalCard size="s" flat className={className}>
|
29
|
+
<CloseModal>
|
30
|
+
<CloseIcon onClick={onClose}>
|
31
|
+
<Icon type="close" />
|
32
|
+
</CloseIcon>
|
33
|
+
</CloseModal>
|
34
|
+
{children}
|
35
|
+
</ModalCard>
|
36
|
+
<Suffix>{suffix}</Suffix>
|
37
|
+
</Content>
|
38
|
+
</PageCenter>
|
31
39
|
</Root>
|
32
40
|
);
|
33
41
|
};
|
@@ -39,7 +47,7 @@ const Root = styled.div`
|
|
39
47
|
left: 0;
|
40
48
|
top: 0;
|
41
49
|
width: 100%;
|
42
|
-
height: 100%;
|
50
|
+
min-height: 100%;
|
43
51
|
z-index: 100;
|
44
52
|
|
45
53
|
&::after {
|
@@ -54,15 +62,27 @@ const Root = styled.div`
|
|
54
62
|
}
|
55
63
|
`;
|
56
64
|
|
57
|
-
const
|
58
|
-
padding: var(--padding-s);
|
65
|
+
const PageCenter = styled.div`
|
59
66
|
position: fixed;
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
67
|
+
height: 100%;
|
68
|
+
width: 100%;
|
69
|
+
display: flex;
|
70
|
+
align-items: center;
|
71
|
+
justify-content: center;
|
65
72
|
z-index: 101;
|
73
|
+
overflow-y: auto;
|
74
|
+
padding: var(--padding-m);
|
75
|
+
`;
|
76
|
+
|
77
|
+
const Content = styled.div`
|
78
|
+
height: auto;
|
79
|
+
width: calc(100vw - 2 * var(--padding-m));
|
80
|
+
max-width: 320px;
|
81
|
+
margin: auto;
|
82
|
+
`;
|
83
|
+
|
84
|
+
const ModalCard = styled(Card)`
|
85
|
+
padding: var(--padding-s);
|
66
86
|
`;
|
67
87
|
|
68
88
|
const CloseModal = styled.div`
|
@@ -85,3 +105,7 @@ const CloseIcon = styled.button`
|
|
85
105
|
}
|
86
106
|
}
|
87
107
|
`;
|
108
|
+
|
109
|
+
const Suffix = styled.div`
|
110
|
+
padding: var(--padding-m) 0;
|
111
|
+
`;
|