@pareto-engineering/design-system 2.0.0-alpha.55 → 2.0.0-alpha.56
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/a/Alert/Alert.js +141 -0
- package/dist/cjs/a/Alert/index.js +15 -0
- package/dist/cjs/a/Alert/styles.scss +74 -0
- package/dist/cjs/a/index.js +9 -1
- package/dist/cjs/f/fields/IntlTelInput/IntlTelInput.js +170 -0
- package/dist/cjs/f/fields/IntlTelInput/index.js +15 -0
- package/dist/cjs/f/fields/IntlTelInput/styles.scss +37 -0
- package/dist/es/a/Alert/Alert.js +118 -0
- package/dist/es/a/Alert/index.js +2 -0
- package/dist/es/a/Alert/styles.scss +74 -0
- package/dist/es/a/index.js +2 -1
- package/dist/es/f/fields/IntlTelInput/IntlTelInput.js +152 -0
- package/dist/es/f/fields/IntlTelInput/index.js +2 -0
- package/dist/es/f/fields/IntlTelInput/styles.scss +37 -0
- package/package.json +2 -2
- package/src/__snapshots__/Storyshots.test.js.snap +323 -25
- package/src/stories/a/Alert.stories.jsx +75 -0
- package/src/stories/a/DotInfo.stories.jsx +2 -1
- package/src/stories/a/ProgressBar.stories.jsx +4 -1
- package/src/stories/a/Timestamp.stories.jsx +3 -1
- package/src/stories/b/Logo.stories.jsx +2 -1
- package/src/stories/b/QuestionDropdown.stories.jsx +3 -0
- package/src/stories/b/SocialMediaButton.stories.jsx +2 -1
- package/src/stories/b/Title.stories.jsx +2 -2
- package/src/stories/c/ContentSlides.stories.jsx +3 -1
- package/src/stories/c/Shortener.stories.jsx +9 -3
- package/src/stories/c/SocialMediaShareButton.stories.jsx +14 -6
- package/src/stories/f/ChoicesInput.stories.jsx +4 -1
- package/src/stories/f/Description.stories.jsx +11 -3
- package/src/stories/f/QueryCombobox.stories.jsx +2 -1
- package/src/stories/f/QuerySelect.stories.jsx +2 -1
- package/src/stories/f/RatingsInput.stories.jsx +8 -1
- package/src/stories/f/SelectInput.stories.jsx +2 -1
- package/src/stories/f/TextInput.stories.jsx +7 -1
- package/src/stories/f/TextareaInput.stories.jsx +6 -1
- package/src/ui/a/Alert/Alert.jsx +144 -0
- package/src/ui/a/Alert/index.js +2 -0
- package/src/ui/a/Alert/styles.scss +74 -0
- package/src/ui/a/index.js +1 -0
|
@@ -13,16 +13,22 @@ export default {
|
|
|
13
13
|
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
14
|
],
|
|
15
15
|
argTypes:{
|
|
16
|
-
backgroundColor:{ control: 'color' },
|
|
16
|
+
// backgroundColor:{ control: 'color' },
|
|
17
|
+
// limit:{ control: 'number' },
|
|
17
18
|
},
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
const Template = (args) => (
|
|
21
22
|
<Shortener
|
|
22
|
-
limit={10}
|
|
23
23
|
style={{ maxWidth: '300px' }}
|
|
24
|
+
{...args}
|
|
24
25
|
>
|
|
25
26
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
|
|
26
27
|
incididunt ut labore et dolore magna aliqua.
|
|
27
28
|
</Shortener>
|
|
28
29
|
)
|
|
30
|
+
|
|
31
|
+
export const Base = Template.bind({})
|
|
32
|
+
Base.args = {
|
|
33
|
+
limit:10,
|
|
34
|
+
}
|
|
@@ -13,13 +13,21 @@ export default {
|
|
|
13
13
|
(storyfn) => <Router>{storyfn()}</Router>,
|
|
14
14
|
],
|
|
15
15
|
argTypes:{
|
|
16
|
-
backgroundColor:{ control: 'color' },
|
|
16
|
+
// backgroundColor:{ control: 'color' },
|
|
17
|
+
type:{ control: 'select', options: ['twitter', 'facebook'] },
|
|
17
18
|
},
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
<SocialMediaShareButton type="facebook" />
|
|
23
|
-
<SocialMediaShareButton type="twitter" />
|
|
24
|
-
</div>
|
|
21
|
+
const Template = (args) => (
|
|
22
|
+
<SocialMediaShareButton {...args} />
|
|
25
23
|
)
|
|
24
|
+
|
|
25
|
+
export const Facebook = Template.bind({})
|
|
26
|
+
Facebook.args = {
|
|
27
|
+
type:'facebook',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Twitter = Template.bind({})
|
|
31
|
+
Twitter.args = {
|
|
32
|
+
type:'twitter',
|
|
33
|
+
}
|
|
@@ -22,7 +22,10 @@ export default {
|
|
|
22
22
|
),
|
|
23
23
|
],
|
|
24
24
|
argTypes:{
|
|
25
|
-
backgroundColor:{ control: 'color' },
|
|
25
|
+
// backgroundColor:{ control: 'color' },
|
|
26
|
+
multiple :{ control: 'boolean' },
|
|
27
|
+
gridColumnsDesktop:{ control: 'number' },
|
|
28
|
+
disabled :{ control: 'boolean' },
|
|
26
29
|
},
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -23,10 +23,18 @@ export default {
|
|
|
23
23
|
),
|
|
24
24
|
],
|
|
25
25
|
argTypes:{
|
|
26
|
-
backgroundColor:{ control: 'color' },
|
|
26
|
+
// backgroundColor:{ control: 'color' },
|
|
27
|
+
description:{ control: 'text' },
|
|
28
|
+
name :{ control: 'text' },
|
|
27
29
|
},
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
<Description
|
|
32
|
+
const Template = (args) => (
|
|
33
|
+
<Description {...args} />
|
|
32
34
|
)
|
|
35
|
+
|
|
36
|
+
export const Base = Template.bind({})
|
|
37
|
+
Base.args = {
|
|
38
|
+
description:'Sample Description',
|
|
39
|
+
name :'email',
|
|
40
|
+
}
|
|
@@ -23,7 +23,14 @@ export default {
|
|
|
23
23
|
),
|
|
24
24
|
],
|
|
25
25
|
argTypes:{
|
|
26
|
-
backgroundColor:{ control: 'color' },
|
|
26
|
+
// backgroundColor:{ control: 'color' },
|
|
27
|
+
ratingCount :{ control: 'number' },
|
|
28
|
+
name :{ control: 'text' },
|
|
29
|
+
label :{ control: 'text' },
|
|
30
|
+
showRatingValue :{ control: 'boolean' },
|
|
31
|
+
displayRatingsLabel:{ control: 'boolean' },
|
|
32
|
+
labelMax :{ control: 'text' },
|
|
33
|
+
labelMin :{ control: 'text' },
|
|
27
34
|
},
|
|
28
35
|
}
|
|
29
36
|
|
|
@@ -26,7 +26,13 @@ export default {
|
|
|
26
26
|
),
|
|
27
27
|
],
|
|
28
28
|
argTypes:{
|
|
29
|
-
backgroundColor:{ control: 'color' },
|
|
29
|
+
// backgroundColor:{ control: 'color' },
|
|
30
|
+
placeholder :{ control: 'text' },
|
|
31
|
+
autoComplete:{ control: 'select', options: ['off', 'on'] },
|
|
32
|
+
disabled :{ control: 'boolean' },
|
|
33
|
+
type :{ control: 'text' },
|
|
34
|
+
name :{ control: 'text' },
|
|
35
|
+
label :{ control: 'text' },
|
|
30
36
|
},
|
|
31
37
|
}
|
|
32
38
|
|
|
@@ -24,7 +24,12 @@ export default {
|
|
|
24
24
|
),
|
|
25
25
|
],
|
|
26
26
|
argTypes:{
|
|
27
|
-
backgroundColor:{ control: 'color' },
|
|
27
|
+
// backgroundColor:{ control: 'color' },
|
|
28
|
+
name :{ control: 'text' },
|
|
29
|
+
label :{ control: 'text' },
|
|
30
|
+
placeholder :{ control: 'text' },
|
|
31
|
+
disabled :{ control: 'boolean' },
|
|
32
|
+
labelAsDescription:{ control: 'boolean' },
|
|
28
33
|
},
|
|
29
34
|
}
|
|
30
35
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useState, useEffect, useLayoutEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import { Button } from 'ui/b'
|
|
9
|
+
|
|
10
|
+
import styleNames from '@pareto-engineering/bem'
|
|
11
|
+
|
|
12
|
+
// Local Definitions
|
|
13
|
+
|
|
14
|
+
const baseClassName = styleNames.base
|
|
15
|
+
|
|
16
|
+
const componentClassName = 'alert'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This is the component description.
|
|
20
|
+
*/
|
|
21
|
+
const Alert = ({
|
|
22
|
+
id,
|
|
23
|
+
className:userClassName,
|
|
24
|
+
style,
|
|
25
|
+
children,
|
|
26
|
+
type,
|
|
27
|
+
withCloseIcon,
|
|
28
|
+
primaryPosition,
|
|
29
|
+
secondaryPosition,
|
|
30
|
+
autoCloseMs,
|
|
31
|
+
width,
|
|
32
|
+
// ...otherProps
|
|
33
|
+
}) => {
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
import('./styles.scss')
|
|
36
|
+
}, [])
|
|
37
|
+
|
|
38
|
+
const [hideAlert, setHideAlert] = useState(false)
|
|
39
|
+
|
|
40
|
+
const handleCloseAlert = () => setHideAlert(true)
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (autoCloseMs) {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
setHideAlert(true)
|
|
46
|
+
}, autoCloseMs)
|
|
47
|
+
}
|
|
48
|
+
}, [autoCloseMs])
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
id={id}
|
|
53
|
+
className={[
|
|
54
|
+
|
|
55
|
+
baseClassName,
|
|
56
|
+
|
|
57
|
+
componentClassName,
|
|
58
|
+
userClassName,
|
|
59
|
+
`x-${type}`,
|
|
60
|
+
hideAlert && 'hide',
|
|
61
|
+
primaryPosition,
|
|
62
|
+
secondaryPosition,
|
|
63
|
+
]
|
|
64
|
+
.filter((e) => e)
|
|
65
|
+
.join(' ')}
|
|
66
|
+
style={{
|
|
67
|
+
...style,
|
|
68
|
+
'--width':width,
|
|
69
|
+
}}
|
|
70
|
+
// {...otherProps}
|
|
71
|
+
>
|
|
72
|
+
<div className="bar" />
|
|
73
|
+
{withCloseIcon && (
|
|
74
|
+
<div className="close">
|
|
75
|
+
<Button isSimple color="heading" onClick={handleCloseAlert}>
|
|
76
|
+
<span className="f-icons">Y</span>
|
|
77
|
+
</Button>
|
|
78
|
+
</div>
|
|
79
|
+
)}
|
|
80
|
+
<div className="content">
|
|
81
|
+
{children}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Alert.propTypes = {
|
|
88
|
+
/**
|
|
89
|
+
* The HTML id for this element
|
|
90
|
+
*/
|
|
91
|
+
id:PropTypes.string,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The HTML class names for this element
|
|
95
|
+
*/
|
|
96
|
+
className:PropTypes.string,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The React-written, css properties for this element.
|
|
100
|
+
*/
|
|
101
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The children JSX
|
|
105
|
+
*/
|
|
106
|
+
children:PropTypes.node,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Whether the alert should have a close Icon
|
|
110
|
+
*/
|
|
111
|
+
withCloseIcon:PropTypes.bool,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The primary position of the alert
|
|
115
|
+
*/
|
|
116
|
+
primaryPosition:PropTypes.oneOf(['top', 'bottom', 'center']),
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The secondary position of the alert
|
|
120
|
+
*/
|
|
121
|
+
secondaryPosition:PropTypes.oneOf(['left', 'right']),
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The number milisseconds to wait for before closing the alert
|
|
125
|
+
*/
|
|
126
|
+
autoCloseMs:PropTypes.number,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The type of the alert
|
|
130
|
+
*/
|
|
131
|
+
type:PropTypes.oneOf(['success', 'warning', 'error']),
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The width of the alert
|
|
135
|
+
*/
|
|
136
|
+
width:PropTypes.number,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
Alert.defaultProps = {
|
|
140
|
+
withCloseIcon :true,
|
|
141
|
+
primaryPosition:'top',
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default Alert
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
@use "@pareto-engineering/bem";
|
|
3
|
+
@use "@aztlan/stylebook/src/mixins";
|
|
4
|
+
@use "@aztlan/stylebook/src/globals" as *;
|
|
5
|
+
|
|
6
|
+
$default-padding: 1em;
|
|
7
|
+
$default-bar-height: .3em;
|
|
8
|
+
$default-alert-desktop-width: var(--width, 30em);
|
|
9
|
+
|
|
10
|
+
.#{bem.$base}.alert {
|
|
11
|
+
border: var(--theme-border);
|
|
12
|
+
padding-bottom: $default-padding * 1.5;
|
|
13
|
+
width: 100%;
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 1;
|
|
16
|
+
|
|
17
|
+
&.center {
|
|
18
|
+
top: 50%;
|
|
19
|
+
left: 50%;
|
|
20
|
+
transform: translate(-50%, -50%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.top {
|
|
24
|
+
top: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.bottom {
|
|
28
|
+
bottom: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.right {
|
|
32
|
+
right: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.left {
|
|
36
|
+
left: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.hide {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
>.bar {
|
|
44
|
+
background-color: var(--x);
|
|
45
|
+
height: $default-bar-height;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
>.close {
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
|
|
52
|
+
span {
|
|
53
|
+
padding: $default-padding / 2;
|
|
54
|
+
font-size: calc(var(--s-2) * 1em);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bar+.content {
|
|
59
|
+
padding-top: $default-padding * 1.5;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
>.content {
|
|
63
|
+
padding-inline: $default-padding;
|
|
64
|
+
|
|
65
|
+
.icon {
|
|
66
|
+
color: var(--x)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Desktop styles
|
|
71
|
+
@include mixins.media($from: $sm-md) {
|
|
72
|
+
width: $default-alert-desktop-width;
|
|
73
|
+
}
|
|
74
|
+
}
|
package/src/ui/a/index.js
CHANGED