@hellobetterdigitalnz/selwynui 0.0.1-58 → 0.0.1-59
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/Components/DataDisplay/BrandBuilderTool/BrandBuilderTool.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolMain/BrandBuilderToolMain.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolMain/BrandBuilderToolMainProps.d.ts +5 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolProps.d.ts +7 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateItem.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateItemProps.d.ts +8 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateSelector.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateSelectorProps.d.ts +6 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolUploader/BrandBuilderToolUploader.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolUploader/BrandBuilderToolUploaderProps.d.ts +6 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolWrapper/BrandBuilderToolWrapper.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolWrapper/BrandBuilderToolWrapperProps.d.ts +6 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandbuilderToolPreview/BrandBuilderToolPreview.d.ts +3 -0
- package/dist/Components/DataDisplay/BrandBuilderTool/BrandbuilderToolPreview/BrandBuilderToolPreviewProps.d.ts +6 -0
- package/dist/Components/DataDisplay/ContactsBlock/ContactItemProps.d.ts +1 -0
- package/dist/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.d.ts +1 -1
- package/dist/Components/DataDisplay/ListingDetailBlock/ListingDetailBlockProps.d.ts +1 -1
- package/dist/Components/DataDisplay/Modal/Modal.d.ts +3 -0
- package/dist/Components/DataDisplay/Modal/ModalActions.d.ts +3 -0
- package/dist/Components/DataDisplay/Modal/ModalActionsLeft.d.ts +3 -0
- package/dist/Components/DataDisplay/Modal/ModalActionsLeftProps.d.ts +6 -0
- package/dist/Components/DataDisplay/Modal/ModalActionsProps.d.ts +6 -0
- package/dist/Components/DataDisplay/Modal/ModalActionsRight.d.ts +3 -0
- package/dist/Components/DataDisplay/Modal/ModalActionsRightProps.d.ts +6 -0
- package/dist/Components/DataDisplay/Modal/ModalBody.d.ts +3 -0
- package/dist/Components/DataDisplay/Modal/ModalBodyProps.d.ts +6 -0
- package/dist/Components/DataDisplay/Modal/ModalCurtain.d.ts +2 -0
- package/dist/Components/DataDisplay/Modal/ModalHeader.d.ts +3 -0
- package/dist/Components/DataDisplay/Modal/ModalHeaderProps.d.ts +9 -0
- package/dist/Components/DataDisplay/Modal/ModalProps.d.ts +7 -0
- package/dist/Components/DataDisplay/index.d.ts +28 -0
- package/dist/Components/SelwynUIProvider/SelwynUIContext.d.ts +9 -0
- package/dist/Components/SelwynUIProvider/SelwynUIProvider.d.ts +6 -0
- package/dist/Components/SelwynUIProvider/index.d.ts +2 -0
- package/dist/Components/index.d.ts +1 -0
- package/dist/index.cjs.js +250 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +41326 -5453
- package/dist/index.es.js.map +1 -1
- package/dist/selwynui.css +1 -1
- package/package.json +1 -1
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderTool.stories.tsx +53 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderTool.tsx +23 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolMain/BrandBuilderToolMain.tsx +13 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolMain/BrandBuilderToolMainProps.tsx +7 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolProps.tsx +9 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateItem.tsx +17 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateItemProps.tsx +10 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateSelector.tsx +26 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateSelectorProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolUploader/BrandBuilderToolUploader.tsx +30 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolUploader/BrandBuilderToolUploaderProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolWrapper/BrandBuilderToolWrapper.tsx +17 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolWrapper/BrandBuilderToolWrapperProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandbuilderToolPreview/BrandBuilderToolPreview.tsx +25 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandbuilderToolPreview/BrandBuilderToolPreviewProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/brandBuilder.module.scss +193 -0
- package/src/Components/DataDisplay/ContactsBlock/ContactItem.tsx +36 -27
- package/src/Components/DataDisplay/ContactsBlock/ContactItemProps.tsx +6 -5
- package/src/Components/DataDisplay/ContactsBlock/ContactsBlock.stories.tsx +13 -1
- package/src/Components/DataDisplay/ContactsBlock/contactsBlock.module.scss +151 -127
- package/src/Components/DataDisplay/ContentBlock/ContentBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/ImageContent/ImageContent.stories.tsx +1 -1
- package/src/Components/DataDisplay/KPIBlock/KPIBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/ListBlock/ListBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.stories.tsx +2 -2
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.tsx +7 -7
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlockProps.tsx +1 -1
- package/src/Components/DataDisplay/Media/Media.stories.tsx +1 -1
- package/src/Components/DataDisplay/Media/Media.tsx +0 -2
- package/src/Components/DataDisplay/Modal/Modal.stories.tsx +89 -0
- package/src/Components/DataDisplay/Modal/Modal.tsx +16 -0
- package/src/Components/DataDisplay/Modal/ModalActions.tsx +14 -0
- package/src/Components/DataDisplay/Modal/ModalActionsLeft.tsx +13 -0
- package/src/Components/DataDisplay/Modal/ModalActionsLeftProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalActionsProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalActionsRight.tsx +14 -0
- package/src/Components/DataDisplay/Modal/ModalActionsRightProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalBody.tsx +14 -0
- package/src/Components/DataDisplay/Modal/ModalBodyProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalCurtain.tsx +6 -0
- package/src/Components/DataDisplay/Modal/ModalHeader.tsx +55 -0
- package/src/Components/DataDisplay/Modal/ModalHeaderProps.tsx +10 -0
- package/src/Components/DataDisplay/Modal/ModalProps.tsx +9 -0
- package/src/Components/DataDisplay/Modal/modal.module.scss +178 -0
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/TestimonyCard/TestimonyCard.stories.tsx +1 -1
- package/src/Components/DataDisplay/TestimonyCard/TestimonyCard.tsx +6 -5
- package/src/Components/DataDisplay/TestimonyCard/testimonyCard.module.scss +22 -5
- package/src/Components/DataDisplay/index.ts +36 -1
- package/src/Components/SelwynUIProvider/SelwynUIContext.tsx +16 -0
- package/src/Components/SelwynUIProvider/SelwynUIProvider.tsx +46 -0
- package/src/Components/SelwynUIProvider/index.ts +2 -0
- package/src/Components/index.ts +1 -0
- package/src/Components/DataDisplay/ListingDetailBlock/listingDetailBlock.module.scss~ +0 -248
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.stories.tsx~ +0 -80
|
@@ -1,141 +1,165 @@
|
|
|
1
1
|
.contactsBlock {
|
|
2
|
-
background-color: var(--color-block-bg);
|
|
3
|
-
color: var(--color-block-text);
|
|
4
2
|
|
|
5
3
|
.contactsBlockHeader {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
padding-bottom: 36px;
|
|
5
|
+
font-size: var(--font-size-h3);
|
|
6
|
+
font-weight: 700;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
letter-spacing: -3.6px;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
h2 {
|
|
45
|
-
font-size: var(--font-size-h6);
|
|
46
|
-
font-weight: var(--font-weight-h4);
|
|
47
|
-
line-height: var(--line-height-h6);
|
|
48
|
-
letter-spacing: -0.56px;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.contactMiddleContent {
|
|
53
|
-
padding-block: 24px;
|
|
54
|
-
|
|
55
|
-
p {
|
|
56
|
-
font-size: var(--font-size-small);
|
|
57
|
-
font-weight: var(--font-weight-h4);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.contactLink {
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: space-between;
|
|
64
|
-
font-size: var(--font-size-regular-sm);
|
|
65
|
-
font-weight: var(--font-weight-bold);
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
11
|
+
.contactsCardsWrapper{
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
margin: -12px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.contactCard{
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: 12px;
|
|
20
|
+
|
|
21
|
+
.contactCardWrapper{
|
|
22
|
+
border:1px solid var(--pathway-card-border);
|
|
23
|
+
color: var(--pathway-card-text);
|
|
24
|
+
background-color: var(--pathway-card-bg);
|
|
25
|
+
transition: all 0.3s ease-in-out;
|
|
26
|
+
border-radius: 12px;
|
|
27
|
+
overflow: clip;
|
|
28
|
+
min-height: 592px;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
background-color: var(--pathway-card-hover-bg);
|
|
34
|
+
border:1px solid var(--pathway-card-hover-text);
|
|
35
|
+
|
|
36
|
+
.contactContentWrapper {
|
|
37
|
+
.contactCardHeader {
|
|
38
|
+
color: var(--pathway-card-hover-text);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
a{
|
|
42
|
+
color: var(--pathway-card-hover-text);
|
|
43
|
+
}
|
|
69
44
|
|
|
70
45
|
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
71
49
|
}
|
|
72
|
-
}
|
|
73
50
|
|
|
51
|
+
.cardImg{
|
|
52
|
+
position: relative;
|
|
53
|
+
height: 300px;
|
|
54
|
+
|
|
55
|
+
&:before{
|
|
56
|
+
content: '';
|
|
57
|
+
padding-top: 65.7%;
|
|
58
|
+
display: block;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
img{
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 0;
|
|
64
|
+
left: 0;
|
|
65
|
+
right: 0;
|
|
66
|
+
bottom: 0;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
object-fit: cover;
|
|
70
|
+
object-position: top;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.contactContentWrapper{
|
|
75
|
+
flex: 1;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
padding: 24px 24px 16px 24px;
|
|
79
|
+
|
|
80
|
+
.contactCardHeader{
|
|
81
|
+
margin-bottom: 44px;
|
|
82
|
+
color: var(--pathway-card-text);
|
|
83
|
+
|
|
84
|
+
h1,h2{
|
|
85
|
+
font-size: 28px;
|
|
86
|
+
letter-spacing: -0.56px;
|
|
87
|
+
line-height: 1.1;
|
|
88
|
+
font-family: var(--font);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
h1{
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
h2{
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.contactMiddleContent{
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
flex: 1;
|
|
105
|
+
margin-bottom: 20px;
|
|
106
|
+
|
|
107
|
+
a{
|
|
108
|
+
letter-spacing: -0.48px;
|
|
109
|
+
font-size: 24px;
|
|
110
|
+
font-weight: 400;
|
|
111
|
+
line-height: 1.3;
|
|
112
|
+
font-family: var(--font);
|
|
113
|
+
text-decoration: underline;
|
|
114
|
+
color: var(--pathway-card-text);
|
|
115
|
+
|
|
116
|
+
&:first-child{
|
|
117
|
+
margin-bottom: 8px;
|
|
118
|
+
}
|
|
74
119
|
|
|
75
|
-
@media screen and (min-width: 992px) {
|
|
76
|
-
.contactsBlock {
|
|
77
|
-
|
|
78
|
-
.contactsBlockHeader {
|
|
79
|
-
padding-bottom: 72px;
|
|
80
|
-
font-size: var(--font-size-h3);
|
|
81
120
|
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.contactLink{
|
|
124
|
+
|
|
125
|
+
a{
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
font-size: 14px;
|
|
129
|
+
font-weight: 700;
|
|
130
|
+
line-height: 1.4;
|
|
131
|
+
letter-spacing: -0.14px;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
color: var(--pathway-card-text);
|
|
134
|
+
|
|
135
|
+
svg{
|
|
136
|
+
width: 32px;
|
|
137
|
+
height: 32px;
|
|
138
|
+
}
|
|
82
139
|
|
|
83
|
-
.contactsCardsWrapper {
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-wrap: wrap;
|
|
86
|
-
flex-grow: 1;
|
|
87
|
-
gap: 24px;
|
|
88
|
-
width: 100%;
|
|
89
|
-
|
|
90
|
-
.contactCard {
|
|
91
|
-
border-radius: 12px;
|
|
92
|
-
width: 33.33%;
|
|
93
|
-
transition: all ease 0.3s;
|
|
94
|
-
|
|
95
|
-
img {
|
|
96
|
-
object-fit: cover;
|
|
97
|
-
border-radius: 12px 12px 0 0;
|
|
98
|
-
width: 100%;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.contactContentWrapper {
|
|
102
|
-
padding: 24px;
|
|
103
|
-
|
|
104
|
-
.contactCardHeader {
|
|
105
|
-
h1 {
|
|
106
|
-
font-size: var(--font-size-h6);
|
|
107
|
-
font-weight: var(--font-weight-bold);
|
|
108
|
-
line-height: var(--line-height-h6);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
h2 {
|
|
112
|
-
font-size: var(--font-size-h6);
|
|
113
|
-
font-weight: var(--font-weight-h4);
|
|
114
|
-
line-height: var(--line-height-h6);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.contactMiddleContent {
|
|
119
|
-
padding-block: 58px;
|
|
120
|
-
|
|
121
|
-
p {
|
|
122
|
-
font-size: var(--font-size-small);
|
|
123
|
-
font-weight: var(--font-weight-h4);
|
|
124
|
-
letter-spacing: -0.48px;
|
|
125
|
-
text-decoration: underline;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.contactLink {
|
|
130
|
-
display: flex;
|
|
131
|
-
justify-content: space-between;
|
|
132
|
-
font-size: var(--font-size-regular-sm);
|
|
133
|
-
font-weight: var(--font-weight-bold);
|
|
134
|
-
cursor: pointer;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
}
|
|
139
140
|
}
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@media screen and (min-width: 700px) {
|
|
149
|
+
|
|
150
|
+
.contactsBlockHeader {
|
|
151
|
+
padding-bottom: 72px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.contactCard{
|
|
155
|
+
width: 50%;
|
|
140
156
|
}
|
|
141
|
-
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media screen and (min-width: 1024px) {
|
|
160
|
+
.contactCard {
|
|
161
|
+
width: 33.33%;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
@@ -5,7 +5,7 @@ import ContentBlock from "./ContentBlock";
|
|
|
5
5
|
import ElementHolder from "../../Shared/ElementHolder/ElementHolder";
|
|
6
6
|
|
|
7
7
|
const meta: Meta = {
|
|
8
|
-
title: "
|
|
8
|
+
title: "DataDisplay / ContentBlock",
|
|
9
9
|
component: ContentBlock,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'fullscreen',
|
|
@@ -8,7 +8,7 @@ import ArrowRight from "../../Icons/Arrows/ArrowRight/ArrowRight.tsx";
|
|
|
8
8
|
import {Button} from "../../Form";
|
|
9
9
|
|
|
10
10
|
const meta: Meta = {
|
|
11
|
-
title: "
|
|
11
|
+
title: "DataDisplay / ListingDetailBlock",
|
|
12
12
|
component: ListingDetailBlock,
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: 'fullscreen',
|
|
@@ -24,7 +24,7 @@ export const Default: Story = {
|
|
|
24
24
|
render: () => (
|
|
25
25
|
<ElementHolder paddingTop="sm" paddingBottom="sm" pillar="visit" level="light">
|
|
26
26
|
<ListingDetailBlock
|
|
27
|
-
|
|
27
|
+
content={
|
|
28
28
|
<>
|
|
29
29
|
<h4>For beginners and kids the dedicated learner slope has gentle runs, easy sunkid carpet and platter lifts.</h4>
|
|
30
30
|
<br/>
|
|
@@ -5,11 +5,11 @@ import Container from "../../Shared/Container/Container.tsx";
|
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
6
|
|
|
7
7
|
const ListingDetailBlock = ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
content,
|
|
9
|
+
facilities,
|
|
10
|
+
callToActions = [],
|
|
11
|
+
callToActionButton,
|
|
12
|
+
}: ListingDetailBlockProps) => {
|
|
13
13
|
|
|
14
14
|
const renderIcon = (icon: ReactNode | string): ReactNode => {
|
|
15
15
|
if (typeof icon === 'string') {
|
|
@@ -23,9 +23,9 @@ const ListingDetailBlock = ({
|
|
|
23
23
|
<div className={styles.listingDetail}>
|
|
24
24
|
|
|
25
25
|
<div className={styles.mainContent}>
|
|
26
|
-
<div className={`typography`}>{
|
|
26
|
+
<div className={`typography`}>{content}</div>
|
|
27
27
|
|
|
28
|
-
<h3 className={styles.
|
|
28
|
+
<h3 className={styles.sectioncontent}>Facilities</h3>
|
|
29
29
|
<ul className={styles.facilitiesList}>
|
|
30
30
|
{facilities.map((facility, index) => (
|
|
31
31
|
<li key={index} className={styles.facilityItem}>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
|
|
4
|
+
import Modal from "./Modal.tsx";
|
|
5
|
+
import ModalHeader from "./ModalHeader.tsx";
|
|
6
|
+
import ModalBody from "./ModalBody.tsx";
|
|
7
|
+
import ModalActions from "./ModalActions.tsx";
|
|
8
|
+
import ModalActionsLeft from "./ModalActionsLeft.tsx";
|
|
9
|
+
import ModalActionsRight from "./ModalActionsRight.tsx";
|
|
10
|
+
import FormFieldHolder from "../../Form/FormFieldHolder/FormFieldHolder.tsx";
|
|
11
|
+
import TextField from "../../Form/TextField/TextField.tsx";
|
|
12
|
+
import Button from "../../Form/Button/Button.tsx";
|
|
13
|
+
import {SelwynUIContext, SelwynUIProvider} from "../../SelwynUIProvider";
|
|
14
|
+
|
|
15
|
+
const meta: Meta = {
|
|
16
|
+
title: "Data Display/Modal",
|
|
17
|
+
component: Modal,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
const ModalStoryContent = () => {
|
|
26
|
+
const context = useContext(SelwynUIContext);
|
|
27
|
+
|
|
28
|
+
const innerModal = (
|
|
29
|
+
<Modal>
|
|
30
|
+
<ModalHeader title="Inner Modal" canClose={true} canGoBack={false} />
|
|
31
|
+
<ModalBody>
|
|
32
|
+
<FormFieldHolder label="Inner Input">
|
|
33
|
+
<TextField />
|
|
34
|
+
</FormFieldHolder>
|
|
35
|
+
</ModalBody>
|
|
36
|
+
<ModalActions>
|
|
37
|
+
<ModalActionsRight>
|
|
38
|
+
<Button label="Close" size="large"
|
|
39
|
+
extraClass="btn-white-border" onClick={context.closeModal} />
|
|
40
|
+
</ModalActionsRight>
|
|
41
|
+
</ModalActions>
|
|
42
|
+
</Modal>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const outerModal = (
|
|
46
|
+
<Modal>
|
|
47
|
+
<ModalHeader title="Outer Modal" canClose={true} canGoBack={false} />
|
|
48
|
+
<ModalBody>
|
|
49
|
+
<FormFieldHolder label="Outer Input">
|
|
50
|
+
<TextField />
|
|
51
|
+
</FormFieldHolder>
|
|
52
|
+
</ModalBody>
|
|
53
|
+
<ModalActions>
|
|
54
|
+
<ModalActionsLeft></ModalActionsLeft>
|
|
55
|
+
<ModalActionsRight>
|
|
56
|
+
<div>
|
|
57
|
+
<Button label="Close" size="large"
|
|
58
|
+
extraClass="btn-white-border" onClick={context.closeModal} />
|
|
59
|
+
</div>
|
|
60
|
+
<div>
|
|
61
|
+
<Button label="Open Inner Modal" size="large" onClick={() => context.openModal(innerModal)} />
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
</ModalActionsRight>
|
|
65
|
+
</ModalActions>
|
|
66
|
+
</Modal>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Button
|
|
71
|
+
label="Open Modal"
|
|
72
|
+
onClick={() => {
|
|
73
|
+
context.openModal(outerModal);
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const ModalTemplate: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<SelwynUIProvider>
|
|
82
|
+
<ModalStoryContent />
|
|
83
|
+
</SelwynUIProvider>
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const Example = {
|
|
88
|
+
...ModalTemplate,
|
|
89
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import ModalProps from "./ModalProps";
|
|
2
|
+
import styles from "./modal.module.scss";
|
|
3
|
+
|
|
4
|
+
const Modal = (props: ModalProps) => {
|
|
5
|
+
const { children, extraClass, pillar = 'taste' } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className={`${styles.holder} ${pillar} ${extraClass} modalHolder`}>
|
|
9
|
+
<div className={`${styles.modal} modal`}>
|
|
10
|
+
<div className={`${styles.wrapper} modalWrapper`}>{children}</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default Modal;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ModalActionsProps from "./ModalActionsProps.tsx";
|
|
2
|
+
import styles from "./modal.module.scss"
|
|
3
|
+
|
|
4
|
+
const ModalActions = (props: ModalActionsProps) => {
|
|
5
|
+
|
|
6
|
+
const {children, extraClass =''} =props
|
|
7
|
+
|
|
8
|
+
return<div className={`${styles.modalAction} modalAction ${extraClass}`}>
|
|
9
|
+
{children}
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default ModalActions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ModalActionsLeftProps from "./ModalActionsLeftProps.tsx";
|
|
2
|
+
import styles from './modal.module.scss'
|
|
3
|
+
const ModalActionsLeft = (props: ModalActionsLeftProps) => {
|
|
4
|
+
|
|
5
|
+
const {children, extraClass ='' } =props
|
|
6
|
+
|
|
7
|
+
return <div className={`${styles.modalActionLeft} modalActionLeft ${extraClass}`}>
|
|
8
|
+
{children}
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default ModalActionsLeft;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ModalActionsRightProps from "./ModalActionsRightProps.tsx";
|
|
2
|
+
import styles from "./modal.module.scss"
|
|
3
|
+
|
|
4
|
+
const ModalActionsRight = (props:ModalActionsRightProps) => {
|
|
5
|
+
|
|
6
|
+
const {children, extraClass ='' } =props
|
|
7
|
+
|
|
8
|
+
return<div className={`${styles.modalActionRight} modalActionRight ${extraClass}`}>
|
|
9
|
+
{children}
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default ModalActionsRight;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ModalBodyProps from "./ModalBodyProps";
|
|
2
|
+
import styles from "./modal.module.scss";
|
|
3
|
+
|
|
4
|
+
const ModalBody = (props: ModalBodyProps) => {
|
|
5
|
+
const { children,extraClass =''} = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className={`${styles.modalBody} ${extraClass} modalBody`}>
|
|
9
|
+
<div className={`${styles.modalBodyWrapper} modalBodyWrapper`}>{children}</div>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default ModalBody;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import CaretLeft from "../../Icons/Arrows/CaretLeft/CaretLeft";
|
|
2
|
+
import XIcon from "../../Icons/MathsAndFinance/XIcon/XIcon";
|
|
3
|
+
import ModalHeaderProps from "./ModalHeaderProps";
|
|
4
|
+
import styles from "./modal.module.scss";
|
|
5
|
+
|
|
6
|
+
import {useContext} from "react";
|
|
7
|
+
import SelwynUIContext from "../../SelwynUIProvider/SelwynUIContext.tsx";
|
|
8
|
+
|
|
9
|
+
const ModalHeader = (props: ModalHeaderProps) => {
|
|
10
|
+
const {closeOnclick, canGoBackOnclick ,canGoBack, canClose, title, extraClass ='',} = props;
|
|
11
|
+
|
|
12
|
+
const context = useContext(SelwynUIContext);
|
|
13
|
+
|
|
14
|
+
const closeOnclickHandler = (e:any) => {
|
|
15
|
+
if (canClose) {
|
|
16
|
+
if (closeOnclick) {
|
|
17
|
+
closeOnclick(e);
|
|
18
|
+
}
|
|
19
|
+
context.closeModal();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const goBackOnclickHandler = (e:any) => {
|
|
24
|
+
if (canGoBack) {
|
|
25
|
+
if (canGoBackOnclick) {
|
|
26
|
+
canGoBackOnclick(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className={`${styles.modalHeader} ${extraClass}`}>
|
|
33
|
+
<div className={styles.modalHeaderWrapper}>
|
|
34
|
+
{!!canGoBack && (
|
|
35
|
+
<div onClick={goBackOnclickHandler} className={`${styles.caretLeft} ${styles.icon}`}>
|
|
36
|
+
<CaretLeft type="bold"/>
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
<div className={`${styles.heading} modalHeading`}>
|
|
40
|
+
{!!title && (
|
|
41
|
+
<h4>{title}</h4>
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
{!!canClose && (
|
|
45
|
+
<span className={`${styles.close} ${styles.icon}`}
|
|
46
|
+
onClick={closeOnclickHandler}>
|
|
47
|
+
<XIcon type="bold"/>
|
|
48
|
+
</span>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default ModalHeader;
|