@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.
Files changed (39) hide show
  1. package/dist/cjs/a/Alert/Alert.js +141 -0
  2. package/dist/cjs/a/Alert/index.js +15 -0
  3. package/dist/cjs/a/Alert/styles.scss +74 -0
  4. package/dist/cjs/a/index.js +9 -1
  5. package/dist/cjs/f/fields/IntlTelInput/IntlTelInput.js +170 -0
  6. package/dist/cjs/f/fields/IntlTelInput/index.js +15 -0
  7. package/dist/cjs/f/fields/IntlTelInput/styles.scss +37 -0
  8. package/dist/es/a/Alert/Alert.js +118 -0
  9. package/dist/es/a/Alert/index.js +2 -0
  10. package/dist/es/a/Alert/styles.scss +74 -0
  11. package/dist/es/a/index.js +2 -1
  12. package/dist/es/f/fields/IntlTelInput/IntlTelInput.js +152 -0
  13. package/dist/es/f/fields/IntlTelInput/index.js +2 -0
  14. package/dist/es/f/fields/IntlTelInput/styles.scss +37 -0
  15. package/package.json +2 -2
  16. package/src/__snapshots__/Storyshots.test.js.snap +323 -25
  17. package/src/stories/a/Alert.stories.jsx +75 -0
  18. package/src/stories/a/DotInfo.stories.jsx +2 -1
  19. package/src/stories/a/ProgressBar.stories.jsx +4 -1
  20. package/src/stories/a/Timestamp.stories.jsx +3 -1
  21. package/src/stories/b/Logo.stories.jsx +2 -1
  22. package/src/stories/b/QuestionDropdown.stories.jsx +3 -0
  23. package/src/stories/b/SocialMediaButton.stories.jsx +2 -1
  24. package/src/stories/b/Title.stories.jsx +2 -2
  25. package/src/stories/c/ContentSlides.stories.jsx +3 -1
  26. package/src/stories/c/Shortener.stories.jsx +9 -3
  27. package/src/stories/c/SocialMediaShareButton.stories.jsx +14 -6
  28. package/src/stories/f/ChoicesInput.stories.jsx +4 -1
  29. package/src/stories/f/Description.stories.jsx +11 -3
  30. package/src/stories/f/QueryCombobox.stories.jsx +2 -1
  31. package/src/stories/f/QuerySelect.stories.jsx +2 -1
  32. package/src/stories/f/RatingsInput.stories.jsx +8 -1
  33. package/src/stories/f/SelectInput.stories.jsx +2 -1
  34. package/src/stories/f/TextInput.stories.jsx +7 -1
  35. package/src/stories/f/TextareaInput.stories.jsx +6 -1
  36. package/src/ui/a/Alert/Alert.jsx +144 -0
  37. package/src/ui/a/Alert/index.js +2 -0
  38. package/src/ui/a/Alert/styles.scss +74 -0
  39. package/src/ui/a/index.js +1 -0
@@ -13,7 +13,8 @@ export default {
13
13
  // storyfn => <div className="">{ storyfn() }</div>,
14
14
  ],
15
15
  argTypes:{
16
- backgroundColor:{ control: 'color' },
16
+ // backgroundColor:{ control: 'color' },
17
+ isTransparent:{ control: 'boolean' },
17
18
  },
18
19
  }
19
20
 
@@ -13,8 +13,8 @@ export default {
13
13
  // storyfn => <div className="">{ storyfn() }</div>,
14
14
  ],
15
15
  argTypes:{
16
- // heading :{ control: 'string' },
17
- // subtitle:{ control: 'string' },
16
+ heading :{ control: 'text' },
17
+ subtitle:{ control: 'text' },
18
18
  },
19
19
  }
20
20
 
@@ -38,7 +38,9 @@ export default {
38
38
  ),
39
39
  ],
40
40
  argTypes:{
41
- backgroundColor:{ control: 'color' },
41
+ // backgroundColor:{ control: 'color' },
42
+ isSimple :{ control: 'boolean' },
43
+ hasBackgroundShape:{ control: 'boolean' },
42
44
  },
43
45
  }
44
46
 
@@ -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
- export const Base = () => (
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
- export const Base = () => (
21
- <div>
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
- export const Base = () => (
31
- <Description description="Sample Description" name="email" />
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
+ }
@@ -29,7 +29,8 @@ export default {
29
29
  ),
30
30
  ],
31
31
  argTypes:{
32
- backgroundColor:{ control: 'color' },
32
+ // backgroundColor:{ control: 'color' },
33
+ multiple:{ control: 'boolean' },
33
34
  },
34
35
  }
35
36
 
@@ -28,7 +28,8 @@ export default {
28
28
  ),
29
29
  ],
30
30
  argTypes:{
31
- backgroundColor:{ control: 'color' },
31
+ // backgroundColor:{ control: 'color' },
32
+ isLoading:{ control: 'boolean' },
32
33
  },
33
34
  }
34
35
  const statuses = [
@@ -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
 
@@ -22,7 +22,8 @@ export default {
22
22
  ),
23
23
  ],
24
24
  argTypes:{
25
- backgroundColor:{ control: 'color' },
25
+ // backgroundColor:{ control: 'color' },
26
+ disabled:{ control: 'boolean' },
26
27
  },
27
28
  }
28
29
 
@@ -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,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as Alert } from './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
@@ -29,3 +29,4 @@ export { SnapScroller } from './SnapScroller'
29
29
  export { BackgroundGradient } from './BackgroundGradient'
30
30
  export { ContentTree } from './ContentTree'
31
31
  export { Popover } from './Popover'
32
+ export { Alert } from './Alert'