@pingux/astro 1.0.0-alpha.4 → 1.0.0-alpha.8
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 +50 -0
- 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/Tab/Tab.js +10 -3
- package/lib/cjs/components/Tabs/Tabs.js +4 -1
- package/lib/cjs/components/Tabs/Tabs.stories.js +57 -2
- package/lib/cjs/components/Tabs/Tabs.test.js +34 -0
- 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/boxes.js +23 -0
- package/lib/cjs/styles/variants/buttons.js +20 -0
- package/lib/cjs/styles/variants/tabs.js +1 -0
- 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/Tab/Tab.js +10 -3
- package/lib/components/Tabs/Tabs.js +4 -1
- package/lib/components/Tabs/Tabs.stories.js +53 -0
- package/lib/components/Tabs/Tabs.test.js +38 -0
- 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/boxes.js +23 -0
- package/lib/styles/variants/buttons.js +20 -0
- package/lib/styles/variants/tabs.js +1 -0
- 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
|
+
};
|
@@ -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
|
|
@@ -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,
|
@@ -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.8",
|
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",
|