@pareto-engineering/design-system 2.0.0-alpha.19 → 2.0.0-alpha.22
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/{experimental/GradientBackground/GradientBackground.js → a/RatingsInput/RatingsInput.js} +27 -37
- package/dist/cjs/a/RatingsInput/common/Rating/Rating.js +120 -0
- package/dist/cjs/a/RatingsInput/common/Rating/index.js +15 -0
- package/dist/cjs/a/RatingsInput/common/index.js +13 -0
- package/dist/cjs/a/RatingsInput/index.js +15 -0
- package/dist/cjs/a/RatingsInput/styles.scss +35 -0
- package/dist/cjs/a/index.js +8 -0
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +3 -3
- package/dist/cjs/c/ContentSlides/styles.scss +10 -4
- package/dist/es/a/RatingsInput/RatingsInput.js +72 -0
- package/dist/es/a/RatingsInput/common/Rating/Rating.js +102 -0
- package/dist/es/a/RatingsInput/common/Rating/index.js +2 -0
- package/dist/es/a/RatingsInput/common/index.js +1 -0
- package/dist/es/a/RatingsInput/index.js +2 -0
- package/dist/es/a/RatingsInput/styles.scss +35 -0
- package/dist/es/a/index.js +1 -0
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +3 -3
- package/dist/es/c/ContentSlides/styles.scss +10 -4
- package/package.json +1 -1
- package/src/__snapshots__/Storyshots.test.js.snap +437 -4
- package/src/stories/a/SnapScroller.stories.jsx +98 -0
- package/src/stories/c/ContentSlides.stories.jsx +154 -2
- package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
- package/src/ui/a/SnapScroller/index.js +2 -0
- package/src/ui/a/SnapScroller/styles.scss +38 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +3 -3
- package/src/ui/c/ContentSlides/styles.scss +10 -4
- package/dist/cjs/a/GradientBackground/GradientBackground.js +0 -140
- package/dist/cjs/a/GradientBackground/index.js +0 -15
- package/dist/cjs/a/GradientBackground/styles.scss +0 -191
- package/dist/cjs/experimental/GradientBackground/index.js +0 -15
- package/dist/cjs/experimental/GradientBackground/styles.scss +0 -64
- package/dist/cjs/experimental/index.js +0 -13
- package/dist/es/a/GradientBackground/GradientBackground.js +0 -118
- package/dist/es/a/GradientBackground/index.js +0 -2
- package/dist/es/a/GradientBackground/styles.scss +0 -191
- package/dist/es/experimental/GradientBackground/GradientBackground.js +0 -76
- package/dist/es/experimental/GradientBackground/index.js +0 -2
- package/dist/es/experimental/GradientBackground/styles.scss +0 -64
- package/dist/es/experimental/index.js +0 -1
|
@@ -4,6 +4,7 @@ import * as React from 'react'
|
|
|
4
4
|
import {
|
|
5
5
|
ContentSlides,
|
|
6
6
|
SiteContextProvider,
|
|
7
|
+
Shapes,
|
|
7
8
|
useContentSlides,
|
|
8
9
|
Title,
|
|
9
10
|
Logo,
|
|
@@ -74,7 +75,7 @@ export const Base = () => {
|
|
|
74
75
|
|
|
75
76
|
return (
|
|
76
77
|
<div className={`ui-${userTheme}`} style={{ height: '100%' }}>
|
|
77
|
-
<ContentSlides className="y-background1" steps={steps}>
|
|
78
|
+
<ContentSlides className="y-background1 b-dark-y" steps={steps}>
|
|
78
79
|
<ContentSlides.Sidebar
|
|
79
80
|
header={(
|
|
80
81
|
<Logo color="paragraph" />
|
|
@@ -341,7 +342,158 @@ export const Simple = () => {
|
|
|
341
342
|
)
|
|
342
343
|
}
|
|
343
344
|
return (
|
|
344
|
-
<ContentSlides className="y-background1" steps={steps} simple>
|
|
345
|
+
<ContentSlides className="y-background1 b-dark-y" steps={steps} simple>
|
|
346
|
+
<Main />
|
|
347
|
+
</ContentSlides>
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export const WithBackgroundShape = () => {
|
|
352
|
+
const steps = [
|
|
353
|
+
{
|
|
354
|
+
id :'welcome',
|
|
355
|
+
title :'Welcome',
|
|
356
|
+
progress:40,
|
|
357
|
+
location:'welcome',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id :'plan',
|
|
361
|
+
title :'Choose your plan',
|
|
362
|
+
progress:60,
|
|
363
|
+
location:'select-plan',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id :'details',
|
|
367
|
+
title :'Personal details',
|
|
368
|
+
progress:70,
|
|
369
|
+
location:'personal-details',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id :'payment',
|
|
373
|
+
title :'Payment',
|
|
374
|
+
progress:90,
|
|
375
|
+
location:'payment',
|
|
376
|
+
},
|
|
377
|
+
]
|
|
378
|
+
|
|
379
|
+
const Main = () => {
|
|
380
|
+
const { isLastStep } = useContentSlides()
|
|
381
|
+
|
|
382
|
+
return (
|
|
383
|
+
<>
|
|
384
|
+
<ContentSlides.HorizontalMenu hideBackIcon={isLastStep} />
|
|
385
|
+
{' '}
|
|
386
|
+
<main>
|
|
387
|
+
<ContentSlides.Slide
|
|
388
|
+
index={0}
|
|
389
|
+
>
|
|
390
|
+
<Title
|
|
391
|
+
heading="Welcome"
|
|
392
|
+
headingAs="h1"
|
|
393
|
+
headingClassName="small"
|
|
394
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
395
|
+
/>
|
|
396
|
+
<ContentSlides.Navigator />
|
|
397
|
+
</ContentSlides.Slide
|
|
398
|
+
>
|
|
399
|
+
<ContentSlides.Slide
|
|
400
|
+
index={1}
|
|
401
|
+
>
|
|
402
|
+
<Title
|
|
403
|
+
heading="Part 2"
|
|
404
|
+
headingAs="h1"
|
|
405
|
+
headingClassName="small"
|
|
406
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
407
|
+
/>
|
|
408
|
+
<p>
|
|
409
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
410
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
411
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
412
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
413
|
+
porta placerat leo.
|
|
414
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
415
|
+
Cras placerat ac enim viverra rhoncus.
|
|
416
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
417
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
418
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
419
|
+
{' '}
|
|
420
|
+
</p>
|
|
421
|
+
<p>
|
|
422
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
423
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
424
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
425
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
426
|
+
porta placerat leo.
|
|
427
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
428
|
+
Cras placerat ac enim viverra rhoncus.
|
|
429
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
430
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
431
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
432
|
+
{' '}
|
|
433
|
+
</p>
|
|
434
|
+
<p>
|
|
435
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
436
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
437
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
438
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
439
|
+
porta placerat leo.
|
|
440
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
441
|
+
Cras placerat ac enim viverra rhoncus.
|
|
442
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
443
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
444
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
445
|
+
{' '}
|
|
446
|
+
</p>
|
|
447
|
+
<p>
|
|
448
|
+
In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
|
|
449
|
+
non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
|
|
450
|
+
enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
|
|
451
|
+
Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
|
|
452
|
+
porta placerat leo.
|
|
453
|
+
Donec scelerisque enim risus, in pharetra purus fringilla eu.
|
|
454
|
+
Cras placerat ac enim viverra rhoncus.
|
|
455
|
+
Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
|
|
456
|
+
Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
|
|
457
|
+
Nullam vel porttitor mi, ut vestibulum arcu.
|
|
458
|
+
{' '}
|
|
459
|
+
</p>
|
|
460
|
+
|
|
461
|
+
<ContentSlides.Navigator />
|
|
462
|
+
</ContentSlides.Slide>
|
|
463
|
+
<ContentSlides.Slide
|
|
464
|
+
index={2}
|
|
465
|
+
>
|
|
466
|
+
<Title
|
|
467
|
+
heading="Part 3"
|
|
468
|
+
headingAs="h1"
|
|
469
|
+
headingClassName="small"
|
|
470
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
471
|
+
/>
|
|
472
|
+
<ContentSlides.Navigator />
|
|
473
|
+
</ContentSlides.Slide>
|
|
474
|
+
<ContentSlides.Slide
|
|
475
|
+
index={3}
|
|
476
|
+
>
|
|
477
|
+
<Title
|
|
478
|
+
heading="Part 4"
|
|
479
|
+
headingAs="h1"
|
|
480
|
+
headingClassName="small"
|
|
481
|
+
subtitle="Welcome to this site. We hope you will have an amazing experience here."
|
|
482
|
+
/>
|
|
483
|
+
<ContentSlides.Navigator />
|
|
484
|
+
</ContentSlides.Slide>
|
|
485
|
+
</main>
|
|
486
|
+
</>
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
return (
|
|
490
|
+
<ContentSlides className="y-background4 b-light-y" steps={steps} simple>
|
|
491
|
+
<Shapes
|
|
492
|
+
height="65em"
|
|
493
|
+
verticalAlign="center"
|
|
494
|
+
horizontalAlign="flex-start"
|
|
495
|
+
shape="spiral"
|
|
496
|
+
/>
|
|
345
497
|
<Main />
|
|
346
498
|
</ContentSlides>
|
|
347
499
|
)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem'
|
|
9
|
+
|
|
10
|
+
// Local Definitions
|
|
11
|
+
|
|
12
|
+
const baseClassName = styleNames.base
|
|
13
|
+
|
|
14
|
+
const componentClassName = 'snap-scroller'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is the component description.
|
|
18
|
+
*/
|
|
19
|
+
const SnapScroller = ({
|
|
20
|
+
id,
|
|
21
|
+
className:userClassName,
|
|
22
|
+
style,
|
|
23
|
+
children,
|
|
24
|
+
noScrollOnDesktop,
|
|
25
|
+
// ...otherProps
|
|
26
|
+
}) => {
|
|
27
|
+
useLayoutEffect(() => {
|
|
28
|
+
import('./styles.scss')
|
|
29
|
+
}, [])
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
id={id}
|
|
34
|
+
className={[
|
|
35
|
+
|
|
36
|
+
baseClassName,
|
|
37
|
+
|
|
38
|
+
componentClassName,
|
|
39
|
+
userClassName,
|
|
40
|
+
noScrollOnDesktop && 'desktop-no-scroll',
|
|
41
|
+
]
|
|
42
|
+
.filter((e) => e)
|
|
43
|
+
.join(' ')}
|
|
44
|
+
style={style}
|
|
45
|
+
// {...otherProps}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
SnapScroller.propTypes = {
|
|
53
|
+
/**
|
|
54
|
+
* The HTML id for this element
|
|
55
|
+
*/
|
|
56
|
+
id:PropTypes.string,
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The HTML class names for this element
|
|
60
|
+
*/
|
|
61
|
+
className:PropTypes.string,
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The React-written, css properties for this element.
|
|
65
|
+
*/
|
|
66
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The children JSX
|
|
70
|
+
*/
|
|
71
|
+
children:PropTypes.node,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Whether to snap scroll on desktop (false will enable a flexbox)
|
|
75
|
+
*/
|
|
76
|
+
noScrollOnDesktop:PropTypes.bool,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
SnapScroller.defaultProps = {
|
|
80
|
+
noScrollOnDesktop:false,
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default SnapScroller
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@aztlan/stylebook/src/mixins";
|
|
5
|
+
@use "@aztlan/stylebook/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
$default-spacing:var(--spacing, var(--u));
|
|
8
|
+
|
|
9
|
+
.#{bem.$base}.snap-scroller {
|
|
10
|
+
display: flex;
|
|
11
|
+
-ms-overflow-style: none; /* for Internet Explorer, Edge */
|
|
12
|
+
overflow-x: auto;
|
|
13
|
+
scroll-padding: calc(#{$default-spacing} *2);
|
|
14
|
+
scroll-snap-type: x mandatory;
|
|
15
|
+
scrollbar-width: none;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
> * {
|
|
19
|
+
&:first-child {
|
|
20
|
+
margin-left: $default-spacing;
|
|
21
|
+
}
|
|
22
|
+
display: inline-block;
|
|
23
|
+
margin-right: $default-spacing;
|
|
24
|
+
scroll-snap-align: start;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@include mixins.media($from:$sm-md) {
|
|
29
|
+
&.desktop-no-scroll {
|
|
30
|
+
overflow: auto;
|
|
31
|
+
-ms-overflow-style: unset; /* for Internet Explorer, Edge */
|
|
32
|
+
scroll-snap-type: none;
|
|
33
|
+
scrollbar-width: unset;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
package/src/ui/a/index.js
CHANGED
|
@@ -25,4 +25,5 @@ export { DotInfo } from './DotInfo'
|
|
|
25
25
|
export { Timestamp } from './Timestamp'
|
|
26
26
|
export { Shapes } from './Shapes'
|
|
27
27
|
export { OvalIllustration } from './OvalIllustration'
|
|
28
|
+
export { SnapScroller } from './SnapScroller'
|
|
28
29
|
export { BackgroundGradient } from './BackgroundGradient'
|
|
@@ -65,13 +65,13 @@ const HorizontalMenu = ({
|
|
|
65
65
|
<div className="left">
|
|
66
66
|
{(!isFirstStep && !hideBackIcon) && (
|
|
67
67
|
<span
|
|
68
|
-
className="
|
|
68
|
+
className="prev-button pointer"
|
|
69
69
|
onClick={mobilePreviousStep}
|
|
70
70
|
role="button"
|
|
71
71
|
onKeyDown={mobilePreviousStep}
|
|
72
72
|
tabIndex={0}
|
|
73
73
|
>
|
|
74
|
-
|
|
74
|
+
{'<--'}
|
|
75
75
|
</span>
|
|
76
76
|
)}
|
|
77
77
|
</div>
|
|
@@ -131,7 +131,7 @@ HorizontalMenu.propTypes = {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
HorizontalMenu.defaultProps = {
|
|
134
|
-
logoColor :'
|
|
134
|
+
logoColor :'paragraph',
|
|
135
135
|
stepsBackwards:1,
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -14,7 +14,7 @@ $class-navigator:navigator;
|
|
|
14
14
|
$default-sidebar-width:minmax(250px, 330px);
|
|
15
15
|
$default-border:none;//2px solid var(--grid);
|
|
16
16
|
$default-border-radius:var(--theme-border-radius);
|
|
17
|
-
$default-content-background:var(--
|
|
17
|
+
$default-content-background: var(--background1);
|
|
18
18
|
$default-padding:var(--u);
|
|
19
19
|
|
|
20
20
|
$mobile-content-margin:6em;
|
|
@@ -61,7 +61,6 @@ $mobile-content-margin:6em;
|
|
|
61
61
|
|
|
62
62
|
//.#{$class-main-container} {
|
|
63
63
|
main {
|
|
64
|
-
background: var(--dark-y);
|
|
65
64
|
overflow: hidden;
|
|
66
65
|
position: relative;
|
|
67
66
|
|
|
@@ -79,7 +78,7 @@ $mobile-content-margin:6em;
|
|
|
79
78
|
.#{bem.$element-content} {
|
|
80
79
|
background: $default-content-background;
|
|
81
80
|
|
|
82
|
-
border:
|
|
81
|
+
border: var(--theme-border);
|
|
83
82
|
border-radius: $default-border-radius;
|
|
84
83
|
max-width: 600px;
|
|
85
84
|
padding: $default-padding;
|
|
@@ -108,8 +107,9 @@ $mobile-content-margin:6em;
|
|
|
108
107
|
|
|
109
108
|
.#{$class-horizontal-menu} {
|
|
110
109
|
background: $default-content-background;
|
|
111
|
-
border-bottom:
|
|
110
|
+
border-bottom: var(--theme-border);
|
|
112
111
|
color: var(--heading);
|
|
112
|
+
z-index: 1;
|
|
113
113
|
|
|
114
114
|
.#{bem.$element-content} {
|
|
115
115
|
display: grid;
|
|
@@ -124,6 +124,11 @@ $mobile-content-margin:6em;
|
|
|
124
124
|
|
|
125
125
|
.left {
|
|
126
126
|
text-align: left;
|
|
127
|
+
|
|
128
|
+
.prev-button {
|
|
129
|
+
font-family: var(--theme-default-paragraph);
|
|
130
|
+
font-size: calc(var(--s2) * 1em);
|
|
131
|
+
}
|
|
127
132
|
}
|
|
128
133
|
|
|
129
134
|
.right {
|
|
@@ -210,6 +215,7 @@ $mobile-content-margin:6em;
|
|
|
210
215
|
|
|
211
216
|
.next {
|
|
212
217
|
flex-grow: 1;
|
|
218
|
+
justify-content: flex-end;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
221
|
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
var _bem = _interopRequireDefault(require("@pareto-engineering/bem"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
|
-
// Local Definitions
|
|
27
|
-
var baseClassName = _bem.default.base;
|
|
28
|
-
var componentClassName = 'gradient-background';
|
|
29
|
-
/**
|
|
30
|
-
* This is the component description.
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
var GradientBackground = _ref => {
|
|
34
|
-
var {
|
|
35
|
-
id,
|
|
36
|
-
className: userClassName,
|
|
37
|
-
style,
|
|
38
|
-
pin,
|
|
39
|
-
shape,
|
|
40
|
-
height,
|
|
41
|
-
width // ...otherProps
|
|
42
|
-
|
|
43
|
-
} = _ref;
|
|
44
|
-
(0, React.useLayoutEffect)(() => {
|
|
45
|
-
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
46
|
-
}, []);
|
|
47
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
id: id,
|
|
49
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
50
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
51
|
-
'--pin': pin,
|
|
52
|
-
'--height': height,
|
|
53
|
-
'--width': width
|
|
54
|
-
}) // {...otherProps}
|
|
55
|
-
|
|
56
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
className: "shapes"
|
|
58
|
-
}, shape === 'triangle' && /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: "triangle"
|
|
60
|
-
}), shape === 'half-ellipses' && /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: "half-ellipses"
|
|
62
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: "up"
|
|
64
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
65
|
-
className: "down"
|
|
66
|
-
})), shape === 'ellipse' && /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: "ellipse"
|
|
68
|
-
}), shape === 'diamonds' && /*#__PURE__*/React.createElement("div", {
|
|
69
|
-
className: "diamonds"
|
|
70
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: "top-right"
|
|
72
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: "bottom-left"
|
|
74
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: "bottom-right"
|
|
76
|
-
})), shape === 'rectangles' && /*#__PURE__*/React.createElement("div", {
|
|
77
|
-
className: "rectangles"
|
|
78
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
79
|
-
className: "top"
|
|
80
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: "center"
|
|
82
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className: "bottom"
|
|
84
|
-
})), shape === 'half-ellipse' && /*#__PURE__*/React.createElement("div", {
|
|
85
|
-
className: "half-ellipse"
|
|
86
|
-
}), shape === 'circle' && /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
className: "circle"
|
|
88
|
-
}), shape === 'half-circle' && /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
className: "half-circle"
|
|
90
|
-
}), shape === 'ellipses' && /*#__PURE__*/React.createElement("div", {
|
|
91
|
-
className: "ellipses"
|
|
92
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: "first"
|
|
94
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className: "second"
|
|
96
|
-
})), shape === 'spiral' && /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className: "spiral"
|
|
98
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
className: "quater-circle-one"
|
|
100
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: "quater-circle-two"
|
|
102
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
103
|
-
className: "quater-circle-three"
|
|
104
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
105
|
-
className: "quater-circle-four"
|
|
106
|
-
}))));
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
GradientBackground.propTypes = {
|
|
110
|
-
/**
|
|
111
|
-
* The HTML id for this element
|
|
112
|
-
*/
|
|
113
|
-
id: _propTypes.default.string,
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The HTML class names for this element
|
|
117
|
-
*/
|
|
118
|
-
className: _propTypes.default.string,
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* The React-written, css properties for this element.
|
|
122
|
-
*/
|
|
123
|
-
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Where to pin the shapes
|
|
127
|
-
*/
|
|
128
|
-
pin: _propTypes.default.oneOf(['flex-start', 'center', 'flex-end']),
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* The options of a shape to use
|
|
132
|
-
*/
|
|
133
|
-
shape: _propTypes.default.oneOf(['triangle', 'ellipse', 'half-ellipse', 'half-ellipses', 'spiral', 'diamonds', 'circle', 'half-circle', 'ellipses', 'rectangles'])
|
|
134
|
-
};
|
|
135
|
-
GradientBackground.defaultProps = {
|
|
136
|
-
pin: 'center',
|
|
137
|
-
shape: 'triangle'
|
|
138
|
-
};
|
|
139
|
-
var _default = GradientBackground;
|
|
140
|
-
exports.default = _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "GradientBackground", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _GradientBackground.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _GradientBackground = _interopRequireDefault(require("./GradientBackground"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|