@pingux/astro 1.42.0 → 1.42.1-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.
- package/lib/cjs/components/Stepper/Step.js +5 -8
- package/lib/cjs/components/Stepper/Stepper.js +4 -8
- package/lib/cjs/components/Stepper/Stepper.stories.js +8 -6
- package/lib/cjs/components/Stepper/Stepper.test.js +3 -3
- package/lib/cjs/index.js +8 -0
- package/lib/components/Stepper/Step.js +3 -4
- package/lib/components/Stepper/Stepper.js +2 -4
- package/lib/components/Stepper/Stepper.stories.js +8 -7
- package/lib/components/Stepper/Stepper.test.js +3 -3
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/NOTICE.html +0 -4707
@@ -14,7 +14,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
14
14
|
value: true
|
15
15
|
});
|
16
16
|
|
17
|
-
exports["default"] =
|
17
|
+
exports["default"] = void 0;
|
18
18
|
|
19
19
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
20
20
|
|
@@ -28,8 +28,6 @@ var _CheckBoldIcon = _interopRequireDefault(require("mdi-react/CheckBoldIcon"));
|
|
28
28
|
|
29
29
|
var _interactions = require("@react-aria/interactions");
|
30
30
|
|
31
|
-
var _collections = require("@react-stately/collections");
|
32
|
-
|
33
31
|
var _Stepper = require("./Stepper.constants");
|
34
32
|
|
35
33
|
var _index = require("../../index");
|
@@ -42,7 +40,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
42
40
|
|
43
41
|
var COMPLETED = _Stepper.stepStatuses.COMPLETED,
|
44
42
|
INACTIVE = _Stepper.stepStatuses.INACTIVE;
|
45
|
-
var
|
43
|
+
var Step = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
46
44
|
var status = props.status,
|
47
45
|
value = props.value;
|
48
46
|
|
@@ -59,14 +57,13 @@ var CollectionStep = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
59
57
|
color: "text.primaryLight"
|
60
58
|
}) : value);
|
61
59
|
});
|
62
|
-
|
63
|
-
CollectionStep.propTypes = {
|
60
|
+
Step.propTypes = {
|
64
61
|
status: _propTypes["default"].oneOf((0, _values["default"])(_Stepper.stepStatuses)),
|
65
62
|
value: _propTypes["default"].number
|
66
63
|
};
|
67
|
-
|
64
|
+
Step.defaultProps = {
|
68
65
|
status: INACTIVE,
|
69
66
|
value: 0
|
70
67
|
};
|
71
|
-
var _default =
|
68
|
+
var _default = Step;
|
72
69
|
exports["default"] = _default;
|
@@ -50,14 +50,10 @@ var _isValidPositiveInt = _interopRequireDefault(require("../../utils/devUtils/p
|
|
50
50
|
|
51
51
|
var _Stepper = require("./Stepper.constants");
|
52
52
|
|
53
|
-
var
|
53
|
+
var _ = require("../..");
|
54
54
|
|
55
55
|
var _Line = _interopRequireDefault(require("./Line"));
|
56
56
|
|
57
|
-
var _Tab = _interopRequireDefault(require("../Tab"));
|
58
|
-
|
59
|
-
var _Tabs = _interopRequireDefault(require("../Tabs"));
|
60
|
-
|
61
57
|
var _react2 = require("@emotion/react");
|
62
58
|
|
63
59
|
var _excluded = ["activeStep", "onStepChange", "tabListProps"];
|
@@ -113,14 +109,14 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
113
109
|
var render = (0, _map["default"])(steps).call(steps, function (item, i) {
|
114
110
|
var stepIndex = i + 1;
|
115
111
|
var stepStatus = getStatus(stepIndex);
|
116
|
-
var step = (0, _react2.jsx)(
|
112
|
+
var step = (0, _react2.jsx)(_.Step, {
|
117
113
|
key: item.key,
|
118
114
|
value: stepIndex,
|
119
115
|
status: stepStatus
|
120
116
|
});
|
121
117
|
var line = (0, _react2.jsx)(_react["default"].Fragment, null, (0, _isArray["default"])(lines) ? lines[i - 1] : lines);
|
122
118
|
var textValue = item && item.value && item.value.label || item.textValue || stepIndex.toString();
|
123
|
-
var container = (0, _react2.jsx)(
|
119
|
+
var container = (0, _react2.jsx)(_.Tab, {
|
124
120
|
key: stepIndex,
|
125
121
|
variant: "stepper.tab",
|
126
122
|
tabLineProps: {
|
@@ -138,7 +134,7 @@ var Stepper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
138
134
|
isFirst = isFirst && !container;
|
139
135
|
return container;
|
140
136
|
});
|
141
|
-
return (0, _react2.jsx)(
|
137
|
+
return (0, _react2.jsx)(_.Tabs, (0, _extends2["default"])({
|
142
138
|
ref: ref,
|
143
139
|
variant: "stepper.wrapper",
|
144
140
|
tabListProps: _objectSpread({
|
@@ -20,6 +20,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/hel
|
|
20
20
|
|
21
21
|
var _react = _interopRequireWildcard(require("react"));
|
22
22
|
|
23
|
+
var _collections = require("@react-stately/collections");
|
24
|
+
|
23
25
|
var _index = require("../../index");
|
24
26
|
|
25
27
|
var _react2 = require("@emotion/react");
|
@@ -89,12 +91,12 @@ var steps = [{
|
|
89
91
|
}];
|
90
92
|
|
91
93
|
var Default = function Default(args) {
|
92
|
-
return (0, _react2.jsx)(_index.Stepper, args, (0, _react2.jsx)(
|
94
|
+
return (0, _react2.jsx)(_index.Stepper, args, (0, _react2.jsx)(_collections.Item, {
|
93
95
|
key: "step1",
|
94
96
|
textValue: "Step 1"
|
95
97
|
}, (0, _react2.jsx)(_index.Text, {
|
96
98
|
pt: "lg"
|
97
|
-
}, "This is content for step 1")), (0, _react2.jsx)(
|
99
|
+
}, "This is content for step 1")), (0, _react2.jsx)(_collections.Item, {
|
98
100
|
key: "step2",
|
99
101
|
textValue: "Step 2"
|
100
102
|
}, (0, _react2.jsx)(_index.Text, {
|
@@ -120,7 +122,7 @@ var ControlledStepper = function ControlledStepper() {
|
|
120
122
|
activeStep: activeStep,
|
121
123
|
onStepChange: setActiveStep
|
122
124
|
}, function (item) {
|
123
|
-
return (0, _react2.jsx)(
|
125
|
+
return (0, _react2.jsx)(_collections.Item, {
|
124
126
|
key: item.name,
|
125
127
|
textValue: item.name
|
126
128
|
}, (0, _react2.jsx)(_index.Text, {
|
@@ -132,13 +134,13 @@ var ControlledStepper = function ControlledStepper() {
|
|
132
134
|
exports.ControlledStepper = ControlledStepper;
|
133
135
|
|
134
136
|
var WithoutContent = function WithoutContent() {
|
135
|
-
return (0, _react2.jsx)(_index.Stepper, null, (0, _react2.jsx)(
|
137
|
+
return (0, _react2.jsx)(_index.Stepper, null, (0, _react2.jsx)(_collections.Item, {
|
136
138
|
key: "step1",
|
137
139
|
textValue: "Step 1"
|
138
|
-
}), (0, _react2.jsx)(
|
140
|
+
}), (0, _react2.jsx)(_collections.Item, {
|
139
141
|
key: "step2",
|
140
142
|
textValue: "Step 2"
|
141
|
-
}), (0, _react2.jsx)(
|
143
|
+
}), (0, _react2.jsx)(_collections.Item, {
|
142
144
|
key: "step3",
|
143
145
|
textValue: "Step 3"
|
144
146
|
}));
|
@@ -24,6 +24,8 @@ var _react2 = require("@emotion/react");
|
|
24
24
|
|
25
25
|
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
26
26
|
|
27
|
+
var _collections = require("@react-stately/collections");
|
28
|
+
|
27
29
|
var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
|
28
30
|
|
29
31
|
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
@@ -32,8 +34,6 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
32
34
|
|
33
35
|
var _Stepper = _interopRequireDefault(require("./Stepper"));
|
34
36
|
|
35
|
-
var _Step = _interopRequireDefault(require("./Step"));
|
36
|
-
|
37
37
|
// Emotion Cache added as test fails otherwise, root cause of this failure is unknown.
|
38
38
|
// Failure occured with ThemeUI refactor.
|
39
39
|
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-557726922
|
@@ -73,7 +73,7 @@ var getComponent = function getComponent() {
|
|
73
73
|
}, (0, _react2.jsx)(_Stepper["default"], (0, _extends2["default"])({}, defaultProps, props), function (_ref2) {
|
74
74
|
var name = _ref2.name,
|
75
75
|
children = _ref2.children;
|
76
|
-
return (0, _react2.jsx)(
|
76
|
+
return (0, _react2.jsx)(_collections.Item, {
|
77
77
|
key: name || children,
|
78
78
|
textValue: name || children
|
79
79
|
}, (0, _react2.jsx)(_Text["default"], null, children));
|
package/lib/cjs/index.js
CHANGED
@@ -88,6 +88,7 @@ var _exportNames = {
|
|
88
88
|
SelectField: true,
|
89
89
|
Separator: true,
|
90
90
|
Stepper: true,
|
91
|
+
Step: true,
|
91
92
|
Switch: true,
|
92
93
|
SwitchField: true,
|
93
94
|
Tab: true,
|
@@ -643,6 +644,13 @@ _Object$defineProperty(exports, "Separator", {
|
|
643
644
|
}
|
644
645
|
});
|
645
646
|
|
647
|
+
_Object$defineProperty(exports, "Step", {
|
648
|
+
enumerable: true,
|
649
|
+
get: function get() {
|
650
|
+
return _Stepper.Step;
|
651
|
+
}
|
652
|
+
});
|
653
|
+
|
646
654
|
_Object$defineProperty(exports, "Stepper", {
|
647
655
|
enumerable: true,
|
648
656
|
get: function get() {
|
@@ -4,13 +4,12 @@ import React, { forwardRef } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import CheckBoldIcon from 'mdi-react/CheckBoldIcon';
|
6
6
|
import { useHover } from '@react-aria/interactions';
|
7
|
-
import { Item as Step } from '@react-stately/collections';
|
8
7
|
import { stepStatuses } from './Stepper.constants';
|
9
8
|
import { Box, Icon } from '../../index';
|
10
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
11
10
|
var COMPLETED = stepStatuses.COMPLETED,
|
12
11
|
INACTIVE = stepStatuses.INACTIVE;
|
13
|
-
|
12
|
+
var Step = /*#__PURE__*/forwardRef(function (props, ref) {
|
14
13
|
var status = props.status,
|
15
14
|
value = props.value;
|
16
15
|
|
@@ -27,11 +26,11 @@ export var CollectionStep = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
27
26
|
color: "text.primaryLight"
|
28
27
|
}) : value);
|
29
28
|
});
|
30
|
-
|
29
|
+
Step.propTypes = {
|
31
30
|
status: PropTypes.oneOf(_Object$values(stepStatuses)),
|
32
31
|
value: PropTypes.number
|
33
32
|
};
|
34
|
-
|
33
|
+
Step.defaultProps = {
|
35
34
|
status: INACTIVE,
|
36
35
|
value: 0
|
37
36
|
};
|
@@ -23,10 +23,8 @@ import PropTypes from 'prop-types';
|
|
23
23
|
import { useSingleSelectListState } from '@react-stately/list';
|
24
24
|
import isValidPositiveInt from '../../utils/devUtils/props/isValidPositiveInt';
|
25
25
|
import { stepStatuses } from './Stepper.constants';
|
26
|
-
import {
|
26
|
+
import { Step, Tab, Tabs } from '../..';
|
27
27
|
import Line from './Line';
|
28
|
-
import Tab from '../Tab';
|
29
|
-
import Tabs from '../Tabs';
|
30
28
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
31
29
|
var ACTIVE = stepStatuses.ACTIVE,
|
32
30
|
COMPLETED = stepStatuses.COMPLETED,
|
@@ -75,7 +73,7 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
75
73
|
var stepIndex = i + 1;
|
76
74
|
var stepStatus = getStatus(stepIndex);
|
77
75
|
|
78
|
-
var step = ___EmotionJSX(
|
76
|
+
var step = ___EmotionJSX(Step, {
|
79
77
|
key: item.key,
|
80
78
|
value: stepIndex,
|
81
79
|
status: stepStatus
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
2
|
import React, { useState } from 'react';
|
3
|
-
import {
|
3
|
+
import { Item } from '@react-stately/collections';
|
4
|
+
import { Stepper, Text } from '../../index';
|
4
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
5
6
|
export default {
|
6
7
|
title: 'Components/Stepper',
|
@@ -61,12 +62,12 @@ var steps = [{
|
|
61
62
|
name: 'step3'
|
62
63
|
}];
|
63
64
|
export var Default = function Default(args) {
|
64
|
-
return ___EmotionJSX(Stepper, args, ___EmotionJSX(
|
65
|
+
return ___EmotionJSX(Stepper, args, ___EmotionJSX(Item, {
|
65
66
|
key: "step1",
|
66
67
|
textValue: "Step 1"
|
67
68
|
}, ___EmotionJSX(Text, {
|
68
69
|
pt: "lg"
|
69
|
-
}, "This is content for step 1")), ___EmotionJSX(
|
70
|
+
}, "This is content for step 1")), ___EmotionJSX(Item, {
|
70
71
|
key: "step2",
|
71
72
|
textValue: "Step 2"
|
72
73
|
}, ___EmotionJSX(Text, {
|
@@ -89,7 +90,7 @@ export var ControlledStepper = function ControlledStepper() {
|
|
89
90
|
activeStep: activeStep,
|
90
91
|
onStepChange: setActiveStep
|
91
92
|
}, function (item) {
|
92
|
-
return ___EmotionJSX(
|
93
|
+
return ___EmotionJSX(Item, {
|
93
94
|
key: item.name,
|
94
95
|
textValue: item.name
|
95
96
|
}, ___EmotionJSX(Text, {
|
@@ -98,13 +99,13 @@ export var ControlledStepper = function ControlledStepper() {
|
|
98
99
|
});
|
99
100
|
};
|
100
101
|
export var WithoutContent = function WithoutContent() {
|
101
|
-
return ___EmotionJSX(Stepper, null, ___EmotionJSX(
|
102
|
+
return ___EmotionJSX(Stepper, null, ___EmotionJSX(Item, {
|
102
103
|
key: "step1",
|
103
104
|
textValue: "Step 1"
|
104
|
-
}), ___EmotionJSX(
|
105
|
+
}), ___EmotionJSX(Item, {
|
105
106
|
key: "step2",
|
106
107
|
textValue: "Step 2"
|
107
|
-
}), ___EmotionJSX(
|
108
|
+
}), ___EmotionJSX(Item, {
|
108
109
|
key: "step3",
|
109
110
|
textValue: "Step 3"
|
110
111
|
}));
|
@@ -9,11 +9,11 @@ import React from 'react';
|
|
9
9
|
import userEvent from '@testing-library/user-event';
|
10
10
|
import { CacheProvider } from '@emotion/react';
|
11
11
|
import createCache from '@emotion/cache';
|
12
|
+
import { Item } from '@react-stately/collections';
|
12
13
|
import axeTest from '../../utils/testUtils/testAxe';
|
13
14
|
import { render, screen, fireEvent } from '../../utils/testUtils/testWrapper';
|
14
15
|
import Text from '../Text';
|
15
|
-
import Stepper from './Stepper';
|
16
|
-
import Step from './Step'; // Emotion Cache added as test fails otherwise, root cause of this failure is unknown.
|
16
|
+
import Stepper from './Stepper'; // Emotion Cache added as test fails otherwise, root cause of this failure is unknown.
|
17
17
|
// Failure occured with ThemeUI refactor.
|
18
18
|
// https://github.com/emotion-js/emotion/issues/1105#issuecomment-557726922
|
19
19
|
|
@@ -54,7 +54,7 @@ var getComponent = function getComponent() {
|
|
54
54
|
}, ___EmotionJSX(Stepper, _extends({}, defaultProps, props), function (_ref2) {
|
55
55
|
var name = _ref2.name,
|
56
56
|
children = _ref2.children;
|
57
|
-
return ___EmotionJSX(
|
57
|
+
return ___EmotionJSX(Item, {
|
58
58
|
key: name || children,
|
59
59
|
textValue: name || children
|
60
60
|
}, ___EmotionJSX(Text, null, children));
|
package/lib/index.js
CHANGED
@@ -122,7 +122,7 @@ export { default as SelectField } from './components/SelectField';
|
|
122
122
|
export * from './components/SelectField';
|
123
123
|
export { default as Separator } from './components/Separator';
|
124
124
|
export * from './components/Separator';
|
125
|
-
export { default as Stepper } from './components/Stepper';
|
125
|
+
export { default as Stepper, Step } from './components/Stepper';
|
126
126
|
export * from './components/Stepper';
|
127
127
|
export { default as Switch } from './components/Switch';
|
128
128
|
export * from './components/Switch';
|