@pingux/astro 1.0.0-alpha.18 → 1.0.0-alpha.21

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/lib/cjs/components/Button/Button.js +5 -24
  3. package/lib/cjs/components/Button/Button.test.js +0 -24
  4. package/lib/cjs/components/ListItem/ListItem.stories.js +0 -2
  5. package/lib/cjs/components/Stepper/Stepper.js +1 -0
  6. package/lib/cjs/components/Tab/Tab.js +4 -2
  7. package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +45 -2
  8. package/lib/cjs/index.js +48 -136
  9. package/lib/cjs/layouts/SchemaFormLayout.stories.js +2 -21
  10. package/lib/cjs/recipes/ArrayField.stories.js +3 -3
  11. package/lib/cjs/styles/theme.js +0 -3
  12. package/lib/cjs/styles/variants/boxes.js +2 -16
  13. package/lib/cjs/styles/variants/buttons.js +37 -28
  14. package/lib/cjs/styles/variants/variants.js +0 -3
  15. package/lib/components/Button/Button.js +7 -24
  16. package/lib/components/Button/Button.test.js +0 -20
  17. package/lib/components/ListItem/ListItem.stories.js +0 -2
  18. package/lib/components/Stepper/Stepper.js +1 -0
  19. package/lib/components/Tab/Tab.js +4 -2
  20. package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +33 -1
  21. package/lib/index.js +0 -8
  22. package/lib/layouts/SchemaFormLayout.stories.js +2 -19
  23. package/lib/recipes/ArrayField.stories.js +3 -3
  24. package/lib/styles/theme.js +0 -3
  25. package/lib/styles/variants/boxes.js +1 -16
  26. package/lib/styles/variants/buttons.js +36 -28
  27. package/lib/styles/variants/variants.js +0 -2
  28. package/package.json +1 -1
  29. package/lib/cjs/components/Dropdown/Dropdown.js +0 -112
  30. package/lib/cjs/components/Dropdown/Dropdown.test.js +0 -80
  31. package/lib/cjs/components/Dropdown/index.js +0 -18
  32. package/lib/cjs/components/DropdownField/DropdownField.js +0 -187
  33. package/lib/cjs/components/DropdownField/DropdownField.stories.js +0 -278
  34. package/lib/cjs/components/DropdownField/DropdownField.test.js +0 -80
  35. package/lib/cjs/components/DropdownField/index.js +0 -18
  36. package/lib/cjs/components/Panel/Panel.js +0 -101
  37. package/lib/cjs/components/Panel/Panel.stories.js +0 -57
  38. package/lib/cjs/components/Panel/Panel.test.js +0 -72
  39. package/lib/cjs/components/Panel/index.js +0 -18
  40. package/lib/cjs/components/Popover/Popover.js +0 -87
  41. package/lib/cjs/components/Popover/Popover.stories.js +0 -80
  42. package/lib/cjs/components/Popover/Popover.test.js +0 -91
  43. package/lib/cjs/components/Popover/index.js +0 -18
  44. package/lib/cjs/recipes/InputBoxWithLinkedChip.stories.js +0 -67
  45. package/lib/cjs/styles/variants/popover.js +0 -86
  46. package/lib/components/Dropdown/Dropdown.js +0 -90
  47. package/lib/components/Dropdown/Dropdown.test.js +0 -62
  48. package/lib/components/Dropdown/index.js +0 -1
  49. package/lib/components/DropdownField/DropdownField.js +0 -155
  50. package/lib/components/DropdownField/DropdownField.stories.js +0 -222
  51. package/lib/components/DropdownField/DropdownField.test.js +0 -60
  52. package/lib/components/DropdownField/index.js +0 -1
  53. package/lib/components/Panel/Panel.js +0 -71
  54. package/lib/components/Panel/Panel.stories.js +0 -35
  55. package/lib/components/Panel/Panel.test.js +0 -52
  56. package/lib/components/Panel/index.js +0 -1
  57. package/lib/components/Popover/Popover.js +0 -65
  58. package/lib/components/Popover/Popover.stories.js +0 -52
  59. package/lib/components/Popover/Popover.test.js +0 -75
  60. package/lib/components/Popover/index.js +0 -2
  61. package/lib/recipes/InputBoxWithLinkedChip.stories.js +0 -43
  62. 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.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)
7
+
8
+
9
+ ### Features
10
+
11
+ * [UIP-5066] Add Icon, Chip, and Text with Tooltips ([1681083](https://gitlab.corp.pingidentity.com/ux/pingux/commit/168108386d77ef09635a177a35cb6d68cfad8bc2))
12
+
13
+
14
+
15
+
16
+
17
+ # [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)
18
+
19
+ **Note:** Version bump only for package @pingux/astro
20
+
21
+
22
+
23
+
24
+
25
+ # [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)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * [UIP-4996] astro stepper redundant tooltip ([d74f102](https://gitlab.corp.pingidentity.com/ux/pingux/commit/d74f1020163703948498436224ef3f9d6458df57))
31
+
32
+
33
+
34
+
35
+
6
36
  # [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
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
- mode = props.mode,
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: 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)(ButtonBase, (0, _extends2["default"])({
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"],
@@ -119,6 +119,7 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
119
119
  },
120
120
  textValue: textValue,
121
121
  title: step,
122
+ "aria-label": textValue,
122
123
  content: item.rendered,
123
124
  separator: !isFirst && line
124
125
  });
@@ -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
- otherItemProps = (0, _objectWithoutProperties2["default"])(itemProps, ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content"]);
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);
@@ -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;