@pingux/astro 1.33.0-alpha.5 → 1.33.1-alpha.0
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 +20 -0
- package/lib/cjs/components/HelpHint/HelpHint.js +11 -2
- package/lib/cjs/components/Modal/Modal.js +6 -1
- package/lib/cjs/components/Modal/tests/Modal.unit.test.js +24 -0
- package/lib/cjs/styles/themeOverrides/uiLibraryOverride.js +12 -1
- package/lib/components/HelpHint/HelpHint.js +10 -2
- package/lib/components/Modal/Modal.js +6 -1
- package/lib/components/Modal/tests/Modal.unit.test.js +20 -1
- package/lib/styles/themeOverrides/uiLibraryOverride.js +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,26 @@
|
|
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.33.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.32.1...@pingux/astro@1.33.0) (2022-10-27)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* [UIP-5698] uiLibraryOverride Theme Link and Icon Button Update ([1f9924e](https://gitlab.corp.pingidentity.com/ux/pingux/commit/1f9924e30bb152de2089969865b7f0bf0f079dc1))
|
12
|
+
* [UIP-5706] Accordion Grid - add aria-expanded and change focus style ([13ae129](https://gitlab.corp.pingidentity.com/ux/pingux/commit/13ae129b877c5a50797622f22f119771eef45e18))
|
13
|
+
* [UIP-5723] Help hint improvements ([24acce7](https://gitlab.corp.pingidentity.com/ux/pingux/commit/24acce7318af5f77574d97c3eb0d4ead7af10654))
|
14
|
+
* [UIP-5739] PasswordField fix error on mount ([bdcd21f](https://gitlab.corp.pingidentity.com/ux/pingux/commit/bdcd21f4e437bd985b7846b659637256fae79f64))
|
15
|
+
* [UIP-5783] Disabled Box: replace inputs with image and text ([ee91ad3](https://gitlab.corp.pingidentity.com/ux/pingux/commit/ee91ad30aa3954bad76085f813677341d609a3c7))
|
16
|
+
|
17
|
+
|
18
|
+
### Features
|
19
|
+
|
20
|
+
* [UIP-5644] Text component and recipe improvements ([a68ef47](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a68ef479985adf8cc9b078b0c10eb3db48cf4152))
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
6
26
|
## [1.32.1](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.32.0...@pingux/astro@1.32.1) (2022-10-25)
|
7
27
|
|
8
28
|
|
@@ -24,6 +24,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
24
24
|
|
25
25
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
26
26
|
|
27
|
+
var _uuid = require("uuid");
|
28
|
+
|
27
29
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
28
30
|
|
29
31
|
var _TooltipTrigger = _interopRequireWildcard(require("../TooltipTrigger"));
|
@@ -63,6 +65,7 @@ var HelpHint = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
63
65
|
tooltipProps = props.tooltipProps,
|
64
66
|
iconButtonProps = props.iconButtonProps,
|
65
67
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
68
|
+
var tooltipId = (0, _uuid.v4)();
|
66
69
|
return (0, _react2.jsx)(_TooltipTrigger["default"], (0, _extends2["default"])({
|
67
70
|
ref: ref,
|
68
71
|
direction: "top"
|
@@ -70,9 +73,15 @@ var HelpHint = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
70
73
|
variant: "helpHint",
|
71
74
|
"aria-label": "label help hint",
|
72
75
|
"data-testid": "help-hint__button"
|
73
|
-
}, iconButtonProps
|
76
|
+
}, iconButtonProps, {
|
77
|
+
"aria-describedby": tooltipId
|
78
|
+
}), (0, _react2.jsx)(_Icon["default"], {
|
74
79
|
icon: HelpIcon
|
75
|
-
})), (0, _react2.jsx)(_TooltipTrigger.Tooltip, tooltipProps,
|
80
|
+
})), (0, _react2.jsx)(_TooltipTrigger.Tooltip, (0, _extends2["default"])({}, tooltipProps, {
|
81
|
+
role: "tooltip",
|
82
|
+
"aria-live": "polite",
|
83
|
+
id: tooltipId
|
84
|
+
}), children));
|
76
85
|
});
|
77
86
|
HelpHint.propTypes = {
|
78
87
|
/** Props object that is spread directly into the tooltip element. */
|
@@ -126,7 +126,12 @@ var Modal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
126
126
|
|
127
127
|
var _useDialog = (0, _dialog.useDialog)(contentProps, modalRef),
|
128
128
|
dialogProps = _useDialog.dialogProps,
|
129
|
-
titleProps = _useDialog.titleProps;
|
129
|
+
titleProps = _useDialog.titleProps; // Prevents extra dialog focus from being called.
|
130
|
+
|
131
|
+
|
132
|
+
dialogProps.onMouseDown = function (e) {
|
133
|
+
return e.preventDefault();
|
134
|
+
};
|
130
135
|
|
131
136
|
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
132
137
|
isDarkMode: others.variant === 'modal.dark'
|
@@ -18,6 +18,13 @@ var _react2 = require("@emotion/react");
|
|
18
18
|
var getComponent = function getComponent() {
|
19
19
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
20
20
|
return (0, _testWrapper.render)((0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Modal, props)));
|
21
|
+
};
|
22
|
+
|
23
|
+
var getComponentWithCheckbox = function getComponentWithCheckbox() {
|
24
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
25
|
+
return (0, _testWrapper.render)((0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Modal, props, (0, _react2.jsx)(_index.CheckboxField, {
|
26
|
+
"aria-label": "checkbox"
|
27
|
+
}))));
|
21
28
|
}; // **********
|
22
29
|
// Unit tests
|
23
30
|
// **********
|
@@ -219,4 +226,21 @@ test('should auto focus the first tabbable element if "hasAutoFocus" is true', f
|
|
219
226
|
var button = _testWrapper.screen.queryByRole('button');
|
220
227
|
|
221
228
|
expect(button).toHaveFocus();
|
229
|
+
});
|
230
|
+
test('checkbox should not have focus outline on click', function () {
|
231
|
+
getComponentWithCheckbox({
|
232
|
+
isOpen: true
|
233
|
+
});
|
234
|
+
|
235
|
+
var checkbox = _testWrapper.screen.getByRole('checkbox');
|
236
|
+
|
237
|
+
_userEvent["default"].click(checkbox);
|
238
|
+
|
239
|
+
expect(checkbox).toBeChecked();
|
240
|
+
expect(checkbox).not.toHaveClass('is-focused');
|
241
|
+
|
242
|
+
_userEvent["default"].click(checkbox);
|
243
|
+
|
244
|
+
expect(checkbox).not.toBeChecked();
|
245
|
+
expect(checkbox).not.toHaveClass('is-focused');
|
222
246
|
});
|
@@ -57,6 +57,11 @@ var buttons = {
|
|
57
57
|
inline: {
|
58
58
|
'&:not(.disabled):hover': _objectSpread(_objectSpread({}, _theme["default"].buttons.inline), _theme["default"].buttons.defaultHover)
|
59
59
|
},
|
60
|
+
inverted: _objectSpread(_objectSpread({}, _theme["default"].buttons.inverted), {}, {
|
61
|
+
':focus': {
|
62
|
+
border: 'none'
|
63
|
+
}
|
64
|
+
}),
|
60
65
|
primary: {
|
61
66
|
'&:hover': _objectSpread({}, _theme["default"].buttons.primary)
|
62
67
|
},
|
@@ -123,8 +128,14 @@ var forms = {
|
|
123
128
|
}
|
124
129
|
}
|
125
130
|
};
|
131
|
+
var links = {
|
132
|
+
app: {
|
133
|
+
'&:hover': _objectSpread({}, _theme["default"].links.app)
|
134
|
+
}
|
135
|
+
};
|
126
136
|
var _default = {
|
127
137
|
buttons: buttons,
|
128
|
-
forms: forms
|
138
|
+
forms: forms,
|
139
|
+
links: links
|
129
140
|
};
|
130
141
|
exports["default"] = _default;
|
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectW
|
|
3
3
|
var _excluded = ["children", "tooltipProps", "iconButtonProps"];
|
4
4
|
import React, { forwardRef } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
|
+
import { v4 as uuid } from 'uuid';
|
6
7
|
import IconButton from '../IconButton';
|
7
8
|
import TooltipTrigger, { Tooltip } from '../TooltipTrigger';
|
8
9
|
import Icon from '../Icon';
|
@@ -34,6 +35,7 @@ var HelpHint = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
35
|
iconButtonProps = props.iconButtonProps,
|
35
36
|
others = _objectWithoutProperties(props, _excluded);
|
36
37
|
|
38
|
+
var tooltipId = uuid();
|
37
39
|
return ___EmotionJSX(TooltipTrigger, _extends({
|
38
40
|
ref: ref,
|
39
41
|
direction: "top"
|
@@ -41,9 +43,15 @@ var HelpHint = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
41
43
|
variant: "helpHint",
|
42
44
|
"aria-label": "label help hint",
|
43
45
|
"data-testid": "help-hint__button"
|
44
|
-
}, iconButtonProps
|
46
|
+
}, iconButtonProps, {
|
47
|
+
"aria-describedby": tooltipId
|
48
|
+
}), ___EmotionJSX(Icon, {
|
45
49
|
icon: HelpIcon
|
46
|
-
})), ___EmotionJSX(Tooltip, tooltipProps,
|
50
|
+
})), ___EmotionJSX(Tooltip, _extends({}, tooltipProps, {
|
51
|
+
role: "tooltip",
|
52
|
+
"aria-live": "polite",
|
53
|
+
id: tooltipId
|
54
|
+
}), children));
|
47
55
|
});
|
48
56
|
HelpHint.propTypes = {
|
49
57
|
/** Props object that is spread directly into the tooltip element. */
|
@@ -86,7 +86,12 @@ var Modal = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
86
86
|
|
87
87
|
var _useDialog = useDialog(contentProps, modalRef),
|
88
88
|
dialogProps = _useDialog.dialogProps,
|
89
|
-
titleProps = _useDialog.titleProps;
|
89
|
+
titleProps = _useDialog.titleProps; // Prevents extra dialog focus from being called.
|
90
|
+
|
91
|
+
|
92
|
+
dialogProps.onMouseDown = function (e) {
|
93
|
+
return e.preventDefault();
|
94
|
+
};
|
90
95
|
|
91
96
|
var _useStatusClasses = useStatusClasses(className, {
|
92
97
|
isDarkMode: others.variant === 'modal.dark'
|
@@ -2,13 +2,20 @@ import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
3
3
|
import axeTest from '../../../utils/testUtils/testAxe';
|
4
4
|
import { render, screen, queryByAttribute } from '../../../utils/testUtils/testWrapper';
|
5
|
-
import { OverlayProvider, Modal } from '../../../index'; // For testing the modal alone
|
5
|
+
import { CheckboxField, OverlayProvider, Modal } from '../../../index'; // For testing the modal alone
|
6
6
|
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
|
9
9
|
var getComponent = function getComponent() {
|
10
10
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11
11
|
return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Modal, props)));
|
12
|
+
};
|
13
|
+
|
14
|
+
var getComponentWithCheckbox = function getComponentWithCheckbox() {
|
15
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
16
|
+
return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Modal, props, ___EmotionJSX(CheckboxField, {
|
17
|
+
"aria-label": "checkbox"
|
18
|
+
}))));
|
12
19
|
}; // **********
|
13
20
|
// Unit tests
|
14
21
|
// **********
|
@@ -185,4 +192,16 @@ test('should auto focus the first tabbable element if "hasAutoFocus" is true', f
|
|
185
192
|
});
|
186
193
|
var button = screen.queryByRole('button');
|
187
194
|
expect(button).toHaveFocus();
|
195
|
+
});
|
196
|
+
test('checkbox should not have focus outline on click', function () {
|
197
|
+
getComponentWithCheckbox({
|
198
|
+
isOpen: true
|
199
|
+
});
|
200
|
+
var checkbox = screen.getByRole('checkbox');
|
201
|
+
userEvent.click(checkbox);
|
202
|
+
expect(checkbox).toBeChecked();
|
203
|
+
expect(checkbox).not.toHaveClass('is-focused');
|
204
|
+
userEvent.click(checkbox);
|
205
|
+
expect(checkbox).not.toBeChecked();
|
206
|
+
expect(checkbox).not.toHaveClass('is-focused');
|
188
207
|
});
|
@@ -38,6 +38,11 @@ var buttons = {
|
|
38
38
|
inline: {
|
39
39
|
'&:not(.disabled):hover': _objectSpread(_objectSpread({}, theme.buttons.inline), theme.buttons.defaultHover)
|
40
40
|
},
|
41
|
+
inverted: _objectSpread(_objectSpread({}, theme.buttons.inverted), {}, {
|
42
|
+
':focus': {
|
43
|
+
border: 'none'
|
44
|
+
}
|
45
|
+
}),
|
41
46
|
primary: {
|
42
47
|
'&:hover': _objectSpread({}, theme.buttons.primary)
|
43
48
|
},
|
@@ -104,7 +109,13 @@ var forms = {
|
|
104
109
|
}
|
105
110
|
}
|
106
111
|
};
|
112
|
+
var links = {
|
113
|
+
app: {
|
114
|
+
'&:hover': _objectSpread({}, theme.links.app)
|
115
|
+
}
|
116
|
+
};
|
107
117
|
export default {
|
108
118
|
buttons: buttons,
|
109
|
-
forms: forms
|
119
|
+
forms: forms,
|
120
|
+
links: links
|
110
121
|
};
|