@pingux/astro 1.1.1-alpha.4 → 1.2.0-alpha.10

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 (79) hide show
  1. package/lib/cjs/components/Breadcrumbs/BreadcrumbItem.js +3 -0
  2. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +24 -14
  3. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +9 -0
  4. package/lib/cjs/components/Button/Button.js +5 -2
  5. package/lib/cjs/components/Button/Button.stories.js +71 -17
  6. package/lib/cjs/components/Button/Button.test.js +26 -0
  7. package/lib/cjs/components/CopyText/CopyButton.js +9 -2
  8. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +338 -0
  9. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +295 -0
  10. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +287 -0
  11. package/lib/cjs/components/EnvironmentBreadcrumb/index.js +18 -0
  12. package/lib/cjs/components/HelpHint/HelpHint.js +24 -6
  13. package/lib/cjs/components/HelpHint/HelpHint.stories.js +57 -0
  14. package/lib/cjs/components/HelpHint/HelpHint.test.js +80 -0
  15. package/lib/cjs/components/Link/Link.js +15 -4
  16. package/lib/cjs/components/Link/Link.stories.js +10 -0
  17. package/lib/cjs/components/Messages/Messages.reducer.js +2 -1
  18. package/lib/cjs/components/Messages/Messages.stories.js +10 -10
  19. package/lib/cjs/components/Messages/Messages.test.js +15 -1
  20. package/lib/cjs/components/Messages/index.js +21 -2
  21. package/lib/cjs/components/MultivaluesField/MultivaluesField.js +3 -1
  22. package/lib/cjs/components/NumberField/NumberField.js +3 -1
  23. package/lib/cjs/components/NumberField/NumberField.test.js +7 -0
  24. package/lib/cjs/components/OverlayPanel/OverlayPanel.js +2 -16
  25. package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +44 -0
  26. package/lib/cjs/components/TextField/TextField.stories.js +79 -2
  27. package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
  28. package/lib/cjs/index.js +10 -0
  29. package/lib/cjs/styles/theme.js +1 -0
  30. package/lib/cjs/styles/variants/boxes.js +13 -0
  31. package/lib/cjs/styles/variants/buttons.js +101 -2
  32. package/lib/cjs/styles/variants/index.js +11 -1
  33. package/lib/cjs/styles/variants/links.js +67 -0
  34. package/lib/cjs/styles/variants/text.js +23 -0
  35. package/lib/cjs/styles/variants/variants.js +2 -2
  36. package/lib/cjs/utils/devUtils/constants/animals.js +11 -0
  37. package/lib/cjs/utils/devUtils/constants/firstNames.js +11 -0
  38. package/lib/cjs/utils/devUtils/createMockData.js +96 -0
  39. package/lib/components/Breadcrumbs/BreadcrumbItem.js +4 -1
  40. package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
  41. package/lib/components/Breadcrumbs/Breadcrumbs.test.js +9 -0
  42. package/lib/components/Button/Button.js +6 -3
  43. package/lib/components/Button/Button.stories.js +53 -5
  44. package/lib/components/Button/Button.test.js +20 -0
  45. package/lib/components/CopyText/CopyButton.js +7 -2
  46. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +296 -0
  47. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +256 -0
  48. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +246 -0
  49. package/lib/components/EnvironmentBreadcrumb/index.js +1 -0
  50. package/lib/components/HelpHint/HelpHint.js +25 -5
  51. package/lib/components/HelpHint/HelpHint.stories.js +34 -0
  52. package/lib/components/HelpHint/HelpHint.test.js +58 -0
  53. package/lib/components/Link/Link.js +16 -5
  54. package/lib/components/Link/Link.stories.js +8 -0
  55. package/lib/components/Messages/Messages.reducer.js +1 -1
  56. package/lib/components/Messages/Messages.stories.js +1 -1
  57. package/lib/components/Messages/Messages.test.js +11 -1
  58. package/lib/components/Messages/index.js +2 -1
  59. package/lib/components/MultivaluesField/MultivaluesField.js +3 -1
  60. package/lib/components/NumberField/NumberField.js +2 -1
  61. package/lib/components/NumberField/NumberField.test.js +7 -0
  62. package/lib/components/OverlayPanel/OverlayPanel.js +3 -16
  63. package/lib/components/OverlayPanel/OverlayPanel.test.js +38 -0
  64. package/lib/components/TextField/TextField.stories.js +72 -0
  65. package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
  66. package/lib/index.js +1 -0
  67. package/lib/styles/theme.js +2 -1
  68. package/lib/styles/variants/boxes.js +13 -0
  69. package/lib/styles/variants/buttons.js +101 -2
  70. package/lib/styles/variants/index.js +1 -0
  71. package/lib/styles/variants/links.js +46 -0
  72. package/lib/styles/variants/text.js +23 -0
  73. package/lib/styles/variants/variants.js +2 -2
  74. package/lib/utils/devUtils/constants/animals.js +1 -0
  75. package/lib/utils/devUtils/constants/firstNames.js +1 -0
  76. package/lib/utils/devUtils/createMockData.js +68 -0
  77. package/package.json +2 -2
  78. package/lib/cjs/styles/variants/link.js +0 -27
  79. package/lib/styles/variants/link.js +0 -17
@@ -8,6 +8,8 @@ import TextField from '.';
8
8
  import { modes as labelModes } from '../Label/constants';
9
9
  import statuses from '../../utils/devUtils/constants/statuses.js';
10
10
  import Box from '../Box';
11
+ import useCopyToClipboard from '../../hooks/useCopyToClipboard';
12
+ import CopyButton from '../CopyText/CopyButton';
11
13
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
14
  export default {
13
15
  title: 'Form/TextField',
@@ -186,4 +188,74 @@ export var MaxLength = function MaxLength() {
186
188
  label: "Example label",
187
189
  maxLength: 9
188
190
  });
191
+ };
192
+ export var WithSlots = function WithSlots() {
193
+ var _useState5 = useState("[{ 'type': 'work', 'streetAddress': 'San Antonio MI 47096' },{ 'type': 'home', 'streetAddress': 'Santa Rosa MN 98804' }]"),
194
+ _useState6 = _slicedToArray(_useState5, 2),
195
+ addressesValue = _useState6[0],
196
+ setAddressesValue = _useState6[1];
197
+
198
+ var _useState7 = useState("[{ 'status': 'inactive', 'subject': 'example@pingidentity.com' },{ 'status': 'active', 'subject': 'john@pingidentity.com' }]"),
199
+ _useState8 = _slicedToArray(_useState7, 2),
200
+ jsonValue = _useState8[0],
201
+ setJsonValue = _useState8[1];
202
+
203
+ var copyAddressesToClipboard = useCopyToClipboard(addressesValue);
204
+ var copyJsonToClipboard = useCopyToClipboard(jsonValue);
205
+ var buttonSx = {
206
+ position: 'absolute',
207
+ right: 0,
208
+ top: '5px'
209
+ };
210
+ var containerSx = {
211
+ sx: {
212
+ '& input': {
213
+ paddingRight: '40px'
214
+ }
215
+ }
216
+ };
217
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TextField, {
218
+ label: "Multiple Addresses",
219
+ labelMode: "float",
220
+ onChange: function onChange(e) {
221
+ return setAddressesValue(e.target.value);
222
+ },
223
+ value: addressesValue,
224
+ containerProps: containerSx,
225
+ slots: {
226
+ inContainer: ___EmotionJSX(CopyButton, {
227
+ onPress: copyAddressesToClipboard,
228
+ sx: buttonSx,
229
+ iconProps: {
230
+ sx: {
231
+ path: {
232
+ fill: 'active'
233
+ }
234
+ }
235
+ }
236
+ })
237
+ },
238
+ mb: 30
239
+ }), ___EmotionJSX(TextField, {
240
+ label: "Example JSON",
241
+ labelMode: "float",
242
+ onChange: function onChange(e) {
243
+ return setJsonValue(e.target.value);
244
+ },
245
+ value: jsonValue,
246
+ containerProps: containerSx,
247
+ slots: {
248
+ inContainer: ___EmotionJSX(CopyButton, {
249
+ onPress: copyJsonToClipboard,
250
+ sx: buttonSx,
251
+ iconProps: {
252
+ sx: {
253
+ path: {
254
+ fill: 'active'
255
+ }
256
+ }
257
+ }
258
+ })
259
+ }
260
+ }));
189
261
  };
@@ -7,8 +7,9 @@ import { useEffect } from 'react';
7
7
  */
8
8
 
9
9
  var useAriaLabelWarning = function useAriaLabelWarning(component, ariaLabel) {
10
+ var condition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
10
11
  useEffect(function () {
11
- if (process.env.NODE_ENV === 'development' && !ariaLabel) {
12
+ if (process.env.NODE_ENV === 'development' && condition && !ariaLabel) {
12
13
  // eslint-disable-next-line no-console
13
14
  console.warn("".concat(component, " requires an aria-label"), '\n', '\n', 'NOTE: This is a development-only warning and will not display in production.');
14
15
  }
package/lib/index.js CHANGED
@@ -31,6 +31,7 @@ export { default as CodeView } from './components/CodeView';
31
31
  export { default as ComboBoxField } from './components/ComboBoxField';
32
32
  export { default as CopyText } from './components/CopyText';
33
33
  export { default as ColorField } from './components/ColorField';
34
+ export { default as EnvironmentBreadcrumb } from './components/EnvironmentBreadcrumb';
34
35
  export { default as FieldHelperText } from './components/FieldHelperText';
35
36
  export * from './components/FieldHelperText';
36
37
  export { default as FileInputField } from './components/FileInputField';
@@ -17,7 +17,7 @@ import colors, { accent, line, shadow, focus } from './colors';
17
17
  import { fontSizes, fontWeights, textColors } from './text';
18
18
  import breakpoints from './breakpoints';
19
19
  import forms from './forms';
20
- import { variants, buttons, text, images } from './variants';
20
+ import { variants, buttons, text, images, links } from './variants';
21
21
  export default {
22
22
  name: 'Astro',
23
23
  space: spacing,
@@ -47,5 +47,6 @@ export default {
47
47
  images: images,
48
48
  buttons: buttons,
49
49
  textColors: textColors,
50
+ links: links,
50
51
  variants: variants
51
52
  };
@@ -252,6 +252,18 @@ var datePicker = {
252
252
  }
253
253
  }
254
254
  };
255
+
256
+ var environmentChip = _objectSpread(_objectSpread({}, chip), {}, {
257
+ alignSelf: 'center',
258
+ height: '17px',
259
+ minWidth: 'fit-content',
260
+ ml: 8,
261
+ '& span': {
262
+ fontSize: 'xs',
263
+ lineHeight: 1
264
+ }
265
+ });
266
+
255
267
  var fileInputFieldWrapper = {
256
268
  display: 'flex',
257
269
  border: '1px dashed',
@@ -280,6 +292,7 @@ export default {
280
292
  chip: chip,
281
293
  copy: copy,
282
294
  datePicker: datePicker,
295
+ environmentChip: environmentChip,
283
296
  expandableRow: expandableRow,
284
297
  inputInContainerSlot: inputInContainerSlot,
285
298
  fileInputFieldWrapper: fileInputFieldWrapper,
@@ -295,6 +295,11 @@ var helpHint = _objectSpread(_objectSpread({}, iconButton), {}, {
295
295
  ml: '5px',
296
296
  maxWidth: '13px',
297
297
  maxHeight: '14px',
298
+ borderRadius: '5.5px',
299
+ 'svg': {
300
+ 'height': '100%',
301
+ mb: 0.75
302
+ },
298
303
  'path': {
299
304
  fill: 'neutral.20'
300
305
  },
@@ -354,7 +359,7 @@ var chipDeleteButton = {
354
359
  borderRadius: '50%',
355
360
  cursor: 'pointer',
356
361
  height: 14,
357
- ml: 'xs',
362
+ mx: '3px !important',
358
363
  p: 0,
359
364
  width: 14,
360
365
  '&.is-focused, &.is-hovered': {
@@ -463,6 +468,28 @@ var expandableRow = {
463
468
  }
464
469
  }
465
470
  };
471
+ var environmentBreadcrumb = {
472
+ current: _objectSpread(_objectSpread({}, text), {}, {
473
+ color: 'neutral.30',
474
+ fontSize: 'md',
475
+ fontWeight: 1,
476
+ '&.is-hovered, &.is-focused': {
477
+ color: 'active',
478
+ textDecoration: 'none',
479
+ boxShadow: 'none'
480
+ },
481
+ '&.is-pressed': {
482
+ color: 'accent.20',
483
+ textDecoration: 'none'
484
+ }
485
+ }),
486
+ selectItem: _objectSpread(_objectSpread({}, text), {}, {
487
+ color: 'neutral.10',
488
+ fontSize: 'md',
489
+ fontWeight: 0,
490
+ justifyContent: 'start'
491
+ })
492
+ };
466
493
  var fileInputField = {
467
494
  background: 'none',
468
495
  cursor: 'pointer',
@@ -512,6 +539,75 @@ var tooltipInline = _objectSpread(_objectSpread({}, text), {}, {
512
539
  }
513
540
  });
514
541
 
542
+ var defaultVariant = _objectSpread(_objectSpread({}, base), {}, {
543
+ bg: 'white',
544
+ border: '1px solid',
545
+ borderColor: 'active',
546
+ '&.is-hovered': _objectSpread({}, defaultHover),
547
+ '&.is-pressed': _objectSpread({}, defaultActive),
548
+ '&.is-focused': _objectSpread({}, defaultFocus)
549
+ });
550
+
551
+ var filter = _objectSpread(_objectSpread({}, defaultVariant), {}, {
552
+ px: 'sm',
553
+ borderColor: 'neutral.80',
554
+ height: 40,
555
+ color: 'active',
556
+ display: 'flex'
557
+ });
558
+
559
+ var colorBlock = {
560
+ bg: 'neutral.95',
561
+ border: '1px solid',
562
+ borderColor: 'neutral.90',
563
+ borderRadius: 10,
564
+ outline: 'none',
565
+ cursor: 'pointer',
566
+ width: 150,
567
+ minHeight: 40,
568
+ p: '5px 15px',
569
+ display: 'flex',
570
+ justifyContent: 'space-between',
571
+ alignItems: 'center',
572
+ '&.is-hovered': {
573
+ bg: 'neutral.80'
574
+ },
575
+ '&.is-focused': _objectSpread({}, defaultFocus),
576
+ '&.is-pressed': {
577
+ bg: 'neutral.60',
578
+ borderColor: 'neutral.60'
579
+ },
580
+ '& span': {
581
+ color: 'text.primary',
582
+ textAlign: 'left'
583
+ },
584
+ '&>div': {
585
+ alignItems: 'baseline'
586
+ },
587
+ '&>svg': {
588
+ color: 'text.secondary',
589
+ fill: 'text.secondary'
590
+ },
591
+ '&.is-configured': {
592
+ bg: 'active',
593
+ borderColor: 'active',
594
+ '& span': {
595
+ color: 'white'
596
+ },
597
+ '&>svg': {
598
+ color: 'white',
599
+ fill: 'white'
600
+ }
601
+ },
602
+ '&.is-configured.is-hovered': {
603
+ bg: 'accent.40',
604
+ borderColor: 'accent.40'
605
+ },
606
+ '&.is-configured.is-pressed': {
607
+ bg: 'accent.20',
608
+ borderColor: 'accent.20'
609
+ }
610
+ };
515
611
  export default {
516
612
  accordionHeader: accordionHeader,
517
613
  chipDeleteButton: chipDeleteButton,
@@ -529,8 +625,10 @@ export default {
529
625
  '&.is-pressed': _objectSpread({}, defaultActive),
530
626
  '&.is-focused': _objectSpread({}, defaultFocus)
531
627
  }),
628
+ environmentBreadcrumb: environmentBreadcrumb,
532
629
  expandableRow: expandableRow,
533
630
  fileInputField: fileInputField,
631
+ filter: filter,
534
632
  iconButton: iconButton,
535
633
  imageUpload: imageUpload,
536
634
  inline: inline,
@@ -550,5 +648,6 @@ export default {
550
648
  invertedSquare: invertedSquare,
551
649
  tooltipChip: tooltipChip,
552
650
  tooltipIconButton: tooltipIconButton,
553
- tooltipInline: tooltipInline
651
+ tooltipInline: tooltipInline,
652
+ colorBlock: colorBlock
554
653
  };
@@ -1,4 +1,5 @@
1
1
  export { default as variants } from './variants';
2
2
  export { default as buttons } from './buttons';
3
3
  export { default as images } from './images';
4
+ export { default as links } from './links';
4
5
  export * from './text';
@@ -0,0 +1,46 @@
1
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
2
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
3
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
4
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
5
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
6
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
7
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
8
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
10
+
11
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
12
+
13
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
14
+
15
+ var app = {
16
+ color: 'active',
17
+ fontFamily: 'standard',
18
+ fontSize: 'md',
19
+ textDecoration: 'none',
20
+ outline: 'none',
21
+ '&.is-hovered': {
22
+ textDecoration: 'underline'
23
+ },
24
+ '&.is-focused': {
25
+ textDecoration: 'underline'
26
+ },
27
+ '&.is-pressed': {
28
+ color: 'accent.40',
29
+ textDecoration: 'underline'
30
+ },
31
+ '&.is-disabled': {
32
+ pointerEvents: 'none'
33
+ }
34
+ };
35
+
36
+ var web = _objectSpread(_objectSpread({}, app), {}, {
37
+ textDecoration: 'underline',
38
+ '&:visited': {
39
+ color: 'decorative.7'
40
+ }
41
+ });
42
+
43
+ export default {
44
+ app: app,
45
+ web: web
46
+ };
@@ -119,6 +119,14 @@ var expandableRow = {
119
119
  }
120
120
  }
121
121
  };
122
+
123
+ var environmentBreadcrumb = _objectSpread(_objectSpread({}, base), {}, {
124
+ fontSize: 'sm',
125
+ fontWeight: 3,
126
+ color: 'secondary',
127
+ textTransform: 'capitalize'
128
+ });
129
+
122
130
  var navBarSubtitle = {
123
131
  fontWeight: 3,
124
132
  fontSize: '11px',
@@ -150,11 +158,26 @@ export var text = {
150
158
  color: 'accent.30',
151
159
  fontFamily: 'standard'
152
160
  }),
161
+ buttonTitle: _objectSpread(_objectSpread({}, wordWrap), {}, {
162
+ fontSize: 'xs',
163
+ fontWeight: 0,
164
+ color: 'text.primary',
165
+ fontFamily: 'standard',
166
+ lineHeight: '13px'
167
+ }),
168
+ buttonSubtitle: _objectSpread(_objectSpread({}, wordWrap), {}, {
169
+ fontSize: 'sm',
170
+ fontWeight: 3,
171
+ color: 'text.primary',
172
+ fontFamily: 'standard',
173
+ lineHeight: '16px'
174
+ }),
153
175
  capsLabel: _objectSpread(_objectSpread({}, wordWrap), {}, {
154
176
  color: 'text.secondary',
155
177
  textTransform: 'uppercase',
156
178
  fontFamily: 'standard'
157
179
  }),
180
+ environmentBreadcrumb: environmentBreadcrumb,
158
181
  fieldHelperText: fieldHelperText,
159
182
  inputValue: {
160
183
  fontWeight: 1,
@@ -17,7 +17,7 @@ import boxes from './boxes';
17
17
  import codeView from './codeView';
18
18
  import images from './images';
19
19
  import imageUpload from './imageUpload';
20
- import link from './link';
20
+ import links from './links';
21
21
  import listBox from './listBox';
22
22
  import loader from './loader';
23
23
  import modal from './modal';
@@ -40,7 +40,7 @@ export default _objectSpread(_objectSpread({
40
40
  images: images,
41
41
  imageUpload: imageUpload,
42
42
  loader: loader,
43
- link: link,
43
+ links: links,
44
44
  listBox: listBox,
45
45
  menu: menu,
46
46
  menuItem: menuItem,
@@ -0,0 +1 @@
1
+ export default ['Aardvark', 'Albatross', 'Alligator', 'Alpaca', 'Ant', 'Anteater', 'Antelope', 'Ape', 'Armadillo', 'Donkey', 'Baboon', 'Badger', 'Barracuda', 'Bat', 'Bear', 'Beaver', 'Bee', 'Bison', 'Boar', 'Buffalo', 'Butterfly', 'Camel', 'Capybara', 'Caribou', 'Cassowary', 'Cat', 'Caterpillar', 'Cattle', 'Chamois', 'Cheetah', 'Chicken', 'Chimpanzee', 'Chinchilla', 'Chough', 'Clam', 'Cobra', 'Cockroach', 'Cod', 'Cormorant', 'Coyote', 'Crab', 'Crane', 'Crocodile', 'Crow', 'Curlew', 'Deer', 'Dinosaur', 'Dog', 'Dogfish', 'Dolphin', 'Dotterel', 'Dove', 'Dragonfly', 'Duck', 'Dugong', 'Dunlin', 'Eagle', 'Echidna', 'Eel', 'Eland', 'Elephant', 'Elk', 'Emu', 'Falcon', 'Ferret', 'Finch', 'Fish', 'Flamingo', 'Fly', 'Fox', 'Frog', 'Gaur', 'Gazelle', 'Gerbil', 'Giraffe', 'Gnat', 'Gnu', 'Goat', 'Goldfinch', 'Goldfish', 'Goose', 'Gorilla', 'Goshawk', 'Grasshopper', 'Grouse', 'Guanaco', 'Gull', 'Hamster', 'Hare', 'Hawk', 'Hedgehog', 'Heron', 'Herring', 'Hippopotamus', 'Hornet', 'Horse', 'Human', 'Hummingbird', 'Hyena', 'Ibex', 'Ibis', 'Jackal', 'Jaguar', 'Jay', 'Jellyfish', 'Kangaroo', 'Kingfisher', 'Koala', 'Kookabura', 'Kouprey', 'Kudu', 'Lapwing', 'Lark', 'Lemur', 'Leopard', 'Lion', 'Llama', 'Lobster', 'Locust', 'Loris', 'Louse', 'Lyrebird', 'Magpie', 'Mallard', 'Manatee', 'Mandrill', 'Mantis', 'Marten', 'Meerkat', 'Mink', 'Mole', 'Mongoose', 'Monkey', 'Moose', 'Mosquito', 'Mouse', 'Mule', 'Narwhal', 'Newt', 'Nightingale', 'Octopus', 'Okapi', 'Opossum', 'Oryx', 'Ostrich', 'Otter', 'Owl', 'Oyster', 'Panther', 'Parrot', 'Partridge', 'Peafowl', 'Pelican', 'Penguin', 'Pheasant', 'Pig', 'Pigeon', 'Pony', 'Porcupine', 'Porpoise', 'Quail', 'Quelea', 'Quetzal', 'Rabbit', 'Raccoon', 'Rail', 'Ram', 'Rat', 'Raven', 'Red deer', 'Red panda', 'Reindeer', 'Rhinoceros', 'Rook', 'Salamander', 'Salmon', 'Sand Dollar', 'Sandpiper', 'Sardine', 'Scorpion', 'Seahorse', 'Seal', 'Shark', 'Sheep', 'Shrew', 'Skunk', 'Snail', 'Snake', 'Sparrow', 'Spider', 'Spoonbill', 'Squid', 'Squirrel', 'Starling', 'Stingray', 'Stinkbug', 'Stork', 'Swallow', 'Swan', 'Tapir', 'Tarsier', 'Termite', 'Tiger', 'Toad', 'Trout', 'Turkey', 'Turtle', 'Viper', 'Vulture', 'Wallaby', 'Walrus', 'Wasp', 'Weasel', 'Whale', 'Wildcat', 'Wolf', 'Wolverine', 'Wombat', 'Woodcock', 'Woodpecker', 'Worm', 'Wren', 'Yak', 'Zebra'];
@@ -0,0 +1 @@
1
+ export default ['Michael', 'Christopher', 'Jessica', 'Matthew', 'Ashley', 'Jennifer', 'Joshua', 'Amanda', 'Daniel', 'David', 'James', 'Robert', 'John', 'Joseph', 'Andrew', 'Ryan', 'Brandon', 'Jason', 'Justin', 'Sarah', 'William', 'Jonathan', 'Stephanie', 'Brian', 'Nicole', 'Nicholas', 'Anthony', 'Heather', 'Eric', 'Elizabeth', 'Adam', 'Megan', 'Melissa', 'Kevin', 'Steven', 'Thomas', 'Timothy', 'Christina', 'Kyle', 'Rachel', 'Laura', 'Lauren', 'Amber', 'Brittany', 'Danielle', 'Richard', 'Kimberly', 'Jeffrey', 'Amy', 'Crystal', 'Michelle', 'Tiffany', 'Jeremy', 'Benjamin', 'Mark', 'Emily', 'Aaron', 'Charles', 'Rebecca', 'Jacob', 'Stephen', 'Patrick', 'Sean', 'Erin', 'Zachary', 'Jamie', 'Kelly', 'Samantha', 'Nathan', 'Sara', 'Dustin', 'Paul', 'Angela', 'Tyler', 'Scott', 'Katherine', 'Andrea', 'Gregory', 'Erica', 'Mary', 'Travis', 'Lisa', 'Kenneth', 'Bryan', 'Lindsey', 'Kristen', 'Jose', 'Alexander', 'Jesse', 'Katie', 'Lindsay', 'Shannon', 'Vanessa', 'Courtney', 'Christine', 'Alicia', 'Cody', 'Allison', 'Bradley', 'Samuel'];
@@ -0,0 +1,68 @@
1
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
2
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
3
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
4
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
5
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
6
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
7
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
8
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
9
+ import _fillInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/fill";
10
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
11
+ import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
12
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
13
+ import _Object$entries from "@babel/runtime-corejs3/core-js-stable/object/entries";
14
+
15
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
16
+
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty(_context3 = ownKeys(Object(source), true)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context4; _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
18
+
19
+ import { v4 as uuid } from 'uuid';
20
+ import animals from './constants/animals';
21
+ import firstNames from './constants/firstNames';
22
+
23
+ function createMockData(length, objectScheme) {
24
+ var mockDataBase = {
25
+ animal: animals,
26
+ firstName: firstNames
27
+ };
28
+ var itemsNumber = {
29
+ animal: 0,
30
+ firstName: 0
31
+ };
32
+
33
+ var getPropValue = function getPropValue(valueType) {
34
+ if (valueType === 'id') {
35
+ return uuid();
36
+ }
37
+
38
+ var valueNumber = itemsNumber[valueType];
39
+ var propValue = mockDataBase[valueType][valueNumber];
40
+ itemsNumber[valueType] += 1;
41
+ return propValue;
42
+ };
43
+
44
+ var generateObject = function generateObject() {
45
+ var entries = _Object$entries(objectScheme);
46
+
47
+ var reducer = function reducer(previousValue, currentValue) {
48
+ var fieldName = currentValue[0];
49
+ var fieldValue = getPropValue(currentValue[1]);
50
+ return _objectSpread(_objectSpread({}, previousValue), {}, _defineProperty({}, fieldName, fieldValue));
51
+ };
52
+
53
+ return _reduceInstanceProperty(entries).call(entries, reducer, {});
54
+ };
55
+
56
+ var generateDataArr = function generateDataArr() {
57
+ var _context, _context2;
58
+
59
+ return _mapInstanceProperty(_context = _fillInstanceProperty(_context2 = Array(length)).call(_context2, undefined)).call(_context, function () {
60
+ return generateObject();
61
+ });
62
+ };
63
+
64
+ return generateDataArr();
65
+ }
66
+
67
+ export default createMockData; // usage(delete this comment as soon as we used this function in a few stories so we have examples):
68
+ // const mockData = createMockData(100, { name: 'animal', id: 'id' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.1.1-alpha.4",
3
+ "version": "1.2.0-alpha.10",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "uxdev@pingidentity.com",
6
6
  "license": "Apache-2.0",
@@ -132,7 +132,7 @@
132
132
  "lodash": "^4.17.21",
133
133
  "mdi-react": "^7.4.0",
134
134
  "moment": "^2.29.1",
135
- "prism-react-renderer": "^1.2.1",
135
+ "prism-react-renderer": "1.2.1",
136
136
  "prop-types": "^15.7.2",
137
137
  "react-calendar": "^3.4.0",
138
138
  "react-color": "^2.19.3",
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
-
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
-
9
- exports["default"] = void 0;
10
- var link = {
11
- color: 'white',
12
- fontFamily: 'standard',
13
- fontSize: 'md',
14
- textDecoration: 'none',
15
- outline: 'none',
16
- '&.is-hovered': {
17
- textDecoration: 'underline'
18
- },
19
- '&.is-focused': {
20
- textDecoration: 'underline'
21
- },
22
- '&.is-disabled': {
23
- pointerEvents: 'none'
24
- }
25
- };
26
- var _default = link;
27
- exports["default"] = _default;
@@ -1,17 +0,0 @@
1
- var link = {
2
- color: 'white',
3
- fontFamily: 'standard',
4
- fontSize: 'md',
5
- textDecoration: 'none',
6
- outline: 'none',
7
- '&.is-hovered': {
8
- textDecoration: 'underline'
9
- },
10
- '&.is-focused': {
11
- textDecoration: 'underline'
12
- },
13
- '&.is-disabled': {
14
- pointerEvents: 'none'
15
- }
16
- };
17
- export default link;