@pingux/astro 1.0.0-alpha.1 → 1.0.0-alpha.13
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/CHANGELOG.md +132 -0
- package/lib/cjs/components/AccordionItem/AccordionItem.js +3 -1
- package/lib/cjs/components/Button/Button.stories.js +5 -11
- package/lib/cjs/components/CopyText/CopyText.js +3 -73
- package/lib/cjs/components/FileInputField/FileInputField.js +324 -0
- package/lib/cjs/components/FileInputField/FileInputField.stories.js +250 -0
- package/lib/cjs/components/FileInputField/FileInputField.test.js +227 -0
- package/lib/cjs/components/FileInputField/FileItem.js +125 -0
- package/lib/cjs/components/FileInputField/FileSelect.js +48 -0
- package/lib/cjs/components/FileInputField/index.js +18 -0
- package/lib/cjs/components/ListView/ListView.js +4 -3
- package/lib/cjs/components/ListViewItem/ListViewItem.js +3 -6
- package/lib/cjs/components/NumberField/NumberField.js +4 -2
- package/lib/cjs/components/NumberField/NumberField.test.js +15 -0
- package/lib/cjs/components/Tab/Tab.js +11 -4
- package/lib/cjs/components/Tabs/Tabs.js +7 -1
- package/lib/cjs/components/Tabs/Tabs.stories.js +60 -6
- package/lib/cjs/components/Tabs/Tabs.test.js +78 -15
- package/lib/cjs/hooks/useCopyToClipboard/index.js +18 -0
- package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +83 -0
- package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.test.js +79 -0
- package/lib/cjs/index.js +10 -0
- package/lib/cjs/recipes/CopyToClipboard.stories.js +45 -0
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +146 -0
- package/lib/cjs/styles/forms/input.js +11 -0
- package/lib/cjs/styles/variants/accordion.js +2 -2
- package/lib/cjs/styles/variants/boxes.js +27 -0
- package/lib/cjs/styles/variants/buttons.js +21 -1
- package/lib/cjs/styles/variants/tabs.js +1 -0
- package/lib/components/AccordionItem/AccordionItem.js +3 -1
- package/lib/components/Button/Button.stories.js +5 -10
- package/lib/components/CopyText/CopyText.js +2 -71
- package/lib/components/FileInputField/FileInputField.js +280 -0
- package/lib/components/FileInputField/FileInputField.stories.js +206 -0
- package/lib/components/FileInputField/FileInputField.test.js +187 -0
- package/lib/components/FileInputField/FileItem.js +100 -0
- package/lib/components/FileInputField/FileSelect.js +31 -0
- package/lib/components/FileInputField/index.js +1 -0
- package/lib/components/ListView/ListView.js +4 -3
- package/lib/components/ListViewItem/ListViewItem.js +3 -5
- package/lib/components/NumberField/NumberField.js +4 -2
- package/lib/components/NumberField/NumberField.test.js +9 -0
- package/lib/components/Tab/Tab.js +11 -4
- package/lib/components/Tabs/Tabs.js +7 -1
- package/lib/components/Tabs/Tabs.stories.js +56 -4
- package/lib/components/Tabs/Tabs.test.js +78 -15
- package/lib/hooks/useCopyToClipboard/index.js +1 -0
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.js +69 -0
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.test.js +64 -0
- package/lib/index.js +1 -0
- package/lib/recipes/CopyToClipboard.stories.js +25 -0
- package/lib/recipes/RadioButtonsWithLinks.stories.js +120 -0
- package/lib/styles/forms/input.js +11 -0
- package/lib/styles/variants/accordion.js +2 -2
- package/lib/styles/variants/boxes.js +27 -0
- package/lib/styles/variants/buttons.js +21 -1
- package/lib/styles/variants/tabs.js +1 -0
- package/package.json +3 -2
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Box, Button, Text } from '../index';
|
3
|
+
import useCopyToClipboard from '../hooks/useCopyToClipboard';
|
4
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
5
|
+
export default {
|
6
|
+
title: 'Recipes/CopyToClipboard'
|
7
|
+
};
|
8
|
+
export var Default = function Default() {
|
9
|
+
var textToCopy = 'eyJraWQiOiI4YTg5MmY3ZS1iNTk1LTRkYWQtODBlNC0yMzA4ODkyZTczZDQiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJodHRwczovL2FwaS5waW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-H1BRQTya_H9AKyWMxCw-vg';
|
10
|
+
var copyToClipboard = useCopyToClipboard(textToCopy);
|
11
|
+
return ___EmotionJSX(Box, {
|
12
|
+
bg: "accent.99",
|
13
|
+
py: "md",
|
14
|
+
px: "xl"
|
15
|
+
}, ___EmotionJSX(Text, {
|
16
|
+
sx: {
|
17
|
+
wordBreak: 'break-all'
|
18
|
+
}
|
19
|
+
}, textToCopy), ___EmotionJSX(Button, {
|
20
|
+
variant: "inline",
|
21
|
+
my: "lg",
|
22
|
+
onPress: copyToClipboard,
|
23
|
+
"aria-label": "Copy Text To Clipboard"
|
24
|
+
}, "Copy To Clipboard"));
|
25
|
+
};
|
@@ -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
|
+
};
|
@@ -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: '
|
17
|
+
mb: '20px',
|
18
18
|
alignItems: 'flex-start'
|
19
19
|
};
|
20
20
|
var accordionBody = {
|
21
21
|
display: 'none !important',
|
22
|
-
|
22
|
+
pt: 'md',
|
23
23
|
width: '100%',
|
24
24
|
'.is-open &': {
|
25
25
|
display: 'flex !important'
|
@@ -85,6 +85,10 @@ var listViewItem = _objectSpread(_objectSpread({}, base), {}, {
|
|
85
85
|
},
|
86
86
|
'&.is-focused': {
|
87
87
|
boxShadow: 'inset 0 0 5px #5873bdbf'
|
88
|
+
},
|
89
|
+
'&.has-separator': {
|
90
|
+
borderBottom: '1px solid',
|
91
|
+
borderBottomColor: 'line.hairline'
|
88
92
|
}
|
89
93
|
});
|
90
94
|
|
@@ -229,6 +233,28 @@ var datePicker = {
|
|
229
233
|
}
|
230
234
|
}
|
231
235
|
};
|
236
|
+
var fileInputFieldWrapper = {
|
237
|
+
display: 'flex',
|
238
|
+
border: '1px dashed',
|
239
|
+
borderColor: 'active',
|
240
|
+
padding: '10px 0',
|
241
|
+
'&.is-drag-active': {
|
242
|
+
backgroundColor: 'accent.95'
|
243
|
+
},
|
244
|
+
'&.is-error': {
|
245
|
+
borderColor: 'critical.dark'
|
246
|
+
},
|
247
|
+
'&.is-success': {
|
248
|
+
borderColor: 'success.dark'
|
249
|
+
},
|
250
|
+
'&.is-warning': {
|
251
|
+
borderColor: 'warning.dark'
|
252
|
+
},
|
253
|
+
'&.is-loading': {
|
254
|
+
justifyContent: 'center',
|
255
|
+
alignItems: 'center'
|
256
|
+
}
|
257
|
+
};
|
232
258
|
export default {
|
233
259
|
base: base,
|
234
260
|
card: card,
|
@@ -237,6 +263,7 @@ export default {
|
|
237
263
|
datePicker: datePicker,
|
238
264
|
expandableRow: expandableRow,
|
239
265
|
inputInContainerSlot: inputInContainerSlot,
|
266
|
+
fileInputFieldWrapper: fileInputFieldWrapper,
|
240
267
|
listItem: listItem,
|
241
268
|
listBoxSectionTitle: listBoxSectionTitle,
|
242
269
|
listViewItem: listViewItem,
|
@@ -309,7 +309,7 @@ var inline = _objectSpread(_objectSpread({}, base), {}, {
|
|
309
309
|
bg: 'white',
|
310
310
|
height: '22px',
|
311
311
|
lineHeight: 1,
|
312
|
-
fontSize: '
|
312
|
+
fontSize: 'sm',
|
313
313
|
borderRadius: '15px',
|
314
314
|
border: '1px solid',
|
315
315
|
borderColor: 'active',
|
@@ -452,6 +452,25 @@ var expandableRow = {
|
|
452
452
|
}
|
453
453
|
}
|
454
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
|
+
};
|
455
474
|
export default {
|
456
475
|
accordionHeader: accordionHeader,
|
457
476
|
chipDeleteButton: chipDeleteButton,
|
@@ -470,6 +489,7 @@ export default {
|
|
470
489
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
471
490
|
}),
|
472
491
|
expandableRow: expandableRow,
|
492
|
+
fileInputField: fileInputField,
|
473
493
|
iconButton: iconButton,
|
474
494
|
icon: icon,
|
475
495
|
imageUpload: imageUpload,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "1.0.0-alpha.
|
3
|
+
"version": "1.0.0-alpha.13",
|
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.
|
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",
|