@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
@@ -0,0 +1,152 @@
1
+ function _extends() { _extends = Object.assign || 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
+
3
+ /* @pareto-engineering/generator-front 1.0.12 */
4
+ import * as React from 'react';
5
+ import { useRef, useEffect, useLayoutEffect } from 'react';
6
+ import intlTelInput from 'intl-tel-input';
7
+ import PropTypes from 'prop-types';
8
+ import styleNames from '@pareto-engineering/bem'; // Local Definitions
9
+
10
+ import { useField } from 'formik';
11
+ import { FormLabel, FormDescription } from "../../common";
12
+ const baseClassName = styleNames.base;
13
+ const componentClassName = 'intl-tel-input';
14
+ /**
15
+ * This is the component description.
16
+ */
17
+
18
+ const IntlTelInput = ({
19
+ id,
20
+ className: userClassName,
21
+ style,
22
+ name,
23
+ label,
24
+ color,
25
+ labelColor,
26
+ validate,
27
+ oneInputLabel,
28
+ description,
29
+ disabled,
30
+ // placeholder,
31
+ optional,
32
+ autoComplete // ...otherProps
33
+
34
+ }) => {
35
+ useLayoutEffect(() => {
36
+ import("./styles.scss");
37
+ import('intl-tel-input/build/css/intlTelInput.css');
38
+ }, []);
39
+ const [field] = useField({
40
+ name,
41
+ validate
42
+ });
43
+ const input = useRef(null);
44
+ useEffect(() => {
45
+ const iti = intlTelInput(input.current, {
46
+ separateDialCode: true,
47
+ customContainer: 'input-wrapper'
48
+ });
49
+ return () => iti.destroy();
50
+ }, [input.current]);
51
+ return /*#__PURE__*/React.createElement("div", {
52
+ id: id,
53
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
54
+ style: style // {...otherProps}
55
+
56
+ }, /*#__PURE__*/React.createElement(FormLabel, {
57
+ className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
58
+ name: name,
59
+ color: labelColor,
60
+ optional: optional
61
+ }, label), /*#__PURE__*/React.createElement("input", _extends({
62
+ id: name,
63
+ className: "input",
64
+ type: "tel",
65
+ disabled: disabled // placeholder={placeholder}
66
+ ,
67
+ autoComplete: autoComplete,
68
+ ref: input
69
+ }, field)), /*#__PURE__*/React.createElement(FormDescription, {
70
+ className: "v50 mt-v s-1",
71
+ description: description,
72
+ name: name
73
+ }));
74
+ };
75
+
76
+ IntlTelInput.propTypes = {
77
+ /**
78
+ * The HTML id for this element
79
+ */
80
+ id: PropTypes.string,
81
+
82
+ /**
83
+ * The HTML class names for this element
84
+ */
85
+ className: PropTypes.string,
86
+
87
+ /**
88
+ * The React-written, css properties for this element.
89
+ */
90
+ style: PropTypes.objectOf(PropTypes.string),
91
+
92
+ /**
93
+ * The input name (html - and Formik state)
94
+ */
95
+ name: PropTypes.string.isRequired,
96
+
97
+ /**
98
+ * The input label
99
+ */
100
+ label: PropTypes.string.isRequired,
101
+
102
+ /**
103
+ * The input label color
104
+ */
105
+ labelColor: PropTypes.string,
106
+
107
+ /**
108
+ * The input field validator function
109
+ */
110
+ validate: PropTypes.func,
111
+
112
+ /**
113
+ * If the slide will only have one input
114
+ */
115
+ oneInputLabel: PropTypes.bool,
116
+
117
+ /**
118
+ * Input description
119
+ */
120
+ description: PropTypes.string,
121
+
122
+ /**
123
+ * Whether the text input should be disabled
124
+ */
125
+ disabled: PropTypes.bool,
126
+
127
+ /**
128
+ * The placeholder text for the input
129
+ */
130
+ placeholder: PropTypes.string,
131
+
132
+ /**
133
+ * The text input color
134
+ */
135
+ color: PropTypes.string,
136
+
137
+ /**
138
+ * Whether the input is optional or not
139
+ */
140
+ optional: PropTypes.bool,
141
+
142
+ /**
143
+ * The autoComplete value that the browser should watch for the input
144
+ * `https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete`
145
+ */
146
+ autoComplete: PropTypes.string
147
+ };
148
+ IntlTelInput.defaultProps = {
149
+ color: 'background2',
150
+ disabled: false
151
+ };
152
+ export default IntlTelInput;
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as IntlTelInput } from "./IntlTelInput";
@@ -0,0 +1,37 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ @use "@pareto-engineering/bem";
3
+
4
+ $default-padding: 0.75em 0.75em 0.55em;
5
+
6
+ .#{bem.$base}.intl-tel-input {
7
+ display: flex;
8
+ flex-direction: column;
9
+
10
+ .input-wrapper {
11
+ width: 100%;
12
+ }
13
+
14
+ .input {
15
+ border: var(--theme-border-style) var(--dark-y);
16
+ background: var(--light-y);
17
+ color: var(--on-y);
18
+ padding: $default-padding;
19
+ width: 100%;
20
+
21
+ &::placeholder {
22
+ color: var(--metadata);
23
+ }
24
+
25
+ &:not(:disabled):hover {
26
+ border: var(--theme-border-style) var(--light-background4);
27
+ }
28
+
29
+ &:disabled {
30
+ background-color: var(--dark-y);
31
+ }
32
+
33
+ &:focus {
34
+ background: var(--light-background4);
35
+ }
36
+ }
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.55",
3
+ "version": "2.0.0-alpha.56",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -88,7 +88,7 @@
88
88
  "stylelint-config-palantir": "^5.1.0"
89
89
  },
90
90
  "dependencies": {
91
- "@pareto-engineering/assets": "^2.0.0-alpha.22",
91
+ "@pareto-engineering/assets": "^2.0.0-alpha.24",
92
92
  "@pareto-engineering/bem": "^0.1.5",
93
93
  "@pareto-engineering/styles": "^2.0.0-alpha.8",
94
94
  "date-fns": "^2.22.1",
@@ -1,5 +1,302 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`Storyshots a/Alert Base 1`] = `
4
+ <div
5
+ className="base alert x-error top"
6
+ style={
7
+ Object {
8
+ "--width": undefined,
9
+ }
10
+ }
11
+ >
12
+ <div
13
+ className="bar"
14
+ />
15
+ <div
16
+ className="close"
17
+ >
18
+ <button
19
+ className="base button x-heading modifierSimple"
20
+ onClick={[Function]}
21
+ type="button"
22
+ >
23
+ <span
24
+ className="f-icons"
25
+ >
26
+ Y
27
+ </span>
28
+ </button>
29
+ </div>
30
+ <div
31
+ className="content"
32
+ >
33
+ <div
34
+ className="v1"
35
+ style={
36
+ Object {
37
+ "alignItems": "center",
38
+ "display": "flex",
39
+ }
40
+ }
41
+ >
42
+ <span
43
+ className="icon mr-v f-icons"
44
+ >
45
+ g
46
+ </span>
47
+ <p>
48
+ This is the alert content This is the alert content
49
+ </p>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ `;
54
+
55
+ exports[`Storyshots a/Alert Bottom Left 1`] = `
56
+ <div
57
+ className="base alert x-error bottom left"
58
+ style={
59
+ Object {
60
+ "--width": undefined,
61
+ }
62
+ }
63
+ >
64
+ <div
65
+ className="bar"
66
+ />
67
+ <div
68
+ className="close"
69
+ >
70
+ <button
71
+ className="base button x-heading modifierSimple"
72
+ onClick={[Function]}
73
+ type="button"
74
+ >
75
+ <span
76
+ className="f-icons"
77
+ >
78
+ Y
79
+ </span>
80
+ </button>
81
+ </div>
82
+ <div
83
+ className="content"
84
+ >
85
+ <div
86
+ className="v1"
87
+ style={
88
+ Object {
89
+ "alignItems": "center",
90
+ "display": "flex",
91
+ }
92
+ }
93
+ >
94
+ <span
95
+ className="icon mr-v f-icons"
96
+ >
97
+ g
98
+ </span>
99
+ <p>
100
+ This is the alert content This is the alert content
101
+ </p>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ `;
106
+
107
+ exports[`Storyshots a/Alert Centered 1`] = `
108
+ <div
109
+ className="base alert x-error center"
110
+ style={
111
+ Object {
112
+ "--width": undefined,
113
+ }
114
+ }
115
+ >
116
+ <div
117
+ className="bar"
118
+ />
119
+ <div
120
+ className="close"
121
+ >
122
+ <button
123
+ className="base button x-heading modifierSimple"
124
+ onClick={[Function]}
125
+ type="button"
126
+ >
127
+ <span
128
+ className="f-icons"
129
+ >
130
+ Y
131
+ </span>
132
+ </button>
133
+ </div>
134
+ <div
135
+ className="content"
136
+ >
137
+ <div
138
+ className="v1"
139
+ style={
140
+ Object {
141
+ "alignItems": "center",
142
+ "display": "flex",
143
+ }
144
+ }
145
+ >
146
+ <span
147
+ className="icon mr-v f-icons"
148
+ >
149
+ g
150
+ </span>
151
+ <p>
152
+ This is the alert content This is the alert content
153
+ </p>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ `;
158
+
159
+ exports[`Storyshots a/Alert Top Right 1`] = `
160
+ <div
161
+ className="base alert x-error top right"
162
+ style={
163
+ Object {
164
+ "--width": undefined,
165
+ }
166
+ }
167
+ >
168
+ <div
169
+ className="bar"
170
+ />
171
+ <div
172
+ className="close"
173
+ >
174
+ <button
175
+ className="base button x-heading modifierSimple"
176
+ onClick={[Function]}
177
+ type="button"
178
+ >
179
+ <span
180
+ className="f-icons"
181
+ >
182
+ Y
183
+ </span>
184
+ </button>
185
+ </div>
186
+ <div
187
+ className="content"
188
+ >
189
+ <div
190
+ className="v1"
191
+ style={
192
+ Object {
193
+ "alignItems": "center",
194
+ "display": "flex",
195
+ }
196
+ }
197
+ >
198
+ <span
199
+ className="icon mr-v f-icons"
200
+ >
201
+ g
202
+ </span>
203
+ <p>
204
+ This is the alert content This is the alert content
205
+ </p>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ `;
210
+
211
+ exports[`Storyshots a/Alert With Auto Close 1`] = `
212
+ <div
213
+ className="base alert x-error top"
214
+ style={
215
+ Object {
216
+ "--width": undefined,
217
+ }
218
+ }
219
+ >
220
+ <div
221
+ className="bar"
222
+ />
223
+ <div
224
+ className="close"
225
+ >
226
+ <button
227
+ className="base button x-heading modifierSimple"
228
+ onClick={[Function]}
229
+ type="button"
230
+ >
231
+ <span
232
+ className="f-icons"
233
+ >
234
+ Y
235
+ </span>
236
+ </button>
237
+ </div>
238
+ <div
239
+ className="content"
240
+ >
241
+ <div
242
+ className="v1"
243
+ style={
244
+ Object {
245
+ "alignItems": "center",
246
+ "display": "flex",
247
+ }
248
+ }
249
+ >
250
+ <span
251
+ className="icon mr-v f-icons"
252
+ >
253
+ g
254
+ </span>
255
+ <p>
256
+ This is the alert content This is the alert content
257
+ </p>
258
+ </div>
259
+ </div>
260
+ </div>
261
+ `;
262
+
263
+ exports[`Storyshots a/Alert Without Close Icon 1`] = `
264
+ <div
265
+ className="base alert x-error top"
266
+ style={
267
+ Object {
268
+ "--width": undefined,
269
+ }
270
+ }
271
+ >
272
+ <div
273
+ className="bar"
274
+ />
275
+ <div
276
+ className="content"
277
+ >
278
+ <div
279
+ className="v1"
280
+ style={
281
+ Object {
282
+ "alignItems": "center",
283
+ "display": "flex",
284
+ }
285
+ }
286
+ >
287
+ <span
288
+ className="icon mr-v f-icons"
289
+ >
290
+ g
291
+ </span>
292
+ <p>
293
+ This is the alert content This is the alert content
294
+ </p>
295
+ </div>
296
+ </div>
297
+ </div>
298
+ `;
299
+
3
300
  exports[`Storyshots a/AnimatedCounter After 1`] = `
4
301
  <div
5
302
  className="base animated-counter x-main1"
@@ -10199,33 +10496,34 @@ exports[`Storyshots c/Shortener Base 1`] = `
10199
10496
  </span>
10200
10497
  `;
10201
10498
 
10202
- exports[`Storyshots c/SocialMediaShareButton Base 1`] = `
10203
- <div>
10204
- <a
10205
- className="base social-media-share-button x-facebook"
10206
- href="https://www.facebook.com/sharer/sharer.php?u=http://localhost/#/welcome"
10207
- rel="noreferrer"
10208
- target="_blank"
10499
+ exports[`Storyshots c/SocialMediaShareButton Facebook 1`] = `
10500
+ <a
10501
+ className="base social-media-share-button x-facebook"
10502
+ href="https://www.facebook.com/sharer/sharer.php?u=http://localhost/#/welcome"
10503
+ rel="noreferrer"
10504
+ target="_blank"
10505
+ >
10506
+ <button
10507
+ type="button"
10209
10508
  >
10210
- <button
10211
- type="button"
10212
- >
10213
- f
10214
- </button>
10215
- </a>
10216
- <a
10217
- className="base social-media-share-button x-twitter"
10218
- href="https://twitter.com/intent/tweet?url=http://localhost/#/welcome"
10219
- rel="noreferrer"
10220
- target="_blank"
10509
+ f
10510
+ </button>
10511
+ </a>
10512
+ `;
10513
+
10514
+ exports[`Storyshots c/SocialMediaShareButton Twitter 1`] = `
10515
+ <a
10516
+ className="base social-media-share-button x-twitter"
10517
+ href="https://twitter.com/intent/tweet?url=http://localhost/#/welcome"
10518
+ rel="noreferrer"
10519
+ target="_blank"
10520
+ >
10521
+ <button
10522
+ type="button"
10221
10523
  >
10222
- <button
10223
- type="button"
10224
- >
10225
- t
10226
- </button>
10227
- </a>
10228
- </div>
10524
+ t
10525
+ </button>
10526
+ </a>
10229
10527
  `;
10230
10528
 
10231
10529
  exports[`Storyshots f/FormInput Base 1`] = `
@@ -0,0 +1,75 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { Alert } from 'ui'
5
+
6
+ export default {
7
+ title :'a/Alert',
8
+ component :Alert,
9
+ subcomponents:{
10
+ // Item:Alert.Item
11
+ },
12
+ decorators:[
13
+ // storyfn => <div className="">{ storyfn() }</div>,
14
+ ],
15
+ argTypes:{
16
+ withCloseIcon :{ control: 'boolean' },
17
+ primaryPosition :{ control: 'select', options: ['top', 'bottom', 'center'] },
18
+ secondaryPosition:{ control: 'select', options: ['left', 'right'] },
19
+ autoCloseMs :{ control: 'text' },
20
+ type :{ control: 'select', options: ['success', 'warning', 'error'] },
21
+ },
22
+ }
23
+
24
+ const Template = (args) => (
25
+ <Alert {...args}>
26
+ <div
27
+ style={{
28
+ display :'flex',
29
+ alignItems:'center',
30
+ }}
31
+ className="v1"
32
+ >
33
+ <span className="icon mr-v f-icons">g</span>
34
+ <p>This is the alert content This is the alert content</p>
35
+ </div>
36
+ </Alert>
37
+ )
38
+
39
+ export const Base = Template.bind({})
40
+ Base.args = {
41
+ type:'error',
42
+ }
43
+
44
+ export const WithoutCloseIcon = Template.bind({})
45
+ WithoutCloseIcon.args = {
46
+ ...Base.args,
47
+ withCloseIcon:false,
48
+ }
49
+
50
+ export const WithAutoClose = Template.bind({})
51
+ WithAutoClose.args = {
52
+ ...WithoutCloseIcon.args,
53
+ withCloseIcon:true,
54
+ autoCloseMs :'2000',
55
+ }
56
+
57
+ export const Centered = Template.bind({})
58
+ Centered.args = {
59
+ ...Base.args,
60
+ primaryPosition:'center',
61
+ }
62
+
63
+ export const TopRight = Template.bind({})
64
+ TopRight.args = {
65
+ ...Base.args,
66
+ primaryPosition :'top',
67
+ secondaryPosition:'right',
68
+ }
69
+
70
+ export const BottomLeft = Template.bind({})
71
+ BottomLeft.args = {
72
+ ...Base.args,
73
+ primaryPosition :'bottom',
74
+ secondaryPosition:'left',
75
+ }
@@ -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
+ booleanValue:{ control: 'boolean' },
17
18
  },
18
19
  }
19
20
 
@@ -14,7 +14,10 @@ export default {
14
14
  // storyfn => <div className="">{ storyfn() }</div>,
15
15
  ],
16
16
  argTypes:{
17
- backgroundColor:{ control: 'color' },
17
+ // backgroundColor:{ control: 'color' },
18
+ progress:{ control: 'number' },
19
+ color :{ control: 'text' },
20
+ height :{ control: 'text' },
18
21
  },
19
22
  }
20
23
 
@@ -15,7 +15,9 @@ export default {
15
15
  // storyfn => <div className="">{ storyfn() }</div>,
16
16
  ],
17
17
  argTypes:{
18
- backgroundColor:{ control: 'color' },
18
+ // backgroundColor:{ control: 'color' },
19
+ dateFormat :{ control: 'select' },
20
+ enabledFormats:{ control: 'select', options: ['distance', 'date', 'relative'] },
19
21
  },
20
22
  }
21
23
 
@@ -14,7 +14,8 @@ export default {
14
14
  // storyfn => <div className="">{ storyfn() }</div>,
15
15
  ],
16
16
  argTypes:{
17
- backgroundColor:{ control: 'color' },
17
+ // backgroundColor:{ control: 'color' },
18
+ square:{ control: 'boolean' },
18
19
  },
19
20
  }
20
21
 
@@ -13,6 +13,9 @@ export default {
13
13
  // storyfn => <div className="">{ storyfn() }</div>,
14
14
  ],
15
15
  argTypes:{
16
+ question :{ control: 'text' },
17
+ isFAQSchema :{ control: 'boolean' },
18
+ defaultIsOpen:{ control: 'boolean' },
16
19
  },
17
20
  }
18
21