@pingux/astro 1.0.0-alpha.17 → 1.0.0-alpha.20
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 +30 -0
- package/lib/cjs/components/Button/Button.js +5 -24
- package/lib/cjs/components/Button/Button.test.js +0 -24
- package/lib/cjs/components/IconButton/IconButton.js +7 -7
- package/lib/cjs/components/IconButton/IconButton.test.js +0 -1
- package/lib/cjs/components/ListItem/ListItem.stories.js +0 -2
- package/lib/cjs/components/Stepper/Stepper.js +1 -0
- package/lib/cjs/components/Tab/Tab.js +4 -2
- package/lib/cjs/index.js +48 -136
- package/lib/cjs/layouts/SchemaFormLayout.stories.js +2 -21
- package/lib/cjs/recipes/ArrayField.stories.js +3 -3
- package/lib/cjs/styles/theme.js +0 -3
- package/lib/cjs/styles/variants/boxes.js +0 -15
- package/lib/cjs/styles/variants/buttons.js +1 -27
- package/lib/cjs/styles/variants/variants.js +0 -3
- package/lib/components/Button/Button.js +7 -24
- package/lib/components/Button/Button.test.js +0 -20
- package/lib/components/IconButton/IconButton.js +7 -8
- package/lib/components/IconButton/IconButton.test.js +0 -1
- package/lib/components/ListItem/ListItem.stories.js +0 -2
- package/lib/components/Stepper/Stepper.js +1 -0
- package/lib/components/Tab/Tab.js +4 -2
- package/lib/index.js +0 -8
- package/lib/layouts/SchemaFormLayout.stories.js +2 -19
- package/lib/recipes/ArrayField.stories.js +3 -3
- package/lib/styles/theme.js +0 -3
- package/lib/styles/variants/boxes.js +0 -15
- package/lib/styles/variants/buttons.js +1 -27
- package/lib/styles/variants/variants.js +0 -2
- package/package.json +1 -1
- package/lib/cjs/components/Dropdown/Dropdown.js +0 -112
- package/lib/cjs/components/Dropdown/Dropdown.test.js +0 -80
- package/lib/cjs/components/Dropdown/index.js +0 -18
- package/lib/cjs/components/DropdownField/DropdownField.js +0 -187
- package/lib/cjs/components/DropdownField/DropdownField.stories.js +0 -278
- package/lib/cjs/components/DropdownField/DropdownField.test.js +0 -80
- package/lib/cjs/components/DropdownField/index.js +0 -18
- package/lib/cjs/components/Panel/Panel.js +0 -101
- package/lib/cjs/components/Panel/Panel.stories.js +0 -57
- package/lib/cjs/components/Panel/Panel.test.js +0 -72
- package/lib/cjs/components/Panel/index.js +0 -18
- package/lib/cjs/components/Popover/Popover.js +0 -87
- package/lib/cjs/components/Popover/Popover.stories.js +0 -80
- package/lib/cjs/components/Popover/Popover.test.js +0 -91
- package/lib/cjs/components/Popover/index.js +0 -18
- package/lib/cjs/recipes/InputBoxWithLinkedChip.stories.js +0 -67
- package/lib/cjs/styles/variants/popover.js +0 -86
- package/lib/components/Dropdown/Dropdown.js +0 -90
- package/lib/components/Dropdown/Dropdown.test.js +0 -62
- package/lib/components/Dropdown/index.js +0 -1
- package/lib/components/DropdownField/DropdownField.js +0 -155
- package/lib/components/DropdownField/DropdownField.stories.js +0 -222
- package/lib/components/DropdownField/DropdownField.test.js +0 -60
- package/lib/components/DropdownField/index.js +0 -1
- package/lib/components/Panel/Panel.js +0 -71
- package/lib/components/Panel/Panel.stories.js +0 -35
- package/lib/components/Panel/Panel.test.js +0 -52
- package/lib/components/Panel/index.js +0 -1
- package/lib/components/Popover/Popover.js +0 -65
- package/lib/components/Popover/Popover.stories.js +0 -52
- package/lib/components/Popover/Popover.test.js +0 -75
- package/lib/components/Popover/index.js +0 -2
- package/lib/recipes/InputBoxWithLinkedChip.stories.js +0 -43
- package/lib/styles/variants/popover.js +0 -76
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,36 @@
|
|
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.20](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.19...@pingux/astro@1.0.0-alpha.20) (2022-01-17)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @pingux/astro
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [1.0.0-alpha.19](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.18...@pingux/astro@1.0.0-alpha.19) (2022-01-13)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* [UIP-4996] astro stepper redundant tooltip ([d74f102](https://gitlab.corp.pingidentity.com/ux/pingux/commit/d74f1020163703948498436224ef3f9d6458df57))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
# [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)
|
26
|
+
|
27
|
+
|
28
|
+
### Bug Fixes
|
29
|
+
|
30
|
+
* [UIP-5107] IconButton - no focus in disabled state ([f301f6d](https://gitlab.corp.pingidentity.com/ux/pingux/commit/f301f6d0cdc8271c992eb3384094cafbd59fa0d5))
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
6
36
|
# [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)
|
7
37
|
|
8
38
|
|
@@ -48,14 +48,10 @@ var _focus = require("@react-aria/focus");
|
|
48
48
|
|
49
49
|
var _utils = require("@react-aria/utils");
|
50
50
|
|
51
|
-
var _constants = require("./constants");
|
52
|
-
|
53
51
|
var _hooks = require("../../hooks");
|
54
52
|
|
55
53
|
var _Loader = _interopRequireDefault(require("../Loader"));
|
56
54
|
|
57
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
58
|
-
|
59
55
|
var _react2 = require("@emotion/react");
|
60
56
|
|
61
57
|
function ownKeys(object, enumerableOnly) { var keys = (0, _keys["default"])(object); if (_getOwnPropertySymbols["default"]) { var symbols = (0, _getOwnPropertySymbols["default"])(object); if (enumerableOnly) symbols = (0, _filter["default"])(symbols).call(symbols, function (sym) { return (0, _getOwnPropertyDescriptor["default"])(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
@@ -75,8 +71,7 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
75
71
|
onPressChange = props.onPressChange,
|
76
72
|
onPressUp = props.onPressUp,
|
77
73
|
children = props.children,
|
78
|
-
|
79
|
-
others = (0, _objectWithoutProperties2["default"])(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children", "mode"]);
|
74
|
+
others = (0, _objectWithoutProperties2["default"])(props, ["className", "isDisabled", "isLoading", "onHoverStart", "onHoverChange", "onHoverEnd", "onPress", "onPressStart", "onPressEnd", "onPressChange", "onPressUp", "children"]);
|
80
75
|
var buttonRef = (0, _react.useRef)();
|
81
76
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
82
77
|
/* istanbul ignore next */
|
@@ -84,20 +79,13 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
84
79
|
(0, _react.useImperativeHandle)(ref, function () {
|
85
80
|
return buttonRef.current;
|
86
81
|
});
|
87
|
-
var ButtonBase = (0, _react.useMemo)(function () {
|
88
|
-
return mode === _constants.modes.ICON ? _Box["default"] : _themeUi.Button;
|
89
|
-
}, [mode]);
|
90
|
-
var elementType = (0, _react.useMemo)(function () {
|
91
|
-
if (mode === _constants.modes.ICON) return 'div';
|
92
|
-
return 'button';
|
93
|
-
}, [mode]);
|
94
82
|
|
95
83
|
var _useFocusRing = (0, _focus.useFocusRing)(),
|
96
84
|
isFocusVisible = _useFocusRing.isFocusVisible,
|
97
85
|
focusProps = _useFocusRing.focusProps;
|
98
86
|
|
99
87
|
var _useButton = (0, _button.useButton)(_objectSpread({
|
100
|
-
elementType:
|
88
|
+
elementType: 'button'
|
101
89
|
}, props), buttonRef),
|
102
90
|
buttonProps = _useButton.buttonProps,
|
103
91
|
isPressed = _useButton.isPressed;
|
@@ -114,12 +102,9 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
114
102
|
}),
|
115
103
|
classNames = _useStatusClasses.classNames;
|
116
104
|
|
117
|
-
(0, _hooks.useDeprecationWarning)('The "icon" variant for `Button` will be deprecated in Astro-UI 1.0.0, use the `IconButton` component instead.', {
|
118
|
-
isActive: props.variant === 'icon'
|
119
|
-
});
|
120
105
|
var ariaLabel = props['aria-label'];
|
121
106
|
(0, _hooks.useAriaLabelWarning)('Button', ariaLabel);
|
122
|
-
return (0, _react2.jsx)(
|
107
|
+
return (0, _react2.jsx)(_themeUi.Button, (0, _extends2["default"])({
|
123
108
|
"aria-label": ariaLabel || 'Button',
|
124
109
|
ref: buttonRef,
|
125
110
|
className: classNames,
|
@@ -202,15 +187,11 @@ Button.propTypes = {
|
|
202
187
|
onPressUp: _propTypes["default"].func,
|
203
188
|
|
204
189
|
/** The styling variation of the button. */
|
205
|
-
variant: _propTypes["default"].string
|
206
|
-
|
207
|
-
/** The behavioral pattern to apply to the button. */
|
208
|
-
mode: _propTypes["default"].oneOf(['default', 'icon'])
|
190
|
+
variant: _propTypes["default"].string
|
209
191
|
};
|
210
192
|
Button.defaultProps = {
|
211
193
|
isDisabled: false,
|
212
|
-
variant: 'default'
|
213
|
-
mode: 'default'
|
194
|
+
variant: 'default'
|
214
195
|
};
|
215
196
|
Button.displayName = 'Button';
|
216
197
|
var _default = Button;
|
@@ -8,16 +8,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
|
9
9
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
10
10
|
|
11
|
-
var _AddCircleIcon = _interopRequireDefault(require("mdi-react/AddCircleIcon"));
|
12
|
-
|
13
11
|
var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
|
14
12
|
|
15
13
|
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
16
14
|
|
17
15
|
var _ = _interopRequireDefault(require("."));
|
18
16
|
|
19
|
-
var _Icon = _interopRequireDefault(require("../Icon"));
|
20
|
-
|
21
17
|
var _react2 = require("@emotion/react");
|
22
18
|
|
23
19
|
var testId = 'test-button';
|
@@ -28,15 +24,6 @@ var defaultProps = {
|
|
28
24
|
var getComponent = function getComponent() {
|
29
25
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
30
26
|
return (0, _testWrapper.render)((0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props)));
|
31
|
-
};
|
32
|
-
|
33
|
-
var getIconButton = function getIconButton() {
|
34
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
35
|
-
return (0, _testWrapper.render)((0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props, {
|
36
|
-
variant: "icon"
|
37
|
-
}), (0, _react2.jsx)(_Icon["default"], {
|
38
|
-
icon: _AddCircleIcon["default"]
|
39
|
-
})));
|
40
27
|
}; // Need to be added to each test file to test accessibility using axe.
|
41
28
|
|
42
29
|
|
@@ -134,15 +121,4 @@ test('button renders children when not loading', function () {
|
|
134
121
|
expect(childWrapper).toBeInTheDocument();
|
135
122
|
expect(childWrapper).toBeVisible();
|
136
123
|
expect(_testWrapper.screen.queryByRole('progressbar')).not.toBeInTheDocument();
|
137
|
-
});
|
138
|
-
test('passing in an icon makes the button parent a div', function () {
|
139
|
-
getIconButton({
|
140
|
-
mode: 'icon'
|
141
|
-
});
|
142
|
-
|
143
|
-
var button = _testWrapper.screen.getByRole('button');
|
144
|
-
|
145
|
-
expect(button).toBeInTheDocument();
|
146
|
-
expect(button).toBeVisible();
|
147
|
-
expect(button).toBeInstanceOf(HTMLDivElement);
|
148
124
|
});
|
@@ -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 () {
|
@@ -56,7 +56,6 @@ var Default = function Default(args) {
|
|
56
56
|
isRow: true,
|
57
57
|
alignSelf: "center"
|
58
58
|
}, (0, _react2.jsx)(_IconButton["default"], {
|
59
|
-
variant: "icon",
|
60
59
|
size: 26
|
61
60
|
}, (0, _react2.jsx)(_Icon["default"], {
|
62
61
|
icon: _MoreVertIcon["default"],
|
@@ -91,7 +90,6 @@ var WithSubtitle = function WithSubtitle(args) {
|
|
91
90
|
isRow: true,
|
92
91
|
alignSelf: "center"
|
93
92
|
}, (0, _react2.jsx)(_IconButton["default"], {
|
94
|
-
variant: "icon",
|
95
93
|
size: 26
|
96
94
|
}, (0, _react2.jsx)(_Icon["default"], {
|
97
95
|
icon: _MoreVertIcon["default"],
|
@@ -63,7 +63,8 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
63
63
|
tabLabelProps = itemProps.tabLabelProps,
|
64
64
|
tabLineProps = itemProps.tabLineProps,
|
65
65
|
content = itemProps.content,
|
66
|
-
|
66
|
+
titleAttr = itemProps.titleAttr,
|
67
|
+
otherItemProps = (0, _objectWithoutProperties2["default"])(itemProps, ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr"]);
|
67
68
|
var state = (0, _react.useContext)(_Tabs.TabsContext);
|
68
69
|
var isDisabled = tabsDisabled || tabDisabled || state.disabledKeys.has(key);
|
69
70
|
var isSelected = state.selectedKey === key;
|
@@ -106,7 +107,8 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
106
107
|
className: classNames,
|
107
108
|
variant: "tab"
|
108
109
|
}, (0, _utils.mergeProps)(focusProps, hoverProps, tabProps), otherItemProps, {
|
109
|
-
ref: tabRef
|
110
|
+
ref: tabRef,
|
111
|
+
title: titleAttr || undefined
|
110
112
|
}), icon, (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({
|
111
113
|
variant: "tabLabel"
|
112
114
|
}, tabLabelProps), rendered), isSelected && !isDisabled && (0, _react2.jsx)(TabLine, tabLineProps)), slots === null || slots === void 0 ? void 0 : slots.afterTab);
|