@pareto-engineering/design-system 4.0.0-alpha.69 → 4.0.0-alpha.72
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/.storybook/preview.js +29 -12
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +0 -1
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/cjs/a/AppContext/ContextProvider.js +2 -0
- package/dist/cjs/{c/ContentSlides/common/Slide/Slide.js → a/LexicalPreview/LexicalPreview.js} +43 -28
- package/dist/cjs/{c/ContentSlides/common/HorizontalMenu → a/LexicalPreview}/index.js +3 -3
- package/dist/cjs/a/LexicalPreview/styles.scss +46 -0
- package/dist/cjs/a/People/common/Person/Person.js +7 -2
- package/dist/cjs/a/ProgressBar/ProgressBar.js +3 -3
- package/dist/cjs/a/ProgressBar/styles.scss +11 -1
- package/dist/cjs/a/XMLEditor/XMLEditor.js +123 -0
- package/dist/cjs/{c/ContentSlides/common/Slide → a/XMLEditor/common}/index.js +3 -3
- package/dist/cjs/a/XMLEditor/common/theme.js +186 -0
- package/dist/cjs/{c/ContentSlides/common/Navigator → a/XMLEditor}/index.js +3 -3
- package/dist/cjs/a/XMLEditor/styles.scss +17 -0
- package/dist/cjs/a/index.js +15 -1
- package/dist/cjs/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +125 -0
- package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +112 -0
- package/dist/cjs/{c/ContentSlides/common/Sidebar → b/ExpandableLexicalPreview/common/ExpandButton}/index.js +3 -3
- package/dist/cjs/b/ExpandableLexicalPreview/common/index.js +12 -0
- package/dist/cjs/b/ExpandableLexicalPreview/index.js +13 -0
- package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/dist/cjs/b/Logo/Logo.js +0 -1
- package/dist/cjs/b/Title/Title.js +0 -1
- package/dist/cjs/b/index.js +8 -1
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
- package/dist/cjs/c/index.js +0 -13
- package/dist/cjs/f/FormInput/FormInput.js +2 -0
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +14 -3
- package/dist/cjs/f/fields/EditorInput/common/StopPropagationPlugin.js +30 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +7 -0
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +11 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
- package/dist/cjs/index.js +0 -11
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +0 -1
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/es/a/BlurOverlay/BlurOverlay.js +0 -1
- package/dist/es/a/DotInfo/DotInfo.js +0 -1
- package/dist/es/a/LexicalPreview/LexicalPreview.js +80 -0
- package/dist/es/a/LexicalPreview/index.js +2 -0
- package/dist/es/a/LexicalPreview/styles.scss +46 -0
- package/dist/es/a/People/common/Person/Person.js +22 -15
- package/dist/es/a/ProgressBar/ProgressBar.js +3 -3
- package/dist/es/a/ProgressBar/styles.scss +11 -1
- package/dist/es/a/XMLEditor/XMLEditor.js +112 -0
- package/dist/es/a/XMLEditor/common/index.js +1 -0
- package/dist/es/a/XMLEditor/common/theme.js +180 -0
- package/dist/es/a/XMLEditor/index.js +1 -0
- package/dist/es/a/XMLEditor/styles.scss +17 -0
- package/dist/es/a/index.js +3 -1
- package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +115 -0
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +102 -0
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
- package/dist/es/b/ExpandableLexicalPreview/common/index.js +1 -0
- package/dist/es/b/ExpandableLexicalPreview/index.js +2 -0
- package/dist/es/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/dist/es/b/Logo/Logo.js +0 -1
- package/dist/es/b/Title/Title.js +0 -1
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
- package/dist/es/c/index.js +0 -1
- package/dist/es/f/fields/EditorInput/EditorInput.js +15 -4
- package/dist/es/f/fields/EditorInput/common/StopPropagationPlugin.js +23 -0
- package/dist/es/f/fields/EditorInput/common/index.js +2 -1
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +11 -1
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
- package/dist/es/index.js +0 -1
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/package.json +7 -5
- package/src/stories/StyleGuide/ai-icons.stories.mdx +27 -0
- package/src/stories/StyleGuide/icons.stories.mdx +22 -22
- package/src/stories/a/LexicalPreview.stories.jsx +28 -0
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/a/XMLEditor.stories.jsx +21 -0
- package/src/stories/b/ExpandableLexicalPreview.stories.jsx +29 -0
- package/src/stories/colors.js +4 -0
- package/src/stories/f/QueryCombobox.stories.jsx +22 -0
- package/src/ui/a/LexicalPreview/LexicalPreview.jsx +109 -0
- package/src/ui/a/LexicalPreview/index.js +2 -0
- package/src/ui/a/LexicalPreview/styles.scss +46 -0
- package/src/ui/a/People/common/Person/Person.jsx +31 -19
- package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -0
- package/src/ui/a/ProgressBar/styles.scss +11 -1
- package/src/ui/a/XMLEditor/XMLEditor.jsx +182 -0
- package/src/ui/a/XMLEditor/common/index.js +1 -0
- package/src/ui/a/XMLEditor/common/theme.jsx +184 -0
- package/src/ui/a/XMLEditor/index.js +1 -0
- package/src/ui/a/XMLEditor/styles.scss +17 -0
- package/src/ui/a/index.js +2 -0
- package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +157 -0
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +123 -0
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/common/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/index.js +2 -0
- package/src/ui/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/index.js +0 -1
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -2
- package/src/ui/f/fields/EditorInput/common/StopPropagationPlugin.jsx +29 -0
- package/src/ui/f/fields/EditorInput/common/index.jsx +1 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +12 -0
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +38 -1
- package/src/ui/index.js +0 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +1531 -782
- package/dist/cjs/c/ContentSlides/ContentSlides.js +0 -172
- package/dist/cjs/c/ContentSlides/Context.js +0 -10
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -124
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -128
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -92
- package/dist/cjs/c/ContentSlides/common/index.js +0 -33
- package/dist/cjs/c/ContentSlides/index.js +0 -27
- package/dist/cjs/c/ContentSlides/styles.scss +0 -312
- package/dist/cjs/c/ContentSlides/useContentSlides.js +0 -11
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +0 -58
- package/dist/cjs/r/SwitchRouteMap/index.js +0 -13
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -75
- package/dist/cjs/r/common/PrivateRoute/index.js +0 -13
- package/dist/cjs/r/common/index.js +0 -12
- package/dist/cjs/r/index.js +0 -27
- package/dist/es/c/ContentSlides/ContentSlides.js +0 -160
- package/dist/es/c/ContentSlides/Context.js +0 -2
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -116
- package/dist/es/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +0 -118
- package/dist/es/c/ContentSlides/common/Navigator/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +0 -84
- package/dist/es/c/ContentSlides/common/Sidebar/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Slide/Slide.js +0 -65
- package/dist/es/c/ContentSlides/common/Slide/index.js +0 -2
- package/dist/es/c/ContentSlides/common/index.js +0 -4
- package/dist/es/c/ContentSlides/index.js +0 -4
- package/dist/es/c/ContentSlides/styles.scss +0 -312
- package/dist/es/c/ContentSlides/useContentSlides.js +0 -3
- package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +0 -45
- package/dist/es/r/SwitchRouteMap/index.js +0 -2
- package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -67
- package/dist/es/r/common/PrivateRoute/index.js +0 -2
- package/dist/es/r/common/index.js +0 -1
- package/dist/es/r/index.js +0 -2
- package/src/stories/c/ContentSlides.stories.jsx +0 -214
- package/src/ui/c/ContentSlides/ContentSlides.jsx +0 -214
- package/src/ui/c/ContentSlides/Context.js +0 -3
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +0 -145
- package/src/ui/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +0 -150
- package/src/ui/c/ContentSlides/common/Navigator/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Sidebar/Sidebar.jsx +0 -135
- package/src/ui/c/ContentSlides/common/Sidebar/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Slide/Slide.jsx +0 -87
- package/src/ui/c/ContentSlides/common/Slide/index.js +0 -2
- package/src/ui/c/ContentSlides/common/index.js +0 -4
- package/src/ui/c/ContentSlides/index.js +0 -4
- package/src/ui/c/ContentSlides/styles.scss +0 -312
- package/src/ui/c/ContentSlides/useContentSlides.js +0 -4
- package/src/ui/r/SwitchRouteMap/SwitchRouteMap.jsx +0 -64
- package/src/ui/r/SwitchRouteMap/index.js +0 -2
- package/src/ui/r/common/PrivateRoute/PrivateRoute.jsx +0 -73
- package/src/ui/r/common/PrivateRoute/index.js +0 -2
- package/src/ui/r/common/index.js +0 -1
- package/src/ui/r/index.js +0 -2
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
/* stylelint-disable selector-max-compound-selectors -- Required here */
|
|
3
|
-
/* stylelint-disable max-nesting-depth -- Required here */
|
|
4
|
-
|
|
5
|
-
@use "@pareto-engineering/bem";
|
|
6
|
-
@use "@pareto-engineering/styles/src/mixins";
|
|
7
|
-
@use "@pareto-engineering/styles/src/globals" as *;
|
|
8
|
-
|
|
9
|
-
$class-sidebar:sidebar;
|
|
10
|
-
$class-horizontal-menu:horizontal-menu;
|
|
11
|
-
$class-slide:slide;
|
|
12
|
-
$class-navigator:navigator;
|
|
13
|
-
|
|
14
|
-
//$class-main-container:main;
|
|
15
|
-
|
|
16
|
-
$default-sidebar-width:minmax(250px, 330px);
|
|
17
|
-
$default-border:none;//2px solid var(--grid);
|
|
18
|
-
$default-border-radius:var(--theme-border-radius);
|
|
19
|
-
$default-content-background: var(--background-far);
|
|
20
|
-
$default-padding:var(--theme-default-padding);
|
|
21
|
-
|
|
22
|
-
$mobile-content-margin:6em;
|
|
23
|
-
|
|
24
|
-
.#{bem.$base}.content-slides {
|
|
25
|
-
height: 100%;
|
|
26
|
-
|
|
27
|
-
.#{$class-sidebar} {
|
|
28
|
-
background: $default-content-background;
|
|
29
|
-
border-right: $default-border;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
height: 100%;
|
|
33
|
-
justify-content: space-between;
|
|
34
|
-
overflow: auto;
|
|
35
|
-
|
|
36
|
-
header,
|
|
37
|
-
.#{bem.$element-content},
|
|
38
|
-
footer {
|
|
39
|
-
padding: $default-padding;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
header {
|
|
43
|
-
border-bottom: $default-border;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
footer {
|
|
47
|
-
border-top: $default-border;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.#{bem.$element-content} {
|
|
51
|
-
.icon-list {
|
|
52
|
-
.#{bem.$element-item} {
|
|
53
|
-
&:not(:last-child) {
|
|
54
|
-
margin-bottom: 1em;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//.#{$class-main-container} {
|
|
63
|
-
main {
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
position: relative;
|
|
66
|
-
|
|
67
|
-
.#{$class-slide} {
|
|
68
|
-
height: 100%;
|
|
69
|
-
left: 0;
|
|
70
|
-
position: absolute;
|
|
71
|
-
right: 0;
|
|
72
|
-
top: 0;
|
|
73
|
-
transition: opacity .3s;
|
|
74
|
-
|
|
75
|
-
.wrapper {
|
|
76
|
-
padding: var(--u);
|
|
77
|
-
|
|
78
|
-
.#{bem.$element-content} {
|
|
79
|
-
background: $default-content-background;
|
|
80
|
-
|
|
81
|
-
border: var(--theme-border);
|
|
82
|
-
border-radius: $default-border-radius;
|
|
83
|
-
max-width: 600px;
|
|
84
|
-
padding: $default-padding;
|
|
85
|
-
position: relative;
|
|
86
|
-
width: 90%;
|
|
87
|
-
//z-index: 1;
|
|
88
|
-
|
|
89
|
-
.#{$class-navigator} {
|
|
90
|
-
display: flex;
|
|
91
|
-
margin-top: $default-padding;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
&:not(.#{bem.$modifier-active}) {
|
|
98
|
-
opacity: .5;
|
|
99
|
-
z-index: -1;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&.#{bem.$modifier-active} {
|
|
103
|
-
opacity: 1;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.#{$class-horizontal-menu} {
|
|
109
|
-
background: $default-content-background;
|
|
110
|
-
border-bottom: var(--theme-border);
|
|
111
|
-
color: var(--heading);
|
|
112
|
-
z-index: 1;
|
|
113
|
-
|
|
114
|
-
.#{bem.$element-content} {
|
|
115
|
-
display: grid;
|
|
116
|
-
grid-template-columns: 1fr [title] 6fr 1fr;
|
|
117
|
-
padding: $default-padding;
|
|
118
|
-
|
|
119
|
-
.title {
|
|
120
|
-
grid-column: title/span 1;
|
|
121
|
-
text-align: center;
|
|
122
|
-
//font-weight:600;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.left {
|
|
126
|
-
text-align: left;
|
|
127
|
-
|
|
128
|
-
.prev-button {
|
|
129
|
-
font-family: var(--theme-default-paragraph);
|
|
130
|
-
font-size: calc(var(--s2) * 1em);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.right {
|
|
135
|
-
text-align: right;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
//
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
@include mixins.media($to:$sm-md) {
|
|
142
|
-
display: flex;
|
|
143
|
-
flex-direction: column;
|
|
144
|
-
|
|
145
|
-
.#{$class-sidebar} {
|
|
146
|
-
display: none;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
//.#{$class-main-container} {
|
|
150
|
-
|
|
151
|
-
main {
|
|
152
|
-
flex-grow: 1;
|
|
153
|
-
|
|
154
|
-
.#{$class-slide} {
|
|
155
|
-
display: flex;
|
|
156
|
-
flex-direction: column;
|
|
157
|
-
justify-content: safe center;
|
|
158
|
-
overflow: auto;
|
|
159
|
-
|
|
160
|
-
/*
|
|
161
|
-
> img {
|
|
162
|
-
height: 100%;
|
|
163
|
-
object-fit: cover;
|
|
164
|
-
position: absolute;
|
|
165
|
-
top: 0;
|
|
166
|
-
transition: opacity .3s;
|
|
167
|
-
width: 100%;
|
|
168
|
-
} */
|
|
169
|
-
|
|
170
|
-
/* stylelint-disable scss/media-feature-value-dollar-variable -- For orientation mq */
|
|
171
|
-
.wrapper {
|
|
172
|
-
display: flex;
|
|
173
|
-
flex-direction: column;
|
|
174
|
-
height: 100%;
|
|
175
|
-
//justify-content: safe center;
|
|
176
|
-
overflow: auto;
|
|
177
|
-
|
|
178
|
-
-ms-overflow-style: none;
|
|
179
|
-
padding-bottom: 0;
|
|
180
|
-
padding-top: 0;
|
|
181
|
-
//padding-bottom: $mobile-content-margin;
|
|
182
|
-
//padding-top: $mobile-content-margin;
|
|
183
|
-
scrollbar-width: none;
|
|
184
|
-
|
|
185
|
-
&::-webkit-scrollbar {
|
|
186
|
-
display: none;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&::after,
|
|
190
|
-
&::before {
|
|
191
|
-
//background: red;
|
|
192
|
-
content: " ";
|
|
193
|
-
flex-grow: 1;
|
|
194
|
-
white-space: pre;
|
|
195
|
-
//z-index: 20;
|
|
196
|
-
@media (orientation: portrait) {
|
|
197
|
-
min-height: calc(#{$mobile-content-margin} + var(--u));
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
@media (orientation: landscape) {
|
|
201
|
-
&::before {
|
|
202
|
-
min-height: var(--u);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.#{bem.$element-content} {
|
|
207
|
-
margin: 0 auto;
|
|
208
|
-
|
|
209
|
-
.#{$class-navigator} {
|
|
210
|
-
.prev {
|
|
211
|
-
display: none;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.next {
|
|
215
|
-
flex-grow: 1;
|
|
216
|
-
justify-content: flex-end;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
/* stylelint-enable */
|
|
222
|
-
|
|
223
|
-
/*
|
|
224
|
-
&:not(.#{bem.$modifier-active}) {
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&.#{bem.$modifier-active} {
|
|
228
|
-
} */
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
@include mixins.media($from:$sm-md) {
|
|
234
|
-
display: grid;
|
|
235
|
-
grid-template-columns: $default-sidebar-width 1fr;
|
|
236
|
-
|
|
237
|
-
.#{$class-horizontal-menu} {
|
|
238
|
-
display: none;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
&.simple {
|
|
242
|
-
grid-template-columns: 1fr;
|
|
243
|
-
grid-template-rows: auto 1fr;
|
|
244
|
-
|
|
245
|
-
.#{$class-horizontal-menu} {
|
|
246
|
-
display: block;
|
|
247
|
-
|
|
248
|
-
.#{bem.$element-content} {
|
|
249
|
-
padding: .5em;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.left,
|
|
253
|
-
.right {
|
|
254
|
-
display: none;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
main {
|
|
262
|
-
.#{$class-slide} {
|
|
263
|
-
//display: flex;
|
|
264
|
-
//flex-direction: column;
|
|
265
|
-
overflow: auto;
|
|
266
|
-
-ms-overflow-style: none;
|
|
267
|
-
scrollbar-width: none;
|
|
268
|
-
|
|
269
|
-
&::-webkit-scrollbar {
|
|
270
|
-
background: transparent; /* Optional: just make scrollbar invisible */
|
|
271
|
-
width: 0; /* Remove scrollbar space */
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/*
|
|
275
|
-
> img {
|
|
276
|
-
height: 100%;
|
|
277
|
-
object-fit: cover;
|
|
278
|
-
position: absolute;
|
|
279
|
-
top: 0;
|
|
280
|
-
transition: opacity .3s;
|
|
281
|
-
width: 100%;
|
|
282
|
-
} */
|
|
283
|
-
|
|
284
|
-
.wrapper {
|
|
285
|
-
display: flex;
|
|
286
|
-
//flex-direction: column;
|
|
287
|
-
height: 100%;
|
|
288
|
-
justify-content: center;
|
|
289
|
-
//overflow: auto;
|
|
290
|
-
.#{bem.$element-content} {
|
|
291
|
-
height: min-content;
|
|
292
|
-
margin: auto 0;
|
|
293
|
-
|
|
294
|
-
.#{$class-navigator} {
|
|
295
|
-
justify-content: space-between;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/*
|
|
302
|
-
&:not(.#{bem.$modifier-active}) {
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
&.#{bem.$modifier-active} {
|
|
306
|
-
} */
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
/* @pareto-engineering/generator-front 0.2.2 */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import { Switch, Route } from 'react-router-dom';
|
|
6
|
-
import { PrivateRoute } from "../common";
|
|
7
|
-
|
|
8
|
-
/* eslint-disable react/no-children-prop */
|
|
9
|
-
/**
|
|
10
|
-
* **Dependencies : `react-router-dom.Router`,**
|
|
11
|
-
* **`SessionContextProvider` in case you're using PrivateRoutes. **
|
|
12
|
-
* `SwitchRouteMap` generates a routing `Switch` from an array of route Props
|
|
13
|
-
*/
|
|
14
|
-
const SwitchRouteMap = ({
|
|
15
|
-
routes,
|
|
16
|
-
NotFound
|
|
17
|
-
}) => /*#__PURE__*/React.createElement(Switch, {
|
|
18
|
-
children: [...routes.map(({
|
|
19
|
-
isPrivate,
|
|
20
|
-
...routeProps
|
|
21
|
-
}) => isPrivate ? /*#__PURE__*/React.createElement(PrivateRoute, _extends({
|
|
22
|
-
key: routeProps.path
|
|
23
|
-
}, routeProps)) : /*#__PURE__*/React.createElement(Route, _extends({
|
|
24
|
-
key: routeProps.path
|
|
25
|
-
}, routeProps))), ...(NotFound ? [/*#__PURE__*/React.createElement(Route, {
|
|
26
|
-
component: NotFound
|
|
27
|
-
})] : [])]
|
|
28
|
-
});
|
|
29
|
-
SwitchRouteMap.propTypes = {
|
|
30
|
-
/**
|
|
31
|
-
* The routes to render
|
|
32
|
-
*/
|
|
33
|
-
routes: PropTypes.arrayOf(PropTypes.shape({
|
|
34
|
-
path: PropTypes.string.isRequired
|
|
35
|
-
// title:PropTypes.string.isRequired,
|
|
36
|
-
// state:PropTypes.string.isRequired,
|
|
37
|
-
})).isRequired,
|
|
38
|
-
/**
|
|
39
|
-
* A component to display in case no route was found.
|
|
40
|
-
* In case you're doing SSR, you might want to use
|
|
41
|
-
* a component that returns a 404 code.
|
|
42
|
-
*/
|
|
43
|
-
NotFound: PropTypes.node
|
|
44
|
-
};
|
|
45
|
-
export default SwitchRouteMap;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
/* @pareto-engineering/generator-front 0.2.1 */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useContext } from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import { Route, Redirect, useLocation } from 'react-router-dom';
|
|
7
|
-
|
|
8
|
-
// import { SessionContext } from '..'
|
|
9
|
-
const SessionContext = /*#__PURE__*/React.createContext({});
|
|
10
|
-
|
|
11
|
-
// Package-level Imports
|
|
12
|
-
// import styleNames from 'style_names.scss'
|
|
13
|
-
|
|
14
|
-
// Component-level imports
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* **Dependencies : `SessionContext.loginPath` **
|
|
18
|
-
* `PrivateRoute` subclasses `react-router-dom` `Route`.
|
|
19
|
-
* `PrivateRoute` checks whether a user matches a specified test before allowing him to the resource
|
|
20
|
-
* In case the user is not allowed, he is redirected to `SessionContext.loginPath`.
|
|
21
|
-
* Please remember this is a front-end test, and is not equivalent to back-end permission checks.
|
|
22
|
-
* This component is meant to be used alongside back-end checks.
|
|
23
|
-
*/
|
|
24
|
-
const PrivateRoute = ({
|
|
25
|
-
component: Component,
|
|
26
|
-
render,
|
|
27
|
-
test,
|
|
28
|
-
...rest
|
|
29
|
-
}) => {
|
|
30
|
-
const {
|
|
31
|
-
currentUserData: currentUser,
|
|
32
|
-
loginPath
|
|
33
|
-
} = useContext(SessionContext);
|
|
34
|
-
const location = useLocation();
|
|
35
|
-
// console.log(me)
|
|
36
|
-
|
|
37
|
-
const isUserAllowed = currentUser && test(currentUser);
|
|
38
|
-
return /*#__PURE__*/React.createElement(Route, _extends({}, rest, {
|
|
39
|
-
render: props => isUserAllowed ? render?.(props) || /*#__PURE__*/React.createElement(Component, props) : /*#__PURE__*/React.createElement(Redirect, {
|
|
40
|
-
to: {
|
|
41
|
-
pathname: loginPath,
|
|
42
|
-
state: {
|
|
43
|
-
from: location
|
|
44
|
-
} // TODO to implement
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}));
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
PrivateRoute.propTypes = {
|
|
51
|
-
/**
|
|
52
|
-
* A function that takes the user and returns a boolean.
|
|
53
|
-
*/
|
|
54
|
-
test: PropTypes.func,
|
|
55
|
-
/**
|
|
56
|
-
* Provide a custom rendering function in the "Render Props" pattern
|
|
57
|
-
*/
|
|
58
|
-
render: PropTypes.func,
|
|
59
|
-
/**
|
|
60
|
-
* Which javascript component to render
|
|
61
|
-
*/
|
|
62
|
-
component: PropTypes.node
|
|
63
|
-
};
|
|
64
|
-
PrivateRoute.defaultProps = {
|
|
65
|
-
test: user => user.id
|
|
66
|
-
};
|
|
67
|
-
export default PrivateRoute;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PrivateRoute } from "./PrivateRoute";
|
package/dist/es/r/index.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
ContentSlides,
|
|
6
|
-
AppContextProvider,
|
|
7
|
-
useContentSlides,
|
|
8
|
-
Title,
|
|
9
|
-
Logo,
|
|
10
|
-
useApp,
|
|
11
|
-
} from 'ui'
|
|
12
|
-
|
|
13
|
-
// import Router from 'stories/utils/Router'
|
|
14
|
-
import Router from '../utils/Router'
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
title :'c/ContentSlides',
|
|
18
|
-
component :ContentSlides,
|
|
19
|
-
subcomponents:{
|
|
20
|
-
'ContentSlides.Sidebar' :ContentSlides.Sidebar,
|
|
21
|
-
'ContentSlides.HorizontalMenu':ContentSlides.HorizontalMenu,
|
|
22
|
-
'ContentSlides.Slide' :ContentSlides.Slide,
|
|
23
|
-
'ContentSlides.Navigator' :ContentSlides.Navigator,
|
|
24
|
-
},
|
|
25
|
-
decorators:[
|
|
26
|
-
(storyfn) => <Router>{ storyfn() }</Router>,
|
|
27
|
-
(storyfn) => (
|
|
28
|
-
<AppContextProvider config={{
|
|
29
|
-
APP:{
|
|
30
|
-
NAME :'name of my site',
|
|
31
|
-
CANONICAL:'https://mysite.com',
|
|
32
|
-
},
|
|
33
|
-
}}
|
|
34
|
-
>
|
|
35
|
-
{ storyfn() }
|
|
36
|
-
</AppContextProvider>
|
|
37
|
-
),
|
|
38
|
-
],
|
|
39
|
-
argTypes:{
|
|
40
|
-
isSimple:{ control: 'boolean' },
|
|
41
|
-
},
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const Template = (args) => {
|
|
45
|
-
const Main = () => {
|
|
46
|
-
const { isSimple } = args || {}
|
|
47
|
-
const { userTheme } = useApp()
|
|
48
|
-
const { isLastStep } = useContentSlides()
|
|
49
|
-
|
|
50
|
-
const steps = [
|
|
51
|
-
{
|
|
52
|
-
id :'welcome',
|
|
53
|
-
title :'Welcome',
|
|
54
|
-
progress:40,
|
|
55
|
-
location:'welcome',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id :'plan',
|
|
59
|
-
title :'Choose your plan',
|
|
60
|
-
progress:60,
|
|
61
|
-
location:'select-plan',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id :'details',
|
|
65
|
-
title :'Personal details',
|
|
66
|
-
progress:70,
|
|
67
|
-
location:'personal-details',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id :'payment',
|
|
71
|
-
title :'Payment',
|
|
72
|
-
progress:90,
|
|
73
|
-
location:'payment',
|
|
74
|
-
},
|
|
75
|
-
]
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<div className={`ui-${userTheme}`} style={{ height: '100%' }}>
|
|
79
|
-
<ContentSlides className="y-background-far b-dark-y" steps={steps} simple={isSimple}>
|
|
80
|
-
{!isSimple && (
|
|
81
|
-
<ContentSlides.Sidebar
|
|
82
|
-
header={(
|
|
83
|
-
<Logo color="paragraph" />
|
|
84
|
-
)}
|
|
85
|
-
/>
|
|
86
|
-
)}
|
|
87
|
-
<ContentSlides.HorizontalMenu hideBackIcon={isLastStep} />
|
|
88
|
-
<main>
|
|
89
|
-
<ContentSlides.Slide
|
|
90
|
-
index={0}
|
|
91
|
-
>
|
|
92
|
-
<Title
|
|
93
|
-
heading="Welcome"
|
|
94
|
-
headingAs="h1"
|
|
95
|
-
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
96
|
-
headingClassName="small"
|
|
97
|
-
/>
|
|
98
|
-
<ContentSlides.Navigator />
|
|
99
|
-
</ContentSlides.Slide
|
|
100
|
-
>
|
|
101
|
-
<ContentSlides.Slide
|
|
102
|
-
index={1}
|
|
103
|
-
>
|
|
104
|
-
<Title
|
|
105
|
-
heading="Part 2"
|
|
106
|
-
headingAs="h1"
|
|
107
|
-
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
108
|
-
headingClassName="small"
|
|
109
|
-
/>
|
|
110
|
-
<p>
|
|
111
|
-
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
112
|
-
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
113
|
-
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
114
|
-
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
115
|
-
porta placerat leo.
|
|
116
|
-
</p>
|
|
117
|
-
<p>
|
|
118
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
119
|
-
Cras placerat ac enim viverra rhoncus.
|
|
120
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
121
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
122
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
123
|
-
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
124
|
-
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
125
|
-
porta placerat leo.
|
|
126
|
-
</p>
|
|
127
|
-
<p>
|
|
128
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
129
|
-
Cras placerat ac enim viverra rhoncus.
|
|
130
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
131
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
132
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
133
|
-
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
134
|
-
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
135
|
-
porta placerat leo.
|
|
136
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
137
|
-
Cras placerat ac enim viverra rhoncus.
|
|
138
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
139
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
140
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
141
|
-
{' '}
|
|
142
|
-
</p>
|
|
143
|
-
<p>
|
|
144
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
145
|
-
Cras placerat ac enim viverra rhoncus.
|
|
146
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
147
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
148
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
149
|
-
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
150
|
-
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
151
|
-
porta placerat leo.
|
|
152
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
153
|
-
Cras placerat ac enim viverra rhoncus.
|
|
154
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
155
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
156
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
157
|
-
{' '}
|
|
158
|
-
</p>
|
|
159
|
-
<p>
|
|
160
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
161
|
-
Cras placerat ac enim viverra rhoncus.
|
|
162
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
163
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
164
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
165
|
-
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
166
|
-
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
167
|
-
porta placerat leo.
|
|
168
|
-
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
169
|
-
Cras placerat ac enim viverra rhoncus.
|
|
170
|
-
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
171
|
-
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
172
|
-
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
173
|
-
{' '}
|
|
174
|
-
</p>
|
|
175
|
-
|
|
176
|
-
<ContentSlides.Navigator />
|
|
177
|
-
</ContentSlides.Slide>
|
|
178
|
-
<ContentSlides.Slide
|
|
179
|
-
index={2}
|
|
180
|
-
>
|
|
181
|
-
<Title
|
|
182
|
-
heading="Part 3"
|
|
183
|
-
headingAs="h1"
|
|
184
|
-
headingClassName="small"
|
|
185
|
-
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
186
|
-
/>
|
|
187
|
-
<ContentSlides.Navigator />
|
|
188
|
-
</ContentSlides.Slide>
|
|
189
|
-
<ContentSlides.Slide
|
|
190
|
-
index={3}
|
|
191
|
-
>
|
|
192
|
-
<Title
|
|
193
|
-
heading="Part 4"
|
|
194
|
-
headingAs="h1"
|
|
195
|
-
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
196
|
-
/>
|
|
197
|
-
<ContentSlides.Navigator />
|
|
198
|
-
</ContentSlides.Slide>
|
|
199
|
-
</main>
|
|
200
|
-
</ContentSlides>
|
|
201
|
-
</div>
|
|
202
|
-
)
|
|
203
|
-
}
|
|
204
|
-
return (
|
|
205
|
-
<Main />
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export const Base = Template.bind({})
|
|
210
|
-
|
|
211
|
-
export const Simple = Template.bind({})
|
|
212
|
-
Simple.args = {
|
|
213
|
-
isSimple:true,
|
|
214
|
-
}
|