@pingux/astro 1.0.0-alpha.19 → 1.0.0-alpha.22
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/ListItem/ListItem.stories.js +0 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +1 -1
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +45 -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 +2 -16
- package/lib/cjs/styles/variants/buttons.js +37 -28
- 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/ListItem/ListItem.stories.js +0 -2
- package/lib/components/MultivaluesField/MultivaluesField.js +1 -1
- package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +33 -1
- 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 +1 -16
- package/lib/styles/variants/buttons.js +36 -28
- 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.22](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.21...@pingux/astro@1.0.0-alpha.22) (2022-01-18)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* [UIP-5122] adjust x icon to 14px ([6b4ca54](https://gitlab.corp.pingidentity.com/ux/pingux/commit/6b4ca5418ddaffb6e1a4daaf28b57151a23529cb))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [1.0.0-alpha.21](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.20...@pingux/astro@1.0.0-alpha.21) (2022-01-18)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* [UIP-5066] Add Icon, Chip, and Text with Tooltips ([1681083](https://gitlab.corp.pingidentity.com/ux/pingux/commit/168108386d77ef09635a177a35cb6d68cfad8bc2))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
# [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)
|
29
|
+
|
30
|
+
**Note:** Version bump only for package @pingux/astro
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
6
36
|
# [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)
|
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
|
});
|
@@ -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"],
|
@@ -8,16 +8,20 @@ _Object$defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
|
11
|
-
exports.Disabled = exports.isOpen = exports.withDelayProp = exports.withDirectionProp = exports.withAlignProp = exports.Default = exports["default"] = void 0;
|
11
|
+
exports.TextWithTooltip = exports.ChipWithTooltip = exports.IconWithTooltip = exports.Disabled = exports.isOpen = exports.withDelayProp = exports.withDirectionProp = exports.withAlignProp = exports.Default = exports["default"] = void 0;
|
12
12
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
14
14
|
|
15
15
|
var _EarthIcon = _interopRequireDefault(require("mdi-react/EarthIcon"));
|
16
16
|
|
17
|
+
var _PersonIcon = _interopRequireDefault(require("mdi-react/PersonIcon"));
|
18
|
+
|
17
19
|
var _index = require("../../index");
|
18
20
|
|
19
21
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
20
22
|
|
23
|
+
var _Text = _interopRequireDefault(require("../Text"));
|
24
|
+
|
21
25
|
var _react2 = require("@emotion/react");
|
22
26
|
|
23
27
|
var _default = {
|
@@ -80,4 +84,43 @@ Disabled.parameters = {
|
|
80
84
|
story: 'The tooltip can be disabled without disabling the button press events.'
|
81
85
|
}
|
82
86
|
}
|
83
|
-
};
|
87
|
+
};
|
88
|
+
|
89
|
+
var IconWithTooltip = function IconWithTooltip() {
|
90
|
+
return (0, _react2.jsx)(_index.Box, {
|
91
|
+
pl: 50
|
92
|
+
}, (0, _react2.jsx)(_index.TooltipTrigger, null, (0, _react2.jsx)(_IconButton["default"], {
|
93
|
+
variant: "tooltipIconButton"
|
94
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
95
|
+
icon: _PersonIcon["default"]
|
96
|
+
})), (0, _react2.jsx)(_index.Tooltip, null, "Useful tooltip")));
|
97
|
+
};
|
98
|
+
|
99
|
+
exports.IconWithTooltip = IconWithTooltip;
|
100
|
+
|
101
|
+
var ChipWithTooltip = function ChipWithTooltip() {
|
102
|
+
return (0, _react2.jsx)(_index.Box, {
|
103
|
+
pl: 50
|
104
|
+
}, (0, _react2.jsx)(_index.TooltipTrigger, null, (0, _react2.jsx)(_index.Button, {
|
105
|
+
variant: "tooltipChip",
|
106
|
+
bg: "neutral.10"
|
107
|
+
}, (0, _react2.jsx)(_Text["default"], {
|
108
|
+
variant: "label",
|
109
|
+
sx: {
|
110
|
+
textTransform: 'uppercase'
|
111
|
+
},
|
112
|
+
color: "white"
|
113
|
+
}, "Some text")), (0, _react2.jsx)(_index.Tooltip, null, "Useful tooltip")));
|
114
|
+
};
|
115
|
+
|
116
|
+
exports.ChipWithTooltip = ChipWithTooltip;
|
117
|
+
|
118
|
+
var TextWithTooltip = function TextWithTooltip() {
|
119
|
+
return (0, _react2.jsx)(_index.Box, {
|
120
|
+
pl: 50
|
121
|
+
}, (0, _react2.jsx)(_index.TooltipTrigger, null, (0, _react2.jsx)(_index.Button, {
|
122
|
+
variant: "tooltipInline"
|
123
|
+
}, "Some text"), (0, _react2.jsx)(_index.Tooltip, null, "Useful tooltip")));
|
124
|
+
};
|
125
|
+
|
126
|
+
exports.TextWithTooltip = TextWithTooltip;
|