@pingux/astro 1.26.1-alpha.0 → 1.26.1-alpha.3
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/lib/cjs/components/AccordionGroup/AccordionGroup.js +2 -6
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +0 -16
- package/lib/cjs/recipes/Arrow.stories.js +17 -13
- package/lib/components/AccordionGroup/AccordionGroup.js +2 -6
- package/lib/components/AccordionGroup/AccordionGroup.test.js +0 -13
- package/lib/recipes/Arrow.stories.js +17 -13
- package/package.json +1 -1
@@ -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 = ["
|
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
|
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
|
-
|
31
|
-
width: 80,
|
32
|
-
sx: {
|
33
|
-
'align-items': 'center'
|
34
|
-
}
|
45
|
+
sx: sx.wrapper
|
35
46
|
}, (0, _react2.jsx)(_Box["default"], {
|
36
|
-
|
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));
|
@@ -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 = ["
|
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
|
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
|
-
|
13
|
-
width: 80,
|
14
|
-
sx: {
|
15
|
-
'align-items': 'center'
|
16
|
-
}
|
27
|
+
sx: sx.wrapper
|
17
28
|
}, ___EmotionJSX(Box, {
|
18
|
-
|
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));
|