@pingux/astro 1.0.0-alpha.13 → 1.0.0-alpha.17

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,47 @@
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.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
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * [UIP-4997] Read only style TextAreaField ([a5f62bd](https://gitlab.corp.pingidentity.com/ux/pingux/commit/a5f62bd014f2d3d75c2c71625bc31ba5cefbb4df))
12
+
13
+
14
+
15
+
16
+
17
+ # [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * [UIP-4962] accordion grid design improvements ([dcec402](https://gitlab.corp.pingidentity.com/ux/pingux/commit/dcec4025f945968e20386bc20ad011f48532acc7))
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+ **Note:** Version bump only for package @pingux/astro
31
+
32
+
33
+
34
+
35
+
36
+ # [1.0.0-alpha.14](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.13...@pingux/astro@1.0.0-alpha.14) (2022-01-10)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * [UIP-4953] Chip component cleanup ([d2f10ec](https://gitlab.corp.pingidentity.com/ux/pingux/commit/d2f10ece82749d723ac35b6262c1b918f81abba1))
42
+
43
+
44
+
45
+
46
+
6
47
  # [1.0.0-alpha.13](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.0.0-alpha.12...@pingux/astro@1.0.0-alpha.13) (2022-01-10)
7
48
 
8
49
 
package/README.md CHANGED
@@ -12,6 +12,11 @@ NPM:
12
12
  Yarn:
13
13
  `yarn add @pingux/astro`
14
14
 
15
+ ## Requirements
16
+
17
+ - Node: 12+
18
+ - React: 16.8+
19
+
15
20
  ## Usage
16
21
 
17
22
  All apps should be wrapped in an <AstroWrapper> for full functionality and styling.
@@ -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
  }))
@@ -18,6 +18,8 @@ var _react = _interopRequireDefault(require("react"));
18
18
 
19
19
  var _propTypes = _interopRequireDefault(require("prop-types"));
20
20
 
21
+ var _ChipContext = require("./ChipContext");
22
+
21
23
  var _Box = _interopRequireDefault(require("../Box/Box"));
22
24
 
23
25
  var _Text = _interopRequireDefault(require("../Text/Text"));
@@ -32,21 +34,31 @@ var _react2 = require("@emotion/react");
32
34
  * available [props from Theme-UI](https://theme-ui.com/sx-prop).
33
35
  */
34
36
  var Chip = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
35
- var children = props.children,
37
+ var bg = props.bg,
38
+ children = props.children,
36
39
  textColor = props.textColor,
37
40
  textProps = props.textProps,
38
- label = props.label;
39
- return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
41
+ label = props.label,
42
+ isUppercase = props.isUppercase;
43
+ return (0, _react2.jsx)(_ChipContext.ChipContext.Provider, {
44
+ value: {
45
+ bg: bg
46
+ }
47
+ }, (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
40
48
  isRow: true,
41
49
  variant: "boxes.chip",
50
+ sx: isUppercase && {
51
+ paddingBottom: '3px'
52
+ },
42
53
  ref: ref
43
54
  }, props), (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({
44
55
  variant: "label",
45
- sx: {
46
- textTransform: 'uppercase'
47
- },
48
- color: textColor
49
- }, textProps), label), children);
56
+ color: textColor,
57
+ sx: isUppercase && {
58
+ textTransform: 'uppercase',
59
+ fontSize: '11px'
60
+ }
61
+ }, textProps), label), children));
50
62
  });
51
63
 
52
64
  Chip.propTypes = {
@@ -60,11 +72,15 @@ Chip.propTypes = {
60
72
  label: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
61
73
 
62
74
  /** Props object that is spread directly into the textfield. */
63
- textProps: _propTypes["default"].shape({})
75
+ textProps: _propTypes["default"].shape({}),
76
+
77
+ /** When true, display chip label as uppercase. */
78
+ isUppercase: _propTypes["default"].bool
64
79
  };
65
80
  Chip.defaultProps = {
66
81
  textColor: 'white',
67
- bg: colors.neutral[10]
82
+ bg: colors.neutral[10],
83
+ isUppercase: false
68
84
  };
69
85
  var _default = Chip;
70
86
  exports["default"] = _default;
@@ -20,9 +20,15 @@ var _react = _interopRequireDefault(require("react"));
20
20
 
21
21
  var _CloseIcon = _interopRequireDefault(require("mdi-react/CloseIcon"));
22
22
 
23
- var _Chip = _interopRequireDefault(require("../Chip/Chip"));
23
+ var _ContentCopyIcon = _interopRequireDefault(require("mdi-react/ContentCopyIcon"));
24
24
 
25
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
25
+ var _EarthIcon = _interopRequireDefault(require("mdi-react/EarthIcon"));
26
+
27
+ var _Chip = _interopRequireDefault(require("../Chip"));
28
+
29
+ var _Icon = _interopRequireDefault(require("../Icon"));
30
+
31
+ var _IconButton = _interopRequireDefault(require("../IconButton"));
26
32
 
27
33
  var _colors = require("../../styles/colors.js");
28
34
 
@@ -61,6 +67,12 @@ var _default = {
61
67
  control: {
62
68
  type: 'text'
63
69
  }
70
+ },
71
+ isUppercase: {
72
+ defaultValue: false,
73
+ control: {
74
+ type: 'boolean'
75
+ }
64
76
  }
65
77
  }
66
78
  };
@@ -87,15 +99,42 @@ var ChipWithCustomColors = function ChipWithCustomColors() {
87
99
  exports.ChipWithCustomColors = ChipWithCustomColors;
88
100
 
89
101
  var ChipWithIcon = function ChipWithIcon() {
90
- return (0, _react2.jsx)(_Chip["default"], {
91
- label: "Chip with Icon",
102
+ return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_Chip["default"], {
103
+ label: "Chip with Icon Button",
92
104
  bg: "navy"
105
+ }, (0, _react2.jsx)(_IconButton["default"], {
106
+ "aria-label": "Clear Chip with Icon Button",
107
+ variant: "inverted"
93
108
  }, (0, _react2.jsx)(_Icon["default"], {
94
109
  icon: _CloseIcon["default"],
95
110
  ml: "xs",
111
+ size: "14px"
112
+ }))), (0, _react2.jsx)("div", {
113
+ style: {
114
+ padding: '5px'
115
+ }
116
+ }), (0, _react2.jsx)(_Chip["default"], {
117
+ label: "Chip with Icon Button"
118
+ }, (0, _react2.jsx)(_IconButton["default"], {
119
+ "aria-label": "Clear Chip with Icon Button",
120
+ variant: "inverted"
121
+ }, (0, _react2.jsx)(_Icon["default"], {
122
+ icon: _EarthIcon["default"],
123
+ ml: "xs",
124
+ size: "14px"
125
+ }))), (0, _react2.jsx)("div", {
126
+ style: {
127
+ padding: '5px'
128
+ }
129
+ }), (0, _react2.jsx)(_Chip["default"], {
130
+ label: "Chip with Icon",
131
+ bg: "green"
132
+ }, (0, _react2.jsx)(_Icon["default"], {
133
+ icon: _ContentCopyIcon["default"],
134
+ ml: "xs",
96
135
  size: "14px",
97
136
  color: "white"
98
- }));
137
+ })));
99
138
  };
100
139
 
101
140
  exports.ChipWithIcon = ChipWithIcon;
@@ -45,4 +45,13 @@ test('renders children within Chip component', function () {
45
45
  var mockedChildren = _react2.screen.getByRole('button');
46
46
 
47
47
  expect(mockedChildren).toBeInTheDocument();
48
+ });
49
+ test('renders Chip component with uppercase', function () {
50
+ var label = 'uppercase';
51
+ var isUppercase = true;
52
+ getComponent({
53
+ label: label,
54
+ isUppercase: isUppercase
55
+ });
56
+ expect(_react2.screen.queryByText('uppercase')).toHaveStyleRule('text-transform', 'uppercase');
48
57
  });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
5
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
+
7
+ _Object$defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+
11
+ exports.ChipContext = void 0;
12
+
13
+ var _react = _interopRequireDefault(require("react"));
14
+
15
+ var defaultValue = 'inherit';
16
+
17
+ var ChipContext = /*#__PURE__*/_react["default"].createContext(defaultValue);
18
+
19
+ exports.ChipContext = ChipContext;
@@ -48,6 +48,8 @@ var _utils = require("@react-aria/utils");
48
48
 
49
49
  var _hooks = require("../../hooks");
50
50
 
51
+ var _ChipContext = require("../Chip/ChipContext");
52
+
51
53
  var _TooltipTrigger = _interopRequireWildcard(require("../TooltipTrigger"));
52
54
 
53
55
  var _react2 = require("@emotion/react");
@@ -82,6 +84,9 @@ var IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
82
84
  return buttonRef.current;
83
85
  });
84
86
 
87
+ var _useContext = (0, _react.useContext)(_ChipContext.ChipContext),
88
+ chipBg = _useContext.bg;
89
+
85
90
  var _usePress = (0, _interactions.usePress)(_objectSpread({
86
91
  ref: buttonRef
87
92
  }, props)),
@@ -110,7 +115,12 @@ var IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
110
115
  tabIndex: 0,
111
116
  ref: buttonRef,
112
117
  className: classNames,
113
- "aria-label": ariaLabel || 'Icon Button'
118
+ "aria-label": ariaLabel || 'Icon Button',
119
+ sx: chipBg && isHovered && {
120
+ 'path': {
121
+ fill: chipBg
122
+ }
123
+ }
114
124
  }, others, (0, _utils.mergeProps)(hoverProps, focusProps, pressProps)), children);
115
125
 
116
126
  if (title) {
@@ -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 = {
@@ -301,7 +301,8 @@ var Default = function Default() {
301
301
  }, (0, _react2.jsx)(_index.Chip, {
302
302
  bg: "success.light",
303
303
  textColor: "success.dark",
304
- label: "New"
304
+ label: "New",
305
+ isUppercase: true
305
306
  })) : null)), (0, _react2.jsx)(_index.Box, {
306
307
  isRow: true,
307
308
  alignSelf: "center"
@@ -52,7 +52,7 @@ var Default = function Default() {
52
52
  }, (0, _react2.jsx)(_Icon["default"], {
53
53
  icon: _LinkVariantIcon["default"],
54
54
  color: "#253746",
55
- size: 15,
55
+ size: 12,
56
56
  alignSelf: "center",
57
57
  mr: "xs"
58
58
  }), (0, _react2.jsx)(_Text["default"], {
@@ -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'
@@ -123,14 +123,27 @@ var listBoxSectionTitle = {
123
123
  };
124
124
  var chip = {
125
125
  cursor: 'pointer',
126
- height: '15px',
127
- p: '10px',
126
+ p: '3px 5px 4px 5px',
128
127
  alignItems: 'center',
129
128
  justifyContent: 'center',
130
129
  minWidth: '50px',
131
130
  alignSelf: 'flex-start',
132
131
  display: 'inline-flex !important',
133
- borderRadius: '5px'
132
+ borderRadius: '5px',
133
+ fontWeight: 1,
134
+ '& button': {
135
+ backgroundColor: 'transparent',
136
+ marginLeft: 'xs',
137
+ marginTop: '1px',
138
+ padding: '0',
139
+ '&.is-hovered': {
140
+ backgroundColor: 'white'
141
+ },
142
+ '& .mdi-icon': {
143
+ marginLeft: '0',
144
+ padding: '2px'
145
+ }
146
+ }
134
147
  };
135
148
  var inputInContainerSlot = {
136
149
  position: 'absolute',
@@ -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
  }))
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
+ import { ChipContext } from './ChipContext';
4
5
  import Box from '../Box/Box';
5
6
  import Text from '../Text/Text';
6
7
  import * as colors from '../../styles/colors';
@@ -12,21 +13,31 @@ import * as colors from '../../styles/colors';
12
13
 
13
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
14
15
  var Chip = /*#__PURE__*/React.forwardRef(function (props, ref) {
15
- var children = props.children,
16
+ var bg = props.bg,
17
+ children = props.children,
16
18
  textColor = props.textColor,
17
19
  textProps = props.textProps,
18
- label = props.label;
19
- return ___EmotionJSX(Box, _extends({
20
+ label = props.label,
21
+ isUppercase = props.isUppercase;
22
+ return ___EmotionJSX(ChipContext.Provider, {
23
+ value: {
24
+ bg: bg
25
+ }
26
+ }, ___EmotionJSX(Box, _extends({
20
27
  isRow: true,
21
28
  variant: "boxes.chip",
29
+ sx: isUppercase && {
30
+ paddingBottom: '3px'
31
+ },
22
32
  ref: ref
23
33
  }, props), ___EmotionJSX(Text, _extends({
24
34
  variant: "label",
25
- sx: {
26
- textTransform: 'uppercase'
27
- },
28
- color: textColor
29
- }, textProps), label), children);
35
+ color: textColor,
36
+ sx: isUppercase && {
37
+ textTransform: 'uppercase',
38
+ fontSize: '11px'
39
+ }
40
+ }, textProps), label), children));
30
41
  });
31
42
  Chip.propTypes = {
32
43
  /** The text color of the chip. */
@@ -39,10 +50,14 @@ Chip.propTypes = {
39
50
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
40
51
 
41
52
  /** Props object that is spread directly into the textfield. */
42
- textProps: PropTypes.shape({})
53
+ textProps: PropTypes.shape({}),
54
+
55
+ /** When true, display chip label as uppercase. */
56
+ isUppercase: PropTypes.bool
43
57
  };
44
58
  Chip.defaultProps = {
45
59
  textColor: 'white',
46
- bg: colors.neutral[10]
60
+ bg: colors.neutral[10],
61
+ isUppercase: false
47
62
  };
48
63
  export default Chip;
@@ -3,8 +3,11 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
3
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
4
4
  import React from 'react';
5
5
  import Clear from 'mdi-react/CloseIcon';
6
- import Chip from '../Chip/Chip';
7
- import Icon from '../Icon/Icon';
6
+ import ContentCopy from 'mdi-react/ContentCopyIcon';
7
+ import Earth from 'mdi-react/EarthIcon';
8
+ import Chip from '../Chip';
9
+ import Icon from '../Icon';
10
+ import IconButton from '../IconButton';
8
11
  import { flatColorList } from '../../styles/colors.js';
9
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
13
  export default {
@@ -40,6 +43,12 @@ export default {
40
43
  control: {
41
44
  type: 'text'
42
45
  }
46
+ },
47
+ isUppercase: {
48
+ defaultValue: false,
49
+ control: {
50
+ type: 'boolean'
51
+ }
43
52
  }
44
53
  }
45
54
  };
@@ -59,13 +68,40 @@ export var ChipWithCustomColors = function ChipWithCustomColors() {
59
68
  });
60
69
  };
61
70
  export var ChipWithIcon = function ChipWithIcon() {
62
- return ___EmotionJSX(Chip, {
63
- label: "Chip with Icon",
71
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Chip, {
72
+ label: "Chip with Icon Button",
64
73
  bg: "navy"
74
+ }, ___EmotionJSX(IconButton, {
75
+ "aria-label": "Clear Chip with Icon Button",
76
+ variant: "inverted"
65
77
  }, ___EmotionJSX(Icon, {
66
78
  icon: Clear,
67
79
  ml: "xs",
80
+ size: "14px"
81
+ }))), ___EmotionJSX("div", {
82
+ style: {
83
+ padding: '5px'
84
+ }
85
+ }), ___EmotionJSX(Chip, {
86
+ label: "Chip with Icon Button"
87
+ }, ___EmotionJSX(IconButton, {
88
+ "aria-label": "Clear Chip with Icon Button",
89
+ variant: "inverted"
90
+ }, ___EmotionJSX(Icon, {
91
+ icon: Earth,
92
+ ml: "xs",
93
+ size: "14px"
94
+ }))), ___EmotionJSX("div", {
95
+ style: {
96
+ padding: '5px'
97
+ }
98
+ }), ___EmotionJSX(Chip, {
99
+ label: "Chip with Icon",
100
+ bg: "green"
101
+ }, ___EmotionJSX(Icon, {
102
+ icon: ContentCopy,
103
+ ml: "xs",
68
104
  size: "14px",
69
105
  color: "white"
70
- }));
106
+ })));
71
107
  };
@@ -31,4 +31,13 @@ test('renders children within Chip component', function () {
31
31
  });
32
32
  var mockedChildren = screen.getByRole('button');
33
33
  expect(mockedChildren).toBeInTheDocument();
34
+ });
35
+ test('renders Chip component with uppercase', function () {
36
+ var label = 'uppercase';
37
+ var isUppercase = true;
38
+ getComponent({
39
+ label: label,
40
+ isUppercase: isUppercase
41
+ });
42
+ expect(screen.queryByText('uppercase')).toHaveStyleRule('text-transform', 'uppercase');
34
43
  });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ var defaultValue = 'inherit';
3
+ export var ChipContext = /*#__PURE__*/React.createContext(defaultValue);
@@ -14,13 +14,14 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
14
14
 
15
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
16
 
17
- import React, { forwardRef, useRef, useImperativeHandle } from 'react';
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
20
  import { useFocusRing } from '@react-aria/focus';
21
21
  import { Pressable, useHover, usePress } from '@react-aria/interactions';
22
22
  import { mergeProps } from '@react-aria/utils';
23
23
  import { useAriaLabelWarning, useStatusClasses } from '../../hooks';
24
+ import { ChipContext } from '../Chip/ChipContext';
24
25
  import TooltipTrigger, { Tooltip } from '../TooltipTrigger';
25
26
  /**
26
27
  * Convenience wrapper for a Button + Icon. This component applies specific styles necessary for
@@ -51,6 +52,9 @@ var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
51
52
  return buttonRef.current;
52
53
  });
53
54
 
55
+ var _useContext = useContext(ChipContext),
56
+ chipBg = _useContext.bg;
57
+
54
58
  var _usePress = usePress(_objectSpread({
55
59
  ref: buttonRef
56
60
  }, props)),
@@ -80,7 +84,12 @@ var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
80
84
  tabIndex: 0,
81
85
  ref: buttonRef,
82
86
  className: classNames,
83
- "aria-label": ariaLabel || 'Icon Button'
87
+ "aria-label": ariaLabel || 'Icon Button',
88
+ sx: chipBg && isHovered && {
89
+ 'path': {
90
+ fill: chipBg
91
+ }
92
+ }
84
93
  }, others, mergeProps(hoverProps, focusProps, pressProps)), children);
85
94
 
86
95
  if (title) {
@@ -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 = {
@@ -274,7 +274,8 @@ export var Default = function Default() {
274
274
  }, ___EmotionJSX(Chip, {
275
275
  bg: "success.light",
276
276
  textColor: "success.dark",
277
- label: "New"
277
+ label: "New",
278
+ isUppercase: true
278
279
  })) : null)), ___EmotionJSX(Box, {
279
280
  isRow: true,
280
281
  alignSelf: "center"
@@ -30,7 +30,7 @@ export var Default = function Default() {
30
30
  }, ___EmotionJSX(Icon, {
31
31
  icon: Link,
32
32
  color: "#253746",
33
- size: 15,
33
+ size: 12,
34
34
  alignSelf: "center",
35
35
  mr: "xs"
36
36
  }), ___EmotionJSX(Text, {
@@ -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'
@@ -102,14 +102,27 @@ var listBoxSectionTitle = {
102
102
  };
103
103
  var chip = {
104
104
  cursor: 'pointer',
105
- height: '15px',
106
- p: '10px',
105
+ p: '3px 5px 4px 5px',
107
106
  alignItems: 'center',
108
107
  justifyContent: 'center',
109
108
  minWidth: '50px',
110
109
  alignSelf: 'flex-start',
111
110
  display: 'inline-flex !important',
112
- borderRadius: '5px'
111
+ borderRadius: '5px',
112
+ fontWeight: 1,
113
+ '& button': {
114
+ backgroundColor: 'transparent',
115
+ marginLeft: 'xs',
116
+ marginTop: '1px',
117
+ padding: '0',
118
+ '&.is-hovered': {
119
+ backgroundColor: 'white'
120
+ },
121
+ '& .mdi-icon': {
122
+ marginLeft: '0',
123
+ padding: '2px'
124
+ }
125
+ }
113
126
  };
114
127
  var inputInContainerSlot = {
115
128
  position: 'absolute',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "uxdev@pingidentity.com",
6
6
  "license": "Apache-2.0",