@pingux/astro 1.0.0-alpha.15 → 1.0.0-alpha.19

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 CHANGED
@@ -3,6 +3,50 @@
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.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
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * [UIP-4996] astro stepper redundant tooltip ([d74f102](https://gitlab.corp.pingidentity.com/ux/pingux/commit/d74f1020163703948498436224ef3f9d6458df57))
12
+
13
+
14
+
15
+
16
+
17
+ # [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * [UIP-5107] IconButton - no focus in disabled state ([f301f6d](https://gitlab.corp.pingidentity.com/ux/pingux/commit/f301f6d0cdc8271c992eb3384094cafbd59fa0d5))
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * [UIP-4997] Read only style TextAreaField ([a5f62bd](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a5f62bd014f2d3d75c2c71625bc31ba5cefbb4df))
34
+
35
+
36
+
37
+
38
+
39
+ # [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)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * [UIP-4962] accordion grid design improvements ([dcec402](https://gitlab.corp.pingidentity.com/ux/pingux/commit/dcec4025f945968e20386bc20ad011f48532acc7))
45
+
46
+
47
+
48
+
49
+
6
50
  # [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)
7
51
 
8
52
  **Note:** Version bump only for package @pingux/astro
@@ -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
- }, others, (0, _utils.mergeProps)(hoverProps, focusProps, pressProps)), children);
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 () {
@@ -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);
@@ -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 = {
@@ -152,6 +152,10 @@ input.container = (_input$container = {
152
152
  backgroundColor: 'accent.95',
153
153
  border: 'none'
154
154
  },
155
+ '> textarea': {
156
+ backgroundColor: 'accent.95',
157
+ border: 'none'
158
+ },
155
159
  '&:after': {
156
160
  display: 'none'
157
161
  }
@@ -37,10 +37,10 @@ var accordionBody = {
37
37
  var accordionGridHeader = {
38
38
  cursor: 'pointer',
39
39
  lineHeight: '30px',
40
- px: 'md',
40
+ pl: 'sm',
41
41
  outline: 'none',
42
42
  display: 'flex',
43
- justifyContent: 'flex-start',
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
- padding: '0px',
57
+ minHeight: '64px',
58
58
  '&.is-hovered': {
59
- color: 'active',
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, usePress } from '@react-aria/interactions';
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
- }, others, mergeProps(hoverProps, focusProps, pressProps)), children);
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 () {
@@ -89,6 +89,7 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
89
89
  },
90
90
  textValue: textValue,
91
91
  title: step,
92
+ "aria-label": textValue,
92
93
  content: item.rendered,
93
94
  separator: !isFirst && line
94
95
  });
@@ -33,7 +33,8 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
33
33
  tabLabelProps = itemProps.tabLabelProps,
34
34
  tabLineProps = itemProps.tabLineProps,
35
35
  content = itemProps.content,
36
- otherItemProps = _objectWithoutProperties(itemProps, ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content"]);
36
+ titleAttr = itemProps.titleAttr,
37
+ otherItemProps = _objectWithoutProperties(itemProps, ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr"]);
37
38
 
38
39
  var state = useContext(TabsContext);
39
40
  var isDisabled = tabsDisabled || tabDisabled || state.disabledKeys.has(key);
@@ -77,7 +78,8 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
77
78
  className: classNames,
78
79
  variant: "tab"
79
80
  }, mergeProps(focusProps, hoverProps, tabProps), otherItemProps, {
80
- ref: tabRef
81
+ ref: tabRef,
82
+ title: titleAttr || undefined
81
83
  }), icon, ___EmotionJSX(Text, _extends({
82
84
  variant: "tabLabel"
83
85
  }, tabLabelProps), rendered), isSelected && !isDisabled && ___EmotionJSX(TabLine, tabLineProps)), slots === null || slots === void 0 ? void 0 : slots.afterTab);
@@ -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 = {
@@ -128,6 +128,10 @@ input.container = (_input$container = {
128
128
  backgroundColor: 'accent.95',
129
129
  border: 'none'
130
130
  },
131
+ '> textarea': {
132
+ backgroundColor: 'accent.95',
133
+ border: 'none'
134
+ },
131
135
  '&:after': {
132
136
  display: 'none'
133
137
  }
@@ -28,10 +28,10 @@ var accordionBody = {
28
28
  var accordionGridHeader = {
29
29
  cursor: 'pointer',
30
30
  lineHeight: '30px',
31
- px: 'md',
31
+ pl: 'sm',
32
32
  outline: 'none',
33
33
  display: 'flex',
34
- justifyContent: 'flex-start',
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
- padding: '0px',
48
+ minHeight: '64px',
49
49
  '&.is-hovered': {
50
- color: 'active',
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'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.19",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "uxdev@pingidentity.com",
6
6
  "license": "Apache-2.0",