@pingux/astro 1.1.0-alpha.0 → 1.1.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/CHANGELOG.md +132 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +24 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +33 -1
- package/lib/cjs/components/AccordionItem/AccordionItem.js +5 -4
- package/lib/cjs/components/Button/Button.js +1 -2
- package/lib/cjs/components/Button/Button.stories.js +2 -1
- package/lib/cjs/components/Button/Button.test.js +2 -1
- package/lib/cjs/components/CodeView/CodeView.js +165 -0
- package/lib/cjs/components/CodeView/CodeView.stories.js +93 -0
- package/lib/cjs/components/CodeView/CodeView.test.js +211 -0
- package/lib/cjs/components/CodeView/index.js +18 -0
- package/lib/cjs/components/ColorField/ColorField.js +1 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +7 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +25 -1
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +44 -0
- package/lib/cjs/components/CopyText/CopyText.js +34 -11
- package/lib/cjs/components/FileInputField/FileItem.js +2 -1
- package/lib/cjs/components/IconButton/IconButton.js +1 -1
- package/lib/cjs/components/IconButton/IconButton.stories.js +8 -17
- package/lib/cjs/components/IconButton/IconButton.test.js +4 -5
- package/lib/cjs/components/ImageUploadField/ImagePreviewButton.js +2 -1
- package/lib/cjs/components/List/List.js +3 -0
- package/lib/cjs/components/List/List.stories.js +7 -2
- package/lib/cjs/components/ListBox/ListBox.js +3 -6
- package/lib/cjs/components/ListBox/ListBox.test.js +2 -0
- package/lib/cjs/components/ListBox/Option.js +6 -0
- package/lib/cjs/components/ListView/ListView.stories.js +580 -39
- package/lib/cjs/components/Messages/Message.js +2 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +2 -1
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +15 -14
- package/lib/cjs/components/PopoverContainer/PopoverContainer.test.js +15 -0
- package/lib/cjs/components/TextArea/TextArea.js +5 -1
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +10 -5
- package/lib/cjs/index.js +10 -0
- package/lib/cjs/styles/variants/accordion.js +2 -2
- package/lib/cjs/styles/variants/buttons.js +11 -1
- package/lib/cjs/styles/variants/codeView.js +80 -0
- package/lib/cjs/styles/variants/variants.js +3 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +23 -1
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
- package/lib/components/AccordionGroup/AccordionGroup.test.js +30 -1
- package/lib/components/AccordionItem/AccordionItem.js +6 -5
- package/lib/components/Button/Button.js +2 -3
- package/lib/components/Button/Button.stories.js +2 -1
- package/lib/components/Button/Button.test.js +2 -1
- package/lib/components/CodeView/CodeView.js +130 -0
- package/lib/components/CodeView/CodeView.stories.js +67 -0
- package/lib/components/CodeView/CodeView.test.js +171 -0
- package/lib/components/CodeView/index.js +1 -0
- package/lib/components/ColorField/ColorField.js +1 -0
- package/lib/components/ComboBoxField/ComboBoxField.js +7 -0
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +21 -0
- package/lib/components/ComboBoxField/ComboBoxField.test.js +35 -0
- package/lib/components/CopyText/CopyText.js +35 -11
- package/lib/components/FileInputField/FileItem.js +2 -1
- package/lib/components/IconButton/IconButton.js +1 -1
- package/lib/components/IconButton/IconButton.stories.js +7 -13
- package/lib/components/IconButton/IconButton.test.js +4 -5
- package/lib/components/ImageUploadField/ImagePreviewButton.js +2 -1
- package/lib/components/List/List.js +2 -0
- package/lib/components/List/List.stories.js +6 -2
- package/lib/components/ListBox/ListBox.js +3 -5
- package/lib/components/ListBox/ListBox.test.js +2 -0
- package/lib/components/ListBox/Option.js +6 -0
- package/lib/components/ListView/ListView.stories.js +577 -39
- package/lib/components/Messages/Message.js +2 -2
- package/lib/components/MultivaluesField/MultivaluesField.js +2 -1
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +7 -5
- package/lib/components/PopoverContainer/PopoverContainer.test.js +16 -1
- package/lib/components/TextArea/TextArea.js +5 -1
- package/lib/components/TooltipTrigger/TooltipTrigger.js +10 -5
- package/lib/index.js +1 -0
- package/lib/styles/variants/accordion.js +2 -2
- package/lib/styles/variants/buttons.js +11 -1
- package/lib/styles/variants/codeView.js +68 -0
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +3 -1
@@ -1,13 +1,20 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import axeTest from '../../utils/testUtils/testAxe';
|
3
3
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
4
|
-
import { Box } from '../../index';
|
4
|
+
import { Box, OverlayPanel } from '../../index';
|
5
5
|
import PopoverContainer from './PopoverContainer';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
|
8
8
|
var getComponent = function getComponent() {
|
9
9
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10
10
|
return render(___EmotionJSX(React.Fragment, null, ___EmotionJSX(PopoverContainer, props, ___EmotionJSX(Box, null, "I am in a popover"))));
|
11
|
+
};
|
12
|
+
|
13
|
+
var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
|
14
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
15
|
+
return render(___EmotionJSX(OverlayPanel, {
|
16
|
+
isOpen: true
|
17
|
+
}, ___EmotionJSX(PopoverContainer, props, ___EmotionJSX(Box, null, "I am in a popover"))));
|
11
18
|
}; // Need to be added to each test file to test accessibility using axe.
|
12
19
|
|
13
20
|
|
@@ -26,4 +33,12 @@ test('should render a popover with no arrow', function () {
|
|
26
33
|
});
|
27
34
|
var arrow = screen.queryByTestId('popover-arrow');
|
28
35
|
expect(arrow).not.toBeInTheDocument();
|
36
|
+
});
|
37
|
+
test('popover will not open if wrapped in an overlayPanel', function () {
|
38
|
+
getComponentInOverlayPanel({
|
39
|
+
popoverProps: {
|
40
|
+
'data-test-id': 'popover-test'
|
41
|
+
}
|
42
|
+
});
|
43
|
+
expect(screen.queryByTestId('popover-test')).not.toBeInTheDocument();
|
29
44
|
});
|
@@ -12,7 +12,11 @@ import { Textarea as ThemeUITextArea } from 'theme-ui';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
13
|
var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
|
14
14
|
return ___EmotionJSX(ThemeUITextArea, _extends({
|
15
|
-
ref: ref
|
15
|
+
ref: ref // this requires to fix safari resizing issue (UIP-4995)
|
16
|
+
,
|
17
|
+
sx: {
|
18
|
+
position: 'relative'
|
19
|
+
}
|
16
20
|
}, props));
|
17
21
|
});
|
18
22
|
TextArea.displayName = 'TextArea';
|
@@ -32,7 +32,8 @@ var TooltipTrigger = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
32
32
|
className = props.className,
|
33
33
|
isNotFlippable = props.isNotFlippable,
|
34
34
|
isDarkMode = props.isDarkMode,
|
35
|
-
hasNoArrow = props.hasNoArrow
|
35
|
+
hasNoArrow = props.hasNoArrow,
|
36
|
+
targetRef = props.targetRef;
|
36
37
|
|
37
38
|
var _React$Children$toArr = React.Children.toArray(children),
|
38
39
|
_React$Children$toArr2 = _slicedToArray(_React$Children$toArr, 2),
|
@@ -42,23 +43,24 @@ var TooltipTrigger = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
42
43
|
var state = useTooltipTriggerState(props);
|
43
44
|
var tooltipTriggerRef = useRef();
|
44
45
|
var overlayRef = useRef();
|
46
|
+
var tooltipRef = targetRef || tooltipTriggerRef;
|
45
47
|
usePropWarning(props, 'disabled', 'isDisabled');
|
46
48
|
/* istanbul ignore next */
|
47
49
|
|
48
50
|
useImperativeHandle(ref, function () {
|
49
|
-
return
|
51
|
+
return tooltipRef.current;
|
50
52
|
});
|
51
53
|
|
52
54
|
var _useTooltipTrigger = useTooltipTrigger({
|
53
55
|
isDisabled: isDisabled,
|
54
56
|
trigger: triggerAction
|
55
|
-
}, state,
|
57
|
+
}, state, tooltipRef),
|
56
58
|
triggerProps = _useTooltipTrigger.triggerProps,
|
57
59
|
tooltipProps = _useTooltipTrigger.tooltipProps;
|
58
60
|
|
59
61
|
var _useOverlayPosition = useOverlayPosition({
|
60
62
|
placement: _concatInstanceProperty(_context = "".concat(direction, " ")).call(_context, align),
|
61
|
-
targetRef:
|
63
|
+
targetRef: tooltipRef,
|
62
64
|
overlayRef: overlayRef,
|
63
65
|
offset: offset,
|
64
66
|
// Our API preference is for default false so we invert this since it should be default true
|
@@ -134,7 +136,10 @@ TooltipTrigger.propTypes = {
|
|
134
136
|
placement: PropTypes.string,
|
135
137
|
|
136
138
|
/** By default, opens for both focus and hover. Can be made to open only for focus. */
|
137
|
-
trigger: PropTypes.string
|
139
|
+
trigger: PropTypes.string,
|
140
|
+
|
141
|
+
/* The ref for the element which the overlay positions itself with respect to. */
|
142
|
+
targetRef: PropTypes.shape({})
|
138
143
|
};
|
139
144
|
TooltipTrigger.defaultProps = {
|
140
145
|
align: 'middle',
|
package/lib/index.js
CHANGED
@@ -27,6 +27,7 @@ export { default as CheckboxField } from './components/CheckboxField';
|
|
27
27
|
export * from './components/CheckboxField';
|
28
28
|
export { default as Chip } from './components/Chip';
|
29
29
|
export * from './components/Chip';
|
30
|
+
export { default as CodeView } from './components/CodeView';
|
30
31
|
export { default as ComboBoxField } from './components/ComboBoxField';
|
31
32
|
export { default as CopyText } from './components/CopyText';
|
32
33
|
export { default as ColorField } from './components/ColorField';
|
@@ -18,11 +18,11 @@ var accordion = {
|
|
18
18
|
alignItems: 'flex-start'
|
19
19
|
};
|
20
20
|
var accordionBody = {
|
21
|
-
display: 'none
|
21
|
+
display: 'none',
|
22
22
|
pt: 'md',
|
23
23
|
width: '100%',
|
24
24
|
'.is-open &': {
|
25
|
-
display: 'flex
|
25
|
+
display: 'flex'
|
26
26
|
}
|
27
27
|
};
|
28
28
|
var accordionGridHeader = {
|
@@ -67,7 +67,7 @@ var iconButton = {
|
|
67
67
|
width: 'inherit',
|
68
68
|
height: 'inherit',
|
69
69
|
path: {
|
70
|
-
fill: 'neutral.
|
70
|
+
fill: 'neutral.40'
|
71
71
|
},
|
72
72
|
outline: 'none',
|
73
73
|
'&.is-focused': _objectSpread({}, defaultFocus),
|
@@ -82,6 +82,10 @@ var iconButton = {
|
|
82
82
|
}
|
83
83
|
};
|
84
84
|
|
85
|
+
var square = _objectSpread(_objectSpread({}, iconButton), {}, {
|
86
|
+
borderRadius: '2px'
|
87
|
+
});
|
88
|
+
|
85
89
|
var modalCloseButton = _objectSpread(_objectSpread({}, iconButton), {}, {
|
86
90
|
position: 'absolute',
|
87
91
|
top: 14,
|
@@ -219,6 +223,10 @@ var inverted = _objectSpread(_objectSpread({}, iconButton), {}, {
|
|
219
223
|
}
|
220
224
|
});
|
221
225
|
|
226
|
+
var invertedSquare = _objectSpread(_objectSpread({}, inverted), {}, {
|
227
|
+
borderRadius: '2px'
|
228
|
+
});
|
229
|
+
|
222
230
|
var applicationPortal = _objectSpread(_objectSpread({}, iconButton), {}, {
|
223
231
|
background: 'transparent',
|
224
232
|
'&.is-focused': _objectSpread({}, defaultFocus),
|
@@ -510,6 +518,8 @@ export default {
|
|
510
518
|
modalCloseButton: modalCloseButton,
|
511
519
|
applicationPortalPinned: applicationPortalPinned,
|
512
520
|
applicationPortal: applicationPortal,
|
521
|
+
square: square,
|
522
|
+
invertedSquare: invertedSquare,
|
513
523
|
tooltipChip: tooltipChip,
|
514
524
|
tooltipIconButton: tooltipIconButton,
|
515
525
|
tooltipInline: tooltipInline
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import 'a11y-syntax-highlighting/dist/prism/a11y-light.min.css';
|
2
|
+
var wrapper = {
|
3
|
+
bg: 'accent.99',
|
4
|
+
border: '1px solid',
|
5
|
+
borderColor: 'accent.95',
|
6
|
+
width: 400,
|
7
|
+
height: 200,
|
8
|
+
my: 5,
|
9
|
+
overflow: 'auto',
|
10
|
+
alignItems: 'center',
|
11
|
+
'&.is-focused, &:focus': {
|
12
|
+
boxShadow: 'focus',
|
13
|
+
outline: 'none'
|
14
|
+
},
|
15
|
+
pre: {
|
16
|
+
backgroundColor: 'transparent',
|
17
|
+
m: 0,
|
18
|
+
p: 10,
|
19
|
+
pr: 0,
|
20
|
+
height: '100%',
|
21
|
+
width: '100%',
|
22
|
+
overflowX: 'hidden',
|
23
|
+
overflowY: 'auto',
|
24
|
+
fontFamily: 'standard',
|
25
|
+
fontSize: 'sm',
|
26
|
+
'& .token-line': {
|
27
|
+
display: 'block',
|
28
|
+
alignItems: 'center',
|
29
|
+
'& .token': {
|
30
|
+
whiteSpace: 'pre-wrap',
|
31
|
+
wordBreak: 'break-all'
|
32
|
+
}
|
33
|
+
}
|
34
|
+
},
|
35
|
+
'&.has-no-copy-button': {
|
36
|
+
pre: {
|
37
|
+
p: 10
|
38
|
+
}
|
39
|
+
},
|
40
|
+
'&.has-line-numbers': {
|
41
|
+
pre: {
|
42
|
+
p: '0 10px 0 0',
|
43
|
+
overflow: 'auto',
|
44
|
+
'& .token-line:first-of-type *': {
|
45
|
+
pt: 10
|
46
|
+
},
|
47
|
+
'& .token-line': {
|
48
|
+
display: 'flex',
|
49
|
+
'& .token': {
|
50
|
+
whiteSpace: 'pre'
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
};
|
56
|
+
var lineNo = {
|
57
|
+
display: 'table-cell',
|
58
|
+
userSelect: 'none',
|
59
|
+
p: 5,
|
60
|
+
m: '0 10px 0 0',
|
61
|
+
bg: 'accent.30',
|
62
|
+
minWidth: 26,
|
63
|
+
color: 'white'
|
64
|
+
};
|
65
|
+
export default {
|
66
|
+
wrapper: wrapper,
|
67
|
+
lineNo: lineNo
|
68
|
+
};
|
@@ -14,6 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
14
14
|
|
15
15
|
import accordion from './accordion';
|
16
16
|
import boxes from './boxes';
|
17
|
+
import codeView from './codeView';
|
17
18
|
import images from './images';
|
18
19
|
import imageUpload from './imageUpload';
|
19
20
|
import link from './link';
|
@@ -35,6 +36,7 @@ import tooltip from './tooltip';
|
|
35
36
|
export default _objectSpread(_objectSpread({
|
36
37
|
accordion: accordion,
|
37
38
|
boxes: boxes,
|
39
|
+
codeView: codeView,
|
38
40
|
images: images,
|
39
41
|
imageUpload: imageUpload,
|
40
42
|
loader: loader,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "1.1.0-alpha.
|
3
|
+
"version": "1.1.0-alpha.12",
|
4
4
|
"description": "PingUX themeable React component library",
|
5
5
|
"author": "uxdev@pingidentity.com",
|
6
6
|
"license": "Apache-2.0",
|
@@ -126,12 +126,14 @@
|
|
126
126
|
"@styled-system/props": "^5.1.5",
|
127
127
|
"@styled-system/theme-get": "^5.1.2",
|
128
128
|
"@tippyjs/react": "4.2.0",
|
129
|
+
"a11y-syntax-highlighting": "0.2.0",
|
129
130
|
"chroma-js": "^2.1.0",
|
130
131
|
"classnames": "^2.2.6",
|
131
132
|
"emotion-normalize": "^11.0.1",
|
132
133
|
"lodash": "^4.17.21",
|
133
134
|
"mdi-react": "^7.4.0",
|
134
135
|
"moment": "^2.29.1",
|
136
|
+
"prism-react-renderer": "^1.2.1",
|
135
137
|
"prop-types": "^15.7.2",
|
136
138
|
"react-calendar": "^3.4.0",
|
137
139
|
"react-color": "^2.19.3",
|