@pareto-engineering/design-system 4.0.0-alpha.70 → 4.0.0-alpha.73
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/cjs/{c/ContentSlides/common/Slide/Slide.js → a/LexicalPreview/LexicalPreview.js} +43 -28
- package/dist/cjs/{c/ContentSlides/common/Sidebar → 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 -2
- package/dist/cjs/a/ProgressBar/styles.scss +11 -1
- package/dist/cjs/a/XMLEditor/XMLEditor.js +14 -6
- package/dist/cjs/a/index.js +8 -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/Navigator → 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/index.js +8 -1
- package/dist/cjs/c/index.js +0 -13
- 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/index.js +0 -11
- 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 -2
- package/dist/es/a/ProgressBar/styles.scss +11 -1
- package/dist/es/a/XMLEditor/XMLEditor.js +16 -10
- package/dist/es/a/index.js +2 -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/index.js +2 -1
- 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/index.js +0 -1
- package/package.json +5 -5
- package/src/stories/a/LexicalPreview.stories.jsx +28 -0
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/b/ExpandableLexicalPreview.stories.jsx +29 -0
- package/src/stories/colors.js +4 -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 +16 -5
- package/src/ui/a/index.js +1 -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/index.js +0 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +1249 -641
- 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 -126
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/index.js +0 -13
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -128
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -94
- package/dist/cjs/c/ContentSlides/common/Slide/index.js +0 -13
- 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 -74
- 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 -66
- 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
- /package/src/stories/a/{CodeEditor.stories.jsx → XMLEditor.stories.jsx} +0 -0
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import { useInsertionEffect, useReducer } from 'react'
|
|
5
|
-
|
|
6
|
-
import PropTypes from 'prop-types'
|
|
7
|
-
|
|
8
|
-
import { useHistory } from 'react-router-dom'
|
|
9
|
-
|
|
10
|
-
import styleNames from '@pareto-engineering/bem/exports'
|
|
11
|
-
|
|
12
|
-
import ContentSlidesContext from './Context'
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
Slide,
|
|
16
|
-
HorizontalMenu,
|
|
17
|
-
Sidebar,
|
|
18
|
-
Navigator,
|
|
19
|
-
} from './common'
|
|
20
|
-
|
|
21
|
-
import './styles.scss'
|
|
22
|
-
|
|
23
|
-
// Local Definitions
|
|
24
|
-
|
|
25
|
-
const baseClassName = styleNames.base
|
|
26
|
-
|
|
27
|
-
const componentClassName = 'content-slides'
|
|
28
|
-
|
|
29
|
-
const reducer = (state, action) => {
|
|
30
|
-
switch (action.type) {
|
|
31
|
-
case 'SET_STEP_INDEX':
|
|
32
|
-
return {
|
|
33
|
-
...state,
|
|
34
|
-
currentStepIndex:action.payload,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
case 'SET_CURRENT_STEP':
|
|
38
|
-
return {
|
|
39
|
-
...state,
|
|
40
|
-
...action.payload,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
case 'SET_EXTRA_CONTEXT':
|
|
44
|
-
return {
|
|
45
|
-
...state,
|
|
46
|
-
...action.payload,
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
return state
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* This is the component description.
|
|
56
|
-
* Colors :
|
|
57
|
-
* `y` : the background of the content
|
|
58
|
-
*/
|
|
59
|
-
const ContentSlides = ({
|
|
60
|
-
id,
|
|
61
|
-
className:userClassName,
|
|
62
|
-
style,
|
|
63
|
-
children,
|
|
64
|
-
steps,
|
|
65
|
-
simple,
|
|
66
|
-
isDebug,
|
|
67
|
-
// ...otherProps
|
|
68
|
-
}) => {
|
|
69
|
-
const history = useHistory()
|
|
70
|
-
|
|
71
|
-
const [state, dispatch] = useReducer(reducer, {
|
|
72
|
-
currentStepIndex:0,
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
const {
|
|
76
|
-
// currentSlide,
|
|
77
|
-
currentStepIndex,
|
|
78
|
-
isFirstStep,
|
|
79
|
-
isLastStep,
|
|
80
|
-
} = state
|
|
81
|
-
|
|
82
|
-
const setNextStepIndex = (step = 1) => {
|
|
83
|
-
if (!isLastStep) {
|
|
84
|
-
dispatch({
|
|
85
|
-
type :'SET_STEP_INDEX',
|
|
86
|
-
payload:currentStepIndex + step,
|
|
87
|
-
})
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const setPrevStepIndex = (step = 1) => {
|
|
92
|
-
if (!isFirstStep) {
|
|
93
|
-
dispatch({
|
|
94
|
-
type :'SET_STEP_INDEX',
|
|
95
|
-
payload:currentStepIndex - step,
|
|
96
|
-
})
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const setStepIndex = (index) => {
|
|
101
|
-
dispatch({
|
|
102
|
-
type :'SET_STEP_INDEX',
|
|
103
|
-
payload:index,
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const setCurrentStep = (index) => {
|
|
108
|
-
const newStep = steps[index]
|
|
109
|
-
|
|
110
|
-
if (newStep.location) {
|
|
111
|
-
history.push(newStep.location)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
dispatch({
|
|
115
|
-
type :'SET_CURRENT_STEP',
|
|
116
|
-
payload:{
|
|
117
|
-
currentStep:steps[index],
|
|
118
|
-
isFirstStep:index === 0,
|
|
119
|
-
isLastStep :index === (steps.length - 1),
|
|
120
|
-
},
|
|
121
|
-
})
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
useInsertionEffect(() => {
|
|
125
|
-
setCurrentStep(currentStepIndex)
|
|
126
|
-
},
|
|
127
|
-
[currentStepIndex])
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<ContentSlidesContext.Provider
|
|
131
|
-
value={{
|
|
132
|
-
steps,
|
|
133
|
-
setNextStepIndex,
|
|
134
|
-
setPrevStepIndex,
|
|
135
|
-
setStepIndex,
|
|
136
|
-
dispatch,
|
|
137
|
-
isDebug,
|
|
138
|
-
...state,
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<div
|
|
142
|
-
id={id}
|
|
143
|
-
className={[
|
|
144
|
-
baseClassName,
|
|
145
|
-
componentClassName,
|
|
146
|
-
userClassName,
|
|
147
|
-
simple && 'simple',
|
|
148
|
-
'u1 md-u2',
|
|
149
|
-
]
|
|
150
|
-
.filter((e) => e)
|
|
151
|
-
.join(' ')}
|
|
152
|
-
style={style}
|
|
153
|
-
>
|
|
154
|
-
{children}
|
|
155
|
-
</div>
|
|
156
|
-
</ContentSlidesContext.Provider>
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
ContentSlides.propTypes = {
|
|
161
|
-
/**
|
|
162
|
-
* The HTML id for this element
|
|
163
|
-
*/
|
|
164
|
-
id:PropTypes.string,
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* The HTML class names for this element
|
|
168
|
-
*/
|
|
169
|
-
className:PropTypes.string,
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* The React-written, css properties for this element.
|
|
173
|
-
*/
|
|
174
|
-
style:PropTypes.objectOf(PropTypes.string),
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* The children JSX
|
|
178
|
-
*/
|
|
179
|
-
children:PropTypes.node,
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The slides properties
|
|
183
|
-
*/
|
|
184
|
-
steps:PropTypes.arrayOf(
|
|
185
|
-
PropTypes.shape({
|
|
186
|
-
id :PropTypes.string.isRequired,
|
|
187
|
-
title :PropTypes.string.isRequired,
|
|
188
|
-
progress:PropTypes.number.isRequired,
|
|
189
|
-
location:PropTypes.string.isRequired,
|
|
190
|
-
}),
|
|
191
|
-
),
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Whether this shouldn't use a sidebar on desktop
|
|
195
|
-
*/
|
|
196
|
-
simple:PropTypes.bool,
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Whether the debug mode is enabled
|
|
200
|
-
*/
|
|
201
|
-
isDebug:PropTypes.bool,
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
ContentSlides.defaultProps = {
|
|
205
|
-
simple :false,
|
|
206
|
-
isDebug:false,
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
ContentSlides.Sidebar = Sidebar
|
|
210
|
-
ContentSlides.HorizontalMenu = HorizontalMenu
|
|
211
|
-
ContentSlides.Slide = Slide
|
|
212
|
-
ContentSlides.Navigator = Navigator
|
|
213
|
-
|
|
214
|
-
export default ContentSlides
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
import styleNames from '@pareto-engineering/bem/exports'
|
|
6
|
-
import { ProgressBar } from 'ui/a'
|
|
7
|
-
import { Logo } from 'ui/b'
|
|
8
|
-
import useContentSlides from '../../useContentSlides'
|
|
9
|
-
|
|
10
|
-
// Local Definitions
|
|
11
|
-
|
|
12
|
-
// const baseClassName = styleNames.base
|
|
13
|
-
|
|
14
|
-
const componentClassName = 'horizontal-menu'
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This is the component description.
|
|
18
|
-
*/
|
|
19
|
-
const HorizontalMenu = ({
|
|
20
|
-
id,
|
|
21
|
-
className:userClassName,
|
|
22
|
-
style,
|
|
23
|
-
logoColor,
|
|
24
|
-
hideBackIcon,
|
|
25
|
-
stepsBackwards,
|
|
26
|
-
customPrevStep,
|
|
27
|
-
color,
|
|
28
|
-
// ...otherProps
|
|
29
|
-
}) => {
|
|
30
|
-
const {
|
|
31
|
-
setPrevStepIndex,
|
|
32
|
-
// setNextStepIndex,
|
|
33
|
-
currentStep,
|
|
34
|
-
isFirstStep,
|
|
35
|
-
// currentStep,
|
|
36
|
-
// currentStepIndex,
|
|
37
|
-
} = useContentSlides()
|
|
38
|
-
|
|
39
|
-
const mobilePreviousStep = () => {
|
|
40
|
-
if (customPrevStep) {
|
|
41
|
-
customPrevStep()
|
|
42
|
-
} else {
|
|
43
|
-
setPrevStepIndex(stepsBackwards)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div
|
|
49
|
-
id={id}
|
|
50
|
-
className={[
|
|
51
|
-
|
|
52
|
-
// baseClassName,
|
|
53
|
-
|
|
54
|
-
componentClassName,
|
|
55
|
-
userClassName,
|
|
56
|
-
]
|
|
57
|
-
.filter((e) => e)
|
|
58
|
-
.join(' ')}
|
|
59
|
-
style={style}
|
|
60
|
-
>
|
|
61
|
-
{
|
|
62
|
-
(currentStep?.progress > 0)
|
|
63
|
-
&& <ProgressBar progress={currentStep.progress} attached height=".4em" color={color} className="y-background-far b-hard-y" />
|
|
64
|
-
}
|
|
65
|
-
<div className={styleNames.elementContent}>
|
|
66
|
-
<div className="left">
|
|
67
|
-
{(!isFirstStep && !hideBackIcon) && (
|
|
68
|
-
<span
|
|
69
|
-
className="prev-button pointer"
|
|
70
|
-
onClick={mobilePreviousStep}
|
|
71
|
-
role="button"
|
|
72
|
-
onKeyDown={mobilePreviousStep}
|
|
73
|
-
tabIndex={0}
|
|
74
|
-
>
|
|
75
|
-
{'<--'}
|
|
76
|
-
</span>
|
|
77
|
-
)}
|
|
78
|
-
</div>
|
|
79
|
-
<div className="title">
|
|
80
|
-
<span className="md-h lg-h">
|
|
81
|
-
{ currentStep?.title }
|
|
82
|
-
</span>
|
|
83
|
-
<Logo className="xs-h sm-h y-transparent" height="1.1em" color={logoColor} />
|
|
84
|
-
</div>
|
|
85
|
-
{/*
|
|
86
|
-
<div className="right">
|
|
87
|
-
{ !isLastStep
|
|
88
|
-
&& (
|
|
89
|
-
<span className="pointer" onClick={setNextStepIndex}>
|
|
90
|
-
>
|
|
91
|
-
</span>
|
|
92
|
-
)}
|
|
93
|
-
</div>
|
|
94
|
-
*/}
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
HorizontalMenu.propTypes = {
|
|
101
|
-
/**
|
|
102
|
-
* The HTML id for this element
|
|
103
|
-
*/
|
|
104
|
-
id:PropTypes.string,
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* The HTML class names for this element
|
|
108
|
-
*/
|
|
109
|
-
className:PropTypes.string,
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* The React-written, css properties for this element.
|
|
113
|
-
*/
|
|
114
|
-
style :PropTypes.objectOf(PropTypes.string),
|
|
115
|
-
/**
|
|
116
|
-
* Number of backward steps for the customPrevStep
|
|
117
|
-
*/
|
|
118
|
-
stepsBackwards:PropTypes.number,
|
|
119
|
-
/**
|
|
120
|
-
* A custom previous function
|
|
121
|
-
*/
|
|
122
|
-
customPrevStep:PropTypes.func,
|
|
123
|
-
/**
|
|
124
|
-
* The logo color
|
|
125
|
-
*/
|
|
126
|
-
logoColor :PropTypes.string,
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Hide back icon boolean
|
|
130
|
-
*/
|
|
131
|
-
hideBackIcon:PropTypes.bool,
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* String that will represent color for Progress bar
|
|
135
|
-
*/
|
|
136
|
-
color:PropTypes.string,
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
HorizontalMenu.defaultProps = {
|
|
140
|
-
logoColor :'paragraph',
|
|
141
|
-
stepsBackwards:1,
|
|
142
|
-
color :'main2',
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export default HorizontalMenu
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
|
|
5
|
-
import { Button } from 'ui/b'
|
|
6
|
-
import useContentSlides from '../../useContentSlides'
|
|
7
|
-
|
|
8
|
-
// Local Definitions
|
|
9
|
-
|
|
10
|
-
const componentClassName = 'navigator'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This is the component description.
|
|
14
|
-
*/
|
|
15
|
-
const Navigator = ({
|
|
16
|
-
id,
|
|
17
|
-
className:userClassName,
|
|
18
|
-
style,
|
|
19
|
-
canMoveForward,
|
|
20
|
-
previousColor,
|
|
21
|
-
nextColor,
|
|
22
|
-
stepsForward,
|
|
23
|
-
stepsBackwards,
|
|
24
|
-
customPrevStep,
|
|
25
|
-
customNextStep,
|
|
26
|
-
isLoading,
|
|
27
|
-
// ...otherProps
|
|
28
|
-
}) => {
|
|
29
|
-
const {
|
|
30
|
-
setPrevStepIndex,
|
|
31
|
-
setNextStepIndex,
|
|
32
|
-
isFirstStep,
|
|
33
|
-
isLastStep,
|
|
34
|
-
isDebug,
|
|
35
|
-
// currentStep,
|
|
36
|
-
// currentStepIndex,
|
|
37
|
-
} = useContentSlides()
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div
|
|
41
|
-
id={id}
|
|
42
|
-
className={[
|
|
43
|
-
componentClassName,
|
|
44
|
-
userClassName,
|
|
45
|
-
]
|
|
46
|
-
.filter((e) => e)
|
|
47
|
-
.join(' ')}
|
|
48
|
-
style={style}
|
|
49
|
-
>
|
|
50
|
-
{ !isFirstStep
|
|
51
|
-
? (
|
|
52
|
-
<Button
|
|
53
|
-
className={`x-${previousColor} prev`}
|
|
54
|
-
isSimple
|
|
55
|
-
onClick={() => {
|
|
56
|
-
if (customPrevStep) {
|
|
57
|
-
customPrevStep()
|
|
58
|
-
} else {
|
|
59
|
-
setPrevStepIndex(stepsBackwards)
|
|
60
|
-
}
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
Previous
|
|
64
|
-
</Button>
|
|
65
|
-
)
|
|
66
|
-
: <span />}
|
|
67
|
-
{ !isLastStep
|
|
68
|
-
? (
|
|
69
|
-
<Button
|
|
70
|
-
className={`x-${nextColor} next`}
|
|
71
|
-
disabled={!isDebug && !canMoveForward}
|
|
72
|
-
isLoading={isLoading}
|
|
73
|
-
onClick={() => {
|
|
74
|
-
if (customNextStep) {
|
|
75
|
-
customNextStep()
|
|
76
|
-
} else {
|
|
77
|
-
setNextStepIndex(stepsForward)
|
|
78
|
-
}
|
|
79
|
-
}}
|
|
80
|
-
isCompact
|
|
81
|
-
>
|
|
82
|
-
Next
|
|
83
|
-
</Button>
|
|
84
|
-
)
|
|
85
|
-
: <span />}
|
|
86
|
-
</div>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
Navigator.propTypes = {
|
|
91
|
-
/**
|
|
92
|
-
* The HTML id for this element
|
|
93
|
-
*/
|
|
94
|
-
id:PropTypes.string,
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* The HTML class names for this element
|
|
98
|
-
*/
|
|
99
|
-
className:PropTypes.string,
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The React-written, css properties for this element.
|
|
103
|
-
*/
|
|
104
|
-
style:PropTypes.objectOf(PropTypes.string),
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Whether the user can move to the next slide
|
|
108
|
-
*/
|
|
109
|
-
canMoveForward:PropTypes.bool,
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* The previous color
|
|
113
|
-
*/
|
|
114
|
-
previousColor:PropTypes.string,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* The next color
|
|
118
|
-
*/
|
|
119
|
-
nextColor :PropTypes.string,
|
|
120
|
-
/**
|
|
121
|
-
* Number of forward steps for the customNextStep
|
|
122
|
-
*/
|
|
123
|
-
stepsForward :PropTypes.number,
|
|
124
|
-
/**
|
|
125
|
-
* Number of backward steps for the customPrevStep
|
|
126
|
-
*/
|
|
127
|
-
stepsBackwards:PropTypes.number,
|
|
128
|
-
/**
|
|
129
|
-
* A custom previous function
|
|
130
|
-
*/
|
|
131
|
-
customPrevStep:PropTypes.func,
|
|
132
|
-
/**
|
|
133
|
-
* A custom next function
|
|
134
|
-
*/
|
|
135
|
-
customNextStep:PropTypes.func,
|
|
136
|
-
/**
|
|
137
|
-
* Button loading state
|
|
138
|
-
*/
|
|
139
|
-
isLoading :PropTypes.bool,
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
Navigator.defaultProps = {
|
|
143
|
-
canMoveForward:true,
|
|
144
|
-
previousColor :'main2',
|
|
145
|
-
nextColor :'main2',
|
|
146
|
-
stepsForward :1,
|
|
147
|
-
stepsBackwards:1,
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export default Navigator
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import PropTypes from 'prop-types'
|
|
5
|
-
|
|
6
|
-
import { IconList } from 'ui/a'
|
|
7
|
-
import { ThemeSelector } from 'ui/b'
|
|
8
|
-
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
|
-
import useContentSlides from '../../useContentSlides'
|
|
10
|
-
|
|
11
|
-
// Local Definitions
|
|
12
|
-
|
|
13
|
-
// const baseClassName = styleNames.base
|
|
14
|
-
|
|
15
|
-
const componentClassName = 'sidebar'
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* This is the component description.
|
|
19
|
-
*/
|
|
20
|
-
const Sidebar = ({
|
|
21
|
-
id,
|
|
22
|
-
className:userClassName,
|
|
23
|
-
style,
|
|
24
|
-
header,
|
|
25
|
-
footer,
|
|
26
|
-
// ...otherProps
|
|
27
|
-
}) => {
|
|
28
|
-
const {
|
|
29
|
-
steps,
|
|
30
|
-
// setPrevStepIndex,
|
|
31
|
-
// setNextStepIndex,
|
|
32
|
-
setStepIndex,
|
|
33
|
-
// isFirstStep,
|
|
34
|
-
// isLastStep,
|
|
35
|
-
// currentStep,
|
|
36
|
-
currentStepIndex,
|
|
37
|
-
} = useContentSlides()
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<nav
|
|
41
|
-
id={id}
|
|
42
|
-
className={[
|
|
43
|
-
|
|
44
|
-
// baseClassName,
|
|
45
|
-
|
|
46
|
-
componentClassName,
|
|
47
|
-
userClassName,
|
|
48
|
-
]
|
|
49
|
-
.filter((e) => e)
|
|
50
|
-
.join(' ')}
|
|
51
|
-
style={style}
|
|
52
|
-
>
|
|
53
|
-
{ header
|
|
54
|
-
? (
|
|
55
|
-
<header>
|
|
56
|
-
{ header }
|
|
57
|
-
|
|
58
|
-
</header>
|
|
59
|
-
)
|
|
60
|
-
: <span />}
|
|
61
|
-
<div className={styleNames.elementContent}>
|
|
62
|
-
<IconList>
|
|
63
|
-
{ steps.map((step, i) => (
|
|
64
|
-
/* eslint-disable no-nested-ternary -- bc of math inequality cases */
|
|
65
|
-
<IconList.Item
|
|
66
|
-
key={step.location}
|
|
67
|
-
icon={
|
|
68
|
-
(currentStepIndex === i) ? 'L'
|
|
69
|
-
: (i < currentStepIndex) ? 'I' : undefined
|
|
70
|
-
}
|
|
71
|
-
iconHover={
|
|
72
|
-
(i < currentStepIndex) ? 'L' : undefined
|
|
73
|
-
}
|
|
74
|
-
className={
|
|
75
|
-
[
|
|
76
|
-
(currentStepIndex === i) ? 'x-heading'
|
|
77
|
-
: (i < currentStepIndex) ? 'pointer x-paragraph xh-main2'
|
|
78
|
-
: 'x-subtitle',
|
|
79
|
-
'c-x',
|
|
80
|
-
].filter((e) => e).join(' ')
|
|
81
|
-
}
|
|
82
|
-
onClick={
|
|
83
|
-
(i < currentStepIndex) ? (() => setStepIndex(i)) : undefined
|
|
84
|
-
}
|
|
85
|
-
>
|
|
86
|
-
{ step.title }
|
|
87
|
-
</IconList.Item>
|
|
88
|
-
/* eslint-enable no-nested-ternary */
|
|
89
|
-
)) }
|
|
90
|
-
</IconList>
|
|
91
|
-
</div>
|
|
92
|
-
{ footer
|
|
93
|
-
? (
|
|
94
|
-
<footer>
|
|
95
|
-
{footer}
|
|
96
|
-
<ThemeSelector className="x-heading" />
|
|
97
|
-
</footer>
|
|
98
|
-
)
|
|
99
|
-
: <span />}
|
|
100
|
-
</nav>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
Sidebar.propTypes = {
|
|
105
|
-
/**
|
|
106
|
-
* The HTML id for this element
|
|
107
|
-
*/
|
|
108
|
-
id:PropTypes.string,
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The HTML class names for this element
|
|
112
|
-
*/
|
|
113
|
-
className:PropTypes.string,
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The React-written, css properties for this element.
|
|
117
|
-
*/
|
|
118
|
-
style:PropTypes.objectOf(PropTypes.string),
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* The header JSX
|
|
122
|
-
*/
|
|
123
|
-
header:PropTypes.node,
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* The footer JSX
|
|
127
|
-
*/
|
|
128
|
-
footer:PropTypes.node,
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
Sidebar.defaultProps = {
|
|
132
|
-
// someProp:false
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export default Sidebar
|