@pingux/astro 1.0.0-alpha.14 → 1.0.0-alpha.18
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 +41 -0
- package/README.md +5 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
- package/lib/cjs/components/IconButton/IconButton.js +7 -7
- package/lib/cjs/components/IconButton/IconButton.test.js +0 -1
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +10 -0
- package/lib/cjs/styles/forms/input.js +4 -0
- package/lib/cjs/styles/variants/accordion.js +5 -7
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
- package/lib/components/IconButton/IconButton.js +7 -8
- package/lib/components/IconButton/IconButton.test.js +0 -1
- package/lib/components/TextAreaField/TextAreaField.test.js +8 -0
- package/lib/styles/forms/input.js +4 -0
- package/lib/styles/variants/accordion.js +5 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,47 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [1.0.0-alpha.18](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.17...@pingux/astro@1.0.0-alpha.18) (2022-01-13)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* [UIP-5107] IconButton - no focus in disabled state ([f301f6d](https://gitlab.corp.pingidentity.com/ux/pingux/commit/f301f6d0cdc8271c992eb3384094cafbd59fa0d5))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [1.0.0-alpha.17](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.16...@pingux/astro@1.0.0-alpha.17) (2022-01-13)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* [UIP-4997] Read only style TextAreaField ([a5f62bd](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a5f62bd014f2d3d75c2c71625bc31ba5cefbb4df))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
# [1.0.0-alpha.16](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.15...@pingux/astro@1.0.0-alpha.16) (2022-01-13)
|
29
|
+
|
30
|
+
|
31
|
+
### Bug Fixes
|
32
|
+
|
33
|
+
* [UIP-4962] accordion grid design improvements ([dcec402](https://gitlab.corp.pingidentity.com/ux/pingux/commit/dcec4025f945968e20386bc20ad011f48532acc7))
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
# [1.0.0-alpha.15](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.14...@pingux/astro@1.0.0-alpha.15) (2022-01-13)
|
40
|
+
|
41
|
+
**Note:** Version bump only for package @pingux/astro
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
6
47
|
# [1.0.0-alpha.14](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.13...@pingux/astro@1.0.0-alpha.14) (2022-01-10)
|
7
48
|
|
8
49
|
|
package/README.md
CHANGED
@@ -108,8 +108,6 @@ var Default = function Default() {
|
|
108
108
|
return (0, _react2.jsx)(_index.Box, {
|
109
109
|
isRow: true,
|
110
110
|
sx: {
|
111
|
-
pt: '12px',
|
112
|
-
pb: '12px',
|
113
111
|
flexGrow: 1
|
114
112
|
}
|
115
113
|
}, (0, _react2.jsx)(_index.Box, {
|
@@ -154,20 +152,14 @@ var Default = function Default() {
|
|
154
152
|
sx: {
|
155
153
|
mr: '4px',
|
156
154
|
height: '26px',
|
157
|
-
width: '26px'
|
158
|
-
'path': {
|
159
|
-
fill: 'active'
|
160
|
-
}
|
155
|
+
width: '26px'
|
161
156
|
}
|
162
157
|
}, (0, _react2.jsx)(_CreateIcon["default"], null)), (0, _react2.jsx)(_index.IconButton, {
|
163
158
|
"aria-label": "vertical-lines-icon",
|
164
159
|
sx: {
|
165
160
|
mr: '4px',
|
166
161
|
height: '26px',
|
167
|
-
width: '26px'
|
168
|
-
'path': {
|
169
|
-
fill: 'active'
|
170
|
-
}
|
162
|
+
width: '26px'
|
171
163
|
}
|
172
164
|
}, (0, _react2.jsx)(_MoreVertIcon["default"], null)))));
|
173
165
|
};
|
@@ -310,7 +302,8 @@ var Default = function Default() {
|
|
310
302
|
item: item
|
311
303
|
}), item.key !== 'Organization' ? (0, _react2.jsx)(_index.Separator, {
|
312
304
|
sx: {
|
313
|
-
m: 0
|
305
|
+
m: 0,
|
306
|
+
bg: 'neutral.90'
|
314
307
|
}
|
315
308
|
}) : null);
|
316
309
|
}))
|
@@ -40,6 +40,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
40
40
|
|
41
41
|
var _themeUi = require("theme-ui");
|
42
42
|
|
43
|
+
var _button = require("@react-aria/button");
|
44
|
+
|
43
45
|
var _focus = require("@react-aria/focus");
|
44
46
|
|
45
47
|
var _interactions = require("@react-aria/interactions");
|
@@ -84,15 +86,13 @@ var IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
84
86
|
return buttonRef.current;
|
85
87
|
});
|
86
88
|
|
89
|
+
var _useButton = (0, _button.useButton)(_objectSpread({}, props), buttonRef),
|
90
|
+
buttonProps = _useButton.buttonProps,
|
91
|
+
isPressed = _useButton.isPressed;
|
92
|
+
|
87
93
|
var _useContext = (0, _react.useContext)(_ChipContext.ChipContext),
|
88
94
|
chipBg = _useContext.bg;
|
89
95
|
|
90
|
-
var _usePress = (0, _interactions.usePress)(_objectSpread({
|
91
|
-
ref: buttonRef
|
92
|
-
}, props)),
|
93
|
-
isPressed = _usePress.isPressed,
|
94
|
-
pressProps = _usePress.pressProps;
|
95
|
-
|
96
96
|
var _useHover = (0, _interactions.useHover)(props),
|
97
97
|
hoverProps = _useHover.hoverProps,
|
98
98
|
isHovered = _useHover.isHovered;
|
@@ -121,7 +121,7 @@ var IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
121
121
|
fill: chipBg
|
122
122
|
}
|
123
123
|
}
|
124
|
-
},
|
124
|
+
}, (0, _utils.mergeProps)(hoverProps, focusProps, buttonProps, others)), children);
|
125
125
|
|
126
126
|
if (title) {
|
127
127
|
return (0, _react2.jsx)(_TooltipTrigger["default"], {
|
@@ -46,7 +46,6 @@ test('default icon button', function () {
|
|
46
46
|
|
47
47
|
expect(button).toHaveAttribute('data-testid', testId);
|
48
48
|
expect(button).toBeInstanceOf(HTMLButtonElement);
|
49
|
-
expect(button).toHaveAttribute('tabindex', '0');
|
50
49
|
expect(button).toBeInTheDocument();
|
51
50
|
});
|
52
51
|
test('icon button hover', function () {
|
@@ -128,6 +128,16 @@ test('form wrapper will have default max label column width when no custom width
|
|
128
128
|
|
129
129
|
expect(textAreaContainer).toHaveStyle('grid-template-columns: 40% auto');
|
130
130
|
});
|
131
|
+
test('passing read only prop applys the is-read-only class to the textarea', function () {
|
132
|
+
var isReadOnly = true;
|
133
|
+
getComponent({
|
134
|
+
isReadOnly: isReadOnly
|
135
|
+
});
|
136
|
+
|
137
|
+
var textArea = _testWrapper.screen.getByLabelText(defaultProps.label);
|
138
|
+
|
139
|
+
expect(textArea).toHaveClass('is-read-only');
|
140
|
+
});
|
131
141
|
test('form wrapper will have a max label column width when custom width set', function () {
|
132
142
|
var labelMode = 'left';
|
133
143
|
var containerProps = {
|
@@ -37,10 +37,10 @@ var accordionBody = {
|
|
37
37
|
var accordionGridHeader = {
|
38
38
|
cursor: 'pointer',
|
39
39
|
lineHeight: '30px',
|
40
|
-
|
40
|
+
pl: 'sm',
|
41
41
|
outline: 'none',
|
42
42
|
display: 'flex',
|
43
|
-
justifyContent: '
|
43
|
+
justifyContent: 'center',
|
44
44
|
flexShrink: 0,
|
45
45
|
wordBreak: 'inherit',
|
46
46
|
whiteSpace: 'nowrap',
|
@@ -54,12 +54,9 @@ var accordionGridHeader = {
|
|
54
54
|
WebkitBoxShadow: 'focus',
|
55
55
|
MozBoxShadow: 'focus'
|
56
56
|
},
|
57
|
-
|
57
|
+
minHeight: '64px',
|
58
58
|
'&.is-hovered': {
|
59
|
-
|
60
|
-
'& div > div > div > span': {
|
61
|
-
color: 'active'
|
62
|
-
}
|
59
|
+
backgroundColor: 'accent.99'
|
63
60
|
},
|
64
61
|
'&.is-pressed': {
|
65
62
|
color: 'accent.20',
|
@@ -70,6 +67,7 @@ var accordionGridHeader = {
|
|
70
67
|
};
|
71
68
|
var accordionGridBody = {
|
72
69
|
display: 'none !important',
|
70
|
+
pl: 'sm',
|
73
71
|
width: '100%',
|
74
72
|
'&.is-selected': {
|
75
73
|
display: 'flex !important'
|
@@ -83,8 +83,6 @@ export var Default = function Default() {
|
|
83
83
|
return ___EmotionJSX(Box, {
|
84
84
|
isRow: true,
|
85
85
|
sx: {
|
86
|
-
pt: '12px',
|
87
|
-
pb: '12px',
|
88
86
|
flexGrow: 1
|
89
87
|
}
|
90
88
|
}, ___EmotionJSX(Box, {
|
@@ -129,20 +127,14 @@ export var Default = function Default() {
|
|
129
127
|
sx: {
|
130
128
|
mr: '4px',
|
131
129
|
height: '26px',
|
132
|
-
width: '26px'
|
133
|
-
'path': {
|
134
|
-
fill: 'active'
|
135
|
-
}
|
130
|
+
width: '26px'
|
136
131
|
}
|
137
132
|
}, ___EmotionJSX(CreateIcon, null)), ___EmotionJSX(IconButton, {
|
138
133
|
"aria-label": "vertical-lines-icon",
|
139
134
|
sx: {
|
140
135
|
mr: '4px',
|
141
136
|
height: '26px',
|
142
|
-
width: '26px'
|
143
|
-
'path': {
|
144
|
-
fill: 'active'
|
145
|
-
}
|
137
|
+
width: '26px'
|
146
138
|
}
|
147
139
|
}, ___EmotionJSX(MoreVertIcon, null)))));
|
148
140
|
};
|
@@ -285,7 +277,8 @@ export var Default = function Default() {
|
|
285
277
|
item: item
|
286
278
|
}), item.key !== 'Organization' ? ___EmotionJSX(Separator, {
|
287
279
|
sx: {
|
288
|
-
m: 0
|
280
|
+
m: 0,
|
281
|
+
bg: 'neutral.90'
|
289
282
|
}
|
290
283
|
}) : null);
|
291
284
|
}))
|
@@ -17,8 +17,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
17
17
|
import React, { forwardRef, useRef, useImperativeHandle, useContext } from 'react';
|
18
18
|
import PropTypes from 'prop-types';
|
19
19
|
import { IconButton as ThemeUIIconButton } from 'theme-ui';
|
20
|
+
import { useButton } from '@react-aria/button';
|
20
21
|
import { useFocusRing } from '@react-aria/focus';
|
21
|
-
import { Pressable, useHover
|
22
|
+
import { Pressable, useHover } from '@react-aria/interactions';
|
22
23
|
import { mergeProps } from '@react-aria/utils';
|
23
24
|
import { useAriaLabelWarning, useStatusClasses } from '../../hooks';
|
24
25
|
import { ChipContext } from '../Chip/ChipContext';
|
@@ -52,15 +53,13 @@ var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
52
53
|
return buttonRef.current;
|
53
54
|
});
|
54
55
|
|
56
|
+
var _useButton = useButton(_objectSpread({}, props), buttonRef),
|
57
|
+
buttonProps = _useButton.buttonProps,
|
58
|
+
isPressed = _useButton.isPressed;
|
59
|
+
|
55
60
|
var _useContext = useContext(ChipContext),
|
56
61
|
chipBg = _useContext.bg;
|
57
62
|
|
58
|
-
var _usePress = usePress(_objectSpread({
|
59
|
-
ref: buttonRef
|
60
|
-
}, props)),
|
61
|
-
isPressed = _usePress.isPressed,
|
62
|
-
pressProps = _usePress.pressProps;
|
63
|
-
|
64
63
|
var _useHover = useHover(props),
|
65
64
|
hoverProps = _useHover.hoverProps,
|
66
65
|
isHovered = _useHover.isHovered;
|
@@ -90,7 +89,7 @@ var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
90
89
|
fill: chipBg
|
91
90
|
}
|
92
91
|
}
|
93
|
-
},
|
92
|
+
}, mergeProps(hoverProps, focusProps, buttonProps, others)), children);
|
94
93
|
|
95
94
|
if (title) {
|
96
95
|
return ___EmotionJSX(TooltipTrigger, {
|
@@ -32,7 +32,6 @@ test('default icon button', function () {
|
|
32
32
|
var button = screen.getByRole('button');
|
33
33
|
expect(button).toHaveAttribute('data-testid', testId);
|
34
34
|
expect(button).toBeInstanceOf(HTMLButtonElement);
|
35
|
-
expect(button).toHaveAttribute('tabindex', '0');
|
36
35
|
expect(button).toBeInTheDocument();
|
37
36
|
});
|
38
37
|
test('icon button hover', function () {
|
@@ -99,6 +99,14 @@ test('form wrapper will have default max label column width when no custom width
|
|
99
99
|
var textAreaContainer = screen.getByTestId(testId);
|
100
100
|
expect(textAreaContainer).toHaveStyle('grid-template-columns: 40% auto');
|
101
101
|
});
|
102
|
+
test('passing read only prop applys the is-read-only class to the textarea', function () {
|
103
|
+
var isReadOnly = true;
|
104
|
+
getComponent({
|
105
|
+
isReadOnly: isReadOnly
|
106
|
+
});
|
107
|
+
var textArea = screen.getByLabelText(defaultProps.label);
|
108
|
+
expect(textArea).toHaveClass('is-read-only');
|
109
|
+
});
|
102
110
|
test('form wrapper will have a max label column width when custom width set', function () {
|
103
111
|
var labelMode = 'left';
|
104
112
|
var containerProps = {
|
@@ -28,10 +28,10 @@ var accordionBody = {
|
|
28
28
|
var accordionGridHeader = {
|
29
29
|
cursor: 'pointer',
|
30
30
|
lineHeight: '30px',
|
31
|
-
|
31
|
+
pl: 'sm',
|
32
32
|
outline: 'none',
|
33
33
|
display: 'flex',
|
34
|
-
justifyContent: '
|
34
|
+
justifyContent: 'center',
|
35
35
|
flexShrink: 0,
|
36
36
|
wordBreak: 'inherit',
|
37
37
|
whiteSpace: 'nowrap',
|
@@ -45,12 +45,9 @@ var accordionGridHeader = {
|
|
45
45
|
WebkitBoxShadow: 'focus',
|
46
46
|
MozBoxShadow: 'focus'
|
47
47
|
},
|
48
|
-
|
48
|
+
minHeight: '64px',
|
49
49
|
'&.is-hovered': {
|
50
|
-
|
51
|
-
'& div > div > div > span': {
|
52
|
-
color: 'active'
|
53
|
-
}
|
50
|
+
backgroundColor: 'accent.99'
|
54
51
|
},
|
55
52
|
'&.is-pressed': {
|
56
53
|
color: 'accent.20',
|
@@ -61,6 +58,7 @@ var accordionGridHeader = {
|
|
61
58
|
};
|
62
59
|
var accordionGridBody = {
|
63
60
|
display: 'none !important',
|
61
|
+
pl: 'sm',
|
64
62
|
width: '100%',
|
65
63
|
'&.is-selected': {
|
66
64
|
display: 'flex !important'
|