@pingux/astro 1.26.1-alpha.1 → 1.26.1-alpha.4

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.
@@ -42,7 +42,7 @@ var _isIterable = require("../../utils/devUtils/props/isIterable");
42
42
 
43
43
  var _react2 = require("@emotion/react");
44
44
 
45
- var _excluded = ["onPress", "onExpandedChange"];
45
+ var _excluded = ["onExpandedChange"];
46
46
 
47
47
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
48
48
 
@@ -59,8 +59,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
59
59
  var AccordionGroup = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
60
60
  var _context;
61
61
 
62
- var onPress = props.onPress,
63
- onExpandedChange = props.onExpandedChange,
62
+ var onExpandedChange = props.onExpandedChange,
64
63
  others = (0, _objectWithoutProperties2["default"])(props, _excluded);
65
64
  var state = (0, _tree.useTreeState)(props);
66
65
  var accordionRef = (0, _react.useRef)();
@@ -90,9 +89,6 @@ AccordionGroup.propTypes = {
90
89
  /** Handler that is called when items are expanded or collapsed. */
91
90
  onExpandedChange: _propTypes["default"].func,
92
91
 
93
- /** Handler that is called when the press is released over the target. */
94
- onPress: _propTypes["default"].func,
95
-
96
92
  /** Item objects in the collection. */
97
93
  items: _isIterable.isIterableProp,
98
94
 
@@ -81,22 +81,6 @@ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
81
81
  }
82
82
  }
83
83
  });
84
- test('button press', function () {
85
- var onPress = jest.fn();
86
- getComponent({
87
- onPress: onPress
88
- });
89
-
90
- var buttons = _testWrapper.screen.getAllByRole('button');
91
-
92
- var selectedItem = buttons[0];
93
- expect(selectedItem).not.toHaveClass('is-pressed');
94
- expect(onPress).not.toHaveBeenCalled(); // Hold down the button to see pressed styles
95
-
96
- _testWrapper.fireEvent.mouseDown(selectedItem);
97
-
98
- expect(selectedItem).toHaveClass('is-pressed');
99
- });
100
84
  test('button press uses callback', function () {
101
85
  var onPress = jest.fn();
102
86
  getComponent({
@@ -23,24 +23,28 @@ var _default = {
23
23
  };
24
24
  exports["default"] = _default;
25
25
  var ArrowIcon = "\u25BA";
26
+ var sx = {
27
+ wrapper: {
28
+ height: '8px',
29
+ width: '80px',
30
+ alignItems: 'center'
31
+ },
32
+ arrowLine: {
33
+ width: '100%',
34
+ // Use this instead of border property, to avoid cropping of strokes in Safari and FF
35
+ backgroundImage: "linear-gradient(to right, ".concat(_colors.line.light, " 50%, white 50%)"),
36
+ backgroundRepeat: 'repeat-x',
37
+ backgroundSize: '10px 2px',
38
+ height: '2px'
39
+ }
40
+ };
26
41
 
27
42
  var Default = function Default() {
28
43
  return (0, _react2.jsx)(_Box["default"], {
29
44
  isRow: true,
30
- height: 8,
31
- width: 80,
32
- sx: {
33
- 'align-items': 'center'
34
- }
45
+ sx: sx.wrapper
35
46
  }, (0, _react2.jsx)(_Box["default"], {
36
- width: "100%" // Use this instead of border property, to avoid cropping of strokes in Safari and FF
37
- ,
38
- sx: {
39
- backgroundImage: "linear-gradient(to right, ".concat(_colors.line.light, " 50%, white 50%)"),
40
- backgroundRepeat: 'repeat-x',
41
- backgroundSize: '10px 2px',
42
- height: 2
43
- }
47
+ sx: sx.arrowLine
44
48
  }), (0, _react2.jsx)(_Box["default"], {
45
49
  color: "line.regular"
46
50
  }, ArrowIcon));
@@ -24,18 +24,21 @@ var _default = {
24
24
  title: 'Recipes/StatsCircle'
25
25
  };
26
26
  exports["default"] = _default;
27
+ var sx = {
28
+ statsCircle: {
29
+ border: '3px solid',
30
+ borderColor: _colors.active,
31
+ borderRadius: '100%',
32
+ alignItems: 'center',
33
+ justifyContent: 'center'
34
+ }
35
+ };
27
36
 
28
37
  var Default = function Default() {
29
38
  return (0, _react2.jsx)(_Box["default"], {
30
39
  width: "110px",
31
40
  height: "110px",
32
- sx: {
33
- 'border': '3px solid',
34
- 'borderColor': _colors.active,
35
- 'borderRadius': '100%',
36
- 'alignItems': 'center',
37
- 'justifyContent': 'center'
38
- }
41
+ sx: sx.statsCircle
39
42
  }, (0, _react2.jsx)(_Text["default"], {
40
43
  fontSize: 30
41
44
  }, "63"), (0, _react2.jsx)(_Text["default"], {
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
3
3
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
4
4
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["onPress", "onExpandedChange"];
5
+ var _excluded = ["onExpandedChange"];
6
6
  import React, { forwardRef, useRef, useImperativeHandle } from 'react';
7
7
  import { useAccordion } from '@react-aria/accordion';
8
8
  import { useTreeState } from '@react-stately/tree';
@@ -24,8 +24,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
24
24
  var AccordionGroup = /*#__PURE__*/forwardRef(function (props, ref) {
25
25
  var _context;
26
26
 
27
- var onPress = props.onPress,
28
- onExpandedChange = props.onExpandedChange,
27
+ var onExpandedChange = props.onExpandedChange,
29
28
  others = _objectWithoutProperties(props, _excluded);
30
29
 
31
30
  var state = useTreeState(props);
@@ -56,9 +55,6 @@ AccordionGroup.propTypes = {
56
55
  /** Handler that is called when items are expanded or collapsed. */
57
56
  onExpandedChange: PropTypes.func,
58
57
 
59
- /** Handler that is called when the press is released over the target. */
60
- onPress: PropTypes.func,
61
-
62
58
  /** Item objects in the collection. */
63
59
  items: isIterableProp,
64
60
 
@@ -66,19 +66,6 @@ axeTest(getComponent, {
66
66
  }
67
67
  }
68
68
  });
69
- test('button press', function () {
70
- var onPress = jest.fn();
71
- getComponent({
72
- onPress: onPress
73
- });
74
- var buttons = screen.getAllByRole('button');
75
- var selectedItem = buttons[0];
76
- expect(selectedItem).not.toHaveClass('is-pressed');
77
- expect(onPress).not.toHaveBeenCalled(); // Hold down the button to see pressed styles
78
-
79
- fireEvent.mouseDown(selectedItem);
80
- expect(selectedItem).toHaveClass('is-pressed');
81
- });
82
69
  test('button press uses callback', function () {
83
70
  var onPress = jest.fn();
84
71
  getComponent({
@@ -6,23 +6,27 @@ export default {
6
6
  title: 'Recipes/Arrow'
7
7
  };
8
8
  var ArrowIcon = "\u25BA";
9
+ var sx = {
10
+ wrapper: {
11
+ height: '8px',
12
+ width: '80px',
13
+ alignItems: 'center'
14
+ },
15
+ arrowLine: {
16
+ width: '100%',
17
+ // Use this instead of border property, to avoid cropping of strokes in Safari and FF
18
+ backgroundImage: "linear-gradient(to right, ".concat(line.light, " 50%, white 50%)"),
19
+ backgroundRepeat: 'repeat-x',
20
+ backgroundSize: '10px 2px',
21
+ height: '2px'
22
+ }
23
+ };
9
24
  export var Default = function Default() {
10
25
  return ___EmotionJSX(Box, {
11
26
  isRow: true,
12
- height: 8,
13
- width: 80,
14
- sx: {
15
- 'align-items': 'center'
16
- }
27
+ sx: sx.wrapper
17
28
  }, ___EmotionJSX(Box, {
18
- width: "100%" // Use this instead of border property, to avoid cropping of strokes in Safari and FF
19
- ,
20
- sx: {
21
- backgroundImage: "linear-gradient(to right, ".concat(line.light, " 50%, white 50%)"),
22
- backgroundRepeat: 'repeat-x',
23
- backgroundSize: '10px 2px',
24
- height: 2
25
- }
29
+ sx: sx.arrowLine
26
30
  }), ___EmotionJSX(Box, {
27
31
  color: "line.regular"
28
32
  }, ArrowIcon));
@@ -6,17 +6,20 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
6
6
  export default {
7
7
  title: 'Recipes/StatsCircle'
8
8
  };
9
+ var sx = {
10
+ statsCircle: {
11
+ border: '3px solid',
12
+ borderColor: active,
13
+ borderRadius: '100%',
14
+ alignItems: 'center',
15
+ justifyContent: 'center'
16
+ }
17
+ };
9
18
  export var Default = function Default() {
10
19
  return ___EmotionJSX(Box, {
11
20
  width: "110px",
12
21
  height: "110px",
13
- sx: {
14
- 'border': '3px solid',
15
- 'borderColor': active,
16
- 'borderRadius': '100%',
17
- 'alignItems': 'center',
18
- 'justifyContent': 'center'
19
- }
22
+ sx: sx.statsCircle
20
23
  }, ___EmotionJSX(Text, {
21
24
  fontSize: 30
22
25
  }, "63"), ___EmotionJSX(Text, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.26.1-alpha.1",
3
+ "version": "1.26.1-alpha.4",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",