@pingux/astro 0.41.0 → 1.0.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 (64) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.js +1 -1
  3. package/lib/cjs/components/AccordionItem/AccordionItem.js +3 -1
  4. package/lib/cjs/components/CopyText/CopyText.js +3 -73
  5. package/lib/cjs/components/FileInputField/FileInputField.js +324 -0
  6. package/lib/cjs/components/FileInputField/FileInputField.stories.js +250 -0
  7. package/lib/cjs/components/FileInputField/FileInputField.test.js +227 -0
  8. package/lib/cjs/components/FileInputField/FileItem.js +125 -0
  9. package/lib/cjs/components/FileInputField/FileSelect.js +48 -0
  10. package/lib/cjs/components/FileInputField/index.js +18 -0
  11. package/lib/cjs/components/ListView/ListView.js +2 -1
  12. package/lib/cjs/components/ListViewItem/ListViewItem.js +14 -6
  13. package/lib/cjs/components/NumberField/NumberField.js +4 -2
  14. package/lib/cjs/components/NumberField/NumberField.test.js +15 -0
  15. package/lib/cjs/components/Tab/Tab.js +11 -4
  16. package/lib/cjs/components/Tabs/Tabs.js +7 -1
  17. package/lib/cjs/components/Tabs/Tabs.stories.js +60 -6
  18. package/lib/cjs/components/Tabs/Tabs.test.js +78 -15
  19. package/lib/cjs/hooks/useCopyToClipboard/index.js +18 -0
  20. package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +83 -0
  21. package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.test.js +79 -0
  22. package/lib/cjs/index.js +10 -0
  23. package/lib/cjs/recipes/ApplicationSearchDropdown.stories.js +310 -0
  24. package/lib/cjs/recipes/CopyToClipboard.stories.js +45 -0
  25. package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +146 -0
  26. package/lib/cjs/recipes/RowLineChart.stories.js +6 -1
  27. package/lib/cjs/recipes/ScrollableListView.stories.js +1 -1
  28. package/lib/cjs/styles/forms/input.js +11 -0
  29. package/lib/cjs/styles/variants/accordion.js +2 -2
  30. package/lib/cjs/styles/variants/boxes.js +23 -0
  31. package/lib/cjs/styles/variants/buttons.js +56 -1
  32. package/lib/cjs/styles/variants/tabs.js +1 -0
  33. package/lib/components/AccordionGridGroup/AccordionGridGroup.js +1 -1
  34. package/lib/components/AccordionItem/AccordionItem.js +3 -1
  35. package/lib/components/CopyText/CopyText.js +2 -71
  36. package/lib/components/FileInputField/FileInputField.js +280 -0
  37. package/lib/components/FileInputField/FileInputField.stories.js +206 -0
  38. package/lib/components/FileInputField/FileInputField.test.js +187 -0
  39. package/lib/components/FileInputField/FileItem.js +100 -0
  40. package/lib/components/FileInputField/FileSelect.js +31 -0
  41. package/lib/components/FileInputField/index.js +1 -0
  42. package/lib/components/ListView/ListView.js +2 -1
  43. package/lib/components/ListViewItem/ListViewItem.js +14 -6
  44. package/lib/components/NumberField/NumberField.js +4 -2
  45. package/lib/components/NumberField/NumberField.test.js +9 -0
  46. package/lib/components/Tab/Tab.js +11 -4
  47. package/lib/components/Tabs/Tabs.js +7 -1
  48. package/lib/components/Tabs/Tabs.stories.js +56 -4
  49. package/lib/components/Tabs/Tabs.test.js +78 -15
  50. package/lib/hooks/useCopyToClipboard/index.js +1 -0
  51. package/lib/hooks/useCopyToClipboard/useCopyToClipboard.js +69 -0
  52. package/lib/hooks/useCopyToClipboard/useCopyToClipboard.test.js +64 -0
  53. package/lib/index.js +1 -0
  54. package/lib/recipes/ApplicationSearchDropdown.stories.js +272 -0
  55. package/lib/recipes/CopyToClipboard.stories.js +25 -0
  56. package/lib/recipes/RadioButtonsWithLinks.stories.js +120 -0
  57. package/lib/recipes/RowLineChart.stories.js +6 -1
  58. package/lib/recipes/ScrollableListView.stories.js +1 -1
  59. package/lib/styles/forms/input.js +11 -0
  60. package/lib/styles/variants/accordion.js +2 -2
  61. package/lib/styles/variants/boxes.js +23 -0
  62. package/lib/styles/variants/buttons.js +56 -1
  63. package/lib/styles/variants/tabs.js +1 -0
  64. package/package.json +3 -2
@@ -0,0 +1,120 @@
1
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
2
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
+ import React, { useState } from 'react';
4
+ import CloseIcon from 'mdi-react/CloseIcon';
5
+ import { Box, Button, Icon, IconButton, Text } from '../index';
6
+ import RadioField from '../components/RadioField';
7
+ import RadioGroupField from '../components/RadioGroupField';
8
+ import { jsx as ___EmotionJSX } from "@emotion/react";
9
+ export default {
10
+ title: 'Recipes/RadioButtonsWithLinks'
11
+ };
12
+ export var Default = function Default() {
13
+ var roles = [{
14
+ name: 'Client Application Developer'
15
+ }, {
16
+ name: 'Environment Admin',
17
+ isDisabled: true
18
+ }, {
19
+ name: 'Identity Data Admin',
20
+ isDisabled: true
21
+ }, {
22
+ name: 'Organization Admin'
23
+ }];
24
+ var titleSx = {
25
+ fontSize: 'md',
26
+ color: 'neutral.20',
27
+ fontWeight: 2
28
+ };
29
+ var subtitleSx = {
30
+ fontSize: 'md',
31
+ color: 'neutral.10'
32
+ };
33
+
34
+ var RadioFieldWithButton = function RadioFieldWithButton(_ref) {
35
+ var fieldName = _ref.fieldName,
36
+ isDisabled = _ref.isDisabled;
37
+
38
+ var _useState = useState(false),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ isOpen = _useState2[0],
41
+ setIsOpen = _useState2[1];
42
+
43
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Box, {
44
+ isRow: true,
45
+ alignItems: "center"
46
+ }, ___EmotionJSX(RadioField, {
47
+ value: fieldName,
48
+ label: fieldName,
49
+ isDisabled: isDisabled
50
+ }), ___EmotionJSX(Button, {
51
+ variant: "text",
52
+ mb: "xs",
53
+ ml: "md",
54
+ onPress: function onPress() {
55
+ return setIsOpen(function (prev) {
56
+ return !prev;
57
+ });
58
+ },
59
+ isDisabled: isDisabled
60
+ }, "".concat(isOpen ? 'Hide' : 'Show', " Permissions"))), isOpen && ___EmotionJSX(PermissionsList, {
61
+ onPress: function onPress() {
62
+ return setIsOpen(false);
63
+ }
64
+ }));
65
+ };
66
+
67
+ var PermissionsList = function PermissionsList(_ref2) {
68
+ var onPress = _ref2.onPress;
69
+ return ___EmotionJSX(Box, {
70
+ p: "md",
71
+ bg: "neutral.95"
72
+ }, ___EmotionJSX(Box, {
73
+ isRow: true,
74
+ justifyContent: "space-between",
75
+ mb: "sm"
76
+ }, ___EmotionJSX(Text, {
77
+ sx: {
78
+ fontWeight: 2
79
+ }
80
+ }, "Permissions"), ___EmotionJSX(IconButton, {
81
+ onPress: onPress
82
+ }, ___EmotionJSX(Icon, {
83
+ icon: CloseIcon
84
+ }))), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
85
+ sx: titleSx,
86
+ mb: "xs"
87
+ }, "Resource"), ___EmotionJSX(Text, {
88
+ sx: subtitleSx,
89
+ mb: "sm"
90
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Text, {
91
+ sx: titleSx,
92
+ mb: "xs"
93
+ }, "Push Credentials"), ___EmotionJSX(Text, {
94
+ sx: subtitleSx,
95
+ mb: "sm"
96
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"), ___EmotionJSX(Text, {
97
+ sx: titleSx,
98
+ mb: "xs"
99
+ }, "Organization"), ___EmotionJSX(Text, {
100
+ sx: subtitleSx,
101
+ mb: "sm"
102
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"), ___EmotionJSX(Text, {
103
+ sx: titleSx,
104
+ mb: "xs"
105
+ }, "Image"), ___EmotionJSX(Text, {
106
+ sx: subtitleSx,
107
+ mb: "sm"
108
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod")));
109
+ };
110
+
111
+ return ___EmotionJSX(RadioGroupField, null, _mapInstanceProperty(roles).call(roles, function (_ref3) {
112
+ var name = _ref3.name,
113
+ isDisabled = _ref3.isDisabled;
114
+ return ___EmotionJSX(RadioFieldWithButton, {
115
+ fieldName: name,
116
+ isDisabled: isDisabled,
117
+ key: name
118
+ });
119
+ }));
120
+ };
@@ -8,7 +8,12 @@ import { neutral } from '../styles/colors';
8
8
  import { Box, Button, SwitchField, Text, Tooltip, TooltipTrigger } from '../index';
9
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
10
  export default {
11
- title: 'Recipes/RowLineChart'
11
+ title: 'Recipes/RowLineChart',
12
+ parameters: {
13
+ chromatic: {
14
+ diffThreshold: 0.9
15
+ }
16
+ }
12
17
  };
13
18
  var chartData = [{
14
19
  id: 1,
@@ -10,7 +10,7 @@ import FormSelectIcon from 'mdi-react/FormSelectIcon';
10
10
  import { SearchField, ListView, Box, IconButton, ScrollBox, Text, Icon } from '../index';
11
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
12
  export default {
13
- title: 'Recipes/ScollableListView'
13
+ title: 'Recipes/ScrollableListView'
14
14
  };
15
15
  var unfilteredItems = [{
16
16
  key: 'Aardvark',
@@ -49,6 +49,17 @@ export var input = _objectSpread(_objectSpread({}, text.inputValue), {}, {
49
49
  '&::placeholder': text.placeholder,
50
50
  '&::-ms-expand': {
51
51
  display: 'none'
52
+ },
53
+ '&::-webkit-contacts-auto-fill-button, &::-webkit-credentials-auto-fill-button': {
54
+ visibility: 'hidden',
55
+ display: 'none !important',
56
+ pointerEvents: 'none',
57
+ height: 0,
58
+ width: 0,
59
+ margin: 0
60
+ },
61
+ '&::-ms-reveal, &::-ms-clear': {
62
+ display: 'none'
52
63
  }
53
64
  }); // Example variant input
54
65
 
@@ -14,12 +14,12 @@ var accordionTitle = {
14
14
  var accordion = {
15
15
  display: 'flex',
16
16
  mt: '5px',
17
- mb: '5px',
17
+ mb: '20px',
18
18
  alignItems: 'flex-start'
19
19
  };
20
20
  var accordionBody = {
21
21
  display: 'none !important',
22
- p: 'md',
22
+ pt: 'md',
23
23
  width: '100%',
24
24
  '.is-open &': {
25
25
  display: 'flex !important'
@@ -229,6 +229,28 @@ var datePicker = {
229
229
  }
230
230
  }
231
231
  };
232
+ var fileInputFieldWrapper = {
233
+ display: 'flex',
234
+ border: '1px dashed',
235
+ borderColor: 'active',
236
+ padding: '10px 0',
237
+ '&.is-drag-active': {
238
+ backgroundColor: 'accent.95'
239
+ },
240
+ '&.is-error': {
241
+ borderColor: 'critical.dark'
242
+ },
243
+ '&.is-success': {
244
+ borderColor: 'success.dark'
245
+ },
246
+ '&.is-warning': {
247
+ borderColor: 'warning.dark'
248
+ },
249
+ '&.is-loading': {
250
+ justifyContent: 'center',
251
+ alignItems: 'center'
252
+ }
253
+ };
232
254
  export default {
233
255
  base: base,
234
256
  card: card,
@@ -237,6 +259,7 @@ export default {
237
259
  datePicker: datePicker,
238
260
  expandableRow: expandableRow,
239
261
  inputInContainerSlot: inputInContainerSlot,
262
+ fileInputFieldWrapper: fileInputFieldWrapper,
240
263
  listItem: listItem,
241
264
  listBoxSectionTitle: listBoxSectionTitle,
242
265
  listViewItem: listViewItem,
@@ -243,6 +243,39 @@ var inverted = _objectSpread(_objectSpread({}, iconButton), {}, {
243
243
  }
244
244
  });
245
245
 
246
+ var applicationPortal = _objectSpread(_objectSpread({}, iconButton), {}, {
247
+ background: 'transparent',
248
+ '&.is-focused': _objectSpread({}, defaultFocus),
249
+ '&.is-hovered': {
250
+ 'path': {
251
+ fill: 'active'
252
+ }
253
+ },
254
+ '&.is-pressed': {
255
+ 'path': {
256
+ fill: 'active'
257
+ }
258
+ }
259
+ });
260
+
261
+ var applicationPortalPinned = _objectSpread(_objectSpread({}, iconButton), {}, {
262
+ 'path': {
263
+ fill: 'success.bright'
264
+ },
265
+ background: 'transparent',
266
+ '&.is-focused': _objectSpread({}, defaultFocus),
267
+ '&.is-hovered': {
268
+ 'path': {
269
+ fill: 'active'
270
+ }
271
+ },
272
+ '&.is-pressed': {
273
+ 'path': {
274
+ fill: 'active'
275
+ }
276
+ }
277
+ });
278
+
246
279
  var helpHint = _objectSpread(_objectSpread({}, iconButton), {}, {
247
280
  bg: 'neutral.90',
248
281
  borderColor: 'active',
@@ -419,6 +452,25 @@ var expandableRow = {
419
452
  }
420
453
  }
421
454
  };
455
+ var fileInputField = {
456
+ background: 'none',
457
+ cursor: 'pointer',
458
+ '& span': {
459
+ textAlign: 'initial'
460
+ },
461
+ '&:focus-visible': {
462
+ outline: 'none'
463
+ },
464
+ '&.is-hovered, &.is-pressed': {
465
+ cursor: 'pointer',
466
+ '& span': {
467
+ textDecoration: 'underline'
468
+ }
469
+ },
470
+ '&.is-focused': {
471
+ boxShadow: 'focus'
472
+ }
473
+ };
422
474
  export default {
423
475
  accordionHeader: accordionHeader,
424
476
  chipDeleteButton: chipDeleteButton,
@@ -437,6 +489,7 @@ export default {
437
489
  '&.is-focused': _objectSpread({}, defaultFocus)
438
490
  }),
439
491
  expandableRow: expandableRow,
492
+ fileInputField: fileInputField,
440
493
  iconButton: iconButton,
441
494
  icon: icon,
442
495
  imageUpload: imageUpload,
@@ -449,5 +502,7 @@ export default {
449
502
  success: success,
450
503
  text: text,
451
504
  helpHint: helpHint,
452
- modalCloseButton: modalCloseButton
505
+ modalCloseButton: modalCloseButton,
506
+ applicationPortalPinned: applicationPortalPinned,
507
+ applicationPortal: applicationPortal
453
508
  };
@@ -5,6 +5,7 @@ export var tab = {
5
5
  display: 'inline-flex',
6
6
  outline: 'none',
7
7
  transform: 'translateY(1px)',
8
+ width: '100%',
8
9
  '&.is-focused': {
9
10
  boxShadow: 'focus'
10
11
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "0.41.0",
3
+ "version": "1.0.0-alpha.10",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "uxdev@pingidentity.com",
6
6
  "license": "Apache-2.0",
@@ -129,12 +129,13 @@
129
129
  "chroma-js": "^2.1.0",
130
130
  "classnames": "^2.2.6",
131
131
  "emotion-normalize": "^11.0.1",
132
- "lodash": "^4.17.20",
132
+ "lodash": "^4.17.21",
133
133
  "mdi-react": "^7.4.0",
134
134
  "moment": "^2.29.1",
135
135
  "prop-types": "^15.7.2",
136
136
  "react-calendar": "^3.4.0",
137
137
  "react-color": "^2.19.3",
138
+ "react-dropzone": "^11.4.2",
138
139
  "rebass": "^4.0.7",
139
140
  "recharts": "^2.1.4",
140
141
  "regenerator-runtime": "^0.13.7",