@pingux/astro 1.2.0-alpha.0 → 1.2.0-alpha.12
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/lib/cjs/components/Breadcrumbs/BreadcrumbItem.js +3 -0
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +24 -14
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +9 -0
- package/lib/cjs/components/Button/Button.js +5 -2
- package/lib/cjs/components/Button/Button.stories.js +71 -17
- package/lib/cjs/components/Button/Button.test.js +26 -0
- package/lib/cjs/components/CopyText/CopyButton.js +9 -2
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +338 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +295 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +287 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/index.js +18 -0
- package/lib/cjs/components/HelpHint/HelpHint.js +24 -6
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +57 -0
- package/lib/cjs/components/HelpHint/HelpHint.test.js +80 -0
- package/lib/cjs/components/Messages/Messages.reducer.js +2 -1
- package/lib/cjs/components/Messages/Messages.stories.js +10 -10
- package/lib/cjs/components/Messages/Messages.test.js +15 -1
- package/lib/cjs/components/Messages/index.js +21 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +3 -1
- package/lib/cjs/components/NumberField/NumberField.js +3 -1
- package/lib/cjs/components/NumberField/NumberField.test.js +7 -0
- package/lib/cjs/components/OverlayPanel/OverlayPanel.js +2 -16
- package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +44 -0
- package/lib/cjs/components/SearchField/SearchField.stories.js +1 -15
- package/lib/cjs/components/TextAreaField/TextAreaField.js +1 -1
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +1 -54
- package/lib/cjs/components/TextField/TextField.stories.js +79 -2
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/cjs/index.js +10 -0
- package/lib/cjs/styles/variants/boxes.js +13 -0
- package/lib/cjs/styles/variants/buttons.js +101 -2
- package/lib/cjs/styles/variants/text.js +23 -0
- package/lib/components/Breadcrumbs/BreadcrumbItem.js +4 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +9 -0
- package/lib/components/Button/Button.js +6 -3
- package/lib/components/Button/Button.stories.js +53 -5
- package/lib/components/Button/Button.test.js +20 -0
- package/lib/components/CopyText/CopyButton.js +7 -2
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +296 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +256 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +246 -0
- package/lib/components/EnvironmentBreadcrumb/index.js +1 -0
- package/lib/components/HelpHint/HelpHint.js +25 -5
- package/lib/components/HelpHint/HelpHint.stories.js +34 -0
- package/lib/components/HelpHint/HelpHint.test.js +58 -0
- package/lib/components/Messages/Messages.reducer.js +1 -1
- package/lib/components/Messages/Messages.stories.js +1 -1
- package/lib/components/Messages/Messages.test.js +11 -1
- package/lib/components/Messages/index.js +2 -1
- package/lib/components/MultivaluesField/MultivaluesField.js +3 -1
- package/lib/components/NumberField/NumberField.js +2 -1
- package/lib/components/NumberField/NumberField.test.js +7 -0
- package/lib/components/OverlayPanel/OverlayPanel.js +3 -16
- package/lib/components/OverlayPanel/OverlayPanel.test.js +38 -0
- package/lib/components/SearchField/SearchField.stories.js +0 -11
- package/lib/components/TextAreaField/TextAreaField.js +1 -1
- package/lib/components/TextAreaField/TextAreaField.stories.js +0 -43
- package/lib/components/TextField/TextField.stories.js +72 -0
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/index.js +1 -0
- package/lib/styles/variants/boxes.js +13 -0
- package/lib/styles/variants/buttons.js +101 -2
- package/lib/styles/variants/text.js +23 -0
- package/package.json +2 -2
@@ -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';
|
@@ -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
|
-
|
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
|
};
|
@@ -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,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "1.2.0-alpha.
|
3
|
+
"version": "1.2.0-alpha.12",
|
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": "
|
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",
|