@pingux/astro 2.140.0 → 2.141.0-alpha.0

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.
@@ -40,7 +40,8 @@ var Card = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
40
40
  onPressEnd = props.onPressEnd,
41
41
  onPressChange = props.onPressChange,
42
42
  onPressUp = props.onPressUp,
43
- isInteractiveWithin = props.isInteractiveWithin,
43
+ _props$isInteractiveW = props.isInteractiveWithin,
44
+ isInteractiveWithin = _props$isInteractiveW === void 0 ? true : _props$isInteractiveW,
44
45
  isSelected = props.isSelected,
45
46
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
46
47
  var cardRef = (0, _hooks.useLocalOrForwardRef)(ref);
@@ -77,8 +78,6 @@ var Card = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
77
78
  }),
78
79
  classNames = _useStatusClasses.classNames;
79
80
  var ariaLabel = props['aria-label'];
80
-
81
- // TODO: [Astro 3.0.0] Update isInteractiveWithin[default] for this prop to true
82
81
  var mergedProps = (0, _utils.mergeProps)(others, focusWithinProps, !isInteractiveWithin ? _objectSpread(_objectSpread(_objectSpread({}, pressProps), hoverProps), focusProps) : {});
83
82
  return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
84
83
  "aria-label": ariaLabel,
@@ -33,4 +33,4 @@ export declare const InteractiveCard: {
33
33
  };
34
34
  };
35
35
  export declare const WithInteractiveContent: (args: any) => React.JSX.Element;
36
- export declare const ActiveCard: (args: any) => React.JSX.Element;
36
+ export declare const RadioGroupCard: (args: any) => React.JSX.Element;
@@ -12,7 +12,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
12
12
  _Object$defineProperty(exports, "__esModule", {
13
13
  value: true
14
14
  });
15
- exports["default"] = exports.WithInteractiveContent = exports.InteractiveCard = exports.HeaderAndFooter = exports.Default = exports.CardWidth = exports.CardRow = exports.ActiveCard = void 0;
15
+ exports["default"] = exports.WithInteractiveContent = exports.RadioGroupCard = exports.InteractiveCard = exports.HeaderAndFooter = exports.Default = exports.CardWidth = exports.CardRow = void 0;
16
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
17
17
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
18
18
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
@@ -56,8 +56,7 @@ Default.parameters = {
56
56
  var HeaderAndFooter = function HeaderAndFooter(args) {
57
57
  var textStyling = {
58
58
  fontSize: 'md',
59
- fontWeight: 600,
60
- color: 'text.secondary'
59
+ fontWeight: 600
61
60
  };
62
61
  return (0, _react2.jsx)(_index.Card, (0, _extends2["default"])({}, args, {
63
62
  variant: "cards.flat",
@@ -163,7 +162,8 @@ var InteractiveCard = function InteractiveCard(args) {
163
162
  },
164
163
  tabIndex: "0",
165
164
  variant: "cards.interactive",
166
- sx: sx
165
+ sx: sx,
166
+ isInteractiveWithin: false
167
167
  }), "Interactive Card");
168
168
  };
169
169
  exports.InteractiveCard = InteractiveCard;
@@ -183,7 +183,7 @@ var WithInteractiveContent = function WithInteractiveContent(args) {
183
183
  }));
184
184
  };
185
185
  exports.WithInteractiveContent = WithInteractiveContent;
186
- var ActiveCard = function ActiveCard(args) {
186
+ var RadioGroupCard = function RadioGroupCard(args) {
187
187
  var sx = {
188
188
  alignContent: 'center',
189
189
  height: '221px',
@@ -202,7 +202,8 @@ var ActiveCard = function ActiveCard(args) {
202
202
  isSelected: isSelected,
203
203
  onPress: function onPress() {
204
204
  return setIsSelected(!isSelected);
205
- }
205
+ },
206
+ isInteractiveWithin: false
206
207
  }), "Active Card");
207
208
  };
208
- exports.ActiveCard = ActiveCard;
209
+ exports.RadioGroupCard = RadioGroupCard;
@@ -57,7 +57,8 @@ test('card allows hover, focus, and press events', function () {
57
57
  getComponent({
58
58
  children: children,
59
59
  onPress: onPress,
60
- tabIndex: 0
60
+ tabIndex: 0,
61
+ isInteractiveWithin: false
61
62
  });
62
63
  var card = _react2.screen.getByTestId(testId);
63
64
  expect(card).not.toHaveClass('is-hovered');
@@ -7,6 +7,7 @@ _Object$defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
10
11
  var _react = _interopRequireDefault(require("react"));
11
12
  var _ChevronLeftIcon = _interopRequireDefault(require("@pingux/mdi-react/ChevronLeftIcon"));
12
13
  var _ChevronRightIcon = _interopRequireDefault(require("@pingux/mdi-react/ChevronRightIcon"));
@@ -14,6 +15,7 @@ var _i18n = require("@react-aria/i18n");
14
15
  var _visuallyHidden = require("@react-aria/visually-hidden");
15
16
  var _index = require("../../index");
16
17
  var _react2 = require("@emotion/react");
18
+ var _excluded = ["onFocusChange"];
17
19
  var RangeCalendarHeader = function RangeCalendarHeader(props) {
18
20
  var state = props.state,
19
21
  calendarProps = props.calendarProps,
@@ -27,7 +29,19 @@ var RangeCalendarHeader = function RangeCalendarHeader(props) {
27
29
 
28
30
  // to remove warning for unknown event handler property `onFocusChange`.
29
31
  delete prevButtonProps.onFocusChange;
30
- delete nextButtonProps.onFocusChange;
32
+ // Removes warning without Safari losing Spectrum’s focus management
33
+ var onFocusChange = nextButtonProps.onFocusChange,
34
+ otherNextButtonProps = (0, _objectWithoutProperties2["default"])(nextButtonProps, _excluded);
35
+
36
+ /* istanbul ignore next */
37
+ var nextButtonFocusProps = {
38
+ onFocus: function onFocus() {
39
+ return onFocusChange === null || onFocusChange === void 0 ? void 0 : onFocusChange(true);
40
+ },
41
+ onBlur: function onBlur() {
42
+ return onFocusChange === null || onFocusChange === void 0 ? void 0 : onFocusChange(false);
43
+ }
44
+ };
31
45
  return (0, _react2.jsx)(_index.Box, {
32
46
  variant: "rangeCalendar.calendarHeaderContainer",
33
47
  isRow: true
@@ -71,7 +85,7 @@ var RangeCalendarHeader = function RangeCalendarHeader(props) {
71
85
  position: 'absolute',
72
86
  right: '10px'
73
87
  }
74
- }, (0, _react2.jsx)(_index.IconButton, (0, _extends2["default"])({}, nextButtonProps, {
88
+ }, (0, _react2.jsx)(_index.IconButton, (0, _extends2["default"])({}, otherNextButtonProps, nextButtonFocusProps, {
75
89
  "aria-label": "Next month navigation"
76
90
  }), (0, _react2.jsx)(_index.Icon, {
77
91
  icon: _ChevronRightIcon["default"],
@@ -3287,6 +3287,7 @@ declare const _default: {
3287
3287
  container: {
3288
3288
  p: string;
3289
3289
  borderColor: string;
3290
+ lineHeight: number;
3290
3291
  boxShadow: string;
3291
3292
  border: string;
3292
3293
  borderRadius: string;
@@ -3337,6 +3338,7 @@ declare const _default: {
3337
3338
  tableWrapper: {
3338
3339
  p: string;
3339
3340
  borderColor: string;
3341
+ lineHeight: number;
3340
3342
  boxShadow: string;
3341
3343
  border: string;
3342
3344
  borderRadius: string;
@@ -63,6 +63,7 @@ declare const _default: {
63
63
  container: {
64
64
  p: string;
65
65
  borderColor: string;
66
+ lineHeight: number;
66
67
  boxShadow: string;
67
68
  border: string;
68
69
  borderRadius: string;
@@ -113,6 +114,7 @@ declare const _default: {
113
114
  tableWrapper: {
114
115
  p: string;
115
116
  borderColor: string;
117
+ lineHeight: number;
116
118
  boxShadow: string;
117
119
  border: string;
118
120
  borderRadius: string;
@@ -37,7 +37,8 @@ var interactive = {
37
37
  };
38
38
  var container = _objectSpread(_objectSpread({}, _flatInstanceProperty(_Card)), {}, {
39
39
  p: 'lg',
40
- borderColor: 'border.base'
40
+ borderColor: 'border.base',
41
+ lineHeight: 1.6
41
42
  });
42
43
  var dark = _objectSpread(_objectSpread({}, _flatInstanceProperty(_Card)), {}, {
43
44
  border: 'none',
@@ -29,7 +29,8 @@ var Card = /*#__PURE__*/forwardRef(function (props, ref) {
29
29
  onPressEnd = props.onPressEnd,
30
30
  onPressChange = props.onPressChange,
31
31
  onPressUp = props.onPressUp,
32
- isInteractiveWithin = props.isInteractiveWithin,
32
+ _props$isInteractiveW = props.isInteractiveWithin,
33
+ isInteractiveWithin = _props$isInteractiveW === void 0 ? true : _props$isInteractiveW,
33
34
  isSelected = props.isSelected,
34
35
  others = _objectWithoutProperties(props, _excluded);
35
36
  var cardRef = useLocalOrForwardRef(ref);
@@ -66,8 +67,6 @@ var Card = /*#__PURE__*/forwardRef(function (props, ref) {
66
67
  }),
67
68
  classNames = _useStatusClasses.classNames;
68
69
  var ariaLabel = props['aria-label'];
69
-
70
- // TODO: [Astro 3.0.0] Update isInteractiveWithin[default] for this prop to true
71
70
  var mergedProps = mergeProps(others, focusWithinProps, !isInteractiveWithin ? _objectSpread(_objectSpread(_objectSpread({}, pressProps), hoverProps), focusProps) : {});
72
71
  return ___EmotionJSX(Box, _extends({
73
72
  "aria-label": ariaLabel,
@@ -47,8 +47,7 @@ Default.parameters = {
47
47
  export var HeaderAndFooter = function HeaderAndFooter(args) {
48
48
  var textStyling = {
49
49
  fontSize: 'md',
50
- fontWeight: 600,
51
- color: 'text.secondary'
50
+ fontWeight: 600
52
51
  };
53
52
  return ___EmotionJSX(Card, _extends({}, args, {
54
53
  variant: "cards.flat",
@@ -151,7 +150,8 @@ export var InteractiveCard = function InteractiveCard(args) {
151
150
  },
152
151
  tabIndex: "0",
153
152
  variant: "cards.interactive",
154
- sx: sx
153
+ sx: sx,
154
+ isInteractiveWithin: false
155
155
  }), "Interactive Card");
156
156
  };
157
157
  InteractiveCard.parameters = {
@@ -169,7 +169,7 @@ export var WithInteractiveContent = function WithInteractiveContent(args) {
169
169
  width: "300px"
170
170
  }));
171
171
  };
172
- export var ActiveCard = function ActiveCard(args) {
172
+ export var RadioGroupCard = function RadioGroupCard(args) {
173
173
  var sx = {
174
174
  alignContent: 'center',
175
175
  height: '221px',
@@ -188,6 +188,7 @@ export var ActiveCard = function ActiveCard(args) {
188
188
  isSelected: isSelected,
189
189
  onPress: function onPress() {
190
190
  return setIsSelected(!isSelected);
191
- }
191
+ },
192
+ isInteractiveWithin: false
192
193
  }), "Active Card");
193
194
  };
@@ -54,7 +54,8 @@ test('card allows hover, focus, and press events', function () {
54
54
  getComponent({
55
55
  children: children,
56
56
  onPress: onPress,
57
- tabIndex: 0
57
+ tabIndex: 0,
58
+ isInteractiveWithin: false
58
59
  });
59
60
  var card = screen.getByTestId(testId);
60
61
  expect(card).not.toHaveClass('is-hovered');
@@ -1,4 +1,6 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["onFocusChange"];
2
4
  import React from 'react';
3
5
  import ChevronLeftIcon from '@pingux/mdi-react/ChevronLeftIcon';
4
6
  import ChevronRightIcon from '@pingux/mdi-react/ChevronRightIcon';
@@ -19,7 +21,19 @@ var RangeCalendarHeader = function RangeCalendarHeader(props) {
19
21
 
20
22
  // to remove warning for unknown event handler property `onFocusChange`.
21
23
  delete prevButtonProps.onFocusChange;
22
- delete nextButtonProps.onFocusChange;
24
+ // Removes warning without Safari losing Spectrum’s focus management
25
+ var onFocusChange = nextButtonProps.onFocusChange,
26
+ otherNextButtonProps = _objectWithoutProperties(nextButtonProps, _excluded);
27
+
28
+ /* istanbul ignore next */
29
+ var nextButtonFocusProps = {
30
+ onFocus: function onFocus() {
31
+ return onFocusChange === null || onFocusChange === void 0 ? void 0 : onFocusChange(true);
32
+ },
33
+ onBlur: function onBlur() {
34
+ return onFocusChange === null || onFocusChange === void 0 ? void 0 : onFocusChange(false);
35
+ }
36
+ };
23
37
  return ___EmotionJSX(Box, {
24
38
  variant: "rangeCalendar.calendarHeaderContainer",
25
39
  isRow: true
@@ -63,7 +77,7 @@ var RangeCalendarHeader = function RangeCalendarHeader(props) {
63
77
  position: 'absolute',
64
78
  right: '10px'
65
79
  }
66
- }, ___EmotionJSX(IconButton, _extends({}, nextButtonProps, {
80
+ }, ___EmotionJSX(IconButton, _extends({}, otherNextButtonProps, nextButtonFocusProps, {
67
81
  "aria-label": "Next month navigation"
68
82
  }), ___EmotionJSX(Icon, {
69
83
  icon: ChevronRightIcon,
@@ -29,7 +29,8 @@ var interactive = {
29
29
  };
30
30
  var container = _objectSpread(_objectSpread({}, flat), {}, {
31
31
  p: 'lg',
32
- borderColor: 'border.base'
32
+ borderColor: 'border.base',
33
+ lineHeight: 1.6
33
34
  });
34
35
  var dark = _objectSpread(_objectSpread({}, flat), {}, {
35
36
  border: 'none',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.140.0",
3
+ "version": "2.141.0-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",